@reinsjs/adapter-tanstack-ai 0.5.2 → 0.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,65 @@
1
1
  # @reinsjs/adapter-tanstack-ai
2
2
 
3
+ ## 0.6.0
4
+
5
+ ### Minor Changes
6
+
7
+ - cf87a07: `runLoop` no longer yields the new session's opening events on a handoff; it yields only events of its own `sessionId`. Before, the summary note and trigger message written into the new session were yielded to the old session's consumer, so `createAgentHandler` streamed them on the old session's SSE stream (ids going back to 1, 2 before the old session's `run_ended`), AG-UI clients showed the trigger message in the old thread, a reconnect with that `Last-Event-ID` replayed most of the old session, and `onEvent` reported them under the old `sessionId`. The opening is still written to the log; read it from `toSessionId`. The TanStack adapter likewise no longer passes them to `onEvent`.
8
+ - 53c5561: Handoff now records who really wrote each opening event of the new session. The summary note used to be a host note (`actor: "host"`, system trust) and the trigger message a user message (`actor: "user"`, principal trust), even when the model wrote both — so a `triggerMessage` the model was talked into by a tool result showed up in the new session as the user's own instruction. Now the summary is recorded as `intent.by` (default `"model"`), and so is the trigger message unless it repeats one of the old session's user messages word for word, in which case it keeps that message's `actor` and trust (the user's stays the user's, a host-written one the host's) and `provenance.ref` points at that message. The summary and self-written trigger messages carry `provenance: { source: "handoff", ref: <core.handoff event id> }`. The shape is built by the new export `handoffOpeningDrafts`, shared by `runLoop` and the TanStack adapter. Event types, payloads and what the model sees are unchanged; code that filtered the new session by `actor` (for example "the user's first message") should read the event type or `provenance` instead.
9
+ - a74c719: Host tools can now declare their risk to the brain: `toolDefinition({ …, metadata: { reins: { risk: "low" } } })` (type `ReinsToolMetadata`, also `replayable`). Before, the read-only view of a TanStack tool never carried a risk, so `approval()`'s default `byRisk` asked a human before every host tool call — the README's `approval({ ask: ["deploy"] })` paused on read-only tools too — and every call logged a `tool_started`. Tools without the declaration behave as before (fail-closed: asked about, not replayable); an invalid value is treated as undeclared and reported once through `warn`. `viewOfTanstackTool` takes an optional options object (`{ warn }`) as its second argument; it is an object rather than a function so that `tools.map(viewOfTanstackTool)`, which passes the array index there, stays harmless.
10
+ - 0fc255a: Answers to TanStack's native approvals (tools with a static `needsApproval: true`) are now logged, and an approval that edits the arguments no longer runs them.
11
+
12
+ **Logging.** Approving a native card left no `approval_decision` and no `run_resumed`, so the log could not tell who let the call through, and `approval({ ttlMs })` never saw the approval. Answers sent with `resume` are now recorded at the start of the resumed run, before any tool runs, server or client: a `run_resumed` (carrying the first answer's `by`), then `approval_decision` with `by: "tanstack"`, the same order as `runLoop`. Answers carried by `UIMessage` `approval-responded` parts are recorded just before a server tool runs, and the brain's `beforeTool` checks (such as an expired `ttlMs`) run again at that point. For a client tool answered through those parts, the decision is still recorded only when the client's result arrives, as approved unless that result is an error. Only calls still waiting for approval get a decision.
13
+
14
+ **Breaking for hosts that use `editedArgs`.** An approval whose `editedArgs` differ from the arguments the model wrote used to execute with the edited arguments while the log kept the original call, so the timeline disagreed with what happened. Such a call is now handed to the engine as cancelled — neither a server tool nor a client tool runs — and logged as approved plus a second `approval_decision` (`by: "reins"`) whose reason, also shown to the model, names the edited arguments, so the model can make the call again. Hosts relying on edit-then-approve must ask the model to re-issue the call instead. Also, before a server tool runs, the call text the engine is about to execute is compared with the logged call (parsed the same way, without the schema, so a non-deterministic schema default does not count) and the call is skipped if they differ.
15
+
16
+ - b5ade5e: A tool call now raises exactly one approval interrupt, which changes which interrupt a client receives. Before, a reins tool declaring `needsApproval: true` (such as an MCP tool with `destructiveHint`) got both TanStack's native approval and `reinsApprovalInterrupt` for the same call: a client answering only the reins one had the resume rejected by the engine and the run ended in an error.
17
+
18
+ - Reins tools are now asked only through `reinsApprovalInterrupt`. A client that answered the native `approval_<id>` card for them must answer the reins interrupt instead.
19
+ - A host tool with a static `needsApproval: true` that a socket (such as `approval()`) also wants to ask about is asked only through TanStack's native approval; the `approval_request` records the socket's policy and summary. A client that answered the reins interrupt for such a call must answer the native card instead; a `reinsApprovalInterrupt` answer pointing at such a call is ignored with a warning.
20
+
21
+ ### Patch Changes
22
+
23
+ - 3830f23: `budget_usage.contextEstimate` now estimates the view actually sent to the model, after `beforeModel` patches and the notes injected during `beforeModel`. Before, it was the projection estimate taken before injection, so a large injected note (such as a pins snapshot at a segment start) was counted as fixed overhead and then counted again on the next turn once it was in the timeline. That made the next turn's perception reading, compact's soft-line requests and the threshold fallback all overestimate the context, and could fold old turns while real usage was far below the line.
24
+ - 040768e: `ext.*` events a socket writes during `beforeModel` no longer join that turn's view. They are not sent to the model, but they were counted in the estimate of what was sent, so the calibrated fixed overhead (`contextOverheadOf`) came out too low. "Hidden from the model by default" now has one definition, exported as `isModelInvisibleByDefault` (the operational event types plus the `ext.` prefix), used by `visibilityFilter`, `runLoop` and the TanStack AI middleware.
25
+ - e366aef: `reinsApprovalInterrupt` answers are now recorded only for calls of this session that are waiting for approval (an `approval_request` and no decision yet, at most one answer per call), the same check `runLoop` and the server apply. TanStack does not sign generic-interrupt continuations, so a client could copy a valid entry, change its `key`, and get an `approval_decision` written for any id, including one the model had not produced yet; when the model later emitted that id, the call ran without being asked about. Such answers are now dropped with a warning.
26
+ - c89523d: A socket block on a client tool (one without `execute`, including an `approval()` deny or a rewrite of a call on TanStack's native approval card) now stops the call: the middleware adds it to the engine's `cancelledToolCallIds` at the `beforeTools` boundary, so the client is never asked to run it. Previously the engine still handed the call to the client, and when the client's result came back it was logged as "Tool call blocked … not executed", replacing what had really happened. If the block cannot be enforced (a middleware placed before reins replaces the engine's cancel set with a copy), the real result is now logged as it came back, followed by a `core.error` (category `tanstack-ai`, not shown to the model) saying the block was not enforced.
27
+ - 456cdf2: `TANSTACK_LOSS_MATRIX` now declares every landing `toModelMessages` can report: host extension events under the wildcard key `"ext.*"` (dropped, same convention as `@reinsjs/lowering-pi`), and `core.tools_bound` (dropped as an operational event; it reaches the translator only when a `beforeModel` patch replaces the projected events). Before, both were reported to `onLandings` as dropped but had no entry in the table, so a host checking landings against it saw an undeclared type.
28
+ - 2a0f4b2: TanStack's native lazy tools (`lazy: true`) now work within a run. After the model called the discovery tool, the middleware handed the engine its start-of-run tool list again on the next turn, overwriting the engine's updated list: the model never saw the discovered tool, and calling it anyway returned "Unknown tool". The middleware now adds tools the engine brings in mid-run (and drops the discovery tool once the engine does), placing them after the other host tools. The engine's discovery tool is treated as read-only (`risk: "low"`), so `approval()` with its default risk rules no longer asks a human before the model looks tools up.
29
+ - fa0e6c9: A reins tool whose `needsApproval` function throws is now handled as in `runLoop`: the call is not executed, the model gets `Approval check failed: <message>`, and a `core.error` (category `host`, `detail.phase: "needsApproval"`) records it for the host. Before, the error escaped `chat()` and left the tool call without a result, which later requests did not repair.
30
+
31
+ Client-side reins tools contributed by a socket (no `execute`) are now cancelled through the engine when a socket blocks them, an approval is denied, or the check above fails, like the host's own client tools. Before, only the host's TanStack client tools were recognised, so the engine still handed such a call to the frontend and the result it sent back was then replaced by the block message.
32
+
33
+ - 237ddd6: An image already in the log whose type is outside `image/jpeg`, `image/png`, `image/gif` and `image/webp` is no longer handed to TanStack AI as is (the provider would reject it on every request). Like the two lowering packages, the adapter puts the core `unsupportedImageText` sentence in its place and records the event `lossy`, declared in `TANSTACK_LOSS_MATRIX`.
34
+ - e46e287: `reinsMiddleware()` now checks `capabilities.contextWindow` and `projection.reserveTokens` when it is created, with the same check as `runLoop` (`resolveReserveTokens`), and throws a `RangeError` for a bad window or reserve. Before, the error only surfaced at the first projection, after `tools_bound` and the imported user messages were already in the log, so the session looked interrupted.
35
+ - Updated dependencies [729f892]
36
+ - Updated dependencies [e04c188]
37
+ - Updated dependencies [3830f23]
38
+ - Updated dependencies [60b6052]
39
+ - Updated dependencies [9856645]
40
+ - Updated dependencies [b4de7f3]
41
+ - Updated dependencies [4a2f5b6]
42
+ - Updated dependencies [6eb8b09]
43
+ - Updated dependencies [cf87a07]
44
+ - Updated dependencies [53c5561]
45
+ - Updated dependencies [afcc7b7]
46
+ - Updated dependencies [040768e]
47
+ - Updated dependencies [5703a3e]
48
+ - Updated dependencies [da6250a]
49
+ - Updated dependencies [6cd00cd]
50
+ - Updated dependencies [b086f75]
51
+ - Updated dependencies [7e4f674]
52
+ - Updated dependencies [9291394]
53
+ - Updated dependencies [9d47f4d]
54
+ - Updated dependencies [01b9440]
55
+ - Updated dependencies [7a7fbe4]
56
+ - Updated dependencies [1c6fc8c]
57
+ - Updated dependencies [246c457]
58
+ - Updated dependencies [252764c]
59
+ - Updated dependencies [bdfdc7c]
60
+ - Updated dependencies [5c36bfd]
61
+ - @reinsjs/core@0.18.0
62
+
3
63
  ## 0.5.2
4
64
 
5
65
  ### Patch Changes
package/README.md CHANGED
@@ -9,12 +9,20 @@ pnpm add @reinsjs/adapter-tanstack-ai @tanstack/ai@0.53.0
9
9
  ```ts
10
10
  import { reinsApprovalInterrupt, reinsMiddleware } from "@reinsjs/adapter-tanstack-ai"
11
11
  import { approval, compact, perception, spill } from "@reinsjs/brain"
12
- import { chat } from "@tanstack/ai"
12
+ import { chat, toolDefinition } from "@tanstack/ai"
13
+
14
+ // approval() asks about every tool whose risk it does not know: declare it on read-only host tools
15
+ const lookup = toolDefinition({
16
+ name: "lookup",
17
+ description: "Look up an order",
18
+ inputSchema,
19
+ metadata: { reins: { risk: "low" } },
20
+ }).server(findOrder)
13
21
 
14
22
  const stream = chat({
15
23
  adapter,
16
24
  messages,
17
- tools,
25
+ tools: [lookup, deploy],
18
26
  systemPrompts: ["You are…"],
19
27
  middleware: [
20
28
  reinsMiddleware({
@@ -34,13 +42,19 @@ const stream = chat({
34
42
  - **`onConfig(init)`** reads the log (fail-closed on unknown events), merges the brain's static tools and prompt fragment, and imports the client's new user messages. Import is idempotent: a network retry that re-sends the same request does not write the message twice (key = message `id` if present, else its position in the client array, plus exact content).
35
43
  - **`onConfig(beforeModel)`** replaces `providerMessages` with the projection of the log — TanStack's own `messages` array only serves the UI.
36
44
  - **`onChunk` / `onUsage`** append the model's blocks and a `budget_usage` event.
37
- - **`onInterruptBoundary(beforeTools)`** runs the socket pipeline for every pending call; a `defer` becomes a `reinsApprovalInterrupt` so the run pauses and the client resumes it with `resume`. `onInterruptResolution` records the answer as `approval_decision`.
45
+ - **`onInterruptBoundary(beforeTools)`** runs the socket pipeline for every pending call; a `defer` becomes a `reinsApprovalInterrupt` so the run pauses and the client resumes it with `resume`. `onInterruptResolution` records an answer as `approval_decision` only when it points at a call of this session that is waiting for approval on a reins card (one answer per call); other answers are dropped with a warning. A `run_resumed` comes first, as in the default loop.
38
46
  - **`onAfterToolCall` / `onToolPhaseComplete`** append results, including the ones TanStack handled itself (native `needsApproval`, client-side tools).
39
47
 
40
48
  ## Boundaries you should know
41
49
 
42
50
  - **Register the interrupt.** If `reinsApprovalInterrupt` is missing from `chat({ interrupts })`, the type layer complains; at run time the middleware also checks the engine's registry, warns once, and treats every call that would need approval as **denied** (an `approval_decision` with `by: "reins"` is left in the log) instead of letting the engine throw mid-run.
43
51
  - **`defer` pauses the whole tool batch**, not just the call that needs approval — that is where TanStack's boundary sits.
52
+ - **Declare `risk` on host tools.** The brain reads a TanStack tool's risk from `metadata.reins` (`ReinsToolMetadata`: `risk`, `replayable`), the same fields a reins `Tool` has. Without it the tool counts as a write tool: `approval()`'s default `byRisk` asks a human before every call (so `approval({ ask: ["deploy"] })` alone also asks about `lookup`), and each call logs a `tool_started` first. A value outside the allowed ones is treated as undeclared and reported through `warn`.
53
+ - **One approval card per call.** Reins tools (brain tools, MCP tools from `@reinsjs/tools-mcp`) are asked only through `reinsApprovalInterrupt`, whatever form their `needsApproval` takes. A host tool with TanStack's static `needsApproval: true` is asked only through TanStack's native approval, even when a socket such as `approval()` also wants to ask; the `approval_request` then carries the socket's policy and summary. Native answers sent with `resume` are logged as `approval_decision` (`by: "tanstack"`) at the start of the resumed run, before any tool runs, server or client. Answers carried by `UIMessage` `approval-responded` parts never reach `resume`: for a server tool the approval is logged just before it runs (and `approval({ ttlMs })` is re-checked then); for a client tool it is logged only when the client's result arrives with the next request, as `approved: true` if that result is not an error and `false` otherwise — a client-side execution error is then indistinguishable from a refusal. If a socket rewrites the arguments of a call that goes to the native card, the call is not executed even when approved (the card shows the arguments the model wrote, so running the rewritten ones would run something nobody approved); for a server tool the human is still asked once, because the engine raises the card before the middleware can step in, while a client tool is normally cancelled before any card (if the same batch also raises a reins interrupt, the engine may still show its native card; approving it does not run the call). Do not rewrite calls of tools with a static `needsApproval`.
54
+ - **Approval answers come from the client.** TanStack does not sign generic-interrupt continuations, so the `key` and the `by` of a `reinsApprovalInterrupt` answer are whatever the resuming client sends. The middleware only records answers for calls of this session that are waiting for approval (one answer per call); anything else is dropped with a warning. If who approved matters, check `resume` before calling `chat()`.
55
+ - **Socket blocks reach client tools through the engine's cancel list.** Client tools (no `execute`) never pass through `onBeforeToolCall`, so when a socket blocks one (including an `approval()` deny) the middleware adds the call to the engine's `cancelledToolCallIds` at the `beforeTools` boundary and the client is never asked to run it. This relies on TanStack AI 0.53.0 handing every `onConfig` its own mutable set; a middleware placed before reins that replaces that set with a copy defeats it. In that case the client's real result is logged as it came back, followed by a `core.error` (category `tanstack-ai`, not shown to the model) saying the block was not enforced. If you must stop a client tool regardless, give it a static `needsApproval` so the engine raises its own card, or check in the front end before running it.
56
+ - **A client tool that needs a reins approval can reach the front end before the answer.** When a socket defers a client tool (no `execute`) for approval, the run ends with two interrupts: TanStack's client-execution request for the call and the reins approval. A front end that runs every client-execution request it receives may run the call before the approval is answered; a later denial keeps the result out of the log but cannot undo what already happened in the browser. Until this is fixed in the middleware, have the front end hold a client-execution request while a reins approval interrupt for the same `toolCallId` is open, or give such tools a static `needsApproval` so only TanStack's native card is raised.
57
+ - **Edited arguments are not executed.** If the approver answers TanStack's native approval with `editedArgs` that differ from the call the model made, the call is denied instead (`approval_decision` with `by: "reins"`, whose reason names the edited arguments) and handed to the engine as cancelled, so neither a server tool nor a client tool runs with them: the log keeps the model's call as it was written, so running other arguments would make it lie. The model sees the arguments the approver wanted and can make the call again. As a second line, a server tool is not run when the call text the engine is about to execute (`toolCall.function.arguments`, parsed the way the engine parses it) differs from the logged call — for instance a client resending edited history. The check compares the call text, not the schema's output, so a schema default that differs on every parse (`randomUUID()`, `Date.now()`) does not trip it.
44
58
  - **No `system` role.** `system_note` events travel as a framed `user` message and are declared lossy; thinking is replayed only with a same-provider signature. The complete table is `TANSTACK_LOSS_MATRIX`.
45
59
  - **Sub-agent pause bubbling (`asTool`) is not available here.** A tool returning `subagentPause` is reported to the model as an error; the child session stays paused and can be resumed by the host.
46
60
  - **Content parts:** data-sourced image, video and audio parts translate both ways; TanStack has no duration field, so `durationSec` is not exported and imported clips have none (the estimate falls back to byte size). URL sources, documents and parts whose mime type does not match their kind become a placeholder and are reported in `dropped`. Whether the provider takes video or audio is up to TanStack's provider adapter, not reins.
@@ -49,6 +63,7 @@ const stream = chat({
49
63
  ## Two more boundaries
50
64
 
51
65
  - `capabilities.deferredTools` is always `false` on this path, even if you pass `true`: TanStack's adapter decides how tools reach the provider, so there is no place for `defer_loading` / `tool_reference`, and `BeforeModelPatch.deferredTools` is not read. `lazyTools()` therefore always takes its filtering path here; the cache-preserving native path is `runLoop` + `@reinsjs/lowering-fetch` on Anthropic.
66
+ - TanStack's own lazy tools (`lazy: true`) work: when the engine adds a tool it just discovered, or drops its discovery tool, the next model request follows it. Tools only appear this way — a host tool missing from the engine's list is otherwise kept, since a middleware placed after this one may hide tools turn by turn. The change is not logged as a new `tools_bound`; the next run's snapshot shows it.
52
67
  - `approval({ ttlMs })` works here exactly as in the default loop: TanStack re-enters the `beforeTools` boundary after an interrupt is resolved, so the `beforeTool` pipeline runs again and an approval that arrived too late is denied with `approval_decision(by: "approval.expired")` before the tool runs (`middleware.test.ts`, "审批").
53
68
  - `ctx.batch` is filled, but the engine checks a whole batch in `beforeTools` before running any of it, so `beforeTool` sees no results from the same batch (only those of a resumed batch logged by an earlier run) and `held` stays empty — a `defer` pauses the whole batch anyway. `haltOnFailure()` therefore never holds back calls of a fresh batch here. A resumed batch also gets no `onTurnEnd`: after the leftover calls run, the engine asks the model straight away, so `stopAfter()` cannot end a run on a wrap-up call that waited behind an approval (`middleware.test.ts`, "TurnContext.batch").
54
69
 
package/dist/index.d.ts CHANGED
@@ -123,7 +123,8 @@ type ReinsApprovalInterrupt = typeof reinsApprovalInterrupt;
123
123
 
124
124
  /**
125
125
  * TanStack AI 路径的有损矩阵:每种事件在 `toModelMessages` 里可能的落点(P7:有损必须声明,测试断言实际落点必在其中)。
126
- * 与 lowering-pi 的 LossMatrix 同形(事件 type → 可能落点列表)。
126
+ * 与 lowering-pi 的 LossMatrix 同形(事件 type → 可能落点列表)。宿主扩展事件按通配键 `"ext.*"` 查
127
+ * (与 lowering-pi `declaredLandings` 同一约定):表里没有具体的 `ext.xxx` 键。
127
128
  */
128
129
 
129
130
  interface LossEntry {
@@ -326,8 +327,29 @@ type NativeToolView = Tool & {
326
327
  [NATIVE_TOOL]: true;
327
328
  };
328
329
  declare function isNativeToolView(tool: Tool | undefined): tool is NativeToolView;
329
- /** TanStack 工具 → reins 只读视图 */
330
- declare function viewOfTanstackTool(tool: AnyTool): NativeToolView;
330
+ /**
331
+ * 宿主在 TanStack 工具上给 reins 看的声明:`toolDefinition({ …, metadata: { reins: { risk: "low" } } })`。
332
+ * 与 reins `Tool` 同名同义——`risk` 给 approval 的缺省 byRisk 与"中断不重放"用(没声明 = 写工具、要问人),
333
+ * `replayable` 覆盖由 risk 推出的可重放性
334
+ */
335
+ interface ReinsToolMetadata {
336
+ risk?: "low" | "medium" | "high";
337
+ replayable?: boolean;
338
+ }
339
+ /**
340
+ * TanStack 工具 → reins 只读视图。`metadata.reins` 里的 `risk` / `replayable` 抄进视图(全库审查 2026-11-25 #31:
341
+ * 此前视图带不了 risk,approval 缺省 byRisk 让每个宿主工具都要问人,README 的 `approval({ ask: ["deploy"] })` 名不副实)。
342
+ * 值不合规的字段 fail-closed:当没声明(仍按写工具、要问人),经 `warn` 报出
343
+ */
344
+ interface ViewOfTanstackToolOptions {
345
+ /** `metadata.reins` 的值不合规时的告警出口;不给就不告警 */
346
+ warn?: (message: string) => void;
347
+ }
348
+ /**
349
+ * 第二个参数刻意是选项对象而不是函数(第二波返修 N1):`tools.map(viewOfTanstackTool)` 会把数组下标当第二个参数传进来,
350
+ * 与 `toolSpecOf` 刻意单参是同一个坑——对象形态下下标只是被忽略(读不到 warn),不会被当函数调用
351
+ */
352
+ declare function viewOfTanstackTool(tool: AnyTool, options?: ViewOfTanstackToolOptions): NativeToolView;
331
353
  /** 包装 reins 工具时需要的运行环境 */
332
354
  interface ToolBridge {
333
355
  sessionId: string;
@@ -337,9 +359,10 @@ interface ToolBridge {
337
359
  outputs: Map<string, ToolResult>;
338
360
  }
339
361
  /**
340
- * reins 工具 → TanStack 工具。`needsApproval` 只透传布尔形态(TanStack 只认布尔);函数形态由适配器在
341
- * beforeTools 边界按 runLoop 的规则判定(circular:见 middleware 的 beforeTools)。
362
+ * reins 工具 → TanStack 工具。`needsApproval` 一律**不透传**:布尔与函数两种形态都由适配器在 beforeTools 边界
363
+ * 按 runLoop 的规则判定(先 validate、再问),以 reins 通用中断问人。透传布尔形态会让 TanStack 再开一张原生审批卡:
364
+ * 同一调用两个中断,前端只答 reins 那张时引擎拒绝续跑、run 记 error(全库审查 2026-11-25 #4)
342
365
  */
343
366
  declare function toTanstackTool(tool: Tool, bridge: ToolBridge): AnyTool;
344
367
 
345
- export { type AssemblerOrigin, BlockAssembler, COMPACTION_PREFIX, type DedupedDrafts, IMPORT_SOURCE, type ImportOptions, type ImportOrigin, type ImportedMessages, type LossEntry, type LoweredMessages, NATIVE_TOOL, type NativeToolView, REINS_APPROVAL_INTERRUPT_ID, type ReinsApprovalInterrupt, type ReinsApprovalPayload, type ReinsApprovalResponse, type ReinsChatMiddleware, type ReinsMiddlewareOptions, type ReinsSchema, type ReinsSchemaInit, TANSTACK_API, TANSTACK_APPROVAL_POLICY, TANSTACK_DECIDER, TANSTACK_LOSS_MATRIX, type ToModelMessagesOptions, type ToolBridge, dedupeImportedUserMessages, framedSystemNote, fromTanstackContent, fromTanstackToolResult, importModelMessages, importRef, isNativeToolView, parseArgs, reinsApprovalInterrupt, reinsMiddleware, reinsSchema, toModelMessages, toReinsUsage, toTanstackContent, toTanstackParts, toTanstackTool, trailingUserMessages, viewOfTanstackTool };
368
+ export { type AssemblerOrigin, BlockAssembler, COMPACTION_PREFIX, type DedupedDrafts, IMPORT_SOURCE, type ImportOptions, type ImportOrigin, type ImportedMessages, type LossEntry, type LoweredMessages, NATIVE_TOOL, type NativeToolView, REINS_APPROVAL_INTERRUPT_ID, type ReinsApprovalInterrupt, type ReinsApprovalPayload, type ReinsApprovalResponse, type ReinsChatMiddleware, type ReinsMiddlewareOptions, type ReinsSchema, type ReinsSchemaInit, type ReinsToolMetadata, TANSTACK_API, TANSTACK_APPROVAL_POLICY, TANSTACK_DECIDER, TANSTACK_LOSS_MATRIX, type ToModelMessagesOptions, type ToolBridge, type ViewOfTanstackToolOptions, dedupeImportedUserMessages, framedSystemNote, fromTanstackContent, fromTanstackToolResult, importModelMessages, importRef, isNativeToolView, parseArgs, reinsApprovalInterrupt, reinsMiddleware, reinsSchema, toModelMessages, toReinsUsage, toTanstackContent, toTanstackParts, toTanstackTool, trailingUserMessages, viewOfTanstackTool };