@swirls/looms 0.12.2 → 0.12.4

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.
@@ -221,6 +221,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
221
221
  }>, {
222
222
  callLLM: import("@swirls/looms/core").LocalEffectDefinition<{
223
223
  readonly turn: number;
224
+ readonly messageTurn?: number | undefined;
224
225
  readonly definitionName?: string | undefined;
225
226
  readonly definitionVersion: string;
226
227
  readonly messages?: readonly {
@@ -239,252 +240,6 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
239
240
  readonly alreadyCompacted?: boolean | undefined;
240
241
  readonly consumedSteerMessageIds?: readonly string[] | undefined;
241
242
  }, 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"> & {
488
243
  readonly type: "agent.context.compacted";
489
244
  readonly payload: {
490
245
  readonly turn: number;
@@ -732,19 +487,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
732
487
  readonly input: number;
733
488
  readonly output: number;
734
489
  };
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"> & {
490
+ }) | (Omit<EventInput, "payload" | "type"> & {
748
491
  readonly type: "runtime.child.close.requested";
749
492
  readonly payload: {
750
493
  readonly policy: "terminate" | "wait";
@@ -990,7 +733,19 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
990
733
  readonly payload: import("effect/Schema").Json;
991
734
  };
992
735
  };
993
- }) | (Omit<EventInput, "payload" | "type"> & {
736
+ })>;
737
+ executeTool: import("@swirls/looms/core").LocalEffectDefinition<{
738
+ readonly turn: number;
739
+ readonly definitionName?: string | undefined;
740
+ readonly definitionVersion: string;
741
+ readonly toolCall: {
742
+ readonly id: string;
743
+ readonly name: string;
744
+ readonly arguments: import("effect/Schema").Json;
745
+ };
746
+ readonly input?: import("effect/Schema").Json | undefined;
747
+ readonly depth?: number | undefined;
748
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
994
749
  readonly type: "agent.context.compacted";
995
750
  readonly payload: {
996
751
  readonly turn: number;
@@ -1238,402 +993,403 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1238
993
  readonly input: number;
1239
994
  readonly output: number;
1240
995
  };
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";
996
+ }) | (Omit<EventInput, "payload" | "type"> & {
997
+ readonly type: "runtime.child.close.requested";
1272
998
  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;
1283
- };
999
+ readonly policy: "terminate" | "wait";
1284
1000
  };
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";
1001
+ }) | (Omit<EventInput, "payload" | "type"> & {
1002
+ readonly type: "runtime.child.settled";
1291
1003
  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;
1304
- };
1305
- readonly interrupt?: boolean | undefined;
1004
+ readonly runId: string;
1005
+ readonly status: "cancelled" | "completed" | "failed";
1006
+ readonly output: import("effect/Schema").Json;
1007
+ readonly error: string | null;
1306
1008
  };
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";
1009
+ }) | (Omit<EventInput, "payload" | "type"> & {
1010
+ readonly type: "runtime.effect.ambiguous";
1319
1011
  readonly payload: {
1320
- readonly messageId: string;
1321
- readonly text: string;
1322
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1323
- readonly activeChildThreadId?: string | undefined;
1012
+ readonly effectId: string;
1013
+ readonly attempt: number;
1014
+ readonly error: string;
1324
1015
  };
1325
- }>;
1326
- cancelAgentTurn: import("@swirls/looms/core").SignalDefinition<{
1327
- readonly childThreadId: string;
1328
- }, ({
1329
- type: 'runtime.thread.cancel.requested';
1330
- payload: {
1331
- threadId: string;
1016
+ }) | (Omit<EventInput, "payload" | "type"> & {
1017
+ readonly type: "runtime.effect.attempt.started";
1018
+ readonly payload: {
1019
+ readonly effectId: string;
1020
+ readonly attempt: number;
1332
1021
  };
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";
1022
+ }) | (Omit<EventInput, "payload" | "type"> & {
1023
+ readonly type: "runtime.effect.cancel.requested";
1344
1024
  readonly payload: {
1345
- readonly messageId: string;
1346
- readonly text: string;
1347
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1348
- readonly activeChildThreadId?: string | undefined;
1025
+ readonly effectId: string;
1026
+ readonly attempt: number;
1027
+ readonly deadlineAt: number | null;
1349
1028
  };
1350
1029
  }) | (Omit<EventInput, "payload" | "type"> & {
1351
- readonly type: "agent.steered";
1030
+ readonly type: "runtime.effect.cancelled";
1352
1031
  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;
1365
- };
1366
- readonly interrupt?: boolean | undefined;
1032
+ readonly effectId: string;
1033
+ readonly attempt: number;
1367
1034
  };
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?: {
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: {
1398
- readonly runId: 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: {
1406
- readonly effectId: string;
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: {
1035
+ }) | (Omit<EventInput, "payload" | "type"> & {
1036
+ readonly type: "runtime.effect.completed";
1037
+ readonly payload: {
1038
+ readonly effectId: string;
1039
+ readonly attempt: number;
1040
+ };
1041
+ }) | (Omit<EventInput, "payload" | "type"> & {
1042
+ readonly type: "runtime.effect.dispatch.deferred";
1043
+ readonly payload: {
1044
+ readonly effectId: string;
1045
+ readonly attempt: number;
1046
+ readonly retryAt: number;
1047
+ readonly error: string;
1048
+ readonly try: number;
1049
+ };
1050
+ }) | (Omit<EventInput, "payload" | "type"> & {
1051
+ readonly type: "runtime.effect.dispatched";
1052
+ readonly payload: {
1053
+ readonly effectId: string;
1054
+ readonly attempt: number;
1055
+ readonly deadlineAt: number | null;
1056
+ };
1057
+ }) | (Omit<EventInput, "payload" | "type"> & {
1058
+ readonly type: "runtime.effect.failed";
1059
+ readonly payload: {
1060
+ readonly effectId: string;
1061
+ readonly error: string;
1062
+ readonly nonRetryable?: boolean | undefined;
1063
+ readonly retryAfterMs?: number | undefined;
1064
+ };
1065
+ }) | (Omit<EventInput, "payload" | "type"> & {
1066
+ readonly type: "runtime.effect.heartbeat";
1067
+ readonly payload: {
1068
+ readonly effectId: string;
1069
+ readonly attempt: number;
1070
+ readonly heartbeatAt: number;
1071
+ readonly deadlineAt: number | null;
1072
+ readonly details?: import("effect/Schema").Json | undefined;
1073
+ };
1074
+ }) | (Omit<EventInput, "payload" | "type"> & {
1075
+ readonly type: "runtime.effect.queued";
1076
+ readonly payload: {
1077
+ readonly effectId: string;
1078
+ readonly attempt: number;
1079
+ readonly deadlineAt: number | null;
1080
+ };
1081
+ }) | (Omit<EventInput, "payload" | "type"> & {
1082
+ readonly type: "runtime.effect.retry.scheduled";
1083
+ readonly payload: {
1084
+ readonly effectId: string;
1085
+ readonly attempt: number;
1086
+ readonly nextAttemptAt: number;
1087
+ readonly error: string;
1088
+ };
1089
+ }) | (Omit<EventInput, "payload" | "type"> & {
1090
+ readonly type: "runtime.effect.timed_out";
1091
+ readonly payload: {
1092
+ readonly effectId: string;
1093
+ readonly attempt: number;
1094
+ readonly timeout: string;
1095
+ };
1096
+ }) | (Omit<EventInput, "payload" | "type"> & {
1097
+ readonly type: "runtime.effect.worker.started";
1098
+ readonly payload: {
1099
+ readonly effectId: string;
1100
+ readonly attempt: number;
1101
+ readonly deadlineAt: number | null;
1102
+ };
1103
+ }) | (Omit<EventInput, "payload" | "type"> & {
1104
+ readonly type: "runtime.fork.elided";
1105
+ readonly payload: {
1106
+ readonly type: string;
1107
+ };
1108
+ }) | (Omit<EventInput, "payload" | "type"> & {
1109
+ readonly type: "runtime.run.cancelled";
1110
+ readonly payload: {
1111
+ readonly reason?: string | undefined;
1112
+ };
1113
+ }) | (Omit<EventInput, "payload" | "type"> & {
1114
+ readonly type: "runtime.run.completed";
1115
+ readonly payload: {
1116
+ readonly output: import("effect/Schema").Json;
1117
+ readonly error: string | null;
1118
+ };
1119
+ }) | (Omit<EventInput, "payload" | "type"> & {
1120
+ readonly type: "runtime.run.forked";
1121
+ readonly payload: {
1122
+ readonly sourceRunId: string;
1123
+ readonly sourceSeq: number;
1124
+ };
1125
+ }) | (Omit<EventInput, "payload" | "type"> & {
1126
+ readonly type: "runtime.run.launched";
1127
+ readonly payload: {
1128
+ readonly runId: string;
1129
+ readonly kind: string;
1130
+ readonly definitionName: string;
1131
+ readonly definitionVersion: string;
1132
+ readonly effectId: string;
1133
+ readonly close: "terminate" | "wait";
1134
+ };
1135
+ }) | (Omit<EventInput, "payload" | "type"> & {
1136
+ readonly type: "runtime.run.started";
1137
+ readonly payload: {
1138
+ readonly rootThreadId?: string | undefined;
1139
+ readonly kind: string;
1140
+ readonly definitionName: string;
1141
+ readonly definitionVersion: string;
1142
+ readonly input: import("effect/Schema").Json;
1143
+ readonly requestedThreadId?: string | null | undefined;
1144
+ readonly launchedBy?: {
1522
1145
  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;
1564
- };
1565
- }) | (Omit<EventInput, "payload" | "type"> & {
1566
- readonly type: "runtime.thread.cancel.requested";
1567
- readonly payload: {
1568
- readonly threadId: string;
1569
- };
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;
1576
- };
1577
- }) | (Omit<EventInput, "payload" | "type"> & {
1578
- readonly type: "runtime.thread.completed";
1579
- readonly payload: {
1580
1146
  readonly threadId: string;
1581
- readonly output: import("effect/Schema").Json;
1582
- };
1583
- }) | (Omit<EventInput, "payload" | "type"> & {
1584
- readonly type: "runtime.thread.failed";
1585
- readonly payload: {
1586
- readonly threadId: string;
1587
- readonly error: string;
1588
- };
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;
1147
+ readonly effectId: string;
1148
+ readonly causationId: string;
1149
+ readonly causationSeq: number;
1150
+ } | undefined;
1151
+ readonly attributes?: {
1152
+ readonly [x: string]: string;
1153
+ } | undefined;
1154
+ readonly trace?: {
1155
+ readonly traceparent: string;
1156
+ readonly tracestate?: string | undefined;
1157
+ } | undefined;
1158
+ };
1159
+ }) | (Omit<EventInput, "payload" | "type"> & {
1160
+ readonly type: "runtime.signal.received";
1161
+ readonly payload: {
1162
+ readonly signalType: string;
1163
+ };
1164
+ }) | (Omit<EventInput, "payload" | "type"> & {
1165
+ readonly type: "runtime.snapshot.taken";
1166
+ readonly payload: {
1167
+ readonly seq: number;
1168
+ readonly stateHash: string;
1169
+ readonly state?: import("effect/Schema").Json | undefined;
1170
+ };
1171
+ }) | (Omit<EventInput, "payload" | "type"> & {
1172
+ readonly type: "runtime.thread.cancel.requested";
1173
+ readonly payload: {
1174
+ readonly threadId: string;
1175
+ };
1176
+ }) | (Omit<EventInput, "payload" | "type"> & {
1177
+ readonly type: "runtime.thread.cancelled";
1178
+ readonly payload: {
1179
+ readonly threadId: string;
1180
+ readonly reason?: string | undefined;
1181
+ readonly resumeSeq?: number | undefined;
1182
+ };
1183
+ }) | (Omit<EventInput, "payload" | "type"> & {
1184
+ readonly type: "runtime.thread.completed";
1185
+ readonly payload: {
1186
+ readonly threadId: string;
1187
+ readonly output: import("effect/Schema").Json;
1188
+ };
1189
+ }) | (Omit<EventInput, "payload" | "type"> & {
1190
+ readonly type: "runtime.thread.failed";
1191
+ readonly payload: {
1192
+ readonly threadId: string;
1193
+ readonly error: string;
1194
+ };
1195
+ }) | (Omit<EventInput, "payload" | "type"> & {
1196
+ readonly type: "runtime.thread.started";
1197
+ readonly payload: {
1198
+ readonly threadId: string;
1199
+ readonly kind: string;
1200
+ readonly definitionName: string;
1201
+ readonly definitionVersion: string;
1202
+ readonly input: import("effect/Schema").Json;
1203
+ readonly parentThreadId: string | null;
1204
+ };
1205
+ }) | (Omit<EventInput, "payload" | "type"> & {
1206
+ readonly type: "runtime.timer.fired";
1207
+ readonly payload: {
1208
+ readonly timerId: string;
1209
+ readonly waitId: string;
1210
+ };
1211
+ }) | (Omit<EventInput, "payload" | "type"> & {
1212
+ readonly type: "runtime.timer.set";
1213
+ readonly payload: {
1214
+ readonly timerId: string;
1215
+ readonly waitId: string;
1216
+ readonly wakeAt: number;
1217
+ };
1218
+ }) | (Omit<EventInput, "payload" | "type"> & {
1219
+ readonly type: "runtime.wait.registered";
1220
+ readonly payload: {
1221
+ readonly waitId: string;
1222
+ readonly threadId?: string | undefined;
1223
+ readonly on: {
1224
+ readonly type: string | readonly string[];
1225
+ readonly match?: import("effect/Schema").Json | undefined;
1226
+ } | {
1227
+ readonly timerAt: number;
1598
1228
  };
1599
- }) | (Omit<EventInput, "payload" | "type"> & {
1600
- readonly type: "runtime.timer.fired";
1601
- readonly payload: {
1602
- readonly timerId: string;
1603
- readonly waitId: string;
1229
+ readonly tag?: import("effect/Schema").Json | undefined;
1230
+ };
1231
+ }) | (Omit<EventInput, "payload" | "type"> & {
1232
+ readonly type: "runtime.wait.satisfied";
1233
+ readonly payload: {
1234
+ readonly waitId: string;
1235
+ readonly tag?: import("effect/Schema").Json | undefined;
1236
+ readonly event: {
1237
+ readonly id: string;
1238
+ readonly type: string;
1239
+ readonly payload: import("effect/Schema").Json;
1604
1240
  };
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;
1241
+ };
1242
+ })>;
1243
+ }, {
1244
+ agent: import("@swirls/looms/core").ThreadDefinition<import("./types").AgentState>;
1245
+ 'agent-session': import("@swirls/looms/core").ThreadDefinition<import("./types").AgentSessionState>;
1246
+ }, {
1247
+ conversation: import("@swirls/looms/core").ProjectionDefinition<{
1248
+ readonly lines: {
1249
+ readonly role: "assistant" | "system" | "tool" | "user";
1250
+ readonly content: string;
1251
+ readonly toolCallId?: string | undefined;
1252
+ readonly name?: string | undefined;
1253
+ readonly toolCalls?: {
1254
+ readonly id: string;
1255
+ readonly name: string;
1256
+ readonly arguments: import("effect/Schema").Json;
1257
+ }[] | undefined;
1258
+ }[];
1259
+ }>;
1260
+ tokenUsage: import("@swirls/looms/core").ProjectionDefinition<{
1261
+ readonly input: number;
1262
+ readonly output: number;
1263
+ }>;
1264
+ turnActivity: import("@swirls/looms/core").ProjectionDefinition<{
1265
+ readonly rootThreadId: string | null;
1266
+ readonly active: boolean;
1267
+ }>;
1268
+ }, import("effect/Context").Service.Any, {
1269
+ userMessage: import("@swirls/looms/core").SignalDefinition<{
1270
+ readonly content: string;
1271
+ }, Omit<EventInput, "payload" | "type"> & {
1272
+ readonly type: "agent.message.received";
1273
+ readonly payload: {
1274
+ readonly message: {
1275
+ readonly role: "assistant" | "system" | "tool" | "user";
1276
+ readonly content: string;
1277
+ readonly toolCallId?: string | undefined;
1278
+ readonly name?: string | undefined;
1279
+ readonly toolCalls?: {
1280
+ readonly id: string;
1281
+ readonly name: string;
1282
+ readonly arguments: import("effect/Schema").Json;
1283
+ }[] | undefined;
1611
1284
  };
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;
1285
+ };
1286
+ }>;
1287
+ steer: import("@swirls/looms/core").SignalDefinition<{
1288
+ readonly content: string;
1289
+ readonly interrupt?: boolean | undefined;
1290
+ }, Omit<EventInput, "payload" | "type"> & {
1291
+ readonly type: "agent.steered";
1292
+ readonly payload: {
1293
+ readonly turn: number;
1294
+ readonly messageId?: string | undefined;
1295
+ readonly message: {
1296
+ readonly role: "assistant" | "system" | "tool" | "user";
1297
+ readonly content: string;
1298
+ readonly toolCallId?: string | undefined;
1299
+ readonly name?: string | undefined;
1300
+ readonly toolCalls?: {
1301
+ readonly id: string;
1302
+ readonly name: string;
1303
+ readonly arguments: import("effect/Schema").Json;
1304
+ }[] | undefined;
1624
1305
  };
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: {
1306
+ readonly interrupt?: boolean | undefined;
1307
+ };
1308
+ }>;
1309
+ stopAgentTurn: import("@swirls/looms/core").SignalDefinition<undefined, Omit<EventInput, "payload" | "type"> & {
1310
+ readonly type: "agent.turn.stopped";
1311
+ readonly payload: {};
1312
+ }>;
1313
+ submitAgentMessage: import("@swirls/looms/core").SignalDefinition<{
1314
+ readonly messageId: string;
1315
+ readonly text: string;
1316
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1317
+ readonly activeChildThreadId?: string | undefined;
1318
+ }, Omit<EventInput, "payload" | "type"> & {
1319
+ readonly type: "agent.session.message.submitted";
1320
+ readonly payload: {
1321
+ readonly messageId: string;
1322
+ readonly text: string;
1323
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1324
+ readonly activeChildThreadId?: string | undefined;
1325
+ };
1326
+ }>;
1327
+ cancelAgentTurn: import("@swirls/looms/core").SignalDefinition<{
1328
+ readonly childThreadId: string;
1329
+ }, ({
1330
+ type: 'runtime.thread.cancel.requested';
1331
+ payload: {
1332
+ threadId: string;
1333
+ };
1334
+ } | (Omit<EventInput, "payload" | "type"> & {
1335
+ readonly type: "agent.session.cancel.requested";
1336
+ readonly payload: {};
1337
+ }))[]>;
1338
+ agentSessionMessageEvents: import("@swirls/looms/core").SignalDefinition<{
1339
+ readonly messageId: string;
1340
+ readonly text: string;
1341
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1342
+ readonly activeChildThreadId?: string | undefined;
1343
+ }, ((Omit<EventInput, "payload" | "type"> & {
1344
+ readonly type: "agent.session.message.submitted";
1345
+ readonly payload: {
1346
+ readonly messageId: string;
1347
+ readonly text: string;
1348
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1349
+ readonly activeChildThreadId?: string | undefined;
1350
+ };
1351
+ }) | (Omit<EventInput, "payload" | "type"> & {
1352
+ readonly type: "agent.steered";
1353
+ readonly payload: {
1354
+ readonly turn: number;
1355
+ readonly messageId?: string | undefined;
1356
+ readonly message: {
1357
+ readonly role: "assistant" | "system" | "tool" | "user";
1358
+ readonly content: string;
1359
+ readonly toolCallId?: string | undefined;
1360
+ readonly name?: string | undefined;
1361
+ readonly toolCalls?: {
1631
1362
  readonly id: string;
1632
- readonly type: string;
1633
- readonly payload: import("effect/Schema").Json;
1634
- };
1363
+ readonly name: string;
1364
+ readonly arguments: import("effect/Schema").Json;
1365
+ }[] | undefined;
1635
1366
  };
1636
- }) | (Omit<EventInput, "payload" | "type"> & {
1367
+ readonly interrupt?: boolean | undefined;
1368
+ };
1369
+ }))[]>;
1370
+ }, {}> & {
1371
+ readonly effects: {
1372
+ callLLM: import("@swirls/looms/core").LocalEffectDefinition<{
1373
+ readonly turn: number;
1374
+ readonly messageTurn?: number | undefined;
1375
+ readonly definitionName?: string | undefined;
1376
+ readonly definitionVersion: string;
1377
+ readonly messages?: readonly {
1378
+ readonly role: "assistant" | "system" | "tool" | "user";
1379
+ readonly content: string;
1380
+ readonly toolCallId?: string | undefined;
1381
+ readonly name?: string | undefined;
1382
+ readonly toolCalls?: {
1383
+ readonly id: string;
1384
+ readonly name: string;
1385
+ readonly arguments: import("effect/Schema").Json;
1386
+ }[] | undefined;
1387
+ }[] | undefined;
1388
+ readonly input?: import("effect/Schema").Json | undefined;
1389
+ readonly structuredOutput?: import("effect/Schema").Json | undefined;
1390
+ readonly alreadyCompacted?: boolean | undefined;
1391
+ readonly consumedSteerMessageIds?: readonly string[] | undefined;
1392
+ }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
1637
1393
  readonly type: "agent.context.compacted";
1638
1394
  readonly payload: {
1639
1395
  readonly turn: number;
@@ -1881,19 +1637,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1881
1637
  readonly input: number;
1882
1638
  readonly output: number;
1883
1639
  };
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"> & {
1640
+ }) | (Omit<EventInput, "payload" | "type"> & {
1897
1641
  readonly type: "runtime.child.close.requested";
1898
1642
  readonly payload: {
1899
1643
  readonly policy: "terminate" | "wait";
@@ -2139,7 +1883,19 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
2139
1883
  readonly payload: import("effect/Schema").Json;
2140
1884
  };
2141
1885
  };
2142
- }) | (Omit<EventInput, "payload" | "type"> & {
1886
+ })>;
1887
+ executeTool: import("@swirls/looms/core").LocalEffectDefinition<{
1888
+ readonly turn: number;
1889
+ readonly definitionName?: string | undefined;
1890
+ readonly definitionVersion: string;
1891
+ readonly toolCall: {
1892
+ readonly id: string;
1893
+ readonly name: string;
1894
+ readonly arguments: import("effect/Schema").Json;
1895
+ };
1896
+ readonly input?: import("effect/Schema").Json | undefined;
1897
+ readonly depth?: number | undefined;
1898
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
2143
1899
  readonly type: "agent.context.compacted";
2144
1900
  readonly payload: {
2145
1901
  readonly turn: number;
@@ -2387,6 +2143,252 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
2387
2143
  readonly input: number;
2388
2144
  readonly output: number;
2389
2145
  };
2146
+ }) | (Omit<EventInput, "payload" | "type"> & {
2147
+ readonly type: "runtime.child.close.requested";
2148
+ readonly payload: {
2149
+ readonly policy: "terminate" | "wait";
2150
+ };
2151
+ }) | (Omit<EventInput, "payload" | "type"> & {
2152
+ readonly type: "runtime.child.settled";
2153
+ readonly payload: {
2154
+ readonly runId: string;
2155
+ readonly status: "cancelled" | "completed" | "failed";
2156
+ readonly output: import("effect/Schema").Json;
2157
+ readonly error: string | null;
2158
+ };
2159
+ }) | (Omit<EventInput, "payload" | "type"> & {
2160
+ readonly type: "runtime.effect.ambiguous";
2161
+ readonly payload: {
2162
+ readonly effectId: string;
2163
+ readonly attempt: number;
2164
+ readonly error: string;
2165
+ };
2166
+ }) | (Omit<EventInput, "payload" | "type"> & {
2167
+ readonly type: "runtime.effect.attempt.started";
2168
+ readonly payload: {
2169
+ readonly effectId: string;
2170
+ readonly attempt: number;
2171
+ };
2172
+ }) | (Omit<EventInput, "payload" | "type"> & {
2173
+ readonly type: "runtime.effect.cancel.requested";
2174
+ readonly payload: {
2175
+ readonly effectId: string;
2176
+ readonly attempt: number;
2177
+ readonly deadlineAt: number | null;
2178
+ };
2179
+ }) | (Omit<EventInput, "payload" | "type"> & {
2180
+ readonly type: "runtime.effect.cancelled";
2181
+ readonly payload: {
2182
+ readonly effectId: string;
2183
+ readonly attempt: number;
2184
+ };
2185
+ }) | (Omit<EventInput, "payload" | "type"> & {
2186
+ readonly type: "runtime.effect.completed";
2187
+ readonly payload: {
2188
+ readonly effectId: string;
2189
+ readonly attempt: number;
2190
+ };
2191
+ }) | (Omit<EventInput, "payload" | "type"> & {
2192
+ readonly type: "runtime.effect.dispatch.deferred";
2193
+ readonly payload: {
2194
+ readonly effectId: string;
2195
+ readonly attempt: number;
2196
+ readonly retryAt: number;
2197
+ readonly error: string;
2198
+ readonly try: number;
2199
+ };
2200
+ }) | (Omit<EventInput, "payload" | "type"> & {
2201
+ readonly type: "runtime.effect.dispatched";
2202
+ readonly payload: {
2203
+ readonly effectId: string;
2204
+ readonly attempt: number;
2205
+ readonly deadlineAt: number | null;
2206
+ };
2207
+ }) | (Omit<EventInput, "payload" | "type"> & {
2208
+ readonly type: "runtime.effect.failed";
2209
+ readonly payload: {
2210
+ readonly effectId: string;
2211
+ readonly error: string;
2212
+ readonly nonRetryable?: boolean | undefined;
2213
+ readonly retryAfterMs?: number | undefined;
2214
+ };
2215
+ }) | (Omit<EventInput, "payload" | "type"> & {
2216
+ readonly type: "runtime.effect.heartbeat";
2217
+ readonly payload: {
2218
+ readonly effectId: string;
2219
+ readonly attempt: number;
2220
+ readonly heartbeatAt: number;
2221
+ readonly deadlineAt: number | null;
2222
+ readonly details?: import("effect/Schema").Json | undefined;
2223
+ };
2224
+ }) | (Omit<EventInput, "payload" | "type"> & {
2225
+ readonly type: "runtime.effect.queued";
2226
+ readonly payload: {
2227
+ readonly effectId: string;
2228
+ readonly attempt: number;
2229
+ readonly deadlineAt: number | null;
2230
+ };
2231
+ }) | (Omit<EventInput, "payload" | "type"> & {
2232
+ readonly type: "runtime.effect.retry.scheduled";
2233
+ readonly payload: {
2234
+ readonly effectId: string;
2235
+ readonly attempt: number;
2236
+ readonly nextAttemptAt: number;
2237
+ readonly error: string;
2238
+ };
2239
+ }) | (Omit<EventInput, "payload" | "type"> & {
2240
+ readonly type: "runtime.effect.timed_out";
2241
+ readonly payload: {
2242
+ readonly effectId: string;
2243
+ readonly attempt: number;
2244
+ readonly timeout: string;
2245
+ };
2246
+ }) | (Omit<EventInput, "payload" | "type"> & {
2247
+ readonly type: "runtime.effect.worker.started";
2248
+ readonly payload: {
2249
+ readonly effectId: string;
2250
+ readonly attempt: number;
2251
+ readonly deadlineAt: number | null;
2252
+ };
2253
+ }) | (Omit<EventInput, "payload" | "type"> & {
2254
+ readonly type: "runtime.fork.elided";
2255
+ readonly payload: {
2256
+ readonly type: string;
2257
+ };
2258
+ }) | (Omit<EventInput, "payload" | "type"> & {
2259
+ readonly type: "runtime.run.cancelled";
2260
+ readonly payload: {
2261
+ readonly reason?: string | undefined;
2262
+ };
2263
+ }) | (Omit<EventInput, "payload" | "type"> & {
2264
+ readonly type: "runtime.run.completed";
2265
+ readonly payload: {
2266
+ readonly output: import("effect/Schema").Json;
2267
+ readonly error: string | null;
2268
+ };
2269
+ }) | (Omit<EventInput, "payload" | "type"> & {
2270
+ readonly type: "runtime.run.forked";
2271
+ readonly payload: {
2272
+ readonly sourceRunId: string;
2273
+ readonly sourceSeq: number;
2274
+ };
2275
+ }) | (Omit<EventInput, "payload" | "type"> & {
2276
+ readonly type: "runtime.run.launched";
2277
+ readonly payload: {
2278
+ readonly runId: string;
2279
+ readonly kind: string;
2280
+ readonly definitionName: string;
2281
+ readonly definitionVersion: string;
2282
+ readonly effectId: string;
2283
+ readonly close: "terminate" | "wait";
2284
+ };
2285
+ }) | (Omit<EventInput, "payload" | "type"> & {
2286
+ readonly type: "runtime.run.started";
2287
+ readonly payload: {
2288
+ readonly rootThreadId?: string | undefined;
2289
+ readonly kind: string;
2290
+ readonly definitionName: string;
2291
+ readonly definitionVersion: string;
2292
+ readonly input: import("effect/Schema").Json;
2293
+ readonly requestedThreadId?: string | null | undefined;
2294
+ readonly launchedBy?: {
2295
+ readonly runId: string;
2296
+ readonly threadId: string;
2297
+ readonly effectId: string;
2298
+ readonly causationId: string;
2299
+ readonly causationSeq: number;
2300
+ } | undefined;
2301
+ readonly attributes?: {
2302
+ readonly [x: string]: string;
2303
+ } | undefined;
2304
+ readonly trace?: {
2305
+ readonly traceparent: string;
2306
+ readonly tracestate?: string | undefined;
2307
+ } | undefined;
2308
+ };
2309
+ }) | (Omit<EventInput, "payload" | "type"> & {
2310
+ readonly type: "runtime.signal.received";
2311
+ readonly payload: {
2312
+ readonly signalType: string;
2313
+ };
2314
+ }) | (Omit<EventInput, "payload" | "type"> & {
2315
+ readonly type: "runtime.snapshot.taken";
2316
+ readonly payload: {
2317
+ readonly seq: number;
2318
+ readonly stateHash: string;
2319
+ readonly state?: import("effect/Schema").Json | undefined;
2320
+ };
2321
+ }) | (Omit<EventInput, "payload" | "type"> & {
2322
+ readonly type: "runtime.thread.cancel.requested";
2323
+ readonly payload: {
2324
+ readonly threadId: string;
2325
+ };
2326
+ }) | (Omit<EventInput, "payload" | "type"> & {
2327
+ readonly type: "runtime.thread.cancelled";
2328
+ readonly payload: {
2329
+ readonly threadId: string;
2330
+ readonly reason?: string | undefined;
2331
+ readonly resumeSeq?: number | undefined;
2332
+ };
2333
+ }) | (Omit<EventInput, "payload" | "type"> & {
2334
+ readonly type: "runtime.thread.completed";
2335
+ readonly payload: {
2336
+ readonly threadId: string;
2337
+ readonly output: import("effect/Schema").Json;
2338
+ };
2339
+ }) | (Omit<EventInput, "payload" | "type"> & {
2340
+ readonly type: "runtime.thread.failed";
2341
+ readonly payload: {
2342
+ readonly threadId: string;
2343
+ readonly error: string;
2344
+ };
2345
+ }) | (Omit<EventInput, "payload" | "type"> & {
2346
+ readonly type: "runtime.thread.started";
2347
+ readonly payload: {
2348
+ readonly threadId: string;
2349
+ readonly kind: string;
2350
+ readonly definitionName: string;
2351
+ readonly definitionVersion: string;
2352
+ readonly input: import("effect/Schema").Json;
2353
+ readonly parentThreadId: string | null;
2354
+ };
2355
+ }) | (Omit<EventInput, "payload" | "type"> & {
2356
+ readonly type: "runtime.timer.fired";
2357
+ readonly payload: {
2358
+ readonly timerId: string;
2359
+ readonly waitId: string;
2360
+ };
2361
+ }) | (Omit<EventInput, "payload" | "type"> & {
2362
+ readonly type: "runtime.timer.set";
2363
+ readonly payload: {
2364
+ readonly timerId: string;
2365
+ readonly waitId: string;
2366
+ readonly wakeAt: number;
2367
+ };
2368
+ }) | (Omit<EventInput, "payload" | "type"> & {
2369
+ readonly type: "runtime.wait.registered";
2370
+ readonly payload: {
2371
+ readonly waitId: string;
2372
+ readonly threadId?: string | undefined;
2373
+ readonly on: {
2374
+ readonly type: string | readonly string[];
2375
+ readonly match?: import("effect/Schema").Json | undefined;
2376
+ } | {
2377
+ readonly timerAt: number;
2378
+ };
2379
+ readonly tag?: import("effect/Schema").Json | undefined;
2380
+ };
2381
+ }) | (Omit<EventInput, "payload" | "type"> & {
2382
+ readonly type: "runtime.wait.satisfied";
2383
+ readonly payload: {
2384
+ readonly waitId: string;
2385
+ readonly tag?: import("effect/Schema").Json | undefined;
2386
+ readonly event: {
2387
+ readonly id: string;
2388
+ readonly type: string;
2389
+ readonly payload: import("effect/Schema").Json;
2390
+ };
2391
+ };
2390
2392
  })>;
2391
2393
  };
2392
2394
  readonly threads: {