@swirls/looms 0.13.1 → 0.14.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/CHANGELOG.md +12 -0
- package/dist/agent/agent-session.js +12 -11
- package/dist/agent/effects.d.ts +343 -266
- package/dist/agent/events.d.ts +70 -0
- package/dist/agent/events.js +2 -1
- package/dist/agent/module.d.ts +329 -0
- package/dist/agent/projections.d.ts +7 -0
- package/dist/agent/projections.js +2 -1
- package/dist/agent/scope.d.ts +70 -0
- package/dist/agent/signals.d.ts +63 -0
- package/dist/agent/signals.js +7 -4
- package/dist/agent/threads.js +8 -11
- package/dist/agent/types.d.ts +49 -0
- package/dist/agent/types.js +33 -0
- package/dist/ai-vercel/index.d.ts +1 -1
- package/dist/ai-vercel/index.js +1 -1
- package/dist/ai-vercel/messages.d.ts +19 -2
- package/dist/ai-vercel/messages.js +60 -2
- package/dist/ai-vercel/vercel-llm.d.ts +6 -0
- package/dist/ai-vercel/vercel-llm.js +9 -2
- package/dist/debugger/app/assets/{index-Dqg2e5oY.js → index-CtGiJU8b.js} +2 -2
- package/dist/debugger/app/assets/{routes-DMDW7tFG.js → routes-Bg0vNEOr.js} +2 -2
- package/dist/debugger/app/index.html +1 -1
- package/dist/runtime/wake-engine.js +32 -3
- package/package.json +1 -1
package/dist/agent/effects.d.ts
CHANGED
|
@@ -11,6 +11,13 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
11
11
|
readonly messages?: readonly {
|
|
12
12
|
readonly role: "assistant" | "system" | "tool" | "user";
|
|
13
13
|
readonly content: string;
|
|
14
|
+
readonly attachments?: readonly {
|
|
15
|
+
readonly id: string;
|
|
16
|
+
readonly mediaType: string;
|
|
17
|
+
readonly name?: string | undefined;
|
|
18
|
+
readonly size?: number | undefined;
|
|
19
|
+
readonly url?: string | undefined;
|
|
20
|
+
}[] | undefined;
|
|
14
21
|
readonly toolCallId?: string | undefined;
|
|
15
22
|
readonly name?: string | undefined;
|
|
16
23
|
readonly toolCalls?: {
|
|
@@ -24,6 +31,289 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
24
31
|
readonly alreadyCompacted?: boolean | undefined;
|
|
25
32
|
readonly consumedSteerMessageIds?: readonly string[] | undefined;
|
|
26
33
|
}, AgentDefinitionsTag | LlmTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
34
|
+
readonly type: "agent.context.compacted";
|
|
35
|
+
readonly payload: {
|
|
36
|
+
readonly turn: number;
|
|
37
|
+
readonly originalCount: number;
|
|
38
|
+
readonly compactedCount: number;
|
|
39
|
+
readonly summary?: string | undefined;
|
|
40
|
+
readonly reason?: "manual" | "overflow" | "threshold" | undefined;
|
|
41
|
+
readonly messages?: readonly {
|
|
42
|
+
readonly role: "assistant" | "system" | "tool" | "user";
|
|
43
|
+
readonly content: string;
|
|
44
|
+
readonly attachments?: readonly {
|
|
45
|
+
readonly id: string;
|
|
46
|
+
readonly mediaType: string;
|
|
47
|
+
readonly name?: string | undefined;
|
|
48
|
+
readonly size?: number | undefined;
|
|
49
|
+
readonly url?: string | undefined;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
readonly toolCallId?: string | undefined;
|
|
52
|
+
readonly name?: string | undefined;
|
|
53
|
+
readonly toolCalls?: {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly name: string;
|
|
56
|
+
readonly arguments: Schema.Json;
|
|
57
|
+
}[] | undefined;
|
|
58
|
+
}[] | undefined;
|
|
59
|
+
};
|
|
60
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
61
|
+
readonly type: "agent.effects.requested";
|
|
62
|
+
readonly payload: {
|
|
63
|
+
readonly toolCallId: string;
|
|
64
|
+
readonly effects: readonly ({
|
|
65
|
+
readonly type: "runtime.spawn";
|
|
66
|
+
readonly childThreadId: string;
|
|
67
|
+
readonly kind: string;
|
|
68
|
+
readonly definitionName: string;
|
|
69
|
+
readonly definitionVersion: string;
|
|
70
|
+
readonly input: Schema.Json;
|
|
71
|
+
} | {
|
|
72
|
+
readonly type: "runtime.wait";
|
|
73
|
+
readonly waitId: string;
|
|
74
|
+
readonly on: {
|
|
75
|
+
readonly type: string | readonly string[];
|
|
76
|
+
readonly match?: Schema.Json | undefined;
|
|
77
|
+
} | {
|
|
78
|
+
readonly timerAt: number;
|
|
79
|
+
};
|
|
80
|
+
readonly tag?: Schema.Json | undefined;
|
|
81
|
+
} | {
|
|
82
|
+
readonly type: "runtime.emit";
|
|
83
|
+
readonly event: {
|
|
84
|
+
readonly type: string;
|
|
85
|
+
readonly payload: Schema.Json;
|
|
86
|
+
readonly threadId?: string | null | undefined;
|
|
87
|
+
readonly parentThreadId?: string | null | undefined;
|
|
88
|
+
readonly causationId?: string | null | undefined;
|
|
89
|
+
readonly correlationId?: string | null | undefined;
|
|
90
|
+
readonly effectId?: string | null | undefined;
|
|
91
|
+
readonly origin?: {
|
|
92
|
+
readonly type: "thread";
|
|
93
|
+
readonly threadId: string;
|
|
94
|
+
} | {
|
|
95
|
+
readonly type: "external";
|
|
96
|
+
readonly actorId?: string | undefined;
|
|
97
|
+
} | {
|
|
98
|
+
readonly type: "system";
|
|
99
|
+
} | {
|
|
100
|
+
readonly type: "run";
|
|
101
|
+
readonly runId: string;
|
|
102
|
+
} | undefined;
|
|
103
|
+
readonly ephemeral?: boolean | undefined;
|
|
104
|
+
readonly id?: string | undefined;
|
|
105
|
+
readonly ts?: number | undefined;
|
|
106
|
+
readonly idempotencyKey?: string | null | undefined;
|
|
107
|
+
};
|
|
108
|
+
readonly tag?: string | undefined;
|
|
109
|
+
} | {
|
|
110
|
+
readonly type: "runtime.complete";
|
|
111
|
+
readonly output: Schema.Json;
|
|
112
|
+
} | {
|
|
113
|
+
readonly type: "runtime.fail";
|
|
114
|
+
readonly error: string;
|
|
115
|
+
} | {
|
|
116
|
+
readonly type: "runtime.cancel";
|
|
117
|
+
readonly threadId: string;
|
|
118
|
+
readonly tag?: string | undefined;
|
|
119
|
+
} | {
|
|
120
|
+
readonly type: "runtime.launch";
|
|
121
|
+
readonly runId: string;
|
|
122
|
+
readonly kind: string;
|
|
123
|
+
readonly definitionName: string;
|
|
124
|
+
readonly definitionVersion: string;
|
|
125
|
+
readonly input: Schema.Json;
|
|
126
|
+
readonly close: "terminate" | "wait";
|
|
127
|
+
readonly tag?: string | undefined;
|
|
128
|
+
} | {
|
|
129
|
+
readonly type: "runtime.cancelRun";
|
|
130
|
+
readonly runId: string;
|
|
131
|
+
readonly tag?: string | undefined;
|
|
132
|
+
} | {
|
|
133
|
+
readonly type: string;
|
|
134
|
+
readonly input: Schema.Json;
|
|
135
|
+
readonly tag?: string | undefined;
|
|
136
|
+
readonly at?: number | undefined;
|
|
137
|
+
})[];
|
|
138
|
+
readonly waitOn?: {
|
|
139
|
+
readonly type: string | readonly string[];
|
|
140
|
+
readonly match?: Schema.Json | undefined;
|
|
141
|
+
} | undefined;
|
|
142
|
+
};
|
|
143
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
144
|
+
readonly type: "agent.lineage";
|
|
145
|
+
readonly payload: {
|
|
146
|
+
readonly depth: number;
|
|
147
|
+
};
|
|
148
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
149
|
+
readonly type: "agent.message";
|
|
150
|
+
readonly payload: {
|
|
151
|
+
readonly turn: number;
|
|
152
|
+
readonly message: {
|
|
153
|
+
readonly role: "assistant" | "system" | "tool" | "user";
|
|
154
|
+
readonly content: string;
|
|
155
|
+
readonly attachments?: readonly {
|
|
156
|
+
readonly id: string;
|
|
157
|
+
readonly mediaType: string;
|
|
158
|
+
readonly name?: string | undefined;
|
|
159
|
+
readonly size?: number | undefined;
|
|
160
|
+
readonly url?: string | undefined;
|
|
161
|
+
}[] | undefined;
|
|
162
|
+
readonly toolCallId?: string | undefined;
|
|
163
|
+
readonly name?: string | undefined;
|
|
164
|
+
readonly toolCalls?: {
|
|
165
|
+
readonly id: string;
|
|
166
|
+
readonly name: string;
|
|
167
|
+
readonly arguments: Schema.Json;
|
|
168
|
+
}[] | undefined;
|
|
169
|
+
};
|
|
170
|
+
readonly usage?: {
|
|
171
|
+
readonly input: number;
|
|
172
|
+
readonly output: number;
|
|
173
|
+
} | undefined;
|
|
174
|
+
};
|
|
175
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
176
|
+
readonly type: "agent.message.received";
|
|
177
|
+
readonly payload: {
|
|
178
|
+
readonly message: {
|
|
179
|
+
readonly role: "assistant" | "system" | "tool" | "user";
|
|
180
|
+
readonly content: string;
|
|
181
|
+
readonly attachments?: readonly {
|
|
182
|
+
readonly id: string;
|
|
183
|
+
readonly mediaType: string;
|
|
184
|
+
readonly name?: string | undefined;
|
|
185
|
+
readonly size?: number | undefined;
|
|
186
|
+
readonly url?: string | undefined;
|
|
187
|
+
}[] | undefined;
|
|
188
|
+
readonly toolCallId?: string | undefined;
|
|
189
|
+
readonly name?: string | undefined;
|
|
190
|
+
readonly toolCalls?: {
|
|
191
|
+
readonly id: string;
|
|
192
|
+
readonly name: string;
|
|
193
|
+
readonly arguments: Schema.Json;
|
|
194
|
+
}[] | undefined;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
198
|
+
readonly type: "agent.session.cancel.requested";
|
|
199
|
+
readonly payload: {};
|
|
200
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
201
|
+
readonly type: "agent.session.message.submitted";
|
|
202
|
+
readonly payload: {
|
|
203
|
+
readonly messageId: string;
|
|
204
|
+
readonly text: string;
|
|
205
|
+
readonly attachments?: readonly {
|
|
206
|
+
readonly id: string;
|
|
207
|
+
readonly mediaType: string;
|
|
208
|
+
readonly name?: string | undefined;
|
|
209
|
+
readonly size?: number | undefined;
|
|
210
|
+
readonly url?: string | undefined;
|
|
211
|
+
}[] | undefined;
|
|
212
|
+
readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
|
|
213
|
+
readonly activeChildThreadId?: string | undefined;
|
|
214
|
+
};
|
|
215
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
216
|
+
readonly type: "agent.session.steer.delivered";
|
|
217
|
+
readonly payload: {
|
|
218
|
+
readonly messageId: string;
|
|
219
|
+
readonly activeMessageId: string;
|
|
220
|
+
};
|
|
221
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
222
|
+
readonly type: "agent.session.turn.closed";
|
|
223
|
+
readonly payload: {
|
|
224
|
+
readonly messageId: string;
|
|
225
|
+
readonly status: "cancelled" | "completed" | "failed";
|
|
226
|
+
readonly error?: string | undefined;
|
|
227
|
+
};
|
|
228
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
229
|
+
readonly type: "agent.session.turn.started";
|
|
230
|
+
readonly payload: {
|
|
231
|
+
readonly messageId: string;
|
|
232
|
+
readonly childThreadId: string;
|
|
233
|
+
};
|
|
234
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
235
|
+
readonly type: "agent.spawn.requested";
|
|
236
|
+
readonly payload: {
|
|
237
|
+
readonly childThreadId: string;
|
|
238
|
+
readonly kind: string;
|
|
239
|
+
readonly definitionName: string;
|
|
240
|
+
readonly definitionVersion: string;
|
|
241
|
+
readonly toolCallId: string;
|
|
242
|
+
readonly input: Schema.Json;
|
|
243
|
+
readonly depth?: number | undefined;
|
|
244
|
+
};
|
|
245
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
246
|
+
readonly type: "agent.steered";
|
|
247
|
+
readonly payload: {
|
|
248
|
+
readonly turn: number;
|
|
249
|
+
readonly messageId?: string | undefined;
|
|
250
|
+
readonly message: {
|
|
251
|
+
readonly role: "assistant" | "system" | "tool" | "user";
|
|
252
|
+
readonly content: string;
|
|
253
|
+
readonly attachments?: readonly {
|
|
254
|
+
readonly id: string;
|
|
255
|
+
readonly mediaType: string;
|
|
256
|
+
readonly name?: string | undefined;
|
|
257
|
+
readonly size?: number | undefined;
|
|
258
|
+
readonly url?: string | undefined;
|
|
259
|
+
}[] | undefined;
|
|
260
|
+
readonly toolCallId?: string | undefined;
|
|
261
|
+
readonly name?: string | undefined;
|
|
262
|
+
readonly toolCalls?: {
|
|
263
|
+
readonly id: string;
|
|
264
|
+
readonly name: string;
|
|
265
|
+
readonly arguments: Schema.Json;
|
|
266
|
+
}[] | undefined;
|
|
267
|
+
};
|
|
268
|
+
readonly interrupt?: boolean | undefined;
|
|
269
|
+
};
|
|
270
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
271
|
+
readonly type: "agent.tool.result";
|
|
272
|
+
readonly payload: {
|
|
273
|
+
readonly turn: number;
|
|
274
|
+
readonly toolCallId: string;
|
|
275
|
+
readonly name: string;
|
|
276
|
+
readonly result: Schema.Json;
|
|
277
|
+
readonly error: string | null;
|
|
278
|
+
};
|
|
279
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
280
|
+
readonly type: "agent.tool_call.requested";
|
|
281
|
+
readonly payload: {
|
|
282
|
+
readonly turn: number;
|
|
283
|
+
readonly toolCall: {
|
|
284
|
+
readonly id: string;
|
|
285
|
+
readonly name: string;
|
|
286
|
+
readonly arguments: Schema.Json;
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
290
|
+
readonly type: "agent.turn.settled";
|
|
291
|
+
readonly payload: {
|
|
292
|
+
readonly turn: number;
|
|
293
|
+
};
|
|
294
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
295
|
+
readonly type: "agent.turn.started";
|
|
296
|
+
readonly payload: {
|
|
297
|
+
readonly turn: number;
|
|
298
|
+
readonly messageCount?: number | undefined;
|
|
299
|
+
};
|
|
300
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
301
|
+
readonly type: "agent.turn.stopped";
|
|
302
|
+
readonly payload: {};
|
|
303
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
304
|
+
readonly type: "agent.turn.text_delta";
|
|
305
|
+
readonly payload: {
|
|
306
|
+
readonly turn: number;
|
|
307
|
+
readonly delta: string;
|
|
308
|
+
};
|
|
309
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
310
|
+
readonly type: "agent.turn.usage";
|
|
311
|
+
readonly payload: {
|
|
312
|
+
readonly turn: number;
|
|
313
|
+
readonly input: number;
|
|
314
|
+
readonly output: number;
|
|
315
|
+
};
|
|
316
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
27
317
|
readonly type: "runtime.child.close.requested";
|
|
28
318
|
readonly payload: {
|
|
29
319
|
readonly policy: "terminate" | "wait";
|
|
@@ -269,7 +559,19 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
269
559
|
readonly payload: Schema.Json;
|
|
270
560
|
};
|
|
271
561
|
};
|
|
272
|
-
})
|
|
562
|
+
})>>;
|
|
563
|
+
export declare const executeToolEffect: NoInfer<import("@swirls/looms/core").LocalEffectDefinition<{
|
|
564
|
+
readonly turn: number;
|
|
565
|
+
readonly definitionName?: string | undefined;
|
|
566
|
+
readonly definitionVersion: string;
|
|
567
|
+
readonly toolCall: {
|
|
568
|
+
readonly id: string;
|
|
569
|
+
readonly name: string;
|
|
570
|
+
readonly arguments: Schema.Json;
|
|
571
|
+
};
|
|
572
|
+
readonly input?: Schema.Json | undefined;
|
|
573
|
+
readonly depth?: number | undefined;
|
|
574
|
+
}, AgentDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
273
575
|
readonly type: "agent.context.compacted";
|
|
274
576
|
readonly payload: {
|
|
275
577
|
readonly turn: number;
|
|
@@ -280,6 +582,13 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
280
582
|
readonly messages?: readonly {
|
|
281
583
|
readonly role: "assistant" | "system" | "tool" | "user";
|
|
282
584
|
readonly content: string;
|
|
585
|
+
readonly attachments?: readonly {
|
|
586
|
+
readonly id: string;
|
|
587
|
+
readonly mediaType: string;
|
|
588
|
+
readonly name?: string | undefined;
|
|
589
|
+
readonly size?: number | undefined;
|
|
590
|
+
readonly url?: string | undefined;
|
|
591
|
+
}[] | undefined;
|
|
283
592
|
readonly toolCallId?: string | undefined;
|
|
284
593
|
readonly name?: string | undefined;
|
|
285
594
|
readonly toolCalls?: {
|
|
@@ -384,6 +693,13 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
384
693
|
readonly message: {
|
|
385
694
|
readonly role: "assistant" | "system" | "tool" | "user";
|
|
386
695
|
readonly content: string;
|
|
696
|
+
readonly attachments?: readonly {
|
|
697
|
+
readonly id: string;
|
|
698
|
+
readonly mediaType: string;
|
|
699
|
+
readonly name?: string | undefined;
|
|
700
|
+
readonly size?: number | undefined;
|
|
701
|
+
readonly url?: string | undefined;
|
|
702
|
+
}[] | undefined;
|
|
387
703
|
readonly toolCallId?: string | undefined;
|
|
388
704
|
readonly name?: string | undefined;
|
|
389
705
|
readonly toolCalls?: {
|
|
@@ -403,6 +719,13 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
403
719
|
readonly message: {
|
|
404
720
|
readonly role: "assistant" | "system" | "tool" | "user";
|
|
405
721
|
readonly content: string;
|
|
722
|
+
readonly attachments?: readonly {
|
|
723
|
+
readonly id: string;
|
|
724
|
+
readonly mediaType: string;
|
|
725
|
+
readonly name?: string | undefined;
|
|
726
|
+
readonly size?: number | undefined;
|
|
727
|
+
readonly url?: string | undefined;
|
|
728
|
+
}[] | undefined;
|
|
406
729
|
readonly toolCallId?: string | undefined;
|
|
407
730
|
readonly name?: string | undefined;
|
|
408
731
|
readonly toolCalls?: {
|
|
@@ -420,6 +743,13 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
420
743
|
readonly payload: {
|
|
421
744
|
readonly messageId: string;
|
|
422
745
|
readonly text: string;
|
|
746
|
+
readonly attachments?: readonly {
|
|
747
|
+
readonly id: string;
|
|
748
|
+
readonly mediaType: string;
|
|
749
|
+
readonly name?: string | undefined;
|
|
750
|
+
readonly size?: number | undefined;
|
|
751
|
+
readonly url?: string | undefined;
|
|
752
|
+
}[] | undefined;
|
|
423
753
|
readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
|
|
424
754
|
readonly activeChildThreadId?: string | undefined;
|
|
425
755
|
};
|
|
@@ -461,6 +791,13 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
461
791
|
readonly message: {
|
|
462
792
|
readonly role: "assistant" | "system" | "tool" | "user";
|
|
463
793
|
readonly content: string;
|
|
794
|
+
readonly attachments?: readonly {
|
|
795
|
+
readonly id: string;
|
|
796
|
+
readonly mediaType: string;
|
|
797
|
+
readonly name?: string | undefined;
|
|
798
|
+
readonly size?: number | undefined;
|
|
799
|
+
readonly url?: string | undefined;
|
|
800
|
+
}[] | undefined;
|
|
464
801
|
readonly toolCallId?: string | undefined;
|
|
465
802
|
readonly name?: string | undefined;
|
|
466
803
|
readonly toolCalls?: {
|
|
@@ -512,24 +849,12 @@ export declare const callLlmEffect: NoInfer<import("@swirls/looms/core").LocalEf
|
|
|
512
849
|
};
|
|
513
850
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
514
851
|
readonly type: "agent.turn.usage";
|
|
515
|
-
readonly payload: {
|
|
516
|
-
readonly turn: number;
|
|
517
|
-
readonly input: number;
|
|
518
|
-
readonly output: number;
|
|
519
|
-
};
|
|
520
|
-
})>>;
|
|
521
|
-
export declare const executeToolEffect: NoInfer<import("@swirls/looms/core").LocalEffectDefinition<{
|
|
522
|
-
readonly turn: number;
|
|
523
|
-
readonly definitionName?: string | undefined;
|
|
524
|
-
readonly definitionVersion: string;
|
|
525
|
-
readonly toolCall: {
|
|
526
|
-
readonly id: string;
|
|
527
|
-
readonly name: string;
|
|
528
|
-
readonly arguments: Schema.Json;
|
|
852
|
+
readonly payload: {
|
|
853
|
+
readonly turn: number;
|
|
854
|
+
readonly input: number;
|
|
855
|
+
readonly output: number;
|
|
529
856
|
};
|
|
530
|
-
|
|
531
|
-
readonly depth?: number | undefined;
|
|
532
|
-
}, AgentDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
857
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
533
858
|
readonly type: "runtime.child.close.requested";
|
|
534
859
|
readonly payload: {
|
|
535
860
|
readonly policy: "terminate" | "wait";
|
|
@@ -775,253 +1100,5 @@ export declare const executeToolEffect: NoInfer<import("@swirls/looms/core").Loc
|
|
|
775
1100
|
readonly payload: Schema.Json;
|
|
776
1101
|
};
|
|
777
1102
|
};
|
|
778
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
779
|
-
readonly type: "agent.context.compacted";
|
|
780
|
-
readonly payload: {
|
|
781
|
-
readonly turn: number;
|
|
782
|
-
readonly originalCount: number;
|
|
783
|
-
readonly compactedCount: number;
|
|
784
|
-
readonly summary?: string | undefined;
|
|
785
|
-
readonly reason?: "manual" | "overflow" | "threshold" | undefined;
|
|
786
|
-
readonly messages?: readonly {
|
|
787
|
-
readonly role: "assistant" | "system" | "tool" | "user";
|
|
788
|
-
readonly content: string;
|
|
789
|
-
readonly toolCallId?: string | undefined;
|
|
790
|
-
readonly name?: string | undefined;
|
|
791
|
-
readonly toolCalls?: {
|
|
792
|
-
readonly id: string;
|
|
793
|
-
readonly name: string;
|
|
794
|
-
readonly arguments: Schema.Json;
|
|
795
|
-
}[] | undefined;
|
|
796
|
-
}[] | undefined;
|
|
797
|
-
};
|
|
798
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
799
|
-
readonly type: "agent.effects.requested";
|
|
800
|
-
readonly payload: {
|
|
801
|
-
readonly toolCallId: string;
|
|
802
|
-
readonly effects: readonly ({
|
|
803
|
-
readonly type: "runtime.spawn";
|
|
804
|
-
readonly childThreadId: string;
|
|
805
|
-
readonly kind: string;
|
|
806
|
-
readonly definitionName: string;
|
|
807
|
-
readonly definitionVersion: string;
|
|
808
|
-
readonly input: Schema.Json;
|
|
809
|
-
} | {
|
|
810
|
-
readonly type: "runtime.wait";
|
|
811
|
-
readonly waitId: string;
|
|
812
|
-
readonly on: {
|
|
813
|
-
readonly type: string | readonly string[];
|
|
814
|
-
readonly match?: Schema.Json | undefined;
|
|
815
|
-
} | {
|
|
816
|
-
readonly timerAt: number;
|
|
817
|
-
};
|
|
818
|
-
readonly tag?: Schema.Json | undefined;
|
|
819
|
-
} | {
|
|
820
|
-
readonly type: "runtime.emit";
|
|
821
|
-
readonly event: {
|
|
822
|
-
readonly type: string;
|
|
823
|
-
readonly payload: Schema.Json;
|
|
824
|
-
readonly threadId?: string | null | undefined;
|
|
825
|
-
readonly parentThreadId?: string | null | undefined;
|
|
826
|
-
readonly causationId?: string | null | undefined;
|
|
827
|
-
readonly correlationId?: string | null | undefined;
|
|
828
|
-
readonly effectId?: string | null | undefined;
|
|
829
|
-
readonly origin?: {
|
|
830
|
-
readonly type: "thread";
|
|
831
|
-
readonly threadId: string;
|
|
832
|
-
} | {
|
|
833
|
-
readonly type: "external";
|
|
834
|
-
readonly actorId?: string | undefined;
|
|
835
|
-
} | {
|
|
836
|
-
readonly type: "system";
|
|
837
|
-
} | {
|
|
838
|
-
readonly type: "run";
|
|
839
|
-
readonly runId: string;
|
|
840
|
-
} | undefined;
|
|
841
|
-
readonly ephemeral?: boolean | undefined;
|
|
842
|
-
readonly id?: string | undefined;
|
|
843
|
-
readonly ts?: number | undefined;
|
|
844
|
-
readonly idempotencyKey?: string | null | undefined;
|
|
845
|
-
};
|
|
846
|
-
readonly tag?: string | undefined;
|
|
847
|
-
} | {
|
|
848
|
-
readonly type: "runtime.complete";
|
|
849
|
-
readonly output: Schema.Json;
|
|
850
|
-
} | {
|
|
851
|
-
readonly type: "runtime.fail";
|
|
852
|
-
readonly error: string;
|
|
853
|
-
} | {
|
|
854
|
-
readonly type: "runtime.cancel";
|
|
855
|
-
readonly threadId: string;
|
|
856
|
-
readonly tag?: string | undefined;
|
|
857
|
-
} | {
|
|
858
|
-
readonly type: "runtime.launch";
|
|
859
|
-
readonly runId: string;
|
|
860
|
-
readonly kind: string;
|
|
861
|
-
readonly definitionName: string;
|
|
862
|
-
readonly definitionVersion: string;
|
|
863
|
-
readonly input: Schema.Json;
|
|
864
|
-
readonly close: "terminate" | "wait";
|
|
865
|
-
readonly tag?: string | undefined;
|
|
866
|
-
} | {
|
|
867
|
-
readonly type: "runtime.cancelRun";
|
|
868
|
-
readonly runId: string;
|
|
869
|
-
readonly tag?: string | undefined;
|
|
870
|
-
} | {
|
|
871
|
-
readonly type: string;
|
|
872
|
-
readonly input: Schema.Json;
|
|
873
|
-
readonly tag?: string | undefined;
|
|
874
|
-
readonly at?: number | undefined;
|
|
875
|
-
})[];
|
|
876
|
-
readonly waitOn?: {
|
|
877
|
-
readonly type: string | readonly string[];
|
|
878
|
-
readonly match?: Schema.Json | undefined;
|
|
879
|
-
} | undefined;
|
|
880
|
-
};
|
|
881
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
882
|
-
readonly type: "agent.lineage";
|
|
883
|
-
readonly payload: {
|
|
884
|
-
readonly depth: number;
|
|
885
|
-
};
|
|
886
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
887
|
-
readonly type: "agent.message";
|
|
888
|
-
readonly payload: {
|
|
889
|
-
readonly turn: number;
|
|
890
|
-
readonly message: {
|
|
891
|
-
readonly role: "assistant" | "system" | "tool" | "user";
|
|
892
|
-
readonly content: string;
|
|
893
|
-
readonly toolCallId?: string | undefined;
|
|
894
|
-
readonly name?: string | undefined;
|
|
895
|
-
readonly toolCalls?: {
|
|
896
|
-
readonly id: string;
|
|
897
|
-
readonly name: string;
|
|
898
|
-
readonly arguments: Schema.Json;
|
|
899
|
-
}[] | undefined;
|
|
900
|
-
};
|
|
901
|
-
readonly usage?: {
|
|
902
|
-
readonly input: number;
|
|
903
|
-
readonly output: number;
|
|
904
|
-
} | undefined;
|
|
905
|
-
};
|
|
906
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
907
|
-
readonly type: "agent.message.received";
|
|
908
|
-
readonly payload: {
|
|
909
|
-
readonly message: {
|
|
910
|
-
readonly role: "assistant" | "system" | "tool" | "user";
|
|
911
|
-
readonly content: string;
|
|
912
|
-
readonly toolCallId?: string | undefined;
|
|
913
|
-
readonly name?: string | undefined;
|
|
914
|
-
readonly toolCalls?: {
|
|
915
|
-
readonly id: string;
|
|
916
|
-
readonly name: string;
|
|
917
|
-
readonly arguments: Schema.Json;
|
|
918
|
-
}[] | undefined;
|
|
919
|
-
};
|
|
920
|
-
};
|
|
921
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
922
|
-
readonly type: "agent.session.cancel.requested";
|
|
923
|
-
readonly payload: {};
|
|
924
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
925
|
-
readonly type: "agent.session.message.submitted";
|
|
926
|
-
readonly payload: {
|
|
927
|
-
readonly messageId: string;
|
|
928
|
-
readonly text: string;
|
|
929
|
-
readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
|
|
930
|
-
readonly activeChildThreadId?: string | undefined;
|
|
931
|
-
};
|
|
932
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
933
|
-
readonly type: "agent.session.steer.delivered";
|
|
934
|
-
readonly payload: {
|
|
935
|
-
readonly messageId: string;
|
|
936
|
-
readonly activeMessageId: string;
|
|
937
|
-
};
|
|
938
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
939
|
-
readonly type: "agent.session.turn.closed";
|
|
940
|
-
readonly payload: {
|
|
941
|
-
readonly messageId: string;
|
|
942
|
-
readonly status: "cancelled" | "completed" | "failed";
|
|
943
|
-
readonly error?: string | undefined;
|
|
944
|
-
};
|
|
945
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
946
|
-
readonly type: "agent.session.turn.started";
|
|
947
|
-
readonly payload: {
|
|
948
|
-
readonly messageId: string;
|
|
949
|
-
readonly childThreadId: string;
|
|
950
|
-
};
|
|
951
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
952
|
-
readonly type: "agent.spawn.requested";
|
|
953
|
-
readonly payload: {
|
|
954
|
-
readonly childThreadId: string;
|
|
955
|
-
readonly kind: string;
|
|
956
|
-
readonly definitionName: string;
|
|
957
|
-
readonly definitionVersion: string;
|
|
958
|
-
readonly toolCallId: string;
|
|
959
|
-
readonly input: Schema.Json;
|
|
960
|
-
readonly depth?: number | undefined;
|
|
961
|
-
};
|
|
962
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
963
|
-
readonly type: "agent.steered";
|
|
964
|
-
readonly payload: {
|
|
965
|
-
readonly turn: number;
|
|
966
|
-
readonly messageId?: string | undefined;
|
|
967
|
-
readonly message: {
|
|
968
|
-
readonly role: "assistant" | "system" | "tool" | "user";
|
|
969
|
-
readonly content: string;
|
|
970
|
-
readonly toolCallId?: string | undefined;
|
|
971
|
-
readonly name?: string | undefined;
|
|
972
|
-
readonly toolCalls?: {
|
|
973
|
-
readonly id: string;
|
|
974
|
-
readonly name: string;
|
|
975
|
-
readonly arguments: Schema.Json;
|
|
976
|
-
}[] | undefined;
|
|
977
|
-
};
|
|
978
|
-
readonly interrupt?: boolean | undefined;
|
|
979
|
-
};
|
|
980
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
981
|
-
readonly type: "agent.tool.result";
|
|
982
|
-
readonly payload: {
|
|
983
|
-
readonly turn: number;
|
|
984
|
-
readonly toolCallId: string;
|
|
985
|
-
readonly name: string;
|
|
986
|
-
readonly result: Schema.Json;
|
|
987
|
-
readonly error: string | null;
|
|
988
|
-
};
|
|
989
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
990
|
-
readonly type: "agent.tool_call.requested";
|
|
991
|
-
readonly payload: {
|
|
992
|
-
readonly turn: number;
|
|
993
|
-
readonly toolCall: {
|
|
994
|
-
readonly id: string;
|
|
995
|
-
readonly name: string;
|
|
996
|
-
readonly arguments: Schema.Json;
|
|
997
|
-
};
|
|
998
|
-
};
|
|
999
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
1000
|
-
readonly type: "agent.turn.settled";
|
|
1001
|
-
readonly payload: {
|
|
1002
|
-
readonly turn: number;
|
|
1003
|
-
};
|
|
1004
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
1005
|
-
readonly type: "agent.turn.started";
|
|
1006
|
-
readonly payload: {
|
|
1007
|
-
readonly turn: number;
|
|
1008
|
-
readonly messageCount?: number | undefined;
|
|
1009
|
-
};
|
|
1010
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
1011
|
-
readonly type: "agent.turn.stopped";
|
|
1012
|
-
readonly payload: {};
|
|
1013
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
1014
|
-
readonly type: "agent.turn.text_delta";
|
|
1015
|
-
readonly payload: {
|
|
1016
|
-
readonly turn: number;
|
|
1017
|
-
readonly delta: string;
|
|
1018
|
-
};
|
|
1019
|
-
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
1020
|
-
readonly type: "agent.turn.usage";
|
|
1021
|
-
readonly payload: {
|
|
1022
|
-
readonly turn: number;
|
|
1023
|
-
readonly input: number;
|
|
1024
|
-
readonly output: number;
|
|
1025
|
-
};
|
|
1026
1103
|
})>>;
|
|
1027
1104
|
export declare function readToolCall(value: JsonValue): ToolCall | null;
|