Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 0 additions & 53 deletions .changeset/resumable-streams.md

This file was deleted.

9 changes: 9 additions & 0 deletions examples/ag-ui/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# ag-ui

## 0.0.3

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai-client@0.23.0
- @tanstack/ai-react@0.18.2
- @tanstack/ai-react-ui@0.8.16

## 0.0.2

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion examples/ag-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
8 changes: 8 additions & 0 deletions packages/ai-acp/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @tanstack/ai-acp

## 0.2.4

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0
- @tanstack/ai-sandbox@0.2.5

## 0.2.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-acp/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions packages/ai-angular/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @tanstack/ai-angular

## 0.3.2

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0
- @tanstack/ai-client@0.23.0

## 0.3.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-angular/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/ai-angular",
"version": "0.3.1",
"version": "0.3.2",
"description": "Angular signals integration for TanStack AI streaming chat, structured outputs, and media generation.",
"author": "",
"license": "MIT",
Expand Down
7 changes: 7 additions & 0 deletions packages/ai-anthropic/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/ai-anthropic

## 0.16.4

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0

## 0.16.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-anthropic/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions packages/ai-bedrock/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @tanstack/ai-bedrock

## 0.1.5

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0
- @tanstack/openai-base@0.9.10

## 0.1.4

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-bedrock/package.json
Original file line number Diff line number Diff line change
@@ -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": "",
Expand Down
8 changes: 8 additions & 0 deletions packages/ai-claude-code/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @tanstack/ai-claude-code

## 0.2.4

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0
- @tanstack/ai-sandbox@0.2.5

## 0.2.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-claude-code/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
55 changes: 55 additions & 0 deletions packages/ai-client/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,60 @@
# @tanstack/ai-client

## 0.23.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 [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0

## 0.22.1

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-client/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions packages/ai-code-mode-skills/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @tanstack/ai-code-mode-skills

## 0.3.12

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0
- @tanstack/ai-code-mode@0.3.9

## 0.3.11

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-code-mode-skills/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/ai-code-mode/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/ai-code-mode

## 0.3.9

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0

## 0.3.8

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-code-mode/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
8 changes: 8 additions & 0 deletions packages/ai-codex/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# @tanstack/ai-codex

## 0.2.4

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0
- @tanstack/ai-sandbox@0.2.5

## 0.2.3

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-codex/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
7 changes: 7 additions & 0 deletions packages/ai-devtools/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# @tanstack/ai-devtools-core

## 0.4.25

### Patch Changes

- Updated dependencies [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0

## 0.4.24

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/ai-devtools/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@tanstack/ai-devtools-core",
"version": "0.4.24",
"version": "0.4.25",
"description": "Core TanStack AI Devtools plugin for inspecting chat messages, tool calls, streams, and errors.",
"author": "Tanner Linsley",
"license": "MIT",
Expand Down
56 changes: 56 additions & 0 deletions packages/ai-durable-stream/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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 [[`7c7aa09`](https://github.com/TanStack/ai/commit/7c7aa09a7402b45e6285ebc78a606131aec3e288)]:
- @tanstack/ai@0.43.0
Loading