From 305a271a1f75832d55919cee364b1ddf2675236b Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" <41898282+github-actions[bot]@users.noreply.github.com> Date: Mon, 13 Jul 2026 05:22:56 +0000 Subject: [PATCH] chore: version packages --- .changeset/great-wolves-shake.md | 11 ----------- .changeset/lucky-pianos-guess.md | 7 ------- .changeset/tidy-moons-search.md | 14 -------------- packages/ai-sdk-middleware/CHANGELOG.md | 17 +++++++++++++++++ packages/ai-sdk-middleware/package.json | 2 +- packages/core/CHANGELOG.md | 15 +++++++++++++++ packages/core/package.json | 2 +- packages/tanstack-ai/CHANGELOG.md | 13 +++++++++++++ packages/tanstack-ai/package.json | 2 +- 9 files changed, 48 insertions(+), 35 deletions(-) delete mode 100644 .changeset/great-wolves-shake.md delete mode 100644 .changeset/lucky-pianos-guess.md delete mode 100644 .changeset/tidy-moons-search.md diff --git a/.changeset/great-wolves-shake.md b/.changeset/great-wolves-shake.md deleted file mode 100644 index f27aaec..0000000 --- a/.changeset/great-wolves-shake.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -"@context-chef/ai-sdk-middleware": minor ---- - -Session isolation, lossless-er tool output flattening, and tighter peer ranges. - -- **Session isolation**: compression state (fed token usage, compression suppression, the failure circuit breaker) is now tracked per session instead of per middleware instance. Pass `providerOptions: { contextChef: { sessionId } }` on each call; calls without a `sessionId` share one default session (prior behavior). New `maxSessions` option caps concurrently tracked sessions (default 256, LRU-evicted). Previously a middleware created at module scope leaked Janitor state across every conversation it served. -- `stringifyToolOutput` no longer silently drops non-text content parts: file/media parts flatten to a `[tool result file: ]` placeholder so compression and truncation see that they exist. The truncator's duplicate text extraction now delegates to the same implementation. -- Tighten peerDependency ranges from `>=4` / `>=7` to `^4.0.0` / `^7.0.0`. The middleware depends on `LanguageModelV4*` type shapes from `@ai-sdk/provider` v4 — an unbounded range would let a future major install silently and fail at runtime. -- Compression flattening now reuses `flattenForCompression` from `@context-chef/core` (behavior unchanged). -- An invalid `sessionId` (empty string, non-string, or a malformed `contextChef` namespace) now warns once and routes to the default session instead of failing silently. The Janitor missing-compression-config nag fires once per middleware instead of once per session. diff --git a/.changeset/lucky-pianos-guess.md b/.changeset/lucky-pianos-guess.md deleted file mode 100644 index f0537d0..0000000 --- a/.changeset/lucky-pianos-guess.md +++ /dev/null @@ -1,7 +0,0 @@ ---- -"@context-chef/tanstack-ai": minor ---- - -Conversation isolation: compression state (fed token usage, compression suppression, the failure circuit breaker) is now tracked per `ctx.conversationId` instead of per middleware instance. Calls without a `conversationId` share one default slot (prior behavior). New `maxSessions` option caps concurrently tracked conversations (default 256, LRU-evicted). Previously a middleware instance reused across chat() calls leaked Janitor state across every conversation it served. Compression flattening now reuses `flattenForCompression` from `@context-chef/core` (behavior unchanged). - -An empty-string `conversationId` now warns once and routes to the default slot (previously it was silently treated as a distinct conversation, diverging from the AI SDK middleware's semantics). The Janitor missing-compression-config nag fires once per middleware instead of once per conversation. diff --git a/.changeset/tidy-moons-search.md b/.changeset/tidy-moons-search.md deleted file mode 100644 index 847f1b3..0000000 --- a/.changeset/tidy-moons-search.md +++ /dev/null @@ -1,14 +0,0 @@ ---- -"@context-chef/core": minor ---- - -Fix Gemini tool call correlation, harden Janitor compression failure paths, and add shared middleware infrastructure. - -- `fromGemini` now synthesizes tool call IDs with per-name counters spanning the whole conversation and correlates each `functionResponse` to the oldest unconsumed call of the same name (FIFO). Previously the correlation state was scoped to a single message, so responses arriving in a later content entry always fell back to the `-0` suffix — repeat calls of the same tool produced duplicate IDs and misattributed results. -- When the compression model throws, the raw error is no longer appended to the LLM-bound fallback summary. It now goes to the configured `logger` (default `console`) instead, keeping stack traces out of model context. -- A throwing/rejecting `onCompress` hook no longer aborts `compile()`. It is caught and logged via `logger`; the compression result is kept. Hooks that follow the documented "must not throw" contract see no behavior change. -- `onBeforeCompress` (and the deprecated `onBudgetExceeded`) now degrade the same way: a throwing hook is caught, logged via `logger`, and treated as if it returned `null` — default compression proceeds. Both hooks now share one failure stance: a broken hook never fails `compile()`. -- The text-placeholder vocabulary is centralized in `Prompts`: new `getAttachmentPlaceholder` (previously janitor-internal), `getToolResultFilePlaceholder`, and `getToolResultPartPlaceholder`. Formats are unchanged — this gives each convention a single source instead of scattered string literals. -- New export `SessionPool` — a keyed instance pool with LRU eviction, used by the middleware packages to hold one Janitor per conversation. `maxSize` is validated (throws `RangeError` unless a positive integer — a non-positive cap would silently evict every entry on insert, disabling pooling). Companion exports `DEFAULT_SESSION_KEY`, `normalizeSessionKey`, and `dedupeConstructionWarnings` back the middlewares' shared session-key normalization and construction-nag dedupe. -- New export `flattenForCompression(messages)` — the canonical role-flattening implementation required by the `summarizeHistory` compress-callback contract (tool results → user messages, tool calls → assistant text). -- `OpenAIAdapter.compile` replaces its per-message `JSON.parse(JSON.stringify(...))` deep clone with a direct clone that skips `undefined` properties — same output, no string serialization detour (noticeable with base64 attachments). The clone honors `toJSON`, so a `Date` still lands as its ISO string. diff --git a/packages/ai-sdk-middleware/CHANGELOG.md b/packages/ai-sdk-middleware/CHANGELOG.md index aed2313..d777bc0 100644 --- a/packages/ai-sdk-middleware/CHANGELOG.md +++ b/packages/ai-sdk-middleware/CHANGELOG.md @@ -1,5 +1,22 @@ # @context-chef/ai-sdk-middleware +## 2.1.0 + +### Minor Changes + +- [#45](https://github.com/MyPrototypeWhat/context-chef/pull/45) [`09ba1d6`](https://github.com/MyPrototypeWhat/context-chef/commit/09ba1d63e2fe3a60db0ee085b878d3317cfa5580) Thanks [@MyPrototypeWhat](https://github.com/MyPrototypeWhat)! - Session isolation, lossless-er tool output flattening, and tighter peer ranges. + + - **Session isolation**: compression state (fed token usage, compression suppression, the failure circuit breaker) is now tracked per session instead of per middleware instance. Pass `providerOptions: { contextChef: { sessionId } }` on each call; calls without a `sessionId` share one default session (prior behavior). New `maxSessions` option caps concurrently tracked sessions (default 256, LRU-evicted). Previously a middleware created at module scope leaked Janitor state across every conversation it served. + - `stringifyToolOutput` no longer silently drops non-text content parts: file/media parts flatten to a `[tool result file: ]` placeholder so compression and truncation see that they exist. The truncator's duplicate text extraction now delegates to the same implementation. + - Tighten peerDependency ranges from `>=4` / `>=7` to `^4.0.0` / `^7.0.0`. The middleware depends on `LanguageModelV4*` type shapes from `@ai-sdk/provider` v4 — an unbounded range would let a future major install silently and fail at runtime. + - Compression flattening now reuses `flattenForCompression` from `@context-chef/core` (behavior unchanged). + - An invalid `sessionId` (empty string, non-string, or a malformed `contextChef` namespace) now warns once and routes to the default session instead of failing silently. The Janitor missing-compression-config nag fires once per middleware instead of once per session. + +### Patch Changes + +- Updated dependencies [[`09ba1d6`](https://github.com/MyPrototypeWhat/context-chef/commit/09ba1d63e2fe3a60db0ee085b878d3317cfa5580)]: + - @context-chef/core@3.9.0 + ## 2.0.0 ### Major Changes diff --git a/packages/ai-sdk-middleware/package.json b/packages/ai-sdk-middleware/package.json index e0a0351..0793429 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": "2.0.0", + "version": "2.1.0", "type": "module", "main": "./dist/index.cjs", "module": "./dist/index.mjs", diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md index da32598..ebbb0c4 100644 --- a/packages/core/CHANGELOG.md +++ b/packages/core/CHANGELOG.md @@ -1,5 +1,20 @@ # context-chef +## 3.9.0 + +### Minor Changes + +- [#45](https://github.com/MyPrototypeWhat/context-chef/pull/45) [`09ba1d6`](https://github.com/MyPrototypeWhat/context-chef/commit/09ba1d63e2fe3a60db0ee085b878d3317cfa5580) Thanks [@MyPrototypeWhat](https://github.com/MyPrototypeWhat)! - Fix Gemini tool call correlation, harden Janitor compression failure paths, and add shared middleware infrastructure. + + - `fromGemini` now synthesizes tool call IDs with per-name counters spanning the whole conversation and correlates each `functionResponse` to the oldest unconsumed call of the same name (FIFO). Previously the correlation state was scoped to a single message, so responses arriving in a later content entry always fell back to the `-0` suffix — repeat calls of the same tool produced duplicate IDs and misattributed results. + - When the compression model throws, the raw error is no longer appended to the LLM-bound fallback summary. It now goes to the configured `logger` (default `console`) instead, keeping stack traces out of model context. + - A throwing/rejecting `onCompress` hook no longer aborts `compile()`. It is caught and logged via `logger`; the compression result is kept. Hooks that follow the documented "must not throw" contract see no behavior change. + - `onBeforeCompress` (and the deprecated `onBudgetExceeded`) now degrade the same way: a throwing hook is caught, logged via `logger`, and treated as if it returned `null` — default compression proceeds. Both hooks now share one failure stance: a broken hook never fails `compile()`. + - The text-placeholder vocabulary is centralized in `Prompts`: new `getAttachmentPlaceholder` (previously janitor-internal), `getToolResultFilePlaceholder`, and `getToolResultPartPlaceholder`. Formats are unchanged — this gives each convention a single source instead of scattered string literals. + - New export `SessionPool` — a keyed instance pool with LRU eviction, used by the middleware packages to hold one Janitor per conversation. `maxSize` is validated (throws `RangeError` unless a positive integer — a non-positive cap would silently evict every entry on insert, disabling pooling). Companion exports `DEFAULT_SESSION_KEY`, `normalizeSessionKey`, and `dedupeConstructionWarnings` back the middlewares' shared session-key normalization and construction-nag dedupe. + - New export `flattenForCompression(messages)` — the canonical role-flattening implementation required by the `summarizeHistory` compress-callback contract (tool results → user messages, tool calls → assistant text). + - `OpenAIAdapter.compile` replaces its per-message `JSON.parse(JSON.stringify(...))` deep clone with a direct clone that skips `undefined` properties — same output, no string serialization detour (noticeable with base64 attachments). The clone honors `toJSON`, so a `Date` still lands as its ISO string. + ## 3.8.0 ### Minor Changes diff --git a/packages/core/package.json b/packages/core/package.json index 5dbc834..dc5a4a8 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@context-chef/core", - "version": "3.8.0", + "version": "3.9.0", "type": "module", "main": "./dist/index.cjs", "module": "./dist/index.mjs", diff --git a/packages/tanstack-ai/CHANGELOG.md b/packages/tanstack-ai/CHANGELOG.md index eb46d73..6fec140 100644 --- a/packages/tanstack-ai/CHANGELOG.md +++ b/packages/tanstack-ai/CHANGELOG.md @@ -1,5 +1,18 @@ # @context-chef/tanstack-ai +## 0.6.0 + +### Minor Changes + +- [#45](https://github.com/MyPrototypeWhat/context-chef/pull/45) [`09ba1d6`](https://github.com/MyPrototypeWhat/context-chef/commit/09ba1d63e2fe3a60db0ee085b878d3317cfa5580) Thanks [@MyPrototypeWhat](https://github.com/MyPrototypeWhat)! - Conversation isolation: compression state (fed token usage, compression suppression, the failure circuit breaker) is now tracked per `ctx.conversationId` instead of per middleware instance. Calls without a `conversationId` share one default slot (prior behavior). New `maxSessions` option caps concurrently tracked conversations (default 256, LRU-evicted). Previously a middleware instance reused across chat() calls leaked Janitor state across every conversation it served. Compression flattening now reuses `flattenForCompression` from `@context-chef/core` (behavior unchanged). + + An empty-string `conversationId` now warns once and routes to the default slot (previously it was silently treated as a distinct conversation, diverging from the AI SDK middleware's semantics). The Janitor missing-compression-config nag fires once per middleware instead of once per conversation. + +### Patch Changes + +- Updated dependencies [[`09ba1d6`](https://github.com/MyPrototypeWhat/context-chef/commit/09ba1d63e2fe3a60db0ee085b878d3317cfa5580)]: + - @context-chef/core@3.9.0 + ## 0.5.2 ### Patch Changes diff --git a/packages/tanstack-ai/package.json b/packages/tanstack-ai/package.json index e15a1b8..763d82a 100644 --- a/packages/tanstack-ai/package.json +++ b/packages/tanstack-ai/package.json @@ -1,6 +1,6 @@ { "name": "@context-chef/tanstack-ai", - "version": "0.5.2", + "version": "0.6.0", "type": "module", "main": "./dist/index.cjs", "module": "./dist/index.mjs",