diff --git a/.changeset/ag-ui-interrupts.md b/.changeset/ag-ui-interrupts.md deleted file mode 100644 index a3a23ff85..000000000 --- a/.changeset/ag-ui-interrupts.md +++ /dev/null @@ -1,21 +0,0 @@ ---- -'@tanstack/ai': minor -'@tanstack/ai-client': minor -'@tanstack/ai-react': minor -'@tanstack/ai-preact': minor -'@tanstack/ai-solid': minor -'@tanstack/ai-vue': minor -'@tanstack/ai-svelte': minor -'@tanstack/ai-angular': minor ---- - -Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and -client-tool execution, with typed bound resolvers, atomic batches, and -structured errors. Interrupts run ephemerally by resuming from the full client -message history in a fresh child run — no persistence required. - -This changes native approval and client-tool streams from legacy custom events -to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated -`pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and -legacy event readers remain as limited compatibility surfaces for migration; -`addToolResult` remains supported. diff --git a/.changeset/devtools-memory-inspector.md b/.changeset/devtools-memory-inspector.md deleted file mode 100644 index 5fd1e33aa..000000000 --- a/.changeset/devtools-memory-inspector.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -'@tanstack/ai-memory': minor -'@tanstack/ai-event-client': minor -'@tanstack/ai-client': minor -'@tanstack/ai-devtools-core': minor ---- - -**Surface server-side memory state in the TanStack AI DevTools.** - -The DevTools panel now has a **Memory** tab for any chat wired with -`memoryMiddleware`. It shows, per scope (session), an operations timeline (each -turn's recall — query, fragment count, injected system-prompt size, whether -memory tools were exposed, duration) and the current stored records/facts when -the adapter implements the optional `inspect`/`listFacts` methods. - -Because memory runs on the server (whose event bus never reaches the browser), -the middleware transports its state to the panel over the chat stream as a -`memory:state` `CUSTOM` event, which `@tanstack/ai-client`'s devtools bridge -re-emits as browser `memory:*` events — the same pattern generation results use. -The snapshot reflects memory as of the start of each turn; opening the panel -mid-conversation replays the latest state so the tab isn't empty. - -- `@tanstack/ai-memory` — `memoryMiddleware` injects a `memory:state` `CUSTOM` - chunk carrying recall metrics + an `inspect`/`listFacts` snapshot; exports - `MEMORY_STATE_EVENT` and `MemoryStateEventValue`. -- `@tanstack/ai-event-client` — adds the `memory:snapshot` devtools event. -- `@tanstack/ai-client` — the chat devtools bridge re-emits `memory:*` from the - transported chunk and replays the last snapshot on `devtools:request-state`. -- `@tanstack/ai-devtools-core` — new Memory tab + per-scope memory store slice. diff --git a/.changeset/interrupt-binding-ownership.md b/.changeset/interrupt-binding-ownership.md deleted file mode 100644 index b681fe9dd..000000000 --- a/.changeset/interrupt-binding-ownership.md +++ /dev/null @@ -1,33 +0,0 @@ ---- -'@tanstack/ai-client': minor -'@tanstack/ai': minor ---- - -Make interrupt ownership explicit rather than assumed. - -An AG-UI `Interrupt` is a shared envelope — a workflow engine's durable -approval or another agent framework's pause can arrive on the same stream. What -makes a pause resumable through `chat()` is the binding this package attaches -under `tanstack:interruptBinding`. - -- Interrupts that carry no binding this client understands now surface as - `kind: 'unbound'` with `canResolve: false`, instead of being given a - synthesized binding and rendered as resolvable generic interrupts. Resolving - those produced an answer submitted against a run with nothing pending, which - failed as `unknown-interrupt` only after the user had filled in the form. - Unbound items never block submission of the interrupts that are yours. -- The binding carries a wire version (`INTERRUPT_BINDING_VERSION`). Readers - reject a version they don't recognise rather than duck-typing its fields. A - binding written before the field existed is still read. -- `INTERRUPT_BINDING_METADATA_KEY`, `withInterruptBinding()` and - `readInterruptBinding()` are exported, so anything producing an interrupt this - package must later resume attaches the binding through a supported API - instead of copying the metadata key. -- Interrupt classification is driven by the binding alone. `Interrupt.reason` is - free-form AG-UI text another producer can also use, so it is now a display - hint only and never decides ownership. -- The interrupt protocol surface is enumerated instead of `export *`. The - unimplemented durable-recovery contract (`InterruptRecoveryStateV1`, - `InterruptRecoveryQuery`, the never-called `loadInterruptState` adapter hook, - and the `persistence-required` / `atomic-commit-unsupported` / - `recovery-unavailable` error codes) is removed rather than published. diff --git a/.changeset/interrupts-validation-ownership.md b/.changeset/interrupts-validation-ownership.md deleted file mode 100644 index 122b0687b..000000000 --- a/.changeset/interrupts-validation-ownership.md +++ /dev/null @@ -1,20 +0,0 @@ ---- -'@tanstack/ai': minor -'@tanstack/ai-client': minor ---- - -Interrupts: the application owns wire-schema validation, and the hashing -dependency is gone. - -The library no longer transforms a generic interrupt's wire JSON Schema into a -validator or validates the resolved value against it, on either the client or -the server. Whatever you pass to `resolveInterrupt` (client) or send in the -`resume` batch (server) flows through as-is. Validate it yourself if you need to -trust it, e.g. with `z.fromJSONSchema(interrupt.responseSchema).safeParse(value)` -on the client and your own check on the server. Validation of a tool's -code-authored Standard Schema (`approvalSchema` / `inputSchema`) is unchanged. - -This drops the `ajv` and `ajv-formats` dependencies. Interrupt binding hashes and -resolution fingerprints now use a small bundled SHA-256 instead of -`@noble/hashes`, so that dependency is gone too. The wire hash shape -(`sha256:`) is unchanged. diff --git a/.changeset/memory-middleware.md b/.changeset/memory-middleware.md deleted file mode 100644 index 6e9cd9f31..000000000 --- a/.changeset/memory-middleware.md +++ /dev/null @@ -1,44 +0,0 @@ ---- -'@tanstack/ai': minor -'@tanstack/ai-event-client': minor -'@tanstack/ai-memory': minor ---- - -**Add server-side memory via a `recall`/`save` adapter contract in `@tanstack/ai-memory`.** - -Memory is now a single, provider-agnostic contract with two verbs — `recall` and -`save` — which is the shape every memory backend (in-process, Redis, and hosted -vendors) naturally exposes. `memoryMiddleware` recalls relevant memory into the -system prompt (and optionally injects vendor tools) before the model runs, then -defers `save` of the finished turn via `ctx.defer` so streaming is never blocked. -Extraction, ranking, and rendering live inside each adapter — the middleware is thin. - -`@tanstack/ai-memory` (new package) — everything ships here: - -- Root: `memoryMiddleware`, the `MemoryAdapter` contract - (`recall` / `save` / optional `inspect` / `listFacts`), and the `MemoryScope` / - `MemoryTurn` / `RecallResult` / `SaveReceipt` types. -- `@tanstack/ai-memory/in-memory` → `inMemory()` — zero-dependency adapter for dev, - tests, and single-process demos. Pass an `embedder` for semantic scoring and/or an - `extract` function to persist derived facts. -- `@tanstack/ai-memory/redis` → `redis({ redis, prefix? })` — production adapter for - plain Redis. `ioredis` wires in directly; `redis` (node-redis v4+) via the - `fromNodeRedis(client)` wrapper. Both are optional peer dependencies. -- `@tanstack/ai-memory/hindsight` → `hindsight()`, `@tanstack/ai-memory/mem0` → - `mem0()`, `@tanstack/ai-memory/honcho` → `honcho()` — hosted-vendor adapters. Their - SDKs (`@vectorize-io/hindsight-client`, `@honcho-ai/sdk`) are optional peers loaded - lazily; mem0 talks to its server over plain HTTP (no SDK). Vendors can expose LLM - tools through `recall` (e.g. hindsight's retain/recall/reflect). -- A shared `recall`/`save` contract-test suite (`@tanstack/ai-memory/tests/contract`) - that any adapter — including third-party ones — can run. - -`@tanstack/ai`: - -- **Removes the (unreleased) `@tanstack/ai/memory` subpath.** The middleware, - contract, and helpers all moved to `@tanstack/ai-memory`. - -`@tanstack/ai-event-client`: - -- The five `memory:*` devtools events (`memory:retrieve:started` / `:completed`, - `memory:persist:started` / `:completed`, `memory:error`) now carry recall/save - payloads (adapter id, fragment/receipt counts, `phase: 'recall' | 'save'`). diff --git a/.changeset/memory-scope-threadid.md b/.changeset/memory-scope-threadid.md deleted file mode 100644 index ba5c66bfe..000000000 --- a/.changeset/memory-scope-threadid.md +++ /dev/null @@ -1,26 +0,0 @@ ---- -'@tanstack/ai-memory': minor -'@tanstack/ai-event-client': minor -'@tanstack/ai-client': minor -'@tanstack/ai-devtools-core': minor ---- - -**Align `MemoryScope` to the shared `Scope` type (`threadId`).** - -`MemoryScope` is now an alias of `Scope` from `@tanstack/ai` so memory and -persistence share one isolation vocabulary. The conversation key is -`threadId` (required); optional dims are `userId`, `tenantId`, and reserved -`namespace`. There is no public `sessionId` on memory scope — hard cut while -`@tanstack/ai-memory` is still `0.x` / unreleased. - -- `@tanstack/ai-memory` — `export type MemoryScope = Scope`. Built-in adapters - (`inMemory`, `redis`) and middleware use `threadId`; `sameScope` also matches - `tenantId` when present on the query. Redis index keys are now - `{prefix}:index:{tenantId|_}:{userId|_}:{threadId}` (escaped). Hindsight banks - use `{user}__{threadId}`. Anyone who wrote Redis rows under the pre-rename - layout needs to reindex or wipe — keys are not dual-read. -- `@tanstack/ai-event-client` — `MemoryScopeLite` is - `{ threadId?, userId?, tenantId? }` (devtools telemetry; not an isolation - authority). -- `@tanstack/ai-client` / `@tanstack/ai-devtools-core` — memory event payloads - and the Memory panel registry follow the same `threadId` field names. diff --git a/.changeset/resumable-streams.md b/.changeset/resumable-streams.md deleted file mode 100644 index 35b6ebfd7..000000000 --- a/.changeset/resumable-streams.md +++ /dev/null @@ -1,53 +0,0 @@ ---- -'@tanstack/ai': minor -'@tanstack/ai-client': minor -'@tanstack/ai-durable-stream': minor ---- - -Resumable streams: reconnect to an in-flight SSE **or NDJSON** response without -re-running the provider. - -`toServerSentEventsResponse` and `toHttpResponse` both accept a -`durability: { adapter, batch }` option. The adapter (`StreamDurability`) -records every chunk to an ordered log before delivery and tags each event with -an opaque, adapter-owned offset — an SSE `id:` line, or the `id` of an NDJSON -`{ id, chunk }` envelope (NDJSON has no native event-id). A reconnect -(`Last-Event-ID`) or an explicit `?offset` read replays strictly after that -offset from the log — the lazy provider stream is never iterated on resume. -Producers terminalize the log on cancellation and failure (`RUN_ERROR` append - -- `close()`) and on completion when the source stream emits its own terminal - event (`chat()` always does), so readers are never parked on a dead run. - -Two adapters ship: `memoryStream(request)` in `@tanstack/ai` (process-local, -for development and tests) and the new `@tanstack/ai-durable-stream` package, -a Durable Streams protocol adapter for production backends. - -For the `GET` handler that a reload or a second tab reconnects to, -`resumeServerSentEventsResponse({ adapter })` and `resumeHttpResponse({ adapter })` -replay a run straight from the durability log. They need no producer stream and -return a 400 when the request carries no resume offset. - -On the client, all four HTTP adapters are now resumable — `fetchServerSentEvents`, -`fetchHttpStream`, `xhrServerSentEvents`, and `xhrHttpStream`. Each tracks the -per-event offset, auto-reconnects with `Last-Event-ID`, de-duplicates the -replayed prefix, and exposes `joinRun(runId)` to attach to an in-flight or -finished run from the start (read-only GET with `offset=-1`). Untagged streams -behave exactly as before. A durable run that ends with no terminal event and no -forward progress now throws `DurableStreamIncompleteError` instead of hanging. - -Reconnection and durability are bounded so failures surface rather than hang or -loop: - -- `memoryStream` evicts completed logs after a grace window (unbounded growth - is gone); resuming an expired/unknown run throws, and a from-start join to a - run that never produces fails after `MemoryStreamOptions.firstChunkDeadlineMs`. -- all four HTTP adapters accept `reconnect: { maxAttempts, delayMs }` — a - throttle plus a ceiling on CONSECUTIVE no-progress reconnects (default 5; - forward progress resets it) that fails with the new `StreamReconnectLimitError` - instead of reconnecting endlessly, without penalizing a healthy long-lived run. -- `durableStream` accepts `reconnect: { maxReadFailures, delayMs }` to bound its - read-retry loop, and `server` is now optional when `fetch` is provided (e.g. a - Cloudflare service binding). -- `toServerSentEventsResponse` accepts `debug` to record durability terminal / - close failures server-side, where a replaying joiner cannot observe them. diff --git a/.changeset/shared-scope.md b/.changeset/shared-scope.md deleted file mode 100644 index 7dee65362..000000000 --- a/.changeset/shared-scope.md +++ /dev/null @@ -1,29 +0,0 @@ ---- -'@tanstack/ai': minor ---- - -**Add a shared `Scope` identity type to `@tanstack/ai`.** - -`Scope` is the single identity/isolation vocabulary for the subsystems that -persist or recall per-conversation data — `@tanstack/ai-persistence` and -`@tanstack/ai-memory`. Rather than each subsystem inventing its own notion of -"whose data is this?", both import one type: - -```ts -interface Scope { - threadId: string // required — the single conversation key (same as ctx.threadId) - userId?: string // durable end-user identity; required in practice for multi-user apps - tenantId?: string // multi-tenant boundary - namespace?: string // reserved logical partition; no subsystem keys on it yet -} -``` - -`threadId` is the one conversation key across the codebase (matching -`ChatMiddlewareContext.threadId`, with `conversationId` already deprecated in -favor of it) — subsystems must not introduce a second name (`sessionId`, …) for -the same concept. Every field is an isolation boundary and must be derived -server-side from trusted session state, never from client input. - -Introduced ahead of the persistence and memory packages so both share one settled -identity contract. `@tanstack/ai-memory` now aliases `MemoryScope` to `Scope` -(see the memory-scope-threadid changeset). diff --git a/.changeset/sync-models.md b/.changeset/sync-models.md deleted file mode 100644 index 63eef764c..000000000 --- a/.changeset/sync-models.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -'@tanstack/ai-openrouter': patch ---- - -Update model metadata from OpenRouter API diff --git a/examples/ag-ui/CHANGELOG.md b/examples/ag-ui/CHANGELOG.md index 41d1e2e02..fbd5a7bd2 100644 --- a/examples/ag-ui/CHANGELOG.md +++ b/examples/ag-ui/CHANGELOG.md @@ -1,5 +1,14 @@ # ag-ui +## 0.0.3 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]: + - @tanstack/ai-client@0.23.0 + - @tanstack/ai-react@0.19.0 + - @tanstack/ai-react-ui@0.8.16 + ## 0.0.2 ### Patch Changes diff --git a/examples/ag-ui/package.json b/examples/ag-ui/package.json index 3475ab6f6..2eb3f2b18 100644 --- a/examples/ag-ui/package.json +++ b/examples/ag-ui/package.json @@ -2,7 +2,7 @@ "name": "ag-ui", "private": true, "type": "module", - "version": "0.0.2", + "version": "0.0.3", "scripts": { "detect-servers": "node scripts/detect-servers.mjs", "predev": "node scripts/detect-servers.mjs", diff --git a/packages/ai-acp/CHANGELOG.md b/packages/ai-acp/CHANGELOG.md index 663b6797f..c308530dd 100644 --- a/packages/ai-acp/CHANGELOG.md +++ b/packages/ai-acp/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-acp +## 0.2.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-sandbox@0.2.5 + ## 0.2.3 ### Patch Changes diff --git a/packages/ai-acp/package.json b/packages/ai-acp/package.json index 7f766d480..dcb042296 100644 --- a/packages/ai-acp/package.json +++ b/packages/ai-acp/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-acp", - "version": "0.2.3", + "version": "0.2.4", "description": "Shared Agent Client Protocol (ACP) transport, session, and AG-UI translation for TanStack AI harness adapters.", "author": "", "license": "MIT", diff --git a/packages/ai-angular/CHANGELOG.md b/packages/ai-angular/CHANGELOG.md index 32645461d..aa2fd4324 100644 --- a/packages/ai-angular/CHANGELOG.md +++ b/packages/ai-angular/CHANGELOG.md @@ -1,5 +1,26 @@ # @tanstack/ai-angular +## 0.4.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-client@0.23.0 + ## 0.3.1 ### Patch Changes diff --git a/packages/ai-angular/package.json b/packages/ai-angular/package.json index 0cc622277..fb1d48aa9 100644 --- a/packages/ai-angular/package.json +++ b/packages/ai-angular/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-angular", - "version": "0.3.1", + "version": "0.4.0", "description": "Angular signals integration for TanStack AI streaming chat, structured outputs, and media generation.", "author": "", "license": "MIT", diff --git a/packages/ai-anthropic/CHANGELOG.md b/packages/ai-anthropic/CHANGELOG.md index f9f654410..ec8d5d0d1 100644 --- a/packages/ai-anthropic/CHANGELOG.md +++ b/packages/ai-anthropic/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-anthropic +## 0.16.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.16.3 ### Patch Changes diff --git a/packages/ai-anthropic/package.json b/packages/ai-anthropic/package.json index 4f6702cbb..ba67655c8 100644 --- a/packages/ai-anthropic/package.json +++ b/packages/ai-anthropic/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-anthropic", - "version": "0.16.3", + "version": "0.16.4", "description": "Anthropic Claude adapter for TanStack AI chat, tool calling, thinking, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-bedrock/CHANGELOG.md b/packages/ai-bedrock/CHANGELOG.md index d737219ad..9aa8a5557 100644 --- a/packages/ai-bedrock/CHANGELOG.md +++ b/packages/ai-bedrock/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-bedrock +## 0.1.5 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/openai-base@0.9.10 + ## 0.1.4 ### Patch Changes diff --git a/packages/ai-bedrock/package.json b/packages/ai-bedrock/package.json index 1981b2b4c..5ac0ae8fa 100644 --- a/packages/ai-bedrock/package.json +++ b/packages/ai-bedrock/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-bedrock", - "version": "0.1.4", + "version": "0.1.5", "type": "module", "description": "Amazon Bedrock adapter for TanStack AI — OpenAI-compatible chat, responses, tools, and reasoning.", "author": "", diff --git a/packages/ai-claude-code/CHANGELOG.md b/packages/ai-claude-code/CHANGELOG.md index 048c0b7d7..bdedcc5cc 100644 --- a/packages/ai-claude-code/CHANGELOG.md +++ b/packages/ai-claude-code/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-claude-code +## 0.2.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-sandbox@0.2.5 + ## 0.2.3 ### Patch Changes diff --git a/packages/ai-claude-code/package.json b/packages/ai-claude-code/package.json index 9d960189c..fa976a33f 100644 --- a/packages/ai-claude-code/package.json +++ b/packages/ai-claude-code/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-claude-code", - "version": "0.2.3", + "version": "0.2.4", "description": "Claude Code harness adapter for TanStack AI — run Claude Code as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-client/CHANGELOG.md b/packages/ai-client/CHANGELOG.md index e0b56d32f..100cad67d 100644 --- a/packages/ai-client/CHANGELOG.md +++ b/packages/ai-client/CHANGELOG.md @@ -1,5 +1,157 @@ # @tanstack/ai-client +## 0.23.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +- [#541](https://github.com/TanStack/ai/pull/541) [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4) - **Surface server-side memory state in the TanStack AI DevTools.** + + The DevTools panel now has a **Memory** tab for any chat wired with + `memoryMiddleware`. It shows, per scope (session), an operations timeline (each + turn's recall — query, fragment count, injected system-prompt size, whether + memory tools were exposed, duration) and the current stored records/facts when + the adapter implements the optional `inspect`/`listFacts` methods. + + Because memory runs on the server (whose event bus never reaches the browser), + the middleware transports its state to the panel over the chat stream as a + `memory:state` `CUSTOM` event, which `@tanstack/ai-client`'s devtools bridge + re-emits as browser `memory:*` events — the same pattern generation results use. + The snapshot reflects memory as of the start of each turn; opening the panel + mid-conversation replays the latest state so the tab isn't empty. + - `@tanstack/ai-memory` — `memoryMiddleware` injects a `memory:state` `CUSTOM` + chunk carrying recall metrics + an `inspect`/`listFacts` snapshot; exports + `MEMORY_STATE_EVENT` and `MemoryStateEventValue`. + - `@tanstack/ai-event-client` — adds the `memory:snapshot` devtools event. + - `@tanstack/ai-client` — the chat devtools bridge re-emits `memory:*` from the + transported chunk and replays the last snapshot on `devtools:request-state`. + - `@tanstack/ai-devtools-core` — new Memory tab + per-scope memory store slice. + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Make interrupt ownership explicit rather than assumed. + + An AG-UI `Interrupt` is a shared envelope — a workflow engine's durable + approval or another agent framework's pause can arrive on the same stream. What + makes a pause resumable through `chat()` is the binding this package attaches + under `tanstack:interruptBinding`. + - Interrupts that carry no binding this client understands now surface as + `kind: 'unbound'` with `canResolve: false`, instead of being given a + synthesized binding and rendered as resolvable generic interrupts. Resolving + those produced an answer submitted against a run with nothing pending, which + failed as `unknown-interrupt` only after the user had filled in the form. + Unbound items never block submission of the interrupts that are yours. + - The binding carries a wire version (`INTERRUPT_BINDING_VERSION`). Readers + reject a version they don't recognise rather than duck-typing its fields. A + binding written before the field existed is still read. + - `INTERRUPT_BINDING_METADATA_KEY`, `withInterruptBinding()` and + `readInterruptBinding()` are exported, so anything producing an interrupt this + package must later resume attaches the binding through a supported API + instead of copying the metadata key. + - Interrupt classification is driven by the binding alone. `Interrupt.reason` is + free-form AG-UI text another producer can also use, so it is now a display + hint only and never decides ownership. + - The interrupt protocol surface is enumerated instead of `export *`. The + unimplemented durable-recovery contract (`InterruptRecoveryStateV1`, + `InterruptRecoveryQuery`, the never-called `loadInterruptState` adapter hook, + and the `persistence-required` / `atomic-commit-unsupported` / + `recovery-unavailable` error codes) is removed rather than published. + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Interrupts: the application owns wire-schema validation, and the hashing + dependency is gone. + + The library no longer transforms a generic interrupt's wire JSON Schema into a + validator or validates the resolved value against it, on either the client or + the server. Whatever you pass to `resolveInterrupt` (client) or send in the + `resume` batch (server) flows through as-is. Validate it yourself if you need to + trust it, e.g. with `z.fromJSONSchema(interrupt.responseSchema).safeParse(value)` + on the client and your own check on the server. Validation of a tool's + code-authored Standard Schema (`approvalSchema` / `inputSchema`) is unchanged. + + This drops the `ajv` and `ajv-formats` dependencies. Interrupt binding hashes and + resolution fingerprints now use a small bundled SHA-256 instead of + `@noble/hashes`, so that dependency is gone too. The wire hash shape + (`sha256:`) is unchanged. + +- [#991](https://github.com/TanStack/ai/pull/991) [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371) - **Align `MemoryScope` to the shared `Scope` type (`threadId`).** + + `MemoryScope` is now an alias of `Scope` from `@tanstack/ai` so memory and + persistence share one isolation vocabulary. The conversation key is + `threadId` (required); optional dims are `userId`, `tenantId`, and reserved + `namespace`. There is no public `sessionId` on memory scope — hard cut while + `@tanstack/ai-memory` is still `0.x` / unreleased. + - `@tanstack/ai-memory` — `export type MemoryScope = Scope`. Built-in adapters + (`inMemory`, `redis`) and middleware use `threadId`; `sameScope` also matches + `tenantId` when present on the query. Redis index keys are now + `{prefix}:index:{tenantId|_}:{userId|_}:{threadId}` (escaped). Hindsight banks + use `{user}__{threadId}`. Anyone who wrote Redis rows under the pre-rename + layout needs to reindex or wipe — keys are not dual-read. + - `@tanstack/ai-event-client` — `MemoryScopeLite` is + `{ threadId?, userId?, tenantId? }` (devtools telemetry; not an isolation + authority). + - `@tanstack/ai-client` / `@tanstack/ai-devtools-core` — memory event payloads + and the Memory panel registry follow the same `threadId` field names. + +- [#955](https://github.com/TanStack/ai/pull/955) [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288) - Resumable streams: reconnect to an in-flight SSE **or NDJSON** response without + re-running the provider. + + `toServerSentEventsResponse` and `toHttpResponse` both accept a + `durability: { adapter, batch }` option. The adapter (`StreamDurability`) + records every chunk to an ordered log before delivery and tags each event with + an opaque, adapter-owned offset — an SSE `id:` line, or the `id` of an NDJSON + `{ id, chunk }` envelope (NDJSON has no native event-id). A reconnect + (`Last-Event-ID`) or an explicit `?offset` read replays strictly after that + offset from the log — the lazy provider stream is never iterated on resume. + Producers terminalize the log on cancellation and failure (`RUN_ERROR` append + - `close()`) and on completion when the source stream emits its own terminal + event (`chat()` always does), so readers are never parked on a dead run. + + Two adapters ship: `memoryStream(request)` in `@tanstack/ai` (process-local, + for development and tests) and the new `@tanstack/ai-durable-stream` package, + a Durable Streams protocol adapter for production backends. + + For the `GET` handler that a reload or a second tab reconnects to, + `resumeServerSentEventsResponse({ adapter })` and `resumeHttpResponse({ adapter })` + replay a run straight from the durability log. They need no producer stream and + return a 400 when the request carries no resume offset. + + On the client, all four HTTP adapters are now resumable — `fetchServerSentEvents`, + `fetchHttpStream`, `xhrServerSentEvents`, and `xhrHttpStream`. Each tracks the + per-event offset, auto-reconnects with `Last-Event-ID`, de-duplicates the + replayed prefix, and exposes `joinRun(runId)` to attach to an in-flight or + finished run from the start (read-only GET with `offset=-1`). Untagged streams + behave exactly as before. A durable run that ends with no terminal event and no + forward progress now throws `DurableStreamIncompleteError` instead of hanging. + + Reconnection and durability are bounded so failures surface rather than hang or + loop: + - `memoryStream` evicts completed logs after a grace window (unbounded growth + is gone); resuming an expired/unknown run throws, and a from-start join to a + run that never produces fails after `MemoryStreamOptions.firstChunkDeadlineMs`. + - all four HTTP adapters accept `reconnect: { maxAttempts, delayMs }` — a + throttle plus a ceiling on CONSECUTIVE no-progress reconnects (default 5; + forward progress resets it) that fails with the new `StreamReconnectLimitError` + instead of reconnecting endlessly, without penalizing a healthy long-lived run. + - `durableStream` accepts `reconnect: { maxReadFailures, delayMs }` to bound its + read-retry loop, and `server` is now optional when `fetch` is provided (e.g. a + Cloudflare service binding). + - `toServerSentEventsResponse` accepts `debug` to record durability terminal / + close failures server-side, where a replaying joiner cannot observe them. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-event-client@0.7.0 + ## 0.22.1 ### Patch Changes diff --git a/packages/ai-client/package.json b/packages/ai-client/package.json index 2423f6948..1d11e6141 100644 --- a/packages/ai-client/package.json +++ b/packages/ai-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-client", - "version": "0.22.1", + "version": "0.23.0", "description": "Framework-agnostic headless client for TanStack AI chat, realtime sessions, streaming transports, and media generations.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-code-mode-skills/CHANGELOG.md b/packages/ai-code-mode-skills/CHANGELOG.md index 94c22b6a9..055a758e4 100644 --- a/packages/ai-code-mode-skills/CHANGELOG.md +++ b/packages/ai-code-mode-skills/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-code-mode-skills +## 0.3.12 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-code-mode@0.3.9 + ## 0.3.11 ### Patch Changes diff --git a/packages/ai-code-mode-skills/package.json b/packages/ai-code-mode-skills/package.json index 48ffd8d90..64782b2f7 100644 --- a/packages/ai-code-mode-skills/package.json +++ b/packages/ai-code-mode-skills/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-code-mode-skills", - "version": "0.3.11", + "version": "0.3.12", "description": "Persistent runtime skill library for TanStack AI Code Mode agents and sandboxed tool orchestration.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-code-mode/CHANGELOG.md b/packages/ai-code-mode/CHANGELOG.md index 3ca87fd9d..03c7cf574 100644 --- a/packages/ai-code-mode/CHANGELOG.md +++ b/packages/ai-code-mode/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-code-mode +## 0.3.9 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.3.8 ### Patch Changes diff --git a/packages/ai-code-mode/package.json b/packages/ai-code-mode/package.json index 85a837d0b..90fb51501 100644 --- a/packages/ai-code-mode/package.json +++ b/packages/ai-code-mode/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-code-mode", - "version": "0.3.8", + "version": "0.3.9", "description": "Secure TypeScript Code Mode for TanStack AI agents to execute sandboxed tool orchestration programs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-codex/CHANGELOG.md b/packages/ai-codex/CHANGELOG.md index 6710f31d7..be9dd021d 100644 --- a/packages/ai-codex/CHANGELOG.md +++ b/packages/ai-codex/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-codex +## 0.2.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-sandbox@0.2.5 + ## 0.2.3 ### Patch Changes diff --git a/packages/ai-codex/package.json b/packages/ai-codex/package.json index 4bdfad50c..2ba51c787 100644 --- a/packages/ai-codex/package.json +++ b/packages/ai-codex/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-codex", - "version": "0.2.3", + "version": "0.2.4", "description": "Codex harness adapter for TanStack AI — run OpenAI Codex as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-devtools/CHANGELOG.md b/packages/ai-devtools/CHANGELOG.md index 9a00d78c5..b13210918 100644 --- a/packages/ai-devtools/CHANGELOG.md +++ b/packages/ai-devtools/CHANGELOG.md @@ -1,5 +1,56 @@ # @tanstack/ai-devtools-core +## 0.5.0 + +### Minor Changes + +- [#541](https://github.com/TanStack/ai/pull/541) [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4) - **Surface server-side memory state in the TanStack AI DevTools.** + + The DevTools panel now has a **Memory** tab for any chat wired with + `memoryMiddleware`. It shows, per scope (session), an operations timeline (each + turn's recall — query, fragment count, injected system-prompt size, whether + memory tools were exposed, duration) and the current stored records/facts when + the adapter implements the optional `inspect`/`listFacts` methods. + + Because memory runs on the server (whose event bus never reaches the browser), + the middleware transports its state to the panel over the chat stream as a + `memory:state` `CUSTOM` event, which `@tanstack/ai-client`'s devtools bridge + re-emits as browser `memory:*` events — the same pattern generation results use. + The snapshot reflects memory as of the start of each turn; opening the panel + mid-conversation replays the latest state so the tab isn't empty. + - `@tanstack/ai-memory` — `memoryMiddleware` injects a `memory:state` `CUSTOM` + chunk carrying recall metrics + an `inspect`/`listFacts` snapshot; exports + `MEMORY_STATE_EVENT` and `MemoryStateEventValue`. + - `@tanstack/ai-event-client` — adds the `memory:snapshot` devtools event. + - `@tanstack/ai-client` — the chat devtools bridge re-emits `memory:*` from the + transported chunk and replays the last snapshot on `devtools:request-state`. + - `@tanstack/ai-devtools-core` — new Memory tab + per-scope memory store slice. + +- [#991](https://github.com/TanStack/ai/pull/991) [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371) - **Align `MemoryScope` to the shared `Scope` type (`threadId`).** + + `MemoryScope` is now an alias of `Scope` from `@tanstack/ai` so memory and + persistence share one isolation vocabulary. The conversation key is + `threadId` (required); optional dims are `userId`, `tenantId`, and reserved + `namespace`. There is no public `sessionId` on memory scope — hard cut while + `@tanstack/ai-memory` is still `0.x` / unreleased. + - `@tanstack/ai-memory` — `export type MemoryScope = Scope`. Built-in adapters + (`inMemory`, `redis`) and middleware use `threadId`; `sameScope` also matches + `tenantId` when present on the query. Redis index keys are now + `{prefix}:index:{tenantId|_}:{userId|_}:{threadId}` (escaped). Hindsight banks + use `{user}__{threadId}`. Anyone who wrote Redis rows under the pre-rename + layout needs to reindex or wipe — keys are not dual-read. + - `@tanstack/ai-event-client` — `MemoryScopeLite` is + `{ threadId?, userId?, tenantId? }` (devtools telemetry; not an isolation + authority). + - `@tanstack/ai-client` / `@tanstack/ai-devtools-core` — memory event payloads + and the Memory panel registry follow the same `threadId` field names. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-event-client@0.7.0 + ## 0.4.24 ### Patch Changes diff --git a/packages/ai-devtools/package.json b/packages/ai-devtools/package.json index e0a766d97..84b3a0452 100644 --- a/packages/ai-devtools/package.json +++ b/packages/ai-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-devtools-core", - "version": "0.4.24", + "version": "0.5.0", "description": "Core TanStack AI Devtools plugin for inspecting chat messages, tool calls, streams, and errors.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-durable-stream/CHANGELOG.md b/packages/ai-durable-stream/CHANGELOG.md new file mode 100644 index 000000000..9f16f841e --- /dev/null +++ b/packages/ai-durable-stream/CHANGELOG.md @@ -0,0 +1,56 @@ +# @tanstack/ai-durable-stream + +## 0.1.0 + +### Minor Changes + +- [#955](https://github.com/TanStack/ai/pull/955) [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288) - Resumable streams: reconnect to an in-flight SSE **or NDJSON** response without + re-running the provider. + + `toServerSentEventsResponse` and `toHttpResponse` both accept a + `durability: { adapter, batch }` option. The adapter (`StreamDurability`) + records every chunk to an ordered log before delivery and tags each event with + an opaque, adapter-owned offset — an SSE `id:` line, or the `id` of an NDJSON + `{ id, chunk }` envelope (NDJSON has no native event-id). A reconnect + (`Last-Event-ID`) or an explicit `?offset` read replays strictly after that + offset from the log — the lazy provider stream is never iterated on resume. + Producers terminalize the log on cancellation and failure (`RUN_ERROR` append + - `close()`) and on completion when the source stream emits its own terminal + event (`chat()` always does), so readers are never parked on a dead run. + + Two adapters ship: `memoryStream(request)` in `@tanstack/ai` (process-local, + for development and tests) and the new `@tanstack/ai-durable-stream` package, + a Durable Streams protocol adapter for production backends. + + For the `GET` handler that a reload or a second tab reconnects to, + `resumeServerSentEventsResponse({ adapter })` and `resumeHttpResponse({ adapter })` + replay a run straight from the durability log. They need no producer stream and + return a 400 when the request carries no resume offset. + + On the client, all four HTTP adapters are now resumable — `fetchServerSentEvents`, + `fetchHttpStream`, `xhrServerSentEvents`, and `xhrHttpStream`. Each tracks the + per-event offset, auto-reconnects with `Last-Event-ID`, de-duplicates the + replayed prefix, and exposes `joinRun(runId)` to attach to an in-flight or + finished run from the start (read-only GET with `offset=-1`). Untagged streams + behave exactly as before. A durable run that ends with no terminal event and no + forward progress now throws `DurableStreamIncompleteError` instead of hanging. + + Reconnection and durability are bounded so failures surface rather than hang or + loop: + - `memoryStream` evicts completed logs after a grace window (unbounded growth + is gone); resuming an expired/unknown run throws, and a from-start join to a + run that never produces fails after `MemoryStreamOptions.firstChunkDeadlineMs`. + - all four HTTP adapters accept `reconnect: { maxAttempts, delayMs }` — a + throttle plus a ceiling on CONSECUTIVE no-progress reconnects (default 5; + forward progress resets it) that fails with the new `StreamReconnectLimitError` + instead of reconnecting endlessly, without penalizing a healthy long-lived run. + - `durableStream` accepts `reconnect: { maxReadFailures, delayMs }` to bound its + read-retry loop, and `server` is now optional when `fetch` is provided (e.g. a + Cloudflare service binding). + - `toServerSentEventsResponse` accepts `debug` to record durability terminal / + close failures server-side, where a replaying joiner cannot observe them. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 diff --git a/packages/ai-durable-stream/package.json b/packages/ai-durable-stream/package.json index 2ce39ffb8..dd3b365fb 100644 --- a/packages/ai-durable-stream/package.json +++ b/packages/ai-durable-stream/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-durable-stream", - "version": "0.0.0", + "version": "0.1.0", "description": "Delivery durability for TanStack AI over the durable-streams HTTP protocol — a resumable StreamDurability transport sink (append/read/resume) that stores zero delivery events itself.", "author": "", "license": "MIT", diff --git a/packages/ai-elevenlabs/CHANGELOG.md b/packages/ai-elevenlabs/CHANGELOG.md index e441d6d16..7361afebd 100644 --- a/packages/ai-elevenlabs/CHANGELOG.md +++ b/packages/ai-elevenlabs/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-elevenlabs +## 0.2.35 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.2.34 ### Patch Changes diff --git a/packages/ai-elevenlabs/package.json b/packages/ai-elevenlabs/package.json index ee1c39d20..d4d7e6648 100644 --- a/packages/ai-elevenlabs/package.json +++ b/packages/ai-elevenlabs/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-elevenlabs", - "version": "0.2.34", + "version": "0.2.35", "description": "ElevenLabs adapter for TanStack AI realtime voice, text-to-speech, transcription, music, and sound effects.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-event-client/CHANGELOG.md b/packages/ai-event-client/CHANGELOG.md index 636549768..b70153785 100644 --- a/packages/ai-event-client/CHANGELOG.md +++ b/packages/ai-event-client/CHANGELOG.md @@ -1,5 +1,86 @@ # @tanstack/ai-event-client +## 0.7.0 + +### Minor Changes + +- [#541](https://github.com/TanStack/ai/pull/541) [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4) - **Surface server-side memory state in the TanStack AI DevTools.** + + The DevTools panel now has a **Memory** tab for any chat wired with + `memoryMiddleware`. It shows, per scope (session), an operations timeline (each + turn's recall — query, fragment count, injected system-prompt size, whether + memory tools were exposed, duration) and the current stored records/facts when + the adapter implements the optional `inspect`/`listFacts` methods. + + Because memory runs on the server (whose event bus never reaches the browser), + the middleware transports its state to the panel over the chat stream as a + `memory:state` `CUSTOM` event, which `@tanstack/ai-client`'s devtools bridge + re-emits as browser `memory:*` events — the same pattern generation results use. + The snapshot reflects memory as of the start of each turn; opening the panel + mid-conversation replays the latest state so the tab isn't empty. + - `@tanstack/ai-memory` — `memoryMiddleware` injects a `memory:state` `CUSTOM` + chunk carrying recall metrics + an `inspect`/`listFacts` snapshot; exports + `MEMORY_STATE_EVENT` and `MemoryStateEventValue`. + - `@tanstack/ai-event-client` — adds the `memory:snapshot` devtools event. + - `@tanstack/ai-client` — the chat devtools bridge re-emits `memory:*` from the + transported chunk and replays the last snapshot on `devtools:request-state`. + - `@tanstack/ai-devtools-core` — new Memory tab + per-scope memory store slice. + +- [#541](https://github.com/TanStack/ai/pull/541) [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4) - **Add server-side memory via a `recall`/`save` adapter contract in `@tanstack/ai-memory`.** + + Memory is now a single, provider-agnostic contract with two verbs — `recall` and + `save` — which is the shape every memory backend (in-process, Redis, and hosted + vendors) naturally exposes. `memoryMiddleware` recalls relevant memory into the + system prompt (and optionally injects vendor tools) before the model runs, then + defers `save` of the finished turn via `ctx.defer` so streaming is never blocked. + Extraction, ranking, and rendering live inside each adapter — the middleware is thin. + + `@tanstack/ai-memory` (new package) — everything ships here: + - Root: `memoryMiddleware`, the `MemoryAdapter` contract + (`recall` / `save` / optional `inspect` / `listFacts`), and the `MemoryScope` / + `MemoryTurn` / `RecallResult` / `SaveReceipt` types. + - `@tanstack/ai-memory/in-memory` → `inMemory()` — zero-dependency adapter for dev, + tests, and single-process demos. Pass an `embedder` for semantic scoring and/or an + `extract` function to persist derived facts. + - `@tanstack/ai-memory/redis` → `redis({ redis, prefix? })` — production adapter for + plain Redis. `ioredis` wires in directly; `redis` (node-redis v4+) via the + `fromNodeRedis(client)` wrapper. Both are optional peer dependencies. + - `@tanstack/ai-memory/hindsight` → `hindsight()`, `@tanstack/ai-memory/mem0` → + `mem0()`, `@tanstack/ai-memory/honcho` → `honcho()` — hosted-vendor adapters. Their + SDKs (`@vectorize-io/hindsight-client`, `@honcho-ai/sdk`) are optional peers loaded + lazily; mem0 talks to its server over plain HTTP (no SDK). Vendors can expose LLM + tools through `recall` (e.g. hindsight's retain/recall/reflect). + - A shared `recall`/`save` contract-test suite (`@tanstack/ai-memory/tests/contract`) + that any adapter — including third-party ones — can run. + + `@tanstack/ai`: + - **Removes the (unreleased) `@tanstack/ai/memory` subpath.** The middleware, + contract, and helpers all moved to `@tanstack/ai-memory`. + + `@tanstack/ai-event-client`: + - The five `memory:*` devtools events (`memory:retrieve:started` / `:completed`, + `memory:persist:started` / `:completed`, `memory:error`) now carry recall/save + payloads (adapter id, fragment/receipt counts, `phase: 'recall' | 'save'`). + +- [#991](https://github.com/TanStack/ai/pull/991) [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371) - **Align `MemoryScope` to the shared `Scope` type (`threadId`).** + + `MemoryScope` is now an alias of `Scope` from `@tanstack/ai` so memory and + persistence share one isolation vocabulary. The conversation key is + `threadId` (required); optional dims are `userId`, `tenantId`, and reserved + `namespace`. There is no public `sessionId` on memory scope — hard cut while + `@tanstack/ai-memory` is still `0.x` / unreleased. + - `@tanstack/ai-memory` — `export type MemoryScope = Scope`. Built-in adapters + (`inMemory`, `redis`) and middleware use `threadId`; `sameScope` also matches + `tenantId` when present on the query. Redis index keys are now + `{prefix}:index:{tenantId|_}:{userId|_}:{threadId}` (escaped). Hindsight banks + use `{user}__{threadId}`. Anyone who wrote Redis rows under the pre-rename + layout needs to reindex or wipe — keys are not dual-read. + - `@tanstack/ai-event-client` — `MemoryScopeLite` is + `{ threadId?, userId?, tenantId? }` (devtools telemetry; not an isolation + authority). + - `@tanstack/ai-client` / `@tanstack/ai-devtools-core` — memory event payloads + and the Memory panel registry follow the same `threadId` field names. + ## 0.6.8 ### Patch Changes diff --git a/packages/ai-event-client/package.json b/packages/ai-event-client/package.json index 8e7ed2a49..0a4abacc2 100644 --- a/packages/ai-event-client/package.json +++ b/packages/ai-event-client/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-event-client", - "version": "0.6.8", + "version": "0.7.0", "description": "Typed event client for TanStack AI devtools, observability, and streamed runtime events.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-fal/CHANGELOG.md b/packages/ai-fal/CHANGELOG.md index e7239bcc4..e54b089b8 100644 --- a/packages/ai-fal/CHANGELOG.md +++ b/packages/ai-fal/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-fal +## 0.9.13 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.9.12 ### Patch Changes diff --git a/packages/ai-fal/package.json b/packages/ai-fal/package.json index 8290805ba..bb7e6b134 100644 --- a/packages/ai-fal/package.json +++ b/packages/ai-fal/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-fal", - "version": "0.9.12", + "version": "0.9.13", "description": "fal.ai adapter for TanStack AI image, video, audio, speech, and transcription generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-gemini/CHANGELOG.md b/packages/ai-gemini/CHANGELOG.md index 7c2f00957..3284b4af5 100644 --- a/packages/ai-gemini/CHANGELOG.md +++ b/packages/ai-gemini/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-gemini +## 0.20.2 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.20.1 ### Patch Changes @@ -22,7 +29,9 @@ ```ts createOpenaiImage('gpt-image-1', apiKey, { allowUrlFetch: true }) createOpenaiVideo('sora-2', apiKey, { allowUrlFetch: true }) - createGeminiVideo('veo-3.1-generate-preview', apiKey, { allowUrlFetch: true }) + createGeminiVideo('veo-3.1-generate-preview', apiKey, { + allowUrlFetch: true, + }) ``` Migration: if you passed HTTP(S) URL image inputs to these adapters, either fetch the bytes yourself and pass a `data:` URI, pass a `gs://` reference (Veo), or set `allowUrlFetch: true`. diff --git a/packages/ai-gemini/package.json b/packages/ai-gemini/package.json index 412fa0a58..e7cb5e9a5 100644 --- a/packages/ai-gemini/package.json +++ b/packages/ai-gemini/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-gemini", - "version": "0.20.1", + "version": "0.20.2", "description": "Google Gemini adapter for TanStack AI chat, images, speech, audio generation, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-grok-build/CHANGELOG.md b/packages/ai-grok-build/CHANGELOG.md index bb7a7132f..8aff77133 100644 --- a/packages/ai-grok-build/CHANGELOG.md +++ b/packages/ai-grok-build/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/ai-grok-build +## 0.2.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-acp@0.2.4 + - @tanstack/ai-sandbox@0.2.5 + ## 0.2.3 ### Patch Changes diff --git a/packages/ai-grok-build/package.json b/packages/ai-grok-build/package.json index 7aeb00977..274841c7c 100644 --- a/packages/ai-grok-build/package.json +++ b/packages/ai-grok-build/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-grok-build", - "version": "0.2.3", + "version": "0.2.4", "description": "Grok Build harness adapter for TanStack AI — run Grok Build as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-grok/CHANGELOG.md b/packages/ai-grok/CHANGELOG.md index 80eb945ea..8164181ef 100644 --- a/packages/ai-grok/CHANGELOG.md +++ b/packages/ai-grok/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-grok +## 0.14.10 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/openai-base@0.9.10 + ## 0.14.9 ### Patch Changes diff --git a/packages/ai-grok/package.json b/packages/ai-grok/package.json index caae1ee0c..3b32629da 100644 --- a/packages/ai-grok/package.json +++ b/packages/ai-grok/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-grok", - "version": "0.14.9", + "version": "0.14.10", "description": "xAI Grok adapter for TanStack AI chat, image generation, realtime, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-groq/CHANGELOG.md b/packages/ai-groq/CHANGELOG.md index b3a32a8cc..90b200e11 100644 --- a/packages/ai-groq/CHANGELOG.md +++ b/packages/ai-groq/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-groq +## 0.5.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/openai-base@0.9.10 + ## 0.5.3 ### Patch Changes diff --git a/packages/ai-groq/package.json b/packages/ai-groq/package.json index 2f1aaef65..2bd567d15 100644 --- a/packages/ai-groq/package.json +++ b/packages/ai-groq/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-groq", - "version": "0.5.3", + "version": "0.5.4", "description": "Groq adapter for TanStack AI low-latency chat, tool calling, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-isolate-cloudflare/CHANGELOG.md b/packages/ai-isolate-cloudflare/CHANGELOG.md index eacf35de7..f8ea64db3 100644 --- a/packages/ai-isolate-cloudflare/CHANGELOG.md +++ b/packages/ai-isolate-cloudflare/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-isolate-cloudflare +## 0.2.39 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/ai-code-mode@0.3.9 + ## 0.2.38 ### Patch Changes diff --git a/packages/ai-isolate-cloudflare/package.json b/packages/ai-isolate-cloudflare/package.json index 726e3b45c..5ee9a3fca 100644 --- a/packages/ai-isolate-cloudflare/package.json +++ b/packages/ai-isolate-cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-isolate-cloudflare", - "version": "0.2.38", + "version": "0.2.39", "description": "Cloudflare Workers sandbox driver for TanStack AI Code Mode TypeScript execution at the edge.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-isolate-node/CHANGELOG.md b/packages/ai-isolate-node/CHANGELOG.md index 355dae5c8..97bdb1d36 100644 --- a/packages/ai-isolate-node/CHANGELOG.md +++ b/packages/ai-isolate-node/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-isolate-node +## 0.1.48 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/ai-code-mode@0.3.9 + ## 0.1.47 ### Patch Changes diff --git a/packages/ai-isolate-node/package.json b/packages/ai-isolate-node/package.json index 18b95cf4c..1c484f827 100644 --- a/packages/ai-isolate-node/package.json +++ b/packages/ai-isolate-node/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-isolate-node", - "version": "0.1.47", + "version": "0.1.48", "description": "Node.js isolated-vm sandbox driver for TanStack AI Code Mode TypeScript execution.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-isolate-quickjs/CHANGELOG.md b/packages/ai-isolate-quickjs/CHANGELOG.md index 21b609c72..77cf64afc 100644 --- a/packages/ai-isolate-quickjs/CHANGELOG.md +++ b/packages/ai-isolate-quickjs/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-isolate-quickjs +## 0.1.48 + +### Patch Changes + +- Updated dependencies []: + - @tanstack/ai-code-mode@0.3.9 + ## 0.1.47 ### Patch Changes diff --git a/packages/ai-isolate-quickjs/package.json b/packages/ai-isolate-quickjs/package.json index 27a7640f6..84a1e3c16 100644 --- a/packages/ai-isolate-quickjs/package.json +++ b/packages/ai-isolate-quickjs/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-isolate-quickjs", - "version": "0.1.47", + "version": "0.1.48", "description": "QuickJS WASM sandbox driver for TanStack AI Code Mode TypeScript execution across runtimes.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-mcp/CHANGELOG.md b/packages/ai-mcp/CHANGELOG.md index 68604fba8..58862b5d0 100644 --- a/packages/ai-mcp/CHANGELOG.md +++ b/packages/ai-mcp/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-mcp +## 0.2.6 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.2.5 ### Patch Changes diff --git a/packages/ai-mcp/package.json b/packages/ai-mcp/package.json index 860f77701..13fb511e1 100644 --- a/packages/ai-mcp/package.json +++ b/packages/ai-mcp/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-mcp", - "version": "0.2.5", + "version": "0.2.6", "description": "Host-side Model Context Protocol client for TanStack AI: discover and run MCP server tools, resources, and prompts in any adapter's chat() loop, with generated end-to-end types.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-memory/CHANGELOG.md b/packages/ai-memory/CHANGELOG.md new file mode 100644 index 000000000..9e7919853 --- /dev/null +++ b/packages/ai-memory/CHANGELOG.md @@ -0,0 +1,88 @@ +# @tanstack/ai-memory + +## 0.1.0 + +### Minor Changes + +- [#541](https://github.com/TanStack/ai/pull/541) [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4) - **Surface server-side memory state in the TanStack AI DevTools.** + + The DevTools panel now has a **Memory** tab for any chat wired with + `memoryMiddleware`. It shows, per scope (session), an operations timeline (each + turn's recall — query, fragment count, injected system-prompt size, whether + memory tools were exposed, duration) and the current stored records/facts when + the adapter implements the optional `inspect`/`listFacts` methods. + + Because memory runs on the server (whose event bus never reaches the browser), + the middleware transports its state to the panel over the chat stream as a + `memory:state` `CUSTOM` event, which `@tanstack/ai-client`'s devtools bridge + re-emits as browser `memory:*` events — the same pattern generation results use. + The snapshot reflects memory as of the start of each turn; opening the panel + mid-conversation replays the latest state so the tab isn't empty. + - `@tanstack/ai-memory` — `memoryMiddleware` injects a `memory:state` `CUSTOM` + chunk carrying recall metrics + an `inspect`/`listFacts` snapshot; exports + `MEMORY_STATE_EVENT` and `MemoryStateEventValue`. + - `@tanstack/ai-event-client` — adds the `memory:snapshot` devtools event. + - `@tanstack/ai-client` — the chat devtools bridge re-emits `memory:*` from the + transported chunk and replays the last snapshot on `devtools:request-state`. + - `@tanstack/ai-devtools-core` — new Memory tab + per-scope memory store slice. + +- [#541](https://github.com/TanStack/ai/pull/541) [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4) - **Add server-side memory via a `recall`/`save` adapter contract in `@tanstack/ai-memory`.** + + Memory is now a single, provider-agnostic contract with two verbs — `recall` and + `save` — which is the shape every memory backend (in-process, Redis, and hosted + vendors) naturally exposes. `memoryMiddleware` recalls relevant memory into the + system prompt (and optionally injects vendor tools) before the model runs, then + defers `save` of the finished turn via `ctx.defer` so streaming is never blocked. + Extraction, ranking, and rendering live inside each adapter — the middleware is thin. + + `@tanstack/ai-memory` (new package) — everything ships here: + - Root: `memoryMiddleware`, the `MemoryAdapter` contract + (`recall` / `save` / optional `inspect` / `listFacts`), and the `MemoryScope` / + `MemoryTurn` / `RecallResult` / `SaveReceipt` types. + - `@tanstack/ai-memory/in-memory` → `inMemory()` — zero-dependency adapter for dev, + tests, and single-process demos. Pass an `embedder` for semantic scoring and/or an + `extract` function to persist derived facts. + - `@tanstack/ai-memory/redis` → `redis({ redis, prefix? })` — production adapter for + plain Redis. `ioredis` wires in directly; `redis` (node-redis v4+) via the + `fromNodeRedis(client)` wrapper. Both are optional peer dependencies. + - `@tanstack/ai-memory/hindsight` → `hindsight()`, `@tanstack/ai-memory/mem0` → + `mem0()`, `@tanstack/ai-memory/honcho` → `honcho()` — hosted-vendor adapters. Their + SDKs (`@vectorize-io/hindsight-client`, `@honcho-ai/sdk`) are optional peers loaded + lazily; mem0 talks to its server over plain HTTP (no SDK). Vendors can expose LLM + tools through `recall` (e.g. hindsight's retain/recall/reflect). + - A shared `recall`/`save` contract-test suite (`@tanstack/ai-memory/tests/contract`) + that any adapter — including third-party ones — can run. + + `@tanstack/ai`: + - **Removes the (unreleased) `@tanstack/ai/memory` subpath.** The middleware, + contract, and helpers all moved to `@tanstack/ai-memory`. + + `@tanstack/ai-event-client`: + - The five `memory:*` devtools events (`memory:retrieve:started` / `:completed`, + `memory:persist:started` / `:completed`, `memory:error`) now carry recall/save + payloads (adapter id, fragment/receipt counts, `phase: 'recall' | 'save'`). + +- [#991](https://github.com/TanStack/ai/pull/991) [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371) - **Align `MemoryScope` to the shared `Scope` type (`threadId`).** + + `MemoryScope` is now an alias of `Scope` from `@tanstack/ai` so memory and + persistence share one isolation vocabulary. The conversation key is + `threadId` (required); optional dims are `userId`, `tenantId`, and reserved + `namespace`. There is no public `sessionId` on memory scope — hard cut while + `@tanstack/ai-memory` is still `0.x` / unreleased. + - `@tanstack/ai-memory` — `export type MemoryScope = Scope`. Built-in adapters + (`inMemory`, `redis`) and middleware use `threadId`; `sameScope` also matches + `tenantId` when present on the query. Redis index keys are now + `{prefix}:index:{tenantId|_}:{userId|_}:{threadId}` (escaped). Hindsight banks + use `{user}__{threadId}`. Anyone who wrote Redis rows under the pre-rename + layout needs to reindex or wipe — keys are not dual-read. + - `@tanstack/ai-event-client` — `MemoryScopeLite` is + `{ threadId?, userId?, tenantId? }` (devtools telemetry; not an isolation + authority). + - `@tanstack/ai-client` / `@tanstack/ai-devtools-core` — memory event payloads + and the Memory panel registry follow the same `threadId` field names. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-event-client@0.7.0 diff --git a/packages/ai-memory/package.json b/packages/ai-memory/package.json index c96b8256b..18a3b99a6 100644 --- a/packages/ai-memory/package.json +++ b/packages/ai-memory/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-memory", - "version": "0.0.0", + "version": "0.1.0", "description": "Pluggable memory adapters for TanStack AI memoryMiddleware", "author": "", "license": "MIT", diff --git a/packages/ai-mistral/CHANGELOG.md b/packages/ai-mistral/CHANGELOG.md index 5bd877325..ee97d4a4a 100644 --- a/packages/ai-mistral/CHANGELOG.md +++ b/packages/ai-mistral/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-mistral +## 0.2.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.2.3 ### Patch Changes diff --git a/packages/ai-mistral/package.json b/packages/ai-mistral/package.json index 177210044..1d5c84639 100644 --- a/packages/ai-mistral/package.json +++ b/packages/ai-mistral/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-mistral", - "version": "0.2.3", + "version": "0.2.4", "type": "module", "description": "Mistral adapter for TanStack AI", "author": "", diff --git a/packages/ai-ollama/CHANGELOG.md b/packages/ai-ollama/CHANGELOG.md index 80f9fa2ef..4243e86fc 100644 --- a/packages/ai-ollama/CHANGELOG.md +++ b/packages/ai-ollama/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-ollama +## 0.8.17 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.8.16 ### Patch Changes diff --git a/packages/ai-ollama/package.json b/packages/ai-ollama/package.json index 8b414b3a4..f57636beb 100644 --- a/packages/ai-ollama/package.json +++ b/packages/ai-ollama/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-ollama", - "version": "0.8.16", + "version": "0.8.17", "description": "Ollama adapter for TanStack AI local LLM chat, tool calling, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-openai/CHANGELOG.md b/packages/ai-openai/CHANGELOG.md index 90c8fa673..9223985b2 100644 --- a/packages/ai-openai/CHANGELOG.md +++ b/packages/ai-openai/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-openai +## 0.17.2 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/openai-base@0.9.10 + ## 0.17.1 ### Patch Changes @@ -21,7 +29,9 @@ ```ts createOpenaiImage('gpt-image-1', apiKey, { allowUrlFetch: true }) createOpenaiVideo('sora-2', apiKey, { allowUrlFetch: true }) - createGeminiVideo('veo-3.1-generate-preview', apiKey, { allowUrlFetch: true }) + createGeminiVideo('veo-3.1-generate-preview', apiKey, { + allowUrlFetch: true, + }) ``` Migration: if you passed HTTP(S) URL image inputs to these adapters, either fetch the bytes yourself and pass a `data:` URI, pass a `gs://` reference (Veo), or set `allowUrlFetch: true`. diff --git a/packages/ai-openai/package.json b/packages/ai-openai/package.json index c10867be9..7ec0cc798 100644 --- a/packages/ai-openai/package.json +++ b/packages/ai-openai/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-openai", - "version": "0.17.1", + "version": "0.17.2", "description": "OpenAI adapter for TanStack AI chat, tools, images, video, speech, transcription, realtime, and structured outputs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-opencode/CHANGELOG.md b/packages/ai-opencode/CHANGELOG.md index 809af39b4..decf9b77f 100644 --- a/packages/ai-opencode/CHANGELOG.md +++ b/packages/ai-opencode/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-opencode +## 0.2.4 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-sandbox@0.2.5 + ## 0.2.3 ### Patch Changes diff --git a/packages/ai-opencode/package.json b/packages/ai-opencode/package.json index 091203639..ff8583692 100644 --- a/packages/ai-opencode/package.json +++ b/packages/ai-opencode/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-opencode", - "version": "0.2.3", + "version": "0.2.4", "description": "OpenCode harness adapter for TanStack AI — run OpenCode as a chat backend with local tool execution and stateful sessions.", "author": "", "license": "MIT", diff --git a/packages/ai-openrouter/CHANGELOG.md b/packages/ai-openrouter/CHANGELOG.md index 49d91c73f..6c0a843f5 100644 --- a/packages/ai-openrouter/CHANGELOG.md +++ b/packages/ai-openrouter/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/ai-openrouter +## 0.15.11 + +### Patch Changes + +- [#888](https://github.com/TanStack/ai/pull/888) [`50d7a7d`](https://github.com/TanStack/ai/commit/50d7a7da319bd39c578548390a723302f90068c7) - Update model metadata from OpenRouter API + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.15.10 ### Patch Changes diff --git a/packages/ai-openrouter/package.json b/packages/ai-openrouter/package.json index 5aa817ade..d3d4d8506 100644 --- a/packages/ai-openrouter/package.json +++ b/packages/ai-openrouter/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-openrouter", - "version": "0.15.10", + "version": "0.15.11", "description": "TanStack AI adapter for OpenRouter chat, provider tools, structured outputs, and access to hundreds of LLMs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-preact/CHANGELOG.md b/packages/ai-preact/CHANGELOG.md index 1f66e75ad..c937bfa90 100644 --- a/packages/ai-preact/CHANGELOG.md +++ b/packages/ai-preact/CHANGELOG.md @@ -1,5 +1,26 @@ # @tanstack/ai-preact +## 0.12.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-client@0.23.0 + ## 0.11.1 ### Patch Changes diff --git a/packages/ai-preact/package.json b/packages/ai-preact/package.json index 3fae2bba4..4bc2b91e5 100644 --- a/packages/ai-preact/package.json +++ b/packages/ai-preact/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-preact", - "version": "0.11.1", + "version": "0.12.0", "description": "Preact hooks for TanStack AI streaming chat and typed messages.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-react-ui/CHANGELOG.md b/packages/ai-react-ui/CHANGELOG.md index 1de3edb2c..fa89c8b88 100644 --- a/packages/ai-react-ui/CHANGELOG.md +++ b/packages/ai-react-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-react-ui +## 0.8.16 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]: + - @tanstack/ai-client@0.23.0 + - @tanstack/ai-react@0.19.0 + ## 0.8.15 ### Patch Changes diff --git a/packages/ai-react-ui/package.json b/packages/ai-react-ui/package.json index 05058a215..2747a47e7 100644 --- a/packages/ai-react-ui/package.json +++ b/packages/ai-react-ui/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-react-ui", - "version": "0.8.15", + "version": "0.8.16", "description": "Headless React components for building TanStack AI chat interfaces with streamed message parts.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-react/CHANGELOG.md b/packages/ai-react/CHANGELOG.md index 25bdce91d..24f4e9de4 100644 --- a/packages/ai-react/CHANGELOG.md +++ b/packages/ai-react/CHANGELOG.md @@ -1,5 +1,26 @@ # @tanstack/ai-react +## 0.19.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-client@0.23.0 + ## 0.18.1 ### Patch Changes diff --git a/packages/ai-react/package.json b/packages/ai-react/package.json index 8cf8747e4..1940f79ff 100644 --- a/packages/ai-react/package.json +++ b/packages/ai-react/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-react", - "version": "0.18.1", + "version": "0.19.0", "description": "React hooks for TanStack AI streaming chat, realtime voice, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-sandbox-cloudflare/CHANGELOG.md b/packages/ai-sandbox-cloudflare/CHANGELOG.md index 214f16495..aca727bd9 100644 --- a/packages/ai-sandbox-cloudflare/CHANGELOG.md +++ b/packages/ai-sandbox-cloudflare/CHANGELOG.md @@ -1,5 +1,14 @@ # @tanstack/ai-sandbox-cloudflare +## 0.2.5 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-sandbox@0.2.5 + - @tanstack/ai-sandbox-local-process@0.2.0 + ## 0.2.4 ### Patch Changes diff --git a/packages/ai-sandbox-cloudflare/package.json b/packages/ai-sandbox-cloudflare/package.json index e8c644836..f47f6f1ac 100644 --- a/packages/ai-sandbox-cloudflare/package.json +++ b/packages/ai-sandbox-cloudflare/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-sandbox-cloudflare", - "version": "0.2.4", + "version": "0.2.5", "description": "Cloudflare sandbox provider for TanStack AI — run harness adapters inside Cloudflare Containers (edge) through the uniform SandboxHandle.", "author": "", "license": "MIT", diff --git a/packages/ai-sandbox/CHANGELOG.md b/packages/ai-sandbox/CHANGELOG.md index 6f3ee0dc9..2b4be3b3d 100644 --- a/packages/ai-sandbox/CHANGELOG.md +++ b/packages/ai-sandbox/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-sandbox +## 0.2.5 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.2.4 ### Patch Changes diff --git a/packages/ai-sandbox/package.json b/packages/ai-sandbox/package.json index 924b25279..6fab07e1b 100644 --- a/packages/ai-sandbox/package.json +++ b/packages/ai-sandbox/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-sandbox", - "version": "0.2.4", + "version": "0.2.5", "description": "Provider-agnostic sandbox layer for TanStack AI — run harness adapters inside isolated sandboxes (defineSandbox, defineWorkspace, withSandbox) with a uniform SandboxHandle, workspace bootstrap, policy, and resumable lifecycle.", "author": "", "license": "MIT", diff --git a/packages/ai-solid-ui/CHANGELOG.md b/packages/ai-solid-ui/CHANGELOG.md index 29c42b34b..511b609e3 100644 --- a/packages/ai-solid-ui/CHANGELOG.md +++ b/packages/ai-solid-ui/CHANGELOG.md @@ -1,5 +1,13 @@ # @tanstack/ai-solid-ui +## 0.7.15 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]: + - @tanstack/ai-client@0.23.0 + - @tanstack/ai-solid@0.16.0 + ## 0.7.14 ### Patch Changes diff --git a/packages/ai-solid-ui/package.json b/packages/ai-solid-ui/package.json index 17cdecd3b..5670e789d 100644 --- a/packages/ai-solid-ui/package.json +++ b/packages/ai-solid-ui/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-solid-ui", - "version": "0.7.14", + "version": "0.7.15", "description": "Headless Solid components for building TanStack AI chat interfaces with streamed message parts.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-solid/CHANGELOG.md b/packages/ai-solid/CHANGELOG.md index 1e502f29a..7c560cead 100644 --- a/packages/ai-solid/CHANGELOG.md +++ b/packages/ai-solid/CHANGELOG.md @@ -1,5 +1,26 @@ # @tanstack/ai-solid +## 0.16.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-client@0.23.0 + ## 0.15.1 ### Patch Changes diff --git a/packages/ai-solid/package.json b/packages/ai-solid/package.json index 2518689b1..f03de7491 100644 --- a/packages/ai-solid/package.json +++ b/packages/ai-solid/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-solid", - "version": "0.15.1", + "version": "0.16.0", "description": "Solid hooks for TanStack AI streaming chat, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-svelte/CHANGELOG.md b/packages/ai-svelte/CHANGELOG.md index 514279b95..a2b29c1f7 100644 --- a/packages/ai-svelte/CHANGELOG.md +++ b/packages/ai-svelte/CHANGELOG.md @@ -1,5 +1,26 @@ # @tanstack/ai-svelte +## 0.16.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-client@0.23.0 + ## 0.15.1 ### Patch Changes diff --git a/packages/ai-svelte/package.json b/packages/ai-svelte/package.json index ddb1e59b5..2c2606d6d 100644 --- a/packages/ai-svelte/package.json +++ b/packages/ai-svelte/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-svelte", - "version": "0.15.1", + "version": "0.16.0", "description": "Svelte 5 bindings for TanStack AI streaming chat, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-vue-ui/CHANGELOG.md b/packages/ai-vue-ui/CHANGELOG.md index c8db6f736..b81b32a14 100644 --- a/packages/ai-vue-ui/CHANGELOG.md +++ b/packages/ai-vue-ui/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/ai-vue-ui +## 0.2.35 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a)]: + - @tanstack/ai-vue@0.16.0 + ## 0.2.34 ### Patch Changes diff --git a/packages/ai-vue-ui/package.json b/packages/ai-vue-ui/package.json index 9036d8330..86801bccb 100644 --- a/packages/ai-vue-ui/package.json +++ b/packages/ai-vue-ui/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-vue-ui", - "version": "0.2.34", + "version": "0.2.35", "description": "Headless Vue components for building TanStack AI chat interfaces with streamed message parts.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai-vue/CHANGELOG.md b/packages/ai-vue/CHANGELOG.md index e7ed5fa20..6a2e02738 100644 --- a/packages/ai-vue/CHANGELOG.md +++ b/packages/ai-vue/CHANGELOG.md @@ -1,5 +1,26 @@ # @tanstack/ai-vue +## 0.16.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + - @tanstack/ai-client@0.23.0 + ## 0.15.1 ### Patch Changes diff --git a/packages/ai-vue/package.json b/packages/ai-vue/package.json index fc57375f0..abcce741b 100644 --- a/packages/ai-vue/package.json +++ b/packages/ai-vue/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai-vue", - "version": "0.15.1", + "version": "0.16.0", "description": "Vue composables for TanStack AI streaming chat, structured outputs, and media generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/ai/CHANGELOG.md b/packages/ai/CHANGELOG.md index a95900586..c5cedc767 100644 --- a/packages/ai/CHANGELOG.md +++ b/packages/ai/CHANGELOG.md @@ -1,5 +1,177 @@ # @tanstack/ai +## 0.43.0 + +### Minor Changes + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Adopt the AG-UI interrupt lifecycle for tool approvals, generic responses, and + client-tool execution, with typed bound resolvers, atomic batches, and + structured errors. Interrupts run ephemerally by resuming from the full client + message history in a fresh child run — no persistence required. + + This changes native approval and client-tool streams from legacy custom events + to snapshot-plus-`RUN_FINISHED` interrupt outcomes. Deprecated + `pendingInterrupts`, `addToolApprovalResponse`, raw `resumeInterrupts`, and + legacy event readers remain as limited compatibility surfaces for migration; + `addToolResult` remains supported. + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Make interrupt ownership explicit rather than assumed. + + An AG-UI `Interrupt` is a shared envelope — a workflow engine's durable + approval or another agent framework's pause can arrive on the same stream. What + makes a pause resumable through `chat()` is the binding this package attaches + under `tanstack:interruptBinding`. + - Interrupts that carry no binding this client understands now surface as + `kind: 'unbound'` with `canResolve: false`, instead of being given a + synthesized binding and rendered as resolvable generic interrupts. Resolving + those produced an answer submitted against a run with nothing pending, which + failed as `unknown-interrupt` only after the user had filled in the form. + Unbound items never block submission of the interrupts that are yours. + - The binding carries a wire version (`INTERRUPT_BINDING_VERSION`). Readers + reject a version they don't recognise rather than duck-typing its fields. A + binding written before the field existed is still read. + - `INTERRUPT_BINDING_METADATA_KEY`, `withInterruptBinding()` and + `readInterruptBinding()` are exported, so anything producing an interrupt this + package must later resume attaches the binding through a supported API + instead of copying the metadata key. + - Interrupt classification is driven by the binding alone. `Interrupt.reason` is + free-form AG-UI text another producer can also use, so it is now a display + hint only and never decides ownership. + - The interrupt protocol surface is enumerated instead of `export *`. The + unimplemented durable-recovery contract (`InterruptRecoveryStateV1`, + `InterruptRecoveryQuery`, the never-called `loadInterruptState` adapter hook, + and the `persistence-required` / `atomic-commit-unsupported` / + `recovery-unavailable` error codes) is removed rather than published. + +- [#970](https://github.com/TanStack/ai/pull/970) [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a) - Interrupts: the application owns wire-schema validation, and the hashing + dependency is gone. + + The library no longer transforms a generic interrupt's wire JSON Schema into a + validator or validates the resolved value against it, on either the client or + the server. Whatever you pass to `resolveInterrupt` (client) or send in the + `resume` batch (server) flows through as-is. Validate it yourself if you need to + trust it, e.g. with `z.fromJSONSchema(interrupt.responseSchema).safeParse(value)` + on the client and your own check on the server. Validation of a tool's + code-authored Standard Schema (`approvalSchema` / `inputSchema`) is unchanged. + + This drops the `ajv` and `ajv-formats` dependencies. Interrupt binding hashes and + resolution fingerprints now use a small bundled SHA-256 instead of + `@noble/hashes`, so that dependency is gone too. The wire hash shape + (`sha256:`) is unchanged. + +- [#541](https://github.com/TanStack/ai/pull/541) [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4) - **Add server-side memory via a `recall`/`save` adapter contract in `@tanstack/ai-memory`.** + + Memory is now a single, provider-agnostic contract with two verbs — `recall` and + `save` — which is the shape every memory backend (in-process, Redis, and hosted + vendors) naturally exposes. `memoryMiddleware` recalls relevant memory into the + system prompt (and optionally injects vendor tools) before the model runs, then + defers `save` of the finished turn via `ctx.defer` so streaming is never blocked. + Extraction, ranking, and rendering live inside each adapter — the middleware is thin. + + `@tanstack/ai-memory` (new package) — everything ships here: + - Root: `memoryMiddleware`, the `MemoryAdapter` contract + (`recall` / `save` / optional `inspect` / `listFacts`), and the `MemoryScope` / + `MemoryTurn` / `RecallResult` / `SaveReceipt` types. + - `@tanstack/ai-memory/in-memory` → `inMemory()` — zero-dependency adapter for dev, + tests, and single-process demos. Pass an `embedder` for semantic scoring and/or an + `extract` function to persist derived facts. + - `@tanstack/ai-memory/redis` → `redis({ redis, prefix? })` — production adapter for + plain Redis. `ioredis` wires in directly; `redis` (node-redis v4+) via the + `fromNodeRedis(client)` wrapper. Both are optional peer dependencies. + - `@tanstack/ai-memory/hindsight` → `hindsight()`, `@tanstack/ai-memory/mem0` → + `mem0()`, `@tanstack/ai-memory/honcho` → `honcho()` — hosted-vendor adapters. Their + SDKs (`@vectorize-io/hindsight-client`, `@honcho-ai/sdk`) are optional peers loaded + lazily; mem0 talks to its server over plain HTTP (no SDK). Vendors can expose LLM + tools through `recall` (e.g. hindsight's retain/recall/reflect). + - A shared `recall`/`save` contract-test suite (`@tanstack/ai-memory/tests/contract`) + that any adapter — including third-party ones — can run. + + `@tanstack/ai`: + - **Removes the (unreleased) `@tanstack/ai/memory` subpath.** The middleware, + contract, and helpers all moved to `@tanstack/ai-memory`. + + `@tanstack/ai-event-client`: + - The five `memory:*` devtools events (`memory:retrieve:started` / `:completed`, + `memory:persist:started` / `:completed`, `memory:error`) now carry recall/save + payloads (adapter id, fragment/receipt counts, `phase: 'recall' | 'save'`). + +- [#955](https://github.com/TanStack/ai/pull/955) [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288) - Resumable streams: reconnect to an in-flight SSE **or NDJSON** response without + re-running the provider. + + `toServerSentEventsResponse` and `toHttpResponse` both accept a + `durability: { adapter, batch }` option. The adapter (`StreamDurability`) + records every chunk to an ordered log before delivery and tags each event with + an opaque, adapter-owned offset — an SSE `id:` line, or the `id` of an NDJSON + `{ id, chunk }` envelope (NDJSON has no native event-id). A reconnect + (`Last-Event-ID`) or an explicit `?offset` read replays strictly after that + offset from the log — the lazy provider stream is never iterated on resume. + Producers terminalize the log on cancellation and failure (`RUN_ERROR` append + - `close()`) and on completion when the source stream emits its own terminal + event (`chat()` always does), so readers are never parked on a dead run. + + Two adapters ship: `memoryStream(request)` in `@tanstack/ai` (process-local, + for development and tests) and the new `@tanstack/ai-durable-stream` package, + a Durable Streams protocol adapter for production backends. + + For the `GET` handler that a reload or a second tab reconnects to, + `resumeServerSentEventsResponse({ adapter })` and `resumeHttpResponse({ adapter })` + replay a run straight from the durability log. They need no producer stream and + return a 400 when the request carries no resume offset. + + On the client, all four HTTP adapters are now resumable — `fetchServerSentEvents`, + `fetchHttpStream`, `xhrServerSentEvents`, and `xhrHttpStream`. Each tracks the + per-event offset, auto-reconnects with `Last-Event-ID`, de-duplicates the + replayed prefix, and exposes `joinRun(runId)` to attach to an in-flight or + finished run from the start (read-only GET with `offset=-1`). Untagged streams + behave exactly as before. A durable run that ends with no terminal event and no + forward progress now throws `DurableStreamIncompleteError` instead of hanging. + + Reconnection and durability are bounded so failures surface rather than hang or + loop: + - `memoryStream` evicts completed logs after a grace window (unbounded growth + is gone); resuming an expired/unknown run throws, and a from-start join to a + run that never produces fails after `MemoryStreamOptions.firstChunkDeadlineMs`. + - all four HTTP adapters accept `reconnect: { maxAttempts, delayMs }` — a + throttle plus a ceiling on CONSECUTIVE no-progress reconnects (default 5; + forward progress resets it) that fails with the new `StreamReconnectLimitError` + instead of reconnecting endlessly, without penalizing a healthy long-lived run. + - `durableStream` accepts `reconnect: { maxReadFailures, delayMs }` to bound its + read-retry loop, and `server` is now optional when `fetch` is provided (e.g. a + Cloudflare service binding). + - `toServerSentEventsResponse` accepts `debug` to record durability terminal / + close failures server-side, where a replaying joiner cannot observe them. + +- [#980](https://github.com/TanStack/ai/pull/980) [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa) - **Add a shared `Scope` identity type to `@tanstack/ai`.** + + `Scope` is the single identity/isolation vocabulary for the subsystems that + persist or recall per-conversation data — `@tanstack/ai-persistence` and + `@tanstack/ai-memory`. Rather than each subsystem inventing its own notion of + "whose data is this?", both import one type: + + ```ts + interface Scope { + threadId: string // required — the single conversation key (same as ctx.threadId) + userId?: string // durable end-user identity; required in practice for multi-user apps + tenantId?: string // multi-tenant boundary + namespace?: string // reserved logical partition; no subsystem keys on it yet + } + ``` + + `threadId` is the one conversation key across the codebase (matching + `ChatMiddlewareContext.threadId`, with `conversationId` already deprecated in + favor of it) — subsystems must not introduce a second name (`sessionId`, …) for + the same concept. Every field is an isolation boundary and must be derived + server-side from trusted session state, never from client input. + + Introduced ahead of the persistence and memory packages so both share one settled + identity contract. `@tanstack/ai-memory` now aliases `MemoryScope` to `Scope` + (see the memory-scope-threadid changeset). + +### Patch Changes + +- Updated dependencies [[`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371)]: + - @tanstack/ai-event-client@0.7.0 + ## 0.42.0 ### Minor Changes diff --git a/packages/ai/package.json b/packages/ai/package.json index 31cf76284..c29a16540 100644 --- a/packages/ai/package.json +++ b/packages/ai/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/ai", - "version": "0.42.0", + "version": "0.43.0", "description": "Type-safe TypeScript AI SDK for streaming chat, tool calling, agents, structured outputs, and multimodal generation.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/openai-base/CHANGELOG.md b/packages/openai-base/CHANGELOG.md index 16a2b786a..b2139d83a 100644 --- a/packages/openai-base/CHANGELOG.md +++ b/packages/openai-base/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/openai-base +## 0.9.10 + +### Patch Changes + +- Updated dependencies [[`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`3301398`](https://github.com/TanStack/ai/commit/330139878958fc5c5c167a69347c884fa35b792a), [`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288), [`4ce7600`](https://github.com/TanStack/ai/commit/4ce7600d5b543d4b7e3bd6d63cdf5ecf91cdeeaa)]: + - @tanstack/ai@0.43.0 + ## 0.9.9 ### Patch Changes diff --git a/packages/openai-base/package.json b/packages/openai-base/package.json index 63532ef4e..eb9241884 100644 --- a/packages/openai-base/package.json +++ b/packages/openai-base/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/openai-base", - "version": "0.9.9", + "version": "0.9.10", "description": "Shared OpenAI SDK base adapters for TanStack AI providers using Chat Completions and Responses APIs.", "author": "Tanner Linsley", "license": "MIT", diff --git a/packages/preact-ai-devtools/CHANGELOG.md b/packages/preact-ai-devtools/CHANGELOG.md index adf1ffa56..fa87087e4 100644 --- a/packages/preact-ai-devtools/CHANGELOG.md +++ b/packages/preact-ai-devtools/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/preact-ai-devtools +## 0.1.68 + +### Patch Changes + +- Updated dependencies [[`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371)]: + - @tanstack/ai-devtools-core@0.5.0 + ## 0.1.67 ### Patch Changes diff --git a/packages/preact-ai-devtools/package.json b/packages/preact-ai-devtools/package.json index c33f8246f..dbe39533d 100644 --- a/packages/preact-ai-devtools/package.json +++ b/packages/preact-ai-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/preact-ai-devtools", - "version": "0.1.67", + "version": "0.1.68", "description": "Preact Devtools plugin for inspecting TanStack AI chat messages, tool calls, streams, and errors.", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/react-ai-devtools/CHANGELOG.md b/packages/react-ai-devtools/CHANGELOG.md index 7f137cae6..a150d0bb9 100644 --- a/packages/react-ai-devtools/CHANGELOG.md +++ b/packages/react-ai-devtools/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/react-ai-devtools +## 0.2.68 + +### Patch Changes + +- Updated dependencies [[`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371)]: + - @tanstack/ai-devtools-core@0.5.0 + ## 0.2.67 ### Patch Changes diff --git a/packages/react-ai-devtools/package.json b/packages/react-ai-devtools/package.json index 18dc96f51..fabdc3642 100644 --- a/packages/react-ai-devtools/package.json +++ b/packages/react-ai-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/react-ai-devtools", - "version": "0.2.67", + "version": "0.2.68", "description": "React Devtools plugin for inspecting TanStack AI chat messages, tool calls, streams, and errors.", "author": "tannerlinsley", "license": "MIT", diff --git a/packages/solid-ai-devtools/CHANGELOG.md b/packages/solid-ai-devtools/CHANGELOG.md index b0b43c73c..6f34f18f6 100644 --- a/packages/solid-ai-devtools/CHANGELOG.md +++ b/packages/solid-ai-devtools/CHANGELOG.md @@ -1,5 +1,12 @@ # @tanstack/solid-ai-devtools +## 0.2.68 + +### Patch Changes + +- Updated dependencies [[`347b61b`](https://github.com/TanStack/ai/commit/347b61bc788bb816bbd12287c1a426ca7def00f4), [`cc88874`](https://github.com/TanStack/ai/commit/cc88874ecb0639daa1f8a8c32be5dcc9b2749371)]: + - @tanstack/ai-devtools-core@0.5.0 + ## 0.2.67 ### Patch Changes diff --git a/packages/solid-ai-devtools/package.json b/packages/solid-ai-devtools/package.json index 492ed6a9a..85cf57124 100644 --- a/packages/solid-ai-devtools/package.json +++ b/packages/solid-ai-devtools/package.json @@ -1,6 +1,6 @@ { "name": "@tanstack/solid-ai-devtools", - "version": "0.2.67", + "version": "0.2.68", "description": "Solid Devtools plugin for inspecting TanStack AI chat messages, tool calls, streams, and errors.", "author": "Tanner Linsley", "license": "MIT",