@stll/chat 0.1.38 → 0.1.40
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/README.md +9 -0
- package/dist/.bun/install/cache/links/@tanstack_ai-event-client@0.13.1-c12313b8e0f930fe/node_modules/@tanstack/ai-event-client/dist/esm/envelope.d.ts +5 -0
- package/dist/.bun/install/cache/links/@tanstack_ai-event-client@0.13.1-c12313b8e0f930fe/node_modules/@tanstack/ai-event-client/dist/esm/index.d.ts +141 -0
- package/dist/.bun/install/cache/links/@tanstack_devtools-event-client@0.4.4-93caf0d86e8c814b/node_modules/@tanstack/devtools-event-client/dist/esm/index.d.ts +1 -0
- package/dist/.bun/install/cache/links/@tanstack_devtools-event-client@0.4.4-93caf0d86e8c814b/node_modules/@tanstack/devtools-event-client/dist/esm/plugin.d.ts +5 -0
- package/dist/durable-transport.d.ts +68 -0
- package/dist/durable-transport.js +239 -0
- package/dist/resume-contract.d.ts +32 -0
- package/dist/resume-contract.js +30 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/activity-records.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/adapter.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agent-loop-strategies.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/define-agent.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/route.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/spawn.d.ts +6 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/agents/turn.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/cancel.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/index.d.ts +9 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/mcp/manager.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/mcp/types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/messages.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/builder.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/compose.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/define.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/generic-interrupts.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/index.d.ts +8 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/locks.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/run-store.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/types.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/middleware/validate.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/runtime-context-types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/index.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/processor.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/strategies.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/stream/types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/approval-schema.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/lazy-tool-manager.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/lazy-tools.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/schema-converter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-calls.d.ts +5 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/tool-definition.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/chat/tools/unique-tool-names.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/embed/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/embed/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/evaluate/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/evaluate/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/files/index.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateAudio/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateAudio/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateImage/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateImage/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateLiveVideo/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateLiveVideo/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateSpeech/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateSpeech/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateTranscription/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateTranscription/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVideo/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVideo/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVideo/snap.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVoice/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateVoice/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateWorld/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/generateWorld/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/index.d.ts +32 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/middleware/index.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/middleware/run.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/middleware/types.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/rerank/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/rerank/index.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/summarize/adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/summarize/chat-stream-summarize.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/activities/summarize/index.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/client.d.ts +23 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/custom-events.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/extend-adapter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/generic-interrupt-continuation.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/index.d.ts +66 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/interrupt-definition.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/interrupt-resume.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/interrupts.d.ts +30 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/realtime/event-emitter.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/realtime/index.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/realtime/types.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/stream-durability.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/stream-to-response.d.ts +4 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/stream-to-websocket.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/tool-registry.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/tools/provider-tool.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/types.d.ts +539 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/adapter-yield-chunk.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-usage.d.ts +8 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-wire.d.ts +3 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/chat-params.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/chunk-ids.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/content-source.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/embedding-input.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/errors.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/media-prompt.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/merge-metadata.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/normalize-stream-chunk.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/provider-executed.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/restore-inbound-chunk.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/subagent-wire.d.ts +2 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/tool-result.d.ts +1 -0
- package/dist/work/stella/stella/node_modules/.bun/@tanstack_ai@0.65.1_9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/usage.d.ts +1 -0
- package/package.json +23 -8
|
@@ -0,0 +1,539 @@
|
|
|
1
|
+
import { InterruptSubmissionError } from "./interrupts.js";
|
|
2
|
+
import { BilledUsage, BillingUnit, CompletionTokensDetails, PromptTokensDetails, ProviderUsageDetails, TokenUsage, UsageCostBreakdown } from "../../../../../../../../../../../.bun/install/cache/links/@tanstack_ai-event-client@0.13.1-c12313b8e0f930fe/node_modules/@tanstack/ai-event-client/dist/esm/index.js";
|
|
3
|
+
import { SpecTokenUsage, TokenUsageLeftover } from "./utilities/ag-ui-usage.js";
|
|
4
|
+
import "./utilities/subagent-wire.js";
|
|
5
|
+
import "./tools/provider-tool.js";
|
|
6
|
+
import { ActivityDeltaEvent, ActivityMessage, ActivitySnapshotEvent, AudioPart, CustomEvent, DocumentPart, EventType, ImagePart, Interrupt, MessagesSnapshotEvent, RawEvent, ReasoningEncryptedValueEvent, ReasoningEndEvent, ReasoningMessageChunkEvent, ReasoningMessageContentEvent, ReasoningMessageEndEvent, ReasoningMessageStartEvent, ReasoningStartEvent, RunErrorEvent, RunFinishedEvent, RunStartedEvent, StateDeltaEvent, StateSnapshotEvent, StepFinishedEvent, StepStartedEvent, SubagentErrorEvent, SubagentFinishedEvent, SubagentFinishedSuspendedOutcome, SubagentInfo, SubagentRunId, SubagentStartedEvent, TextMessageChunkEvent, TextMessageContentEvent, TextMessageEndEvent, TextMessageStartEvent, ToolCall, ToolCallArgsEvent, ToolCallChunkEvent, ToolCallEndEvent, ToolCallResultEvent, ToolCallStartEvent, VideoPart } from "@ag-ui/core";
|
|
7
|
+
//#region ../../node_modules/.bun/@tanstack+ai@0.65.1+9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/types.d.ts
|
|
8
|
+
/**
|
|
9
|
+
* Tool call states - track the lifecycle of a tool call
|
|
10
|
+
*/
|
|
11
|
+
export type ToolCallState = 'awaiting-input' | 'input-streaming' | 'input-complete' | 'approval-requested' | 'approval-responded' | 'complete' | 'error';
|
|
12
|
+
/**
|
|
13
|
+
* Tool result states - track the lifecycle of a tool result
|
|
14
|
+
*/
|
|
15
|
+
export type ToolResultState = 'streaming' | 'complete' | 'error';
|
|
16
|
+
/** Why a tool result ended without executing successfully. */
|
|
17
|
+
export type ToolResultOutcome = 'cancelled' | 'denied';
|
|
18
|
+
export type ToolOutputState = 'output-available' | 'output-error';
|
|
19
|
+
/** AG-UI `ToolCall` with typed metadata. `function.arguments` is a JSON string. */
|
|
20
|
+
interface ToolCall$1<TMetadata = unknown> extends Omit<ToolCall, 'metadata'> {
|
|
21
|
+
/** Provider-specific metadata to carry through the tool call lifecycle.
|
|
22
|
+
* Typed per-adapter via `TToolCallMetadata`. For example,
|
|
23
|
+
* `@tanstack/ai-gemini` sets this to `{ thoughtSignature?: string }`. */
|
|
24
|
+
metadata?: TMetadata;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Image content part for multimodal messages. AG-UI `ImagePart` with typed metadata.
|
|
28
|
+
* @template TMetadata - Provider-specific metadata type (e.g., OpenAI's detail level)
|
|
29
|
+
*/
|
|
30
|
+
interface ImagePart$1<TMetadata = unknown> extends ImagePart {
|
|
31
|
+
/** Provider-specific metadata (e.g., OpenAI's detail: 'auto' | 'low' | 'high') */
|
|
32
|
+
metadata?: TMetadata;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Audio content part for multimodal messages. AG-UI `AudioPart` with typed metadata.
|
|
36
|
+
* @template TMetadata - Provider-specific metadata type
|
|
37
|
+
*/
|
|
38
|
+
interface AudioPart$1<TMetadata = unknown> extends AudioPart {
|
|
39
|
+
/** Provider-specific metadata (e.g., format, sample rate) */
|
|
40
|
+
metadata?: TMetadata;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Video content part for multimodal messages. AG-UI `VideoPart` with typed metadata.
|
|
44
|
+
* @template TMetadata - Provider-specific metadata type
|
|
45
|
+
*/
|
|
46
|
+
interface VideoPart$1<TMetadata = unknown> extends VideoPart {
|
|
47
|
+
/** Provider-specific metadata (e.g., duration, resolution) */
|
|
48
|
+
metadata?: TMetadata;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Document content part for multimodal messages (e.g., PDFs). AG-UI `DocumentPart` with typed metadata.
|
|
52
|
+
* @template TMetadata - Provider-specific metadata type (e.g., Anthropic's media_type)
|
|
53
|
+
*/
|
|
54
|
+
interface DocumentPart$1<TMetadata = unknown> extends DocumentPart {
|
|
55
|
+
/** Provider-specific metadata (e.g., media_type for PDFs) */
|
|
56
|
+
metadata?: TMetadata;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Union type for all multimodal content parts.
|
|
60
|
+
* @template TImageMeta - Provider-specific image metadata type
|
|
61
|
+
* @template TAudioMeta - Provider-specific audio metadata type
|
|
62
|
+
* @template TVideoMeta - Provider-specific video metadata type
|
|
63
|
+
* @template TDocumentMeta - Provider-specific document metadata type
|
|
64
|
+
*/
|
|
65
|
+
export type ContentPart<TTextMeta = unknown, TImageMeta = unknown, TAudioMeta = unknown, TVideoMeta = unknown, TDocumentMeta = unknown> = TextPart<TTextMeta> | ImagePart$1<TImageMeta> | AudioPart$1<TAudioMeta> | VideoPart$1<TVideoMeta> | DocumentPart$1<TDocumentMeta>;
|
|
66
|
+
export interface ModelMessage<TContent extends string | null | Array<ContentPart> = string | null | Array<ContentPart>> {
|
|
67
|
+
role: 'user' | 'assistant' | 'tool';
|
|
68
|
+
content: TContent;
|
|
69
|
+
name?: string;
|
|
70
|
+
toolCalls?: Array<ToolCall$1>;
|
|
71
|
+
toolCallId?: string;
|
|
72
|
+
/**
|
|
73
|
+
* Signed thinking to send back to the provider. `redacted: true` marks a
|
|
74
|
+
* block the provider encrypted: `content` is empty and `signature` holds its
|
|
75
|
+
* opaque data. See `ThinkingPart.signature` for the planned rename.
|
|
76
|
+
*/
|
|
77
|
+
thinking?: Array<{
|
|
78
|
+
content: string;
|
|
79
|
+
signature?: string;
|
|
80
|
+
redacted?: boolean;
|
|
81
|
+
}>;
|
|
82
|
+
/** Error reported by an AG-UI tool message. */
|
|
83
|
+
error?: string;
|
|
84
|
+
/** Optional AG-UI message metadata. TanStack-owned fields live under `tanstack`. */
|
|
85
|
+
metadata?: Record<string, any>;
|
|
86
|
+
/**
|
|
87
|
+
* Completed structured output represented by this assistant message.
|
|
88
|
+
* `content` remains the provider-facing JSON text; this field preserves the
|
|
89
|
+
* typed UI part across persistence and message conversion.
|
|
90
|
+
*/
|
|
91
|
+
structuredOutput?: StructuredOutputPart;
|
|
92
|
+
/**
|
|
93
|
+
* Optional stable message id. Providers ignore it; it exists so a persisted
|
|
94
|
+
* transcript can retain the streaming `messageId` and survive the
|
|
95
|
+
* persist → hydrate round-trip. When present, `modelMessagesToUIMessages`
|
|
96
|
+
* reuses it instead of generating a fresh id, so a hydrated message keeps the
|
|
97
|
+
* same identity as its live stream — which is what lets a mid-stream reload
|
|
98
|
+
* resume the SAME message bubble in place (see `@tanstack/ai-persistence`).
|
|
99
|
+
*/
|
|
100
|
+
id?: string;
|
|
101
|
+
/**
|
|
102
|
+
* Optional message creation timestamp. When present, message converters
|
|
103
|
+
* preserve it across persist → hydrate round-trips.
|
|
104
|
+
*/
|
|
105
|
+
createdAt?: Date;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Message parts - building blocks of UIMessage
|
|
109
|
+
*/
|
|
110
|
+
export interface TextPart<TMetadata = unknown> {
|
|
111
|
+
type: 'text';
|
|
112
|
+
content: string;
|
|
113
|
+
metadata?: TMetadata;
|
|
114
|
+
}
|
|
115
|
+
export interface ToolCallPart<TMetadata = unknown> {
|
|
116
|
+
type: 'tool-call';
|
|
117
|
+
id: string;
|
|
118
|
+
name: string;
|
|
119
|
+
arguments: string;
|
|
120
|
+
/**
|
|
121
|
+
* Parsed tool input. Set from the parsed arguments once they are complete
|
|
122
|
+
* (`state: 'input-complete'` and later). `undefined` while the raw
|
|
123
|
+
* `arguments` string is still streaming, and may stay `undefined` for a call
|
|
124
|
+
* that terminates in an error state — the raw `arguments` string is always
|
|
125
|
+
* available as a fallback. Typed per-tool on the client `ToolCallPart` (see
|
|
126
|
+
* `@tanstack/ai-client`); `unknown` on this base type.
|
|
127
|
+
*/
|
|
128
|
+
input?: unknown;
|
|
129
|
+
state: ToolCallState;
|
|
130
|
+
/** Approval metadata if tool requires user approval */
|
|
131
|
+
approval?: {
|
|
132
|
+
id: string;
|
|
133
|
+
needsApproval: boolean;
|
|
134
|
+
approved?: boolean;
|
|
135
|
+
};
|
|
136
|
+
/** Tool execution output (for client tools or after approval) */
|
|
137
|
+
output?: any;
|
|
138
|
+
/** Provider-specific metadata that round-trips with the tool call.
|
|
139
|
+
* Typed per-adapter via `TToolCallMetadata`. May follow the
|
|
140
|
+
* {@link ProviderExecutedToolMetadata} convention to mark provider-executed
|
|
141
|
+
* server tools (e.g. Anthropic `web_search`). */
|
|
142
|
+
metadata?: TMetadata;
|
|
143
|
+
}
|
|
144
|
+
export interface ToolResultPart {
|
|
145
|
+
type: 'tool-result';
|
|
146
|
+
id?: string;
|
|
147
|
+
name?: string;
|
|
148
|
+
toolCallId: string;
|
|
149
|
+
content: string | Array<ContentPart>;
|
|
150
|
+
state: ToolResultState;
|
|
151
|
+
/** Set when the user or middleware cancelled or denied the tool call; state remains `error`. */
|
|
152
|
+
outcome?: ToolResultOutcome;
|
|
153
|
+
error?: string;
|
|
154
|
+
metadata?: Record<string, unknown>;
|
|
155
|
+
createdAt?: Date;
|
|
156
|
+
}
|
|
157
|
+
export interface ThinkingPart {
|
|
158
|
+
type: 'thinking';
|
|
159
|
+
content: string;
|
|
160
|
+
stepId?: string;
|
|
161
|
+
/**
|
|
162
|
+
* The provider's opaque reasoning artefact, sent back unchanged: an
|
|
163
|
+
* Anthropic signature, Anthropic redacted data, or OpenAI encrypted content.
|
|
164
|
+
* TODO(#1581): rename to `encryptedValue` to match AG-UI's `ReasoningMessage`.
|
|
165
|
+
* Renaming breaks stored messages, so it needs a read shim for `signature`.
|
|
166
|
+
*/
|
|
167
|
+
signature?: string;
|
|
168
|
+
/**
|
|
169
|
+
* The provider encrypted this thinking block (Anthropic `redacted_thinking`).
|
|
170
|
+
* `content` is empty, and `signature` holds the opaque data that goes back
|
|
171
|
+
* to the provider unchanged. On the AG-UI wire, the reasoning message id
|
|
172
|
+
* starts with `redacted_thinking-` instead.
|
|
173
|
+
*/
|
|
174
|
+
redacted?: boolean;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* Frontend-only AG-UI activity. Never converted into ModelMessage input.
|
|
178
|
+
* Mirrors {@link https://docs.ag-ui.com/concepts/messages | ActivityMessage}:
|
|
179
|
+
* `activityType` selects a renderer; `content` is the structured payload.
|
|
180
|
+
*/
|
|
181
|
+
export interface ActivityPart extends Pick<ActivityMessage, 'activityType' | 'content' | 'subagentRunId'> {
|
|
182
|
+
type: 'activity';
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Recursive `Partial` — every nested field becomes optional. Used as the
|
|
186
|
+
* `partial` type on a streaming structured-output part since the progressive
|
|
187
|
+
* JSON parse hands back objects whose fields are only filled in as bytes
|
|
188
|
+
* arrive. Defaulted in `DeepPartial<unknown>` → `unknown` so untyped parts
|
|
189
|
+
* keep their existing shape.
|
|
190
|
+
*/
|
|
191
|
+
export type DeepPartial<T> = T extends ReadonlyArray<infer U> ? Array<DeepPartial<U>> : T extends object ? { [K in keyof T]?: DeepPartial<T[K]>; } : T;
|
|
192
|
+
/**
|
|
193
|
+
* StructuredOutputPart — a typed structured response attached to the assistant
|
|
194
|
+
* message that produced it. Generic over the schema-inferred data type so
|
|
195
|
+
* consumers can thread `useChat({ outputSchema })`'s schema all the way down
|
|
196
|
+
* to `messages[i].parts[j].data`. Defaults to `unknown` so untyped consumers
|
|
197
|
+
* (e.g. internal codepaths that don't know about TSchema) keep working.
|
|
198
|
+
*
|
|
199
|
+
* Discriminated on `status`: checking `status === 'complete'` narrows `data`
|
|
200
|
+
* to `TData`.
|
|
201
|
+
*/
|
|
202
|
+
export type StructuredOutputPart<TData = unknown> = (StructuredOutputPartBase<TData> & {
|
|
203
|
+
status: 'streaming' | 'error';
|
|
204
|
+
/** Not set until `status === 'complete'`. */
|
|
205
|
+
data?: undefined;
|
|
206
|
+
}) | (StructuredOutputPartBase<TData> & {
|
|
207
|
+
status: 'complete';
|
|
208
|
+
/** Validated final object. */
|
|
209
|
+
data: TData;
|
|
210
|
+
});
|
|
211
|
+
interface StructuredOutputPartBase<TData> {
|
|
212
|
+
type: 'structured-output';
|
|
213
|
+
/** Progressive parse of `raw` via parsePartialJSON — populated while streaming and after complete. */
|
|
214
|
+
partial?: DeepPartial<TData>;
|
|
215
|
+
/** Accumulating JSON buffer. Source of truth for wire round-trip. */
|
|
216
|
+
raw: string;
|
|
217
|
+
/** Optional chain-of-thought surfaced by reasoning models alongside the structured output. */
|
|
218
|
+
reasoning?: string;
|
|
219
|
+
/** Populated when `status === 'error'`. */
|
|
220
|
+
errorMessage?: string;
|
|
221
|
+
}
|
|
222
|
+
export type SubagentStatus = 'running' | 'finished' | 'error' | 'suspended';
|
|
223
|
+
/**
|
|
224
|
+
* One child invocation as the client sees it. AG-UI `SubagentInfo` names the
|
|
225
|
+
* child; the other AG-UI fields come from its `SUBAGENT_STARTED`,
|
|
226
|
+
* `SUBAGENT_FINISHED` and `SUBAGENT_ERROR` events. `id` is the AG-UI
|
|
227
|
+
* `subagentRunId`. `status`, `parentRunId` and `messages` are client state the
|
|
228
|
+
* spec does not model.
|
|
229
|
+
*/
|
|
230
|
+
export interface SubagentHandleData extends SubagentInfo, Pick<SubagentStartedEvent, 'parentSubagentRunId' | 'parentToolCallId' | 'metadata'> {
|
|
231
|
+
id: SubagentRunId;
|
|
232
|
+
status: SubagentStatus;
|
|
233
|
+
/** The parent chat run that started this child. */
|
|
234
|
+
parentRunId?: string;
|
|
235
|
+
/** Interrupts this child raised, while `status` is `'suspended'`. */
|
|
236
|
+
interruptIds?: SubagentFinishedSuspendedOutcome['interruptIds'];
|
|
237
|
+
messages: Array<UIMessage>;
|
|
238
|
+
error?: Pick<SubagentErrorEvent, 'message' | 'code'>;
|
|
239
|
+
}
|
|
240
|
+
export interface SubagentPart {
|
|
241
|
+
type: 'subagent';
|
|
242
|
+
subagent: SubagentHandleData;
|
|
243
|
+
}
|
|
244
|
+
export interface UIResourcePart {
|
|
245
|
+
type: 'ui-resource';
|
|
246
|
+
/** The ui:// resource object in MCP-native shape — fed straight to the renderer. */
|
|
247
|
+
resource: {
|
|
248
|
+
uri: string;
|
|
249
|
+
mimeType: string;
|
|
250
|
+
text?: string;
|
|
251
|
+
blob?: string;
|
|
252
|
+
};
|
|
253
|
+
/** Pool prefix / config key — routes interactive calls to the right MCP server. */
|
|
254
|
+
serverId?: string;
|
|
255
|
+
/** Links the widget to the originating tool call — correlates it with the
|
|
256
|
+
* sibling ToolCallPart/ToolResultPart in the same message. */
|
|
257
|
+
toolCallId: string;
|
|
258
|
+
/** Server-native (unprefixed) MCP tool name whose UI this resource renders.
|
|
259
|
+
* Required by the renderer (`@mcp-ui/client`'s `AppRenderer` `toolName` prop). */
|
|
260
|
+
toolName: string;
|
|
261
|
+
/** Reserved for future passthrough of the resource/tool `_meta.ui` (e.g. frame-size hints).
|
|
262
|
+
* Currently always `undefined` — nothing populates this field yet. */
|
|
263
|
+
meta?: Record<string, unknown>;
|
|
264
|
+
}
|
|
265
|
+
export type MessagePart<TData = unknown> = TextPart | ImagePart$1 | AudioPart$1 | VideoPart$1 | DocumentPart$1 | ToolCallPart | ToolResultPart | ThinkingPart | ActivityPart | StructuredOutputPart<TData> | UIResourcePart | SubagentPart;
|
|
266
|
+
/**
|
|
267
|
+
* Shape of `metadata.tanstack` on run events.
|
|
268
|
+
*/
|
|
269
|
+
export interface TanStackRunMetadata {
|
|
270
|
+
model?: string;
|
|
271
|
+
finishReason?: 'stop' | 'length' | 'content_filter' | 'tool_calls' | null;
|
|
272
|
+
/** TokenUsage fields that have no AG-UI `usage[]` equivalent. */
|
|
273
|
+
usage?: TokenUsageLeftover;
|
|
274
|
+
interruptErrors?: ReadonlyArray<InterruptSubmissionError>;
|
|
275
|
+
threadId?: string;
|
|
276
|
+
runId?: string;
|
|
277
|
+
sessionId?: string;
|
|
278
|
+
index?: number;
|
|
279
|
+
state?: ToolOutputState;
|
|
280
|
+
/** Parsed `TOOL_CALL_END` input. Spec `TOOL_CALL_END` has no top-level `input`. */
|
|
281
|
+
input?: unknown;
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* UIMessage - Domain-specific message format optimized for building chat UIs
|
|
285
|
+
* Contains parts that can be text, tool calls, or tool results. Generic over
|
|
286
|
+
* the structured-output data type so `useChat({ outputSchema })`'s schema
|
|
287
|
+
* narrows `parts.find(p => p.type === 'structured-output').data` on the
|
|
288
|
+
* consumer side without manual casts.
|
|
289
|
+
*/
|
|
290
|
+
export interface UIMessage<TData = unknown> {
|
|
291
|
+
id: string;
|
|
292
|
+
role: 'system' | 'user' | 'assistant' | 'activity';
|
|
293
|
+
parts: Array<MessagePart<TData>>;
|
|
294
|
+
createdAt?: Date;
|
|
295
|
+
/** Optional AG-UI sender name. Converters preserve it across wire and persist. */
|
|
296
|
+
name?: string;
|
|
297
|
+
/**
|
|
298
|
+
* Optional AG-UI metadata bag. TanStack writes the `tanstack` key.
|
|
299
|
+
* User keys stay at the top.
|
|
300
|
+
*/
|
|
301
|
+
metadata?: Record<string, any>;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* Emitted when a run starts.
|
|
305
|
+
* This is the first event in any streaming response.
|
|
306
|
+
*
|
|
307
|
+
* @ag-ui/core provides: `threadId`, `runId`, `parentRunId?`, `input?`
|
|
308
|
+
*/
|
|
309
|
+
interface RunStartedEvent$1 extends RunStartedEvent {}
|
|
310
|
+
/**
|
|
311
|
+
* Emitted when a run completes successfully.
|
|
312
|
+
*
|
|
313
|
+
* @ag-ui/core provides: `threadId`, `runId`, `result?`, `outcome?`
|
|
314
|
+
* Spec `usage[]` is provider/model token counts. TanStack leftovers live in
|
|
315
|
+
* `metadata.tanstack`.
|
|
316
|
+
*/
|
|
317
|
+
interface RunFinishedEvent$1 extends Pick<RunFinishedEvent, 'threadId' | 'runId' | 'result' | 'outcome' | 'timestamp' | 'rawEvent'> {
|
|
318
|
+
type: EventType.RUN_FINISHED;
|
|
319
|
+
usage?: Array<SpecTokenUsage> | TokenUsage;
|
|
320
|
+
/** Restored on the client from `metadata.tanstack`. */
|
|
321
|
+
model?: string;
|
|
322
|
+
/** Restored on the client from `metadata.tanstack`. */
|
|
323
|
+
finishReason?: 'stop' | 'length' | 'content_filter' | 'tool_calls' | null;
|
|
324
|
+
metadata?: {
|
|
325
|
+
tanstack?: TanStackRunMetadata;
|
|
326
|
+
} & Record<string, any>;
|
|
327
|
+
}
|
|
328
|
+
/**
|
|
329
|
+
* Emitted when an error occurs during a run.
|
|
330
|
+
*
|
|
331
|
+
* @ag-ui/core provides: `message`, `code?`
|
|
332
|
+
* Spec `usage[]` is provider/model token counts. Interrupt errors live in
|
|
333
|
+
* `metadata.tanstack.interruptErrors`.
|
|
334
|
+
*/
|
|
335
|
+
interface RunErrorEvent$1 extends Pick<RunErrorEvent, 'message' | 'code' | 'timestamp' | 'rawEvent'> {
|
|
336
|
+
type: EventType.RUN_ERROR;
|
|
337
|
+
usage?: Array<SpecTokenUsage> | TokenUsage;
|
|
338
|
+
/** Restored on the client from `metadata.tanstack`. */
|
|
339
|
+
threadId?: string;
|
|
340
|
+
/** Restored on the client from `metadata.tanstack`. */
|
|
341
|
+
runId?: string;
|
|
342
|
+
/** Restored on the client from `metadata.tanstack`. */
|
|
343
|
+
model?: string;
|
|
344
|
+
/** Nested payload kept for in-process / durability consumers. */
|
|
345
|
+
error?: {
|
|
346
|
+
message: string;
|
|
347
|
+
code?: string;
|
|
348
|
+
};
|
|
349
|
+
metadata?: {
|
|
350
|
+
tanstack?: TanStackRunMetadata;
|
|
351
|
+
} & Record<string, any>;
|
|
352
|
+
}
|
|
353
|
+
/**
|
|
354
|
+
* Emitted when a text message starts.
|
|
355
|
+
*
|
|
356
|
+
* @ag-ui/core provides: `messageId`, `role?`, `name?`
|
|
357
|
+
*/
|
|
358
|
+
interface TextMessageStartEvent$1 extends TextMessageStartEvent {}
|
|
359
|
+
/**
|
|
360
|
+
* Emitted when text content is generated (streaming tokens).
|
|
361
|
+
*
|
|
362
|
+
* @ag-ui/core provides: `messageId`, `delta`
|
|
363
|
+
*/
|
|
364
|
+
interface TextMessageContentEvent$1 extends TextMessageContentEvent {}
|
|
365
|
+
/**
|
|
366
|
+
* Emitted when a text message completes.
|
|
367
|
+
*
|
|
368
|
+
* @ag-ui/core provides: `messageId`
|
|
369
|
+
*/
|
|
370
|
+
interface TextMessageEndEvent$1 extends TextMessageEndEvent {}
|
|
371
|
+
/**
|
|
372
|
+
* Emitted when a tool call starts.
|
|
373
|
+
*
|
|
374
|
+
* @ag-ui/core provides: `toolCallId`, `toolCallName`, `parentMessageId?`,
|
|
375
|
+
* `subagentRunId?`
|
|
376
|
+
*/
|
|
377
|
+
interface ToolCallStartEvent$1 extends Omit<ToolCallStartEvent, 'type'> {
|
|
378
|
+
type: 'TOOL_CALL_START';
|
|
379
|
+
/** Alias of `toolCallName`. Kept so existing stream readers still compile. */
|
|
380
|
+
toolName?: string;
|
|
381
|
+
/** Provider-specific metadata to carry into the ToolCall. */
|
|
382
|
+
metadata?: Record<string, any>;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Emitted when tool call arguments are streaming.
|
|
386
|
+
*
|
|
387
|
+
* @ag-ui/core provides: `toolCallId`, `delta`
|
|
388
|
+
*/
|
|
389
|
+
interface ToolCallArgsEvent$1 extends ToolCallArgsEvent {}
|
|
390
|
+
/**
|
|
391
|
+
* Emitted when a tool call completes.
|
|
392
|
+
*
|
|
393
|
+
* @ag-ui/core provides: `toolCallId`, `subagentRunId?`
|
|
394
|
+
*/
|
|
395
|
+
interface ToolCallEndEvent$1 extends Omit<ToolCallEndEvent, 'type'> {
|
|
396
|
+
type: 'TOOL_CALL_END';
|
|
397
|
+
/** Parsed tool arguments when the adapter already parsed them. */
|
|
398
|
+
input?: unknown;
|
|
399
|
+
metadata?: Record<string, any>;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Emitted when a tool call result is available.
|
|
403
|
+
*
|
|
404
|
+
* @ag-ui/core provides: `messageId`, `toolCallId`, `content`, `role?`
|
|
405
|
+
*/
|
|
406
|
+
interface ToolCallResultEvent$1 extends ToolCallResultEvent {}
|
|
407
|
+
/**
|
|
408
|
+
* Emitted when a thinking/reasoning step starts.
|
|
409
|
+
*
|
|
410
|
+
* @ag-ui/core provides: `stepName`
|
|
411
|
+
*/
|
|
412
|
+
interface StepStartedEvent$1 extends StepStartedEvent {}
|
|
413
|
+
/**
|
|
414
|
+
* Emitted when a thinking/reasoning step finishes.
|
|
415
|
+
*
|
|
416
|
+
* @ag-ui/core provides: `stepName`
|
|
417
|
+
*/
|
|
418
|
+
interface StepFinishedEvent$1 extends StepFinishedEvent {}
|
|
419
|
+
/**
|
|
420
|
+
* Emitted to provide a snapshot of all messages in a conversation.
|
|
421
|
+
*
|
|
422
|
+
* Unlike StateSnapshot (which carries arbitrary application state),
|
|
423
|
+
* MessagesSnapshot specifically delivers the conversation transcript.
|
|
424
|
+
*
|
|
425
|
+
* @ag-ui/core provides: `messages` (as @ag-ui/core Message[])
|
|
426
|
+
*
|
|
427
|
+
* Note: The `messages` field uses the @ag-ui/core Message type.
|
|
428
|
+
* Use converters to transform to/from TanStack UIMessage format.
|
|
429
|
+
*/
|
|
430
|
+
interface MessagesSnapshotEvent$1 extends MessagesSnapshotEvent {}
|
|
431
|
+
/**
|
|
432
|
+
* Emitted to provide a full state snapshot.
|
|
433
|
+
*
|
|
434
|
+
* @ag-ui/core provides: `snapshot` (any)
|
|
435
|
+
*/
|
|
436
|
+
interface StateSnapshotEvent$1 extends StateSnapshotEvent {}
|
|
437
|
+
/**
|
|
438
|
+
* Emitted to provide an incremental state update.
|
|
439
|
+
*
|
|
440
|
+
* @ag-ui/core provides: `delta` (any[] - JSON Patch RFC 6902)
|
|
441
|
+
*/
|
|
442
|
+
interface StateDeltaEvent$1 extends StateDeltaEvent {}
|
|
443
|
+
/**
|
|
444
|
+
* Custom event for extensibility.
|
|
445
|
+
*
|
|
446
|
+
* @ag-ui/core provides: `name`, `value`, `subagentRunId?`
|
|
447
|
+
*/
|
|
448
|
+
interface CustomEvent$1 extends Omit<CustomEvent, 'type'> {
|
|
449
|
+
type: 'CUSTOM';
|
|
450
|
+
metadata?: Record<string, any>;
|
|
451
|
+
}
|
|
452
|
+
/**
|
|
453
|
+
* Emitted when reasoning starts for a message.
|
|
454
|
+
*
|
|
455
|
+
* @ag-ui/core provides: `messageId`
|
|
456
|
+
*/
|
|
457
|
+
interface ReasoningStartEvent$1 extends ReasoningStartEvent {}
|
|
458
|
+
/**
|
|
459
|
+
* Emitted when a reasoning message starts.
|
|
460
|
+
*
|
|
461
|
+
* @ag-ui/core provides: `messageId`, `role` ("reasoning")
|
|
462
|
+
*/
|
|
463
|
+
interface ReasoningMessageStartEvent$1 extends ReasoningMessageStartEvent {}
|
|
464
|
+
/**
|
|
465
|
+
* Emitted when reasoning message content is generated.
|
|
466
|
+
*
|
|
467
|
+
* @ag-ui/core provides: `messageId`, `delta`
|
|
468
|
+
*/
|
|
469
|
+
interface ReasoningMessageContentEvent$1 extends ReasoningMessageContentEvent {}
|
|
470
|
+
/**
|
|
471
|
+
* Emitted when a reasoning message ends.
|
|
472
|
+
*
|
|
473
|
+
* @ag-ui/core provides: `messageId`
|
|
474
|
+
*/
|
|
475
|
+
interface ReasoningMessageEndEvent$1 extends ReasoningMessageEndEvent {}
|
|
476
|
+
/**
|
|
477
|
+
* Emitted when reasoning ends for a message.
|
|
478
|
+
*
|
|
479
|
+
* @ag-ui/core provides: `messageId`
|
|
480
|
+
*/
|
|
481
|
+
interface ReasoningEndEvent$1 extends ReasoningEndEvent {}
|
|
482
|
+
/**
|
|
483
|
+
* Emitted for encrypted reasoning values.
|
|
484
|
+
*
|
|
485
|
+
* @ag-ui/core provides: `subtype`, `entityId`, `encryptedValue`
|
|
486
|
+
*/
|
|
487
|
+
interface ReasoningEncryptedValueEvent$1 extends ReasoningEncryptedValueEvent {}
|
|
488
|
+
/**
|
|
489
|
+
* Full activity state for an `ActivityMessage`.
|
|
490
|
+
*
|
|
491
|
+
* @ag-ui/core provides: `messageId`, `activityType`, `content`, `replace?`,
|
|
492
|
+
* `metadata?`, `subagentRunId?`. When `replace` is omitted it means `true`.
|
|
493
|
+
*/
|
|
494
|
+
interface ActivitySnapshotEvent$1 extends Omit<ActivitySnapshotEvent, 'type'> {
|
|
495
|
+
type: 'ACTIVITY_SNAPSHOT';
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* RFC 6902 JSON Patch against an existing activity's `content`.
|
|
499
|
+
*
|
|
500
|
+
* @ag-ui/core provides: `messageId`, `activityType`, `patch`, `metadata?`,
|
|
501
|
+
* `subagentRunId?`
|
|
502
|
+
*/
|
|
503
|
+
interface ActivityDeltaEvent$1 extends Omit<ActivityDeltaEvent, 'type'> {
|
|
504
|
+
type: 'ACTIVITY_DELTA';
|
|
505
|
+
}
|
|
506
|
+
/** AG-UI 1.0 RawEvent shape. */
|
|
507
|
+
interface RawEvent$1 extends RawEvent {}
|
|
508
|
+
/** AG-UI 1.0 TextMessageChunkEvent shape. */
|
|
509
|
+
interface TextMessageChunkEvent$1 extends TextMessageChunkEvent {}
|
|
510
|
+
/** AG-UI 1.0 ToolCallChunkEvent shape. */
|
|
511
|
+
interface ToolCallChunkEvent$1 extends ToolCallChunkEvent {}
|
|
512
|
+
/** AG-UI 1.0 ReasoningMessageChunkEvent shape. */
|
|
513
|
+
interface ReasoningMessageChunkEvent$1 extends ReasoningMessageChunkEvent {}
|
|
514
|
+
/**
|
|
515
|
+
* Union of all AG-UI events.
|
|
516
|
+
*/
|
|
517
|
+
export type AGUIEvent = ActivitySnapshotEvent$1 | ActivityDeltaEvent$1 | RawEvent$1 | TextMessageChunkEvent$1 | ToolCallChunkEvent$1 | ReasoningMessageChunkEvent$1 | RunStartedEvent$1 | RunFinishedEvent$1 | RunErrorEvent$1 | TextMessageStartEvent$1 | TextMessageContentEvent$1 | TextMessageEndEvent$1 | ToolCallStartEvent$1 | ToolCallArgsEvent$1 | ToolCallEndEvent$1 | ToolCallResultEvent$1 | StepStartedEvent$1 | StepFinishedEvent$1 | MessagesSnapshotEvent$1 | StateSnapshotEvent$1 | StateDeltaEvent$1 | CustomEvent$1 | ReasoningStartEvent$1 | ReasoningMessageStartEvent$1 | ReasoningMessageContentEvent$1 | ReasoningMessageEndEvent$1 | ReasoningEndEvent$1 | ReasoningEncryptedValueEvent$1 | SubagentStartedEvent$1 | SubagentFinishedEvent$1 | SubagentErrorEvent$1;
|
|
518
|
+
/**
|
|
519
|
+
* A child agent started. The later chunks for that child carry the same
|
|
520
|
+
* `subagentRunId`.
|
|
521
|
+
*
|
|
522
|
+
* @ag-ui/core provides: `subagentRunId`, `name`, `description?`,
|
|
523
|
+
* `parentSubagentRunId?`, `parentToolCallId?`, `parentMessageId?`, `metadata?`
|
|
524
|
+
*/
|
|
525
|
+
interface SubagentStartedEvent$1 extends SubagentStartedEvent {}
|
|
526
|
+
/**
|
|
527
|
+
* A child agent's segment of this run ended.
|
|
528
|
+
*
|
|
529
|
+
* @ag-ui/core provides: `subagentRunId`, `result?`, `outcome?`
|
|
530
|
+
*/
|
|
531
|
+
interface SubagentFinishedEvent$1 extends SubagentFinishedEvent {}
|
|
532
|
+
/**
|
|
533
|
+
* A child agent failed. The parent run can continue.
|
|
534
|
+
*
|
|
535
|
+
* @ag-ui/core provides: `subagentRunId`, `message`, `code?`
|
|
536
|
+
*/
|
|
537
|
+
interface SubagentErrorEvent$1 extends SubagentErrorEvent {}
|
|
538
|
+
//#endregion
|
|
539
|
+
export { ActivityDeltaEvent$1 as ActivityDeltaEvent, ActivitySnapshotEvent$1 as ActivitySnapshotEvent, AudioPart$1 as AudioPart, CustomEvent$1 as CustomEvent, DocumentPart$1 as DocumentPart, ImagePart$1 as ImagePart, MessagesSnapshotEvent$1 as MessagesSnapshotEvent, RawEvent$1 as RawEvent, ReasoningEncryptedValueEvent$1 as ReasoningEncryptedValueEvent, ReasoningEndEvent$1 as ReasoningEndEvent, ReasoningMessageChunkEvent$1 as ReasoningMessageChunkEvent, ReasoningMessageContentEvent$1 as ReasoningMessageContentEvent, ReasoningMessageEndEvent$1 as ReasoningMessageEndEvent, ReasoningMessageStartEvent$1 as ReasoningMessageStartEvent, ReasoningStartEvent$1 as ReasoningStartEvent, RunErrorEvent$1 as RunErrorEvent, RunFinishedEvent$1 as RunFinishedEvent, RunStartedEvent$1 as RunStartedEvent, StateDeltaEvent$1 as StateDeltaEvent, StateSnapshotEvent$1 as StateSnapshotEvent, StepFinishedEvent$1 as StepFinishedEvent, StepStartedEvent$1 as StepStartedEvent, SubagentErrorEvent$1 as SubagentErrorEvent, SubagentFinishedEvent$1 as SubagentFinishedEvent, SubagentStartedEvent$1 as SubagentStartedEvent, TextMessageChunkEvent$1 as TextMessageChunkEvent, TextMessageContentEvent$1 as TextMessageContentEvent, TextMessageEndEvent$1 as TextMessageEndEvent, TextMessageStartEvent$1 as TextMessageStartEvent, type TokenUsage, ToolCall$1 as ToolCall, ToolCallArgsEvent$1 as ToolCallArgsEvent, ToolCallChunkEvent$1 as ToolCallChunkEvent, ToolCallEndEvent$1 as ToolCallEndEvent, ToolCallResultEvent$1 as ToolCallResultEvent, ToolCallStartEvent$1 as ToolCallStartEvent, VideoPart$1 as VideoPart };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TokenUsage } from "../../../../../../../../../../../../.bun/install/cache/links/@tanstack_ai-event-client@0.13.1-c12313b8e0f930fe/node_modules/@tanstack/ai-event-client/dist/esm/index.js";
|
|
2
|
+
import "../types.js";
|
|
3
|
+
import { TokenUsage as SpecTokenUsage } from "@ag-ui/core";
|
|
4
|
+
//#region ../../node_modules/.bun/@tanstack+ai@0.65.1+9c170ad6cb10badb/node_modules/@tanstack/ai/dist/esm/utilities/ag-ui-usage.d.ts
|
|
5
|
+
/** TokenUsage fields that have no AG-UI `usage[]` equivalent. */
|
|
6
|
+
export type TokenUsageLeftover = Omit<TokenUsage, 'promptTokens' | 'completionTokens' | 'totalTokens'>;
|
|
7
|
+
//#endregion
|
|
8
|
+
export type { SpecTokenUsage };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../types.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stll/chat",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.40",
|
|
4
4
|
"description": "Typed React chat composer, message stream, model selector, and transport runtime primitives.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"ai",
|
|
@@ -44,6 +44,14 @@
|
|
|
44
44
|
"./stream": {
|
|
45
45
|
"types": "./dist/stream.d.ts",
|
|
46
46
|
"import": "./dist/stream.js"
|
|
47
|
+
},
|
|
48
|
+
"./durable-transport": {
|
|
49
|
+
"types": "./dist/durable-transport.d.ts",
|
|
50
|
+
"import": "./dist/durable-transport.js"
|
|
51
|
+
},
|
|
52
|
+
"./resume-contract": {
|
|
53
|
+
"types": "./dist/resume-contract.d.ts",
|
|
54
|
+
"import": "./dist/resume-contract.js"
|
|
47
55
|
}
|
|
48
56
|
},
|
|
49
57
|
"publishConfig": {
|
|
@@ -54,22 +62,29 @@
|
|
|
54
62
|
"build": "tsdown",
|
|
55
63
|
"pack:dry-run": "bun pm pack --dry-run",
|
|
56
64
|
"test": "bun test src",
|
|
57
|
-
"typecheck": "bun
|
|
65
|
+
"typecheck": "bun check --no-pretty --all --project=tsconfig.json",
|
|
58
66
|
"lint": "cd ../.. && bun --bun oxlint -c oxlint.config.ts --report-unused-disable-directives-severity=error --type-aware --type-check packages/chat",
|
|
59
67
|
"lint:fix": "cd ../.. && bun --bun oxlint -c oxlint.config.ts --type-aware --fix packages/chat",
|
|
60
68
|
"format": "bun ../../scripts/run-oxfmt.ts .",
|
|
61
|
-
"prepack": "bun run build"
|
|
69
|
+
"prepack": "bun run build",
|
|
70
|
+
"test:property": "bun test --preload @stll/property-testing/preload $(grep -rlE 'fc\\.assert|assertProperty' src --include='*.test.ts')"
|
|
62
71
|
},
|
|
63
72
|
"dependencies": {
|
|
64
|
-
"@
|
|
65
|
-
"@stll/
|
|
66
|
-
"
|
|
73
|
+
"@ag-ui/core": "1.0.2",
|
|
74
|
+
"@stll/ai-catalog": "^0.7.0",
|
|
75
|
+
"@stll/ui": "^0.45.0",
|
|
76
|
+
"@tanstack/ai-client": "0.38.0",
|
|
77
|
+
"better-result": "3.0.1",
|
|
78
|
+
"valibot": "1.5.0",
|
|
79
|
+
"zod": "^4.5.4"
|
|
67
80
|
},
|
|
68
81
|
"devDependencies": {
|
|
82
|
+
"@stll/property-testing": "0.0.0",
|
|
69
83
|
"@stll/typescript-config": "0.0.0",
|
|
70
84
|
"@types/react": "^19.2.17",
|
|
71
|
-
"bun-types": "1.4.
|
|
72
|
-
"
|
|
85
|
+
"bun-types": "1.4.3",
|
|
86
|
+
"fast-check": "^4.10.2",
|
|
87
|
+
"react": "^19.3.0",
|
|
73
88
|
"tsdown": "0.23.0"
|
|
74
89
|
},
|
|
75
90
|
"peerDependencies": {
|