Skip to content
Source
Sign inSign up
TanStack/ai
Open History to see the last commit

CHANGELOG.md

111 lines6.5 KB

@tanstack/ai-compaction

0.1.11

Patch Changes

0.1.10

Patch Changes

0.1.9

Patch Changes

0.1.8

Patch Changes

  • Updated dependencies [ef0a00f]:
    • @tanstack/ai@0.60.0

0.1.7

Patch Changes

0.1.6

Patch Changes

  • Updated dependencies [796f2b5]:
    • @tanstack/ai@0.58.0

0.1.5

Patch Changes

0.1.4

Patch Changes

0.1.3

Patch Changes

0.1.2

Patch Changes

0.1.1

Patch Changes

  • Updated dependencies [21775ee]:
    • @tanstack/ai@0.53.0

0.1.0

Minor Changes

  • #1235 e04ff6a - Add @tanstack/ai-compaction — context-window compaction as a chat() middleware. withCompaction({ maxTokens, strategy }) runs a pluggable CompactionStrategy before each model call, so compaction is incremental and rolling. Three strategies ship built in: evictOldest (drop old messages, the default), summarizeOldest (replace them with an LLM summary), and clearToolResults (stub old tool output, keep the messages). Combine them with composeStrategies, which escalates through strategies until the transcript is back under budget. Strategies preserve tool-call/result pairing and never touch the system prompt.

  • #1235 e04ff6a - Show compaction in TanStack AI DevTools. withCompaction injects compaction:started, compaction:state, and compaction:ended CUSTOM stream events. State includes before/after counts, the token budget, and dropped vs sent message previews. The chat client re-emits the same three events. The AI panel has a Compaction tab and started/state/ended steps on the iteration.

  • #1235 e04ff6a - Keep canonical chat history separate from compacted provider context. Reuse validated compaction checkpoints through an optional persistence metadata store.

Patch Changes

  • #1235 e04ff6a - Add ctx.emitCustomEvent on chat middleware context. The engine yields CUSTOM chunks while hooks such as onConfig are still running, so a long middleware step can send progress before it finishes. Compaction uses this to emit compaction:started before the strategy returns.
  • Updated dependencies [49fc54c, e04ff6a, e04ff6a]:
    • @tanstack/ai@0.52.0