diff --git a/.changeset/ai-sdk-v7-support.md b/.changeset/ai-sdk-v7-support.md deleted file mode 100644 index d75b84b..0000000 --- a/.changeset/ai-sdk-v7-support.md +++ /dev/null @@ -1,31 +0,0 @@ ---- -"@context-chef/ai-sdk-middleware": major ---- - -Support AI SDK v7 (provider spec V4). - -The middleware now targets `ai@>=7` / `@ai-sdk/provider@>=4`: it implements the V4 -language-model middleware spec (`specificationVersion: 'v4'`) and all public types -move from `LanguageModelV3*` to `LanguageModelV4*`. AI SDK v7's `wrapLanguageModel` -rejects a v3-spec middleware, so this is a breaking change that requires AI SDK v7. - -**Migration** - -- On AI SDK v7 (`ai@7`): upgrade to `@context-chef/ai-sdk-middleware@2`. -- Still on AI SDK v6 (`ai@6`): stay on `@context-chef/ai-sdk-middleware@1` — the 1.x - line continues to support the v3 spec. No code change is forced on you. - -**Removed** (deprecated APIs that were slated for removal in the next major): - -- `planCompaction`, `compactHistory`, and the `CompactionPlan` type (the provider-prompt - altitude variants) — use `planCompactionModelMessages` / `compactModelMessages` / - `CompactionPlanModelMessages` at the `ModelMessage` altitude instead. -- `onBudgetExceeded` on `ContextChefOptions` — use `onBeforeCompress` instead. - -Runtime behavior is unchanged. The only V4 nuance: provider-level `FilePart.data` -became a tagged union (`SharedV4FileData`); the prompt adapter handles it -transparently and the binary/URL payload still round-trips losslessly. - -On v7, durable in-loop compaction via `compactModelMessages` inside a -`ToolLoopAgent` `prepareStep` now persists across steps (AI SDK v7 carries -`prepareStep`-returned messages forward into later steps — v6 did not). diff --git a/packages/ai-sdk-middleware/CHANGELOG.md b/packages/ai-sdk-middleware/CHANGELOG.md index 0996480..aed2313 100644 --- a/packages/ai-sdk-middleware/CHANGELOG.md +++ b/packages/ai-sdk-middleware/CHANGELOG.md @@ -1,5 +1,37 @@ # @context-chef/ai-sdk-middleware +## 2.0.0 + +### Major Changes + +- [#43](https://github.com/MyPrototypeWhat/context-chef/pull/43) [`e8ae66a`](https://github.com/MyPrototypeWhat/context-chef/commit/e8ae66a5eca7ed16b56270a0156c63b70abaf142) Thanks [@MyPrototypeWhat](https://github.com/MyPrototypeWhat)! - Support AI SDK v7 (provider spec V4). + + The middleware now targets `ai@>=7` / `@ai-sdk/provider@>=4`: it implements the V4 + language-model middleware spec (`specificationVersion: 'v4'`) and all public types + move from `LanguageModelV3*` to `LanguageModelV4*`. AI SDK v7's `wrapLanguageModel` + rejects a v3-spec middleware, so this is a breaking change that requires AI SDK v7. + + **Migration** + + - On AI SDK v7 (`ai@7`): upgrade to `@context-chef/ai-sdk-middleware@2`. + - Still on AI SDK v6 (`ai@6`): stay on `@context-chef/ai-sdk-middleware@1` — the 1.x + line continues to support the v3 spec. No code change is forced on you. + + **Removed** (deprecated APIs that were slated for removal in the next major): + + - `planCompaction`, `compactHistory`, and the `CompactionPlan` type (the provider-prompt + altitude variants) — use `planCompactionModelMessages` / `compactModelMessages` / + `CompactionPlanModelMessages` at the `ModelMessage` altitude instead. + - `onBudgetExceeded` on `ContextChefOptions` — use `onBeforeCompress` instead. + + Runtime behavior is unchanged. The only V4 nuance: provider-level `FilePart.data` + became a tagged union (`SharedV4FileData`); the prompt adapter handles it + transparently and the binary/URL payload still round-trips losslessly. + + On v7, durable in-loop compaction via `compactModelMessages` inside a + `ToolLoopAgent` `prepareStep` now persists across steps (AI SDK v7 carries + `prepareStep`-returned messages forward into later steps — v6 did not). + ## 1.6.0 ### Minor Changes diff --git a/packages/ai-sdk-middleware/package.json b/packages/ai-sdk-middleware/package.json index 89aad6a..7e12695 100644 --- a/packages/ai-sdk-middleware/package.json +++ b/packages/ai-sdk-middleware/package.json @@ -1,6 +1,6 @@ { "name": "@context-chef/ai-sdk-middleware", - "version": "1.6.0", + "version": "2.0.0", "type": "module", "main": "./dist/index.cjs", "module": "./dist/index.mjs",