Commit 71262b6
Merge branch 'main' into worktree-serialized-exploring-wall
Reconcile the typed-stream-chunks feature with main's typed-runtime-context
(#628) and multimodal-tool-result (#666) work, which had diverged on the same
hot paths. Key conflict resolutions:
- types.ts: keep the branch's Pick<>-based event interfaces + TypedStreamChunk
machinery; layer in main's `usage?: TokenUsage`, multimodal
`result?: string | Array<ContentPart>`, and `state?: ToolOutputState` on
ToolCallEndEvent (added `state` to the drift-guard Omit). Switched the
typed-chunk constraints from `Tool<any,any,any>` to main's `AnyTool` (its
bivariant `execute` is what lets concrete tools satisfy the constraint).
- chat/index.ts: unify the two generic systems — main's `const TTools`
inference (for context) now also feeds the branch's
`TextActivityResult<…, TTools>` so streaming tool-call events stay typed.
`tools?` widened to ReadonlyArray so const-inferred tuples / mergeAgentTools'
readonly return fit. Removed now-unnecessary `as StreamChunk` casts (the
literal `type` discriminators check structurally).
- tool-calls.ts: executeTools keeps both the branch's typed `output` and main's
`normalizeToolResult`/`state`/typed `executionContext`.
- chat-params.ts: mergeAgentTools stays generic over `const TServerTools`
(constrained to AnyTool) for name narrowing.
- createChatOptions: preserve the concrete tool tuple in the return type while
threading main's InferredContext.
Validated: @tanstack/ai type-check + 1006 unit tests + 0 lint errors; affected
workspace type-check (32 projects), unit tests (31), eslint, and build all pass.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>626 files changed
Lines changed: 48986 additions & 6648 deletions
File tree
- .changeset
- .github/workflows
- docs
- adapters
- advanced
- api
- chat
- getting-started
- media
- migration
- protocol
- reference
- classes
- functions
- interfaces
- type-aliases
- structured-outputs
- tools
- examples
- ts-code-mode-web/src/lib
- ts-react-chat
- public
- scripts
- src
- components
- lib
- routes
- ts-react-native-chat
- scripts
- src
- server
- packages
- ai-anthropic
- src
- adapters
- tests
- ai-client
- src
- tests
- ai-code-mode-skills
- src
- storage
- ai-code-mode
- models-eval
- src
- bindings
- tests
- ai-devtools
- src
- components
- conversation
- hooks
- list
- utils
- store
- styles
- tests
- ai-elevenlabs
- ai-event-client
- src
- tests
- ai-fal
- ai-gemini
- src
- adapters
- experimental
- text-interactions
- tests
- ai-grok
- src/adapters
- tests
- ai-groq
- ai-isolate-cloudflare
- ai-isolate-node
- ai-isolate-quickjs
- ai-ollama
- src
- adapters
- tests
- ai-openai
- src
- adapters
- compatible
- tests
- ai-openrouter
- src
- adapters
- tests
- ai-preact
- src
- tests
- ai-react-ui
- ai-react
- src
- tests
- ai-solid-ui
- ai-solid
- src
- tests
- ai-svelte
- src
- tests
- ai-vue-ui
- ai-vue
- src
- tests
- ai
- skills/ai-core/adapter-configuration
- src
- activities
- chat
- middleware
- stream
- tools
- generateAudio
- generateSpeech
- utilities
- tests
- openai-base
- src
- adapters
- tests
- preact-ai-devtools
- src
- react-ai-devtools
- src
- solid-ai-devtools
- src
- scripts
- testing
- e2e
- fixtures
- audio-gen
- stateful-interactions
- tools-test
- tts
- src
- components
- lib
- routes
- $provider
- tests
- tools-test
- react-native-smoke
- scripts
- src
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
| 4 | + | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | | - | |
| 65 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | | - | |
| 62 | + | |
63 | 63 | | |
64 | 64 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
| 28 | + | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
72 | 72 | | |
73 | 73 | | |
74 | 74 | | |
| 75 | + | |
75 | 76 | | |
76 | 77 | | |
77 | 78 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
18 | 21 | | |
19 | 22 | | |
20 | 23 | | |
| |||
215 | 218 | | |
216 | 219 | | |
217 | 220 | | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
218 | 249 | | |
219 | 250 | | |
220 | 251 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
189 | | - | |
| 189 | + | |
190 | 190 | | |
191 | 191 | | |
192 | 192 | | |
| |||
0 commit comments