veryfront 0.1.150 → 0.1.152
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/esm/deno.js +1 -1
- package/esm/src/agent/ag-ui-handler.d.ts.map +1 -1
- package/esm/src/agent/ag-ui-handler.js +6 -0
- package/esm/src/agent/index.d.ts +1 -0
- package/esm/src/agent/index.d.ts.map +1 -1
- package/esm/src/agent/index.js +1 -0
- package/esm/src/agent/runtime-ag-ui-contract.d.ts +207 -0
- package/esm/src/agent/runtime-ag-ui-contract.d.ts.map +1 -0
- package/esm/src/agent/runtime-ag-ui-contract.js +109 -0
- package/esm/src/internal-agents/ag-ui-sse.d.ts.map +1 -1
- package/esm/src/internal-agents/ag-ui-sse.js +12 -0
- package/esm/src/internal-agents/schema.d.ts +14 -68
- package/esm/src/internal-agents/schema.d.ts.map +1 -1
- package/esm/src/internal-agents/schema.js +8 -98
- package/esm/src/provider/runtime-loader.d.ts.map +1 -1
- package/esm/src/provider/runtime-loader.js +9 -32
- package/esm/src/utils/version-constant.d.ts +1 -1
- package/esm/src/utils/version-constant.js +1 -1
- package/package.json +1 -1
- package/src/deno.js +1 -1
- package/src/src/agent/ag-ui-handler.ts +6 -0
- package/src/src/agent/index.ts +10 -0
- package/src/src/agent/runtime-ag-ui-contract.ts +144 -0
- package/src/src/internal-agents/ag-ui-sse.ts +12 -0
- package/src/src/internal-agents/schema.ts +22 -129
- package/src/src/provider/runtime-loader.ts +9 -39
- package/src/src/utils/version-constant.ts +1 -1
package/esm/deno.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag-ui-handler.d.ts","sourceRoot":"","sources":["../../../src/src/agent/ag-ui-handler.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,OAAO,MAAM,qBAAqB,CAAC;AAC/C,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,KAAK,EAAW,MAAM,YAAY,CAAC;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O,EAAE,OAAO,CAAC,OAAO,KAAK,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;CAChG;AAED,MAAM,WAAW,0BAA2B,SAAQ,kBAAkB;IACpE,KAAK,EAAE,KAAK,CAAC;CACd;AAUD,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,GAC3B,CAAC,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC;AACxD,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,0BAA0B,EAClC,OAAO,CAAC,EAAE,kBAAkB,GAC3B,CAAC,YAAY,EAAE,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC"}
|
|
@@ -215,6 +215,12 @@ async function createAgUiStreamResponse(agent, request, baseContext) {
|
|
|
215
215
|
if (!enqueueEvent(controller, "RunStarted", { runId, threadId, agentId: agent.id })) {
|
|
216
216
|
return;
|
|
217
217
|
}
|
|
218
|
+
if (!enqueueEvent(controller, "StateSnapshot", { snapshot: {} })) {
|
|
219
|
+
return;
|
|
220
|
+
}
|
|
221
|
+
if (!enqueueEvent(controller, "MessagesSnapshot", { messages: request.messages })) {
|
|
222
|
+
return;
|
|
223
|
+
}
|
|
218
224
|
try {
|
|
219
225
|
if (!upstreamBody) {
|
|
220
226
|
for (const event of finalizeRunEvents(state, null)) {
|
package/esm/src/agent/index.d.ts
CHANGED
|
@@ -84,6 +84,7 @@ export { getTextFromParts, getToolArguments, hasArgs, hasInput } from "./types.j
|
|
|
84
84
|
export { BufferMemory, ConversationMemory, createMemory, createRedisMemory, type Memory, type MemoryPersistence, type MemoryStats, type RedisClient, RedisMemory, type RedisMemoryConfig, SummaryMemory, } from "./memory/index.js";
|
|
85
85
|
export { agentAsTool, createWorkflow, getAgent, getAgentsAsTools, getAllAgentIds, registerAgent, type WorkflowConfig, type WorkflowResult, type WorkflowStep, } from "./composition/index.js";
|
|
86
86
|
export { agent } from "./factory.js";
|
|
87
|
+
export { type AgUiRuntimeContextItem, AgUiRuntimeContextItemSchema, type AgUiRuntimeInjectedTool, AgUiRuntimeInjectedToolSchema, type AgUiRuntimeMessage, AgUiRuntimeMessageSchema, type AgUiRuntimeRequest, AgUiRuntimeRequestSchema, } from "./runtime-ag-ui-contract.js";
|
|
87
88
|
export { type AgUiContextItem, type AgUiHandlerConfigWithAgent, type AgUiHandlerOptions, type AgUiInjectedTool, type AgUiRequest, AgUiRequestSchema, createAgUiHandler, } from "./ag-ui-handler.js";
|
|
88
89
|
export { type ChatHandlerBeforeStream, type ChatHandlerBeforeStreamContext, type ChatHandlerBeforeStreamResult, type ChatHandlerConfigWithAgent, type ChatHandlerMessageInput, type ChatHandlerOptions, createChatHandler, } from "./chat-handler.js";
|
|
89
90
|
export { AgentRuntime, RunAlreadyExistsError, RunCancelledError, RunNotActiveError, RunResumeSessionManager, type RunResumeSessionManagerOptions, type RunSessionStatus, type SubmitResumeValueOutcome, WaitConflictError, WaitNotPendingError, } from "./runtime/index.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+EG;AACH,OAAO,yBAAyB,CAAC;AAGjC,YAAY,EACV,KAAK,EACL,WAAW,EACX,YAAY,EACZ,eAAe,EACf,aAAa,EACb,WAAW,EACX,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,OAAO,IAAI,YAAY,EACvB,WAAW,EACX,aAAa,EACb,WAAW,EACX,mBAAmB,EACnB,cAAc,EACd,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,qBAAqB,EACrB,cAAc,GACf,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEnF,OAAO,EACL,YAAY,EACZ,kBAAkB,EAClB,YAAY,EACZ,iBAAiB,EACjB,KAAK,MAAM,EACX,KAAK,iBAAiB,EACtB,KAAK,WAAW,EAChB,KAAK,WAAW,EAChB,WAAW,EACX,KAAK,iBAAiB,EACtB,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,WAAW,EACX,cAAc,EACd,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACd,aAAa,EACb,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,cAAc,CAAC;AACrC,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,0BAA0B,EAC/B,KAAK,kBAAkB,EACvB,KAAK,gBAAgB,EACrB,KAAK,WAAW,EAChB,iBAAiB,EACjB,iBAAiB,GAClB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/src/agent/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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oB,CAAC;AAC5B,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,8BAA8B,EACnC,KAAK,6BAA6B,EAClC,KAAK,0BAA0B,EAC/B,KAAK,uBAAuB,EAC5B,KAAK,kBAAkB,EACvB,iBAAiB,GAClB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EACL,YAAY,EACZ,qBAAqB,EACrB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,8BAA8B,EACnC,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,iBAAiB,EACjB,mBAAmB,GACpB,MAAM,oBAAoB,CAAC"}
|
package/esm/src/agent/index.js
CHANGED
|
@@ -83,6 +83,7 @@ export { getTextFromParts, getToolArguments, hasArgs, hasInput } from "./types.j
|
|
|
83
83
|
export { BufferMemory, ConversationMemory, createMemory, createRedisMemory, RedisMemory, SummaryMemory, } from "./memory/index.js";
|
|
84
84
|
export { agentAsTool, createWorkflow, getAgent, getAgentsAsTools, getAllAgentIds, registerAgent, } from "./composition/index.js";
|
|
85
85
|
export { agent } from "./factory.js";
|
|
86
|
+
export { AgUiRuntimeContextItemSchema, AgUiRuntimeInjectedToolSchema, AgUiRuntimeMessageSchema, AgUiRuntimeRequestSchema, } from "./runtime-ag-ui-contract.js";
|
|
86
87
|
export { AgUiRequestSchema, createAgUiHandler, } from "./ag-ui-handler.js";
|
|
87
88
|
export { createChatHandler, } from "./chat-handler.js";
|
|
88
89
|
export { AgentRuntime, RunAlreadyExistsError, RunCancelledError, RunNotActiveError, RunResumeSessionManager, WaitConflictError, WaitNotPendingError, } from "./runtime/index.js";
|
|
@@ -0,0 +1,207 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
export declare const AgUiRuntimeRunIdSchema: z.ZodString;
|
|
3
|
+
export declare const AgUiRuntimeInjectedToolSchema: z.ZodObject<{
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
description: z.ZodOptional<z.ZodString>;
|
|
6
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
export declare const AgUiRuntimeContextItemSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"text">;
|
|
10
|
+
title: z.ZodOptional<z.ZodString>;
|
|
11
|
+
text: z.ZodString;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"json">;
|
|
14
|
+
title: z.ZodOptional<z.ZodString>;
|
|
15
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
16
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"resource">;
|
|
18
|
+
title: z.ZodOptional<z.ZodString>;
|
|
19
|
+
uri: z.ZodString;
|
|
20
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
21
|
+
text: z.ZodOptional<z.ZodString>;
|
|
22
|
+
}, z.core.$strip>], "type">;
|
|
23
|
+
export declare const AgUiRuntimeToolFunctionCallSchema: z.ZodObject<{
|
|
24
|
+
name: z.ZodString;
|
|
25
|
+
arguments: z.ZodString;
|
|
26
|
+
}, z.core.$strict>;
|
|
27
|
+
export declare const AgUiRuntimeToolCallSchema: z.ZodObject<{
|
|
28
|
+
id: z.ZodString;
|
|
29
|
+
type: z.ZodLiteral<"function">;
|
|
30
|
+
function: z.ZodObject<{
|
|
31
|
+
name: z.ZodString;
|
|
32
|
+
arguments: z.ZodString;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
}, z.core.$strict>;
|
|
35
|
+
export declare const AgUiRuntimeSystemMessageSchema: z.ZodObject<{
|
|
36
|
+
name: z.ZodOptional<z.ZodString>;
|
|
37
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
38
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
39
|
+
id: z.ZodString;
|
|
40
|
+
role: z.ZodLiteral<"system">;
|
|
41
|
+
content: z.ZodString;
|
|
42
|
+
}, z.core.$strict>;
|
|
43
|
+
export declare const AgUiRuntimeUserMessageSchema: z.ZodObject<{
|
|
44
|
+
name: z.ZodOptional<z.ZodString>;
|
|
45
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
46
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
role: z.ZodLiteral<"user">;
|
|
49
|
+
content: z.ZodString;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
export declare const AgUiRuntimeAssistantMessageSchema: z.ZodObject<{
|
|
52
|
+
name: z.ZodOptional<z.ZodString>;
|
|
53
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
54
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
55
|
+
id: z.ZodString;
|
|
56
|
+
role: z.ZodLiteral<"assistant">;
|
|
57
|
+
content: z.ZodOptional<z.ZodString>;
|
|
58
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
59
|
+
id: z.ZodString;
|
|
60
|
+
type: z.ZodLiteral<"function">;
|
|
61
|
+
function: z.ZodObject<{
|
|
62
|
+
name: z.ZodString;
|
|
63
|
+
arguments: z.ZodString;
|
|
64
|
+
}, z.core.$strict>;
|
|
65
|
+
}, z.core.$strict>>>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
export declare const AgUiRuntimeToolMessageSchema: z.ZodObject<{
|
|
68
|
+
name: z.ZodOptional<z.ZodString>;
|
|
69
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
70
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
71
|
+
id: z.ZodString;
|
|
72
|
+
role: z.ZodLiteral<"tool">;
|
|
73
|
+
toolCallId: z.ZodString;
|
|
74
|
+
content: z.ZodString;
|
|
75
|
+
error: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$strict>;
|
|
77
|
+
export declare const AgUiRuntimeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
78
|
+
name: z.ZodOptional<z.ZodString>;
|
|
79
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
80
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
81
|
+
id: z.ZodString;
|
|
82
|
+
role: z.ZodLiteral<"system">;
|
|
83
|
+
content: z.ZodString;
|
|
84
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
85
|
+
name: z.ZodOptional<z.ZodString>;
|
|
86
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
88
|
+
id: z.ZodString;
|
|
89
|
+
role: z.ZodLiteral<"user">;
|
|
90
|
+
content: z.ZodString;
|
|
91
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
92
|
+
name: z.ZodOptional<z.ZodString>;
|
|
93
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
94
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
95
|
+
id: z.ZodString;
|
|
96
|
+
role: z.ZodLiteral<"assistant">;
|
|
97
|
+
content: z.ZodOptional<z.ZodString>;
|
|
98
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
99
|
+
id: z.ZodString;
|
|
100
|
+
type: z.ZodLiteral<"function">;
|
|
101
|
+
function: z.ZodObject<{
|
|
102
|
+
name: z.ZodString;
|
|
103
|
+
arguments: z.ZodString;
|
|
104
|
+
}, z.core.$strict>;
|
|
105
|
+
}, z.core.$strict>>>;
|
|
106
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
107
|
+
name: z.ZodOptional<z.ZodString>;
|
|
108
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
109
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
110
|
+
id: z.ZodString;
|
|
111
|
+
role: z.ZodLiteral<"tool">;
|
|
112
|
+
toolCallId: z.ZodString;
|
|
113
|
+
content: z.ZodString;
|
|
114
|
+
error: z.ZodOptional<z.ZodString>;
|
|
115
|
+
}, z.core.$strict>], "role">;
|
|
116
|
+
export declare const AgUiRuntimeContextSchema: z.ZodUnion<readonly [z.ZodObject<{
|
|
117
|
+
description: z.ZodString;
|
|
118
|
+
value: z.ZodString;
|
|
119
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
120
|
+
type: z.ZodLiteral<"text">;
|
|
121
|
+
title: z.ZodOptional<z.ZodString>;
|
|
122
|
+
text: z.ZodString;
|
|
123
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
124
|
+
type: z.ZodLiteral<"json">;
|
|
125
|
+
title: z.ZodOptional<z.ZodString>;
|
|
126
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
127
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
128
|
+
type: z.ZodLiteral<"resource">;
|
|
129
|
+
title: z.ZodOptional<z.ZodString>;
|
|
130
|
+
uri: z.ZodString;
|
|
131
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
132
|
+
text: z.ZodOptional<z.ZodString>;
|
|
133
|
+
}, z.core.$strip>], "type">]>;
|
|
134
|
+
export declare const AgUiRuntimeRequestSchema: z.ZodObject<{
|
|
135
|
+
threadId: z.ZodString;
|
|
136
|
+
runId: z.ZodString;
|
|
137
|
+
parentRunId: z.ZodOptional<z.ZodString>;
|
|
138
|
+
state: z.ZodOptional<z.ZodUnknown>;
|
|
139
|
+
messages: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
140
|
+
name: z.ZodOptional<z.ZodString>;
|
|
141
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
142
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
143
|
+
id: z.ZodString;
|
|
144
|
+
role: z.ZodLiteral<"system">;
|
|
145
|
+
content: z.ZodString;
|
|
146
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
147
|
+
name: z.ZodOptional<z.ZodString>;
|
|
148
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
149
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
150
|
+
id: z.ZodString;
|
|
151
|
+
role: z.ZodLiteral<"user">;
|
|
152
|
+
content: z.ZodString;
|
|
153
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
154
|
+
name: z.ZodOptional<z.ZodString>;
|
|
155
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
156
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
157
|
+
id: z.ZodString;
|
|
158
|
+
role: z.ZodLiteral<"assistant">;
|
|
159
|
+
content: z.ZodOptional<z.ZodString>;
|
|
160
|
+
toolCalls: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
161
|
+
id: z.ZodString;
|
|
162
|
+
type: z.ZodLiteral<"function">;
|
|
163
|
+
function: z.ZodObject<{
|
|
164
|
+
name: z.ZodString;
|
|
165
|
+
arguments: z.ZodString;
|
|
166
|
+
}, z.core.$strict>;
|
|
167
|
+
}, z.core.$strict>>>;
|
|
168
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
169
|
+
name: z.ZodOptional<z.ZodString>;
|
|
170
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
171
|
+
createdAt: z.ZodOptional<z.ZodString>;
|
|
172
|
+
id: z.ZodString;
|
|
173
|
+
role: z.ZodLiteral<"tool">;
|
|
174
|
+
toolCallId: z.ZodString;
|
|
175
|
+
content: z.ZodString;
|
|
176
|
+
error: z.ZodOptional<z.ZodString>;
|
|
177
|
+
}, z.core.$strict>], "role">>;
|
|
178
|
+
tools: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
179
|
+
name: z.ZodString;
|
|
180
|
+
description: z.ZodOptional<z.ZodString>;
|
|
181
|
+
parameters: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
182
|
+
}, z.core.$strip>>>;
|
|
183
|
+
context: z.ZodDefault<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
|
|
184
|
+
description: z.ZodString;
|
|
185
|
+
value: z.ZodString;
|
|
186
|
+
}, z.core.$strip>, z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
187
|
+
type: z.ZodLiteral<"text">;
|
|
188
|
+
title: z.ZodOptional<z.ZodString>;
|
|
189
|
+
text: z.ZodString;
|
|
190
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
191
|
+
type: z.ZodLiteral<"json">;
|
|
192
|
+
title: z.ZodOptional<z.ZodString>;
|
|
193
|
+
data: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
194
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
195
|
+
type: z.ZodLiteral<"resource">;
|
|
196
|
+
title: z.ZodOptional<z.ZodString>;
|
|
197
|
+
uri: z.ZodString;
|
|
198
|
+
mimeType: z.ZodOptional<z.ZodString>;
|
|
199
|
+
text: z.ZodOptional<z.ZodString>;
|
|
200
|
+
}, z.core.$strip>], "type">]>>>;
|
|
201
|
+
forwardedProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
202
|
+
}, z.core.$strip>;
|
|
203
|
+
export type AgUiRuntimeInjectedTool = z.infer<typeof AgUiRuntimeInjectedToolSchema>;
|
|
204
|
+
export type AgUiRuntimeContextItem = z.infer<typeof AgUiRuntimeContextItemSchema>;
|
|
205
|
+
export type AgUiRuntimeMessage = z.infer<typeof AgUiRuntimeMessageSchema>;
|
|
206
|
+
export type AgUiRuntimeRequest = z.infer<typeof AgUiRuntimeRequestSchema>;
|
|
207
|
+
//# sourceMappingURL=runtime-ag-ui-contract.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AC"}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
const AGENT_ID_PATTERN = /^[a-zA-Z0-9_-]+$/;
|
|
3
|
+
const MAX_TOOL_PARAMETERS_BYTES = 16_384;
|
|
4
|
+
const MAX_CONTEXT_ITEM_BYTES = 16_384;
|
|
5
|
+
const MAX_CONTEXT_TOTAL_BYTES = 65_536;
|
|
6
|
+
const MAX_FORWARDED_PROPS_BYTES = 65_536;
|
|
7
|
+
const MAX_RUNTIME_MESSAGES = 100;
|
|
8
|
+
const encoder = new TextEncoder();
|
|
9
|
+
function isWithinJsonSizeLimit(value, maxBytes) {
|
|
10
|
+
try {
|
|
11
|
+
return encoder.encode(JSON.stringify(value)).byteLength <= maxBytes;
|
|
12
|
+
}
|
|
13
|
+
catch {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export const AgUiRuntimeRunIdSchema = z.string().min(1).max(128).regex(AGENT_ID_PATTERN);
|
|
18
|
+
export const AgUiRuntimeInjectedToolSchema = z.object({
|
|
19
|
+
name: z
|
|
20
|
+
.string()
|
|
21
|
+
.min(1)
|
|
22
|
+
.max(128)
|
|
23
|
+
.regex(/^[a-zA-Z][a-zA-Z0-9._:-]*$/, "Tool names must start with a letter and use a valid client-tool format"),
|
|
24
|
+
description: z.string().max(1024).optional(),
|
|
25
|
+
parameters: z.record(z.string(), z.unknown()).optional().refine((value) => value === undefined || isWithinJsonSizeLimit(value, MAX_TOOL_PARAMETERS_BYTES), { message: "Tool parameters must be less than 16 KB" }),
|
|
26
|
+
});
|
|
27
|
+
export const AgUiRuntimeContextItemSchema = z.discriminatedUnion("type", [
|
|
28
|
+
z.object({
|
|
29
|
+
type: z.literal("text"),
|
|
30
|
+
title: z.string().max(256).optional(),
|
|
31
|
+
text: z.string().max(MAX_CONTEXT_ITEM_BYTES),
|
|
32
|
+
}),
|
|
33
|
+
z.object({
|
|
34
|
+
type: z.literal("json"),
|
|
35
|
+
title: z.string().max(256).optional(),
|
|
36
|
+
data: z.record(z.string(), z.unknown()).refine((value) => isWithinJsonSizeLimit(value, MAX_CONTEXT_ITEM_BYTES), { message: "JSON context item must be less than 16 KB" }),
|
|
37
|
+
}),
|
|
38
|
+
z.object({
|
|
39
|
+
type: z.literal("resource"),
|
|
40
|
+
title: z.string().max(256).optional(),
|
|
41
|
+
uri: z.string().max(2048),
|
|
42
|
+
mimeType: z.string().max(256).optional(),
|
|
43
|
+
text: z.string().max(MAX_CONTEXT_ITEM_BYTES).optional(),
|
|
44
|
+
}),
|
|
45
|
+
]);
|
|
46
|
+
const RuntimeMessageExtensionFieldsSchema = {
|
|
47
|
+
name: z.string().max(256).optional(),
|
|
48
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
49
|
+
createdAt: z.string().optional(),
|
|
50
|
+
};
|
|
51
|
+
export const AgUiRuntimeToolFunctionCallSchema = z.object({
|
|
52
|
+
name: AgUiRuntimeInjectedToolSchema.shape.name,
|
|
53
|
+
arguments: z.string().max(MAX_TOOL_PARAMETERS_BYTES),
|
|
54
|
+
}).strict();
|
|
55
|
+
export const AgUiRuntimeToolCallSchema = z.object({
|
|
56
|
+
id: z.string().min(1).max(128),
|
|
57
|
+
type: z.literal("function"),
|
|
58
|
+
function: AgUiRuntimeToolFunctionCallSchema,
|
|
59
|
+
}).strict();
|
|
60
|
+
export const AgUiRuntimeSystemMessageSchema = z.object({
|
|
61
|
+
id: z.string().min(1),
|
|
62
|
+
role: z.literal("system"),
|
|
63
|
+
content: z.string(),
|
|
64
|
+
...RuntimeMessageExtensionFieldsSchema,
|
|
65
|
+
}).strict();
|
|
66
|
+
export const AgUiRuntimeUserMessageSchema = z.object({
|
|
67
|
+
id: z.string().min(1),
|
|
68
|
+
role: z.literal("user"),
|
|
69
|
+
content: z.string(),
|
|
70
|
+
...RuntimeMessageExtensionFieldsSchema,
|
|
71
|
+
}).strict();
|
|
72
|
+
export const AgUiRuntimeAssistantMessageSchema = z.object({
|
|
73
|
+
id: z.string().min(1),
|
|
74
|
+
role: z.literal("assistant"),
|
|
75
|
+
content: z.string().optional(),
|
|
76
|
+
toolCalls: z.array(AgUiRuntimeToolCallSchema).optional(),
|
|
77
|
+
...RuntimeMessageExtensionFieldsSchema,
|
|
78
|
+
}).strict();
|
|
79
|
+
export const AgUiRuntimeToolMessageSchema = z.object({
|
|
80
|
+
id: z.string().min(1),
|
|
81
|
+
role: z.literal("tool"),
|
|
82
|
+
toolCallId: z.string().min(1).max(128),
|
|
83
|
+
content: z.string(),
|
|
84
|
+
error: z.string().optional(),
|
|
85
|
+
...RuntimeMessageExtensionFieldsSchema,
|
|
86
|
+
}).strict();
|
|
87
|
+
export const AgUiRuntimeMessageSchema = z.discriminatedUnion("role", [
|
|
88
|
+
AgUiRuntimeSystemMessageSchema,
|
|
89
|
+
AgUiRuntimeUserMessageSchema,
|
|
90
|
+
AgUiRuntimeAssistantMessageSchema,
|
|
91
|
+
AgUiRuntimeToolMessageSchema,
|
|
92
|
+
]);
|
|
93
|
+
export const AgUiRuntimeContextSchema = z.union([
|
|
94
|
+
z.object({
|
|
95
|
+
description: z.string().max(1024),
|
|
96
|
+
value: z.string().max(MAX_CONTEXT_ITEM_BYTES),
|
|
97
|
+
}),
|
|
98
|
+
AgUiRuntimeContextItemSchema,
|
|
99
|
+
]);
|
|
100
|
+
export const AgUiRuntimeRequestSchema = z.object({
|
|
101
|
+
threadId: z.string().uuid(),
|
|
102
|
+
runId: AgUiRuntimeRunIdSchema,
|
|
103
|
+
parentRunId: AgUiRuntimeRunIdSchema.optional(),
|
|
104
|
+
state: z.unknown().optional(),
|
|
105
|
+
messages: z.array(AgUiRuntimeMessageSchema).max(MAX_RUNTIME_MESSAGES),
|
|
106
|
+
tools: z.array(AgUiRuntimeInjectedToolSchema).max(50).default([]),
|
|
107
|
+
context: z.array(AgUiRuntimeContextSchema).max(10).default([]).refine((value) => isWithinJsonSizeLimit(value, MAX_CONTEXT_TOTAL_BYTES), { message: "context must be less than 64 KB total" }),
|
|
108
|
+
forwardedProps: z.record(z.string(), z.unknown()).optional().refine((value) => value === undefined || isWithinJsonSizeLimit(value, MAX_FORWARDED_PROPS_BYTES), { message: "forwardedProps must be less than 64 KB" }),
|
|
109
|
+
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ag-ui-sse.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/ag-ui-sse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOvD,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,QAAQ,EAAE,OAAO,CAAC;IAClB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,QAAQ,EAAE,mBAAmB,CAAC;CAC/B;AAED,wBAAgB,0BAA0B,IAAI,oBAAoB,CAQjE;
|
|
1
|
+
{"version":3,"file":"ag-ui-sse.d.ts","sourceRoot":"","sources":["../../../src/src/internal-agents/ag-ui-sse.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAOvD,KAAK,gBAAgB,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC;AAEnE,MAA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: z.string().min(1),
|
|
19
19
|
agentId: z.string().min(1),
|
|
20
20
|
}),
|
|
21
|
+
StateSnapshot: z.object({
|
|
22
|
+
snapshot: z.record(z.string(), z.unknown()),
|
|
23
|
+
}),
|
|
24
|
+
MessagesSnapshot: z.object({
|
|
25
|
+
messages: z.array(z.object({
|
|
26
|
+
id: z.string().min(1),
|
|
27
|
+
role: z.enum(["user", "assistant", "system", "tool"]),
|
|
28
|
+
parts: z.array(z.record(z.string(), z.unknown())),
|
|
29
|
+
metadata: z.record(z.string(), z.unknown()).optional(),
|
|
30
|
+
createdAt: z.string().optional(),
|
|
31
|
+
})),
|
|
32
|
+
}),
|
|
21
33
|
TextMessageStart: z.object({
|
|
22
34
|
messageId: z.string().min(1),
|
|
23
35
|
role: z.literal("assistant"),
|
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
|
+
import { type AgUiRuntimeRequest } from "../agent/runtime-ag-ui-contract.js";
|
|
2
3
|
export declare const RunIdSchema: z.ZodString;
|
|
3
4
|
export declare const AgentIdSchema: z.ZodString;
|
|
4
|
-
export declare const
|
|
5
|
+
export declare const RuntimeAgentSourceContextSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
|
+
type: z.ZodLiteral<"branch">;
|
|
7
|
+
branch: z.ZodString;
|
|
8
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
9
|
+
type: z.ZodLiteral<"environment">;
|
|
10
|
+
environmentName: z.ZodString;
|
|
11
|
+
releaseId: z.ZodOptional<z.ZodString>;
|
|
12
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
13
|
+
type: z.ZodLiteral<"release">;
|
|
14
|
+
releaseId: z.ZodString;
|
|
15
|
+
}, z.core.$strip>], "type">;
|
|
5
16
|
export declare const RuntimeInjectedToolSchema: z.ZodObject<{
|
|
6
17
|
name: z.ZodString;
|
|
7
18
|
description: z.ZodOptional<z.ZodString>;
|
|
@@ -22,71 +33,6 @@ export declare const RuntimeContextItemSchema: z.ZodDiscriminatedUnion<[z.ZodObj
|
|
|
22
33
|
mimeType: z.ZodOptional<z.ZodString>;
|
|
23
34
|
text: z.ZodOptional<z.ZodString>;
|
|
24
35
|
}, z.core.$strip>], "type">;
|
|
25
|
-
export declare const RuntimeAgentSourceContextSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
26
|
-
type: z.ZodLiteral<"branch">;
|
|
27
|
-
branch: z.ZodString;
|
|
28
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
29
|
-
type: z.ZodLiteral<"environment">;
|
|
30
|
-
environmentName: z.ZodString;
|
|
31
|
-
releaseId: z.ZodOptional<z.ZodString>;
|
|
32
|
-
}, z.core.$strip>, z.ZodObject<{
|
|
33
|
-
type: z.ZodLiteral<"release">;
|
|
34
|
-
releaseId: z.ZodString;
|
|
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
36
|
export declare const RuntimeMessageSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
91
37
|
name: z.ZodOptional<z.ZodString>;
|
|
92
38
|
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
@@ -321,7 +267,7 @@ export declare const InternalAgentStreamRequestSchema: z.ZodObject<{
|
|
|
321
267
|
}, z.core.$strip>], "type">>;
|
|
322
268
|
forwardedProps: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
323
269
|
}, z.core.$strip>;
|
|
324
|
-
export declare function toRuntimeRunAgentInput(input: z.infer<typeof InternalAgentStreamRequestSchema>):
|
|
270
|
+
export declare function toRuntimeRunAgentInput(input: z.infer<typeof InternalAgentStreamRequestSchema>): AgUiRuntimeRequest;
|
|
325
271
|
export declare const ResumeSignalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
326
272
|
type: z.ZodLiteral<"tool_result">;
|
|
327
273
|
toolCallId: z.ZodString;
|
|
@@ -331,7 +277,7 @@ export declare const ResumeSignalSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
|
331
277
|
export type RuntimeInjectedTool = z.infer<typeof RuntimeInjectedToolSchema>;
|
|
332
278
|
export type RuntimeContextItem = z.infer<typeof RuntimeContextItemSchema>;
|
|
333
279
|
export type RuntimeAgentSourceContext = z.infer<typeof RuntimeAgentSourceContextSchema>;
|
|
334
|
-
export type RuntimeRunAgentInput =
|
|
280
|
+
export type RuntimeRunAgentInput = AgUiRuntimeRequest;
|
|
335
281
|
export type InternalAgentStreamRequest = z.infer<typeof InternalAgentStreamRequestSchema>;
|
|
336
282
|
export type ResumeSignal = z.infer<typeof ResumeSignalSchema>;
|
|
337
283
|
//# 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;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","s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