chore: version packages#46
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR was opened by the Changesets release GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated.
Releases
@context-chef/ai-sdk-middleware@2.1.0
Minor Changes
#45
09ba1d6Thanks @MyPrototypeWhat! - Session isolation, lossless-er tool output flattening, and tighter peer ranges.providerOptions: { contextChef: { sessionId } }on each call; calls without asessionIdshare one default session (prior behavior). NewmaxSessionsoption caps concurrently tracked sessions (default 256, LRU-evicted). Previously a middleware created at module scope leaked Janitor state across every conversation it served.stringifyToolOutputno longer silently drops non-text content parts: file/media parts flatten to a[tool result file: <mediaType>]placeholder so compression and truncation see that they exist. The truncator's duplicate text extraction now delegates to the same implementation.>=4/>=7to^4.0.0/^7.0.0. The middleware depends onLanguageModelV4*type shapes from@ai-sdk/providerv4 — an unbounded range would let a future major install silently and fail at runtime.flattenForCompressionfrom@context-chef/core(behavior unchanged).sessionId(empty string, non-string, or a malformedcontextChefnamespace) 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
09ba1d6]:@context-chef/core@3.9.0
Minor Changes
#45
09ba1d6Thanks @MyPrototypeWhat! - Fix Gemini tool call correlation, harden Janitor compression failure paths, and add shared middleware infrastructure.fromGemininow synthesizes tool call IDs with per-name counters spanning the whole conversation and correlates eachfunctionResponseto 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-0suffix — repeat calls of the same tool produced duplicate IDs and misattributed results.logger(defaultconsole) instead, keeping stack traces out of model context.onCompresshook no longer abortscompile(). It is caught and logged vialogger; the compression result is kept. Hooks that follow the documented "must not throw" contract see no behavior change.onBeforeCompress(and the deprecatedonBudgetExceeded) now degrade the same way: a throwing hook is caught, logged vialogger, and treated as if it returnednull— default compression proceeds. Both hooks now share one failure stance: a broken hook never failscompile().Prompts: newgetAttachmentPlaceholder(previously janitor-internal),getToolResultFilePlaceholder, andgetToolResultPartPlaceholder. Formats are unchanged — this gives each convention a single source instead of scattered string literals.SessionPool<T>— a keyed instance pool with LRU eviction, used by the middleware packages to hold one Janitor per conversation.maxSizeis validated (throwsRangeErrorunless a positive integer — a non-positive cap would silently evict every entry on insert, disabling pooling). Companion exportsDEFAULT_SESSION_KEY,normalizeSessionKey, anddedupeConstructionWarningsback the middlewares' shared session-key normalization and construction-nag dedupe.flattenForCompression(messages)— the canonical role-flattening implementation required by thesummarizeHistorycompress-callback contract (tool results → user messages, tool calls → assistant text).OpenAIAdapter.compilereplaces its per-messageJSON.parse(JSON.stringify(...))deep clone with a direct clone that skipsundefinedproperties — same output, no string serialization detour (noticeable with base64 attachments). The clone honorstoJSON, so aDatestill lands as its ISO string.@context-chef/tanstack-ai@0.6.0
Minor Changes
#45
09ba1d6Thanks @MyPrototypeWhat! - Conversation isolation: compression state (fed token usage, compression suppression, the failure circuit breaker) is now tracked perctx.conversationIdinstead of per middleware instance. Calls without aconversationIdshare one default slot (prior behavior). NewmaxSessionsoption 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 reusesflattenForCompressionfrom@context-chef/core(behavior unchanged).An empty-string
conversationIdnow 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
09ba1d6]: