veryfront 0.1.146 → 0.1.147

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 (42) hide show
  1. package/esm/deno.js +1 -1
  2. package/esm/src/internal-agents/run-stream.d.ts.map +1 -1
  3. package/esm/src/internal-agents/run-stream.js +60 -79
  4. package/esm/src/internal-agents/schema.d.ts +243 -4
  5. package/esm/src/internal-agents/schema.d.ts.map +1 -1
  6. package/esm/src/internal-agents/schema.js +219 -8
  7. package/esm/src/jobs/schemas.d.ts +4 -4
  8. package/esm/src/mcp/elicitation.d.ts +16 -0
  9. package/esm/src/mcp/elicitation.d.ts.map +1 -0
  10. package/esm/src/mcp/elicitation.js +21 -0
  11. package/esm/src/mcp/index.d.ts +3 -0
  12. package/esm/src/mcp/index.d.ts.map +1 -1
  13. package/esm/src/mcp/index.js +2 -0
  14. package/esm/src/mcp/server.d.ts +22 -0
  15. package/esm/src/mcp/server.d.ts.map +1 -1
  16. package/esm/src/mcp/server.js +163 -2
  17. package/esm/src/mcp/task-store.d.ts +27 -0
  18. package/esm/src/mcp/task-store.d.ts.map +1 -0
  19. package/esm/src/mcp/task-store.js +116 -0
  20. package/esm/src/modules/react-loader/ssr-module-loader/cache/memory.d.ts.map +1 -1
  21. package/esm/src/modules/react-loader/ssr-module-loader/cache/memory.js +4 -2
  22. package/esm/src/server/handlers/request/agent-stream.handler.d.ts.map +1 -1
  23. package/esm/src/server/handlers/request/agent-stream.handler.js +4 -3
  24. package/esm/src/tool/remote-mcp.d.ts.map +1 -1
  25. package/esm/src/tool/remote-mcp.js +60 -1
  26. package/esm/src/tool/types.d.ts +2 -0
  27. package/esm/src/tool/types.d.ts.map +1 -1
  28. package/esm/src/utils/version-constant.d.ts +1 -1
  29. package/esm/src/utils/version-constant.js +1 -1
  30. package/package.json +1 -1
  31. package/src/deno.js +1 -1
  32. package/src/src/internal-agents/run-stream.ts +61 -94
  33. package/src/src/internal-agents/schema.ts +277 -10
  34. package/src/src/mcp/elicitation.ts +42 -0
  35. package/src/src/mcp/index.ts +9 -0
  36. package/src/src/mcp/server.ts +185 -2
  37. package/src/src/mcp/task-store.ts +137 -0
  38. package/src/src/modules/react-loader/ssr-module-loader/cache/memory.ts +4 -2
  39. package/src/src/server/handlers/request/agent-stream.handler.ts +5 -3
  40. package/src/src/tool/remote-mcp.ts +86 -1
  41. package/src/src/tool/types.ts +2 -0
  42. package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export default {
2
2
  "name": "veryfront",
3
- "version": "0.1.146",
3
+ "version": "0.1.147",
4
4
  "license": "Apache-2.0",
5
5
  "nodeModulesDir": "auto",
6
6
  "exclude": [
@@ -1 +1 @@
1
- {"version":3,"file":"run-stream.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/run-stream.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EACL,KAAK,KAAK,EACV,KAAK,YAAY,IAAI,OAAO,EAC5B,KAAK,aAAa,EAEnB,MAAM,mBAAmB,CAAC;AAW3B,OAAO,EAA0B,KAAK,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC3F,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAYxD,MAAM,WAAW,+BAA+B;IAC9C,cAAc,EAAE,sBAAsB,CAAC;IACvC,aAAa,CAAC,EAAE,CACd,KAAK,EAAE,KAAK,EACZ,WAAW,EAAE,KAAK,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,KAClC;QACH,MAAM,EAAE,CACN,QAAQ,EAAE,OAAO,EAAE,EACnB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACjC,SAAS,CAAC,EAAE;YACV,QAAQ,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,KAAK,IAAI,CAAC;SAC9C,EACD,aAAa,CAAC,EAAE,MAAM,E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BAAoB,EAC3B,KAAK,EAAE,KAAK,EACZ,IAAI,EAAE,+BAA+B,GACpC,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CA6N3B"}
@@ -54,79 +54,58 @@ function buildMergedTools(agent, input, sessionManager) {
54
54
  function isRecord(value) {
55
55
  return typeof value === "object" && value !== null && !Array.isArray(value);
56
56
  }
57
- function normalizeToolArgs(part) {
58
- if (isRecord(part.args)) {
59
- return part.args;
57
+ function parseToolArguments(serializedArguments) {
58
+ try {
59
+ const parsed = JSON.parse(serializedArguments);
60
+ return isRecord(parsed) ? parsed : {};
60
61
  }
61
- if (isRecord(part.input)) {
62
- return part.input;
62
+ catch {
63
+ return {};
63
64
  }
64
- return {};
65
65
  }
66
- function normalizeMessagePart(part) {
67
- if (part.type === "text" && typeof part.text === "string") {
68
- return { type: "text", text: part.text };
69
- }
70
- if (part.type === "tool_call" &&
71
- typeof part.id === "string" &&
72
- typeof part.name === "string") {
73
- return {
74
- type: "tool-call",
75
- toolCallId: part.id,
76
- toolName: part.name,
77
- args: normalizeToolArgs(part),
78
- };
79
- }
80
- if (part.type === "tool-call" &&
81
- typeof part.toolCallId === "string" &&
82
- typeof part.toolName === "string") {
83
- return {
84
- type: "tool-call",
85
- toolCallId: part.toolCallId,
86
- toolName: part.toolName,
87
- args: normalizeToolArgs(part),
88
- };
89
- }
90
- if (typeof part.type === "string" &&
91
- part.type.startsWith("tool-") &&
92
- part.type !== "tool-result" &&
93
- typeof part.toolCallId === "string" &&
94
- typeof part.toolName === "string") {
95
- return {
96
- type: part.type,
97
- toolCallId: part.toolCallId,
98
- toolName: part.toolName,
99
- args: normalizeToolArgs(part),
100
- };
101
- }
102
- if (part.type === "tool_result" && typeof part.tool_call_id === "string") {
103
- return {
104
- type: "tool-result",
105
- toolCallId: part.tool_call_id,
106
- toolName: typeof part.tool_name === "string" ? part.tool_name : "unknown",
107
- result: "output" in part ? part.output : undefined,
108
- };
109
- }
110
- if (part.type === "tool-result" && typeof part.toolCallId === "string") {
66
+ function normalizeRuntimeMessages(messages) {
67
+ return messages.map((message) => {
68
+ const parts = [];
69
+ switch (message.role) {
70
+ case "system":
71
+ case "user":
72
+ parts.push({ type: "text", text: message.content });
73
+ break;
74
+ case "assistant":
75
+ if (typeof message.content === "string" && message.content.length > 0) {
76
+ parts.push({ type: "text", text: message.content });
77
+ }
78
+ for (const toolCall of message.toolCalls ?? []) {
79
+ parts.push({
80
+ type: "tool-call",
81
+ toolCallId: toolCall.id,
82
+ toolName: toolCall.function.name,
83
+ args: parseToolArguments(toolCall.function.arguments),
84
+ });
85
+ }
86
+ break;
87
+ case "tool":
88
+ parts.push({
89
+ type: "tool-result",
90
+ toolCallId: message.toolCallId,
91
+ toolName: "unknown",
92
+ result: message.error
93
+ ? {
94
+ content: message.content,
95
+ error: message.error,
96
+ }
97
+ : message.content,
98
+ });
99
+ break;
100
+ }
111
101
  return {
112
- type: "tool-result",
113
- toolCallId: part.toolCallId,
114
- toolName: typeof part.toolName === "string" ? part.toolName : "unknown",
115
- result: "result" in part ? part.result : undefined,
102
+ id: message.id,
103
+ role: message.role,
104
+ parts,
105
+ ...(message.createdAt ? { timestamp: Date.parse(message.createdAt) || undefined } : {}),
106
+ ...(message.metadata ? { metadata: message.metadata } : {}),
116
107
  };
117
- }
118
- return null;
119
- }
120
- function normalizeRuntimeMessages(messages) {
121
- return messages.map((message) => ({
122
- id: message.id,
123
- role: message.role,
124
- parts: message.parts
125
- .map((part) => isRecord(part) ? normalizeMessagePart(part) : null)
126
- .filter((part) => part !== null),
127
- ...(message.createdAt ? { timestamp: Date.parse(message.createdAt) || undefined } : {}),
128
- ...(message.metadata ? { metadata: message.metadata } : {}),
129
- }));
108
+ });
130
109
  }
131
110
  function getAllowedRemoteToolNames(forwardedProps) {
132
111
  const runtimeOverrides = isRecord(forwardedProps?.runtimeOverrides)
@@ -145,7 +124,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
145
124
  logger.info("Starting internal agent runtime stream", {
146
125
  runId: input.runId,
147
126
  threadId: input.threadId,
148
- agentId: input.agentId,
127
+ agentId: agent.id,
149
128
  messageCount: input.messages.length,
150
129
  toolCount: input.tools.length,
151
130
  contextCount: input.context.length,
@@ -176,6 +155,8 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
176
155
  runtimeStream = await runtime.stream(runtimeMessages, {
177
156
  threadId: input.threadId,
178
157
  runId: input.runId,
158
+ ...(input.parentRunId ? { parentRunId: input.parentRunId } : {}),
159
+ ...(input.state !== undefined ? { state: input.state } : {}),
179
160
  context: input.context,
180
161
  forwardedProps: input.forwardedProps,
181
162
  }, {
@@ -186,7 +167,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
186
167
  logger.info("Internal agent runtime stream attached", {
187
168
  runId: input.runId,
188
169
  threadId: input.threadId,
189
- agentId: input.agentId,
170
+ agentId: agent.id,
190
171
  });
191
172
  }
192
173
  catch (error) {
@@ -194,7 +175,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
194
175
  logger.error("Internal agent runtime stream setup failed", {
195
176
  runId: input.runId,
196
177
  threadId: input.threadId,
197
- agentId: input.agentId,
178
+ agentId: agent.id,
198
179
  error: error instanceof Error ? error.message : String(error),
199
180
  });
200
181
  throw error;
@@ -228,7 +209,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
228
209
  logger.warn("Internal agent runtime stream aborted", {
229
210
  runId: input.runId,
230
211
  threadId: input.threadId,
231
- agentId: input.agentId,
212
+ agentId: agent.id,
232
213
  });
233
214
  reader.cancel(new AgentRunCancelledError()).catch(() => { });
234
215
  };
@@ -236,7 +217,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
236
217
  enqueueIfAttached("RunStarted", {
237
218
  runId: input.runId,
238
219
  threadId: input.threadId,
239
- agentId: input.agentId,
220
+ agentId: agent.id,
240
221
  });
241
222
  try {
242
223
  while (true) {
@@ -247,7 +228,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
247
228
  logger.info("Internal agent runtime stream reader completed", {
248
229
  runId: input.runId,
249
230
  threadId: input.threadId,
250
- agentId: input.agentId,
231
+ agentId: agent.id,
251
232
  });
252
233
  break;
253
234
  }
@@ -275,7 +256,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
275
256
  logger.info("Internal agent runtime stream finalized", {
276
257
  runId: input.runId,
277
258
  threadId: input.threadId,
278
- agentId: input.agentId,
259
+ agentId: agent.id,
279
260
  sawVisibleOutput: state.sawVisibleOutput,
280
261
  sawTerminalError: state.sawTerminalError,
281
262
  finishReason: state.metadata.finishReason,
@@ -287,7 +268,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
287
268
  logger.warn("Internal agent runtime stream cancelled", {
288
269
  runId: input.runId,
289
270
  threadId: input.threadId,
290
- agentId: input.agentId,
271
+ agentId: agent.id,
291
272
  error: error.message,
292
273
  });
293
274
  enqueueIfAttached("RunError", {
@@ -300,7 +281,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
300
281
  logger.error("Internal agent runtime stream failed", {
301
282
  runId: input.runId,
302
283
  threadId: input.threadId,
303
- agentId: input.agentId,
284
+ agentId: agent.id,
304
285
  error: error instanceof Error ? error.message : String(error),
305
286
  });
306
287
  enqueueIfAttached("RunError", {
@@ -317,7 +298,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
317
298
  logger.debug("Internal agent runtime stream response closed", {
318
299
  runId: input.runId,
319
300
  threadId: input.threadId,
320
- agentId: input.agentId,
301
+ agentId: agent.id,
321
302
  clientAttached,
322
303
  });
323
304
  }
@@ -327,7 +308,7 @@ export async function createRuntimeAgentStreamResponse(input, agent, deps) {
327
308
  logger.info("Internal agent runtime client detached", {
328
309
  runId: input.runId,
329
310
  threadId: input.threadId,
330
- agentId: input.agentId,
311
+ agentId: agent.id,
331
312
  });
332
313
  return Promise.resolve();
333
314
  },
@@ -33,11 +33,245 @@ export declare const RuntimeAgentSourceContextSchema: z.ZodDiscriminatedUnion<[z
33
33
  type: z.ZodLiteral<"release">;
34
34
  releaseId: z.ZodString;
35
35
  }, z.core.$strip>], "type">;
36
+ export declare const RuntimeToolFunctionCallSchema: z.ZodObject<{
37
+ name: z.ZodString;
38
+ arguments: z.ZodString;
39
+ }, z.core.$strict>;
40
+ export declare const RuntimeToolCallSchema: z.ZodObject<{
41
+ id: z.ZodString;
42
+ type: z.ZodLiteral<"function">;
43
+ function: z.ZodObject<{
44
+ name: z.ZodString;
45
+ arguments: z.ZodString;
46
+ }, z.core.$strict>;
47
+ }, z.core.$strict>;
48
+ export declare const RuntimeSystemMessageSchema: z.ZodObject<{
49
+ name: z.ZodOptional<z.ZodString>;
50
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
51
+ createdAt: z.ZodOptional<z.ZodString>;
52
+ id: z.ZodString;
53
+ role: z.ZodLiteral<"system">;
54
+ content: z.ZodString;
55
+ }, z.core.$strict>;
56
+ export declare const RuntimeUserMessageSchema: z.ZodObject<{
57
+ name: z.ZodOptional<z.ZodString>;
58
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
59
+ createdAt: z.ZodOptional<z.ZodString>;
60
+ id: z.ZodString;
61
+ role: z.ZodLiteral<"user">;
62
+ content: z.ZodString;
63
+ }, z.core.$strict>;
64
+ export declare const RuntimeAssistantMessageSchema: z.ZodObject<{
65
+ name: z.ZodOptional<z.ZodString>;
66
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
67
+ createdAt: z.ZodOptional<z.ZodString>;
68
+ id: z.ZodString;
69
+ role: z.ZodLiteral<"assistant">;
70
+ content: z.ZodOptional<z.ZodString>;
71
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
72
+ id: z.ZodString;
73
+ type: z.ZodLiteral<"function">;
74
+ function: z.ZodObject<{
75
+ name: z.ZodString;
76
+ arguments: z.ZodString;
77
+ }, z.core.$strict>;
78
+ }, z.core.$strict>>>;
79
+ }, z.core.$strict>;
80
+ export declare const RuntimeToolMessageSchema: z.ZodObject<{
81
+ name: z.ZodOptional<z.ZodString>;
82
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
83
+ createdAt: z.ZodOptional<z.ZodString>;
84
+ id: z.ZodString;
85
+ role: z.ZodLiteral<"tool">;
86
+ toolCallId: z.ZodString;
87
+ content: z.ZodString;
88
+ error: z.ZodOptional<z.ZodString>;
89
+ }, z.core.$strict>;
90
+ export declare const RuntimeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
91
+ name: z.ZodOptional<z.ZodString>;
92
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
93
+ createdAt: z.ZodOptional<z.ZodString>;
94
+ id: z.ZodString;
95
+ role: z.ZodLiteral<"system">;
96
+ content: z.ZodString;
97
+ }, z.core.$strict>, z.ZodObject<{
98
+ name: z.ZodOptional<z.ZodString>;
99
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
100
+ createdAt: z.ZodOptional<z.ZodString>;
101
+ id: z.ZodString;
102
+ role: z.ZodLiteral<"user">;
103
+ content: z.ZodString;
104
+ }, z.core.$strict>, z.ZodObject<{
105
+ name: z.ZodOptional<z.ZodString>;
106
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
107
+ createdAt: z.ZodOptional<z.ZodString>;
108
+ id: z.ZodString;
109
+ role: z.ZodLiteral<"assistant">;
110
+ content: z.ZodOptional<z.ZodString>;
111
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
112
+ id: z.ZodString;
113
+ type: z.ZodLiteral<"function">;
114
+ function: z.ZodObject<{
115
+ name: z.ZodString;
116
+ arguments: z.ZodString;
117
+ }, z.core.$strict>;
118
+ }, z.core.$strict>>>;
119
+ }, z.core.$strict>, z.ZodObject<{
120
+ name: z.ZodOptional<z.ZodString>;
121
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
122
+ createdAt: z.ZodOptional<z.ZodString>;
123
+ id: z.ZodString;
124
+ role: z.ZodLiteral<"tool">;
125
+ toolCallId: z.ZodString;
126
+ content: z.ZodString;
127
+ error: z.ZodOptional<z.ZodString>;
128
+ }, z.core.$strict>], "role">;
129
+ export declare const RuntimeContextSchema: z.ZodUnion<readonly [z.ZodObject<{
130
+ description: z.ZodString;
131
+ value: z.ZodString;
132
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
133
+ type: z.ZodLiteral<"text">;
134
+ title: z.ZodOptional<z.ZodString>;
135
+ text: z.ZodString;
136
+ }, z.core.$strip>, z.ZodObject<{
137
+ type: z.ZodLiteral<"json">;
138
+ title: z.ZodOptional<z.ZodString>;
139
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
140
+ }, z.core.$strip>, z.ZodObject<{
141
+ type: z.ZodLiteral<"resource">;
142
+ title: z.ZodOptional<z.ZodString>;
143
+ uri: z.ZodString;
144
+ mimeType: z.ZodOptional<z.ZodString>;
145
+ text: z.ZodOptional<z.ZodString>;
146
+ }, z.core.$strip>], "type">]>;
36
147
  export declare const RuntimeRunAgentInputSchema: z.ZodObject<{
148
+ threadId: z.ZodString;
149
+ runId: z.ZodString;
150
+ parentRunId: z.ZodOptional<z.ZodString>;
151
+ state: z.ZodOptional<z.ZodUnknown>;
152
+ messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
153
+ name: z.ZodOptional<z.ZodString>;
154
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
155
+ createdAt: z.ZodOptional<z.ZodString>;
156
+ id: z.ZodString;
157
+ role: z.ZodLiteral<"system">;
158
+ content: z.ZodString;
159
+ }, z.core.$strict>, z.ZodObject<{
160
+ name: z.ZodOptional<z.ZodString>;
161
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
162
+ createdAt: z.ZodOptional<z.ZodString>;
163
+ id: z.ZodString;
164
+ role: z.ZodLiteral<"user">;
165
+ content: z.ZodString;
166
+ }, z.core.$strict>, z.ZodObject<{
167
+ name: z.ZodOptional<z.ZodString>;
168
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
169
+ createdAt: z.ZodOptional<z.ZodString>;
170
+ id: z.ZodString;
171
+ role: z.ZodLiteral<"assistant">;
172
+ content: z.ZodOptional<z.ZodString>;
173
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
174
+ id: z.ZodString;
175
+ type: z.ZodLiteral<"function">;
176
+ function: z.ZodObject<{
177
+ name: z.ZodString;
178
+ arguments: z.ZodString;
179
+ }, z.core.$strict>;
180
+ }, z.core.$strict>>>;
181
+ }, z.core.$strict>, z.ZodObject<{
182
+ name: z.ZodOptional<z.ZodString>;
183
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
184
+ createdAt: z.ZodOptional<z.ZodString>;
185
+ id: z.ZodString;
186
+ role: z.ZodLiteral<"tool">;
187
+ toolCallId: z.ZodString;
188
+ content: z.ZodString;
189
+ error: z.ZodOptional<z.ZodString>;
190
+ }, z.core.$strict>], "role">>;
191
+ tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
192
+ name: z.ZodString;
193
+ description: z.ZodOptional<z.ZodString>;
194
+ parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
195
+ }, z.core.$strip>>>;
196
+ context: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
197
+ description: z.ZodString;
198
+ value: z.ZodString;
199
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
200
+ type: z.ZodLiteral<"text">;
201
+ title: z.ZodOptional<z.ZodString>;
202
+ text: z.ZodString;
203
+ }, z.core.$strip>, z.ZodObject<{
204
+ type: z.ZodLiteral<"json">;
205
+ title: z.ZodOptional<z.ZodString>;
206
+ data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
207
+ }, z.core.$strip>, z.ZodObject<{
208
+ type: z.ZodLiteral<"resource">;
209
+ title: z.ZodOptional<z.ZodString>;
210
+ uri: z.ZodString;
211
+ mimeType: z.ZodOptional<z.ZodString>;
212
+ text: z.ZodOptional<z.ZodString>;
213
+ }, z.core.$strip>], "type">]>>>;
214
+ forwardedProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
215
+ }, z.core.$strip>;
216
+ export declare const InternalAgentCompatibilityMessageSchema: z.ZodObject<{
217
+ id: z.ZodString;
218
+ role: z.ZodEnum<{
219
+ tool: "tool";
220
+ user: "user";
221
+ assistant: "assistant";
222
+ system: "system";
223
+ }>;
224
+ parts: z.ZodDefault<z.ZodArray<z.ZodObject<{
225
+ type: z.ZodString;
226
+ }, z.core.$loose>>>;
227
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
228
+ createdAt: z.ZodOptional<z.ZodString>;
229
+ }, z.core.$strip>;
230
+ export declare const InternalAgentStreamRequestSchema: z.ZodObject<{
37
231
  agentId: z.ZodString;
38
232
  threadId: z.ZodString;
39
233
  runId: z.ZodString;
40
- messages: z.ZodArray<z.ZodObject<{
234
+ parentRunId: z.ZodOptional<z.ZodString>;
235
+ state: z.ZodOptional<z.ZodUnknown>;
236
+ messages: z.ZodArray<z.ZodUnion<readonly [z.ZodDiscriminatedUnion<[z.ZodObject<{
237
+ name: z.ZodOptional<z.ZodString>;
238
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
239
+ createdAt: z.ZodOptional<z.ZodString>;
240
+ id: z.ZodString;
241
+ role: z.ZodLiteral<"system">;
242
+ content: z.ZodString;
243
+ }, z.core.$strict>, z.ZodObject<{
244
+ name: z.ZodOptional<z.ZodString>;
245
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
246
+ createdAt: z.ZodOptional<z.ZodString>;
247
+ id: z.ZodString;
248
+ role: z.ZodLiteral<"user">;
249
+ content: z.ZodString;
250
+ }, z.core.$strict>, z.ZodObject<{
251
+ name: z.ZodOptional<z.ZodString>;
252
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
253
+ createdAt: z.ZodOptional<z.ZodString>;
254
+ id: z.ZodString;
255
+ role: z.ZodLiteral<"assistant">;
256
+ content: z.ZodOptional<z.ZodString>;
257
+ toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
258
+ id: z.ZodString;
259
+ type: z.ZodLiteral<"function">;
260
+ function: z.ZodObject<{
261
+ name: z.ZodString;
262
+ arguments: z.ZodString;
263
+ }, z.core.$strict>;
264
+ }, z.core.$strict>>>;
265
+ }, z.core.$strict>, z.ZodObject<{
266
+ name: z.ZodOptional<z.ZodString>;
267
+ metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
268
+ createdAt: z.ZodOptional<z.ZodString>;
269
+ id: z.ZodString;
270
+ role: z.ZodLiteral<"tool">;
271
+ toolCallId: z.ZodString;
272
+ content: z.ZodString;
273
+ error: z.ZodOptional<z.ZodString>;
274
+ }, z.core.$strict>], "role">, z.ZodObject<{
41
275
  id: z.ZodString;
42
276
  role: z.ZodEnum<{
43
277
  tool: "tool";
@@ -50,13 +284,16 @@ export declare const RuntimeRunAgentInputSchema: z.ZodObject<{
50
284
  }, z.core.$loose>>>;
51
285
  metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
52
286
  createdAt: z.ZodOptional<z.ZodString>;
53
- }, z.core.$strip>>;
287
+ }, z.core.$strip>]>>;
54
288
  tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
55
289
  name: z.ZodString;
56
290
  description: z.ZodOptional<z.ZodString>;
57
291
  parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
58
292
  }, z.core.$strip>>>;
59
- context: z.ZodDefault<z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
293
+ context: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
294
+ description: z.ZodString;
295
+ value: z.ZodString;
296
+ }, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
60
297
  type: z.ZodLiteral<"text">;
61
298
  title: z.ZodOptional<z.ZodString>;
62
299
  text: z.ZodString;
@@ -70,7 +307,7 @@ export declare const RuntimeRunAgentInputSchema: z.ZodObject<{
70
307
  uri: z.ZodString;
71
308
  mimeType: z.ZodOptional<z.ZodString>;
72
309
  text: z.ZodOptional<z.ZodString>;
73
- }, z.core.$strip>], "type">>>;
310
+ }, z.core.$strip>], "type">]>>>;
74
311
  agentSource: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
75
312
  type: z.ZodLiteral<"branch">;
76
313
  branch: z.ZodString;
@@ -84,6 +321,7 @@ export declare const RuntimeRunAgentInputSchema: z.ZodObject<{
84
321
  }, z.core.$strip>], "type">>;
85
322
  forwardedProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
86
323
  }, z.core.$strip>;
324
+ export declare function toRuntimeRunAgentInput(input: z.infer<typeof InternalAgentStreamRequestSchema>): z.infer<typeof RuntimeRunAgentInputSchema>;
87
325
  export declare const ResumeSignalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
88
326
  type: z.ZodLiteral<"tool_result">;
89
327
  toolCallId: z.ZodString;
@@ -94,5 +332,6 @@ export type RuntimeInjectedTool = z.infer<typeof RuntimeInjectedToolSchema>;
94
332
  export type RuntimeContextItem = z.infer<typeof RuntimeContextItemSchema>;
95
333
  export type RuntimeAgentSourceContext = z.infer<typeof RuntimeAgentSourceContextSchema>;
96
334
  export type RuntimeRunAgentInput = z.infer<typeof RuntimeRunAgentInputSchema>;
335
+ export type InternalAgentStreamRequest = z.infer<typeof InternalAgentStreamRequestSchema>;
97
336
  export type ResumeSignal = z.infer<typeof ResumeSignalSchema>;
98
337
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,WAAW,aAAqD,CAAC;AAE9E,eAAO,MAAM,aAAa,aAAqD,CAAC;AAEhF,eAAO,MAAM,oBAAoB,aAO9B,CAAC;AAEJ,eAAO,MAAM,yBAAyB;;;;iBAOpC,CAAC;AAEH,eAAO,MAAM,wBAAwB;;;;;;;;;;;;;;2BAqBnC,CAAC;AAEH,eAAO,MAAM,+BAA+B;;;;;;;;;;2BAc1C,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAuBrC,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;2BAU7B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,yBAAyB,CAAC,CAAC;AAC5E,MAAM,MAAM,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAC1E,MAAM,MAAM,yBAAyB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,+BAA+B,CAAC,CAAC;AACxF,MAAM,MAAM,oBAAoB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAC9E,MAAM,MAAM,YAAY,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,kBAAkB,CAAC,CAAC"}
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAoBxB,eAAO,MAAM,WAAW,aAAqD,CAAC;AAE9E,eAAO,MAAM,aAAa,aAAqD,CAAC;AAEhF,eAAO,MAAM,oBAAoB,aAO9B,CAAC;AAEJ,eAAO,MAAM,yBAAy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