@swirls/looms 0.5.2 → 0.6.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.
Files changed (39) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/dist/agent/definitions.d.ts +0 -12
  3. package/dist/agent/effects.js +0 -24
  4. package/dist/agent/module.d.ts +507 -507
  5. package/dist/agent/projections.d.ts +5 -0
  6. package/dist/agent/projections.js +5 -0
  7. package/dist/approval/effects.d.ts +26 -26
  8. package/dist/client/client.d.ts +2 -0
  9. package/dist/client/client.js +13 -1
  10. package/dist/client/index.d.ts +1 -1
  11. package/dist/client/index.js +1 -1
  12. package/dist/cloudflare/queue-consumer.js +6 -1
  13. package/dist/core/blob-store.js +5 -1
  14. package/dist/core/definition-resolver.d.ts +16 -0
  15. package/dist/core/definition-resolver.js +23 -0
  16. package/dist/core/definition-version.d.ts +3 -0
  17. package/dist/core/definition-version.js +5 -0
  18. package/dist/core/effects.js +1 -1
  19. package/dist/core/module.d.ts +12 -3
  20. package/dist/core/module.js +18 -3
  21. package/dist/debugger/app/assets/{index-C31SnCuN.js → index-CUO1xyYW.js} +2 -2
  22. package/dist/debugger/app/assets/{routes-DPA3O5AF.js → routes-lt_6J025.js} +12 -12
  23. package/dist/debugger/app/index.html +1 -1
  24. package/dist/react/store.d.ts +1 -1
  25. package/dist/react/store.js +2 -1
  26. package/dist/runtime/cancellation.js +21 -0
  27. package/dist/runtime/dispatch-effect.js +4 -1
  28. package/dist/runtime/filesystem-blob-store.js +17 -8
  29. package/dist/runtime/repository.js +2 -1
  30. package/dist/runtime/server/routes/runs.js +6 -11
  31. package/dist/runtime/sse.d.ts +3 -1
  32. package/dist/runtime/sse.js +5 -2
  33. package/dist/runtime/types.d.ts +2 -1
  34. package/dist/runtime/wake-engine.js +16 -11
  35. package/dist/runtime/worker-effect-dispatch.d.ts +3 -1
  36. package/dist/runtime/worker-effect-dispatch.js +14 -5
  37. package/dist/testing/corpus-module.js +11 -2
  38. package/dist/workflow/threads.js +5 -8
  39. package/package.json +1 -1
@@ -235,248 +235,6 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
235
235
  readonly alreadyCompacted?: boolean | undefined;
236
236
  readonly consumedSteerMessageIds?: readonly string[] | undefined;
237
237
  }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
238
- readonly type: "agent.context.compacted";
239
- readonly payload: {
240
- readonly turn: number;
241
- readonly originalCount: number;
242
- readonly compactedCount: number;
243
- readonly summary?: string | undefined;
244
- readonly reason?: "manual" | "overflow" | "threshold" | undefined;
245
- readonly messages?: readonly {
246
- readonly role: "assistant" | "system" | "tool" | "user";
247
- readonly content: string;
248
- readonly toolCallId?: string | undefined;
249
- readonly name?: string | undefined;
250
- readonly toolCalls?: {
251
- readonly id: string;
252
- readonly name: string;
253
- readonly arguments: import("effect/Schema").Json;
254
- }[] | undefined;
255
- }[] | undefined;
256
- };
257
- }) | (Omit<EventInput, "payload" | "type"> & {
258
- readonly type: "agent.effects.requested";
259
- readonly payload: {
260
- readonly toolCallId: string;
261
- readonly effects: readonly ({
262
- readonly type: "runtime.spawn";
263
- readonly childThreadId: string;
264
- readonly kind: string;
265
- readonly definitionName: string;
266
- readonly definitionVersion: string;
267
- readonly input: import("effect/Schema").Json;
268
- } | {
269
- readonly type: "runtime.wait";
270
- readonly waitId: string;
271
- readonly on: {
272
- readonly type: string | readonly string[];
273
- readonly match?: import("effect/Schema").Json | undefined;
274
- } | {
275
- readonly timerAt: number;
276
- };
277
- readonly tag?: import("effect/Schema").Json | undefined;
278
- } | {
279
- readonly type: "runtime.emit";
280
- readonly event: {
281
- readonly type: string;
282
- readonly payload: import("effect/Schema").Json;
283
- readonly threadId?: string | null | undefined;
284
- readonly parentThreadId?: string | null | undefined;
285
- readonly causationId?: string | null | undefined;
286
- readonly correlationId?: string | null | undefined;
287
- readonly effectId?: string | null | undefined;
288
- readonly origin?: {
289
- readonly type: "thread";
290
- readonly threadId: string;
291
- } | {
292
- readonly type: "external";
293
- readonly actorId?: string | undefined;
294
- } | {
295
- readonly type: "system";
296
- } | {
297
- readonly type: "run";
298
- readonly runId: string;
299
- } | undefined;
300
- readonly ephemeral?: boolean | undefined;
301
- readonly id?: string | undefined;
302
- readonly ts?: number | undefined;
303
- readonly idempotencyKey?: string | null | undefined;
304
- };
305
- readonly tag?: string | undefined;
306
- } | {
307
- readonly type: "runtime.complete";
308
- readonly output: import("effect/Schema").Json;
309
- } | {
310
- readonly type: "runtime.fail";
311
- readonly error: string;
312
- } | {
313
- readonly type: "runtime.cancel";
314
- readonly threadId: string;
315
- readonly tag?: string | undefined;
316
- } | {
317
- readonly type: "runtime.launch";
318
- readonly runId: string;
319
- readonly kind: string;
320
- readonly definitionName: string;
321
- readonly definitionVersion: string;
322
- readonly input: import("effect/Schema").Json;
323
- readonly close: "terminate" | "wait";
324
- readonly tag?: string | undefined;
325
- } | {
326
- readonly type: "runtime.cancelRun";
327
- readonly runId: string;
328
- readonly tag?: string | undefined;
329
- } | {
330
- readonly type: string;
331
- readonly input: import("effect/Schema").Json;
332
- readonly tag?: string | undefined;
333
- readonly at?: number | undefined;
334
- })[];
335
- readonly waitOn?: {
336
- readonly type: string | readonly string[];
337
- readonly match?: import("effect/Schema").Json | undefined;
338
- } | undefined;
339
- };
340
- }) | (Omit<EventInput, "payload" | "type"> & {
341
- readonly type: "agent.lineage";
342
- readonly payload: {
343
- readonly depth: number;
344
- };
345
- }) | (Omit<EventInput, "payload" | "type"> & {
346
- readonly type: "agent.message";
347
- readonly payload: {
348
- readonly turn: number;
349
- readonly message: {
350
- readonly role: "assistant" | "system" | "tool" | "user";
351
- readonly content: string;
352
- readonly toolCallId?: string | undefined;
353
- readonly name?: string | undefined;
354
- readonly toolCalls?: {
355
- readonly id: string;
356
- readonly name: string;
357
- readonly arguments: import("effect/Schema").Json;
358
- }[] | undefined;
359
- };
360
- readonly usage?: {
361
- readonly input: number;
362
- readonly output: number;
363
- } | undefined;
364
- };
365
- }) | (Omit<EventInput, "payload" | "type"> & {
366
- readonly type: "agent.message.received";
367
- readonly payload: {
368
- readonly message: {
369
- readonly role: "assistant" | "system" | "tool" | "user";
370
- readonly content: string;
371
- readonly toolCallId?: string | undefined;
372
- readonly name?: string | undefined;
373
- readonly toolCalls?: {
374
- readonly id: string;
375
- readonly name: string;
376
- readonly arguments: import("effect/Schema").Json;
377
- }[] | undefined;
378
- };
379
- };
380
- }) | (Omit<EventInput, "payload" | "type"> & {
381
- readonly type: "agent.session.cancel.requested";
382
- readonly payload: {};
383
- }) | (Omit<EventInput, "payload" | "type"> & {
384
- readonly type: "agent.session.message.submitted";
385
- readonly payload: {
386
- readonly messageId: string;
387
- readonly text: string;
388
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
389
- readonly activeChildThreadId?: string | undefined;
390
- };
391
- }) | (Omit<EventInput, "payload" | "type"> & {
392
- readonly type: "agent.session.steer.delivered";
393
- readonly payload: {
394
- readonly messageId: string;
395
- readonly activeMessageId: string;
396
- };
397
- }) | (Omit<EventInput, "payload" | "type"> & {
398
- readonly type: "agent.session.turn.closed";
399
- readonly payload: {
400
- readonly messageId: string;
401
- readonly status: "cancelled" | "completed" | "failed";
402
- readonly error?: string | undefined;
403
- };
404
- }) | (Omit<EventInput, "payload" | "type"> & {
405
- readonly type: "agent.session.turn.started";
406
- readonly payload: {
407
- readonly messageId: string;
408
- readonly childThreadId: string;
409
- };
410
- }) | (Omit<EventInput, "payload" | "type"> & {
411
- readonly type: "agent.spawn.requested";
412
- readonly payload: {
413
- readonly childThreadId: string;
414
- readonly kind: string;
415
- readonly definitionName: string;
416
- readonly definitionVersion: string;
417
- readonly toolCallId: string;
418
- readonly input: import("effect/Schema").Json;
419
- readonly depth?: number | undefined;
420
- };
421
- }) | (Omit<EventInput, "payload" | "type"> & {
422
- readonly type: "agent.steered";
423
- readonly payload: {
424
- readonly turn: number;
425
- readonly messageId?: string | undefined;
426
- readonly message: {
427
- readonly role: "assistant" | "system" | "tool" | "user";
428
- readonly content: string;
429
- readonly toolCallId?: string | undefined;
430
- readonly name?: string | undefined;
431
- readonly toolCalls?: {
432
- readonly id: string;
433
- readonly name: string;
434
- readonly arguments: import("effect/Schema").Json;
435
- }[] | undefined;
436
- };
437
- readonly interrupt?: boolean | undefined;
438
- };
439
- }) | (Omit<EventInput, "payload" | "type"> & {
440
- readonly type: "agent.tool.result";
441
- readonly payload: {
442
- readonly turn: number;
443
- readonly toolCallId: string;
444
- readonly name: string;
445
- readonly result: import("effect/Schema").Json;
446
- readonly error: string | null;
447
- };
448
- }) | (Omit<EventInput, "payload" | "type"> & {
449
- readonly type: "agent.tool_call.requested";
450
- readonly payload: {
451
- readonly turn: number;
452
- readonly toolCall: {
453
- readonly id: string;
454
- readonly name: string;
455
- readonly arguments: import("effect/Schema").Json;
456
- };
457
- };
458
- }) | (Omit<EventInput, "payload" | "type"> & {
459
- readonly type: "agent.turn.started";
460
- readonly payload: {
461
- readonly turn: number;
462
- };
463
- }) | (Omit<EventInput, "payload" | "type"> & {
464
- readonly type: "agent.turn.stopped";
465
- readonly payload: {};
466
- }) | (Omit<EventInput, "payload" | "type"> & {
467
- readonly type: "agent.turn.text_delta";
468
- readonly payload: {
469
- readonly turn: number;
470
- readonly delta: string;
471
- };
472
- }) | (Omit<EventInput, "payload" | "type"> & {
473
- readonly type: "agent.turn.usage";
474
- readonly payload: {
475
- readonly turn: number;
476
- readonly input: number;
477
- readonly output: number;
478
- };
479
- }) | (Omit<EventInput, "payload" | "type"> & {
480
238
  readonly type: "runtime.child.close.requested";
481
239
  readonly payload: {
482
240
  readonly policy: "terminate" | "wait";
@@ -713,19 +471,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
713
471
  readonly payload: import("effect/Schema").Json;
714
472
  };
715
473
  };
716
- })>;
717
- executeTool: import("@swirls/looms/core").EffectDefinition<{
718
- readonly turn: number;
719
- readonly definitionName?: string | undefined;
720
- readonly definitionVersion: string;
721
- readonly toolCall: {
722
- readonly id: string;
723
- readonly name: string;
724
- readonly arguments: import("effect/Schema").Json;
725
- };
726
- readonly input?: import("effect/Schema").Json | undefined;
727
- readonly depth?: number | undefined;
728
- }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
474
+ }) | (Omit<EventInput, "payload" | "type"> & {
729
475
  readonly type: "agent.context.compacted";
730
476
  readonly payload: {
731
477
  readonly turn: number;
@@ -967,7 +713,19 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
967
713
  readonly input: number;
968
714
  readonly output: number;
969
715
  };
970
- }) | (Omit<EventInput, "payload" | "type"> & {
716
+ })>;
717
+ executeTool: import("@swirls/looms/core").EffectDefinition<{
718
+ readonly turn: number;
719
+ readonly definitionName?: string | undefined;
720
+ readonly definitionVersion: string;
721
+ readonly toolCall: {
722
+ readonly id: string;
723
+ readonly name: string;
724
+ readonly arguments: import("effect/Schema").Json;
725
+ };
726
+ readonly input?: import("effect/Schema").Json | undefined;
727
+ readonly depth?: number | undefined;
728
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
971
729
  readonly type: "runtime.child.close.requested";
972
730
  readonly payload: {
973
731
  readonly policy: "terminate" | "wait";
@@ -1204,6 +962,248 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1204
962
  readonly payload: import("effect/Schema").Json;
1205
963
  };
1206
964
  };
965
+ }) | (Omit<EventInput, "payload" | "type"> & {
966
+ readonly type: "agent.context.compacted";
967
+ readonly payload: {
968
+ readonly turn: number;
969
+ readonly originalCount: number;
970
+ readonly compactedCount: number;
971
+ readonly summary?: string | undefined;
972
+ readonly reason?: "manual" | "overflow" | "threshold" | undefined;
973
+ readonly messages?: readonly {
974
+ readonly role: "assistant" | "system" | "tool" | "user";
975
+ readonly content: string;
976
+ readonly toolCallId?: string | undefined;
977
+ readonly name?: string | undefined;
978
+ readonly toolCalls?: {
979
+ readonly id: string;
980
+ readonly name: string;
981
+ readonly arguments: import("effect/Schema").Json;
982
+ }[] | undefined;
983
+ }[] | undefined;
984
+ };
985
+ }) | (Omit<EventInput, "payload" | "type"> & {
986
+ readonly type: "agent.effects.requested";
987
+ readonly payload: {
988
+ readonly toolCallId: string;
989
+ readonly effects: readonly ({
990
+ readonly type: "runtime.spawn";
991
+ readonly childThreadId: string;
992
+ readonly kind: string;
993
+ readonly definitionName: string;
994
+ readonly definitionVersion: string;
995
+ readonly input: import("effect/Schema").Json;
996
+ } | {
997
+ readonly type: "runtime.wait";
998
+ readonly waitId: string;
999
+ readonly on: {
1000
+ readonly type: string | readonly string[];
1001
+ readonly match?: import("effect/Schema").Json | undefined;
1002
+ } | {
1003
+ readonly timerAt: number;
1004
+ };
1005
+ readonly tag?: import("effect/Schema").Json | undefined;
1006
+ } | {
1007
+ readonly type: "runtime.emit";
1008
+ readonly event: {
1009
+ readonly type: string;
1010
+ readonly payload: import("effect/Schema").Json;
1011
+ readonly threadId?: string | null | undefined;
1012
+ readonly parentThreadId?: string | null | undefined;
1013
+ readonly causationId?: string | null | undefined;
1014
+ readonly correlationId?: string | null | undefined;
1015
+ readonly effectId?: string | null | undefined;
1016
+ readonly origin?: {
1017
+ readonly type: "thread";
1018
+ readonly threadId: string;
1019
+ } | {
1020
+ readonly type: "external";
1021
+ readonly actorId?: string | undefined;
1022
+ } | {
1023
+ readonly type: "system";
1024
+ } | {
1025
+ readonly type: "run";
1026
+ readonly runId: string;
1027
+ } | undefined;
1028
+ readonly ephemeral?: boolean | undefined;
1029
+ readonly id?: string | undefined;
1030
+ readonly ts?: number | undefined;
1031
+ readonly idempotencyKey?: string | null | undefined;
1032
+ };
1033
+ readonly tag?: string | undefined;
1034
+ } | {
1035
+ readonly type: "runtime.complete";
1036
+ readonly output: import("effect/Schema").Json;
1037
+ } | {
1038
+ readonly type: "runtime.fail";
1039
+ readonly error: string;
1040
+ } | {
1041
+ readonly type: "runtime.cancel";
1042
+ readonly threadId: string;
1043
+ readonly tag?: string | undefined;
1044
+ } | {
1045
+ readonly type: "runtime.launch";
1046
+ readonly runId: string;
1047
+ readonly kind: string;
1048
+ readonly definitionName: string;
1049
+ readonly definitionVersion: string;
1050
+ readonly input: import("effect/Schema").Json;
1051
+ readonly close: "terminate" | "wait";
1052
+ readonly tag?: string | undefined;
1053
+ } | {
1054
+ readonly type: "runtime.cancelRun";
1055
+ readonly runId: string;
1056
+ readonly tag?: string | undefined;
1057
+ } | {
1058
+ readonly type: string;
1059
+ readonly input: import("effect/Schema").Json;
1060
+ readonly tag?: string | undefined;
1061
+ readonly at?: number | undefined;
1062
+ })[];
1063
+ readonly waitOn?: {
1064
+ readonly type: string | readonly string[];
1065
+ readonly match?: import("effect/Schema").Json | undefined;
1066
+ } | undefined;
1067
+ };
1068
+ }) | (Omit<EventInput, "payload" | "type"> & {
1069
+ readonly type: "agent.lineage";
1070
+ readonly payload: {
1071
+ readonly depth: number;
1072
+ };
1073
+ }) | (Omit<EventInput, "payload" | "type"> & {
1074
+ readonly type: "agent.message";
1075
+ readonly payload: {
1076
+ readonly turn: number;
1077
+ readonly message: {
1078
+ readonly role: "assistant" | "system" | "tool" | "user";
1079
+ readonly content: string;
1080
+ readonly toolCallId?: string | undefined;
1081
+ readonly name?: string | undefined;
1082
+ readonly toolCalls?: {
1083
+ readonly id: string;
1084
+ readonly name: string;
1085
+ readonly arguments: import("effect/Schema").Json;
1086
+ }[] | undefined;
1087
+ };
1088
+ readonly usage?: {
1089
+ readonly input: number;
1090
+ readonly output: number;
1091
+ } | undefined;
1092
+ };
1093
+ }) | (Omit<EventInput, "payload" | "type"> & {
1094
+ readonly type: "agent.message.received";
1095
+ readonly payload: {
1096
+ readonly message: {
1097
+ readonly role: "assistant" | "system" | "tool" | "user";
1098
+ readonly content: string;
1099
+ readonly toolCallId?: string | undefined;
1100
+ readonly name?: string | undefined;
1101
+ readonly toolCalls?: {
1102
+ readonly id: string;
1103
+ readonly name: string;
1104
+ readonly arguments: import("effect/Schema").Json;
1105
+ }[] | undefined;
1106
+ };
1107
+ };
1108
+ }) | (Omit<EventInput, "payload" | "type"> & {
1109
+ readonly type: "agent.session.cancel.requested";
1110
+ readonly payload: {};
1111
+ }) | (Omit<EventInput, "payload" | "type"> & {
1112
+ readonly type: "agent.session.message.submitted";
1113
+ readonly payload: {
1114
+ readonly messageId: string;
1115
+ readonly text: string;
1116
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1117
+ readonly activeChildThreadId?: string | undefined;
1118
+ };
1119
+ }) | (Omit<EventInput, "payload" | "type"> & {
1120
+ readonly type: "agent.session.steer.delivered";
1121
+ readonly payload: {
1122
+ readonly messageId: string;
1123
+ readonly activeMessageId: string;
1124
+ };
1125
+ }) | (Omit<EventInput, "payload" | "type"> & {
1126
+ readonly type: "agent.session.turn.closed";
1127
+ readonly payload: {
1128
+ readonly messageId: string;
1129
+ readonly status: "cancelled" | "completed" | "failed";
1130
+ readonly error?: string | undefined;
1131
+ };
1132
+ }) | (Omit<EventInput, "payload" | "type"> & {
1133
+ readonly type: "agent.session.turn.started";
1134
+ readonly payload: {
1135
+ readonly messageId: string;
1136
+ readonly childThreadId: string;
1137
+ };
1138
+ }) | (Omit<EventInput, "payload" | "type"> & {
1139
+ readonly type: "agent.spawn.requested";
1140
+ readonly payload: {
1141
+ readonly childThreadId: string;
1142
+ readonly kind: string;
1143
+ readonly definitionName: string;
1144
+ readonly definitionVersion: string;
1145
+ readonly toolCallId: string;
1146
+ readonly input: import("effect/Schema").Json;
1147
+ readonly depth?: number | undefined;
1148
+ };
1149
+ }) | (Omit<EventInput, "payload" | "type"> & {
1150
+ readonly type: "agent.steered";
1151
+ readonly payload: {
1152
+ readonly turn: number;
1153
+ readonly messageId?: string | undefined;
1154
+ readonly message: {
1155
+ readonly role: "assistant" | "system" | "tool" | "user";
1156
+ readonly content: string;
1157
+ readonly toolCallId?: string | undefined;
1158
+ readonly name?: string | undefined;
1159
+ readonly toolCalls?: {
1160
+ readonly id: string;
1161
+ readonly name: string;
1162
+ readonly arguments: import("effect/Schema").Json;
1163
+ }[] | undefined;
1164
+ };
1165
+ readonly interrupt?: boolean | undefined;
1166
+ };
1167
+ }) | (Omit<EventInput, "payload" | "type"> & {
1168
+ readonly type: "agent.tool.result";
1169
+ readonly payload: {
1170
+ readonly turn: number;
1171
+ readonly toolCallId: string;
1172
+ readonly name: string;
1173
+ readonly result: import("effect/Schema").Json;
1174
+ readonly error: string | null;
1175
+ };
1176
+ }) | (Omit<EventInput, "payload" | "type"> & {
1177
+ readonly type: "agent.tool_call.requested";
1178
+ readonly payload: {
1179
+ readonly turn: number;
1180
+ readonly toolCall: {
1181
+ readonly id: string;
1182
+ readonly name: string;
1183
+ readonly arguments: import("effect/Schema").Json;
1184
+ };
1185
+ };
1186
+ }) | (Omit<EventInput, "payload" | "type"> & {
1187
+ readonly type: "agent.turn.started";
1188
+ readonly payload: {
1189
+ readonly turn: number;
1190
+ };
1191
+ }) | (Omit<EventInput, "payload" | "type"> & {
1192
+ readonly type: "agent.turn.stopped";
1193
+ readonly payload: {};
1194
+ }) | (Omit<EventInput, "payload" | "type"> & {
1195
+ readonly type: "agent.turn.text_delta";
1196
+ readonly payload: {
1197
+ readonly turn: number;
1198
+ readonly delta: string;
1199
+ };
1200
+ }) | (Omit<EventInput, "payload" | "type"> & {
1201
+ readonly type: "agent.turn.usage";
1202
+ readonly payload: {
1203
+ readonly turn: number;
1204
+ readonly input: number;
1205
+ readonly output: number;
1206
+ };
1207
1207
  })>;
1208
1208
  }, {
1209
1209
  agent: import("@swirls/looms/core").ThreadDefinition<import("./types").AgentState>;
@@ -1252,6 +1252,243 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1252
1252
  readonly alreadyCompacted?: boolean | undefined;
1253
1253
  readonly consumedSteerMessageIds?: readonly string[] | undefined;
1254
1254
  }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
1255
+ readonly type: "runtime.child.close.requested";
1256
+ readonly payload: {
1257
+ readonly policy: "terminate" | "wait";
1258
+ };
1259
+ }) | (Omit<EventInput, "payload" | "type"> & {
1260
+ readonly type: "runtime.child.settled";
1261
+ readonly payload: {
1262
+ readonly runId: string;
1263
+ readonly status: "cancelled" | "completed" | "failed";
1264
+ readonly output: import("effect/Schema").Json;
1265
+ readonly error: string | null;
1266
+ };
1267
+ }) | (Omit<EventInput, "payload" | "type"> & {
1268
+ readonly type: "runtime.effect.ambiguous";
1269
+ readonly payload: {
1270
+ readonly effectId: string;
1271
+ readonly attempt: number;
1272
+ readonly error: string;
1273
+ };
1274
+ }) | (Omit<EventInput, "payload" | "type"> & {
1275
+ readonly type: "runtime.effect.attempt.started";
1276
+ readonly payload: {
1277
+ readonly effectId: string;
1278
+ readonly attempt: number;
1279
+ };
1280
+ }) | (Omit<EventInput, "payload" | "type"> & {
1281
+ readonly type: "runtime.effect.cancel.requested";
1282
+ readonly payload: {
1283
+ readonly effectId: string;
1284
+ readonly attempt: number;
1285
+ readonly deadlineAt: number | null;
1286
+ };
1287
+ }) | (Omit<EventInput, "payload" | "type"> & {
1288
+ readonly type: "runtime.effect.cancelled";
1289
+ readonly payload: {
1290
+ readonly effectId: string;
1291
+ readonly attempt: number;
1292
+ };
1293
+ }) | (Omit<EventInput, "payload" | "type"> & {
1294
+ readonly type: "runtime.effect.completed";
1295
+ readonly payload: {
1296
+ readonly effectId: string;
1297
+ readonly attempt: number;
1298
+ };
1299
+ }) | (Omit<EventInput, "payload" | "type"> & {
1300
+ readonly type: "runtime.effect.dispatched";
1301
+ readonly payload: {
1302
+ readonly effectId: string;
1303
+ readonly attempt: number;
1304
+ readonly deadlineAt: number | null;
1305
+ };
1306
+ }) | (Omit<EventInput, "payload" | "type"> & {
1307
+ readonly type: "runtime.effect.failed";
1308
+ readonly payload: {
1309
+ readonly effectId: string;
1310
+ readonly error: string;
1311
+ readonly nonRetryable?: boolean | undefined;
1312
+ readonly retryAfterMs?: number | undefined;
1313
+ };
1314
+ }) | (Omit<EventInput, "payload" | "type"> & {
1315
+ readonly type: "runtime.effect.heartbeat";
1316
+ readonly payload: {
1317
+ readonly effectId: string;
1318
+ readonly attempt: number;
1319
+ readonly heartbeatAt: number;
1320
+ readonly deadlineAt: number | null;
1321
+ readonly details?: import("effect/Schema").Json | undefined;
1322
+ };
1323
+ }) | (Omit<EventInput, "payload" | "type"> & {
1324
+ readonly type: "runtime.effect.queued";
1325
+ readonly payload: {
1326
+ readonly effectId: string;
1327
+ readonly attempt: number;
1328
+ readonly deadlineAt: number | null;
1329
+ };
1330
+ }) | (Omit<EventInput, "payload" | "type"> & {
1331
+ readonly type: "runtime.effect.retry.scheduled";
1332
+ readonly payload: {
1333
+ readonly effectId: string;
1334
+ readonly attempt: number;
1335
+ readonly nextAttemptAt: number;
1336
+ readonly error: string;
1337
+ };
1338
+ }) | (Omit<EventInput, "payload" | "type"> & {
1339
+ readonly type: "runtime.effect.timed_out";
1340
+ readonly payload: {
1341
+ readonly effectId: string;
1342
+ readonly attempt: number;
1343
+ readonly timeout: string;
1344
+ };
1345
+ }) | (Omit<EventInput, "payload" | "type"> & {
1346
+ readonly type: "runtime.effect.worker.started";
1347
+ readonly payload: {
1348
+ readonly effectId: string;
1349
+ readonly attempt: number;
1350
+ readonly deadlineAt: number | null;
1351
+ };
1352
+ }) | (Omit<EventInput, "payload" | "type"> & {
1353
+ readonly type: "runtime.fork.elided";
1354
+ readonly payload: {
1355
+ readonly type: string;
1356
+ };
1357
+ }) | (Omit<EventInput, "payload" | "type"> & {
1358
+ readonly type: "runtime.run.cancelled";
1359
+ readonly payload: {
1360
+ readonly reason?: string | undefined;
1361
+ };
1362
+ }) | (Omit<EventInput, "payload" | "type"> & {
1363
+ readonly type: "runtime.run.completed";
1364
+ readonly payload: {
1365
+ readonly output: import("effect/Schema").Json;
1366
+ readonly error: string | null;
1367
+ };
1368
+ }) | (Omit<EventInput, "payload" | "type"> & {
1369
+ readonly type: "runtime.run.forked";
1370
+ readonly payload: {
1371
+ readonly sourceRunId: string;
1372
+ readonly sourceSeq: number;
1373
+ };
1374
+ }) | (Omit<EventInput, "payload" | "type"> & {
1375
+ readonly type: "runtime.run.launched";
1376
+ readonly payload: {
1377
+ readonly runId: string;
1378
+ readonly kind: string;
1379
+ readonly definitionName: string;
1380
+ readonly definitionVersion: string;
1381
+ readonly effectId: string;
1382
+ readonly close: "terminate" | "wait";
1383
+ };
1384
+ }) | (Omit<EventInput, "payload" | "type"> & {
1385
+ readonly type: "runtime.run.started";
1386
+ readonly payload: {
1387
+ readonly rootThreadId?: string | undefined;
1388
+ readonly kind: string;
1389
+ readonly definitionName: string;
1390
+ readonly definitionVersion: string;
1391
+ readonly input: import("effect/Schema").Json;
1392
+ readonly requestedThreadId?: string | null | undefined;
1393
+ readonly launchedBy?: {
1394
+ readonly runId: string;
1395
+ readonly threadId: string;
1396
+ readonly effectId: string;
1397
+ readonly causationId: string;
1398
+ readonly causationSeq: number;
1399
+ } | undefined;
1400
+ readonly attributes?: {
1401
+ readonly [x: string]: string;
1402
+ } | undefined;
1403
+ readonly trace?: {
1404
+ readonly traceparent: string;
1405
+ readonly tracestate?: string | undefined;
1406
+ } | undefined;
1407
+ };
1408
+ }) | (Omit<EventInput, "payload" | "type"> & {
1409
+ readonly type: "runtime.signal.received";
1410
+ readonly payload: {
1411
+ readonly signalType: string;
1412
+ };
1413
+ }) | (Omit<EventInput, "payload" | "type"> & {
1414
+ readonly type: "runtime.snapshot.taken";
1415
+ readonly payload: {
1416
+ readonly seq: number;
1417
+ readonly stateHash: string;
1418
+ readonly state?: import("effect/Schema").Json | undefined;
1419
+ };
1420
+ }) | (Omit<EventInput, "payload" | "type"> & {
1421
+ readonly type: "runtime.thread.cancel.requested";
1422
+ readonly payload: {
1423
+ readonly threadId: string;
1424
+ };
1425
+ }) | (Omit<EventInput, "payload" | "type"> & {
1426
+ readonly type: "runtime.thread.cancelled";
1427
+ readonly payload: {
1428
+ readonly threadId: string;
1429
+ readonly reason?: string | undefined;
1430
+ readonly resumeSeq?: number | undefined;
1431
+ };
1432
+ }) | (Omit<EventInput, "payload" | "type"> & {
1433
+ readonly type: "runtime.thread.completed";
1434
+ readonly payload: {
1435
+ readonly threadId: string;
1436
+ readonly output: import("effect/Schema").Json;
1437
+ };
1438
+ }) | (Omit<EventInput, "payload" | "type"> & {
1439
+ readonly type: "runtime.thread.failed";
1440
+ readonly payload: {
1441
+ readonly threadId: string;
1442
+ readonly error: string;
1443
+ };
1444
+ }) | (Omit<EventInput, "payload" | "type"> & {
1445
+ readonly type: "runtime.thread.started";
1446
+ readonly payload: {
1447
+ readonly threadId: string;
1448
+ readonly kind: string;
1449
+ readonly definitionName: string;
1450
+ readonly definitionVersion: string;
1451
+ readonly input: import("effect/Schema").Json;
1452
+ readonly parentThreadId: string | null;
1453
+ };
1454
+ }) | (Omit<EventInput, "payload" | "type"> & {
1455
+ readonly type: "runtime.timer.fired";
1456
+ readonly payload: {
1457
+ readonly timerId: string;
1458
+ readonly waitId: string;
1459
+ };
1460
+ }) | (Omit<EventInput, "payload" | "type"> & {
1461
+ readonly type: "runtime.timer.set";
1462
+ readonly payload: {
1463
+ readonly timerId: string;
1464
+ readonly waitId: string;
1465
+ readonly wakeAt: number;
1466
+ };
1467
+ }) | (Omit<EventInput, "payload" | "type"> & {
1468
+ readonly type: "runtime.wait.registered";
1469
+ readonly payload: {
1470
+ readonly waitId: string;
1471
+ readonly threadId?: string | undefined;
1472
+ readonly on: {
1473
+ readonly type: string | readonly string[];
1474
+ readonly match?: import("effect/Schema").Json | undefined;
1475
+ } | {
1476
+ readonly timerAt: number;
1477
+ };
1478
+ readonly tag?: import("effect/Schema").Json | undefined;
1479
+ };
1480
+ }) | (Omit<EventInput, "payload" | "type"> & {
1481
+ readonly type: "runtime.wait.satisfied";
1482
+ readonly payload: {
1483
+ readonly waitId: string;
1484
+ readonly tag?: import("effect/Schema").Json | undefined;
1485
+ readonly event: {
1486
+ readonly id: string;
1487
+ readonly type: string;
1488
+ readonly payload: import("effect/Schema").Json;
1489
+ };
1490
+ };
1491
+ }) | (Omit<EventInput, "payload" | "type"> & {
1255
1492
  readonly type: "agent.context.compacted";
1256
1493
  readonly payload: {
1257
1494
  readonly turn: number;
@@ -1493,7 +1730,19 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1493
1730
  readonly input: number;
1494
1731
  readonly output: number;
1495
1732
  };
1496
- }) | (Omit<EventInput, "payload" | "type"> & {
1733
+ })>;
1734
+ executeTool: import("@swirls/looms/core").EffectDefinition<{
1735
+ readonly turn: number;
1736
+ readonly definitionName?: string | undefined;
1737
+ readonly definitionVersion: string;
1738
+ readonly toolCall: {
1739
+ readonly id: string;
1740
+ readonly name: string;
1741
+ readonly arguments: import("effect/Schema").Json;
1742
+ };
1743
+ readonly input?: import("effect/Schema").Json | undefined;
1744
+ readonly depth?: number | undefined;
1745
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
1497
1746
  readonly type: "runtime.child.close.requested";
1498
1747
  readonly payload: {
1499
1748
  readonly policy: "terminate" | "wait";
@@ -1730,19 +1979,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1730
1979
  readonly payload: import("effect/Schema").Json;
1731
1980
  };
1732
1981
  };
1733
- })>;
1734
- executeTool: import("@swirls/looms/core").EffectDefinition<{
1735
- readonly turn: number;
1736
- readonly definitionName?: string | undefined;
1737
- readonly definitionVersion: string;
1738
- readonly toolCall: {
1739
- readonly id: string;
1740
- readonly name: string;
1741
- readonly arguments: import("effect/Schema").Json;
1742
- };
1743
- readonly input?: import("effect/Schema").Json | undefined;
1744
- readonly depth?: number | undefined;
1745
- }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
1982
+ }) | (Omit<EventInput, "payload" | "type"> & {
1746
1983
  readonly type: "agent.context.compacted";
1747
1984
  readonly payload: {
1748
1985
  readonly turn: number;
@@ -1984,243 +2221,6 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1984
2221
  readonly input: number;
1985
2222
  readonly output: number;
1986
2223
  };
1987
- }) | (Omit<EventInput, "payload" | "type"> & {
1988
- readonly type: "runtime.child.close.requested";
1989
- readonly payload: {
1990
- readonly policy: "terminate" | "wait";
1991
- };
1992
- }) | (Omit<EventInput, "payload" | "type"> & {
1993
- readonly type: "runtime.child.settled";
1994
- readonly payload: {
1995
- readonly runId: string;
1996
- readonly status: "cancelled" | "completed" | "failed";
1997
- readonly output: import("effect/Schema").Json;
1998
- readonly error: string | null;
1999
- };
2000
- }) | (Omit<EventInput, "payload" | "type"> & {
2001
- readonly type: "runtime.effect.ambiguous";
2002
- readonly payload: {
2003
- readonly effectId: string;
2004
- readonly attempt: number;
2005
- readonly error: string;
2006
- };
2007
- }) | (Omit<EventInput, "payload" | "type"> & {
2008
- readonly type: "runtime.effect.attempt.started";
2009
- readonly payload: {
2010
- readonly effectId: string;
2011
- readonly attempt: number;
2012
- };
2013
- }) | (Omit<EventInput, "payload" | "type"> & {
2014
- readonly type: "runtime.effect.cancel.requested";
2015
- readonly payload: {
2016
- readonly effectId: string;
2017
- readonly attempt: number;
2018
- readonly deadlineAt: number | null;
2019
- };
2020
- }) | (Omit<EventInput, "payload" | "type"> & {
2021
- readonly type: "runtime.effect.cancelled";
2022
- readonly payload: {
2023
- readonly effectId: string;
2024
- readonly attempt: number;
2025
- };
2026
- }) | (Omit<EventInput, "payload" | "type"> & {
2027
- readonly type: "runtime.effect.completed";
2028
- readonly payload: {
2029
- readonly effectId: string;
2030
- readonly attempt: number;
2031
- };
2032
- }) | (Omit<EventInput, "payload" | "type"> & {
2033
- readonly type: "runtime.effect.dispatched";
2034
- readonly payload: {
2035
- readonly effectId: string;
2036
- readonly attempt: number;
2037
- readonly deadlineAt: number | null;
2038
- };
2039
- }) | (Omit<EventInput, "payload" | "type"> & {
2040
- readonly type: "runtime.effect.failed";
2041
- readonly payload: {
2042
- readonly effectId: string;
2043
- readonly error: string;
2044
- readonly nonRetryable?: boolean | undefined;
2045
- readonly retryAfterMs?: number | undefined;
2046
- };
2047
- }) | (Omit<EventInput, "payload" | "type"> & {
2048
- readonly type: "runtime.effect.heartbeat";
2049
- readonly payload: {
2050
- readonly effectId: string;
2051
- readonly attempt: number;
2052
- readonly heartbeatAt: number;
2053
- readonly deadlineAt: number | null;
2054
- readonly details?: import("effect/Schema").Json | undefined;
2055
- };
2056
- }) | (Omit<EventInput, "payload" | "type"> & {
2057
- readonly type: "runtime.effect.queued";
2058
- readonly payload: {
2059
- readonly effectId: string;
2060
- readonly attempt: number;
2061
- readonly deadlineAt: number | null;
2062
- };
2063
- }) | (Omit<EventInput, "payload" | "type"> & {
2064
- readonly type: "runtime.effect.retry.scheduled";
2065
- readonly payload: {
2066
- readonly effectId: string;
2067
- readonly attempt: number;
2068
- readonly nextAttemptAt: number;
2069
- readonly error: string;
2070
- };
2071
- }) | (Omit<EventInput, "payload" | "type"> & {
2072
- readonly type: "runtime.effect.timed_out";
2073
- readonly payload: {
2074
- readonly effectId: string;
2075
- readonly attempt: number;
2076
- readonly timeout: string;
2077
- };
2078
- }) | (Omit<EventInput, "payload" | "type"> & {
2079
- readonly type: "runtime.effect.worker.started";
2080
- readonly payload: {
2081
- readonly effectId: string;
2082
- readonly attempt: number;
2083
- readonly deadlineAt: number | null;
2084
- };
2085
- }) | (Omit<EventInput, "payload" | "type"> & {
2086
- readonly type: "runtime.fork.elided";
2087
- readonly payload: {
2088
- readonly type: string;
2089
- };
2090
- }) | (Omit<EventInput, "payload" | "type"> & {
2091
- readonly type: "runtime.run.cancelled";
2092
- readonly payload: {
2093
- readonly reason?: string | undefined;
2094
- };
2095
- }) | (Omit<EventInput, "payload" | "type"> & {
2096
- readonly type: "runtime.run.completed";
2097
- readonly payload: {
2098
- readonly output: import("effect/Schema").Json;
2099
- readonly error: string | null;
2100
- };
2101
- }) | (Omit<EventInput, "payload" | "type"> & {
2102
- readonly type: "runtime.run.forked";
2103
- readonly payload: {
2104
- readonly sourceRunId: string;
2105
- readonly sourceSeq: number;
2106
- };
2107
- }) | (Omit<EventInput, "payload" | "type"> & {
2108
- readonly type: "runtime.run.launched";
2109
- readonly payload: {
2110
- readonly runId: string;
2111
- readonly kind: string;
2112
- readonly definitionName: string;
2113
- readonly definitionVersion: string;
2114
- readonly effectId: string;
2115
- readonly close: "terminate" | "wait";
2116
- };
2117
- }) | (Omit<EventInput, "payload" | "type"> & {
2118
- readonly type: "runtime.run.started";
2119
- readonly payload: {
2120
- readonly rootThreadId?: string | undefined;
2121
- readonly kind: string;
2122
- readonly definitionName: string;
2123
- readonly definitionVersion: string;
2124
- readonly input: import("effect/Schema").Json;
2125
- readonly requestedThreadId?: string | null | undefined;
2126
- readonly launchedBy?: {
2127
- readonly runId: string;
2128
- readonly threadId: string;
2129
- readonly effectId: string;
2130
- readonly causationId: string;
2131
- readonly causationSeq: number;
2132
- } | undefined;
2133
- readonly attributes?: {
2134
- readonly [x: string]: string;
2135
- } | undefined;
2136
- readonly trace?: {
2137
- readonly traceparent: string;
2138
- readonly tracestate?: string | undefined;
2139
- } | undefined;
2140
- };
2141
- }) | (Omit<EventInput, "payload" | "type"> & {
2142
- readonly type: "runtime.signal.received";
2143
- readonly payload: {
2144
- readonly signalType: string;
2145
- };
2146
- }) | (Omit<EventInput, "payload" | "type"> & {
2147
- readonly type: "runtime.snapshot.taken";
2148
- readonly payload: {
2149
- readonly seq: number;
2150
- readonly stateHash: string;
2151
- readonly state?: import("effect/Schema").Json | undefined;
2152
- };
2153
- }) | (Omit<EventInput, "payload" | "type"> & {
2154
- readonly type: "runtime.thread.cancel.requested";
2155
- readonly payload: {
2156
- readonly threadId: string;
2157
- };
2158
- }) | (Omit<EventInput, "payload" | "type"> & {
2159
- readonly type: "runtime.thread.cancelled";
2160
- readonly payload: {
2161
- readonly threadId: string;
2162
- readonly reason?: string | undefined;
2163
- readonly resumeSeq?: number | undefined;
2164
- };
2165
- }) | (Omit<EventInput, "payload" | "type"> & {
2166
- readonly type: "runtime.thread.completed";
2167
- readonly payload: {
2168
- readonly threadId: string;
2169
- readonly output: import("effect/Schema").Json;
2170
- };
2171
- }) | (Omit<EventInput, "payload" | "type"> & {
2172
- readonly type: "runtime.thread.failed";
2173
- readonly payload: {
2174
- readonly threadId: string;
2175
- readonly error: string;
2176
- };
2177
- }) | (Omit<EventInput, "payload" | "type"> & {
2178
- readonly type: "runtime.thread.started";
2179
- readonly payload: {
2180
- readonly threadId: string;
2181
- readonly kind: string;
2182
- readonly definitionName: string;
2183
- readonly definitionVersion: string;
2184
- readonly input: import("effect/Schema").Json;
2185
- readonly parentThreadId: string | null;
2186
- };
2187
- }) | (Omit<EventInput, "payload" | "type"> & {
2188
- readonly type: "runtime.timer.fired";
2189
- readonly payload: {
2190
- readonly timerId: string;
2191
- readonly waitId: string;
2192
- };
2193
- }) | (Omit<EventInput, "payload" | "type"> & {
2194
- readonly type: "runtime.timer.set";
2195
- readonly payload: {
2196
- readonly timerId: string;
2197
- readonly waitId: string;
2198
- readonly wakeAt: number;
2199
- };
2200
- }) | (Omit<EventInput, "payload" | "type"> & {
2201
- readonly type: "runtime.wait.registered";
2202
- readonly payload: {
2203
- readonly waitId: string;
2204
- readonly threadId?: string | undefined;
2205
- readonly on: {
2206
- readonly type: string | readonly string[];
2207
- readonly match?: import("effect/Schema").Json | undefined;
2208
- } | {
2209
- readonly timerAt: number;
2210
- };
2211
- readonly tag?: import("effect/Schema").Json | undefined;
2212
- };
2213
- }) | (Omit<EventInput, "payload" | "type"> & {
2214
- readonly type: "runtime.wait.satisfied";
2215
- readonly payload: {
2216
- readonly waitId: string;
2217
- readonly tag?: import("effect/Schema").Json | undefined;
2218
- readonly event: {
2219
- readonly id: string;
2220
- readonly type: string;
2221
- readonly payload: import("effect/Schema").Json;
2222
- };
2223
- };
2224
2224
  })>;
2225
2225
  };
2226
2226
  readonly threads: {