Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 0 additions & 13 deletions .changeset/model-message-durable-compaction.md

This file was deleted.

14 changes: 14 additions & 0 deletions packages/ai-sdk-middleware/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# @context-chef/ai-sdk-middleware

## 1.6.0

### Minor Changes

- [#40](https://github.com/MyPrototypeWhat/context-chef/pull/40) [`55d5c27`](https://github.com/MyPrototypeWhat/context-chef/commit/55d5c2727bbf9117bbb846be8ab7d7d9a4ef47e1) Thanks [@MyPrototypeWhat](https://github.com/MyPrototypeWhat)! - Add ModelMessage-altitude durable compaction.

`compactModelMessages`, `planCompactionModelMessages`, and `summarizeModelMessages` operate on `ModelMessage[]` — the message type `generateText`/`prepareStep` actually use — so you can run durable compaction directly against your own message store, or inside a `ToolLoopAgent` `prepareStep`. They reuse the provider-agnostic core engine, and `compactModelMessages` preserves the no-op reference-identity contract (returns the input array unchanged when there is nothing old enough to compact, so callers can skip persistence).

`createCompressionAdapter` now accepts `ai`'s `LanguageModel` (a model id string, or a V3/V2 model) — matching what `prepareStep`/`generateText` hand you — instead of only `LanguageModelV3`.

Deprecates the `LanguageModelV3Prompt`-typed `compactHistory` / `planCompaction` (still exported and fully working) in favor of the ModelMessage variants; they are slated for removal in the next major. `summarizeMessages` is unchanged.

Also fixes three round-trip issues in both AI-SDK adapters (V3 and ModelMessage): provider-executed (inline) tool-results no longer trigger a spurious `[No tool result available]` placeholder; tool-message-level `providerOptions` (e.g. Anthropic cache control) is now preserved; and a tool-call with `undefined` input serializes to `"{}"` instead of a non-string value.

## 1.5.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-sdk-middleware/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@context-chef/ai-sdk-middleware",
"version": "1.5.2",
"version": "1.6.0",
"type": "module",
"main": "./dist/index.cjs",
"module": "./dist/index.mjs",
Expand Down
Loading