chore: version packages#28
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/core@3.5.0
Minor Changes
bb35e1fThanks @MyPrototypeWhat! - feat: configurable memory placement (MemoryConfig.memoryPlacement) + Gemini parallel-tool-call fixmemoryPlacement: 'after_system' | 'before_history_tail'New
MemoryConfig.memoryPlacementcontrols where the volatile<memory>data block lands in the compiled payload. Default'after_system'is byte-for-byte compatible with previous behavior. Opt into'before_history_tail'when you use Anthropic prompt caching with cache breakpoints on history — under the default placement, every memory mutation invalidates the entire history cache because Anthropic / Gemini adapters extract everyrole: 'system'message into the top-level system parameter, and downstream cache breakpoints hash that block.'after_system'(default)<memory>data combined into onerole: 'system''before_history_tail'<memory>data appended via the existing tail-injection mechanismWhen
dynamicStatePlacement: 'last_user'is also active, the tail order inside the last user message is: original content →<memory>→<dynamic_state>→<implicit_context>→ anchor line.Caveat — when
compile()is invoked mid-agent-loop (history tail is atoolturn awaiting interpretation), "most recent user" walks back past the tool result(s) to the user turn that kicked off the current tool sequence. The injection lands mid-conversation rather than at the absolute tail. Cache breakpoints placed AFTER that user turn (typical: end-of-history assistant) will see the modified user content and miss. To preserve cache in tool-ending tails, place breakpoints BEFORE the user turn that started the active tool sequence. Same placement convention assetDynamicState({ placement: 'last_user' }).Additions:
Memory.placement: MemoryPlacement— public getter exposing the configured placement for observability.MemoryPlacementtype re-exported from@context-chef/core.Gemini adapter: parallel-tool-call merge (latent bug fix)
GeminiAdapter.compile()now collapses consecutive same-roleContententries before returning the payload. Previously, any IR sequence with parallel tool calls would emit non-canonical Gemini shape — three paralleltoolIR messages map to threerole: 'user'Contents (Gemini's tool-result convention), which is rejected bygenerateContentwith:The canonical Gemini shape for parallel function responses is ONE user
Contentwith multiplefunctionResponseparts (Vertex AI docs; same shape the Google Gen AI SDK constructs in itsautomatic function callingpath). The new merge produces exactly that shape and additionally guards against any other source of adjacent same-role contents (e.g. stripped-thinking empty model turns, caller-supplied malformed IR).Implementation notes:
partsarrays are fresh; innerPartobjects are treated as immutable leaves.@tanstack/ai-gemini'smergeConsecutiveSameRoleMessagesand LangChain'slangchain-google-genai.Users on
@context-chef/ai-sdk-middlewareand@context-chef/tanstack-aiare unaffected by the latent bug — those paths already produce canonical Gemini shape via existing batching (toAISDK's consecutive-tool-message coalescing, TanStack's own merge).Internal API tightening —
Assembler.compile()/AssembleOptionsmarked@internalAssembleOptionsis no longer re-exported from the package barrel. BothAssembleOptions(the interface) andAssembler.compile()(the instance method) now carry@internalJSDoc tags so TypeScript / TypeDoc tool chains exclude them from generated.d.tsand documentation.This makes explicit what was already true in practice:
Assembler.compile()is implementation glue forContextChef.compile()and has no external use case. The Assembler class itself remains exported because its static helpers —orderKeysDeterministicallyandstringifyPayload— are genuine public utilities for callers that need to hash payloads consistently with the compile pipeline (cache-aware logging, custom adapters, etc.).Internal signature changes (under
@internal):AssembleOptions.dynamicStateXml→AssembleOptions.tailXml— the field is general-purpose tail injection, not dynamic-state-specific.AssembleOptions.placementremoved — the assembler no longer gates injection on a placement enum;ContextChef.compile()composes the tail stitch and supplies it only when injection should happen.injectIntoLastUserand intoContextChef.compile()— appended only when dynamic state or implicit context is actually present in the tail.Migration — external callers of
import { type AssembleOptions } from '@context-chef/core'(rare; never advertised) will see a TypeScript error after upgrade. Resolution: useContextChef.compile()rather than invoking the assembler directly. If you have a genuine use case for direct assembler access, please open an issue.Other additions
Prompts.MEMORY_BLOCK_HEADER: 'You recall the following from previous conversations:'— extracted constant referenced by bothPrompts.getMemoryBlockandContextChef.compile()'s anchor-suppression logic. Makes the self-anchor contract explicit so future changes to the memory block prefix can't silently break anchor suppression for memory-only tail injections.@context-chef/ai-sdk-middleware@1.3.5
Patch Changes
bb35e1f]:@context-chef/tanstack-ai@0.4.5
Patch Changes
bb35e1f]: