@swirls/looms 0.3.0 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +64 -0
- package/dist/actor/cell.d.ts +21 -2
- package/dist/actor/cell.js +15 -3
- package/dist/actor/host.d.ts +10 -2
- package/dist/actor/host.js +27 -4
- package/dist/actor/index.d.ts +2 -1
- package/dist/actor/index.js +1 -1
- package/dist/actor/routing.d.ts +3 -0
- package/dist/actor/routing.js +13 -2
- package/dist/agent/debugger/agent-chat.js +3 -30
- package/dist/agent/debugger/streaming-text.d.ts +6 -0
- package/dist/agent/debugger/streaming-text.js +33 -0
- package/dist/agent/definitions-store.d.ts +1 -1
- package/dist/agent/definitions-store.js +1 -1
- package/dist/agent/definitions.d.ts +48 -0
- package/dist/agent/definitions.js +44 -0
- package/dist/agent/effects.d.ts +184 -0
- package/dist/agent/effects.js +172 -40
- package/dist/agent/events.d.ts +89 -0
- package/dist/agent/events.js +25 -0
- package/dist/agent/module.d.ts +819 -407
- package/dist/agent/module.js +5 -1
- package/dist/agent/scope.d.ts +88 -0
- package/dist/agent/threads.js +39 -3
- package/dist/agent/types.d.ts +4 -0
- package/dist/approval/effects.d.ts +40 -0
- package/dist/approval/module.d.ts +80 -0
- package/dist/client/client.d.ts +468 -119
- package/dist/client/client.js +214 -21
- package/dist/client/index.d.ts +1 -1
- package/dist/client/sse.d.ts +1 -1
- package/dist/client/sse.js +2 -2
- package/dist/cloudflare/durable-object.d.ts +66 -2
- package/dist/cloudflare/durable-object.js +96 -1
- package/dist/cloudflare/event-store.d.ts +7 -3
- package/dist/cloudflare/event-store.js +16 -3
- package/dist/cloudflare/index.d.ts +7 -1
- package/dist/cloudflare/index.js +7 -1
- package/dist/cloudflare/memory-queue.d.ts +18 -0
- package/dist/cloudflare/memory-queue.js +53 -0
- package/dist/cloudflare/queue-consumer.d.ts +52 -0
- package/dist/cloudflare/queue-consumer.js +102 -0
- package/dist/cloudflare/queue-message.d.ts +31 -0
- package/dist/cloudflare/queue-message.js +33 -0
- package/dist/cloudflare/queue-pull.d.ts +62 -0
- package/dist/cloudflare/queue-pull.js +130 -0
- package/dist/cloudflare/queue-worker.d.ts +39 -0
- package/dist/cloudflare/queue-worker.js +62 -0
- package/dist/cloudflare/r2-blob-store.d.ts +33 -0
- package/dist/cloudflare/r2-blob-store.js +60 -0
- package/dist/cloudflare/router.d.ts +4 -1
- package/dist/cloudflare/router.js +8 -3
- package/dist/cloudflare/websocket.d.ts +27 -0
- package/dist/cloudflare/websocket.js +215 -0
- package/dist/core/attempts.d.ts +8 -0
- package/dist/core/attempts.js +27 -0
- package/dist/core/blob-offload.d.ts +21 -0
- package/dist/core/blob-offload.js +143 -0
- package/dist/core/blob-store.d.ts +45 -0
- package/dist/core/blob-store.js +164 -0
- package/dist/core/blobs.d.ts +37 -0
- package/dist/core/blobs.js +160 -0
- package/dist/core/definition-resolver.d.ts +40 -0
- package/dist/core/definition-resolver.js +129 -0
- package/dist/core/definition-store.d.ts +6 -0
- package/dist/core/definition-store.js +37 -1
- package/dist/core/effects.d.ts +86 -3
- package/dist/core/effects.js +99 -3
- package/dist/core/envelope.d.ts +9 -0
- package/dist/core/envelope.js +4 -0
- package/dist/core/event-codec.js +3 -0
- package/dist/core/fold.js +83 -1
- package/dist/core/ids.d.ts +2 -0
- package/dist/core/ids.js +4 -0
- package/dist/core/index.d.ts +10 -0
- package/dist/core/index.js +9 -0
- package/dist/core/launcher.d.ts +97 -0
- package/dist/core/launcher.js +67 -0
- package/dist/core/module-scope.d.ts +7 -3
- package/dist/core/module-scope.js +3 -0
- package/dist/core/module.d.ts +10 -0
- package/dist/core/projection.d.ts +5 -4
- package/dist/core/projection.js +4 -0
- package/dist/core/protocol.d.ts +36 -1
- package/dist/core/protocol.js +35 -0
- package/dist/core/published.d.ts +2 -0
- package/dist/core/published.js +4 -1
- package/dist/{react → core}/register.d.ts +9 -8
- package/dist/core/replay.d.ts +96 -0
- package/dist/core/run-context.d.ts +33 -0
- package/dist/core/run-context.js +23 -0
- package/dist/core/sqlite-store.js +57 -5
- package/dist/core/state.d.ts +60 -0
- package/dist/core/state.js +19 -0
- package/dist/core/store.d.ts +6 -0
- package/dist/core/store.js +7 -0
- package/dist/core/subscription.d.ts +97 -0
- package/dist/core/subscription.js +224 -0
- package/dist/core/thread.d.ts +7 -0
- package/dist/core/thread.js +1 -0
- package/dist/core/trace.d.ts +21 -0
- package/dist/core/trace.js +45 -0
- package/dist/core/worker-callback.d.ts +25 -1
- package/dist/debugger/app/assets/{index-CgDzWJg7.css → index-B7GdT1UA.css} +1 -1
- package/dist/debugger/app/assets/index-C31SnCuN.js +22 -0
- package/dist/debugger/app/assets/routes-DPA3O5AF.js +47 -0
- package/dist/debugger/app/index.html +2 -2
- package/dist/debugger/components/event-inspector.d.ts +3 -1
- package/dist/debugger/components/event-inspector.js +25 -4
- package/dist/debugger/components/event-stream.d.ts +4 -1
- package/dist/debugger/components/event-stream.js +2 -2
- package/dist/debugger/components/run-tree.d.ts +5 -2
- package/dist/debugger/components/run-tree.js +10 -4
- package/dist/debugger/context.d.ts +8 -1
- package/dist/debugger/context.js +15 -3
- package/dist/debugger/events/protocol-summarize.js +18 -3
- package/dist/debugger/index.d.ts +1 -1
- package/dist/debugger/index.js +1 -1
- package/dist/debugger/shell/debugger-shell.js +1 -1
- package/dist/debugger/shell/events-pane.js +4 -3
- package/dist/debugger/styles.css +1 -0
- package/dist/evaluator/definitions-store.d.ts +3 -4
- package/dist/evaluator/definitions-store.js +3 -3
- package/dist/evaluator/definitions.d.ts +4 -1
- package/dist/evaluator/definitions.js +5 -2
- package/dist/evaluator/effects.d.ts +41 -0
- package/dist/evaluator/effects.js +6 -2
- package/dist/evaluator/module.d.ts +84 -0
- package/dist/evaluator/module.js +7 -3
- package/dist/evaluator/threads.d.ts +2 -0
- package/dist/evaluator/threads.js +4 -0
- package/dist/projectors/event-log.d.ts +87 -0
- package/dist/projectors/event-log.js +396 -0
- package/dist/projectors/index-model.d.ts +12 -0
- package/dist/projectors/index-model.js +12 -3
- package/dist/projectors/memory.js +7 -0
- package/dist/projectors/postgres.d.ts +1 -0
- package/dist/projectors/postgres.js +32 -15
- package/dist/projectors/schema.d.ts +5 -0
- package/dist/projectors/schema.js +26 -1
- package/dist/projectors/sqlite.js +47 -19
- package/dist/projectors/with-projectors.d.ts +7 -1
- package/dist/projectors/with-projectors.js +13 -3
- package/dist/react/derived.d.ts +26 -8
- package/dist/react/derived.js +23 -26
- package/dist/react/index.d.ts +3 -3
- package/dist/react/index.js +2 -2
- package/dist/react/materialize.js +5 -1
- package/dist/react/react.d.ts +16 -9
- package/dist/react/react.js +47 -23
- package/dist/react/store.d.ts +14 -6
- package/dist/react/store.js +104 -12
- package/dist/react/tables.d.ts +4 -1
- package/dist/runtime/cancellation.d.ts +2 -1
- package/dist/runtime/cancellation.js +35 -2
- package/dist/runtime/child-run.d.ts +10 -0
- package/dist/runtime/child-run.js +58 -0
- package/dist/runtime/deadline-transition-planner.js +11 -2
- package/dist/runtime/dispatch-effect.d.ts +2 -2
- package/dist/runtime/dispatch-effect.js +43 -19
- package/dist/runtime/errors.d.ts +14 -1
- package/dist/runtime/errors.js +10 -0
- package/dist/runtime/filesystem-blob-store.d.ts +6 -0
- package/dist/runtime/filesystem-blob-store.js +59 -0
- package/dist/runtime/helpers.d.ts +15 -6
- package/dist/runtime/helpers.js +46 -6
- package/dist/runtime/index.d.ts +4 -2
- package/dist/runtime/index.js +3 -1
- package/dist/runtime/local-effect-executor.d.ts +11 -2
- package/dist/runtime/local-effect-executor.js +80 -4
- package/dist/runtime/looms.d.ts +38 -4
- package/dist/runtime/looms.js +17 -3
- package/dist/runtime/repository.d.ts +5 -4
- package/dist/runtime/repository.js +5 -2
- package/dist/runtime/retry-policy.d.ts +5 -0
- package/dist/runtime/retry-policy.js +10 -2
- package/dist/runtime/run-start.d.ts +1 -1
- package/dist/runtime/run-start.js +10 -0
- package/dist/runtime/runtime.d.ts +2 -2
- package/dist/runtime/runtime.js +191 -68
- package/dist/runtime/server/auth.d.ts +3 -0
- package/dist/runtime/server/fetch-handler.d.ts +2 -2
- package/dist/runtime/server/fetch-handler.js +35 -4
- package/dist/runtime/server/grant.d.ts +49 -0
- package/dist/runtime/server/grant.js +177 -0
- package/dist/runtime/server/routes/effects.js +47 -5
- package/dist/runtime/server/routes/runs.js +6 -1
- package/dist/runtime/server/run-route.d.ts +18 -0
- package/dist/runtime/server/run-route.js +26 -0
- package/dist/runtime/server.d.ts +3 -1
- package/dist/runtime/server.js +3 -1
- package/dist/runtime/sse.js +26 -4
- package/dist/runtime/subscription.d.ts +8 -0
- package/dist/runtime/subscription.js +23 -0
- package/dist/runtime/types.d.ts +87 -8
- package/dist/runtime/wake-engine.d.ts +4 -2
- package/dist/runtime/wake-engine.js +57 -6
- package/dist/runtime/worker-callbacks.d.ts +12 -2
- package/dist/runtime/worker-callbacks.js +102 -72
- package/dist/runtime/worker-effect-dispatch.d.ts +14 -5
- package/dist/runtime/worker-effect-dispatch.js +84 -18
- package/dist/schedule/debugger/index.d.ts +4 -0
- package/dist/schedule/debugger/index.js +11 -0
- package/dist/schedule/debugger/schedule-view.d.ts +3 -0
- package/dist/schedule/debugger/schedule-view.js +68 -0
- package/dist/schedule/debugger/summarize.d.ts +2 -0
- package/dist/schedule/debugger/summarize.js +43 -0
- package/dist/schedule/definitions-store.d.ts +10 -0
- package/dist/schedule/definitions-store.js +8 -0
- package/dist/schedule/definitions.d.ts +57 -0
- package/dist/schedule/definitions.js +30 -0
- package/dist/schedule/effects.d.ts +756 -0
- package/dist/schedule/effects.js +244 -0
- package/dist/schedule/ensure.d.ts +55 -0
- package/dist/schedule/ensure.js +109 -0
- package/dist/schedule/events.d.ts +116 -0
- package/dist/schedule/events.js +49 -0
- package/dist/schedule/index.d.ts +11 -0
- package/dist/schedule/index.js +11 -0
- package/dist/schedule/module.d.ts +1474 -0
- package/dist/schedule/module.js +22 -0
- package/dist/schedule/projections.d.ts +55 -0
- package/dist/schedule/projections.js +88 -0
- package/dist/schedule/scope.d.ts +121 -0
- package/dist/schedule/scope.js +7 -0
- package/dist/schedule/signals.d.ts +25 -0
- package/dist/schedule/signals.js +33 -0
- package/dist/schedule/specs.d.ts +59 -0
- package/dist/schedule/specs.js +231 -0
- package/dist/schedule/threads.d.ts +25 -0
- package/dist/schedule/threads.js +259 -0
- package/dist/testing/corpus-module.d.ts +34 -0
- package/dist/testing/corpus-module.js +87 -0
- package/dist/testing/index.d.ts +2 -0
- package/dist/testing/index.js +5 -6
- package/dist/testing/replay-corpus.d.ts +22 -0
- package/dist/testing/replay-corpus.js +50 -0
- package/dist/workflow/definitions-store.d.ts +1 -1
- package/dist/workflow/definitions-store.js +1 -1
- package/dist/workflow/definitions.d.ts +14 -0
- package/dist/workflow/effects.d.ts +122 -0
- package/dist/workflow/effects.js +16 -6
- package/dist/workflow/events.d.ts +42 -0
- package/dist/workflow/events.js +4 -0
- package/dist/workflow/module.d.ts +345 -32
- package/dist/workflow/module.js +7 -3
- package/dist/workflow/scope.d.ts +42 -0
- package/dist/workflow/threads.d.ts +72 -0
- package/dist/workflow/threads.js +106 -38
- package/package.json +11 -2
- package/dist/debugger/app/assets/index-BevQYa-U.js +0 -22
- package/dist/debugger/app/assets/routes-B17Om93i.js +0 -47
- /package/dist/{react → core}/register.js +0 -0
package/dist/agent/events.d.ts
CHANGED
|
@@ -97,6 +97,34 @@ export declare const AgentSpawnRequestedPayloadSchema: Schema.Struct<{
|
|
|
97
97
|
readonly definitionVersion: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
98
98
|
readonly toolCallId: Schema.String;
|
|
99
99
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
100
|
+
readonly depth: Schema.optional<Schema.Finite>;
|
|
101
|
+
}>;
|
|
102
|
+
/** Sent by a parent agent to a team member it spawned, so the depth limit survives nesting. */
|
|
103
|
+
export declare const AgentLineagePayloadSchema: Schema.Struct<{
|
|
104
|
+
readonly depth: Schema.Finite;
|
|
105
|
+
}>;
|
|
106
|
+
export declare const AgentContextCompactedPayloadSchema: Schema.Struct<{
|
|
107
|
+
readonly turn: Schema.Finite;
|
|
108
|
+
readonly originalCount: Schema.Finite;
|
|
109
|
+
readonly compactedCount: Schema.Finite;
|
|
110
|
+
readonly summary: Schema.optional<Schema.String>;
|
|
111
|
+
readonly reason: Schema.optional<Schema.Union<readonly [Schema.Literal<"overflow">, Schema.Literal<"manual">, Schema.Literal<"threshold">]>>;
|
|
112
|
+
readonly messages: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
113
|
+
readonly role: Schema.Union<readonly [Schema.Literal<"system">, Schema.Literal<"user">, Schema.Literal<"assistant">, Schema.Literal<"tool">]>;
|
|
114
|
+
readonly content: Schema.String;
|
|
115
|
+
readonly toolCallId: Schema.optional<Schema.String>;
|
|
116
|
+
readonly name: Schema.optional<Schema.String>;
|
|
117
|
+
readonly toolCalls: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
118
|
+
readonly id: Schema.String;
|
|
119
|
+
readonly name: Schema.String;
|
|
120
|
+
readonly arguments: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
121
|
+
}>>>>;
|
|
122
|
+
}>>>;
|
|
123
|
+
}>;
|
|
124
|
+
export declare const AgentTurnUsagePayloadSchema: Schema.Struct<{
|
|
125
|
+
readonly turn: Schema.Finite;
|
|
126
|
+
readonly input: Schema.Finite;
|
|
127
|
+
readonly output: Schema.Finite;
|
|
100
128
|
}>;
|
|
101
129
|
export declare const AgentEffectsRequestedPayloadSchema: Schema.Struct<{
|
|
102
130
|
readonly toolCallId: Schema.String;
|
|
@@ -135,6 +163,9 @@ export declare const AgentEffectsRequestedPayloadSchema: Schema.Struct<{
|
|
|
135
163
|
readonly actorId: Schema.optional<Schema.String>;
|
|
136
164
|
}>, Schema.Struct<{
|
|
137
165
|
readonly type: Schema.Literal<"system">;
|
|
166
|
+
}>, Schema.Struct<{
|
|
167
|
+
readonly type: Schema.Literal<"run">;
|
|
168
|
+
readonly runId: Schema.String;
|
|
138
169
|
}>]>>;
|
|
139
170
|
readonly ephemeral: Schema.optional<Schema.Boolean>;
|
|
140
171
|
readonly id: Schema.optional<Schema.String>;
|
|
@@ -152,10 +183,24 @@ export declare const AgentEffectsRequestedPayloadSchema: Schema.Struct<{
|
|
|
152
183
|
readonly type: Schema.Literal<"runtime.cancel">;
|
|
153
184
|
readonly threadId: Schema.String;
|
|
154
185
|
readonly tag: Schema.optional<Schema.String>;
|
|
186
|
+
}>, Schema.Struct<{
|
|
187
|
+
readonly type: Schema.Literal<"runtime.launch">;
|
|
188
|
+
readonly runId: Schema.String;
|
|
189
|
+
readonly kind: Schema.String;
|
|
190
|
+
readonly definitionName: Schema.String;
|
|
191
|
+
readonly definitionVersion: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
192
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
193
|
+
readonly close: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Literal<"terminate">, Schema.Literal<"wait">]>, never>;
|
|
194
|
+
readonly tag: Schema.optional<Schema.String>;
|
|
195
|
+
}>, Schema.Struct<{
|
|
196
|
+
readonly type: Schema.Literal<"runtime.cancelRun">;
|
|
197
|
+
readonly runId: Schema.String;
|
|
198
|
+
readonly tag: Schema.optional<Schema.String>;
|
|
155
199
|
}>, Schema.Struct<{
|
|
156
200
|
readonly type: Schema.String;
|
|
157
201
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
158
202
|
readonly tag: Schema.optional<Schema.String>;
|
|
203
|
+
readonly at: Schema.optional<Schema.Finite>;
|
|
159
204
|
}>]>>;
|
|
160
205
|
readonly waitOn: Schema.optional<Schema.Struct<{
|
|
161
206
|
readonly type: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.String>]>;
|
|
@@ -260,6 +305,7 @@ export declare const agentCatalog: import("@swirls/looms/core").EventCatalog<"ag
|
|
|
260
305
|
readonly definitionVersion: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
261
306
|
readonly toolCallId: Schema.String;
|
|
262
307
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
308
|
+
readonly depth: Schema.optional<Schema.Finite>;
|
|
263
309
|
}>;
|
|
264
310
|
'effects.requested': Schema.Struct<{
|
|
265
311
|
readonly toolCallId: Schema.String;
|
|
@@ -298,6 +344,9 @@ export declare const agentCatalog: import("@swirls/looms/core").EventCatalog<"ag
|
|
|
298
344
|
readonly actorId: Schema.optional<Schema.String>;
|
|
299
345
|
}>, Schema.Struct<{
|
|
300
346
|
readonly type: Schema.Literal<"system">;
|
|
347
|
+
}>, Schema.Struct<{
|
|
348
|
+
readonly type: Schema.Literal<"run">;
|
|
349
|
+
readonly runId: Schema.String;
|
|
301
350
|
}>]>>;
|
|
302
351
|
readonly ephemeral: Schema.optional<Schema.Boolean>;
|
|
303
352
|
readonly id: Schema.optional<Schema.String>;
|
|
@@ -315,14 +364,54 @@ export declare const agentCatalog: import("@swirls/looms/core").EventCatalog<"ag
|
|
|
315
364
|
readonly type: Schema.Literal<"runtime.cancel">;
|
|
316
365
|
readonly threadId: Schema.String;
|
|
317
366
|
readonly tag: Schema.optional<Schema.String>;
|
|
367
|
+
}>, Schema.Struct<{
|
|
368
|
+
readonly type: Schema.Literal<"runtime.launch">;
|
|
369
|
+
readonly runId: Schema.String;
|
|
370
|
+
readonly kind: Schema.String;
|
|
371
|
+
readonly definitionName: Schema.String;
|
|
372
|
+
readonly definitionVersion: Schema.withDecodingDefaultKey<Schema.String, never>;
|
|
373
|
+
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
374
|
+
readonly close: Schema.withDecodingDefaultKey<Schema.Union<readonly [Schema.Literal<"terminate">, Schema.Literal<"wait">]>, never>;
|
|
375
|
+
readonly tag: Schema.optional<Schema.String>;
|
|
376
|
+
}>, Schema.Struct<{
|
|
377
|
+
readonly type: Schema.Literal<"runtime.cancelRun">;
|
|
378
|
+
readonly runId: Schema.String;
|
|
379
|
+
readonly tag: Schema.optional<Schema.String>;
|
|
318
380
|
}>, Schema.Struct<{
|
|
319
381
|
readonly type: Schema.String;
|
|
320
382
|
readonly input: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
321
383
|
readonly tag: Schema.optional<Schema.String>;
|
|
384
|
+
readonly at: Schema.optional<Schema.Finite>;
|
|
322
385
|
}>]>>;
|
|
323
386
|
readonly waitOn: Schema.optional<Schema.Struct<{
|
|
324
387
|
readonly type: Schema.Union<readonly [Schema.String, Schema.$Array<Schema.String>]>;
|
|
325
388
|
readonly match: Schema.optional<Schema.Codec<Schema.Json, Schema.Json, never, never>>;
|
|
326
389
|
}>>;
|
|
327
390
|
}>;
|
|
391
|
+
lineage: Schema.Struct<{
|
|
392
|
+
readonly depth: Schema.Finite;
|
|
393
|
+
}>;
|
|
394
|
+
'context.compacted': Schema.Struct<{
|
|
395
|
+
readonly turn: Schema.Finite;
|
|
396
|
+
readonly originalCount: Schema.Finite;
|
|
397
|
+
readonly compactedCount: Schema.Finite;
|
|
398
|
+
readonly summary: Schema.optional<Schema.String>;
|
|
399
|
+
readonly reason: Schema.optional<Schema.Union<readonly [Schema.Literal<"overflow">, Schema.Literal<"manual">, Schema.Literal<"threshold">]>>;
|
|
400
|
+
readonly messages: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
401
|
+
readonly role: Schema.Union<readonly [Schema.Literal<"system">, Schema.Literal<"user">, Schema.Literal<"assistant">, Schema.Literal<"tool">]>;
|
|
402
|
+
readonly content: Schema.String;
|
|
403
|
+
readonly toolCallId: Schema.optional<Schema.String>;
|
|
404
|
+
readonly name: Schema.optional<Schema.String>;
|
|
405
|
+
readonly toolCalls: Schema.optional<Schema.mutable<Schema.$Array<Schema.Struct<{
|
|
406
|
+
readonly id: Schema.String;
|
|
407
|
+
readonly name: Schema.String;
|
|
408
|
+
readonly arguments: Schema.Codec<Schema.Json, Schema.Json, never, never>;
|
|
409
|
+
}>>>>;
|
|
410
|
+
}>>>;
|
|
411
|
+
}>;
|
|
412
|
+
'turn.usage': Schema.Struct<{
|
|
413
|
+
readonly turn: Schema.Finite;
|
|
414
|
+
readonly input: Schema.Finite;
|
|
415
|
+
readonly output: Schema.Finite;
|
|
416
|
+
}>;
|
|
328
417
|
}>;
|
package/dist/agent/events.js
CHANGED
|
@@ -70,6 +70,28 @@ export const AgentSpawnRequestedPayloadSchema = Schema.Struct({
|
|
|
70
70
|
definitionVersion: Schema.String.pipe(Schema.withDecodingDefaultKey(Effect.succeed(DEFAULT_DEFINITION_VERSION))),
|
|
71
71
|
toolCallId: Schema.String,
|
|
72
72
|
input: Schema.Json,
|
|
73
|
+
depth: Schema.optional(Schema.Finite),
|
|
74
|
+
});
|
|
75
|
+
/** Sent by a parent agent to a team member it spawned, so the depth limit survives nesting. */
|
|
76
|
+
export const AgentLineagePayloadSchema = Schema.Struct({
|
|
77
|
+
depth: Schema.Finite,
|
|
78
|
+
});
|
|
79
|
+
export const AgentContextCompactedPayloadSchema = Schema.Struct({
|
|
80
|
+
turn: Schema.Finite,
|
|
81
|
+
originalCount: Schema.Finite,
|
|
82
|
+
compactedCount: Schema.Finite,
|
|
83
|
+
summary: Schema.optional(Schema.String),
|
|
84
|
+
reason: Schema.optional(Schema.Union([
|
|
85
|
+
Schema.Literal('overflow'),
|
|
86
|
+
Schema.Literal('manual'),
|
|
87
|
+
Schema.Literal('threshold'),
|
|
88
|
+
])),
|
|
89
|
+
messages: Schema.optional(Schema.Array(MessageSchema)),
|
|
90
|
+
});
|
|
91
|
+
export const AgentTurnUsagePayloadSchema = Schema.Struct({
|
|
92
|
+
turn: Schema.Finite,
|
|
93
|
+
input: Schema.Finite,
|
|
94
|
+
output: Schema.Finite,
|
|
73
95
|
});
|
|
74
96
|
export const AgentEffectsRequestedPayloadSchema = Schema.Struct({
|
|
75
97
|
toolCallId: Schema.String,
|
|
@@ -95,4 +117,7 @@ export const agentCatalog = defineEventCatalog('agent', {
|
|
|
95
117
|
'session.cancel.requested': AgentSessionCancelRequestedPayloadSchema,
|
|
96
118
|
'spawn.requested': AgentSpawnRequestedPayloadSchema,
|
|
97
119
|
'effects.requested': AgentEffectsRequestedPayloadSchema,
|
|
120
|
+
lineage: AgentLineagePayloadSchema,
|
|
121
|
+
'context.compacted': AgentContextCompactedPayloadSchema,
|
|
122
|
+
'turn.usage': AgentTurnUsagePayloadSchema,
|
|
98
123
|
});
|