@agent-native/core 0.54.1 → 0.56.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.
Files changed (186) hide show
  1. package/README.md +16 -1
  2. package/dist/action-ui.d.ts +17 -0
  3. package/dist/action-ui.d.ts.map +1 -0
  4. package/dist/action-ui.js +23 -0
  5. package/dist/action-ui.js.map +1 -0
  6. package/dist/action.d.ts +8 -1
  7. package/dist/action.d.ts.map +1 -1
  8. package/dist/action.js +3 -0
  9. package/dist/action.js.map +1 -1
  10. package/dist/agent/production-agent.d.ts +2 -0
  11. package/dist/agent/production-agent.d.ts.map +1 -1
  12. package/dist/agent/production-agent.js +11 -1
  13. package/dist/agent/production-agent.js.map +1 -1
  14. package/dist/agent/thread-data-builder.d.ts +4 -0
  15. package/dist/agent/thread-data-builder.d.ts.map +1 -1
  16. package/dist/agent/thread-data-builder.js +4 -0
  17. package/dist/agent/thread-data-builder.js.map +1 -1
  18. package/dist/agent/types.d.ts +2 -0
  19. package/dist/agent/types.d.ts.map +1 -1
  20. package/dist/agent/types.js.map +1 -1
  21. package/dist/cli/connect.d.ts +3 -1
  22. package/dist/cli/connect.d.ts.map +1 -1
  23. package/dist/cli/connect.js +7 -1
  24. package/dist/cli/connect.js.map +1 -1
  25. package/dist/cli/index.js +1 -1
  26. package/dist/cli/index.js.map +1 -1
  27. package/dist/cli/plan-local.d.ts +40 -0
  28. package/dist/cli/plan-local.d.ts.map +1 -1
  29. package/dist/cli/plan-local.js +495 -9
  30. package/dist/cli/plan-local.js.map +1 -1
  31. package/dist/cli/skills.d.ts +17 -2
  32. package/dist/cli/skills.d.ts.map +1 -1
  33. package/dist/cli/skills.js +135 -36
  34. package/dist/cli/skills.js.map +1 -1
  35. package/dist/client/AgentChatHome.d.ts +23 -0
  36. package/dist/client/AgentChatHome.d.ts.map +1 -0
  37. package/dist/client/AgentChatHome.js +13 -0
  38. package/dist/client/AgentChatHome.js.map +1 -0
  39. package/dist/client/AgentPanel.d.ts +29 -2
  40. package/dist/client/AgentPanel.d.ts.map +1 -1
  41. package/dist/client/AgentPanel.js +116 -68
  42. package/dist/client/AgentPanel.js.map +1 -1
  43. package/dist/client/AssistantChat.d.ts.map +1 -1
  44. package/dist/client/AssistantChat.js +145 -21
  45. package/dist/client/AssistantChat.js.map +1 -1
  46. package/dist/client/FeedbackButton.d.ts +7 -1
  47. package/dist/client/FeedbackButton.d.ts.map +1 -1
  48. package/dist/client/FeedbackButton.js +13 -3
  49. package/dist/client/FeedbackButton.js.map +1 -1
  50. package/dist/client/MultiTabAssistantChat.d.ts +1 -2
  51. package/dist/client/MultiTabAssistantChat.d.ts.map +1 -1
  52. package/dist/client/MultiTabAssistantChat.js.map +1 -1
  53. package/dist/client/agent-sidebar-state.d.ts +2 -0
  54. package/dist/client/agent-sidebar-state.d.ts.map +1 -1
  55. package/dist/client/agent-sidebar-state.js +15 -4
  56. package/dist/client/agent-sidebar-state.js.map +1 -1
  57. package/dist/client/chat/index.d.ts +7 -0
  58. package/dist/client/chat/index.d.ts.map +1 -1
  59. package/dist/client/chat/index.js +6 -0
  60. package/dist/client/chat/index.js.map +1 -1
  61. package/dist/client/chat/run-recovery.d.ts.map +1 -1
  62. package/dist/client/chat/run-recovery.js +11 -9
  63. package/dist/client/chat/run-recovery.js.map +1 -1
  64. package/dist/client/chat/runtime.d.ts +354 -0
  65. package/dist/client/chat/runtime.d.ts.map +1 -0
  66. package/dist/client/chat/runtime.js +2 -0
  67. package/dist/client/chat/runtime.js.map +1 -0
  68. package/dist/client/chat/tool-call-display.d.ts +5 -1
  69. package/dist/client/chat/tool-call-display.d.ts.map +1 -1
  70. package/dist/client/chat/tool-call-display.js +22 -5
  71. package/dist/client/chat/tool-call-display.js.map +1 -1
  72. package/dist/client/chat/tool-render-registry.d.ts +35 -0
  73. package/dist/client/chat/tool-render-registry.d.ts.map +1 -0
  74. package/dist/client/chat/tool-render-registry.js +83 -0
  75. package/dist/client/chat/tool-render-registry.js.map +1 -0
  76. package/dist/client/chat/widgets/DataChartRenderer.d.ts +5 -0
  77. package/dist/client/chat/widgets/DataChartRenderer.d.ts.map +1 -0
  78. package/dist/client/chat/widgets/DataChartRenderer.js +33 -0
  79. package/dist/client/chat/widgets/DataChartRenderer.js.map +1 -0
  80. package/dist/client/chat/widgets/DataChartWidget.d.ts +5 -0
  81. package/dist/client/chat/widgets/DataChartWidget.d.ts.map +1 -0
  82. package/dist/client/chat/widgets/DataChartWidget.js +15 -0
  83. package/dist/client/chat/widgets/DataChartWidget.js.map +1 -0
  84. package/dist/client/chat/widgets/DataInsightsWidget.d.ts +5 -0
  85. package/dist/client/chat/widgets/DataInsightsWidget.d.ts.map +1 -0
  86. package/dist/client/chat/widgets/DataInsightsWidget.js +18 -0
  87. package/dist/client/chat/widgets/DataInsightsWidget.js.map +1 -0
  88. package/dist/client/chat/widgets/DataTableWidget.d.ts +9 -0
  89. package/dist/client/chat/widgets/DataTableWidget.d.ts.map +1 -0
  90. package/dist/client/chat/widgets/DataTableWidget.js +95 -0
  91. package/dist/client/chat/widgets/DataTableWidget.js.map +1 -0
  92. package/dist/client/chat/widgets/builtin-tool-renderers.d.ts +2 -0
  93. package/dist/client/chat/widgets/builtin-tool-renderers.d.ts.map +1 -0
  94. package/dist/client/chat/widgets/builtin-tool-renderers.js +82 -0
  95. package/dist/client/chat/widgets/builtin-tool-renderers.js.map +1 -0
  96. package/dist/client/chat/widgets/data-widget-types.d.ts +2 -0
  97. package/dist/client/chat/widgets/data-widget-types.d.ts.map +1 -0
  98. package/dist/client/chat/widgets/data-widget-types.js +2 -0
  99. package/dist/client/chat/widgets/data-widget-types.js.map +1 -0
  100. package/dist/client/chat-view-transition.d.ts +35 -0
  101. package/dist/client/chat-view-transition.d.ts.map +1 -0
  102. package/dist/client/chat-view-transition.js +66 -0
  103. package/dist/client/chat-view-transition.js.map +1 -0
  104. package/dist/client/composer/PromptComposer.d.ts +1 -1
  105. package/dist/client/composer/PromptComposer.d.ts.map +1 -1
  106. package/dist/client/composer/PromptComposer.js +2 -2
  107. package/dist/client/composer/PromptComposer.js.map +1 -1
  108. package/dist/client/composer/TiptapComposer.d.ts +2 -1
  109. package/dist/client/composer/TiptapComposer.d.ts.map +1 -1
  110. package/dist/client/composer/TiptapComposer.js +2 -1
  111. package/dist/client/composer/TiptapComposer.js.map +1 -1
  112. package/dist/client/index.d.ts +7 -1
  113. package/dist/client/index.d.ts.map +1 -1
  114. package/dist/client/index.js +6 -1
  115. package/dist/client/index.js.map +1 -1
  116. package/dist/client/route-state.d.ts +6 -0
  117. package/dist/client/route-state.d.ts.map +1 -1
  118. package/dist/client/route-state.js +16 -1
  119. package/dist/client/route-state.js.map +1 -1
  120. package/dist/client/sse-event-processor.d.ts +3 -0
  121. package/dist/client/sse-event-processor.d.ts.map +1 -1
  122. package/dist/client/sse-event-processor.js +2 -0
  123. package/dist/client/sse-event-processor.js.map +1 -1
  124. package/dist/client/use-chat-threads.d.ts.map +1 -1
  125. package/dist/client/use-chat-threads.js +19 -4
  126. package/dist/client/use-chat-threads.js.map +1 -1
  127. package/dist/data-widgets/index.d.ts +326 -0
  128. package/dist/data-widgets/index.d.ts.map +1 -0
  129. package/dist/data-widgets/index.js +232 -0
  130. package/dist/data-widgets/index.js.map +1 -0
  131. package/dist/index.browser.d.ts +2 -0
  132. package/dist/index.browser.d.ts.map +1 -1
  133. package/dist/index.browser.js +2 -0
  134. package/dist/index.browser.js.map +1 -1
  135. package/dist/index.d.ts +2 -0
  136. package/dist/index.d.ts.map +1 -1
  137. package/dist/index.js +2 -0
  138. package/dist/index.js.map +1 -1
  139. package/dist/provider-api/corpus-jobs.d.ts +160 -0
  140. package/dist/provider-api/corpus-jobs.d.ts.map +1 -1
  141. package/dist/provider-api/corpus-jobs.js +44 -0
  142. package/dist/provider-api/corpus-jobs.js.map +1 -1
  143. package/dist/provider-api/index.d.ts +39 -0
  144. package/dist/provider-api/index.d.ts.map +1 -1
  145. package/dist/provider-api/index.js +53 -0
  146. package/dist/provider-api/index.js.map +1 -1
  147. package/dist/scripts/dev/index.d.ts +1 -0
  148. package/dist/scripts/dev/index.d.ts.map +1 -1
  149. package/dist/scripts/dev/index.js +129 -127
  150. package/dist/scripts/dev/index.js.map +1 -1
  151. package/dist/server/action-discovery.d.ts.map +1 -1
  152. package/dist/server/action-discovery.js +5 -0
  153. package/dist/server/action-discovery.js.map +1 -1
  154. package/dist/server/agent-chat-plugin.d.ts +8 -0
  155. package/dist/server/agent-chat-plugin.d.ts.map +1 -1
  156. package/dist/server/agent-chat-plugin.js +34 -21
  157. package/dist/server/agent-chat-plugin.js.map +1 -1
  158. package/dist/server/prompts/framework-core-compact.d.ts +4 -1
  159. package/dist/server/prompts/framework-core-compact.d.ts.map +1 -1
  160. package/dist/server/prompts/framework-core-compact.js +11 -4
  161. package/dist/server/prompts/framework-core-compact.js.map +1 -1
  162. package/dist/server/prompts/framework-core.d.ts +4 -1
  163. package/dist/server/prompts/framework-core.d.ts.map +1 -1
  164. package/dist/server/prompts/framework-core.js +15 -5
  165. package/dist/server/prompts/framework-core.js.map +1 -1
  166. package/dist/server/prompts/shared-rules.d.ts +4 -1
  167. package/dist/server/prompts/shared-rules.d.ts.map +1 -1
  168. package/dist/server/prompts/shared-rules.js +4 -1
  169. package/dist/server/prompts/shared-rules.js.map +1 -1
  170. package/dist/styles/agent-native.css +62 -0
  171. package/dist/vite/client.d.ts.map +1 -1
  172. package/dist/vite/client.js +5 -0
  173. package/dist/vite/client.js.map +1 -1
  174. package/docs/content/actions.md +52 -0
  175. package/docs/content/components.md +24 -1
  176. package/docs/content/drop-in-agent.md +9 -2
  177. package/docs/content/external-agents.md +14 -4
  178. package/docs/content/faq.md +5 -4
  179. package/docs/content/getting-started.md +39 -87
  180. package/docs/content/key-concepts.md +34 -15
  181. package/docs/content/mcp-apps.md +2 -0
  182. package/docs/content/mcp-protocol.md +2 -2
  183. package/docs/content/native-chat-ui.md +210 -0
  184. package/docs/content/template-plan.md +16 -1
  185. package/docs/content/what-is-agent-native.md +10 -2
  186. package/package.json +2 -1
@@ -0,0 +1,354 @@
1
+ import type { AgentMcpAppPayload } from "../../mcp-client/app-result.js";
2
+ import type { ActionChatUIConfig } from "../../action-ui.js";
3
+ import type { ReasoningEffort } from "../../shared/reasoning-effort.js";
4
+ export type AgentChatRuntimeId = string;
5
+ export type AgentChatRuntimeSessionId = string;
6
+ export type AgentChatRuntimeTurnId = string;
7
+ export type AgentChatRuntimeMessageId = string;
8
+ export type AgentChatRuntimeToolCallId = string;
9
+ export type AgentChatRuntimeMetadata = Record<string, unknown>;
10
+ export type AgentChatRuntimeAwaitable<T> = T | Promise<T>;
11
+ export type AgentChatRuntimeKind = "agent-native" | "external-agent" | "code-agent" | (string & {});
12
+ export type AgentChatRuntimeRole = "system" | "user" | "assistant" | "tool";
13
+ export interface AgentChatRuntimeContentPartBase<TType extends string = string> {
14
+ readonly type: TType;
15
+ readonly id?: string;
16
+ readonly metadata?: AgentChatRuntimeMetadata;
17
+ }
18
+ export interface AgentChatRuntimeTextPart extends AgentChatRuntimeContentPartBase<"text"> {
19
+ readonly text: string;
20
+ }
21
+ export interface AgentChatRuntimeReasoningPart extends AgentChatRuntimeContentPartBase<"reasoning"> {
22
+ readonly text: string;
23
+ readonly signature?: string;
24
+ }
25
+ export interface AgentChatRuntimeImagePart extends AgentChatRuntimeContentPartBase<"image"> {
26
+ readonly data?: string;
27
+ readonly url?: string;
28
+ readonly mediaType?: string;
29
+ readonly alt?: string;
30
+ }
31
+ export interface AgentChatRuntimeFilePart extends AgentChatRuntimeContentPartBase<"file"> {
32
+ readonly data?: string;
33
+ readonly url?: string;
34
+ readonly mediaType?: string;
35
+ readonly filename?: string;
36
+ }
37
+ export interface AgentChatRuntimeToolCallPart extends AgentChatRuntimeContentPartBase<"tool-call"> {
38
+ readonly toolCallId: AgentChatRuntimeToolCallId;
39
+ readonly toolName: string;
40
+ readonly input?: unknown;
41
+ readonly inputText?: string;
42
+ }
43
+ export interface AgentChatRuntimeToolResultPart extends AgentChatRuntimeContentPartBase<"tool-result"> {
44
+ readonly toolCallId: AgentChatRuntimeToolCallId;
45
+ readonly toolName?: string;
46
+ readonly result?: unknown;
47
+ readonly resultText?: string;
48
+ readonly isError?: boolean;
49
+ readonly mcpApp?: AgentMcpAppPayload;
50
+ readonly chatUI?: ActionChatUIConfig;
51
+ }
52
+ export interface AgentChatRuntimeDataPart extends AgentChatRuntimeContentPartBase<"data"> {
53
+ readonly data: unknown;
54
+ readonly mediaType?: string;
55
+ readonly title?: string;
56
+ }
57
+ export interface AgentChatRuntimeCustomContentPart extends AgentChatRuntimeContentPartBase {
58
+ readonly [key: string]: unknown;
59
+ }
60
+ export type AgentChatRuntimeKnownContentPart = AgentChatRuntimeTextPart | AgentChatRuntimeReasoningPart | AgentChatRuntimeImagePart | AgentChatRuntimeFilePart | AgentChatRuntimeToolCallPart | AgentChatRuntimeToolResultPart | AgentChatRuntimeDataPart;
61
+ export type AgentChatRuntimeContentPart<TCustomPart extends AgentChatRuntimeCustomContentPart = never> = AgentChatRuntimeKnownContentPart | TCustomPart;
62
+ export interface AgentChatRuntimeMessage<TContentPart extends AgentChatRuntimeContentPartBase = AgentChatRuntimeKnownContentPart> {
63
+ readonly id: AgentChatRuntimeMessageId;
64
+ readonly role: AgentChatRuntimeRole;
65
+ readonly content: readonly TContentPart[];
66
+ readonly createdAt?: string;
67
+ readonly metadata?: AgentChatRuntimeMetadata;
68
+ }
69
+ export interface AgentChatRuntimeAttachment {
70
+ readonly id?: string;
71
+ readonly name: string;
72
+ readonly mediaType?: string;
73
+ readonly data?: string;
74
+ readonly url?: string;
75
+ readonly text?: string;
76
+ readonly metadata?: AgentChatRuntimeMetadata;
77
+ }
78
+ export interface AgentChatRuntimeToolDefinition {
79
+ readonly name: string;
80
+ readonly description?: string;
81
+ readonly inputSchema?: Record<string, unknown>;
82
+ readonly readOnly?: boolean;
83
+ readonly destructive?: boolean;
84
+ readonly metadata?: AgentChatRuntimeMetadata;
85
+ }
86
+ export interface AgentChatRuntimeToolCall {
87
+ readonly id: AgentChatRuntimeToolCallId;
88
+ readonly name: string;
89
+ readonly input?: unknown;
90
+ readonly inputText?: string;
91
+ readonly metadata?: AgentChatRuntimeMetadata;
92
+ }
93
+ export type AgentChatRuntimeToolStatus = "pending" | "running" | "completed" | "failed" | "cancelled";
94
+ export interface AgentChatRuntimeUsage {
95
+ readonly inputTokens?: number;
96
+ readonly outputTokens?: number;
97
+ readonly totalTokens?: number;
98
+ readonly reasoningTokens?: number;
99
+ readonly cacheReadTokens?: number;
100
+ readonly cacheWriteTokens?: number;
101
+ readonly costCents?: number;
102
+ readonly metadata?: AgentChatRuntimeMetadata;
103
+ }
104
+ export interface AgentChatRuntimeMessageCapabilities {
105
+ readonly streaming: boolean;
106
+ readonly history?: boolean;
107
+ readonly structuredContent?: boolean;
108
+ readonly multimodal?: boolean;
109
+ readonly attachments?: boolean;
110
+ }
111
+ export interface AgentChatRuntimeToolCapabilities {
112
+ readonly events: boolean;
113
+ readonly hostTools?: boolean;
114
+ readonly inputStreaming?: boolean;
115
+ readonly resultStreaming?: boolean;
116
+ readonly approvals?: boolean;
117
+ readonly mcpApps?: boolean;
118
+ }
119
+ export interface AgentChatRuntimeSessionCapabilities {
120
+ readonly create: boolean;
121
+ readonly restore?: boolean;
122
+ readonly list?: boolean;
123
+ readonly fork?: boolean;
124
+ readonly detach?: boolean;
125
+ readonly persistent?: boolean;
126
+ }
127
+ export interface AgentChatRuntimeCancellationCapabilities {
128
+ readonly abortSignal?: boolean;
129
+ readonly explicitCancel?: boolean;
130
+ readonly interrupt?: boolean;
131
+ }
132
+ export interface AgentChatRuntimeModelCapabilities {
133
+ readonly selectable?: boolean;
134
+ readonly reasoningEffort?: boolean;
135
+ readonly temperature?: boolean;
136
+ readonly providerOptions?: boolean;
137
+ }
138
+ export interface AgentChatRuntimeArtifactCapabilities {
139
+ readonly files?: boolean;
140
+ readonly links?: boolean;
141
+ readonly patches?: boolean;
142
+ readonly progress?: boolean;
143
+ }
144
+ export interface AgentChatRuntimeCapabilities {
145
+ readonly messages: AgentChatRuntimeMessageCapabilities;
146
+ readonly tools?: AgentChatRuntimeToolCapabilities;
147
+ readonly sessions?: AgentChatRuntimeSessionCapabilities;
148
+ readonly cancellation?: AgentChatRuntimeCancellationCapabilities;
149
+ readonly models?: AgentChatRuntimeModelCapabilities;
150
+ readonly artifacts?: AgentChatRuntimeArtifactCapabilities;
151
+ readonly custom?: AgentChatRuntimeMetadata;
152
+ }
153
+ export interface AgentChatRuntimeCreateSessionInput {
154
+ readonly id?: AgentChatRuntimeSessionId;
155
+ readonly threadId?: string;
156
+ readonly title?: string;
157
+ readonly messages?: readonly AgentChatRuntimeMessage[];
158
+ readonly resumeState?: unknown;
159
+ readonly metadata?: AgentChatRuntimeMetadata;
160
+ readonly abortSignal?: AbortSignal;
161
+ }
162
+ export interface AgentChatRuntimeListSessionsInput {
163
+ readonly threadId?: string;
164
+ readonly limit?: number;
165
+ readonly cursor?: string;
166
+ readonly metadata?: AgentChatRuntimeMetadata;
167
+ readonly abortSignal?: AbortSignal;
168
+ }
169
+ export type AgentChatRuntimeSessionStatus = "idle" | "running" | "waiting" | "cancelled" | "completed" | "error";
170
+ export interface AgentChatRuntimeSessionSummary {
171
+ readonly id: AgentChatRuntimeSessionId;
172
+ readonly runtimeId: AgentChatRuntimeId;
173
+ readonly threadId?: string;
174
+ readonly title?: string;
175
+ readonly status?: AgentChatRuntimeSessionStatus;
176
+ readonly createdAt?: string;
177
+ readonly updatedAt?: string;
178
+ readonly metadata?: AgentChatRuntimeMetadata;
179
+ }
180
+ export interface AgentChatRuntimeSessionSnapshot extends AgentChatRuntimeSessionSummary {
181
+ readonly messages?: readonly AgentChatRuntimeMessage[];
182
+ readonly resumeState?: unknown;
183
+ }
184
+ export interface AgentChatRuntimeTurnInput {
185
+ readonly prompt?: string;
186
+ readonly messages?: readonly AgentChatRuntimeMessage[];
187
+ readonly attachments?: readonly AgentChatRuntimeAttachment[];
188
+ readonly tools?: readonly AgentChatRuntimeToolDefinition[];
189
+ readonly model?: string;
190
+ readonly reasoningEffort?: ReasoningEffort;
191
+ readonly temperature?: number;
192
+ readonly providerOptions?: Record<string, unknown>;
193
+ readonly metadata?: AgentChatRuntimeMetadata;
194
+ readonly abortSignal?: AbortSignal;
195
+ }
196
+ export interface AgentChatRuntimeApprovalResponse {
197
+ readonly id: string;
198
+ readonly approved: boolean;
199
+ readonly message?: string;
200
+ readonly metadata?: AgentChatRuntimeMetadata;
201
+ }
202
+ export interface AgentChatRuntimeContinueInput {
203
+ readonly turnId?: AgentChatRuntimeTurnId;
204
+ readonly prompt?: string;
205
+ readonly approval?: AgentChatRuntimeApprovalResponse;
206
+ readonly metadata?: AgentChatRuntimeMetadata;
207
+ readonly abortSignal?: AbortSignal;
208
+ }
209
+ export interface AgentChatRuntimeCancelInput {
210
+ readonly turnId?: AgentChatRuntimeTurnId;
211
+ readonly reason?: string;
212
+ readonly metadata?: AgentChatRuntimeMetadata;
213
+ readonly abortSignal?: AbortSignal;
214
+ }
215
+ export type AgentChatRuntimeCancelStatus = "cancelled" | "not-found" | "already-finished" | "unsupported";
216
+ export interface AgentChatRuntimeCancelResult {
217
+ readonly status: AgentChatRuntimeCancelStatus;
218
+ readonly message?: string;
219
+ readonly metadata?: AgentChatRuntimeMetadata;
220
+ }
221
+ export interface AgentChatRuntimeEventBase<TType extends string = string> {
222
+ readonly type: TType;
223
+ readonly id?: string;
224
+ readonly sessionId?: AgentChatRuntimeSessionId;
225
+ readonly turnId?: AgentChatRuntimeTurnId;
226
+ readonly timestamp?: string;
227
+ readonly metadata?: AgentChatRuntimeMetadata;
228
+ }
229
+ export interface AgentChatRuntimeMessageStartEvent extends AgentChatRuntimeEventBase<"message-start"> {
230
+ readonly message: AgentChatRuntimeMessage;
231
+ }
232
+ export type AgentChatRuntimeMessageDelta = {
233
+ readonly type: "text";
234
+ readonly text: string;
235
+ readonly partId?: string;
236
+ } | {
237
+ readonly type: "reasoning";
238
+ readonly text: string;
239
+ readonly partId?: string;
240
+ readonly signature?: string;
241
+ } | {
242
+ readonly type: "data";
243
+ readonly data: unknown;
244
+ readonly partId?: string;
245
+ readonly mediaType?: string;
246
+ };
247
+ export interface AgentChatRuntimeMessageDeltaEvent extends AgentChatRuntimeEventBase<"message-delta"> {
248
+ readonly messageId: AgentChatRuntimeMessageId;
249
+ readonly delta: AgentChatRuntimeMessageDelta;
250
+ }
251
+ export interface AgentChatRuntimeMessageDoneEvent extends AgentChatRuntimeEventBase<"message-done"> {
252
+ readonly message: AgentChatRuntimeMessage;
253
+ }
254
+ export interface AgentChatRuntimeToolStartEvent extends AgentChatRuntimeEventBase<"tool-start"> {
255
+ readonly toolCall: AgentChatRuntimeToolCall;
256
+ }
257
+ export interface AgentChatRuntimeToolDeltaEvent extends AgentChatRuntimeEventBase<"tool-delta"> {
258
+ readonly toolCallId: AgentChatRuntimeToolCallId;
259
+ readonly toolName?: string;
260
+ readonly inputTextDelta?: string;
261
+ readonly resultTextDelta?: string;
262
+ }
263
+ export interface AgentChatRuntimeToolDoneEvent extends AgentChatRuntimeEventBase<"tool-done"> {
264
+ readonly toolCallId: AgentChatRuntimeToolCallId;
265
+ readonly toolName: string;
266
+ readonly status: AgentChatRuntimeToolStatus;
267
+ readonly result?: unknown;
268
+ readonly resultText?: string;
269
+ readonly error?: string;
270
+ readonly mcpApp?: AgentMcpAppPayload;
271
+ }
272
+ export interface AgentChatRuntimeApprovalRequestEvent extends AgentChatRuntimeEventBase<"approval-request"> {
273
+ readonly approvalId: string;
274
+ readonly toolCallId?: AgentChatRuntimeToolCallId;
275
+ readonly toolName?: string;
276
+ readonly message: string;
277
+ readonly input?: unknown;
278
+ }
279
+ export interface AgentChatRuntimeApprovalResolvedEvent extends AgentChatRuntimeEventBase<"approval-resolved"> {
280
+ readonly approvalId: string;
281
+ readonly approved: boolean;
282
+ readonly message?: string;
283
+ }
284
+ export interface AgentChatRuntimeStatusEvent extends AgentChatRuntimeEventBase<"status"> {
285
+ readonly level?: "info" | "warning" | "error";
286
+ readonly message: string;
287
+ readonly code?: string;
288
+ }
289
+ export interface AgentChatRuntimeArtifactEvent extends AgentChatRuntimeEventBase<"artifact"> {
290
+ readonly artifact: {
291
+ readonly id?: string;
292
+ readonly kind: string;
293
+ readonly title?: string;
294
+ readonly url?: string;
295
+ readonly path?: string;
296
+ readonly data?: unknown;
297
+ readonly metadata?: AgentChatRuntimeMetadata;
298
+ };
299
+ }
300
+ export interface AgentChatRuntimeFileEvent extends AgentChatRuntimeEventBase<"file"> {
301
+ readonly path: string;
302
+ readonly operation?: "create" | "update" | "delete" | "rename" | "unknown";
303
+ readonly summary?: string;
304
+ }
305
+ export interface AgentChatRuntimeUsageEvent extends AgentChatRuntimeEventBase<"usage"> {
306
+ readonly usage: AgentChatRuntimeUsage;
307
+ }
308
+ export interface AgentChatRuntimeErrorEvent extends AgentChatRuntimeEventBase<"error"> {
309
+ readonly error: string;
310
+ readonly code?: string;
311
+ readonly recoverable?: boolean;
312
+ readonly cause?: unknown;
313
+ }
314
+ export type AgentChatRuntimeDoneReason = "complete" | "cancelled" | "error" | "interrupted" | "length" | "tool-use" | (string & {});
315
+ export interface AgentChatRuntimeDoneEvent extends AgentChatRuntimeEventBase<"done"> {
316
+ readonly reason?: AgentChatRuntimeDoneReason;
317
+ }
318
+ export interface AgentChatRuntimeCustomEvent extends AgentChatRuntimeEventBase {
319
+ readonly [key: string]: unknown;
320
+ }
321
+ export type AgentChatRuntimeKnownEvent = AgentChatRuntimeMessageStartEvent | AgentChatRuntimeMessageDeltaEvent | AgentChatRuntimeMessageDoneEvent | AgentChatRuntimeToolStartEvent | AgentChatRuntimeToolDeltaEvent | AgentChatRuntimeToolDoneEvent | AgentChatRuntimeApprovalRequestEvent | AgentChatRuntimeApprovalResolvedEvent | AgentChatRuntimeStatusEvent | AgentChatRuntimeArtifactEvent | AgentChatRuntimeFileEvent | AgentChatRuntimeUsageEvent | AgentChatRuntimeErrorEvent | AgentChatRuntimeDoneEvent;
322
+ export type AgentChatRuntimeEvent<TCustomEvent extends AgentChatRuntimeCustomEvent = never> = AgentChatRuntimeKnownEvent | TCustomEvent;
323
+ export interface AgentChatRuntimeTurn<TEvent extends AgentChatRuntimeEventBase = AgentChatRuntimeKnownEvent> {
324
+ readonly id?: AgentChatRuntimeTurnId;
325
+ readonly sessionId: AgentChatRuntimeSessionId;
326
+ readonly events: AsyncIterable<TEvent>;
327
+ cancel?(input?: AgentChatRuntimeCancelInput): Promise<AgentChatRuntimeCancelResult>;
328
+ }
329
+ export interface AgentChatRuntimeSession<TEvent extends AgentChatRuntimeEventBase = AgentChatRuntimeKnownEvent> {
330
+ readonly id: AgentChatRuntimeSessionId;
331
+ readonly runtimeId: AgentChatRuntimeId;
332
+ readonly threadId?: string;
333
+ readonly capabilities?: Partial<AgentChatRuntimeCapabilities>;
334
+ startTurn(input: AgentChatRuntimeTurnInput): AgentChatRuntimeAwaitable<AgentChatRuntimeTurn<TEvent>>;
335
+ continueTurn?(input?: AgentChatRuntimeContinueInput): AgentChatRuntimeAwaitable<AgentChatRuntimeTurn<TEvent>>;
336
+ cancelTurn?(input?: AgentChatRuntimeCancelInput): Promise<AgentChatRuntimeCancelResult>;
337
+ snapshot?(): AgentChatRuntimeAwaitable<AgentChatRuntimeSessionSnapshot>;
338
+ dispose?(): AgentChatRuntimeAwaitable<void>;
339
+ }
340
+ export interface AgentChatRuntime<TEvent extends AgentChatRuntimeEventBase = AgentChatRuntimeKnownEvent> {
341
+ readonly id: AgentChatRuntimeId;
342
+ readonly kind: AgentChatRuntimeKind;
343
+ readonly label: string;
344
+ readonly description?: string;
345
+ readonly capabilities: AgentChatRuntimeCapabilities;
346
+ createSession(input?: AgentChatRuntimeCreateSessionInput): AgentChatRuntimeAwaitable<AgentChatRuntimeSession<TEvent>>;
347
+ restoreSession?(snapshot: AgentChatRuntimeSessionSnapshot): AgentChatRuntimeAwaitable<AgentChatRuntimeSession<TEvent>>;
348
+ getSession?(input: {
349
+ readonly sessionId: AgentChatRuntimeSessionId;
350
+ readonly abortSignal?: AbortSignal;
351
+ }): AgentChatRuntimeAwaitable<AgentChatRuntimeSession<TEvent> | null>;
352
+ listSessions?(input?: AgentChatRuntimeListSessionsInput): AgentChatRuntimeAwaitable<readonly AgentChatRuntimeSessionSummary[]>;
353
+ }
354
+ //# sourceMappingURL=runtime.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../../src/client/chat/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAExE,MAAM,MAAM,kBAAkB,GAAG,MAAM,CAAC;AACxC,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAC/C,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC;AAC5C,MAAM,MAAM,yBAAyB,GAAG,MAAM,CAAC;AAC/C,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC;AAChD,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AAC/D,MAAM,MAAM,yBAAyB,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE1D,MAAM,MAAM,oBAAoB,GAC5B,cAAc,GACd,gBAAgB,GAChB,YAAY,GACZ,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,MAAM,oBAAoB,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,MAAM,CAAC;AAE5E,MAAM,WAAW,+BAA+B,CAC9C,KAAK,SAAS,MAAM,GAAG,MAAM;IAE7B,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;IACrB,QAAQ,CAAC,EAAE,CAAC,EAAE,MAAM,CAAC;IACrB,QAA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vB,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,YAAY,EAAE,4BAA4B,CAAC;IACpD,aAAa,CACX,KAAK,CAAC,EAAE,kCAAkC,GACzC,yBAAyB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,cAAc,CAAC,CACb,QAAQ,EAAE,+BAA+B,GACxC,yBAAyB,CAAC,uBAAuB,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9D,UAAU,CAAC,CAAC,KAAK,EAAE;QACjB,QAAQ,CAAC,SAAS,EAAE,yBAAyB,CAAC;QAC9C,QAAQ,CAAC,WAAW,CAAC,EAAE,WAAW,CAAC;KACpC,GAAG,yBAAyB,CAAC,uBAAuB,CAAC,MAAM,CAAC,GAAG,IAAI,CAAC,CAAC;IACtE,YAAY,CAAC,CACX,KAAK,CAAC,EAAE,iCAAiC,GACxC,yBAAyB,CAAC,SAAS,8BAA8B,EAAE,CAAC,CAAC;CACzE"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=runtime.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"runtime.js","sourceRoot":"","sources":["../../../src/client/chat/runtime.ts"],"names":[],"mappings":"","sourcesContent":["import type { AgentMcpAppPayload } from \"../../mcp-client/app-result.js\";\nimport type { ActionChatUIConfig } from \"../../action-ui.js\";\nimport type { ReasoningEffort } from \"../../shared/reasoning-effort.js\";\n\nexport type AgentChatRuntimeId = string;\nexport type AgentChatRuntimeSessionId = string;\nexport type AgentChatRuntimeTurnId = string;\nexport type AgentChatRuntimeMessageId = string;\nexport type AgentChatRuntimeToolCallId = string;\nexport type AgentChatRuntimeMetadata = Record<string, unknown>;\nexport type AgentChatRuntimeAwaitable<T> = T | Promise<T>;\n\nexport type AgentChatRuntimeKind =\n | \"agent-native\"\n | \"external-agent\"\n | \"code-agent\"\n | (string & {});\n\nexport type AgentChatRuntimeRole = \"system\" | \"user\" | \"assistant\" | \"tool\";\n\nexport interface AgentChatRuntimeContentPartBase<\n TType extends string = string,\n> {\n readonly type: TType;\n readonly id?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeTextPart extends AgentChatRuntimeContentPartBase<\"text\"> {\n readonly text: string;\n}\n\nexport interface AgentChatRuntimeReasoningPart extends AgentChatRuntimeContentPartBase<\"reasoning\"> {\n readonly text: string;\n readonly signature?: string;\n}\n\nexport interface AgentChatRuntimeImagePart extends AgentChatRuntimeContentPartBase<\"image\"> {\n readonly data?: string;\n readonly url?: string;\n readonly mediaType?: string;\n readonly alt?: string;\n}\n\nexport interface AgentChatRuntimeFilePart extends AgentChatRuntimeContentPartBase<\"file\"> {\n readonly data?: string;\n readonly url?: string;\n readonly mediaType?: string;\n readonly filename?: string;\n}\n\nexport interface AgentChatRuntimeToolCallPart extends AgentChatRuntimeContentPartBase<\"tool-call\"> {\n readonly toolCallId: AgentChatRuntimeToolCallId;\n readonly toolName: string;\n readonly input?: unknown;\n readonly inputText?: string;\n}\n\nexport interface AgentChatRuntimeToolResultPart extends AgentChatRuntimeContentPartBase<\"tool-result\"> {\n readonly toolCallId: AgentChatRuntimeToolCallId;\n readonly toolName?: string;\n readonly result?: unknown;\n readonly resultText?: string;\n readonly isError?: boolean;\n readonly mcpApp?: AgentMcpAppPayload;\n readonly chatUI?: ActionChatUIConfig;\n}\n\nexport interface AgentChatRuntimeDataPart extends AgentChatRuntimeContentPartBase<\"data\"> {\n readonly data: unknown;\n readonly mediaType?: string;\n readonly title?: string;\n}\n\nexport interface AgentChatRuntimeCustomContentPart extends AgentChatRuntimeContentPartBase {\n readonly [key: string]: unknown;\n}\n\nexport type AgentChatRuntimeKnownContentPart =\n | AgentChatRuntimeTextPart\n | AgentChatRuntimeReasoningPart\n | AgentChatRuntimeImagePart\n | AgentChatRuntimeFilePart\n | AgentChatRuntimeToolCallPart\n | AgentChatRuntimeToolResultPart\n | AgentChatRuntimeDataPart;\n\nexport type AgentChatRuntimeContentPart<\n TCustomPart extends AgentChatRuntimeCustomContentPart = never,\n> = AgentChatRuntimeKnownContentPart | TCustomPart;\n\nexport interface AgentChatRuntimeMessage<\n TContentPart extends AgentChatRuntimeContentPartBase =\n AgentChatRuntimeKnownContentPart,\n> {\n readonly id: AgentChatRuntimeMessageId;\n readonly role: AgentChatRuntimeRole;\n readonly content: readonly TContentPart[];\n readonly createdAt?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeAttachment {\n readonly id?: string;\n readonly name: string;\n readonly mediaType?: string;\n readonly data?: string;\n readonly url?: string;\n readonly text?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeToolDefinition {\n readonly name: string;\n readonly description?: string;\n readonly inputSchema?: Record<string, unknown>;\n readonly readOnly?: boolean;\n readonly destructive?: boolean;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeToolCall {\n readonly id: AgentChatRuntimeToolCallId;\n readonly name: string;\n readonly input?: unknown;\n readonly inputText?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport type AgentChatRuntimeToolStatus =\n | \"pending\"\n | \"running\"\n | \"completed\"\n | \"failed\"\n | \"cancelled\";\n\nexport interface AgentChatRuntimeUsage {\n readonly inputTokens?: number;\n readonly outputTokens?: number;\n readonly totalTokens?: number;\n readonly reasoningTokens?: number;\n readonly cacheReadTokens?: number;\n readonly cacheWriteTokens?: number;\n readonly costCents?: number;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeMessageCapabilities {\n readonly streaming: boolean;\n readonly history?: boolean;\n readonly structuredContent?: boolean;\n readonly multimodal?: boolean;\n readonly attachments?: boolean;\n}\n\nexport interface AgentChatRuntimeToolCapabilities {\n readonly events: boolean;\n readonly hostTools?: boolean;\n readonly inputStreaming?: boolean;\n readonly resultStreaming?: boolean;\n readonly approvals?: boolean;\n readonly mcpApps?: boolean;\n}\n\nexport interface AgentChatRuntimeSessionCapabilities {\n readonly create: boolean;\n readonly restore?: boolean;\n readonly list?: boolean;\n readonly fork?: boolean;\n readonly detach?: boolean;\n readonly persistent?: boolean;\n}\n\nexport interface AgentChatRuntimeCancellationCapabilities {\n readonly abortSignal?: boolean;\n readonly explicitCancel?: boolean;\n readonly interrupt?: boolean;\n}\n\nexport interface AgentChatRuntimeModelCapabilities {\n readonly selectable?: boolean;\n readonly reasoningEffort?: boolean;\n readonly temperature?: boolean;\n readonly providerOptions?: boolean;\n}\n\nexport interface AgentChatRuntimeArtifactCapabilities {\n readonly files?: boolean;\n readonly links?: boolean;\n readonly patches?: boolean;\n readonly progress?: boolean;\n}\n\nexport interface AgentChatRuntimeCapabilities {\n readonly messages: AgentChatRuntimeMessageCapabilities;\n readonly tools?: AgentChatRuntimeToolCapabilities;\n readonly sessions?: AgentChatRuntimeSessionCapabilities;\n readonly cancellation?: AgentChatRuntimeCancellationCapabilities;\n readonly models?: AgentChatRuntimeModelCapabilities;\n readonly artifacts?: AgentChatRuntimeArtifactCapabilities;\n readonly custom?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeCreateSessionInput {\n readonly id?: AgentChatRuntimeSessionId;\n readonly threadId?: string;\n readonly title?: string;\n readonly messages?: readonly AgentChatRuntimeMessage[];\n readonly resumeState?: unknown;\n readonly metadata?: AgentChatRuntimeMetadata;\n readonly abortSignal?: AbortSignal;\n}\n\nexport interface AgentChatRuntimeListSessionsInput {\n readonly threadId?: string;\n readonly limit?: number;\n readonly cursor?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n readonly abortSignal?: AbortSignal;\n}\n\nexport type AgentChatRuntimeSessionStatus =\n | \"idle\"\n | \"running\"\n | \"waiting\"\n | \"cancelled\"\n | \"completed\"\n | \"error\";\n\nexport interface AgentChatRuntimeSessionSummary {\n readonly id: AgentChatRuntimeSessionId;\n readonly runtimeId: AgentChatRuntimeId;\n readonly threadId?: string;\n readonly title?: string;\n readonly status?: AgentChatRuntimeSessionStatus;\n readonly createdAt?: string;\n readonly updatedAt?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeSessionSnapshot extends AgentChatRuntimeSessionSummary {\n readonly messages?: readonly AgentChatRuntimeMessage[];\n readonly resumeState?: unknown;\n}\n\nexport interface AgentChatRuntimeTurnInput {\n readonly prompt?: string;\n readonly messages?: readonly AgentChatRuntimeMessage[];\n readonly attachments?: readonly AgentChatRuntimeAttachment[];\n readonly tools?: readonly AgentChatRuntimeToolDefinition[];\n readonly model?: string;\n readonly reasoningEffort?: ReasoningEffort;\n readonly temperature?: number;\n readonly providerOptions?: Record<string, unknown>;\n readonly metadata?: AgentChatRuntimeMetadata;\n readonly abortSignal?: AbortSignal;\n}\n\nexport interface AgentChatRuntimeApprovalResponse {\n readonly id: string;\n readonly approved: boolean;\n readonly message?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeContinueInput {\n readonly turnId?: AgentChatRuntimeTurnId;\n readonly prompt?: string;\n readonly approval?: AgentChatRuntimeApprovalResponse;\n readonly metadata?: AgentChatRuntimeMetadata;\n readonly abortSignal?: AbortSignal;\n}\n\nexport interface AgentChatRuntimeCancelInput {\n readonly turnId?: AgentChatRuntimeTurnId;\n readonly reason?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n readonly abortSignal?: AbortSignal;\n}\n\nexport type AgentChatRuntimeCancelStatus =\n | \"cancelled\"\n | \"not-found\"\n | \"already-finished\"\n | \"unsupported\";\n\nexport interface AgentChatRuntimeCancelResult {\n readonly status: AgentChatRuntimeCancelStatus;\n readonly message?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeEventBase<TType extends string = string> {\n readonly type: TType;\n readonly id?: string;\n readonly sessionId?: AgentChatRuntimeSessionId;\n readonly turnId?: AgentChatRuntimeTurnId;\n readonly timestamp?: string;\n readonly metadata?: AgentChatRuntimeMetadata;\n}\n\nexport interface AgentChatRuntimeMessageStartEvent extends AgentChatRuntimeEventBase<\"message-start\"> {\n readonly message: AgentChatRuntimeMessage;\n}\n\nexport type AgentChatRuntimeMessageDelta =\n | {\n readonly type: \"text\";\n readonly text: string;\n readonly partId?: string;\n }\n | {\n readonly type: \"reasoning\";\n readonly text: string;\n readonly partId?: string;\n readonly signature?: string;\n }\n | {\n readonly type: \"data\";\n readonly data: unknown;\n readonly partId?: string;\n readonly mediaType?: string;\n };\n\nexport interface AgentChatRuntimeMessageDeltaEvent extends AgentChatRuntimeEventBase<\"message-delta\"> {\n readonly messageId: AgentChatRuntimeMessageId;\n readonly delta: AgentChatRuntimeMessageDelta;\n}\n\nexport interface AgentChatRuntimeMessageDoneEvent extends AgentChatRuntimeEventBase<\"message-done\"> {\n readonly message: AgentChatRuntimeMessage;\n}\n\nexport interface AgentChatRuntimeToolStartEvent extends AgentChatRuntimeEventBase<\"tool-start\"> {\n readonly toolCall: AgentChatRuntimeToolCall;\n}\n\nexport interface AgentChatRuntimeToolDeltaEvent extends AgentChatRuntimeEventBase<\"tool-delta\"> {\n readonly toolCallId: AgentChatRuntimeToolCallId;\n readonly toolName?: string;\n readonly inputTextDelta?: string;\n readonly resultTextDelta?: string;\n}\n\nexport interface AgentChatRuntimeToolDoneEvent extends AgentChatRuntimeEventBase<\"tool-done\"> {\n readonly toolCallId: AgentChatRuntimeToolCallId;\n readonly toolName: string;\n readonly status: AgentChatRuntimeToolStatus;\n readonly result?: unknown;\n readonly resultText?: string;\n readonly error?: string;\n readonly mcpApp?: AgentMcpAppPayload;\n}\n\nexport interface AgentChatRuntimeApprovalRequestEvent extends AgentChatRuntimeEventBase<\"approval-request\"> {\n readonly approvalId: string;\n readonly toolCallId?: AgentChatRuntimeToolCallId;\n readonly toolName?: string;\n readonly message: string;\n readonly input?: unknown;\n}\n\nexport interface AgentChatRuntimeApprovalResolvedEvent extends AgentChatRuntimeEventBase<\"approval-resolved\"> {\n readonly approvalId: string;\n readonly approved: boolean;\n readonly message?: string;\n}\n\nexport interface AgentChatRuntimeStatusEvent extends AgentChatRuntimeEventBase<\"status\"> {\n readonly level?: \"info\" | \"warning\" | \"error\";\n readonly message: string;\n readonly code?: string;\n}\n\nexport interface AgentChatRuntimeArtifactEvent extends AgentChatRuntimeEventBase<\"artifact\"> {\n readonly artifact: {\n readonly id?: string;\n readonly kind: string;\n readonly title?: string;\n readonly url?: string;\n readonly path?: string;\n readonly data?: unknown;\n readonly metadata?: AgentChatRuntimeMetadata;\n };\n}\n\nexport interface AgentChatRuntimeFileEvent extends AgentChatRuntimeEventBase<\"file\"> {\n readonly path: string;\n readonly operation?: \"create\" | \"update\" | \"delete\" | \"rename\" | \"unknown\";\n readonly summary?: string;\n}\n\nexport interface AgentChatRuntimeUsageEvent extends AgentChatRuntimeEventBase<\"usage\"> {\n readonly usage: AgentChatRuntimeUsage;\n}\n\nexport interface AgentChatRuntimeErrorEvent extends AgentChatRuntimeEventBase<\"error\"> {\n readonly error: string;\n readonly code?: string;\n readonly recoverable?: boolean;\n readonly cause?: unknown;\n}\n\nexport type AgentChatRuntimeDoneReason =\n | \"complete\"\n | \"cancelled\"\n | \"error\"\n | \"interrupted\"\n | \"length\"\n | \"tool-use\"\n | (string & {});\n\nexport interface AgentChatRuntimeDoneEvent extends AgentChatRuntimeEventBase<\"done\"> {\n readonly reason?: AgentChatRuntimeDoneReason;\n}\n\nexport interface AgentChatRuntimeCustomEvent extends AgentChatRuntimeEventBase {\n readonly [key: string]: unknown;\n}\n\nexport type AgentChatRuntimeKnownEvent =\n | AgentChatRuntimeMessageStartEvent\n | AgentChatRuntimeMessageDeltaEvent\n | AgentChatRuntimeMessageDoneEvent\n | AgentChatRuntimeToolStartEvent\n | AgentChatRuntimeToolDeltaEvent\n | AgentChatRuntimeToolDoneEvent\n | AgentChatRuntimeApprovalRequestEvent\n | AgentChatRuntimeApprovalResolvedEvent\n | AgentChatRuntimeStatusEvent\n | AgentChatRuntimeArtifactEvent\n | AgentChatRuntimeFileEvent\n | AgentChatRuntimeUsageEvent\n | AgentChatRuntimeErrorEvent\n | AgentChatRuntimeDoneEvent;\n\nexport type AgentChatRuntimeEvent<\n TCustomEvent extends AgentChatRuntimeCustomEvent = never,\n> = AgentChatRuntimeKnownEvent | TCustomEvent;\n\nexport interface AgentChatRuntimeTurn<\n TEvent extends AgentChatRuntimeEventBase = AgentChatRuntimeKnownEvent,\n> {\n readonly id?: AgentChatRuntimeTurnId;\n readonly sessionId: AgentChatRuntimeSessionId;\n readonly events: AsyncIterable<TEvent>;\n cancel?(\n input?: AgentChatRuntimeCancelInput,\n ): Promise<AgentChatRuntimeCancelResult>;\n}\n\nexport interface AgentChatRuntimeSession<\n TEvent extends AgentChatRuntimeEventBase = AgentChatRuntimeKnownEvent,\n> {\n readonly id: AgentChatRuntimeSessionId;\n readonly runtimeId: AgentChatRuntimeId;\n readonly threadId?: string;\n readonly capabilities?: Partial<AgentChatRuntimeCapabilities>;\n startTurn(\n input: AgentChatRuntimeTurnInput,\n ): AgentChatRuntimeAwaitable<AgentChatRuntimeTurn<TEvent>>;\n continueTurn?(\n input?: AgentChatRuntimeContinueInput,\n ): AgentChatRuntimeAwaitable<AgentChatRuntimeTurn<TEvent>>;\n cancelTurn?(\n input?: AgentChatRuntimeCancelInput,\n ): Promise<AgentChatRuntimeCancelResult>;\n snapshot?(): AgentChatRuntimeAwaitable<AgentChatRuntimeSessionSnapshot>;\n dispose?(): AgentChatRuntimeAwaitable<void>;\n}\n\nexport interface AgentChatRuntime<\n TEvent extends AgentChatRuntimeEventBase = AgentChatRuntimeKnownEvent,\n> {\n readonly id: AgentChatRuntimeId;\n readonly kind: AgentChatRuntimeKind;\n readonly label: string;\n readonly description?: string;\n readonly capabilities: AgentChatRuntimeCapabilities;\n createSession(\n input?: AgentChatRuntimeCreateSessionInput,\n ): AgentChatRuntimeAwaitable<AgentChatRuntimeSession<TEvent>>;\n restoreSession?(\n snapshot: AgentChatRuntimeSessionSnapshot,\n ): AgentChatRuntimeAwaitable<AgentChatRuntimeSession<TEvent>>;\n getSession?(input: {\n readonly sessionId: AgentChatRuntimeSessionId;\n readonly abortSignal?: AbortSignal;\n }): AgentChatRuntimeAwaitable<AgentChatRuntimeSession<TEvent> | null>;\n listSessions?(\n input?: AgentChatRuntimeListSessionsInput,\n ): AgentChatRuntimeAwaitable<readonly AgentChatRuntimeSessionSummary[]>;\n}\n"]}
@@ -1,8 +1,10 @@
1
1
  import React from "react";
2
2
  import type { ToolCallMessagePartProps } from "@assistant-ui/react";
3
+ import type { ActionChatUIConfig } from "../../action-ui.js";
3
4
  import type { AgentMcpAppPayload } from "../../mcp-client/app-result.js";
4
5
  import type { ContentPart } from "../sse-event-processor.js";
5
6
  import { FilesChangedSummary } from "../tool-cells/index.js";
7
+ import "./widgets/builtin-tool-renderers.js";
6
8
  export declare const ChatRunningContext: React.Context<boolean>;
7
9
  /**
8
10
  * Human-in-the-loop approval bridge. `AssistantChatInner` provides a value that
@@ -25,12 +27,13 @@ export type ToolDetailPayload = {
25
27
  };
26
28
  export declare function toolInputPayload(toolName: string, args: Record<string, unknown>): ToolDetailPayload | null;
27
29
  export declare function toolResultPayload(result: string | undefined): ToolDetailPayload | null;
28
- export declare function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, isRunning, structuredMeta, approval, }: {
30
+ export declare function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, structuredMeta, approval, }: {
29
31
  toolName: string;
30
32
  argsText?: string;
31
33
  args: Record<string, unknown>;
32
34
  result?: string;
33
35
  mcpApp?: AgentMcpAppPayload;
36
+ chatUI?: ActionChatUIConfig;
34
37
  isRunning: boolean;
35
38
  structuredMeta?: Record<string, unknown>;
36
39
  approval?: {
@@ -40,6 +43,7 @@ export declare function ToolCallDisplay({ toolName, argsText, args, result, mcpA
40
43
  }): import("react/jsx-runtime").JSX.Element;
41
44
  export declare function ToolCallFallback({ toolName, args, argsText, result, ...rest }: ToolCallMessagePartProps & {
42
45
  mcpApp?: AgentMcpAppPayload;
46
+ chatUI?: ActionChatUIConfig;
43
47
  structuredMeta?: Record<string, unknown>;
44
48
  approval?: {
45
49
  approvalKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"tool-call-display.d.ts","sourceRoot":"","sources":["../../../src/client/chat/tool-call-display.tsx"],"names":[],"mappings":"AAGA,OAAO,KAMN,MAAM,OAAO,CAAC;AACf,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,gCAAgC,CAAC;AACzE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAIL,mBAAmB,EACpB,MAAM,wBAAwB,CAAC;AA6BhC,eAAO,MAAM,kBAAkB,wBAA6B,CAAC;AAE7D;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,8DAA8D;IAC9D,SAAS,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;CAC1C,CAAC;AACF,eAAO,MAAM,eAAe,4CAE3B,CAAC;AAIF,KAAK,iBAAiB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAC5C,MAAM,MAAM,iBAAiB,GAAG;IAC9B,OAAO,EAAE,iBAAiB,CAAC;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAiEF,wBAAgB,gBAAgB,CAC9B,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,iBAAiB,GAAG,IAAI,CAyB1B;AAED,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,MAAM,GAAG,SAAS,GACzB,iBAAiB,GAAG,IAAI,CAU1B;AA8ND,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,QAAQ,EACR,IAAI,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C5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,SAAS,EAAE,OAAO,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACzD,2CAgDA;AA0MD,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,QAAQ,EACR,MAAM,EACN,GAAG,IAAI,EACR,EAAE,wBAAwB,GAAG;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,MAAM,CAAC,EAAE,kBAAkB,CAAC;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACzC,QAAQ,CAAC,EAAE;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,SAAS,CAAC,EAAE,OAAO,CAAA;KAAE,CAAC;CACzD,2CAsBA;AAMD,wBAAgB,sBAAsB,CAAC,EACrC,OAAO,GACR,EAAE;IACD,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB,2CAuCA;AAKD,OAAO,EAAE,mBAAmB,EAAE,CAAC"}
@@ -9,6 +9,8 @@ import { ConnectBuilderCard } from "../ConnectBuilderCard.js";
9
9
  import { McpAppRenderer } from "../mcp-apps/McpAppRenderer.js";
10
10
  import { writeClipboardText } from "../clipboard.js";
11
11
  import { cn } from "../utils.js";
12
+ import "./widgets/builtin-tool-renderers.js";
13
+ import { resolveToolRenderer } from "./tool-render-registry.js";
12
14
  import { SmoothMarkdownText, HighlightedCodeBlock, markdownComponents, markdownModule, remarkGfmFn, markdownUrlTransform, } from "./markdown-renderer.js";
13
15
  import { IconLoader2, IconCircleX, IconCheck, IconSquareFilled, IconChevronDown, IconCopy, IconSearch, IconArrowsMaximize, IconArrowsMinimize, IconShieldCheck, IconX, } from "@tabler/icons-react";
14
16
  // Exported so AssistantChatInner can provide a context value.
@@ -187,7 +189,7 @@ function ApprovalAffordance({ toolName, approval, }) {
187
189
  }, className: cn("inline-flex items-center gap-1 rounded-md px-2.5 py-1 text-xs font-medium transition-colors", "bg-foreground text-background hover:bg-foreground/90"), children: [_jsx(IconCheck, { className: "h-3.5 w-3.5" }), "Approve"] })), _jsxs("button", { type: "button", onClick: () => setDenied(true), className: cn("inline-flex items-center gap-1 rounded-md border border-border px-2.5 py-1 text-xs font-medium transition-colors", "text-foreground hover:bg-muted"), children: [_jsx(IconX, { className: "h-3.5 w-3.5" }), "Deny"] })] }));
188
190
  }
189
191
  // ─── ToolCallDisplay ──────────────────────────────────────────────────────────
190
- export function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, isRunning, structuredMeta, approval, }) {
192
+ export function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, structuredMeta, approval, }) {
191
193
  // Delegate to bespoke cells when structured metadata is present.
192
194
  // These must be separate components so hook order in ToolCallDisplayGeneric
193
195
  // is always stable (no conditional hook calls).
@@ -201,9 +203,9 @@ export function ToolCallDisplay({ toolName, argsText, args, result, mcpApp, isRu
201
203
  if (toolKind === "write") {
202
204
  return (_jsx(WriteCell, { meta: structuredMeta, isRunning: isRunning }));
203
205
  }
204
- return (_jsx(ToolCallDisplayGeneric, { toolName: toolName, argsText: argsText, args: args, result: result, mcpApp: mcpApp, isRunning: isRunning, approval: approval }));
206
+ return (_jsx(ToolCallDisplayGeneric, { toolName: toolName, argsText: argsText, args: args, result: result, mcpApp: mcpApp, chatUI: chatUI, isRunning: isRunning, approval: approval }));
205
207
  }
206
- function ToolCallDisplayGeneric({ toolName, argsText, args, result, mcpApp, isRunning, approval, }) {
208
+ function ToolCallDisplayGeneric({ toolName, argsText, args, result, mcpApp, chatUI, isRunning, approval, }) {
207
209
  const streamRef = useRef(null);
208
210
  const isAgentCall = toolName.startsWith("agent:");
209
211
  const [expanded, setExpanded] = useState(isAgentCall);
@@ -260,6 +262,21 @@ function ToolCallDisplayGeneric({ toolName, argsText, args, result, mcpApp, isRu
260
262
  // Fall through to default pill rendering
261
263
  }
262
264
  }
265
+ const parsedResult = result ? parseJsonText(result) : null;
266
+ const nativeToolContext = {
267
+ toolName,
268
+ args,
269
+ resultText: result,
270
+ resultJson: parsedResult,
271
+ isRunning,
272
+ chatUI,
273
+ };
274
+ const NativeToolRenderer = isAgentCall
275
+ ? null
276
+ : resolveToolRenderer(nativeToolContext);
277
+ if (NativeToolRenderer) {
278
+ return _jsx(NativeToolRenderer, { context: nativeToolContext });
279
+ }
263
280
  const inputPayload = hasArgs ? toolInputPayload(toolName, args) : null;
264
281
  const resultPayload = toolResultPayload(result);
265
282
  const displayName = isAgentCall
@@ -285,7 +302,7 @@ export function ToolCallFallback({ toolName, args, argsText, result, ...rest })
285
302
  ? result
286
303
  : result !== undefined
287
304
  ? JSON.stringify(result)
288
- : undefined, mcpApp: rest.mcpApp, structuredMeta: rest.structuredMeta, isRunning: isRunning, approval: rest.approval }));
305
+ : undefined, mcpApp: rest.mcpApp, chatUI: rest.chatUI, structuredMeta: rest.structuredMeta, isRunning: isRunning, approval: rest.approval }));
289
306
  }
290
307
  // ─── ReconnectStreamMessage ────────────────────────────────────────────────────
291
308
  // Renders the agent's in-progress response during reconnection (outside
@@ -297,7 +314,7 @@ export function ReconnectStreamMessage({ content, }) {
297
314
  return (_jsx(SmoothMarkdownText, { text: part.text, streaming: chatRunning, resetKey: `reconnect-text-${i}`, statusType: chatRunning ? "running" : "complete" }, `reconnect-text-${i}`));
298
315
  }
299
316
  if (part.type === "tool-call") {
300
- return (_jsx(ToolCallDisplay, { toolName: part.toolName, argsText: part.argsText, args: part.args, result: part.result, mcpApp: part.mcpApp, structuredMeta: part.structuredMeta, isRunning: part.result === undefined && chatRunning, approval: part.approval }, `reconnect-tool-${i}`));
317
+ return (_jsx(ToolCallDisplay, { toolName: part.toolName, argsText: part.argsText, args: part.args, result: part.result, mcpApp: part.mcpApp, chatUI: part.chatUI, structuredMeta: part.structuredMeta, isRunning: part.result === undefined && chatRunning, approval: part.approval }, `reconnect-tool-${i}`));
301
318
  }
302
319
  return null;
303
320
  }) }) }));