@swirls/looms 0.3.0 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -189,6 +189,198 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
189
189
  readonly input?: import("effect/Schema").Json | undefined;
190
190
  readonly consumedSteerMessageIds?: readonly string[] | undefined;
191
191
  }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
192
+ readonly type: "agent.effects.requested";
193
+ readonly payload: {
194
+ readonly toolCallId: string;
195
+ readonly effects: readonly ({
196
+ readonly type: "runtime.spawn";
197
+ readonly childThreadId: string;
198
+ readonly kind: string;
199
+ readonly definitionName: string;
200
+ readonly definitionVersion: string;
201
+ readonly input: import("effect/Schema").Json;
202
+ } | {
203
+ readonly type: "runtime.wait";
204
+ readonly waitId: string;
205
+ readonly on: {
206
+ readonly type: string | readonly string[];
207
+ readonly match?: import("effect/Schema").Json | undefined;
208
+ } | {
209
+ readonly timerAt: number;
210
+ };
211
+ readonly tag?: import("effect/Schema").Json | undefined;
212
+ } | {
213
+ readonly type: "runtime.emit";
214
+ readonly event: {
215
+ readonly type: string;
216
+ readonly payload: import("effect/Schema").Json;
217
+ readonly threadId?: string | null | undefined;
218
+ readonly parentThreadId?: string | null | undefined;
219
+ readonly causationId?: string | null | undefined;
220
+ readonly correlationId?: string | null | undefined;
221
+ readonly effectId?: string | null | undefined;
222
+ readonly origin?: {
223
+ readonly type: "thread";
224
+ readonly threadId: string;
225
+ } | {
226
+ readonly type: "external";
227
+ readonly actorId?: string | undefined;
228
+ } | {
229
+ readonly type: "system";
230
+ } | undefined;
231
+ readonly ephemeral?: boolean | undefined;
232
+ readonly id?: string | undefined;
233
+ readonly ts?: number | undefined;
234
+ readonly idempotencyKey?: string | null | undefined;
235
+ };
236
+ readonly tag?: string | undefined;
237
+ } | {
238
+ readonly type: "runtime.complete";
239
+ readonly output: import("effect/Schema").Json;
240
+ } | {
241
+ readonly type: "runtime.fail";
242
+ readonly error: string;
243
+ } | {
244
+ readonly type: "runtime.cancel";
245
+ readonly threadId: string;
246
+ readonly tag?: string | undefined;
247
+ } | {
248
+ readonly type: string;
249
+ readonly input: import("effect/Schema").Json;
250
+ readonly tag?: string | undefined;
251
+ })[];
252
+ readonly waitOn?: {
253
+ readonly type: string | readonly string[];
254
+ readonly match?: import("effect/Schema").Json | undefined;
255
+ } | undefined;
256
+ };
257
+ }) | (Omit<EventInput, "payload" | "type"> & {
258
+ readonly type: "agent.message";
259
+ readonly payload: {
260
+ readonly turn: number;
261
+ readonly message: {
262
+ readonly role: "assistant" | "system" | "tool" | "user";
263
+ readonly content: string;
264
+ readonly toolCallId?: string | undefined;
265
+ readonly name?: string | undefined;
266
+ readonly toolCalls?: {
267
+ readonly id: string;
268
+ readonly name: string;
269
+ readonly arguments: import("effect/Schema").Json;
270
+ }[] | undefined;
271
+ };
272
+ readonly usage?: {
273
+ readonly input: number;
274
+ readonly output: number;
275
+ } | undefined;
276
+ };
277
+ }) | (Omit<EventInput, "payload" | "type"> & {
278
+ readonly type: "agent.message.received";
279
+ readonly payload: {
280
+ readonly message: {
281
+ readonly role: "assistant" | "system" | "tool" | "user";
282
+ readonly content: string;
283
+ readonly toolCallId?: string | undefined;
284
+ readonly name?: string | undefined;
285
+ readonly toolCalls?: {
286
+ readonly id: string;
287
+ readonly name: string;
288
+ readonly arguments: import("effect/Schema").Json;
289
+ }[] | undefined;
290
+ };
291
+ };
292
+ }) | (Omit<EventInput, "payload" | "type"> & {
293
+ readonly type: "agent.session.cancel.requested";
294
+ readonly payload: {};
295
+ }) | (Omit<EventInput, "payload" | "type"> & {
296
+ readonly type: "agent.session.message.submitted";
297
+ readonly payload: {
298
+ readonly messageId: string;
299
+ readonly text: string;
300
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
301
+ readonly activeChildThreadId?: string | undefined;
302
+ };
303
+ }) | (Omit<EventInput, "payload" | "type"> & {
304
+ readonly type: "agent.session.steer.delivered";
305
+ readonly payload: {
306
+ readonly messageId: string;
307
+ readonly activeMessageId: string;
308
+ };
309
+ }) | (Omit<EventInput, "payload" | "type"> & {
310
+ readonly type: "agent.session.turn.closed";
311
+ readonly payload: {
312
+ readonly messageId: string;
313
+ readonly status: "cancelled" | "completed" | "failed";
314
+ readonly error?: string | undefined;
315
+ };
316
+ }) | (Omit<EventInput, "payload" | "type"> & {
317
+ readonly type: "agent.session.turn.started";
318
+ readonly payload: {
319
+ readonly messageId: string;
320
+ readonly childThreadId: string;
321
+ };
322
+ }) | (Omit<EventInput, "payload" | "type"> & {
323
+ readonly type: "agent.spawn.requested";
324
+ readonly payload: {
325
+ readonly childThreadId: string;
326
+ readonly kind: string;
327
+ readonly definitionName: string;
328
+ readonly definitionVersion: string;
329
+ readonly toolCallId: string;
330
+ readonly input: import("effect/Schema").Json;
331
+ };
332
+ }) | (Omit<EventInput, "payload" | "type"> & {
333
+ readonly type: "agent.steered";
334
+ readonly payload: {
335
+ readonly turn: number;
336
+ readonly messageId?: string | undefined;
337
+ readonly message: {
338
+ readonly role: "assistant" | "system" | "tool" | "user";
339
+ readonly content: string;
340
+ readonly toolCallId?: string | undefined;
341
+ readonly name?: string | undefined;
342
+ readonly toolCalls?: {
343
+ readonly id: string;
344
+ readonly name: string;
345
+ readonly arguments: import("effect/Schema").Json;
346
+ }[] | undefined;
347
+ };
348
+ readonly interrupt?: boolean | undefined;
349
+ };
350
+ }) | (Omit<EventInput, "payload" | "type"> & {
351
+ readonly type: "agent.tool.result";
352
+ readonly payload: {
353
+ readonly turn: number;
354
+ readonly toolCallId: string;
355
+ readonly name: string;
356
+ readonly result: import("effect/Schema").Json;
357
+ readonly error: string | null;
358
+ };
359
+ }) | (Omit<EventInput, "payload" | "type"> & {
360
+ readonly type: "agent.tool_call.requested";
361
+ readonly payload: {
362
+ readonly turn: number;
363
+ readonly toolCall: {
364
+ readonly id: string;
365
+ readonly name: string;
366
+ readonly arguments: import("effect/Schema").Json;
367
+ };
368
+ };
369
+ }) | (Omit<EventInput, "payload" | "type"> & {
370
+ readonly type: "agent.turn.started";
371
+ readonly payload: {
372
+ readonly turn: number;
373
+ };
374
+ }) | (Omit<EventInput, "payload" | "type"> & {
375
+ readonly type: "agent.turn.stopped";
376
+ readonly payload: {};
377
+ }) | (Omit<EventInput, "payload" | "type"> & {
378
+ readonly type: "agent.turn.text_delta";
379
+ readonly payload: {
380
+ readonly turn: number;
381
+ readonly delta: string;
382
+ };
383
+ }) | (Omit<EventInput, "payload" | "type"> & {
192
384
  readonly type: "runtime.effect.ambiguous";
193
385
  readonly payload: {
194
386
  readonly effectId: string;
@@ -385,7 +577,17 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
385
577
  readonly payload: import("effect/Schema").Json;
386
578
  };
387
579
  };
388
- }) | (Omit<EventInput, "payload" | "type"> & {
580
+ })>;
581
+ executeTool: import("@swirls/looms/core").EffectDefinition<{
582
+ readonly turn: number;
583
+ readonly definitionName?: string | undefined;
584
+ readonly definitionVersion: string;
585
+ readonly toolCall: {
586
+ readonly id: string;
587
+ readonly name: string;
588
+ readonly arguments: import("effect/Schema").Json;
589
+ };
590
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
389
591
  readonly type: "agent.effects.requested";
390
592
  readonly payload: {
391
593
  readonly toolCallId: string;
@@ -577,17 +779,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
577
779
  readonly turn: number;
578
780
  readonly delta: string;
579
781
  };
580
- })>;
581
- executeTool: import("@swirls/looms/core").EffectDefinition<{
582
- readonly turn: number;
583
- readonly definitionName?: string | undefined;
584
- readonly definitionVersion: string;
585
- readonly toolCall: {
586
- readonly id: string;
587
- readonly name: string;
588
- readonly arguments: import("effect/Schema").Json;
589
- };
590
- }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
782
+ }) | (Omit<EventInput, "payload" | "type"> & {
591
783
  readonly type: "runtime.effect.ambiguous";
592
784
  readonly payload: {
593
785
  readonly effectId: string;
@@ -784,198 +976,6 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
784
976
  readonly payload: import("effect/Schema").Json;
785
977
  };
786
978
  };
787
- }) | (Omit<EventInput, "payload" | "type"> & {
788
- readonly type: "agent.effects.requested";
789
- readonly payload: {
790
- readonly toolCallId: string;
791
- readonly effects: readonly ({
792
- readonly type: "runtime.spawn";
793
- readonly childThreadId: string;
794
- readonly kind: string;
795
- readonly definitionName: string;
796
- readonly definitionVersion: string;
797
- readonly input: import("effect/Schema").Json;
798
- } | {
799
- readonly type: "runtime.wait";
800
- readonly waitId: string;
801
- readonly on: {
802
- readonly type: string | readonly string[];
803
- readonly match?: import("effect/Schema").Json | undefined;
804
- } | {
805
- readonly timerAt: number;
806
- };
807
- readonly tag?: import("effect/Schema").Json | undefined;
808
- } | {
809
- readonly type: "runtime.emit";
810
- readonly event: {
811
- readonly type: string;
812
- readonly payload: import("effect/Schema").Json;
813
- readonly threadId?: string | null | undefined;
814
- readonly parentThreadId?: string | null | undefined;
815
- readonly causationId?: string | null | undefined;
816
- readonly correlationId?: string | null | undefined;
817
- readonly effectId?: string | null | undefined;
818
- readonly origin?: {
819
- readonly type: "thread";
820
- readonly threadId: string;
821
- } | {
822
- readonly type: "external";
823
- readonly actorId?: string | undefined;
824
- } | {
825
- readonly type: "system";
826
- } | undefined;
827
- readonly ephemeral?: boolean | undefined;
828
- readonly id?: string | undefined;
829
- readonly ts?: number | undefined;
830
- readonly idempotencyKey?: string | null | undefined;
831
- };
832
- readonly tag?: string | undefined;
833
- } | {
834
- readonly type: "runtime.complete";
835
- readonly output: import("effect/Schema").Json;
836
- } | {
837
- readonly type: "runtime.fail";
838
- readonly error: string;
839
- } | {
840
- readonly type: "runtime.cancel";
841
- readonly threadId: string;
842
- readonly tag?: string | undefined;
843
- } | {
844
- readonly type: string;
845
- readonly input: import("effect/Schema").Json;
846
- readonly tag?: string | undefined;
847
- })[];
848
- readonly waitOn?: {
849
- readonly type: string | readonly string[];
850
- readonly match?: import("effect/Schema").Json | undefined;
851
- } | undefined;
852
- };
853
- }) | (Omit<EventInput, "payload" | "type"> & {
854
- readonly type: "agent.message";
855
- readonly payload: {
856
- readonly turn: number;
857
- readonly message: {
858
- readonly role: "assistant" | "system" | "tool" | "user";
859
- readonly content: string;
860
- readonly toolCallId?: string | undefined;
861
- readonly name?: string | undefined;
862
- readonly toolCalls?: {
863
- readonly id: string;
864
- readonly name: string;
865
- readonly arguments: import("effect/Schema").Json;
866
- }[] | undefined;
867
- };
868
- readonly usage?: {
869
- readonly input: number;
870
- readonly output: number;
871
- } | undefined;
872
- };
873
- }) | (Omit<EventInput, "payload" | "type"> & {
874
- readonly type: "agent.message.received";
875
- readonly payload: {
876
- readonly message: {
877
- readonly role: "assistant" | "system" | "tool" | "user";
878
- readonly content: string;
879
- readonly toolCallId?: string | undefined;
880
- readonly name?: string | undefined;
881
- readonly toolCalls?: {
882
- readonly id: string;
883
- readonly name: string;
884
- readonly arguments: import("effect/Schema").Json;
885
- }[] | undefined;
886
- };
887
- };
888
- }) | (Omit<EventInput, "payload" | "type"> & {
889
- readonly type: "agent.session.cancel.requested";
890
- readonly payload: {};
891
- }) | (Omit<EventInput, "payload" | "type"> & {
892
- readonly type: "agent.session.message.submitted";
893
- readonly payload: {
894
- readonly messageId: string;
895
- readonly text: string;
896
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
897
- readonly activeChildThreadId?: string | undefined;
898
- };
899
- }) | (Omit<EventInput, "payload" | "type"> & {
900
- readonly type: "agent.session.steer.delivered";
901
- readonly payload: {
902
- readonly messageId: string;
903
- readonly activeMessageId: string;
904
- };
905
- }) | (Omit<EventInput, "payload" | "type"> & {
906
- readonly type: "agent.session.turn.closed";
907
- readonly payload: {
908
- readonly messageId: string;
909
- readonly status: "cancelled" | "completed" | "failed";
910
- readonly error?: string | undefined;
911
- };
912
- }) | (Omit<EventInput, "payload" | "type"> & {
913
- readonly type: "agent.session.turn.started";
914
- readonly payload: {
915
- readonly messageId: string;
916
- readonly childThreadId: string;
917
- };
918
- }) | (Omit<EventInput, "payload" | "type"> & {
919
- readonly type: "agent.spawn.requested";
920
- readonly payload: {
921
- readonly childThreadId: string;
922
- readonly kind: string;
923
- readonly definitionName: string;
924
- readonly definitionVersion: string;
925
- readonly toolCallId: string;
926
- readonly input: import("effect/Schema").Json;
927
- };
928
- }) | (Omit<EventInput, "payload" | "type"> & {
929
- readonly type: "agent.steered";
930
- readonly payload: {
931
- readonly turn: number;
932
- readonly messageId?: string | undefined;
933
- readonly message: {
934
- readonly role: "assistant" | "system" | "tool" | "user";
935
- readonly content: string;
936
- readonly toolCallId?: string | undefined;
937
- readonly name?: string | undefined;
938
- readonly toolCalls?: {
939
- readonly id: string;
940
- readonly name: string;
941
- readonly arguments: import("effect/Schema").Json;
942
- }[] | undefined;
943
- };
944
- readonly interrupt?: boolean | undefined;
945
- };
946
- }) | (Omit<EventInput, "payload" | "type"> & {
947
- readonly type: "agent.tool.result";
948
- readonly payload: {
949
- readonly turn: number;
950
- readonly toolCallId: string;
951
- readonly name: string;
952
- readonly result: import("effect/Schema").Json;
953
- readonly error: string | null;
954
- };
955
- }) | (Omit<EventInput, "payload" | "type"> & {
956
- readonly type: "agent.tool_call.requested";
957
- readonly payload: {
958
- readonly turn: number;
959
- readonly toolCall: {
960
- readonly id: string;
961
- readonly name: string;
962
- readonly arguments: import("effect/Schema").Json;
963
- };
964
- };
965
- }) | (Omit<EventInput, "payload" | "type"> & {
966
- readonly type: "agent.turn.started";
967
- readonly payload: {
968
- readonly turn: number;
969
- };
970
- }) | (Omit<EventInput, "payload" | "type"> & {
971
- readonly type: "agent.turn.stopped";
972
- readonly payload: {};
973
- }) | (Omit<EventInput, "payload" | "type"> & {
974
- readonly type: "agent.turn.text_delta";
975
- readonly payload: {
976
- readonly turn: number;
977
- readonly delta: string;
978
- };
979
979
  })>;
980
980
  }, {
981
981
  agent: import("@swirls/looms/core").ThreadDefinition<import("./types").AgentState>;
@@ -1017,11 +1017,203 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1017
1017
  readonly id: string;
1018
1018
  readonly name: string;
1019
1019
  readonly arguments: import("effect/Schema").Json;
1020
- }[] | undefined;
1021
- }[] | undefined;
1022
- readonly input?: import("effect/Schema").Json | undefined;
1023
- readonly consumedSteerMessageIds?: readonly string[] | undefined;
1024
- }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
1020
+ }[] | undefined;
1021
+ }[] | undefined;
1022
+ readonly input?: import("effect/Schema").Json | undefined;
1023
+ readonly consumedSteerMessageIds?: readonly string[] | undefined;
1024
+ }, import("./definitions-store").AgentDefinitionsTag | LlmTag, (Omit<EventInput, "payload" | "type"> & {
1025
+ readonly type: "agent.effects.requested";
1026
+ readonly payload: {
1027
+ readonly toolCallId: string;
1028
+ readonly effects: readonly ({
1029
+ readonly type: "runtime.spawn";
1030
+ readonly childThreadId: string;
1031
+ readonly kind: string;
1032
+ readonly definitionName: string;
1033
+ readonly definitionVersion: string;
1034
+ readonly input: import("effect/Schema").Json;
1035
+ } | {
1036
+ readonly type: "runtime.wait";
1037
+ readonly waitId: string;
1038
+ readonly on: {
1039
+ readonly type: string | readonly string[];
1040
+ readonly match?: import("effect/Schema").Json | undefined;
1041
+ } | {
1042
+ readonly timerAt: number;
1043
+ };
1044
+ readonly tag?: import("effect/Schema").Json | undefined;
1045
+ } | {
1046
+ readonly type: "runtime.emit";
1047
+ readonly event: {
1048
+ readonly type: string;
1049
+ readonly payload: import("effect/Schema").Json;
1050
+ readonly threadId?: string | null | undefined;
1051
+ readonly parentThreadId?: string | null | undefined;
1052
+ readonly causationId?: string | null | undefined;
1053
+ readonly correlationId?: string | null | undefined;
1054
+ readonly effectId?: string | null | undefined;
1055
+ readonly origin?: {
1056
+ readonly type: "thread";
1057
+ readonly threadId: string;
1058
+ } | {
1059
+ readonly type: "external";
1060
+ readonly actorId?: string | undefined;
1061
+ } | {
1062
+ readonly type: "system";
1063
+ } | undefined;
1064
+ readonly ephemeral?: boolean | undefined;
1065
+ readonly id?: string | undefined;
1066
+ readonly ts?: number | undefined;
1067
+ readonly idempotencyKey?: string | null | undefined;
1068
+ };
1069
+ readonly tag?: string | undefined;
1070
+ } | {
1071
+ readonly type: "runtime.complete";
1072
+ readonly output: import("effect/Schema").Json;
1073
+ } | {
1074
+ readonly type: "runtime.fail";
1075
+ readonly error: string;
1076
+ } | {
1077
+ readonly type: "runtime.cancel";
1078
+ readonly threadId: string;
1079
+ readonly tag?: string | undefined;
1080
+ } | {
1081
+ readonly type: string;
1082
+ readonly input: import("effect/Schema").Json;
1083
+ readonly tag?: string | undefined;
1084
+ })[];
1085
+ readonly waitOn?: {
1086
+ readonly type: string | readonly string[];
1087
+ readonly match?: import("effect/Schema").Json | undefined;
1088
+ } | undefined;
1089
+ };
1090
+ }) | (Omit<EventInput, "payload" | "type"> & {
1091
+ readonly type: "agent.message";
1092
+ readonly payload: {
1093
+ readonly turn: number;
1094
+ readonly message: {
1095
+ readonly role: "assistant" | "system" | "tool" | "user";
1096
+ readonly content: string;
1097
+ readonly toolCallId?: string | undefined;
1098
+ readonly name?: string | undefined;
1099
+ readonly toolCalls?: {
1100
+ readonly id: string;
1101
+ readonly name: string;
1102
+ readonly arguments: import("effect/Schema").Json;
1103
+ }[] | undefined;
1104
+ };
1105
+ readonly usage?: {
1106
+ readonly input: number;
1107
+ readonly output: number;
1108
+ } | undefined;
1109
+ };
1110
+ }) | (Omit<EventInput, "payload" | "type"> & {
1111
+ readonly type: "agent.message.received";
1112
+ readonly payload: {
1113
+ readonly message: {
1114
+ readonly role: "assistant" | "system" | "tool" | "user";
1115
+ readonly content: string;
1116
+ readonly toolCallId?: string | undefined;
1117
+ readonly name?: string | undefined;
1118
+ readonly toolCalls?: {
1119
+ readonly id: string;
1120
+ readonly name: string;
1121
+ readonly arguments: import("effect/Schema").Json;
1122
+ }[] | undefined;
1123
+ };
1124
+ };
1125
+ }) | (Omit<EventInput, "payload" | "type"> & {
1126
+ readonly type: "agent.session.cancel.requested";
1127
+ readonly payload: {};
1128
+ }) | (Omit<EventInput, "payload" | "type"> & {
1129
+ readonly type: "agent.session.message.submitted";
1130
+ readonly payload: {
1131
+ readonly messageId: string;
1132
+ readonly text: string;
1133
+ readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1134
+ readonly activeChildThreadId?: string | undefined;
1135
+ };
1136
+ }) | (Omit<EventInput, "payload" | "type"> & {
1137
+ readonly type: "agent.session.steer.delivered";
1138
+ readonly payload: {
1139
+ readonly messageId: string;
1140
+ readonly activeMessageId: string;
1141
+ };
1142
+ }) | (Omit<EventInput, "payload" | "type"> & {
1143
+ readonly type: "agent.session.turn.closed";
1144
+ readonly payload: {
1145
+ readonly messageId: string;
1146
+ readonly status: "cancelled" | "completed" | "failed";
1147
+ readonly error?: string | undefined;
1148
+ };
1149
+ }) | (Omit<EventInput, "payload" | "type"> & {
1150
+ readonly type: "agent.session.turn.started";
1151
+ readonly payload: {
1152
+ readonly messageId: string;
1153
+ readonly childThreadId: string;
1154
+ };
1155
+ }) | (Omit<EventInput, "payload" | "type"> & {
1156
+ readonly type: "agent.spawn.requested";
1157
+ readonly payload: {
1158
+ readonly childThreadId: string;
1159
+ readonly kind: string;
1160
+ readonly definitionName: string;
1161
+ readonly definitionVersion: string;
1162
+ readonly toolCallId: string;
1163
+ readonly input: import("effect/Schema").Json;
1164
+ };
1165
+ }) | (Omit<EventInput, "payload" | "type"> & {
1166
+ readonly type: "agent.steered";
1167
+ readonly payload: {
1168
+ readonly turn: number;
1169
+ readonly messageId?: string | undefined;
1170
+ readonly message: {
1171
+ readonly role: "assistant" | "system" | "tool" | "user";
1172
+ readonly content: string;
1173
+ readonly toolCallId?: string | undefined;
1174
+ readonly name?: string | undefined;
1175
+ readonly toolCalls?: {
1176
+ readonly id: string;
1177
+ readonly name: string;
1178
+ readonly arguments: import("effect/Schema").Json;
1179
+ }[] | undefined;
1180
+ };
1181
+ readonly interrupt?: boolean | undefined;
1182
+ };
1183
+ }) | (Omit<EventInput, "payload" | "type"> & {
1184
+ readonly type: "agent.tool.result";
1185
+ readonly payload: {
1186
+ readonly turn: number;
1187
+ readonly toolCallId: string;
1188
+ readonly name: string;
1189
+ readonly result: import("effect/Schema").Json;
1190
+ readonly error: string | null;
1191
+ };
1192
+ }) | (Omit<EventInput, "payload" | "type"> & {
1193
+ readonly type: "agent.tool_call.requested";
1194
+ readonly payload: {
1195
+ readonly turn: number;
1196
+ readonly toolCall: {
1197
+ readonly id: string;
1198
+ readonly name: string;
1199
+ readonly arguments: import("effect/Schema").Json;
1200
+ };
1201
+ };
1202
+ }) | (Omit<EventInput, "payload" | "type"> & {
1203
+ readonly type: "agent.turn.started";
1204
+ readonly payload: {
1205
+ readonly turn: number;
1206
+ };
1207
+ }) | (Omit<EventInput, "payload" | "type"> & {
1208
+ readonly type: "agent.turn.stopped";
1209
+ readonly payload: {};
1210
+ }) | (Omit<EventInput, "payload" | "type"> & {
1211
+ readonly type: "agent.turn.text_delta";
1212
+ readonly payload: {
1213
+ readonly turn: number;
1214
+ readonly delta: string;
1215
+ };
1216
+ }) | (Omit<EventInput, "payload" | "type"> & {
1025
1217
  readonly type: "runtime.effect.ambiguous";
1026
1218
  readonly payload: {
1027
1219
  readonly effectId: string;
@@ -1218,7 +1410,17 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1218
1410
  readonly payload: import("effect/Schema").Json;
1219
1411
  };
1220
1412
  };
1221
- }) | (Omit<EventInput, "payload" | "type"> & {
1413
+ })>;
1414
+ executeTool: import("@swirls/looms/core").EffectDefinition<{
1415
+ readonly turn: number;
1416
+ readonly definitionName?: string | undefined;
1417
+ readonly definitionVersion: string;
1418
+ readonly toolCall: {
1419
+ readonly id: string;
1420
+ readonly name: string;
1421
+ readonly arguments: import("effect/Schema").Json;
1422
+ };
1423
+ }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
1222
1424
  readonly type: "agent.effects.requested";
1223
1425
  readonly payload: {
1224
1426
  readonly toolCallId: string;
@@ -1410,17 +1612,7 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1410
1612
  readonly turn: number;
1411
1613
  readonly delta: string;
1412
1614
  };
1413
- })>;
1414
- executeTool: import("@swirls/looms/core").EffectDefinition<{
1415
- readonly turn: number;
1416
- readonly definitionName?: string | undefined;
1417
- readonly definitionVersion: string;
1418
- readonly toolCall: {
1419
- readonly id: string;
1420
- readonly name: string;
1421
- readonly arguments: import("effect/Schema").Json;
1422
- };
1423
- }, import("./definitions-store").AgentDefinitionsTag, (Omit<EventInput, "payload" | "type"> & {
1615
+ }) | (Omit<EventInput, "payload" | "type"> & {
1424
1616
  readonly type: "runtime.effect.ambiguous";
1425
1617
  readonly payload: {
1426
1618
  readonly effectId: string;
@@ -1617,198 +1809,6 @@ export declare function agent(options?: AgentModuleOptions): import("@swirls/loo
1617
1809
  readonly payload: import("effect/Schema").Json;
1618
1810
  };
1619
1811
  };
1620
- }) | (Omit<EventInput, "payload" | "type"> & {
1621
- readonly type: "agent.effects.requested";
1622
- readonly payload: {
1623
- readonly toolCallId: string;
1624
- readonly effects: readonly ({
1625
- readonly type: "runtime.spawn";
1626
- readonly childThreadId: string;
1627
- readonly kind: string;
1628
- readonly definitionName: string;
1629
- readonly definitionVersion: string;
1630
- readonly input: import("effect/Schema").Json;
1631
- } | {
1632
- readonly type: "runtime.wait";
1633
- readonly waitId: string;
1634
- readonly on: {
1635
- readonly type: string | readonly string[];
1636
- readonly match?: import("effect/Schema").Json | undefined;
1637
- } | {
1638
- readonly timerAt: number;
1639
- };
1640
- readonly tag?: import("effect/Schema").Json | undefined;
1641
- } | {
1642
- readonly type: "runtime.emit";
1643
- readonly event: {
1644
- readonly type: string;
1645
- readonly payload: import("effect/Schema").Json;
1646
- readonly threadId?: string | null | undefined;
1647
- readonly parentThreadId?: string | null | undefined;
1648
- readonly causationId?: string | null | undefined;
1649
- readonly correlationId?: string | null | undefined;
1650
- readonly effectId?: string | null | undefined;
1651
- readonly origin?: {
1652
- readonly type: "thread";
1653
- readonly threadId: string;
1654
- } | {
1655
- readonly type: "external";
1656
- readonly actorId?: string | undefined;
1657
- } | {
1658
- readonly type: "system";
1659
- } | undefined;
1660
- readonly ephemeral?: boolean | undefined;
1661
- readonly id?: string | undefined;
1662
- readonly ts?: number | undefined;
1663
- readonly idempotencyKey?: string | null | undefined;
1664
- };
1665
- readonly tag?: string | undefined;
1666
- } | {
1667
- readonly type: "runtime.complete";
1668
- readonly output: import("effect/Schema").Json;
1669
- } | {
1670
- readonly type: "runtime.fail";
1671
- readonly error: string;
1672
- } | {
1673
- readonly type: "runtime.cancel";
1674
- readonly threadId: string;
1675
- readonly tag?: string | undefined;
1676
- } | {
1677
- readonly type: string;
1678
- readonly input: import("effect/Schema").Json;
1679
- readonly tag?: string | undefined;
1680
- })[];
1681
- readonly waitOn?: {
1682
- readonly type: string | readonly string[];
1683
- readonly match?: import("effect/Schema").Json | undefined;
1684
- } | undefined;
1685
- };
1686
- }) | (Omit<EventInput, "payload" | "type"> & {
1687
- readonly type: "agent.message";
1688
- readonly payload: {
1689
- readonly turn: number;
1690
- readonly message: {
1691
- readonly role: "assistant" | "system" | "tool" | "user";
1692
- readonly content: string;
1693
- readonly toolCallId?: string | undefined;
1694
- readonly name?: string | undefined;
1695
- readonly toolCalls?: {
1696
- readonly id: string;
1697
- readonly name: string;
1698
- readonly arguments: import("effect/Schema").Json;
1699
- }[] | undefined;
1700
- };
1701
- readonly usage?: {
1702
- readonly input: number;
1703
- readonly output: number;
1704
- } | undefined;
1705
- };
1706
- }) | (Omit<EventInput, "payload" | "type"> & {
1707
- readonly type: "agent.message.received";
1708
- readonly payload: {
1709
- readonly message: {
1710
- readonly role: "assistant" | "system" | "tool" | "user";
1711
- readonly content: string;
1712
- readonly toolCallId?: string | undefined;
1713
- readonly name?: string | undefined;
1714
- readonly toolCalls?: {
1715
- readonly id: string;
1716
- readonly name: string;
1717
- readonly arguments: import("effect/Schema").Json;
1718
- }[] | undefined;
1719
- };
1720
- };
1721
- }) | (Omit<EventInput, "payload" | "type"> & {
1722
- readonly type: "agent.session.cancel.requested";
1723
- readonly payload: {};
1724
- }) | (Omit<EventInput, "payload" | "type"> & {
1725
- readonly type: "agent.session.message.submitted";
1726
- readonly payload: {
1727
- readonly messageId: string;
1728
- readonly text: string;
1729
- readonly delivery?: "followUp" | "nextTurn" | "steer" | undefined;
1730
- readonly activeChildThreadId?: string | undefined;
1731
- };
1732
- }) | (Omit<EventInput, "payload" | "type"> & {
1733
- readonly type: "agent.session.steer.delivered";
1734
- readonly payload: {
1735
- readonly messageId: string;
1736
- readonly activeMessageId: string;
1737
- };
1738
- }) | (Omit<EventInput, "payload" | "type"> & {
1739
- readonly type: "agent.session.turn.closed";
1740
- readonly payload: {
1741
- readonly messageId: string;
1742
- readonly status: "cancelled" | "completed" | "failed";
1743
- readonly error?: string | undefined;
1744
- };
1745
- }) | (Omit<EventInput, "payload" | "type"> & {
1746
- readonly type: "agent.session.turn.started";
1747
- readonly payload: {
1748
- readonly messageId: string;
1749
- readonly childThreadId: string;
1750
- };
1751
- }) | (Omit<EventInput, "payload" | "type"> & {
1752
- readonly type: "agent.spawn.requested";
1753
- readonly payload: {
1754
- readonly childThreadId: string;
1755
- readonly kind: string;
1756
- readonly definitionName: string;
1757
- readonly definitionVersion: string;
1758
- readonly toolCallId: string;
1759
- readonly input: import("effect/Schema").Json;
1760
- };
1761
- }) | (Omit<EventInput, "payload" | "type"> & {
1762
- readonly type: "agent.steered";
1763
- readonly payload: {
1764
- readonly turn: number;
1765
- readonly messageId?: string | undefined;
1766
- readonly message: {
1767
- readonly role: "assistant" | "system" | "tool" | "user";
1768
- readonly content: string;
1769
- readonly toolCallId?: string | undefined;
1770
- readonly name?: string | undefined;
1771
- readonly toolCalls?: {
1772
- readonly id: string;
1773
- readonly name: string;
1774
- readonly arguments: import("effect/Schema").Json;
1775
- }[] | undefined;
1776
- };
1777
- readonly interrupt?: boolean | undefined;
1778
- };
1779
- }) | (Omit<EventInput, "payload" | "type"> & {
1780
- readonly type: "agent.tool.result";
1781
- readonly payload: {
1782
- readonly turn: number;
1783
- readonly toolCallId: string;
1784
- readonly name: string;
1785
- readonly result: import("effect/Schema").Json;
1786
- readonly error: string | null;
1787
- };
1788
- }) | (Omit<EventInput, "payload" | "type"> & {
1789
- readonly type: "agent.tool_call.requested";
1790
- readonly payload: {
1791
- readonly turn: number;
1792
- readonly toolCall: {
1793
- readonly id: string;
1794
- readonly name: string;
1795
- readonly arguments: import("effect/Schema").Json;
1796
- };
1797
- };
1798
- }) | (Omit<EventInput, "payload" | "type"> & {
1799
- readonly type: "agent.turn.started";
1800
- readonly payload: {
1801
- readonly turn: number;
1802
- };
1803
- }) | (Omit<EventInput, "payload" | "type"> & {
1804
- readonly type: "agent.turn.stopped";
1805
- readonly payload: {};
1806
- }) | (Omit<EventInput, "payload" | "type"> & {
1807
- readonly type: "agent.turn.text_delta";
1808
- readonly payload: {
1809
- readonly turn: number;
1810
- readonly delta: string;
1811
- };
1812
1812
  })>;
1813
1813
  };
1814
1814
  readonly threads: {