@gea-ai/agent-sdk 0.1.260910-alpha.2 → 0.1.260911-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/dist/agent-call.d.ts +613 -0
- package/dist/agent-call.d.ts.map +1 -0
- package/dist/agent-call.js +104 -0
- package/dist/agent-call.js.map +1 -0
- package/dist/agent-channel-author-runtime.js +1 -1
- package/dist/agent-channel-author-runtime.js.map +1 -1
- package/dist/agent-channel-runtime.d.ts +1 -1
- package/dist/agent-channel-runtime.d.ts.map +1 -1
- package/dist/agent-channel-runtime.js +1 -1
- package/dist/agent-channel-runtime.js.map +1 -1
- package/dist/agent-session-tasks.d.ts +4 -0
- package/dist/agent-session-tasks.d.ts.map +1 -0
- package/dist/agent-session-tasks.js +174 -0
- package/dist/agent-session-tasks.js.map +1 -0
- package/dist/agent-session.d.ts.map +1 -1
- package/dist/agent-session.js +60 -22
- package/dist/agent-session.js.map +1 -1
- package/dist/agent-worker.d.ts +4 -0
- package/dist/agent-worker.d.ts.map +1 -1
- package/dist/agent-worker.js +170 -60
- package/dist/agent-worker.js.map +1 -1
- package/dist/index.d.ts +41 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +51 -0
- package/dist/index.js.map +1 -1
- package/dist/tracing.d.ts +5 -0
- package/dist/tracing.d.ts.map +1 -1
- package/dist/tracing.js +8 -1
- package/dist/tracing.js.map +1 -1
- package/package.json +10 -2
package/README.md
CHANGED
|
@@ -7,3 +7,59 @@ npm install @gea-ai/agent-sdk
|
|
|
7
7
|
```
|
|
8
8
|
|
|
9
9
|
[Developer documentation](https://musegea.com/developers/agent-development)
|
|
10
|
+
|
|
11
|
+
## Model identity and output limits
|
|
12
|
+
|
|
13
|
+
Set an optional per-model-call output budget on the Agent definition:
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { defineAgent } from "@gea-ai/agent-sdk";
|
|
17
|
+
|
|
18
|
+
export default defineAgent({
|
|
19
|
+
name: "Research assistant",
|
|
20
|
+
slug: "research",
|
|
21
|
+
model: "creative-reasoning-1.5",
|
|
22
|
+
maxOutputTokens: 32_000,
|
|
23
|
+
});
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
`maxOutputTokens` must be a positive integer. Omit it to retain the engine/provider default. It applies to each model call in the default AI SDK engine and `agentCore`, subject to the provider's supported limits; it is not a total task budget. Each private or referenced Agent uses its own definition, while self copies use the source definition. Agent Core's explicit per-step `generation.max_output_tokens` may override this baseline for that step.
|
|
27
|
+
|
|
28
|
+
The default AI SDK engine resolves Anthropic capabilities from the upstream model identity. The approved gateway aliases `creative-reasoning-1.5` and `crr-a-pro-20260724` resolve to Claude Sonnet 5 and Opus 5 respectively. Gateway requests retain the configured routing ID; public model IDs and usage attribution are unchanged. The installed Anthropic adapter supplies their default output budget (currently 128,000 tokens) and reasoning behavior. Explicit AI SDK output limits still apply; unknown model IDs retain the adapter's compatibility fallback.
|
|
29
|
+
|
|
30
|
+
Native Workers request the catalog target from the AI binding, so public aliases can use the same recognition. This requires updating Worker Runtime and rebuilding the Agent with the new SDK. Existing SDK bundles retain their descriptor format. The hosted AI SDK proxy resolves target identity on the server; the optional `agentCore` engine keeps its existing protocol.
|
|
31
|
+
|
|
32
|
+
## Background Agent tasks
|
|
33
|
+
|
|
34
|
+
Declare private definitions in `subagents/<name>/agent.ts` with their own `AGENTS.md`, tools, skills and connectors. They run in independent Sessions and may declare further subagents. Only top-level definitions become public Worker entrypoints.
|
|
35
|
+
|
|
36
|
+
References are explicit default exports from `subagents/<alias>.ts`:
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { defineAgentReference, defineRemoteAgent } from "@gea-ai/agent-sdk";
|
|
40
|
+
|
|
41
|
+
// Same Worker: slug is checked against the CLI-generated WorkerAgentRegistry.
|
|
42
|
+
const sales = defineAgentReference({
|
|
43
|
+
slug: "sales",
|
|
44
|
+
description: "Sales analysis",
|
|
45
|
+
});
|
|
46
|
+
// Same Project: uses the Studio Agent slug and the caller's environment.
|
|
47
|
+
const legal = defineRemoteAgent({
|
|
48
|
+
slug: "legal-advisor",
|
|
49
|
+
description: "Legal review",
|
|
50
|
+
});
|
|
51
|
+
// URL: a GEA Agent protocol endpoint. The key stays in runtime environment configuration.
|
|
52
|
+
const external = defineRemoteAgent({
|
|
53
|
+
url: "https://legal.example.com/gea/agents/advisor",
|
|
54
|
+
description: "Legal review",
|
|
55
|
+
auth: { bearerTokenEnv: "LEGAL_AGENT_KEY" },
|
|
56
|
+
});
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
Each reference file default-exports one reference. All targets use `agent({ target: "alias", message, agentId? })`; callers only see their own declared aliases. Include `agentTool()` in the root's tools to additionally allow self copies by omitting `target`. Named delegation follows each node's own declarations; child invocations cannot create another unnamed copy.
|
|
60
|
+
|
|
61
|
+
The tool returns `{ status: "working", taskId, agentId }`. `task_update({ message })` reports progress, and `task_cancel({ taskId })` requests cancellation. The host continues idle parent conversations when updates arrive. A child task finishes after its descendants and notification inbox settle, including any final summary turn. Continue an idle child with its returned `agentId` and the same target.
|
|
62
|
+
|
|
63
|
+
URL targets implement GEA task create/status/cancel endpoints. New calls and continuations follow the deployment selected by the URL, retaining history while using its current model, instructions and tools. Accepted tasks finish on their selected version. URL credentials are explicitly configured; source credentials and principals are not forwarded. Pure local development uses URLs for cross-Worker calls because it has no hosted Project identity.
|
|
64
|
+
|
|
65
|
+
This requires matching SDK, CLI, server and Worker Runtime support and rebuilding immutable bundles. Task Sessions opt into `durable-object-worker-namespace-v1`; existing ordinary Session storage is unchanged. Channel wakeups, approval relay, active-child steering and execution recovery after a host crash remain deferred.
|
|
@@ -0,0 +1,613 @@
|
|
|
1
|
+
import { type AgentWorkerToolInitialization } from "@gea-ai/contract/agent-worker-tools";
|
|
2
|
+
import type { AgentHostBinding } from "./agent-worker";
|
|
3
|
+
/** The host opens a fresh Worker invocation; only its visible answer returns to the caller. */
|
|
4
|
+
export declare function createWorkerAgentTool(input: {
|
|
5
|
+
agents: NonNullable<AgentWorkerToolInitialization["agents"]>;
|
|
6
|
+
host: AgentHostBinding;
|
|
7
|
+
canCopy?: boolean;
|
|
8
|
+
}): ({
|
|
9
|
+
title?: string;
|
|
10
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
11
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
12
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
13
|
+
agentId?: string | undefined;
|
|
14
|
+
message: string;
|
|
15
|
+
target: string | undefined;
|
|
16
|
+
}>;
|
|
17
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
18
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
19
|
+
agentId?: string | undefined;
|
|
20
|
+
message: string;
|
|
21
|
+
target: string | undefined;
|
|
22
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
23
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
24
|
+
onInputDelta?: ((options: {
|
|
25
|
+
inputTextDelta: string;
|
|
26
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
27
|
+
onInputAvailable?: ((options: {
|
|
28
|
+
input: {
|
|
29
|
+
agentId?: string | undefined;
|
|
30
|
+
message: string;
|
|
31
|
+
target: string | undefined;
|
|
32
|
+
};
|
|
33
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
34
|
+
toModelOutput?: ((options: {
|
|
35
|
+
toolCallId: string;
|
|
36
|
+
input: {
|
|
37
|
+
agentId?: string | undefined;
|
|
38
|
+
message: string;
|
|
39
|
+
target: string | undefined;
|
|
40
|
+
};
|
|
41
|
+
output: NoInfer<{
|
|
42
|
+
status: "working";
|
|
43
|
+
taskId: string;
|
|
44
|
+
agentId: string;
|
|
45
|
+
}>;
|
|
46
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
47
|
+
} & {
|
|
48
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
49
|
+
status: "working";
|
|
50
|
+
taskId: string;
|
|
51
|
+
agentId: string;
|
|
52
|
+
}> | undefined;
|
|
53
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
54
|
+
agentId?: string | undefined;
|
|
55
|
+
message: string;
|
|
56
|
+
target: string | undefined;
|
|
57
|
+
}, {
|
|
58
|
+
status: "working";
|
|
59
|
+
taskId: string;
|
|
60
|
+
agentId: string;
|
|
61
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
62
|
+
} & {
|
|
63
|
+
description?: string | ((options: {
|
|
64
|
+
context: NoInfer<import("@ai-sdk/provider-utils").Context>;
|
|
65
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
66
|
+
}) => string) | undefined;
|
|
67
|
+
strict?: boolean;
|
|
68
|
+
inputExamples?: {
|
|
69
|
+
input: NoInfer<{
|
|
70
|
+
agentId?: string | undefined;
|
|
71
|
+
message: string;
|
|
72
|
+
target: string | undefined;
|
|
73
|
+
}>;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
id?: never;
|
|
76
|
+
isProviderExecuted?: never;
|
|
77
|
+
args?: never;
|
|
78
|
+
supportsDeferredResults?: never;
|
|
79
|
+
} & {
|
|
80
|
+
type?: undefined | 'function';
|
|
81
|
+
} & {
|
|
82
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
83
|
+
agentId?: string | undefined;
|
|
84
|
+
message: string;
|
|
85
|
+
target: string | undefined;
|
|
86
|
+
}, {
|
|
87
|
+
status: "working";
|
|
88
|
+
taskId: string;
|
|
89
|
+
agentId: string;
|
|
90
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
91
|
+
}) | ({
|
|
92
|
+
title?: string;
|
|
93
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
94
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
95
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
96
|
+
agentId?: string | undefined;
|
|
97
|
+
message: string;
|
|
98
|
+
target: string | undefined;
|
|
99
|
+
}>;
|
|
100
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
101
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
102
|
+
agentId?: string | undefined;
|
|
103
|
+
message: string;
|
|
104
|
+
target: string | undefined;
|
|
105
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
106
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
107
|
+
onInputDelta?: ((options: {
|
|
108
|
+
inputTextDelta: string;
|
|
109
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
110
|
+
onInputAvailable?: ((options: {
|
|
111
|
+
input: {
|
|
112
|
+
agentId?: string | undefined;
|
|
113
|
+
message: string;
|
|
114
|
+
target: string | undefined;
|
|
115
|
+
};
|
|
116
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
117
|
+
toModelOutput?: ((options: {
|
|
118
|
+
toolCallId: string;
|
|
119
|
+
input: {
|
|
120
|
+
agentId?: string | undefined;
|
|
121
|
+
message: string;
|
|
122
|
+
target: string | undefined;
|
|
123
|
+
};
|
|
124
|
+
output: NoInfer<{
|
|
125
|
+
status: "working";
|
|
126
|
+
taskId: string;
|
|
127
|
+
agentId: string;
|
|
128
|
+
}>;
|
|
129
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
130
|
+
} & {
|
|
131
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
132
|
+
status: "working";
|
|
133
|
+
taskId: string;
|
|
134
|
+
agentId: string;
|
|
135
|
+
}> | undefined;
|
|
136
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
137
|
+
agentId?: string | undefined;
|
|
138
|
+
message: string;
|
|
139
|
+
target: string | undefined;
|
|
140
|
+
}, {
|
|
141
|
+
status: "working";
|
|
142
|
+
taskId: string;
|
|
143
|
+
agentId: string;
|
|
144
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
145
|
+
} & {
|
|
146
|
+
description?: string | ((options: {
|
|
147
|
+
context: NoInfer<import("@ai-sdk/provider-utils").Context>;
|
|
148
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
149
|
+
}) => string) | undefined;
|
|
150
|
+
strict?: boolean;
|
|
151
|
+
inputExamples?: {
|
|
152
|
+
input: NoInfer<{
|
|
153
|
+
agentId?: string | undefined;
|
|
154
|
+
message: string;
|
|
155
|
+
target: string | undefined;
|
|
156
|
+
}>;
|
|
157
|
+
}[] | undefined;
|
|
158
|
+
id?: never;
|
|
159
|
+
isProviderExecuted?: never;
|
|
160
|
+
args?: never;
|
|
161
|
+
supportsDeferredResults?: never;
|
|
162
|
+
} & {
|
|
163
|
+
type: 'dynamic';
|
|
164
|
+
} & {
|
|
165
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
166
|
+
agentId?: string | undefined;
|
|
167
|
+
message: string;
|
|
168
|
+
target: string | undefined;
|
|
169
|
+
}, {
|
|
170
|
+
status: "working";
|
|
171
|
+
taskId: string;
|
|
172
|
+
agentId: string;
|
|
173
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
174
|
+
}) | ({
|
|
175
|
+
title?: string;
|
|
176
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
177
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
178
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
179
|
+
agentId?: string | undefined;
|
|
180
|
+
message: string;
|
|
181
|
+
target: string | undefined;
|
|
182
|
+
}>;
|
|
183
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
184
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
185
|
+
agentId?: string | undefined;
|
|
186
|
+
message: string;
|
|
187
|
+
target: string | undefined;
|
|
188
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
189
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
190
|
+
onInputDelta?: ((options: {
|
|
191
|
+
inputTextDelta: string;
|
|
192
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
193
|
+
onInputAvailable?: ((options: {
|
|
194
|
+
input: {
|
|
195
|
+
agentId?: string | undefined;
|
|
196
|
+
message: string;
|
|
197
|
+
target: string | undefined;
|
|
198
|
+
};
|
|
199
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
200
|
+
toModelOutput?: ((options: {
|
|
201
|
+
toolCallId: string;
|
|
202
|
+
input: {
|
|
203
|
+
agentId?: string | undefined;
|
|
204
|
+
message: string;
|
|
205
|
+
target: string | undefined;
|
|
206
|
+
};
|
|
207
|
+
output: NoInfer<{
|
|
208
|
+
status: "working";
|
|
209
|
+
taskId: string;
|
|
210
|
+
agentId: string;
|
|
211
|
+
}>;
|
|
212
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
213
|
+
} & {
|
|
214
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
215
|
+
status: "working";
|
|
216
|
+
taskId: string;
|
|
217
|
+
agentId: string;
|
|
218
|
+
}> | undefined;
|
|
219
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
220
|
+
agentId?: string | undefined;
|
|
221
|
+
message: string;
|
|
222
|
+
target: string | undefined;
|
|
223
|
+
}, {
|
|
224
|
+
status: "working";
|
|
225
|
+
taskId: string;
|
|
226
|
+
agentId: string;
|
|
227
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
228
|
+
} & {
|
|
229
|
+
type: 'provider';
|
|
230
|
+
id: `${string}.${string}`;
|
|
231
|
+
args: Record<string, unknown>;
|
|
232
|
+
description?: never;
|
|
233
|
+
strict?: never;
|
|
234
|
+
inputExamples?: never;
|
|
235
|
+
} & {
|
|
236
|
+
isProviderExecuted: false;
|
|
237
|
+
supportsDeferredResults?: never;
|
|
238
|
+
} & {
|
|
239
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
240
|
+
agentId?: string | undefined;
|
|
241
|
+
message: string;
|
|
242
|
+
target: string | undefined;
|
|
243
|
+
}, {
|
|
244
|
+
status: "working";
|
|
245
|
+
taskId: string;
|
|
246
|
+
agentId: string;
|
|
247
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
248
|
+
}) | ({
|
|
249
|
+
title?: string;
|
|
250
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
251
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
252
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
253
|
+
agentId?: string | undefined;
|
|
254
|
+
message: string;
|
|
255
|
+
target: string | undefined;
|
|
256
|
+
}>;
|
|
257
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
258
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
259
|
+
agentId?: string | undefined;
|
|
260
|
+
message: string;
|
|
261
|
+
target: string | undefined;
|
|
262
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
263
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
264
|
+
onInputDelta?: ((options: {
|
|
265
|
+
inputTextDelta: string;
|
|
266
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
267
|
+
onInputAvailable?: ((options: {
|
|
268
|
+
input: {
|
|
269
|
+
agentId?: string | undefined;
|
|
270
|
+
message: string;
|
|
271
|
+
target: string | undefined;
|
|
272
|
+
};
|
|
273
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
274
|
+
toModelOutput?: ((options: {
|
|
275
|
+
toolCallId: string;
|
|
276
|
+
input: {
|
|
277
|
+
agentId?: string | undefined;
|
|
278
|
+
message: string;
|
|
279
|
+
target: string | undefined;
|
|
280
|
+
};
|
|
281
|
+
output: NoInfer<{
|
|
282
|
+
status: "working";
|
|
283
|
+
taskId: string;
|
|
284
|
+
agentId: string;
|
|
285
|
+
}>;
|
|
286
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
287
|
+
} & {
|
|
288
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
289
|
+
status: "working";
|
|
290
|
+
taskId: string;
|
|
291
|
+
agentId: string;
|
|
292
|
+
}> | undefined;
|
|
293
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
294
|
+
agentId?: string | undefined;
|
|
295
|
+
message: string;
|
|
296
|
+
target: string | undefined;
|
|
297
|
+
}, {
|
|
298
|
+
status: "working";
|
|
299
|
+
taskId: string;
|
|
300
|
+
agentId: string;
|
|
301
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
302
|
+
} & {
|
|
303
|
+
type: 'provider';
|
|
304
|
+
id: `${string}.${string}`;
|
|
305
|
+
args: Record<string, unknown>;
|
|
306
|
+
description?: never;
|
|
307
|
+
strict?: never;
|
|
308
|
+
inputExamples?: never;
|
|
309
|
+
} & {
|
|
310
|
+
isProviderExecuted: true;
|
|
311
|
+
supportsDeferredResults?: boolean;
|
|
312
|
+
} & {
|
|
313
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
314
|
+
agentId?: string | undefined;
|
|
315
|
+
message: string;
|
|
316
|
+
target: string | undefined;
|
|
317
|
+
}, {
|
|
318
|
+
status: "working";
|
|
319
|
+
taskId: string;
|
|
320
|
+
agentId: string;
|
|
321
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
322
|
+
});
|
|
323
|
+
export declare function createWorkerTaskTool(input: {
|
|
324
|
+
kind: "cancel" | "update";
|
|
325
|
+
host: AgentHostBinding;
|
|
326
|
+
}): ({
|
|
327
|
+
title?: string;
|
|
328
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
329
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
330
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
331
|
+
taskId: string;
|
|
332
|
+
} | {
|
|
333
|
+
message: string;
|
|
334
|
+
}>;
|
|
335
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
336
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
337
|
+
taskId: string;
|
|
338
|
+
} | {
|
|
339
|
+
message: string;
|
|
340
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
341
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
342
|
+
onInputDelta?: ((options: {
|
|
343
|
+
inputTextDelta: string;
|
|
344
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
345
|
+
onInputAvailable?: ((options: {
|
|
346
|
+
input: {
|
|
347
|
+
taskId: string;
|
|
348
|
+
} | {
|
|
349
|
+
message: string;
|
|
350
|
+
};
|
|
351
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
352
|
+
toModelOutput?: ((options: {
|
|
353
|
+
toolCallId: string;
|
|
354
|
+
input: {
|
|
355
|
+
taskId: string;
|
|
356
|
+
} | {
|
|
357
|
+
message: string;
|
|
358
|
+
};
|
|
359
|
+
output: NoInfer<{
|
|
360
|
+
status: string;
|
|
361
|
+
}>;
|
|
362
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
363
|
+
} & {
|
|
364
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
365
|
+
status: string;
|
|
366
|
+
}> | undefined;
|
|
367
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
368
|
+
taskId: string;
|
|
369
|
+
} | {
|
|
370
|
+
message: string;
|
|
371
|
+
}, {
|
|
372
|
+
status: string;
|
|
373
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
374
|
+
} & {
|
|
375
|
+
description?: string | ((options: {
|
|
376
|
+
context: NoInfer<import("@ai-sdk/provider-utils").Context>;
|
|
377
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
378
|
+
}) => string) | undefined;
|
|
379
|
+
strict?: boolean;
|
|
380
|
+
inputExamples?: {
|
|
381
|
+
input: NoInfer<{
|
|
382
|
+
taskId: string;
|
|
383
|
+
} | {
|
|
384
|
+
message: string;
|
|
385
|
+
}>;
|
|
386
|
+
}[] | undefined;
|
|
387
|
+
id?: never;
|
|
388
|
+
isProviderExecuted?: never;
|
|
389
|
+
args?: never;
|
|
390
|
+
supportsDeferredResults?: never;
|
|
391
|
+
} & {
|
|
392
|
+
type?: undefined | 'function';
|
|
393
|
+
} & {
|
|
394
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
395
|
+
taskId: string;
|
|
396
|
+
} | {
|
|
397
|
+
message: string;
|
|
398
|
+
}, {
|
|
399
|
+
status: string;
|
|
400
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
401
|
+
}) | ({
|
|
402
|
+
title?: string;
|
|
403
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
404
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
405
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
406
|
+
taskId: string;
|
|
407
|
+
} | {
|
|
408
|
+
message: string;
|
|
409
|
+
}>;
|
|
410
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
411
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
412
|
+
taskId: string;
|
|
413
|
+
} | {
|
|
414
|
+
message: string;
|
|
415
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
416
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
417
|
+
onInputDelta?: ((options: {
|
|
418
|
+
inputTextDelta: string;
|
|
419
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
420
|
+
onInputAvailable?: ((options: {
|
|
421
|
+
input: {
|
|
422
|
+
taskId: string;
|
|
423
|
+
} | {
|
|
424
|
+
message: string;
|
|
425
|
+
};
|
|
426
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
427
|
+
toModelOutput?: ((options: {
|
|
428
|
+
toolCallId: string;
|
|
429
|
+
input: {
|
|
430
|
+
taskId: string;
|
|
431
|
+
} | {
|
|
432
|
+
message: string;
|
|
433
|
+
};
|
|
434
|
+
output: NoInfer<{
|
|
435
|
+
status: string;
|
|
436
|
+
}>;
|
|
437
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
438
|
+
} & {
|
|
439
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
440
|
+
status: string;
|
|
441
|
+
}> | undefined;
|
|
442
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
443
|
+
taskId: string;
|
|
444
|
+
} | {
|
|
445
|
+
message: string;
|
|
446
|
+
}, {
|
|
447
|
+
status: string;
|
|
448
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
449
|
+
} & {
|
|
450
|
+
description?: string | ((options: {
|
|
451
|
+
context: NoInfer<import("@ai-sdk/provider-utils").Context>;
|
|
452
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
453
|
+
}) => string) | undefined;
|
|
454
|
+
strict?: boolean;
|
|
455
|
+
inputExamples?: {
|
|
456
|
+
input: NoInfer<{
|
|
457
|
+
taskId: string;
|
|
458
|
+
} | {
|
|
459
|
+
message: string;
|
|
460
|
+
}>;
|
|
461
|
+
}[] | undefined;
|
|
462
|
+
id?: never;
|
|
463
|
+
isProviderExecuted?: never;
|
|
464
|
+
args?: never;
|
|
465
|
+
supportsDeferredResults?: never;
|
|
466
|
+
} & {
|
|
467
|
+
type: 'dynamic';
|
|
468
|
+
} & {
|
|
469
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
470
|
+
taskId: string;
|
|
471
|
+
} | {
|
|
472
|
+
message: string;
|
|
473
|
+
}, {
|
|
474
|
+
status: string;
|
|
475
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
476
|
+
}) | ({
|
|
477
|
+
title?: string;
|
|
478
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
479
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
480
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
481
|
+
taskId: string;
|
|
482
|
+
} | {
|
|
483
|
+
message: string;
|
|
484
|
+
}>;
|
|
485
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
486
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
487
|
+
taskId: string;
|
|
488
|
+
} | {
|
|
489
|
+
message: string;
|
|
490
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
491
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
492
|
+
onInputDelta?: ((options: {
|
|
493
|
+
inputTextDelta: string;
|
|
494
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
495
|
+
onInputAvailable?: ((options: {
|
|
496
|
+
input: {
|
|
497
|
+
taskId: string;
|
|
498
|
+
} | {
|
|
499
|
+
message: string;
|
|
500
|
+
};
|
|
501
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
502
|
+
toModelOutput?: ((options: {
|
|
503
|
+
toolCallId: string;
|
|
504
|
+
input: {
|
|
505
|
+
taskId: string;
|
|
506
|
+
} | {
|
|
507
|
+
message: string;
|
|
508
|
+
};
|
|
509
|
+
output: NoInfer<{
|
|
510
|
+
status: string;
|
|
511
|
+
}>;
|
|
512
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
513
|
+
} & {
|
|
514
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
515
|
+
status: string;
|
|
516
|
+
}> | undefined;
|
|
517
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
518
|
+
taskId: string;
|
|
519
|
+
} | {
|
|
520
|
+
message: string;
|
|
521
|
+
}, {
|
|
522
|
+
status: string;
|
|
523
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
524
|
+
} & {
|
|
525
|
+
type: 'provider';
|
|
526
|
+
id: `${string}.${string}`;
|
|
527
|
+
args: Record<string, unknown>;
|
|
528
|
+
description?: never;
|
|
529
|
+
strict?: never;
|
|
530
|
+
inputExamples?: never;
|
|
531
|
+
} & {
|
|
532
|
+
isProviderExecuted: false;
|
|
533
|
+
supportsDeferredResults?: never;
|
|
534
|
+
} & {
|
|
535
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
536
|
+
taskId: string;
|
|
537
|
+
} | {
|
|
538
|
+
message: string;
|
|
539
|
+
}, {
|
|
540
|
+
status: string;
|
|
541
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
542
|
+
}) | ({
|
|
543
|
+
title?: string;
|
|
544
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
545
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
546
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
547
|
+
taskId: string;
|
|
548
|
+
} | {
|
|
549
|
+
message: string;
|
|
550
|
+
}>;
|
|
551
|
+
contextSchema?: import("ai").FlexibleSchema<import("@ai-sdk/provider-utils").Context> | undefined;
|
|
552
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
553
|
+
taskId: string;
|
|
554
|
+
} | {
|
|
555
|
+
message: string;
|
|
556
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>> | undefined;
|
|
557
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
558
|
+
onInputDelta?: ((options: {
|
|
559
|
+
inputTextDelta: string;
|
|
560
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
561
|
+
onInputAvailable?: ((options: {
|
|
562
|
+
input: {
|
|
563
|
+
taskId: string;
|
|
564
|
+
} | {
|
|
565
|
+
message: string;
|
|
566
|
+
};
|
|
567
|
+
} & import("ai").ToolExecutionOptions<NoInfer<import("@ai-sdk/provider-utils").Context>>) => void | PromiseLike<void>) | undefined;
|
|
568
|
+
toModelOutput?: ((options: {
|
|
569
|
+
toolCallId: string;
|
|
570
|
+
input: {
|
|
571
|
+
taskId: string;
|
|
572
|
+
} | {
|
|
573
|
+
message: string;
|
|
574
|
+
};
|
|
575
|
+
output: NoInfer<{
|
|
576
|
+
status: string;
|
|
577
|
+
}>;
|
|
578
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
579
|
+
} & {
|
|
580
|
+
outputSchema?: import("ai").FlexibleSchema<{
|
|
581
|
+
status: string;
|
|
582
|
+
}> | undefined;
|
|
583
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
584
|
+
taskId: string;
|
|
585
|
+
} | {
|
|
586
|
+
message: string;
|
|
587
|
+
}, {
|
|
588
|
+
status: string;
|
|
589
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
590
|
+
} & {
|
|
591
|
+
type: 'provider';
|
|
592
|
+
id: `${string}.${string}`;
|
|
593
|
+
args: Record<string, unknown>;
|
|
594
|
+
description?: never;
|
|
595
|
+
strict?: never;
|
|
596
|
+
inputExamples?: never;
|
|
597
|
+
} & {
|
|
598
|
+
isProviderExecuted: true;
|
|
599
|
+
supportsDeferredResults?: boolean;
|
|
600
|
+
} & {
|
|
601
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
602
|
+
taskId: string;
|
|
603
|
+
} | {
|
|
604
|
+
message: string;
|
|
605
|
+
}, {
|
|
606
|
+
status: string;
|
|
607
|
+
}, NoInfer<import("@ai-sdk/provider-utils").Context>>;
|
|
608
|
+
});
|
|
609
|
+
export declare function readWorkerAgentResponse(response: Response): Promise<{
|
|
610
|
+
status: "completed";
|
|
611
|
+
text: string;
|
|
612
|
+
}>;
|
|
613
|
+
//# sourceMappingURL=agent-call.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"agent-call.d.ts","sourceRoot":"","sources":["../src/agent-call.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAEvD,+FAA+F;AAC/F,wBAAgB,qBAAqB,CAAC,KAAK,EAAE;IAC3C,MAAM,EAAE,WAAW,CAAC,6BAA6B,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC7D,IAAI,EAAE,gBAAgB,CAAC;IACvB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BA;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE;IAC1C,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAAC;IAC1B,IAAI,EAAE,gBAAgB,CAAC;CACxB;;;;;gBACwC,MAAM;;iBAAgB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCpE;AAED,wBAAsB,uBAAuB,CAAC,QAAQ,EAAE,QAAQ;YAkC7C,WAAW;;GAC7B"}
|