Skip to content

Commit 11ce2a1

Browse files
ci: Version Packages (#670)
Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent a452ae8 commit 11ce2a1

63 files changed

Lines changed: 800 additions & 127 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.changeset/multimodal-tool-results.md

Lines changed: 0 additions & 15 deletions
This file was deleted.

.changeset/runerror-raw-event.md

Lines changed: 0 additions & 30 deletions
This file was deleted.

.changeset/typed-runtime-context.md

Lines changed: 0 additions & 52 deletions
This file was deleted.

packages/ai-anthropic/CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,44 @@
11
# @tanstack/ai-anthropic
22

3+
## 0.12.0
4+
5+
### Minor Changes
6+
7+
- [#666](https://github.com/TanStack/ai/pull/666) [`c1ae8b9`](https://github.com/TanStack/ai/commit/c1ae8b94c83d70508975568eb4fc9b45f1af540b) - feat: support multimodal (image) tool results
8+
9+
Tools may now return an `Array<ContentPart>` (e.g. a text part plus an image part) and have it transmitted to the model as structured multimodal tool output instead of a `JSON.stringify`'d blob. This unblocks use cases like returning a screenshot from a tool so the model can see it (issue [#363](https://github.com/TanStack/ai/issues/363)).
10+
- Detection is structural and opt-in by shape: a tool that returns a non-empty array whose every element is a valid `ContentPart` is passed through unchanged; strings and all other return values are serialized exactly as before, so there are no breaking changes.
11+
- The OpenAI Responses, Anthropic, and Google Gemini adapters convert the content parts into their native multimodal tool-output formats (`function_call_output.output`, `tool_result` content blocks, and `functionResponse.parts` respectively). Providers on the Chat Completions path (Groq, Ollama, Grok, OpenRouter chat) fall back to stringifying, which their APIs require.
12+
- AG-UI stream events (`TOOL_CALL_RESULT.content`, `TOOL_CALL_END.result`) remain string-only per the spec; the multimodal array travels on the tool message itself.
13+
14+
- [#673](https://github.com/TanStack/ai/pull/673) [`a452ae8`](https://github.com/TanStack/ai/commit/a452ae8bcda8abfdc6309983976ed0fbf6df1915) - Populate AG-UI `rawEvent` on `RUN_ERROR` events with the provider's structured error body.
15+
16+
Previously, when a streaming chat call failed the `RUN_ERROR` event carried only an
17+
opaque `{ message, code }` headline (e.g. `"Provider returned error"`), and no adapter
18+
populated AG-UI's purpose-built `rawEvent` field — so the upstream provider detail was
19+
unrecoverable.
20+
21+
Adapters now forward the provider's **structured error body** (e.g. an SDK `APIError`'s
22+
parsed `.error` response body, or OpenRouter's mid-stream `chunk.error`) as `rawEvent`
23+
on the `RUN_ERROR` event. The new `toRunErrorRawEvent` helper extracts only known
24+
provider-body fields — never the raw SDK exception object, which can carry request
25+
metadata such as auth headers. The `{ message, code }` contract of `toRunErrorPayload`
26+
is unchanged.
27+
28+
The error surfaced to consumers via the `ChatClient` / `useChat` `error` (and the
29+
`onError` callback) now also carries `code` and `rawEvent` when present, so the upstream
30+
cause is recoverable in application code.
31+
32+
> Note: the OpenRouter SDK parses each in-band stream chunk's `error` through a strict
33+
> schema (`{ code, message }`), so provider `metadata` survives only on pre-stream HTTP
34+
> errors (rate-limit / overload / BYOK rejection), whose typed error class exposes the
35+
> full body via `.error`.
36+
37+
### Patch Changes
38+
39+
- Updated dependencies [[`c1ae8b9`](https://github.com/TanStack/ai/commit/c1ae8b94c83d70508975568eb4fc9b45f1af540b), [`a452ae8`](https://github.com/TanStack/ai/commit/a452ae8bcda8abfdc6309983976ed0fbf6df1915), [`8036b50`](https://github.com/TanStack/ai/commit/8036b5054330a180023c6e3225b8d2735a43a919)]:
40+
- @tanstack/ai@0.24.0
41+
342
## 0.11.2
443

544
### Patch Changes

packages/ai-anthropic/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/ai-anthropic",
3-
"version": "0.11.2",
3+
"version": "0.12.0",
44
"description": "Anthropic Claude adapter for TanStack AI chat, tool calling, thinking, and structured outputs.",
55
"author": "",
66
"license": "MIT",

packages/ai-client/CHANGELOG.md

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,63 @@
11
# @tanstack/ai-client
22

3+
## 0.15.0
4+
5+
### Minor Changes
6+
7+
- [#666](https://github.com/TanStack/ai/pull/666) [`c1ae8b9`](https://github.com/TanStack/ai/commit/c1ae8b94c83d70508975568eb4fc9b45f1af540b) - feat: support multimodal (image) tool results
8+
9+
Tools may now return an `Array<ContentPart>` (e.g. a text part plus an image part) and have it transmitted to the model as structured multimodal tool output instead of a `JSON.stringify`'d blob. This unblocks use cases like returning a screenshot from a tool so the model can see it (issue [#363](https://github.com/TanStack/ai/issues/363)).
10+
- Detection is structural and opt-in by shape: a tool that returns a non-empty array whose every element is a valid `ContentPart` is passed through unchanged; strings and all other return values are serialized exactly as before, so there are no breaking changes.
11+
- The OpenAI Responses, Anthropic, and Google Gemini adapters convert the content parts into their native multimodal tool-output formats (`function_call_output.output`, `tool_result` content blocks, and `functionResponse.parts` respectively). Providers on the Chat Completions path (Groq, Ollama, Grok, OpenRouter chat) fall back to stringifying, which their APIs require.
12+
- AG-UI stream events (`TOOL_CALL_RESULT.content`, `TOOL_CALL_END.result`) remain string-only per the spec; the multimodal array travels on the tool message itself.
13+
14+
- [#628](https://github.com/TanStack/ai/pull/628) [`8036b50`](https://github.com/TanStack/ai/commit/8036b5054330a180023c6e3225b8d2735a43a919) - Add typed runtime context for tools and middleware.
15+
16+
Tools and middleware can now declare the runtime context shape they require, and
17+
`chat()`, `ChatClient`, and the framework `useChat` / `createChat` hooks infer
18+
the merged requirement and type-check the `context` option you pass against it.
19+
20+
```typescript
21+
type AppContext = { userId: string; db: Db }
22+
23+
const listNotes = toolDefinition({
24+
name: 'list_notes' /* ... */,
25+
}).server<AppContext>((_input, ctx) =>
26+
ctx.context.db.notes.findMany({ userId: ctx.context.userId }),
27+
)
28+
29+
chat({
30+
adapter,
31+
messages,
32+
tools: [listNotes],
33+
context: { userId, db }, // required and type-checked because listNotes declares AppContext
34+
})
35+
```
36+
37+
Runtime context is request-local application state for tool and middleware
38+
implementations (authenticated users, database clients, tenancy, feature flags,
39+
loggers, browser services). It is never sent to the model and is distinct from
40+
the AG-UI `RunAgentInput.context` protocol field.
41+
42+
Untyped tools and middleware continue to receive `unknown` context and do not
43+
force a `context` option. Client tools receive client-local context via
44+
`ChatClient` / `useChat`; use `forwardedProps` to hand serializable client data
45+
to the server and map it into server context explicitly. See the new Runtime
46+
Context guide for details.
47+
48+
Behavior change: tool output validation now also runs when a tool returns
49+
`undefined` or `null`. Previously these values bypassed `outputSchema`
50+
validation entirely; now the schema decides whether they are valid, so a tool
51+
whose schema forbids `undefined`/`null` surfaces a validation error
52+
(`output-error`) instead of silently passing. Tools whose schema permits
53+
`null`/`undefined` (e.g. nullable or void outputs) are unaffected.
54+
55+
### Patch Changes
56+
57+
- Updated dependencies [[`c1ae8b9`](https://github.com/TanStack/ai/commit/c1ae8b94c83d70508975568eb4fc9b45f1af540b), [`a452ae8`](https://github.com/TanStack/ai/commit/a452ae8bcda8abfdc6309983976ed0fbf6df1915), [`8036b50`](https://github.com/TanStack/ai/commit/8036b5054330a180023c6e3225b8d2735a43a919)]:
58+
- @tanstack/ai@0.24.0
59+
- @tanstack/ai-event-client@0.4.3
60+
361
## 0.14.1
462

563
### Patch Changes

packages/ai-client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/ai-client",
3-
"version": "0.14.1",
3+
"version": "0.15.0",
44
"description": "Framework-agnostic headless client for TanStack AI chat, realtime sessions, streaming transports, and media generations.",
55
"author": "",
66
"license": "MIT",

packages/ai-code-mode-skills/CHANGELOG.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,56 @@
11
# @tanstack/ai-code-mode-skills
22

3+
## 0.2.0
4+
5+
### Minor Changes
6+
7+
- [#628](https://github.com/TanStack/ai/pull/628) [`8036b50`](https://github.com/TanStack/ai/commit/8036b5054330a180023c6e3225b8d2735a43a919) - Add typed runtime context for tools and middleware.
8+
9+
Tools and middleware can now declare the runtime context shape they require, and
10+
`chat()`, `ChatClient`, and the framework `useChat` / `createChat` hooks infer
11+
the merged requirement and type-check the `context` option you pass against it.
12+
13+
```typescript
14+
type AppContext = { userId: string; db: Db }
15+
16+
const listNotes = toolDefinition({
17+
name: 'list_notes' /* ... */,
18+
}).server<AppContext>((_input, ctx) =>
19+
ctx.context.db.notes.findMany({ userId: ctx.context.userId }),
20+
)
21+
22+
chat({
23+
adapter,
24+
messages,
25+
tools: [listNotes],
26+
context: { userId, db }, // required and type-checked because listNotes declares AppContext
27+
})
28+
```
29+
30+
Runtime context is request-local application state for tool and middleware
31+
implementations (authenticated users, database clients, tenancy, feature flags,
32+
loggers, browser services). It is never sent to the model and is distinct from
33+
the AG-UI `RunAgentInput.context` protocol field.
34+
35+
Untyped tools and middleware continue to receive `unknown` context and do not
36+
force a `context` option. Client tools receive client-local context via
37+
`ChatClient` / `useChat`; use `forwardedProps` to hand serializable client data
38+
to the server and map it into server context explicitly. See the new Runtime
39+
Context guide for details.
40+
41+
Behavior change: tool output validation now also runs when a tool returns
42+
`undefined` or `null`. Previously these values bypassed `outputSchema`
43+
validation entirely; now the schema decides whether they are valid, so a tool
44+
whose schema forbids `undefined`/`null` surfaces a validation error
45+
(`output-error`) instead of silently passing. Tools whose schema permits
46+
`null`/`undefined` (e.g. nullable or void outputs) are unaffected.
47+
48+
### Patch Changes
49+
50+
- Updated dependencies [[`c1ae8b9`](https://github.com/TanStack/ai/commit/c1ae8b94c83d70508975568eb4fc9b45f1af540b), [`a452ae8`](https://github.com/TanStack/ai/commit/a452ae8bcda8abfdc6309983976ed0fbf6df1915), [`8036b50`](https://github.com/TanStack/ai/commit/8036b5054330a180023c6e3225b8d2735a43a919)]:
51+
- @tanstack/ai@0.24.0
52+
- @tanstack/ai-code-mode@0.2.0
53+
354
## 0.1.24
455

556
### Patch Changes

packages/ai-code-mode-skills/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@tanstack/ai-code-mode-skills",
3-
"version": "0.1.24",
3+
"version": "0.2.0",
44
"description": "Persistent runtime skill library for TanStack AI Code Mode agents and sandboxed tool orchestration.",
55
"author": "",
66
"license": "MIT",

packages/ai-code-mode/CHANGELOG.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,55 @@
11
# @tanstack/ai-code-mode
22

3+
## 0.2.0
4+
5+
### Minor Changes
6+
7+
- [#628](https://github.com/TanStack/ai/pull/628) [`8036b50`](https://github.com/TanStack/ai/commit/8036b5054330a180023c6e3225b8d2735a43a919) - Add typed runtime context for tools and middleware.
8+
9+
Tools and middleware can now declare the runtime context shape they require, and
10+
`chat()`, `ChatClient`, and the framework `useChat` / `createChat` hooks infer
11+
the merged requirement and type-check the `context` option you pass against it.
12+
13+
```typescript
14+
type AppContext = { userId: string; db: Db }
15+
16+
const listNotes = toolDefinition({
17+
name: 'list_notes' /* ... */,
18+
}).server<AppContext>((_input, ctx) =>
19+
ctx.context.db.notes.findMany({ userId: ctx.context.userId }),
20+
)
21+
22+
chat({
23+
adapter,
24+
messages,
25+
tools: [listNotes],
26+
context: { userId, db }, // required and type-checked because listNotes declares AppContext
27+
})
28+
```
29+
30+
Runtime context is request-local application state for tool and middleware
31+
implementations (authenticated users, database clients, tenancy, feature flags,
32+
loggers, browser services). It is never sent to the model and is distinct from
33+
the AG-UI `RunAgentInput.context` protocol field.
34+
35+
Untyped tools and middleware continue to receive `unknown` context and do not
36+
force a `context` option. Client tools receive client-local context via
37+
`ChatClient` / `useChat`; use `forwardedProps` to hand serializable client data
38+
to the server and map it into server context explicitly. See the new Runtime
39+
Context guide for details.
40+
41+
Behavior change: tool output validation now also runs when a tool returns
42+
`undefined` or `null`. Previously these values bypassed `outputSchema`
43+
validation entirely; now the schema decides whether they are valid, so a tool
44+
whose schema forbids `undefined`/`null` surfaces a validation error
45+
(`output-error`) instead of silently passing. Tools whose schema permits
46+
`null`/`undefined` (e.g. nullable or void outputs) are unaffected.
47+
48+
### Patch Changes
49+
50+
- Updated dependencies [[`c1ae8b9`](https://github.com/TanStack/ai/commit/c1ae8b94c83d70508975568eb4fc9b45f1af540b), [`a452ae8`](https://github.com/TanStack/ai/commit/a452ae8bcda8abfdc6309983976ed0fbf6df1915), [`8036b50`](https://github.com/TanStack/ai/commit/8036b5054330a180023c6e3225b8d2735a43a919)]:
51+
- @tanstack/ai@0.24.0
52+
353
## 0.1.24
454

555
### Patch Changes

0 commit comments

Comments
 (0)