@deepagents/experimental 4.3.0 → 5.0.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 +9 -5
- package/dist/index.js +1716 -152
- package/dist/index.js.map +4 -4
- package/dist/zukhruf/agent-control-plane.d.ts +68 -0
- package/dist/zukhruf/agent-control-plane.d.ts.map +1 -0
- package/dist/zukhruf/agent-declaration-registry.d.ts +9 -0
- package/dist/zukhruf/agent-declaration-registry.d.ts.map +1 -0
- package/dist/zukhruf/agent-directory.d.ts +21 -0
- package/dist/zukhruf/agent-directory.d.ts.map +1 -0
- package/dist/zukhruf/agent-path.d.ts +15 -0
- package/dist/zukhruf/agent-path.d.ts.map +1 -0
- package/dist/zukhruf/agent-runtime.d.ts +53 -0
- package/dist/zukhruf/agent-runtime.d.ts.map +1 -0
- package/dist/zukhruf/agent-status-projector.d.ts +32 -0
- package/dist/zukhruf/agent-status-projector.d.ts.map +1 -0
- package/dist/zukhruf/agent-thread.d.ts +31 -0
- package/dist/zukhruf/agent-thread.d.ts.map +1 -0
- package/dist/zukhruf/agent-tool-context.d.ts +6 -0
- package/dist/zukhruf/agent-tool-context.d.ts.map +1 -0
- package/dist/zukhruf/agent-turn-executor.d.ts +19 -0
- package/dist/zukhruf/agent-turn-executor.d.ts.map +1 -0
- package/dist/zukhruf/agent-turn-id.d.ts +11 -0
- package/dist/zukhruf/agent-turn-id.d.ts.map +1 -0
- package/dist/zukhruf/agent.d.ts +13 -8
- package/dist/zukhruf/agent.d.ts.map +1 -1
- package/dist/zukhruf/approval-controller.d.ts +34 -0
- package/dist/zukhruf/approval-controller.d.ts.map +1 -0
- package/dist/zukhruf/approval-mutex.d.ts +5 -0
- package/dist/zukhruf/approval-mutex.d.ts.map +1 -0
- package/dist/zukhruf/index.d.ts +15 -11
- package/dist/zukhruf/index.d.ts.map +1 -1
- package/dist/zukhruf/index.js +1716 -152
- package/dist/zukhruf/index.js.map +4 -4
- package/dist/zukhruf/list-agents.d.ts +234 -0
- package/dist/zukhruf/list-agents.d.ts.map +1 -0
- package/dist/zukhruf/mailbox/coordinator.d.ts +22 -0
- package/dist/zukhruf/mailbox/coordinator.d.ts.map +1 -0
- package/dist/zukhruf/mailbox/sqlite.store.d.ts +16 -0
- package/dist/zukhruf/mailbox/sqlite.store.d.ts.map +1 -0
- package/dist/zukhruf/mailbox/store.d.ts +20 -0
- package/dist/zukhruf/mailbox/store.d.ts.map +1 -0
- package/dist/zukhruf/mailbox/types.d.ts +35 -0
- package/dist/zukhruf/mailbox/types.d.ts.map +1 -0
- package/dist/zukhruf/message-tools.d.ts +456 -0
- package/dist/zukhruf/message-tools.d.ts.map +1 -0
- package/dist/zukhruf/queue/pg-boss.turn-queue.d.ts +2 -1
- package/dist/zukhruf/queue/pg-boss.turn-queue.d.ts.map +1 -1
- package/dist/zukhruf/queue/turn-queue.d.ts +14 -0
- package/dist/zukhruf/queue/turn-queue.d.ts.map +1 -1
- package/dist/zukhruf/spawn-agent.d.ts +301 -0
- package/dist/zukhruf/spawn-agent.d.ts.map +1 -0
- package/dist/zukhruf/sqlite-approval-mutex.d.ts +17 -0
- package/dist/zukhruf/sqlite-approval-mutex.d.ts.map +1 -0
- package/package.json +8 -7
- package/dist/zukhruf/runtime.d.ts +0 -67
- package/dist/zukhruf/runtime.d.ts.map +0 -1
|
@@ -0,0 +1,456 @@
|
|
|
1
|
+
import type { AgentToolContext } from './agent-tool-context.ts';
|
|
2
|
+
type AgentMessageOutput = {
|
|
3
|
+
target: string;
|
|
4
|
+
};
|
|
5
|
+
export declare const sendMessageTool: ({
|
|
6
|
+
title?: string;
|
|
7
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
8
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
9
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
10
|
+
message: string;
|
|
11
|
+
target: string;
|
|
12
|
+
}>;
|
|
13
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
14
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
15
|
+
message: string;
|
|
16
|
+
target: string;
|
|
17
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
18
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
19
|
+
onInputDelta?: ((options: {
|
|
20
|
+
inputTextDelta: string;
|
|
21
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
22
|
+
onInputAvailable?: ((options: {
|
|
23
|
+
input: {
|
|
24
|
+
message: string;
|
|
25
|
+
target: string;
|
|
26
|
+
};
|
|
27
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
28
|
+
toModelOutput?: ((options: {
|
|
29
|
+
toolCallId: string;
|
|
30
|
+
input: {
|
|
31
|
+
message: string;
|
|
32
|
+
target: string;
|
|
33
|
+
};
|
|
34
|
+
output: NoInfer<AgentMessageOutput>;
|
|
35
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
36
|
+
} & {
|
|
37
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
38
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
39
|
+
message: string;
|
|
40
|
+
target: string;
|
|
41
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
42
|
+
} & {
|
|
43
|
+
description?: string | ((options: {
|
|
44
|
+
context: NoInfer<AgentToolContext>;
|
|
45
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
46
|
+
}) => string) | undefined;
|
|
47
|
+
strict?: boolean;
|
|
48
|
+
inputExamples?: {
|
|
49
|
+
input: NoInfer<{
|
|
50
|
+
message: string;
|
|
51
|
+
target: string;
|
|
52
|
+
}>;
|
|
53
|
+
}[] | undefined;
|
|
54
|
+
id?: never;
|
|
55
|
+
isProviderExecuted?: never;
|
|
56
|
+
args?: never;
|
|
57
|
+
supportsDeferredResults?: never;
|
|
58
|
+
} & {
|
|
59
|
+
type?: undefined | "function";
|
|
60
|
+
} & {
|
|
61
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
62
|
+
message: string;
|
|
63
|
+
target: string;
|
|
64
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
65
|
+
}) | ({
|
|
66
|
+
title?: string;
|
|
67
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
68
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
69
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
70
|
+
message: string;
|
|
71
|
+
target: string;
|
|
72
|
+
}>;
|
|
73
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
74
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
75
|
+
message: string;
|
|
76
|
+
target: string;
|
|
77
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
78
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
79
|
+
onInputDelta?: ((options: {
|
|
80
|
+
inputTextDelta: string;
|
|
81
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
82
|
+
onInputAvailable?: ((options: {
|
|
83
|
+
input: {
|
|
84
|
+
message: string;
|
|
85
|
+
target: string;
|
|
86
|
+
};
|
|
87
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
88
|
+
toModelOutput?: ((options: {
|
|
89
|
+
toolCallId: string;
|
|
90
|
+
input: {
|
|
91
|
+
message: string;
|
|
92
|
+
target: string;
|
|
93
|
+
};
|
|
94
|
+
output: NoInfer<AgentMessageOutput>;
|
|
95
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
96
|
+
} & {
|
|
97
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
98
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
99
|
+
message: string;
|
|
100
|
+
target: string;
|
|
101
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
102
|
+
} & {
|
|
103
|
+
description?: string | ((options: {
|
|
104
|
+
context: NoInfer<AgentToolContext>;
|
|
105
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
106
|
+
}) => string) | undefined;
|
|
107
|
+
strict?: boolean;
|
|
108
|
+
inputExamples?: {
|
|
109
|
+
input: NoInfer<{
|
|
110
|
+
message: string;
|
|
111
|
+
target: string;
|
|
112
|
+
}>;
|
|
113
|
+
}[] | undefined;
|
|
114
|
+
id?: never;
|
|
115
|
+
isProviderExecuted?: never;
|
|
116
|
+
args?: never;
|
|
117
|
+
supportsDeferredResults?: never;
|
|
118
|
+
} & {
|
|
119
|
+
type: "dynamic";
|
|
120
|
+
} & {
|
|
121
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
122
|
+
message: string;
|
|
123
|
+
target: string;
|
|
124
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
125
|
+
}) | ({
|
|
126
|
+
title?: string;
|
|
127
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
128
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
129
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
130
|
+
message: string;
|
|
131
|
+
target: string;
|
|
132
|
+
}>;
|
|
133
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
134
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
135
|
+
message: string;
|
|
136
|
+
target: string;
|
|
137
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
138
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
139
|
+
onInputDelta?: ((options: {
|
|
140
|
+
inputTextDelta: string;
|
|
141
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
142
|
+
onInputAvailable?: ((options: {
|
|
143
|
+
input: {
|
|
144
|
+
message: string;
|
|
145
|
+
target: string;
|
|
146
|
+
};
|
|
147
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
148
|
+
toModelOutput?: ((options: {
|
|
149
|
+
toolCallId: string;
|
|
150
|
+
input: {
|
|
151
|
+
message: string;
|
|
152
|
+
target: string;
|
|
153
|
+
};
|
|
154
|
+
output: NoInfer<AgentMessageOutput>;
|
|
155
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
156
|
+
} & {
|
|
157
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
158
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
159
|
+
message: string;
|
|
160
|
+
target: string;
|
|
161
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
162
|
+
} & {
|
|
163
|
+
type: "provider";
|
|
164
|
+
id: `${string}.${string}`;
|
|
165
|
+
args: Record<string, unknown>;
|
|
166
|
+
description?: never;
|
|
167
|
+
strict?: never;
|
|
168
|
+
inputExamples?: never;
|
|
169
|
+
} & {
|
|
170
|
+
isProviderExecuted: false;
|
|
171
|
+
supportsDeferredResults?: never;
|
|
172
|
+
} & {
|
|
173
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
174
|
+
message: string;
|
|
175
|
+
target: string;
|
|
176
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
177
|
+
}) | ({
|
|
178
|
+
title?: string;
|
|
179
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
180
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
181
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
182
|
+
message: string;
|
|
183
|
+
target: string;
|
|
184
|
+
}>;
|
|
185
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
186
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
187
|
+
message: string;
|
|
188
|
+
target: string;
|
|
189
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
190
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
191
|
+
onInputDelta?: ((options: {
|
|
192
|
+
inputTextDelta: string;
|
|
193
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
194
|
+
onInputAvailable?: ((options: {
|
|
195
|
+
input: {
|
|
196
|
+
message: string;
|
|
197
|
+
target: string;
|
|
198
|
+
};
|
|
199
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
200
|
+
toModelOutput?: ((options: {
|
|
201
|
+
toolCallId: string;
|
|
202
|
+
input: {
|
|
203
|
+
message: string;
|
|
204
|
+
target: string;
|
|
205
|
+
};
|
|
206
|
+
output: NoInfer<AgentMessageOutput>;
|
|
207
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
208
|
+
} & {
|
|
209
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
210
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
211
|
+
message: string;
|
|
212
|
+
target: string;
|
|
213
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
214
|
+
} & {
|
|
215
|
+
type: "provider";
|
|
216
|
+
id: `${string}.${string}`;
|
|
217
|
+
args: Record<string, unknown>;
|
|
218
|
+
description?: never;
|
|
219
|
+
strict?: never;
|
|
220
|
+
inputExamples?: never;
|
|
221
|
+
} & {
|
|
222
|
+
isProviderExecuted: true;
|
|
223
|
+
supportsDeferredResults?: boolean;
|
|
224
|
+
} & {
|
|
225
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
226
|
+
message: string;
|
|
227
|
+
target: string;
|
|
228
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
229
|
+
});
|
|
230
|
+
export declare const followupTaskTool: ({
|
|
231
|
+
title?: string;
|
|
232
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
233
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
234
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
235
|
+
message: string;
|
|
236
|
+
target: string;
|
|
237
|
+
}>;
|
|
238
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
239
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
240
|
+
message: string;
|
|
241
|
+
target: string;
|
|
242
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
243
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
244
|
+
onInputDelta?: ((options: {
|
|
245
|
+
inputTextDelta: string;
|
|
246
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
247
|
+
onInputAvailable?: ((options: {
|
|
248
|
+
input: {
|
|
249
|
+
message: string;
|
|
250
|
+
target: string;
|
|
251
|
+
};
|
|
252
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
253
|
+
toModelOutput?: ((options: {
|
|
254
|
+
toolCallId: string;
|
|
255
|
+
input: {
|
|
256
|
+
message: string;
|
|
257
|
+
target: string;
|
|
258
|
+
};
|
|
259
|
+
output: NoInfer<AgentMessageOutput>;
|
|
260
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
261
|
+
} & {
|
|
262
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
263
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
264
|
+
message: string;
|
|
265
|
+
target: string;
|
|
266
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
267
|
+
} & {
|
|
268
|
+
description?: string | ((options: {
|
|
269
|
+
context: NoInfer<AgentToolContext>;
|
|
270
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
271
|
+
}) => string) | undefined;
|
|
272
|
+
strict?: boolean;
|
|
273
|
+
inputExamples?: {
|
|
274
|
+
input: NoInfer<{
|
|
275
|
+
message: string;
|
|
276
|
+
target: string;
|
|
277
|
+
}>;
|
|
278
|
+
}[] | undefined;
|
|
279
|
+
id?: never;
|
|
280
|
+
isProviderExecuted?: never;
|
|
281
|
+
args?: never;
|
|
282
|
+
supportsDeferredResults?: never;
|
|
283
|
+
} & {
|
|
284
|
+
type?: undefined | "function";
|
|
285
|
+
} & {
|
|
286
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
287
|
+
message: string;
|
|
288
|
+
target: string;
|
|
289
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
290
|
+
}) | ({
|
|
291
|
+
title?: string;
|
|
292
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
293
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
294
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
295
|
+
message: string;
|
|
296
|
+
target: string;
|
|
297
|
+
}>;
|
|
298
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
299
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
300
|
+
message: string;
|
|
301
|
+
target: string;
|
|
302
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
303
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
304
|
+
onInputDelta?: ((options: {
|
|
305
|
+
inputTextDelta: string;
|
|
306
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
307
|
+
onInputAvailable?: ((options: {
|
|
308
|
+
input: {
|
|
309
|
+
message: string;
|
|
310
|
+
target: string;
|
|
311
|
+
};
|
|
312
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
313
|
+
toModelOutput?: ((options: {
|
|
314
|
+
toolCallId: string;
|
|
315
|
+
input: {
|
|
316
|
+
message: string;
|
|
317
|
+
target: string;
|
|
318
|
+
};
|
|
319
|
+
output: NoInfer<AgentMessageOutput>;
|
|
320
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
321
|
+
} & {
|
|
322
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
323
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
324
|
+
message: string;
|
|
325
|
+
target: string;
|
|
326
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
327
|
+
} & {
|
|
328
|
+
description?: string | ((options: {
|
|
329
|
+
context: NoInfer<AgentToolContext>;
|
|
330
|
+
experimental_sandbox?: import("ai").Experimental_SandboxSession;
|
|
331
|
+
}) => string) | undefined;
|
|
332
|
+
strict?: boolean;
|
|
333
|
+
inputExamples?: {
|
|
334
|
+
input: NoInfer<{
|
|
335
|
+
message: string;
|
|
336
|
+
target: string;
|
|
337
|
+
}>;
|
|
338
|
+
}[] | undefined;
|
|
339
|
+
id?: never;
|
|
340
|
+
isProviderExecuted?: never;
|
|
341
|
+
args?: never;
|
|
342
|
+
supportsDeferredResults?: never;
|
|
343
|
+
} & {
|
|
344
|
+
type: "dynamic";
|
|
345
|
+
} & {
|
|
346
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
347
|
+
message: string;
|
|
348
|
+
target: string;
|
|
349
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
350
|
+
}) | ({
|
|
351
|
+
title?: string;
|
|
352
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
353
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
354
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
355
|
+
message: string;
|
|
356
|
+
target: string;
|
|
357
|
+
}>;
|
|
358
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
359
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
360
|
+
message: string;
|
|
361
|
+
target: string;
|
|
362
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
363
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
364
|
+
onInputDelta?: ((options: {
|
|
365
|
+
inputTextDelta: string;
|
|
366
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
367
|
+
onInputAvailable?: ((options: {
|
|
368
|
+
input: {
|
|
369
|
+
message: string;
|
|
370
|
+
target: string;
|
|
371
|
+
};
|
|
372
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
373
|
+
toModelOutput?: ((options: {
|
|
374
|
+
toolCallId: string;
|
|
375
|
+
input: {
|
|
376
|
+
message: string;
|
|
377
|
+
target: string;
|
|
378
|
+
};
|
|
379
|
+
output: NoInfer<AgentMessageOutput>;
|
|
380
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
381
|
+
} & {
|
|
382
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
383
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
384
|
+
message: string;
|
|
385
|
+
target: string;
|
|
386
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
387
|
+
} & {
|
|
388
|
+
type: "provider";
|
|
389
|
+
id: `${string}.${string}`;
|
|
390
|
+
args: Record<string, unknown>;
|
|
391
|
+
description?: never;
|
|
392
|
+
strict?: never;
|
|
393
|
+
inputExamples?: never;
|
|
394
|
+
} & {
|
|
395
|
+
isProviderExecuted: false;
|
|
396
|
+
supportsDeferredResults?: never;
|
|
397
|
+
} & {
|
|
398
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
399
|
+
message: string;
|
|
400
|
+
target: string;
|
|
401
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
402
|
+
}) | ({
|
|
403
|
+
title?: string;
|
|
404
|
+
providerOptions?: import("@ai-sdk/provider-utils").ProviderOptions;
|
|
405
|
+
metadata?: import("@ai-sdk/provider").JSONObject;
|
|
406
|
+
inputSchema: import("ai").FlexibleSchema<{
|
|
407
|
+
message: string;
|
|
408
|
+
target: string;
|
|
409
|
+
}>;
|
|
410
|
+
contextSchema?: import("ai").FlexibleSchema<AgentToolContext> | undefined;
|
|
411
|
+
needsApproval?: boolean | import("@ai-sdk/provider-utils").ToolNeedsApprovalFunction<{
|
|
412
|
+
message: string;
|
|
413
|
+
target: string;
|
|
414
|
+
}, NoInfer<AgentToolContext>> | undefined;
|
|
415
|
+
onInputStart?: ((options: import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
416
|
+
onInputDelta?: ((options: {
|
|
417
|
+
inputTextDelta: string;
|
|
418
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
419
|
+
onInputAvailable?: ((options: {
|
|
420
|
+
input: {
|
|
421
|
+
message: string;
|
|
422
|
+
target: string;
|
|
423
|
+
};
|
|
424
|
+
} & import("ai").ToolExecutionOptions<NoInfer<AgentToolContext>>) => void | PromiseLike<void>) | undefined;
|
|
425
|
+
toModelOutput?: ((options: {
|
|
426
|
+
toolCallId: string;
|
|
427
|
+
input: {
|
|
428
|
+
message: string;
|
|
429
|
+
target: string;
|
|
430
|
+
};
|
|
431
|
+
output: NoInfer<AgentMessageOutput>;
|
|
432
|
+
}) => import("@ai-sdk/provider-utils").ToolResultOutput | PromiseLike<import("@ai-sdk/provider-utils").ToolResultOutput>) | undefined;
|
|
433
|
+
} & {
|
|
434
|
+
outputSchema?: import("ai").FlexibleSchema<AgentMessageOutput> | undefined;
|
|
435
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
436
|
+
message: string;
|
|
437
|
+
target: string;
|
|
438
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
439
|
+
} & {
|
|
440
|
+
type: "provider";
|
|
441
|
+
id: `${string}.${string}`;
|
|
442
|
+
args: Record<string, unknown>;
|
|
443
|
+
description?: never;
|
|
444
|
+
strict?: never;
|
|
445
|
+
inputExamples?: never;
|
|
446
|
+
} & {
|
|
447
|
+
isProviderExecuted: true;
|
|
448
|
+
supportsDeferredResults?: boolean;
|
|
449
|
+
} & {
|
|
450
|
+
execute: import("ai").ToolExecuteFunction<{
|
|
451
|
+
message: string;
|
|
452
|
+
target: string;
|
|
453
|
+
}, AgentMessageOutput, NoInfer<AgentToolContext>>;
|
|
454
|
+
});
|
|
455
|
+
export {};
|
|
456
|
+
//# sourceMappingURL=message-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message-tools.d.ts","sourceRoot":"","sources":["../../src/zukhruf/message-tools.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAchE,KAAK,kBAAkB,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAE7C,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU1B,CAAC;AAEH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { PgBoss } from 'pg-boss';
|
|
2
|
-
import { type ConsumeContext, type ConsumeOptions, TurnQueue, type TurnRef } from './turn-queue.ts';
|
|
2
|
+
import { type ConsumeContext, type ConsumeOptions, type TurnActivity, TurnQueue, type TurnRef } from './turn-queue.ts';
|
|
3
3
|
export interface PgBossTurnQueueOptions {
|
|
4
4
|
queue?: string;
|
|
5
5
|
/** Hard cap on one turn attempt; the job fails past this. */
|
|
@@ -37,6 +37,7 @@ export declare class PgBossTurnQueue extends TurnQueue {
|
|
|
37
37
|
get deadLetterQueue(): string;
|
|
38
38
|
initialize(): Promise<void>;
|
|
39
39
|
push(turn: TurnRef): Promise<void>;
|
|
40
|
+
getTurnActivity(conversation: Pick<TurnRef, 'chatId' | 'userId'>): Promise<TurnActivity>;
|
|
40
41
|
consume(handler: (turn: TurnRef, context: ConsumeContext) => Promise<void>, options: ConsumeOptions): Promise<AsyncDisposable>;
|
|
41
42
|
resumeParked(chatId: string): Promise<void>;
|
|
42
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pg-boss.turn-queue.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/queue/pg-boss.turn-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,MAAM,EAAE,MAAM,SAAS,CAAC;AAGvD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,SAAS,EACT,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,eAAgB,SAAQ,SAAS;;gBAOhC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;IAS9D,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB3B,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"pg-boss.turn-queue.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/queue/pg-boss.turn-queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAmB,MAAM,EAAE,MAAM,SAAS,CAAC;AAGvD,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,SAAS,EACT,KAAK,OAAO,EACb,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,sBAAsB;IACrC,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAC1B,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,eAAgB,SAAQ,SAAS;;gBAOhC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,sBAA2B;IAS9D,IAAI,KAAK,IAAI,MAAM,CAElB;IAED,IAAI,eAAe,IAAI,MAAM,CAE5B;IAEK,UAAU,IAAI,OAAO,CAAC,IAAI,CAAC;IAgB3B,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAgBzB,eAAe,CAC5B,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAC,GAC/C,OAAO,CAAC,YAAY,CAAC;IAiBlB,OAAO,CACX,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,EAClE,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC;IAkErB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAmBlD"}
|
|
@@ -19,6 +19,12 @@ export type TurnRef = {
|
|
|
19
19
|
* place by `approve()`/`deny()`.
|
|
20
20
|
*/
|
|
21
21
|
kind: 'continuation';
|
|
22
|
+
} | {
|
|
23
|
+
/**
|
|
24
|
+
* A mailbox wake-up. The communication payload remains in MailboxStore;
|
|
25
|
+
* TurnQueue carries only the execution request and addressing.
|
|
26
|
+
*/
|
|
27
|
+
kind: 'mailbox';
|
|
22
28
|
});
|
|
23
29
|
export interface ConsumeContext {
|
|
24
30
|
signal: AbortSignal;
|
|
@@ -39,6 +45,7 @@ export interface ConsumeOptions {
|
|
|
39
45
|
*/
|
|
40
46
|
onOrphaned: (turn: TurnRef, error: string) => Promise<void>;
|
|
41
47
|
}
|
|
48
|
+
export type TurnActivity = 'idle' | 'queued' | 'running';
|
|
42
49
|
/**
|
|
43
50
|
* Durable holding pen for pending turns.
|
|
44
51
|
*
|
|
@@ -53,8 +60,13 @@ export interface ConsumeOptions {
|
|
|
53
60
|
* run in the order they were pushed (strict FIFO per `chatId`) — this
|
|
54
61
|
* covers duplicates too: they can never run concurrently or out of order.
|
|
55
62
|
* - Turns from different chats may run concurrently.
|
|
63
|
+
* - `getTurnActivity` distinguishes queued from active scheduler work for
|
|
64
|
+
* status inspection; adapters must not silently fall back to stale history.
|
|
56
65
|
* - A handler that throws (or a worker that dies mid-turn) does not retry:
|
|
57
66
|
* the turn surfaces once through `onOrphaned`, then the chat unblocks.
|
|
67
|
+
* - Mailbox payloads NEVER live here. A `{kind: 'mailbox'}` item is only a
|
|
68
|
+
* durable wake request; the target MailboxStore remains the pending-input
|
|
69
|
+
* authority.
|
|
58
70
|
* - A parked turn (`context.park()`) is not delivered again until
|
|
59
71
|
* `resumeParked(chatId)`; revived turns keep their original FIFO order,
|
|
60
72
|
* and a `'continuation'` turn pushed for the chat outranks them.
|
|
@@ -64,6 +76,8 @@ export interface ConsumeOptions {
|
|
|
64
76
|
*/
|
|
65
77
|
export declare abstract class TurnQueue {
|
|
66
78
|
abstract push(turn: TurnRef): Promise<void>;
|
|
79
|
+
/** Whether this conversation currently has queued or active scheduler work. */
|
|
80
|
+
abstract getTurnActivity(conversation: Pick<TurnRef, 'chatId' | 'userId'>): Promise<TurnActivity>;
|
|
67
81
|
abstract consume(handler: (turn: TurnRef, context: ConsumeContext) => Promise<void>, options: ConsumeOptions): Promise<AsyncDisposable>;
|
|
68
82
|
abstract resumeParked(chatId: string): Promise<void>;
|
|
69
83
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turn-queue.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/queue/turn-queue.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,CACA;IACE,IAAI,EAAE,KAAK,CAAC;IACZ;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE;;;;OAIG;IACH,IAAI,EAAE,cAAc,CAAC;CACtB,CACJ,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED
|
|
1
|
+
{"version":3,"file":"turn-queue.d.ts","sourceRoot":"","sources":["../../../src/zukhruf/queue/turn-queue.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,OAAO,GAAG;IACpB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,CACA;IACE,IAAI,EAAE,KAAK,CAAC;IACZ;;;;;;OAMG;IACH,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE;;;;OAIG;IACH,IAAI,EAAE,cAAc,CAAC;CACtB,GACD;IACE;;;OAGG;IACH,IAAI,EAAE,SAAS,CAAC;CACjB,CACJ,CAAC;AAEF,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,WAAW,CAAC;IACpB;;;;OAIG;IACH,IAAI,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CAC3B;AAED,MAAM,WAAW,cAAc;IAC7B,wEAAwE;IACxE,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,UAAU,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7D;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEzD;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,8BAAsB,SAAS;IAC7B,QAAQ,CAAC,IAAI,CAAC,IAAI,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC;IAE3C,+EAA+E;IAC/E,QAAQ,CAAC,eAAe,CACtB,YAAY,EAAE,IAAI,CAAC,OAAO,EAAE,QAAQ,GAAG,QAAQ,CAAC,GAC/C,OAAO,CAAC,YAAY,CAAC;IAExB,QAAQ,CAAC,OAAO,CACd,OAAO,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,KAAK,OAAO,CAAC,IAAI,CAAC,EAClE,OAAO,EAAE,cAAc,GACtB,OAAO,CAAC,eAAe,CAAC;IAE3B,QAAQ,CAAC,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CACrD"}
|