@swirls/looms 0.12.1 → 0.12.2

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.
@@ -239,6 +239,252 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
239
239
  readonly alreadyCompacted?: boolean | undefined;
240
240
  readonly consumedSteerMessageIds?: readonly string[] | undefined;
241
241
  }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
242
+ readonly type: "runtime.child.close.requested";
243
+ readonly payload: {
244
+ readonly policy: "terminate" | "wait";
245
+ };
246
+ }) | (Omit<EventInput, "payload" | "type"> & {
247
+ readonly type: "runtime.child.settled";
248
+ readonly payload: {
249
+ readonly runId: string;
250
+ readonly status: "cancelled" | "completed" | "failed";
251
+ readonly output: import("effect/Schema").Json;
252
+ readonly error: string | null;
253
+ };
254
+ }) | (Omit<EventInput, "payload" | "type"> & {
255
+ readonly type: "runtime.effect.ambiguous";
256
+ readonly payload: {
257
+ readonly effectId: string;
258
+ readonly attempt: number;
259
+ readonly error: string;
260
+ };
261
+ }) | (Omit<EventInput, "payload" | "type"> & {
262
+ readonly type: "runtime.effect.attempt.started";
263
+ readonly payload: {
264
+ readonly effectId: string;
265
+ readonly attempt: number;
266
+ };
267
+ }) | (Omit<EventInput, "payload" | "type"> & {
268
+ readonly type: "runtime.effect.cancel.requested";
269
+ readonly payload: {
270
+ readonly effectId: string;
271
+ readonly attempt: number;
272
+ readonly deadlineAt: number | null;
273
+ };
274
+ }) | (Omit<EventInput, "payload" | "type"> & {
275
+ readonly type: "runtime.effect.cancelled";
276
+ readonly payload: {
277
+ readonly effectId: string;
278
+ readonly attempt: number;
279
+ };
280
+ }) | (Omit<EventInput, "payload" | "type"> & {
281
+ readonly type: "runtime.effect.completed";
282
+ readonly payload: {
283
+ readonly effectId: string;
284
+ readonly attempt: number;
285
+ };
286
+ }) | (Omit<EventInput, "payload" | "type"> & {
287
+ readonly type: "runtime.effect.dispatch.deferred";
288
+ readonly payload: {
289
+ readonly effectId: string;
290
+ readonly attempt: number;
291
+ readonly retryAt: number;
292
+ readonly error: string;
293
+ readonly try: number;
294
+ };
295
+ }) | (Omit<EventInput, "payload" | "type"> & {
296
+ readonly type: "runtime.effect.dispatched";
297
+ readonly payload: {
298
+ readonly effectId: string;
299
+ readonly attempt: number;
300
+ readonly deadlineAt: number | null;
301
+ };
302
+ }) | (Omit<EventInput, "payload" | "type"> & {
303
+ readonly type: "runtime.effect.failed";
304
+ readonly payload: {
305
+ readonly effectId: string;
306
+ readonly error: string;
307
+ readonly nonRetryable?: boolean | undefined;
308
+ readonly retryAfterMs?: number | undefined;
309
+ };
310
+ }) | (Omit<EventInput, "payload" | "type"> & {
311
+ readonly type: "runtime.effect.heartbeat";
312
+ readonly payload: {
313
+ readonly effectId: string;
314
+ readonly attempt: number;
315
+ readonly heartbeatAt: number;
316
+ readonly deadlineAt: number | null;
317
+ readonly details?: import("effect/Schema").Json | undefined;
318
+ };
319
+ }) | (Omit<EventInput, "payload" | "type"> & {
320
+ readonly type: "runtime.effect.queued";
321
+ readonly payload: {
322
+ readonly effectId: string;
323
+ readonly attempt: number;
324
+ readonly deadlineAt: number | null;
325
+ };
326
+ }) | (Omit<EventInput, "payload" | "type"> & {
327
+ readonly type: "runtime.effect.retry.scheduled";
328
+ readonly payload: {
329
+ readonly effectId: string;
330
+ readonly attempt: number;
331
+ readonly nextAttemptAt: number;
332
+ readonly error: string;
333
+ };
334
+ }) | (Omit<EventInput, "payload" | "type"> & {
335
+ readonly type: "runtime.effect.timed_out";
336
+ readonly payload: {
337
+ readonly effectId: string;
338
+ readonly attempt: number;
339
+ readonly timeout: string;
340
+ };
341
+ }) | (Omit<EventInput, "payload" | "type"> & {
342
+ readonly type: "runtime.effect.worker.started";
343
+ readonly payload: {
344
+ readonly effectId: string;
345
+ readonly attempt: number;
346
+ readonly deadlineAt: number | null;
347
+ };
348
+ }) | (Omit<EventInput, "payload" | "type"> & {
349
+ readonly type: "runtime.fork.elided";
350
+ readonly payload: {
351
+ readonly type: string;
352
+ };
353
+ }) | (Omit<EventInput, "payload" | "type"> & {
354
+ readonly type: "runtime.run.cancelled";
355
+ readonly payload: {
356
+ readonly reason?: string | undefined;
357
+ };
358
+ }) | (Omit<EventInput, "payload" | "type"> & {
359
+ readonly type: "runtime.run.completed";
360
+ readonly payload: {
361
+ readonly output: import("effect/Schema").Json;
362
+ readonly error: string | null;
363
+ };
364
+ }) | (Omit<EventInput, "payload" | "type"> & {
365
+ readonly type: "runtime.run.forked";
366
+ readonly payload: {
367
+ readonly sourceRunId: string;
368
+ readonly sourceSeq: number;
369
+ };
370
+ }) | (Omit<EventInput, "payload" | "type"> & {
371
+ readonly type: "runtime.run.launched";
372
+ readonly payload: {
373
+ readonly runId: string;
374
+ readonly kind: string;
375
+ readonly definitionName: string;
376
+ readonly definitionVersion: string;
377
+ readonly effectId: string;
378
+ readonly close: "terminate" | "wait";
379
+ };
380
+ }) | (Omit<EventInput, "payload" | "type"> & {
381
+ readonly type: "runtime.run.started";
382
+ readonly payload: {
383
+ readonly rootThreadId?: string | undefined;
384
+ readonly kind: string;
385
+ readonly definitionName: string;
386
+ readonly definitionVersion: string;
387
+ readonly input: import("effect/Schema").Json;
388
+ readonly requestedThreadId?: string | null | undefined;
389
+ readonly launchedBy?: {
390
+ readonly runId: string;
391
+ readonly threadId: string;
392
+ readonly effectId: string;
393
+ readonly causationId: string;
394
+ readonly causationSeq: number;
395
+ } | undefined;
396
+ readonly attributes?: {
397
+ readonly [x: string]: string;
398
+ } | undefined;
399
+ readonly trace?: {
400
+ readonly traceparent: string;
401
+ readonly tracestate?: string | undefined;
402
+ } | undefined;
403
+ };
404
+ }) | (Omit<EventInput, "payload" | "type"> & {
405
+ readonly type: "runtime.signal.received";
406
+ readonly payload: {
407
+ readonly signalType: string;
408
+ };
409
+ }) | (Omit<EventInput, "payload" | "type"> & {
410
+ readonly type: "runtime.snapshot.taken";
411
+ readonly payload: {
412
+ readonly seq: number;
413
+ readonly stateHash: string;
414
+ readonly state?: import("effect/Schema").Json | undefined;
415
+ };
416
+ }) | (Omit<EventInput, "payload" | "type"> & {
417
+ readonly type: "runtime.thread.cancel.requested";
418
+ readonly payload: {
419
+ readonly threadId: string;
420
+ };
421
+ }) | (Omit<EventInput, "payload" | "type"> & {
422
+ readonly type: "runtime.thread.cancelled";
423
+ readonly payload: {
424
+ readonly threadId: string;
425
+ readonly reason?: string | undefined;
426
+ readonly resumeSeq?: number | undefined;
427
+ };
428
+ }) | (Omit<EventInput, "payload" | "type"> & {
429
+ readonly type: "runtime.thread.completed";
430
+ readonly payload: {
431
+ readonly threadId: string;
432
+ readonly output: import("effect/Schema").Json;
433
+ };
434
+ }) | (Omit<EventInput, "payload" | "type"> & {
435
+ readonly type: "runtime.thread.failed";
436
+ readonly payload: {
437
+ readonly threadId: string;
438
+ readonly error: string;
439
+ };
440
+ }) | (Omit<EventInput, "payload" | "type"> & {
441
+ readonly type: "runtime.thread.started";
442
+ readonly payload: {
443
+ readonly threadId: string;
444
+ readonly kind: string;
445
+ readonly definitionName: string;
446
+ readonly definitionVersion: string;
447
+ readonly input: import("effect/Schema").Json;
448
+ readonly parentThreadId: string | null;
449
+ };
450
+ }) | (Omit<EventInput, "payload" | "type"> & {
451
+ readonly type: "runtime.timer.fired";
452
+ readonly payload: {
453
+ readonly timerId: string;
454
+ readonly waitId: string;
455
+ };
456
+ }) | (Omit<EventInput, "payload" | "type"> & {
457
+ readonly type: "runtime.timer.set";
458
+ readonly payload: {
459
+ readonly timerId: string;
460
+ readonly waitId: string;
461
+ readonly wakeAt: number;
462
+ };
463
+ }) | (Omit<EventInput, "payload" | "type"> & {
464
+ readonly type: "runtime.wait.registered";
465
+ readonly payload: {
466
+ readonly waitId: string;
467
+ readonly threadId?: string | undefined;
468
+ readonly on: {
469
+ readonly type: string | readonly string[];
470
+ readonly match?: import("effect/Schema").Json | undefined;
471
+ } | {
472
+ readonly timerAt: number;
473
+ };
474
+ readonly tag?: import("effect/Schema").Json | undefined;
475
+ };
476
+ }) | (Omit<EventInput, "payload" | "type"> & {
477
+ readonly type: "runtime.wait.satisfied";
478
+ readonly payload: {
479
+ readonly waitId: string;
480
+ readonly tag?: import("effect/Schema").Json | undefined;
481
+ readonly event: {
482
+ readonly id: string;
483
+ readonly type: string;
484
+ readonly payload: import("effect/Schema").Json;
485
+ };
486
+ };
487
+ }) | (Omit<EventInput, "payload" | "type"> & {
242
488
  readonly type: "agent.context.compacted";
243
489
  readonly payload: {
244
490
  readonly turn: number;
@@ -486,16 +732,28 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
486
732
  readonly input: number;
487
733
  readonly output: number;
488
734
  };
489
- }) | (Omit<EventInput, "payload" | "type"> & {
490
- readonly type: "runtime.child.close.requested";
491
- readonly payload: {
492
- readonly policy: "terminate" | "wait";
493
- };
494
- }) | (Omit<EventInput, "payload" | "type"> & {
495
- readonly type: "runtime.child.settled";
496
- readonly payload: {
497
- readonly runId: string;
498
- readonly status: "cancelled" | "completed" | "failed";
735
+ })>;
736
+ executeTool: import("@swirls/looms/core").LocalEffectDefinition<{
737
+ readonly turn: number;
738
+ readonly definitionName?: string | undefined;
739
+ readonly definitionVersion: string;
740
+ readonly toolCall: {
741
+ readonly id: string;
742
+ readonly name: string;
743
+ readonly arguments: import("effect/Schema").Json;
744
+ };
745
+ readonly input?: import("effect/Schema").Json | undefined;
746
+ readonly depth?: number | undefined;
747
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
748
+ readonly type: "runtime.child.close.requested";
749
+ readonly payload: {
750
+ readonly policy: "terminate" | "wait";
751
+ };
752
+ }) | (Omit<EventInput, "payload" | "type"> & {
753
+ readonly type: "runtime.child.settled";
754
+ readonly payload: {
755
+ readonly runId: string;
756
+ readonly status: "cancelled" | "completed" | "failed";
499
757
  readonly output: import("effect/Schema").Json;
500
758
  readonly error: string | null;
501
759
  };
@@ -732,19 +990,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
732
990
  readonly payload: import("effect/Schema").Json;
733
991
  };
734
992
  };
735
- })>;
736
- executeTool: import("@swirls/looms/core").LocalEffectDefinition<{
737
- readonly turn: number;
738
- readonly definitionName?: string | undefined;
739
- readonly definitionVersion: string;
740
- readonly toolCall: {
741
- readonly id: string;
742
- readonly name: string;
743
- readonly arguments: import("effect/Schema").Json;
744
- };
745
- readonly input?: import("effect/Schema").Json | undefined;
746
- readonly depth?: number | undefined;
747
- }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
993
+ }) | (Omit<EventInput, "payload" | "type"> & {
748
994
  readonly type: "agent.context.compacted";
749
995
  readonly payload: {
750
996
  readonly turn: number;
@@ -992,402 +1238,402 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
992
1238
  readonly input: number;
993
1239
  readonly output: number;
994
1240
  };
995
- }) | (Omit<EventInput, "payload" | "type"> & {
996
- readonly type: "runtime.child.close.requested";
997
- readonly payload: {
998
- readonly policy: "terminate" | "wait";
999
- };
1000
- }) | (Omit<EventInput, "payload" | "type"> & {
1001
- readonly type: "runtime.child.settled";
1002
- readonly payload: {
1003
- readonly runId: string;
1004
- readonly status: "cancelled" | "completed" | "failed";
1005
- readonly output: import("effect/Schema").Json;
1006
- readonly error: string | null;
1007
- };
1008
- }) | (Omit<EventInput, "payload" | "type"> & {
1009
- readonly type: "runtime.effect.ambiguous";
1010
- readonly payload: {
1011
- readonly effectId: string;
1012
- readonly attempt: number;
1013
- readonly error: string;
1014
- };
1015
- }) | (Omit<EventInput, "payload" | "type"> & {
1016
- readonly type: "runtime.effect.attempt.started";
1017
- readonly payload: {
1018
- readonly effectId: string;
1019
- readonly attempt: number;
1020
- };
1021
- }) | (Omit<EventInput, "payload" | "type"> & {
1022
- readonly type: "runtime.effect.cancel.requested";
1023
- readonly payload: {
1024
- readonly effectId: string;
1025
- readonly attempt: number;
1026
- readonly deadlineAt: number | null;
1027
- };
1028
- }) | (Omit<EventInput, "payload" | "type"> & {
1029
- readonly type: "runtime.effect.cancelled";
1030
- readonly payload: {
1031
- readonly effectId: string;
1032
- readonly attempt: number;
1033
- };
1034
- }) | (Omit<EventInput, "payload" | "type"> & {
1035
- readonly type: "runtime.effect.completed";
1036
- readonly payload: {
1037
- readonly effectId: string;
1038
- readonly attempt: number;
1039
- };
1040
- }) | (Omit<EventInput, "payload" | "type"> & {
1041
- readonly type: "runtime.effect.dispatch.deferred";
1042
- readonly payload: {
1043
- readonly effectId: string;
1044
- readonly attempt: number;
1045
- readonly retryAt: number;
1046
- readonly error: string;
1047
- readonly try: number;
1048
- };
1049
- }) | (Omit<EventInput, "payload" | "type"> & {
1050
- readonly type: "runtime.effect.dispatched";
1051
- readonly payload: {
1052
- readonly effectId: string;
1053
- readonly attempt: number;
1054
- readonly deadlineAt: number | null;
1055
- };
1056
- }) | (Omit<EventInput, "payload" | "type"> & {
1057
- readonly type: "runtime.effect.failed";
1058
- readonly payload: {
1059
- readonly effectId: string;
1060
- readonly error: string;
1061
- readonly nonRetryable?: boolean | undefined;
1062
- readonly retryAfterMs?: number | undefined;
1063
- };
1064
- }) | (Omit<EventInput, "payload" | "type"> & {
1065
- readonly type: "runtime.effect.heartbeat";
1066
- readonly payload: {
1067
- readonly effectId: string;
1068
- readonly attempt: number;
1069
- readonly heartbeatAt: number;
1070
- readonly deadlineAt: number | null;
1071
- readonly details?: import("effect/Schema").Json | undefined;
1072
- };
1073
- }) | (Omit<EventInput, "payload" | "type"> & {
1074
- readonly type: "runtime.effect.queued";
1241
+ })>;
1242
+ }, {
1243
+ agent: import("@swirls/looms/core").ThreadDefinition<import("./types").AgentState>;
1244
+ 'agent-session': import("@swirls/looms/core").ThreadDefinition<import("./types").AgentSessionState>;
1245
+ }, {
1246
+ conversation: import("@swirls/looms/core").ProjectionDefinition<{
1247
+ readonly lines: {
1248
+ readonly role: "assistant" | "system" | "tool" | "user";
1249
+ readonly content: string;
1250
+ readonly toolCallId?: string | undefined;
1251
+ readonly name?: string | undefined;
1252
+ readonly toolCalls?: {
1253
+ readonly id: string;
1254
+ readonly name: string;
1255
+ readonly arguments: import("effect/Schema").Json;
1256
+ }[] | undefined;
1257
+ }[];
1258
+ }>;
1259
+ tokenUsage: import("@swirls/looms/core").ProjectionDefinition<{
1260
+ readonly input: number;
1261
+ readonly output: number;
1262
+ }>;
1263
+ turnActivity: import("@swirls/looms/core").ProjectionDefinition<{
1264
+ readonly rootThreadId: string | null;
1265
+ readonly active: boolean;
1266
+ }>;
1267
+ }, import("effect/Context").Service.Any, {
1268
+ userMessage: import("@swirls/looms/core").SignalDefinition<{
1269
+ readonly content: string;
1270
+ }, Omit<EventInput, "payload" | "type"> & {
1271
+ readonly type: "agent.message.received";
1075
1272
  readonly payload: {
1076
- readonly effectId: string;
1077
- readonly attempt: number;
1078
- readonly deadlineAt: number | null;
1273
+ readonly message: {
1274
+ readonly role: "assistant" | "system" | "tool" | "user";
1275
+ readonly content: string;
1276
+ readonly toolCallId?: string | undefined;
1277
+ readonly name?: string | undefined;
1278
+ readonly toolCalls?: {
1279
+ readonly id: string;
1280
+ readonly name: string;
1281
+ readonly arguments: import("effect/Schema").Json;
1282
+ }[] | undefined;
1283
+ };
1079
1284
  };
1080
- }) | (Omit<EventInput, "payload" | "type"> & {
1081
- readonly type: "runtime.effect.retry.scheduled";
1285
+ }>;
1286
+ steer: import("@swirls/looms/core").SignalDefinition<{
1287
+ readonly content: string;
1288
+ readonly interrupt?: boolean | undefined;
1289
+ }, Omit<EventInput, "payload" | "type"> & {
1290
+ readonly type: "agent.steered";
1082
1291
  readonly payload: {
1083
- readonly effectId: string;
1084
- readonly attempt: number;
1085
- readonly nextAttemptAt: number;
1086
- readonly error: string;
1292
+ readonly turn: number;
1293
+ readonly messageId?: string | undefined;
1294
+ readonly message: {
1295
+ readonly role: "assistant" | "system" | "tool" | "user";
1296
+ readonly content: string;
1297
+ readonly toolCallId?: string | undefined;
1298
+ readonly name?: string | undefined;
1299
+ readonly toolCalls?: {
1300
+ readonly id: string;
1301
+ readonly name: string;
1302
+ readonly arguments: import("effect/Schema").Json;
1303
+ }[] | undefined;
1304
+ };
1305
+ readonly interrupt?: boolean | undefined;
1087
1306
  };
1088
- }) | (Omit<EventInput, "payload" | "type"> & {
1089
- readonly type: "runtime.effect.timed_out";
1307
+ }>;
1308
+ stopAgentTurn: import("@swirls/looms/core").SignalDefinition<undefined, Omit<EventInput, "payload" | "type"> & {
1309
+ readonly type: "agent.turn.stopped";
1310
+ readonly payload: {};
1311
+ }>;
1312
+ submitAgentMessage: import("@swirls/looms/core").SignalDefinition<{
1313
+ readonly messageId: string;
1314
+ readonly text: string;
1315
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1316
+ readonly activeChildThreadId?: string | undefined;
1317
+ }, Omit<EventInput, "payload" | "type"> & {
1318
+ readonly type: "agent.session.message.submitted";
1090
1319
  readonly payload: {
1091
- readonly effectId: string;
1092
- readonly attempt: number;
1093
- readonly timeout: string;
1320
+ readonly messageId: string;
1321
+ readonly text: string;
1322
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1323
+ readonly activeChildThreadId?: string | undefined;
1094
1324
  };
1095
- }) | (Omit<EventInput, "payload" | "type"> & {
1096
- readonly type: "runtime.effect.worker.started";
1097
- readonly payload: {
1098
- readonly effectId: string;
1099
- readonly attempt: number;
1100
- readonly deadlineAt: number | null;
1325
+ }>;
1326
+ cancelAgentTurn: import("@swirls/looms/core").SignalDefinition<{
1327
+ readonly childThreadId: string;
1328
+ }, ({
1329
+ type: 'runtime.thread.cancel.requested';
1330
+ payload: {
1331
+ threadId: string;
1101
1332
  };
1102
- }) | (Omit<EventInput, "payload" | "type"> & {
1103
- readonly type: "runtime.fork.elided";
1333
+ } | (Omit<EventInput, "payload" | "type"> & {
1334
+ readonly type: "agent.session.cancel.requested";
1335
+ readonly payload: {};
1336
+ }))[]>;
1337
+ agentSessionMessageEvents: import("@swirls/looms/core").SignalDefinition<{
1338
+ readonly messageId: string;
1339
+ readonly text: string;
1340
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1341
+ readonly activeChildThreadId?: string | undefined;
1342
+ }, ((Omit<EventInput, "payload" | "type"> & {
1343
+ readonly type: "agent.session.message.submitted";
1104
1344
  readonly payload: {
1105
- readonly type: string;
1345
+ readonly messageId: string;
1346
+ readonly text: string;
1347
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1348
+ readonly activeChildThreadId?: string | undefined;
1106
1349
  };
1107
1350
  }) | (Omit<EventInput, "payload" | "type"> & {
1108
- readonly type: "runtime.run.cancelled";
1351
+ readonly type: "agent.steered";
1109
1352
  readonly payload: {
1110
- readonly reason?: string | undefined;
1353
+ readonly turn: number;
1354
+ readonly messageId?: string | undefined;
1355
+ readonly message: {
1356
+ readonly role: "assistant" | "system" | "tool" | "user";
1357
+ readonly content: string;
1358
+ readonly toolCallId?: string | undefined;
1359
+ readonly name?: string | undefined;
1360
+ readonly toolCalls?: {
1361
+ readonly id: string;
1362
+ readonly name: string;
1363
+ readonly arguments: import("effect/Schema").Json;
1364
+ }[] | undefined;
1365
+ };
1366
+ readonly interrupt?: boolean | undefined;
1111
1367
  };
1112
- }) | (Omit<EventInput, "payload" | "type"> & {
1113
- readonly type: "runtime.run.completed";
1114
- readonly payload: {
1115
- readonly output: import("effect/Schema").Json;
1116
- readonly error: string | null;
1117
- };
1118
- }) | (Omit<EventInput, "payload" | "type"> & {
1119
- readonly type: "runtime.run.forked";
1120
- readonly payload: {
1121
- readonly sourceRunId: string;
1122
- readonly sourceSeq: number;
1123
- };
1124
- }) | (Omit<EventInput, "payload" | "type"> & {
1125
- readonly type: "runtime.run.launched";
1126
- readonly payload: {
1127
- readonly runId: string;
1128
- readonly kind: string;
1129
- readonly definitionName: string;
1130
- readonly definitionVersion: string;
1131
- readonly effectId: string;
1132
- readonly close: "terminate" | "wait";
1133
- };
1134
- }) | (Omit<EventInput, "payload" | "type"> & {
1135
- readonly type: "runtime.run.started";
1136
- readonly payload: {
1137
- readonly rootThreadId?: string | undefined;
1138
- readonly kind: string;
1139
- readonly definitionName: string;
1368
+ }))[]>;
1369
+ }, {}> & {
1370
+ readonly effects: {
1371
+ callLLM: import("@swirls/looms/core").LocalEffectDefinition<{
1372
+ readonly turn: number;
1373
+ readonly definitionName?: string | undefined;
1140
1374
  readonly definitionVersion: string;
1141
- readonly input: import("effect/Schema").Json;
1142
- readonly requestedThreadId?: string | null | undefined;
1143
- readonly launchedBy?: {
1375
+ readonly messages?: readonly {
1376
+ readonly role: "assistant" | "system" | "tool" | "user";
1377
+ readonly content: string;
1378
+ readonly toolCallId?: string | undefined;
1379
+ readonly name?: string | undefined;
1380
+ readonly toolCalls?: {
1381
+ readonly id: string;
1382
+ readonly name: string;
1383
+ readonly arguments: import("effect/Schema").Json;
1384
+ }[] | undefined;
1385
+ }[] | undefined;
1386
+ readonly input?: import("effect/Schema").Json | undefined;
1387
+ readonly structuredOutput?: import("effect/Schema").Json | undefined;
1388
+ readonly alreadyCompacted?: boolean | undefined;
1389
+ readonly consumedSteerMessageIds?: readonly string[] | undefined;
1390
+ }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
1391
+ readonly type: "runtime.child.close.requested";
1392
+ readonly payload: {
1393
+ readonly policy: "terminate" | "wait";
1394
+ };
1395
+ }) | (Omit<EventInput, "payload" | "type"> & {
1396
+ readonly type: "runtime.child.settled";
1397
+ readonly payload: {
1144
1398
  readonly runId: string;
1145
- readonly threadId: string;
1399
+ readonly status: "cancelled" | "completed" | "failed";
1400
+ readonly output: import("effect/Schema").Json;
1401
+ readonly error: string | null;
1402
+ };
1403
+ }) | (Omit<EventInput, "payload" | "type"> & {
1404
+ readonly type: "runtime.effect.ambiguous";
1405
+ readonly payload: {
1146
1406
  readonly effectId: string;
1147
- readonly causationId: string;
1148
- readonly causationSeq: number;
1149
- } | undefined;
1150
- readonly attributes?: {
1151
- readonly [x: string]: string;
1152
- } | undefined;
1153
- readonly trace?: {
1154
- readonly traceparent: string;
1155
- readonly tracestate?: string | undefined;
1156
- } | undefined;
1157
- };
1158
- }) | (Omit<EventInput, "payload" | "type"> & {
1159
- readonly type: "runtime.signal.received";
1160
- readonly payload: {
1161
- readonly signalType: string;
1162
- };
1163
- }) | (Omit<EventInput, "payload" | "type"> & {
1164
- readonly type: "runtime.snapshot.taken";
1165
- readonly payload: {
1166
- readonly seq: number;
1167
- readonly stateHash: string;
1168
- readonly state?: import("effect/Schema").Json | undefined;
1169
- };
1170
- }) | (Omit<EventInput, "payload" | "type"> & {
1171
- readonly type: "runtime.thread.cancel.requested";
1172
- readonly payload: {
1173
- readonly threadId: string;
1174
- };
1175
- }) | (Omit<EventInput, "payload" | "type"> & {
1176
- readonly type: "runtime.thread.cancelled";
1177
- readonly payload: {
1178
- readonly threadId: string;
1179
- readonly reason?: string | undefined;
1180
- readonly resumeSeq?: number | undefined;
1181
- };
1182
- }) | (Omit<EventInput, "payload" | "type"> & {
1183
- readonly type: "runtime.thread.completed";
1184
- readonly payload: {
1185
- readonly threadId: string;
1186
- readonly output: import("effect/Schema").Json;
1187
- };
1188
- }) | (Omit<EventInput, "payload" | "type"> & {
1189
- readonly type: "runtime.thread.failed";
1190
- readonly payload: {
1191
- readonly threadId: string;
1192
- readonly error: string;
1193
- };
1194
- }) | (Omit<EventInput, "payload" | "type"> & {
1195
- readonly type: "runtime.thread.started";
1196
- readonly payload: {
1197
- readonly threadId: string;
1198
- readonly kind: string;
1199
- readonly definitionName: string;
1200
- readonly definitionVersion: string;
1201
- readonly input: import("effect/Schema").Json;
1202
- readonly parentThreadId: string | null;
1203
- };
1204
- }) | (Omit<EventInput, "payload" | "type"> & {
1205
- readonly type: "runtime.timer.fired";
1206
- readonly payload: {
1207
- readonly timerId: string;
1208
- readonly waitId: string;
1209
- };
1210
- }) | (Omit<EventInput, "payload" | "type"> & {
1211
- readonly type: "runtime.timer.set";
1212
- readonly payload: {
1213
- readonly timerId: string;
1214
- readonly waitId: string;
1215
- readonly wakeAt: number;
1216
- };
1217
- }) | (Omit<EventInput, "payload" | "type"> & {
1218
- readonly type: "runtime.wait.registered";
1219
- readonly payload: {
1220
- readonly waitId: string;
1221
- readonly threadId?: string | undefined;
1222
- readonly on: {
1223
- readonly type: string | readonly string[];
1224
- readonly match?: import("effect/Schema").Json | undefined;
1225
- } | {
1226
- readonly timerAt: number;
1407
+ readonly attempt: number;
1408
+ readonly error: string;
1409
+ };
1410
+ }) | (Omit<EventInput, "payload" | "type"> & {
1411
+ readonly type: "runtime.effect.attempt.started";
1412
+ readonly payload: {
1413
+ readonly effectId: string;
1414
+ readonly attempt: number;
1415
+ };
1416
+ }) | (Omit<EventInput, "payload" | "type"> & {
1417
+ readonly type: "runtime.effect.cancel.requested";
1418
+ readonly payload: {
1419
+ readonly effectId: string;
1420
+ readonly attempt: number;
1421
+ readonly deadlineAt: number | null;
1422
+ };
1423
+ }) | (Omit<EventInput, "payload" | "type"> & {
1424
+ readonly type: "runtime.effect.cancelled";
1425
+ readonly payload: {
1426
+ readonly effectId: string;
1427
+ readonly attempt: number;
1428
+ };
1429
+ }) | (Omit<EventInput, "payload" | "type"> & {
1430
+ readonly type: "runtime.effect.completed";
1431
+ readonly payload: {
1432
+ readonly effectId: string;
1433
+ readonly attempt: number;
1434
+ };
1435
+ }) | (Omit<EventInput, "payload" | "type"> & {
1436
+ readonly type: "runtime.effect.dispatch.deferred";
1437
+ readonly payload: {
1438
+ readonly effectId: string;
1439
+ readonly attempt: number;
1440
+ readonly retryAt: number;
1441
+ readonly error: string;
1442
+ readonly try: number;
1443
+ };
1444
+ }) | (Omit<EventInput, "payload" | "type"> & {
1445
+ readonly type: "runtime.effect.dispatched";
1446
+ readonly payload: {
1447
+ readonly effectId: string;
1448
+ readonly attempt: number;
1449
+ readonly deadlineAt: number | null;
1450
+ };
1451
+ }) | (Omit<EventInput, "payload" | "type"> & {
1452
+ readonly type: "runtime.effect.failed";
1453
+ readonly payload: {
1454
+ readonly effectId: string;
1455
+ readonly error: string;
1456
+ readonly nonRetryable?: boolean | undefined;
1457
+ readonly retryAfterMs?: number | undefined;
1458
+ };
1459
+ }) | (Omit<EventInput, "payload" | "type"> & {
1460
+ readonly type: "runtime.effect.heartbeat";
1461
+ readonly payload: {
1462
+ readonly effectId: string;
1463
+ readonly attempt: number;
1464
+ readonly heartbeatAt: number;
1465
+ readonly deadlineAt: number | null;
1466
+ readonly details?: import("effect/Schema").Json | undefined;
1467
+ };
1468
+ }) | (Omit<EventInput, "payload" | "type"> & {
1469
+ readonly type: "runtime.effect.queued";
1470
+ readonly payload: {
1471
+ readonly effectId: string;
1472
+ readonly attempt: number;
1473
+ readonly deadlineAt: number | null;
1474
+ };
1475
+ }) | (Omit<EventInput, "payload" | "type"> & {
1476
+ readonly type: "runtime.effect.retry.scheduled";
1477
+ readonly payload: {
1478
+ readonly effectId: string;
1479
+ readonly attempt: number;
1480
+ readonly nextAttemptAt: number;
1481
+ readonly error: string;
1482
+ };
1483
+ }) | (Omit<EventInput, "payload" | "type"> & {
1484
+ readonly type: "runtime.effect.timed_out";
1485
+ readonly payload: {
1486
+ readonly effectId: string;
1487
+ readonly attempt: number;
1488
+ readonly timeout: string;
1489
+ };
1490
+ }) | (Omit<EventInput, "payload" | "type"> & {
1491
+ readonly type: "runtime.effect.worker.started";
1492
+ readonly payload: {
1493
+ readonly effectId: string;
1494
+ readonly attempt: number;
1495
+ readonly deadlineAt: number | null;
1496
+ };
1497
+ }) | (Omit<EventInput, "payload" | "type"> & {
1498
+ readonly type: "runtime.fork.elided";
1499
+ readonly payload: {
1500
+ readonly type: string;
1501
+ };
1502
+ }) | (Omit<EventInput, "payload" | "type"> & {
1503
+ readonly type: "runtime.run.cancelled";
1504
+ readonly payload: {
1505
+ readonly reason?: string | undefined;
1506
+ };
1507
+ }) | (Omit<EventInput, "payload" | "type"> & {
1508
+ readonly type: "runtime.run.completed";
1509
+ readonly payload: {
1510
+ readonly output: import("effect/Schema").Json;
1511
+ readonly error: string | null;
1512
+ };
1513
+ }) | (Omit<EventInput, "payload" | "type"> & {
1514
+ readonly type: "runtime.run.forked";
1515
+ readonly payload: {
1516
+ readonly sourceRunId: string;
1517
+ readonly sourceSeq: number;
1518
+ };
1519
+ }) | (Omit<EventInput, "payload" | "type"> & {
1520
+ readonly type: "runtime.run.launched";
1521
+ readonly payload: {
1522
+ readonly runId: string;
1523
+ readonly kind: string;
1524
+ readonly definitionName: string;
1525
+ readonly definitionVersion: string;
1526
+ readonly effectId: string;
1527
+ readonly close: "terminate" | "wait";
1528
+ };
1529
+ }) | (Omit<EventInput, "payload" | "type"> & {
1530
+ readonly type: "runtime.run.started";
1531
+ readonly payload: {
1532
+ readonly rootThreadId?: string | undefined;
1533
+ readonly kind: string;
1534
+ readonly definitionName: string;
1535
+ readonly definitionVersion: string;
1536
+ readonly input: import("effect/Schema").Json;
1537
+ readonly requestedThreadId?: string | null | undefined;
1538
+ readonly launchedBy?: {
1539
+ readonly runId: string;
1540
+ readonly threadId: string;
1541
+ readonly effectId: string;
1542
+ readonly causationId: string;
1543
+ readonly causationSeq: number;
1544
+ } | undefined;
1545
+ readonly attributes?: {
1546
+ readonly [x: string]: string;
1547
+ } | undefined;
1548
+ readonly trace?: {
1549
+ readonly traceparent: string;
1550
+ readonly tracestate?: string | undefined;
1551
+ } | undefined;
1552
+ };
1553
+ }) | (Omit<EventInput, "payload" | "type"> & {
1554
+ readonly type: "runtime.signal.received";
1555
+ readonly payload: {
1556
+ readonly signalType: string;
1557
+ };
1558
+ }) | (Omit<EventInput, "payload" | "type"> & {
1559
+ readonly type: "runtime.snapshot.taken";
1560
+ readonly payload: {
1561
+ readonly seq: number;
1562
+ readonly stateHash: string;
1563
+ readonly state?: import("effect/Schema").Json | undefined;
1227
1564
  };
1228
- readonly tag?: import("effect/Schema").Json | undefined;
1229
- };
1230
- }) | (Omit<EventInput, "payload" | "type"> & {
1231
- readonly type: "runtime.wait.satisfied";
1232
- readonly payload: {
1233
- readonly waitId: string;
1234
- readonly tag?: import("effect/Schema").Json | undefined;
1235
- readonly event: {
1236
- readonly id: string;
1237
- readonly type: string;
1238
- readonly payload: import("effect/Schema").Json;
1565
+ }) | (Omit<EventInput, "payload" | "type"> & {
1566
+ readonly type: "runtime.thread.cancel.requested";
1567
+ readonly payload: {
1568
+ readonly threadId: string;
1239
1569
  };
1240
- };
1241
- })>;
1242
- }, {
1243
- agent: import("@swirls/looms/core").ThreadDefinition<import("./types").AgentState>;
1244
- 'agent-session': import("@swirls/looms/core").ThreadDefinition<import("./types").AgentSessionState>;
1245
- }, {
1246
- conversation: import("@swirls/looms/core").ProjectionDefinition<{
1247
- readonly lines: {
1248
- readonly role: "assistant" | "system" | "tool" | "user";
1249
- readonly content: string;
1250
- readonly toolCallId?: string | undefined;
1251
- readonly name?: string | undefined;
1252
- readonly toolCalls?: {
1253
- readonly id: string;
1254
- readonly name: string;
1255
- readonly arguments: import("effect/Schema").Json;
1256
- }[] | undefined;
1257
- }[];
1258
- }>;
1259
- tokenUsage: import("@swirls/looms/core").ProjectionDefinition<{
1260
- readonly input: number;
1261
- readonly output: number;
1262
- }>;
1263
- turnActivity: import("@swirls/looms/core").ProjectionDefinition<{
1264
- readonly rootThreadId: string | null;
1265
- readonly active: boolean;
1266
- }>;
1267
- }, import("effect/Context").Service.Any, {
1268
- userMessage: import("@swirls/looms/core").SignalDefinition<{
1269
- readonly content: string;
1270
- }, Omit<EventInput, "payload" | "type"> & {
1271
- readonly type: "agent.message.received";
1272
- readonly payload: {
1273
- readonly message: {
1274
- readonly role: "assistant" | "system" | "tool" | "user";
1275
- readonly content: string;
1276
- readonly toolCallId?: string | undefined;
1277
- readonly name?: string | undefined;
1278
- readonly toolCalls?: {
1279
- readonly id: string;
1280
- readonly name: string;
1281
- readonly arguments: import("effect/Schema").Json;
1282
- }[] | undefined;
1570
+ }) | (Omit<EventInput, "payload" | "type"> & {
1571
+ readonly type: "runtime.thread.cancelled";
1572
+ readonly payload: {
1573
+ readonly threadId: string;
1574
+ readonly reason?: string | undefined;
1575
+ readonly resumeSeq?: number | undefined;
1283
1576
  };
1284
- };
1285
- }>;
1286
- steer: import("@swirls/looms/core").SignalDefinition<{
1287
- readonly content: string;
1288
- readonly interrupt?: boolean | undefined;
1289
- }, Omit<EventInput, "payload" | "type"> & {
1290
- readonly type: "agent.steered";
1291
- readonly payload: {
1292
- readonly turn: number;
1293
- readonly messageId?: string | undefined;
1294
- readonly message: {
1295
- readonly role: "assistant" | "system" | "tool" | "user";
1296
- readonly content: string;
1297
- readonly toolCallId?: string | undefined;
1298
- readonly name?: string | undefined;
1299
- readonly toolCalls?: {
1300
- readonly id: string;
1301
- readonly name: string;
1302
- readonly arguments: import("effect/Schema").Json;
1303
- }[] | undefined;
1577
+ }) | (Omit<EventInput, "payload" | "type"> & {
1578
+ readonly type: "runtime.thread.completed";
1579
+ readonly payload: {
1580
+ readonly threadId: string;
1581
+ readonly output: import("effect/Schema").Json;
1304
1582
  };
1305
- readonly interrupt?: boolean | undefined;
1306
- };
1307
- }>;
1308
- stopAgentTurn: import("@swirls/looms/core").SignalDefinition<undefined, Omit<EventInput, "payload" | "type"> & {
1309
- readonly type: "agent.turn.stopped";
1310
- readonly payload: {};
1311
- }>;
1312
- submitAgentMessage: import("@swirls/looms/core").SignalDefinition<{
1313
- readonly messageId: string;
1314
- readonly text: string;
1315
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1316
- readonly activeChildThreadId?: string | undefined;
1317
- }, Omit<EventInput, "payload" | "type"> & {
1318
- readonly type: "agent.session.message.submitted";
1319
- readonly payload: {
1320
- readonly messageId: string;
1321
- readonly text: string;
1322
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1323
- readonly activeChildThreadId?: string | undefined;
1324
- };
1325
- }>;
1326
- cancelAgentTurn: import("@swirls/looms/core").SignalDefinition<{
1327
- readonly childThreadId: string;
1328
- }, ({
1329
- type: 'runtime.thread.cancel.requested';
1330
- payload: {
1331
- threadId: string;
1332
- };
1333
- } | (Omit<EventInput, "payload" | "type"> & {
1334
- readonly type: "agent.session.cancel.requested";
1335
- readonly payload: {};
1336
- }))[]>;
1337
- agentSessionMessageEvents: import("@swirls/looms/core").SignalDefinition<{
1338
- readonly messageId: string;
1339
- readonly text: string;
1340
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1341
- readonly activeChildThreadId?: string | undefined;
1342
- }, ((Omit<EventInput, "payload" | "type"> & {
1343
- readonly type: "agent.session.message.submitted";
1344
- readonly payload: {
1345
- readonly messageId: string;
1346
- readonly text: string;
1347
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1348
- readonly activeChildThreadId?: string | undefined;
1349
- };
1350
- }) | (Omit<EventInput, "payload" | "type"> & {
1351
- readonly type: "agent.steered";
1352
- readonly payload: {
1353
- readonly turn: number;
1354
- readonly messageId?: string | undefined;
1355
- readonly message: {
1356
- readonly role: "assistant" | "system" | "tool" | "user";
1357
- readonly content: string;
1358
- readonly toolCallId?: string | undefined;
1359
- readonly name?: string | undefined;
1360
- readonly toolCalls?: {
1361
- readonly id: string;
1362
- readonly name: string;
1363
- readonly arguments: import("effect/Schema").Json;
1364
- }[] | undefined;
1583
+ }) | (Omit<EventInput, "payload" | "type"> & {
1584
+ readonly type: "runtime.thread.failed";
1585
+ readonly payload: {
1586
+ readonly threadId: string;
1587
+ readonly error: string;
1365
1588
  };
1366
- readonly interrupt?: boolean | undefined;
1367
- };
1368
- }))[]>;
1369
- }, {}> & {
1370
- readonly effects: {
1371
- callLLM: import("@swirls/looms/core").LocalEffectDefinition<{
1372
- readonly turn: number;
1373
- readonly definitionName?: string | undefined;
1374
- readonly definitionVersion: string;
1375
- readonly messages?: readonly {
1376
- readonly role: "assistant" | "system" | "tool" | "user";
1377
- readonly content: string;
1378
- readonly toolCallId?: string | undefined;
1379
- readonly name?: string | undefined;
1380
- readonly toolCalls?: {
1589
+ }) | (Omit<EventInput, "payload" | "type"> & {
1590
+ readonly type: "runtime.thread.started";
1591
+ readonly payload: {
1592
+ readonly threadId: string;
1593
+ readonly kind: string;
1594
+ readonly definitionName: string;
1595
+ readonly definitionVersion: string;
1596
+ readonly input: import("effect/Schema").Json;
1597
+ readonly parentThreadId: string | null;
1598
+ };
1599
+ }) | (Omit<EventInput, "payload" | "type"> & {
1600
+ readonly type: "runtime.timer.fired";
1601
+ readonly payload: {
1602
+ readonly timerId: string;
1603
+ readonly waitId: string;
1604
+ };
1605
+ }) | (Omit<EventInput, "payload" | "type"> & {
1606
+ readonly type: "runtime.timer.set";
1607
+ readonly payload: {
1608
+ readonly timerId: string;
1609
+ readonly waitId: string;
1610
+ readonly wakeAt: number;
1611
+ };
1612
+ }) | (Omit<EventInput, "payload" | "type"> & {
1613
+ readonly type: "runtime.wait.registered";
1614
+ readonly payload: {
1615
+ readonly waitId: string;
1616
+ readonly threadId?: string | undefined;
1617
+ readonly on: {
1618
+ readonly type: string | readonly string[];
1619
+ readonly match?: import("effect/Schema").Json | undefined;
1620
+ } | {
1621
+ readonly timerAt: number;
1622
+ };
1623
+ readonly tag?: import("effect/Schema").Json | undefined;
1624
+ };
1625
+ }) | (Omit<EventInput, "payload" | "type"> & {
1626
+ readonly type: "runtime.wait.satisfied";
1627
+ readonly payload: {
1628
+ readonly waitId: string;
1629
+ readonly tag?: import("effect/Schema").Json | undefined;
1630
+ readonly event: {
1381
1631
  readonly id: string;
1382
- readonly name: string;
1383
- readonly arguments: import("effect/Schema").Json;
1384
- }[] | undefined;
1385
- }[] | undefined;
1386
- readonly input?: import("effect/Schema").Json | undefined;
1387
- readonly structuredOutput?: import("effect/Schema").Json | undefined;
1388
- readonly alreadyCompacted?: boolean | undefined;
1389
- readonly consumedSteerMessageIds?: readonly string[] | undefined;
1390
- }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
1632
+ readonly type: string;
1633
+ readonly payload: import("effect/Schema").Json;
1634
+ };
1635
+ };
1636
+ }) | (Omit<EventInput, "payload" | "type"> & {
1391
1637
  readonly type: "agent.context.compacted";
1392
1638
  readonly payload: {
1393
1639
  readonly turn: number;
@@ -1635,7 +1881,19 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1635
1881
  readonly input: number;
1636
1882
  readonly output: number;
1637
1883
  };
1638
- }) | (Omit<EventInput, "payload" | "type"> & {
1884
+ })>;
1885
+ executeTool: import("@swirls/looms/core").LocalEffectDefinition<{
1886
+ readonly turn: number;
1887
+ readonly definitionName?: string | undefined;
1888
+ readonly definitionVersion: string;
1889
+ readonly toolCall: {
1890
+ readonly id: string;
1891
+ readonly name: string;
1892
+ readonly arguments: import("effect/Schema").Json;
1893
+ };
1894
+ readonly input?: import("effect/Schema").Json | undefined;
1895
+ readonly depth?: number | undefined;
1896
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
1639
1897
  readonly type: "runtime.child.close.requested";
1640
1898
  readonly payload: {
1641
1899
  readonly policy: "terminate" | "wait";
@@ -1874,26 +2132,14 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1874
2132
  readonly type: "runtime.wait.satisfied";
1875
2133
  readonly payload: {
1876
2134
  readonly waitId: string;
1877
- readonly tag?: import("effect/Schema").Json | undefined;
1878
- readonly event: {
1879
- readonly id: string;
1880
- readonly type: string;
1881
- readonly payload: import("effect/Schema").Json;
1882
- };
1883
- };
1884
- })>;
1885
- executeTool: import("@swirls/looms/core").LocalEffectDefinition<{
1886
- readonly turn: number;
1887
- readonly definitionName?: string | undefined;
1888
- readonly definitionVersion: string;
1889
- readonly toolCall: {
1890
- readonly id: string;
1891
- readonly name: string;
1892
- readonly arguments: import("effect/Schema").Json;
2135
+ readonly tag?: import("effect/Schema").Json | undefined;
2136
+ readonly event: {
2137
+ readonly id: string;
2138
+ readonly type: string;
2139
+ readonly payload: import("effect/Schema").Json;
2140
+ };
1893
2141
  };
1894
- readonly input?: import("effect/Schema").Json | undefined;
1895
- readonly depth?: number | undefined;
1896
- }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
2142
+ }) | (Omit<EventInput, "payload" | "type"> & {
1897
2143
  readonly type: "agent.context.compacted";
1898
2144
  readonly payload: {
1899
2145
  readonly turn: number;
@@ -2141,252 +2387,6 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
2141
2387
  readonly input: number;
2142
2388
  readonly output: number;
2143
2389
  };
2144
- }) | (Omit<EventInput, "payload" | "type"> & {
2145
- readonly type: "runtime.child.close.requested";
2146
- readonly payload: {
2147
- readonly policy: "terminate" | "wait";
2148
- };
2149
- }) | (Omit<EventInput, "payload" | "type"> & {
2150
- readonly type: "runtime.child.settled";
2151
- readonly payload: {
2152
- readonly runId: string;
2153
- readonly status: "cancelled" | "completed" | "failed";
2154
- readonly output: import("effect/Schema").Json;
2155
- readonly error: string | null;
2156
- };
2157
- }) | (Omit<EventInput, "payload" | "type"> & {
2158
- readonly type: "runtime.effect.ambiguous";
2159
- readonly payload: {
2160
- readonly effectId: string;
2161
- readonly attempt: number;
2162
- readonly error: string;
2163
- };
2164
- }) | (Omit<EventInput, "payload" | "type"> & {
2165
- readonly type: "runtime.effect.attempt.started";
2166
- readonly payload: {
2167
- readonly effectId: string;
2168
- readonly attempt: number;
2169
- };
2170
- }) | (Omit<EventInput, "payload" | "type"> & {
2171
- readonly type: "runtime.effect.cancel.requested";
2172
- readonly payload: {
2173
- readonly effectId: string;
2174
- readonly attempt: number;
2175
- readonly deadlineAt: number | null;
2176
- };
2177
- }) | (Omit<EventInput, "payload" | "type"> & {
2178
- readonly type: "runtime.effect.cancelled";
2179
- readonly payload: {
2180
- readonly effectId: string;
2181
- readonly attempt: number;
2182
- };
2183
- }) | (Omit<EventInput, "payload" | "type"> & {
2184
- readonly type: "runtime.effect.completed";
2185
- readonly payload: {
2186
- readonly effectId: string;
2187
- readonly attempt: number;
2188
- };
2189
- }) | (Omit<EventInput, "payload" | "type"> & {
2190
- readonly type: "runtime.effect.dispatch.deferred";
2191
- readonly payload: {
2192
- readonly effectId: string;
2193
- readonly attempt: number;
2194
- readonly retryAt: number;
2195
- readonly error: string;
2196
- readonly try: number;
2197
- };
2198
- }) | (Omit<EventInput, "payload" | "type"> & {
2199
- readonly type: "runtime.effect.dispatched";
2200
- readonly payload: {
2201
- readonly effectId: string;
2202
- readonly attempt: number;
2203
- readonly deadlineAt: number | null;
2204
- };
2205
- }) | (Omit<EventInput, "payload" | "type"> & {
2206
- readonly type: "runtime.effect.failed";
2207
- readonly payload: {
2208
- readonly effectId: string;
2209
- readonly error: string;
2210
- readonly nonRetryable?: boolean | undefined;
2211
- readonly retryAfterMs?: number | undefined;
2212
- };
2213
- }) | (Omit<EventInput, "payload" | "type"> & {
2214
- readonly type: "runtime.effect.heartbeat";
2215
- readonly payload: {
2216
- readonly effectId: string;
2217
- readonly attempt: number;
2218
- readonly heartbeatAt: number;
2219
- readonly deadlineAt: number | null;
2220
- readonly details?: import("effect/Schema").Json | undefined;
2221
- };
2222
- }) | (Omit<EventInput, "payload" | "type"> & {
2223
- readonly type: "runtime.effect.queued";
2224
- readonly payload: {
2225
- readonly effectId: string;
2226
- readonly attempt: number;
2227
- readonly deadlineAt: number | null;
2228
- };
2229
- }) | (Omit<EventInput, "payload" | "type"> & {
2230
- readonly type: "runtime.effect.retry.scheduled";
2231
- readonly payload: {
2232
- readonly effectId: string;
2233
- readonly attempt: number;
2234
- readonly nextAttemptAt: number;
2235
- readonly error: string;
2236
- };
2237
- }) | (Omit<EventInput, "payload" | "type"> & {
2238
- readonly type: "runtime.effect.timed_out";
2239
- readonly payload: {
2240
- readonly effectId: string;
2241
- readonly attempt: number;
2242
- readonly timeout: string;
2243
- };
2244
- }) | (Omit<EventInput, "payload" | "type"> & {
2245
- readonly type: "runtime.effect.worker.started";
2246
- readonly payload: {
2247
- readonly effectId: string;
2248
- readonly attempt: number;
2249
- readonly deadlineAt: number | null;
2250
- };
2251
- }) | (Omit<EventInput, "payload" | "type"> & {
2252
- readonly type: "runtime.fork.elided";
2253
- readonly payload: {
2254
- readonly type: string;
2255
- };
2256
- }) | (Omit<EventInput, "payload" | "type"> & {
2257
- readonly type: "runtime.run.cancelled";
2258
- readonly payload: {
2259
- readonly reason?: string | undefined;
2260
- };
2261
- }) | (Omit<EventInput, "payload" | "type"> & {
2262
- readonly type: "runtime.run.completed";
2263
- readonly payload: {
2264
- readonly output: import("effect/Schema").Json;
2265
- readonly error: string | null;
2266
- };
2267
- }) | (Omit<EventInput, "payload" | "type"> & {
2268
- readonly type: "runtime.run.forked";
2269
- readonly payload: {
2270
- readonly sourceRunId: string;
2271
- readonly sourceSeq: number;
2272
- };
2273
- }) | (Omit<EventInput, "payload" | "type"> & {
2274
- readonly type: "runtime.run.launched";
2275
- readonly payload: {
2276
- readonly runId: string;
2277
- readonly kind: string;
2278
- readonly definitionName: string;
2279
- readonly definitionVersion: string;
2280
- readonly effectId: string;
2281
- readonly close: "terminate" | "wait";
2282
- };
2283
- }) | (Omit<EventInput, "payload" | "type"> & {
2284
- readonly type: "runtime.run.started";
2285
- readonly payload: {
2286
- readonly rootThreadId?: string | undefined;
2287
- readonly kind: string;
2288
- readonly definitionName: string;
2289
- readonly definitionVersion: string;
2290
- readonly input: import("effect/Schema").Json;
2291
- readonly requestedThreadId?: string | null | undefined;
2292
- readonly launchedBy?: {
2293
- readonly runId: string;
2294
- readonly threadId: string;
2295
- readonly effectId: string;
2296
- readonly causationId: string;
2297
- readonly causationSeq: number;
2298
- } | undefined;
2299
- readonly attributes?: {
2300
- readonly [x: string]: string;
2301
- } | undefined;
2302
- readonly trace?: {
2303
- readonly traceparent: string;
2304
- readonly tracestate?: string | undefined;
2305
- } | undefined;
2306
- };
2307
- }) | (Omit<EventInput, "payload" | "type"> & {
2308
- readonly type: "runtime.signal.received";
2309
- readonly payload: {
2310
- readonly signalType: string;
2311
- };
2312
- }) | (Omit<EventInput, "payload" | "type"> & {
2313
- readonly type: "runtime.snapshot.taken";
2314
- readonly payload: {
2315
- readonly seq: number;
2316
- readonly stateHash: string;
2317
- readonly state?: import("effect/Schema").Json | undefined;
2318
- };
2319
- }) | (Omit<EventInput, "payload" | "type"> & {
2320
- readonly type: "runtime.thread.cancel.requested";
2321
- readonly payload: {
2322
- readonly threadId: string;
2323
- };
2324
- }) | (Omit<EventInput, "payload" | "type"> & {
2325
- readonly type: "runtime.thread.cancelled";
2326
- readonly payload: {
2327
- readonly threadId: string;
2328
- readonly reason?: string | undefined;
2329
- readonly resumeSeq?: number | undefined;
2330
- };
2331
- }) | (Omit<EventInput, "payload" | "type"> & {
2332
- readonly type: "runtime.thread.completed";
2333
- readonly payload: {
2334
- readonly threadId: string;
2335
- readonly output: import("effect/Schema").Json;
2336
- };
2337
- }) | (Omit<EventInput, "payload" | "type"> & {
2338
- readonly type: "runtime.thread.failed";
2339
- readonly payload: {
2340
- readonly threadId: string;
2341
- readonly error: string;
2342
- };
2343
- }) | (Omit<EventInput, "payload" | "type"> & {
2344
- readonly type: "runtime.thread.started";
2345
- readonly payload: {
2346
- readonly threadId: string;
2347
- readonly kind: string;
2348
- readonly definitionName: string;
2349
- readonly definitionVersion: string;
2350
- readonly input: import("effect/Schema").Json;
2351
- readonly parentThreadId: string | null;
2352
- };
2353
- }) | (Omit<EventInput, "payload" | "type"> & {
2354
- readonly type: "runtime.timer.fired";
2355
- readonly payload: {
2356
- readonly timerId: string;
2357
- readonly waitId: string;
2358
- };
2359
- }) | (Omit<EventInput, "payload" | "type"> & {
2360
- readonly type: "runtime.timer.set";
2361
- readonly payload: {
2362
- readonly timerId: string;
2363
- readonly waitId: string;
2364
- readonly wakeAt: number;
2365
- };
2366
- }) | (Omit<EventInput, "payload" | "type"> & {
2367
- readonly type: "runtime.wait.registered";
2368
- readonly payload: {
2369
- readonly waitId: string;
2370
- readonly threadId?: string | undefined;
2371
- readonly on: {
2372
- readonly type: string | readonly string[];
2373
- readonly match?: import("effect/Schema").Json | undefined;
2374
- } | {
2375
- readonly timerAt: number;
2376
- };
2377
- readonly tag?: import("effect/Schema").Json | undefined;
2378
- };
2379
- }) | (Omit<EventInput, "payload" | "type"> & {
2380
- readonly type: "runtime.wait.satisfied";
2381
- readonly payload: {
2382
- readonly waitId: string;
2383
- readonly tag?: import("effect/Schema").Json | undefined;
2384
- readonly event: {
2385
- readonly id: string;
2386
- readonly type: string;
2387
- readonly payload: import("effect/Schema").Json;
2388
- };
2389
- };
2390
2390
  })>;
2391
2391
  };
2392
2392
  readonly threads: {