@swirls/looms 0.0.2 → 0.2.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 +24 -2
- package/dist/actor/cell.d.ts +9 -4
- package/dist/actor/cell.js +7 -11
- package/dist/actor/host.d.ts +7 -3
- package/dist/actor/host.js +57 -33
- package/dist/actor/index.d.ts +1 -1
- package/dist/actor/index.js +1 -1
- package/dist/actor/routing.d.ts +12 -1
- package/dist/actor/routing.js +57 -51
- package/dist/agent/agent-session.d.ts +5 -0
- package/dist/agent/agent-session.js +270 -0
- package/dist/agent/debugger/agent-chat.d.ts +2 -0
- package/dist/agent/debugger/agent-chat.js +176 -0
- package/dist/agent/debugger/index.d.ts +5 -0
- package/dist/agent/debugger/index.js +19 -0
- package/dist/agent/debugger/summarize.d.ts +2 -0
- package/dist/agent/debugger/summarize.js +51 -0
- package/dist/agent/debugger/token-usage.d.ts +3 -0
- package/dist/agent/debugger/token-usage.js +11 -0
- package/dist/agent/definitions-store.d.ts +2 -3
- package/dist/agent/definitions-store.js +2 -4
- package/dist/agent/definitions.d.ts +47 -29
- package/dist/agent/definitions.js +39 -12
- package/dist/agent/effects.d.ts +359 -2
- package/dist/agent/effects.js +60 -34
- package/dist/agent/events.d.ts +175 -19
- package/dist/agent/events.js +45 -10
- package/dist/agent/index.d.ts +1 -0
- package/dist/agent/index.js +1 -0
- package/dist/agent/llm.d.ts +11 -2
- package/dist/agent/llm.js +13 -3
- package/dist/agent/module.d.ts +812 -78
- package/dist/agent/module.js +16 -4
- package/dist/agent/scope.d.ts +174 -18
- package/dist/agent/signals.d.ts +26 -1
- package/dist/agent/signals.js +79 -0
- package/dist/agent/threads.d.ts +3 -33
- package/dist/agent/threads.js +20 -25
- package/dist/agent/tool-schema.d.ts +1 -17
- package/dist/agent/tool-schema.js +3 -43
- package/dist/agent/types.d.ts +49 -4
- package/dist/agent/types.js +5 -5
- package/dist/ai-vercel/index.d.ts +1 -0
- package/dist/ai-vercel/index.js +1 -0
- package/dist/ai-vercel/messages.js +22 -7
- package/dist/ai-vercel/vercel-evaluator.d.ts +36 -0
- package/dist/ai-vercel/vercel-evaluator.js +73 -0
- package/dist/ai-vercel/vercel-llm.js +64 -44
- package/dist/approval/debugger/approvals-view.d.ts +3 -0
- package/dist/approval/debugger/approvals-view.js +16 -0
- package/dist/approval/debugger/index.d.ts +4 -0
- package/dist/approval/debugger/index.js +11 -0
- package/dist/approval/debugger/summarize.d.ts +2 -0
- package/dist/approval/debugger/summarize.js +17 -0
- package/dist/approval/effects.d.ts +89 -0
- package/dist/approval/module.d.ts +179 -29
- package/dist/approval/projections.d.ts +0 -14
- package/dist/approval/projections.js +20 -3
- package/dist/approval/signals.d.ts +2 -0
- package/dist/approval/signals.js +18 -2
- package/dist/cli/cli.js +2 -0
- package/dist/cli/commands.js +12 -16
- package/dist/client/client.d.ts +1213 -18
- package/dist/client/client.js +120 -120
- package/dist/client/index.d.ts +1 -1
- package/dist/client/index.js +1 -1
- package/dist/client/sse.d.ts +13 -0
- package/dist/client/sse.js +38 -44
- package/dist/cloudflare/alarm-scheduler.d.ts +12 -2
- package/dist/cloudflare/alarm-scheduler.js +34 -7
- package/dist/cloudflare/durable-object.d.ts +10 -2
- package/dist/cloudflare/durable-object.js +59 -28
- package/dist/cloudflare/event-store.d.ts +7 -2
- package/dist/cloudflare/event-store.js +8 -7
- package/dist/cloudflare/index.d.ts +2 -2
- package/dist/cloudflare/index.js +2 -2
- package/dist/cloudflare/router.d.ts +1 -1
- package/dist/cloudflare/router.js +15 -16
- package/dist/core/catalog.d.ts +3 -3
- package/dist/core/catalog.js +2 -5
- package/dist/core/coalesce.js +5 -3
- package/dist/core/compose.d.ts +2 -1
- package/dist/core/compose.js +19 -2
- package/dist/core/debugger-host.d.ts +16 -0
- package/dist/core/debugger-host.js +1 -0
- package/dist/core/definition-store.d.ts +11 -0
- package/dist/core/definition-store.js +6 -0
- package/dist/core/effects.d.ts +127 -15
- package/dist/core/effects.js +89 -17
- package/dist/core/envelope.d.ts +27 -7
- package/dist/core/envelope.js +20 -6
- package/dist/core/event-codec.d.ts +4 -2
- package/dist/core/event-codec.js +10 -5
- package/dist/core/event-index.js +1 -3
- package/dist/core/fold.d.ts +3 -0
- package/dist/core/fold.js +171 -24
- package/dist/core/ids.d.ts +5 -0
- package/dist/core/ids.js +35 -2
- package/dist/core/index.d.ts +7 -1
- package/dist/core/index.js +6 -1
- package/dist/core/kind.d.ts +22 -0
- package/dist/core/kind.js +17 -0
- package/dist/core/limits.d.ts +34 -0
- package/dist/core/limits.js +46 -0
- package/dist/core/match.d.ts +1 -0
- package/dist/core/match.js +10 -1
- package/dist/core/module-scope.d.ts +22 -20
- package/dist/core/module-scope.js +38 -28
- package/dist/core/module.d.ts +18 -5
- package/dist/core/module.js +4 -0
- package/dist/core/projection.d.ts +13 -13
- package/dist/core/projection.js +9 -5
- package/dist/core/protocol.d.ts +68 -11
- package/dist/core/protocol.js +82 -11
- package/dist/core/published.d.ts +43 -0
- package/dist/core/published.js +44 -0
- package/dist/core/replay.d.ts +312 -3
- package/dist/core/replay.js +11 -1
- package/dist/core/schema.d.ts +11 -20
- package/dist/core/schema.js +63 -80
- package/dist/core/serialize.js +2 -4
- package/dist/core/snapshot-store.d.ts +6 -1
- package/dist/core/snapshot-store.js +15 -2
- package/dist/core/snapshots.d.ts +5 -1
- package/dist/core/snapshots.js +10 -15
- package/dist/core/sqlite-store.js +95 -11
- package/dist/core/state.d.ts +142 -4
- package/dist/core/state.js +78 -0
- package/dist/core/store.d.ts +38 -3
- package/dist/core/store.js +77 -22
- package/dist/core/thread.d.ts +10 -9
- package/dist/core/types.d.ts +5 -8
- package/dist/core/types.js +28 -24
- package/dist/core/validate-event.js +14 -4
- package/dist/core/worker-callback.d.ts +17 -0
- package/dist/core/worker-callback.js +1 -0
- package/dist/debugger/app/assets/index-B3Ah8WAE.css +2 -0
- package/dist/debugger/app/assets/index-Qb371t_O.js +22 -0
- package/dist/debugger/app/assets/rolldown-runtime-CbXtAM7H.js +1 -0
- package/dist/debugger/app/assets/routes-CjtEHgPQ.js +47 -0
- package/dist/debugger/app/index.html +14 -0
- package/dist/debugger/components/composer.d.ts +17 -0
- package/dist/debugger/components/composer.js +25 -0
- package/dist/debugger/components/debugger-split.d.ts +2 -1
- package/dist/debugger/components/debugger-split.js +2 -2
- package/dist/debugger/components/event-inspector.d.ts +2 -1
- package/dist/debugger/components/event-inspector.js +25 -16
- package/dist/debugger/components/event-stream.d.ts +2 -1
- package/dist/debugger/components/event-stream.js +14 -74
- package/dist/debugger/components/follow-list.d.ts +19 -0
- package/dist/debugger/components/follow-list.js +96 -0
- package/dist/debugger/components/json-tree.d.ts +11 -0
- package/dist/debugger/components/json-tree.js +120 -0
- package/dist/debugger/components/json-view.js +2 -2
- package/dist/debugger/components/run-tree.js +53 -20
- package/dist/debugger/components/status-dot.d.ts +4 -0
- package/dist/debugger/components/status-dot.js +6 -2
- package/dist/debugger/context.d.ts +14 -0
- package/dist/debugger/context.js +17 -0
- package/dist/debugger/contracts.d.ts +7 -4
- package/dist/debugger/events/builtin-families.d.ts +3 -0
- package/dist/debugger/events/builtin-families.js +9 -0
- package/dist/debugger/events/catalog.d.ts +3 -4
- package/dist/debugger/events/catalog.js +27 -17
- package/dist/debugger/events/protocol-summarize.d.ts +1 -2
- package/dist/debugger/events/protocol-summarize.js +42 -24
- package/dist/debugger/index.d.ts +20 -6
- package/dist/debugger/index.js +19 -5
- package/dist/debugger/lib/cn.d.ts +1 -0
- package/dist/debugger/lib/cn.js +3 -0
- package/dist/debugger/lib/event-meta.d.ts +2 -3
- package/dist/debugger/lib/event-meta.js +6 -12
- package/dist/debugger/lib/json.d.ts +25 -0
- package/dist/debugger/lib/json.js +87 -0
- package/dist/debugger/lib/payload.d.ts +7 -0
- package/dist/debugger/lib/payload.js +11 -0
- package/dist/debugger/lib/time.d.ts +3 -0
- package/dist/debugger/lib/time.js +24 -0
- package/dist/debugger/plugin.d.ts +36 -0
- package/dist/debugger/plugin.js +14 -0
- package/dist/debugger/server/index.d.ts +14 -0
- package/dist/debugger/server/index.js +114 -0
- package/dist/debugger/shell/debugger-shell.d.ts +15 -0
- package/dist/debugger/shell/debugger-shell.js +43 -0
- package/dist/debugger/shell/definition-key.d.ts +3 -0
- package/dist/debugger/shell/definition-key.js +4 -0
- package/dist/debugger/shell/events-pane.d.ts +12 -0
- package/dist/debugger/shell/events-pane.js +25 -0
- package/dist/debugger/shell/projections-panel.d.ts +4 -0
- package/dist/debugger/shell/projections-panel.js +59 -0
- package/dist/debugger/shell/run-controls.d.ts +4 -0
- package/dist/debugger/shell/run-controls.js +72 -0
- package/dist/debugger/shell/run-search.d.ts +6 -0
- package/dist/debugger/shell/run-search.js +102 -0
- package/dist/debugger/shell/run-type-menu.d.ts +6 -0
- package/dist/debugger/shell/run-type-menu.js +11 -0
- package/dist/debugger/shell/schema-form.d.ts +31 -0
- package/dist/debugger/shell/schema-form.js +117 -0
- package/dist/debugger/shell/start-form.d.ts +3 -0
- package/dist/debugger/shell/start-form.js +75 -0
- package/dist/debugger/shell/use-start-run.d.ts +14 -0
- package/dist/debugger/shell/use-start-run.js +32 -0
- package/dist/debugger/shell/workspace.d.ts +6 -0
- package/dist/debugger/shell/workspace.js +15 -0
- package/dist/debugger/styles.css +111 -27
- package/dist/debugger/ui/button.d.ts +24 -0
- package/dist/debugger/ui/button.js +24 -0
- package/dist/debugger/ui/command.d.ts +9 -0
- package/dist/debugger/ui/command.js +24 -0
- package/dist/debugger/ui/dropdown-menu.d.ts +13 -0
- package/dist/debugger/ui/dropdown-menu.js +37 -0
- package/dist/debugger/ui/panel.d.ts +14 -0
- package/dist/debugger/ui/panel.js +16 -0
- package/dist/debugger/ui/popover.d.ts +7 -0
- package/dist/debugger/ui/popover.js +17 -0
- package/dist/debugger/ui/resizable.d.ts +7 -0
- package/dist/debugger/ui/resizable.js +14 -0
- package/dist/debugger/ui/scroll-area.d.ts +2 -1
- package/dist/debugger/ui/scroll-area.js +5 -3
- package/dist/debugger/ui/select.d.ts +10 -0
- package/dist/debugger/ui/select.js +21 -0
- package/dist/debugger/ui/tabs.js +2 -2
- package/dist/debugger/ui/textarea.d.ts +3 -0
- package/dist/debugger/ui/textarea.js +7 -0
- package/dist/evaluator/definitions-store.d.ts +11 -0
- package/dist/evaluator/definitions-store.js +8 -0
- package/dist/evaluator/definitions.d.ts +18 -0
- package/dist/evaluator/definitions.js +4 -0
- package/dist/evaluator/effects.d.ts +226 -0
- package/dist/evaluator/effects.js +132 -0
- package/dist/evaluator/evaluator.d.ts +24 -0
- package/dist/evaluator/evaluator.js +67 -0
- package/dist/evaluator/events.d.ts +59 -0
- package/dist/evaluator/events.js +21 -0
- package/dist/evaluator/index.d.ts +11 -0
- package/dist/evaluator/index.js +11 -0
- package/dist/evaluator/module.d.ts +606 -0
- package/dist/evaluator/module.js +25 -0
- package/dist/evaluator/projections.d.ts +50 -0
- package/dist/evaluator/projections.js +20 -0
- package/dist/evaluator/scope.d.ts +59 -0
- package/dist/evaluator/scope.js +7 -0
- package/dist/evaluator/signals.d.ts +3 -0
- package/dist/evaluator/signals.js +17 -0
- package/dist/evaluator/threads.d.ts +62 -0
- package/dist/evaluator/threads.js +117 -0
- package/dist/evaluator/types.d.ts +125 -0
- package/dist/evaluator/types.js +51 -0
- package/dist/projectors/delivery.d.ts +83 -0
- package/dist/projectors/delivery.js +182 -0
- package/dist/projectors/index-model.d.ts +1 -1
- package/dist/projectors/index-model.js +4 -6
- package/dist/projectors/index.d.ts +2 -0
- package/dist/projectors/index.js +2 -0
- package/dist/projectors/memory.d.ts +1 -1
- package/dist/projectors/memory.js +10 -8
- package/dist/projectors/postgres.js +44 -58
- package/dist/projectors/projector.d.ts +17 -0
- package/dist/projectors/projector.js +26 -1
- package/dist/projectors/sqlite-delivery.d.ts +4 -0
- package/dist/projectors/sqlite-delivery.js +147 -0
- package/dist/projectors/sqlite.js +23 -23
- package/dist/projectors/with-projectors.d.ts +7 -2
- package/dist/projectors/with-projectors.js +27 -28
- package/dist/react/notify.js +11 -8
- package/dist/react/react.d.ts +2 -3
- package/dist/react/react.js +14 -30
- package/dist/react/sse.d.ts +1 -1
- package/dist/react/sse.js +1 -1
- package/dist/react/store.d.ts +3 -3
- package/dist/react/store.js +109 -119
- package/dist/runtime/cancellation.d.ts +16 -0
- package/dist/runtime/cancellation.js +129 -0
- package/dist/runtime/deadline-transition-planner.d.ts +31 -0
- package/dist/runtime/deadline-transition-planner.js +139 -0
- package/dist/runtime/dispatch-effect.d.ts +3 -2
- package/dist/runtime/dispatch-effect.js +7 -13
- package/dist/runtime/errors.d.ts +51 -0
- package/dist/runtime/errors.js +39 -0
- package/dist/runtime/{runtime-helpers.d.ts → helpers.d.ts} +24 -4
- package/dist/runtime/{runtime-helpers.js → helpers.js} +56 -19
- package/dist/runtime/index.d.ts +3 -3
- package/dist/runtime/index.js +3 -3
- package/dist/runtime/ingress.d.ts +15 -0
- package/dist/runtime/ingress.js +42 -0
- package/dist/runtime/local-effect-executor.d.ts +21 -0
- package/dist/runtime/local-effect-executor.js +137 -0
- package/dist/runtime/looms.d.ts +30 -4
- package/dist/runtime/looms.js +57 -37
- package/dist/runtime/observer.d.ts +45 -0
- package/dist/runtime/observer.js +11 -0
- package/dist/runtime/repository.d.ts +55 -0
- package/dist/runtime/repository.js +293 -0
- package/dist/runtime/retry-policy.d.ts +16 -0
- package/dist/runtime/retry-policy.js +29 -0
- package/dist/runtime/run-execution-context.d.ts +30 -0
- package/dist/runtime/run-execution-context.js +56 -0
- package/dist/runtime/run-start.d.ts +4 -0
- package/dist/runtime/run-start.js +44 -0
- package/dist/runtime/runtime.d.ts +6 -87
- package/dist/runtime/runtime.js +248 -470
- package/dist/runtime/server/auth.d.ts +41 -0
- package/dist/runtime/server/auth.js +45 -0
- package/dist/runtime/server/debugger-host.d.ts +11 -0
- package/dist/runtime/server/debugger-host.js +32 -0
- package/dist/runtime/server/fetch-handler.d.ts +18 -0
- package/dist/runtime/server/fetch-handler.js +62 -0
- package/dist/runtime/server/http.d.ts +38 -0
- package/dist/runtime/server/http.js +66 -0
- package/dist/runtime/server/route-table.d.ts +55 -0
- package/dist/runtime/server/route-table.js +74 -0
- package/dist/runtime/server/routes/definitions.d.ts +3 -0
- package/dist/runtime/server/routes/definitions.js +20 -0
- package/dist/runtime/server/routes/effects.d.ts +3 -0
- package/dist/runtime/server/routes/effects.js +59 -0
- package/dist/runtime/server/routes/operations.d.ts +3 -0
- package/dist/runtime/server/routes/operations.js +14 -0
- package/dist/runtime/server/routes/runs.d.ts +3 -0
- package/dist/runtime/server/routes/runs.js +199 -0
- package/dist/runtime/server.d.ts +4 -8
- package/dist/runtime/server.js +6 -211
- package/dist/runtime/sse.d.ts +2 -1
- package/dist/runtime/sse.js +24 -17
- package/dist/runtime/types.d.ts +117 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/wake-engine.d.ts +20 -0
- package/dist/runtime/wake-engine.js +311 -0
- package/dist/runtime/wake-scheduler.d.ts +3 -4
- package/dist/runtime/wake-scheduler.js +25 -31
- package/dist/runtime/worker-callbacks.d.ts +16 -0
- package/dist/runtime/worker-callbacks.js +167 -0
- package/dist/runtime/worker-effect-dispatch.d.ts +36 -0
- package/dist/runtime/worker-effect-dispatch.js +126 -0
- package/dist/s2/config.d.ts +1 -1
- package/dist/s2/config.js +1 -1
- package/dist/s2/lite.js +70 -82
- package/dist/s2/pagination.d.ts +15 -0
- package/dist/s2/pagination.js +36 -0
- package/dist/s2/projector.js +6 -5
- package/dist/s2/snapshot-store.js +188 -161
- package/dist/s2/store.d.ts +3 -21
- package/dist/s2/store.js +71 -165
- package/dist/testing/index.d.ts +15 -0
- package/dist/testing/index.js +53 -16
- package/dist/workflow/debugger/index.d.ts +4 -0
- package/dist/workflow/debugger/index.js +11 -0
- package/dist/workflow/debugger/nodes-view.d.ts +3 -0
- package/dist/workflow/debugger/nodes-view.js +13 -0
- package/dist/workflow/debugger/summarize.d.ts +2 -0
- package/dist/workflow/debugger/summarize.js +30 -0
- package/dist/workflow/definitions-store.d.ts +2 -3
- package/dist/workflow/definitions-store.js +2 -2
- package/dist/workflow/definitions.d.ts +78 -22
- package/dist/workflow/definitions.js +80 -14
- package/dist/workflow/effects.d.ts +453 -107
- package/dist/workflow/effects.js +214 -115
- package/dist/workflow/events.d.ts +149 -5
- package/dist/workflow/events.js +27 -5
- package/dist/workflow/graph.d.ts +56 -0
- package/dist/workflow/graph.js +207 -0
- package/dist/workflow/index.d.ts +1 -0
- package/dist/workflow/index.js +1 -0
- package/dist/workflow/module.d.ts +1047 -266
- package/dist/workflow/projections.d.ts +14 -12
- package/dist/workflow/projections.js +30 -8
- package/dist/workflow/scope.d.ts +146 -4
- package/dist/workflow/threads.d.ts +383 -155
- package/dist/workflow/threads.js +308 -110
- package/package.json +26 -2
- package/dist/debugger/events/domain-summarize.d.ts +0 -3
- package/dist/debugger/events/domain-summarize.js +0 -107
- package/dist/debugger/events/family.d.ts +0 -8
- package/dist/debugger/events/family.js +0 -44
- package/dist/runtime/events-api.d.ts +0 -4
- package/dist/runtime/events-api.js +0 -84
|
@@ -1,65 +1,113 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
1
|
+
import { Effect, Schema } from 'effect';
|
|
2
2
|
import { type EventInputOf, type JsonValue } from '@swirls/looms/core';
|
|
3
|
-
import { type WorkflowDefinition } from './definitions';
|
|
3
|
+
import { type NodeState, type WorkflowDefinition } from './definitions';
|
|
4
4
|
import { WorkflowDefinitionsTag } from './definitions-store';
|
|
5
5
|
import { type WorkflowEvent } from './scope';
|
|
6
|
+
type WorkflowEvents = EventInputOf<WorkflowEvent>[];
|
|
6
7
|
export declare const scheduleEffect: NoInfer<import("@swirls/looms/core").EffectDefinition<{
|
|
7
8
|
readonly definitionName?: string | undefined;
|
|
9
|
+
readonly definitionVersion: string;
|
|
8
10
|
readonly nodes?: {
|
|
9
11
|
readonly [x: string]: {
|
|
10
12
|
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
11
13
|
readonly result: Schema.Json;
|
|
12
14
|
readonly error: string | null;
|
|
15
|
+
readonly attempts?: number | undefined;
|
|
16
|
+
readonly branch?: string | undefined;
|
|
17
|
+
readonly skipCause?: "inactive" | "policy" | undefined;
|
|
18
|
+
readonly iteration?: {
|
|
19
|
+
readonly index: number;
|
|
20
|
+
readonly previous: Schema.Json;
|
|
21
|
+
} | undefined;
|
|
13
22
|
};
|
|
14
23
|
} | undefined;
|
|
15
24
|
readonly input?: Schema.Json | undefined;
|
|
16
25
|
}, WorkflowDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
17
|
-
readonly type: "
|
|
26
|
+
readonly type: "runtime.effect.ambiguous";
|
|
18
27
|
readonly payload: {
|
|
19
|
-
readonly
|
|
28
|
+
readonly effectId: string;
|
|
29
|
+
readonly attempt: number;
|
|
30
|
+
readonly error: string;
|
|
20
31
|
};
|
|
21
32
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
22
|
-
readonly type: "
|
|
33
|
+
readonly type: "runtime.effect.attempt.started";
|
|
23
34
|
readonly payload: {
|
|
24
|
-
readonly
|
|
25
|
-
readonly
|
|
26
|
-
readonly error: string | null;
|
|
35
|
+
readonly effectId: string;
|
|
36
|
+
readonly attempt: number;
|
|
27
37
|
};
|
|
28
38
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
29
|
-
readonly type: "
|
|
39
|
+
readonly type: "runtime.effect.cancel.requested";
|
|
30
40
|
readonly payload: {
|
|
31
|
-
readonly
|
|
32
|
-
readonly
|
|
41
|
+
readonly effectId: string;
|
|
42
|
+
readonly attempt: number;
|
|
43
|
+
readonly deadlineAt: number | null;
|
|
33
44
|
};
|
|
34
45
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
35
|
-
readonly type: "
|
|
46
|
+
readonly type: "runtime.effect.cancelled";
|
|
36
47
|
readonly payload: {
|
|
37
|
-
readonly
|
|
38
|
-
readonly
|
|
39
|
-
readonly kind: string;
|
|
40
|
-
readonly definitionName: string;
|
|
41
|
-
readonly input: Schema.Json;
|
|
48
|
+
readonly effectId: string;
|
|
49
|
+
readonly attempt: number;
|
|
42
50
|
};
|
|
43
51
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
44
|
-
readonly type: "
|
|
52
|
+
readonly type: "runtime.effect.completed";
|
|
45
53
|
readonly payload: {
|
|
46
|
-
readonly
|
|
47
|
-
readonly
|
|
48
|
-
readonly wakeAt: number;
|
|
54
|
+
readonly effectId: string;
|
|
55
|
+
readonly attempt: number;
|
|
49
56
|
};
|
|
50
57
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
51
|
-
readonly type: "
|
|
58
|
+
readonly type: "runtime.effect.dispatched";
|
|
52
59
|
readonly payload: {
|
|
53
|
-
readonly
|
|
54
|
-
readonly
|
|
60
|
+
readonly effectId: string;
|
|
61
|
+
readonly attempt: number;
|
|
62
|
+
readonly deadlineAt: number | null;
|
|
55
63
|
};
|
|
56
64
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
57
|
-
readonly type: "runtime.
|
|
65
|
+
readonly type: "runtime.effect.failed";
|
|
58
66
|
readonly payload: {
|
|
59
|
-
readonly
|
|
60
|
-
readonly
|
|
61
|
-
|
|
62
|
-
|
|
67
|
+
readonly effectId: string;
|
|
68
|
+
readonly error: string;
|
|
69
|
+
};
|
|
70
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
71
|
+
readonly type: "runtime.effect.heartbeat";
|
|
72
|
+
readonly payload: {
|
|
73
|
+
readonly effectId: string;
|
|
74
|
+
readonly attempt: number;
|
|
75
|
+
readonly heartbeatAt: number;
|
|
76
|
+
readonly deadlineAt: number | null;
|
|
77
|
+
};
|
|
78
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
79
|
+
readonly type: "runtime.effect.queued";
|
|
80
|
+
readonly payload: {
|
|
81
|
+
readonly effectId: string;
|
|
82
|
+
readonly attempt: number;
|
|
83
|
+
readonly deadlineAt: number | null;
|
|
84
|
+
};
|
|
85
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
86
|
+
readonly type: "runtime.effect.retry.scheduled";
|
|
87
|
+
readonly payload: {
|
|
88
|
+
readonly effectId: string;
|
|
89
|
+
readonly attempt: number;
|
|
90
|
+
readonly nextAttemptAt: number;
|
|
91
|
+
readonly error: string;
|
|
92
|
+
};
|
|
93
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
94
|
+
readonly type: "runtime.effect.timed_out";
|
|
95
|
+
readonly payload: {
|
|
96
|
+
readonly effectId: string;
|
|
97
|
+
readonly attempt: number;
|
|
98
|
+
readonly timeout: string;
|
|
99
|
+
};
|
|
100
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
101
|
+
readonly type: "runtime.effect.worker.started";
|
|
102
|
+
readonly payload: {
|
|
103
|
+
readonly effectId: string;
|
|
104
|
+
readonly attempt: number;
|
|
105
|
+
readonly deadlineAt: number | null;
|
|
106
|
+
};
|
|
107
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
108
|
+
readonly type: "runtime.run.cancelled";
|
|
109
|
+
readonly payload: {
|
|
110
|
+
readonly reason?: string | undefined;
|
|
63
111
|
};
|
|
64
112
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
65
113
|
readonly type: "runtime.run.completed";
|
|
@@ -68,13 +116,37 @@ export declare const scheduleEffect: NoInfer<import("@swirls/looms/core").Effect
|
|
|
68
116
|
readonly error: string | null;
|
|
69
117
|
};
|
|
70
118
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
71
|
-
readonly type: "runtime.
|
|
119
|
+
readonly type: "runtime.run.started";
|
|
72
120
|
readonly payload: {
|
|
73
|
-
readonly
|
|
121
|
+
readonly rootThreadId?: string | undefined;
|
|
74
122
|
readonly kind: string;
|
|
75
123
|
readonly definitionName: string;
|
|
124
|
+
readonly definitionVersion: string;
|
|
76
125
|
readonly input: Schema.Json;
|
|
77
|
-
readonly
|
|
126
|
+
readonly requestedThreadId?: string | null | undefined;
|
|
127
|
+
};
|
|
128
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
129
|
+
readonly type: "runtime.signal.received";
|
|
130
|
+
readonly payload: {
|
|
131
|
+
readonly signalType: string;
|
|
132
|
+
};
|
|
133
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
134
|
+
readonly type: "runtime.snapshot.taken";
|
|
135
|
+
readonly payload: {
|
|
136
|
+
readonly seq: number;
|
|
137
|
+
readonly stateHash: string;
|
|
138
|
+
readonly state?: Schema.Json | undefined;
|
|
139
|
+
};
|
|
140
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
141
|
+
readonly type: "runtime.thread.cancel.requested";
|
|
142
|
+
readonly payload: {
|
|
143
|
+
readonly threadId: string;
|
|
144
|
+
};
|
|
145
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
146
|
+
readonly type: "runtime.thread.cancelled";
|
|
147
|
+
readonly payload: {
|
|
148
|
+
readonly threadId: string;
|
|
149
|
+
readonly reason?: string | undefined;
|
|
78
150
|
};
|
|
79
151
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
80
152
|
readonly type: "runtime.thread.completed";
|
|
@@ -89,10 +161,27 @@ export declare const scheduleEffect: NoInfer<import("@swirls/looms/core").Effect
|
|
|
89
161
|
readonly error: string;
|
|
90
162
|
};
|
|
91
163
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
92
|
-
readonly type: "runtime.thread.
|
|
164
|
+
readonly type: "runtime.thread.started";
|
|
93
165
|
readonly payload: {
|
|
94
166
|
readonly threadId: string;
|
|
95
|
-
readonly
|
|
167
|
+
readonly kind: string;
|
|
168
|
+
readonly definitionName: string;
|
|
169
|
+
readonly definitionVersion: string;
|
|
170
|
+
readonly input: Schema.Json;
|
|
171
|
+
readonly parentThreadId: string | null;
|
|
172
|
+
};
|
|
173
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
174
|
+
readonly type: "runtime.timer.fired";
|
|
175
|
+
readonly payload: {
|
|
176
|
+
readonly timerId: string;
|
|
177
|
+
readonly waitId: string;
|
|
178
|
+
};
|
|
179
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
180
|
+
readonly type: "runtime.timer.set";
|
|
181
|
+
readonly payload: {
|
|
182
|
+
readonly timerId: string;
|
|
183
|
+
readonly waitId: string;
|
|
184
|
+
readonly wakeAt: number;
|
|
96
185
|
};
|
|
97
186
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
98
187
|
readonly type: "runtime.wait.registered";
|
|
@@ -119,100 +208,233 @@ export declare const scheduleEffect: NoInfer<import("@swirls/looms/core").Effect
|
|
|
119
208
|
};
|
|
120
209
|
};
|
|
121
210
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
122
|
-
readonly type: "
|
|
211
|
+
readonly type: "workflow.effects.requested";
|
|
123
212
|
readonly payload: {
|
|
124
|
-
readonly
|
|
125
|
-
readonly
|
|
126
|
-
|
|
213
|
+
readonly nodeId: string;
|
|
214
|
+
readonly effects: readonly ({
|
|
215
|
+
readonly type: "runtime.spawn";
|
|
216
|
+
readonly childThreadId: string;
|
|
217
|
+
readonly kind: string;
|
|
218
|
+
readonly definitionName: string;
|
|
219
|
+
readonly definitionVersion: string;
|
|
220
|
+
readonly input: Schema.Json;
|
|
221
|
+
} | {
|
|
222
|
+
readonly type: "runtime.wait";
|
|
223
|
+
readonly waitId: string;
|
|
224
|
+
readonly on: {
|
|
225
|
+
readonly type: string | readonly string[];
|
|
226
|
+
readonly match?: Schema.Json | undefined;
|
|
227
|
+
} | {
|
|
228
|
+
readonly timerAt: number;
|
|
229
|
+
};
|
|
230
|
+
readonly tag?: Schema.Json | undefined;
|
|
231
|
+
} | {
|
|
232
|
+
readonly type: "runtime.emit";
|
|
233
|
+
readonly event: {
|
|
234
|
+
readonly type: string;
|
|
235
|
+
readonly payload: Schema.Json;
|
|
236
|
+
readonly threadId?: string | null | undefined;
|
|
237
|
+
readonly parentThreadId?: string | null | undefined;
|
|
238
|
+
readonly causationId?: string | null | undefined;
|
|
239
|
+
readonly correlationId?: string | null | undefined;
|
|
240
|
+
readonly effectId?: string | null | undefined;
|
|
241
|
+
readonly origin?: {
|
|
242
|
+
readonly type: "thread";
|
|
243
|
+
readonly threadId: string;
|
|
244
|
+
} | {
|
|
245
|
+
readonly type: "external";
|
|
246
|
+
readonly actorId?: string | undefined;
|
|
247
|
+
} | {
|
|
248
|
+
readonly type: "system";
|
|
249
|
+
} | undefined;
|
|
250
|
+
readonly ephemeral?: boolean | undefined;
|
|
251
|
+
readonly id?: string | undefined;
|
|
252
|
+
readonly ts?: number | undefined;
|
|
253
|
+
readonly idempotencyKey?: string | null | undefined;
|
|
254
|
+
};
|
|
255
|
+
readonly tag?: string | undefined;
|
|
256
|
+
} | {
|
|
257
|
+
readonly type: "runtime.complete";
|
|
258
|
+
readonly output: Schema.Json;
|
|
259
|
+
} | {
|
|
260
|
+
readonly type: "runtime.fail";
|
|
261
|
+
readonly error: string;
|
|
262
|
+
} | {
|
|
263
|
+
readonly type: "runtime.cancel";
|
|
264
|
+
readonly threadId: string;
|
|
265
|
+
readonly tag?: string | undefined;
|
|
266
|
+
} | {
|
|
267
|
+
readonly type: string;
|
|
268
|
+
readonly input: Schema.Json;
|
|
269
|
+
readonly tag?: string | undefined;
|
|
270
|
+
})[];
|
|
127
271
|
};
|
|
128
272
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
129
|
-
readonly type: "
|
|
273
|
+
readonly type: "workflow.map.requested";
|
|
130
274
|
readonly payload: {
|
|
131
|
-
readonly
|
|
132
|
-
readonly
|
|
275
|
+
readonly nodeId: string;
|
|
276
|
+
readonly attempt: number;
|
|
277
|
+
readonly kind: string;
|
|
278
|
+
readonly definitionName: string;
|
|
279
|
+
readonly definitionVersion: string;
|
|
280
|
+
readonly items: readonly Schema.Json[];
|
|
281
|
+
readonly concurrency: number;
|
|
282
|
+
readonly limitBytes: number;
|
|
133
283
|
};
|
|
134
284
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
135
|
-
readonly type: "
|
|
285
|
+
readonly type: "workflow.node.finished";
|
|
136
286
|
readonly payload: {
|
|
137
|
-
readonly
|
|
138
|
-
readonly
|
|
287
|
+
readonly nodeId: string;
|
|
288
|
+
readonly result: Schema.Json;
|
|
289
|
+
readonly error: string | null;
|
|
290
|
+
readonly branch?: string | undefined;
|
|
139
291
|
};
|
|
140
292
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
141
|
-
readonly type: "
|
|
293
|
+
readonly type: "workflow.node.skipped";
|
|
142
294
|
readonly payload: {
|
|
143
|
-
readonly
|
|
144
|
-
readonly
|
|
145
|
-
readonly
|
|
295
|
+
readonly nodeId: string;
|
|
296
|
+
readonly reason: string;
|
|
297
|
+
readonly cause: "inactive" | "policy";
|
|
146
298
|
};
|
|
147
299
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
148
|
-
readonly type: "
|
|
300
|
+
readonly type: "workflow.node.started";
|
|
149
301
|
readonly payload: {
|
|
150
|
-
readonly
|
|
302
|
+
readonly nodeId: string;
|
|
303
|
+
};
|
|
304
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
305
|
+
readonly type: "workflow.sleep.requested";
|
|
306
|
+
readonly payload: {
|
|
307
|
+
readonly nodeId: string;
|
|
308
|
+
readonly waitId: string;
|
|
309
|
+
readonly wakeAt: number;
|
|
310
|
+
};
|
|
311
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
312
|
+
readonly type: "workflow.spawn.requested";
|
|
313
|
+
readonly payload: {
|
|
314
|
+
readonly nodeId: string;
|
|
315
|
+
readonly attempt: number;
|
|
316
|
+
readonly childThreadId: string;
|
|
317
|
+
readonly kind: string;
|
|
318
|
+
readonly definitionName: string;
|
|
319
|
+
readonly definitionVersion: string;
|
|
320
|
+
readonly input: Schema.Json;
|
|
321
|
+
readonly loopIndex: number | null;
|
|
151
322
|
};
|
|
152
323
|
})>>;
|
|
153
324
|
export declare function scheduleEvents(definition: WorkflowDefinition, binding: {
|
|
154
|
-
nodes:
|
|
155
|
-
[id: string]: {
|
|
156
|
-
status: string;
|
|
157
|
-
result: JsonValue | null;
|
|
158
|
-
};
|
|
159
|
-
};
|
|
325
|
+
nodes: Record<string, NodeState>;
|
|
160
326
|
input: JsonValue;
|
|
161
|
-
}, threadId: string):
|
|
327
|
+
}, threadId: string): Effect.Effect<WorkflowEvents>;
|
|
162
328
|
export declare const runNodeEffect: NoInfer<import("@swirls/looms/core").EffectDefinition<{
|
|
163
329
|
readonly definitionName?: string | undefined;
|
|
330
|
+
readonly definitionVersion: string;
|
|
164
331
|
readonly nodeId: string;
|
|
332
|
+
readonly attempt: number;
|
|
333
|
+
readonly iteration?: {
|
|
334
|
+
readonly index: number;
|
|
335
|
+
readonly previous: Schema.Json;
|
|
336
|
+
} | undefined;
|
|
165
337
|
readonly input?: Schema.Json | undefined;
|
|
166
|
-
readonly
|
|
167
|
-
readonly [x: string]:
|
|
338
|
+
readonly nodes?: {
|
|
339
|
+
readonly [x: string]: {
|
|
340
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
341
|
+
readonly result: Schema.Json;
|
|
342
|
+
readonly error: string | null;
|
|
343
|
+
readonly attempts?: number | undefined;
|
|
344
|
+
readonly branch?: string | undefined;
|
|
345
|
+
readonly skipCause?: "inactive" | "policy" | undefined;
|
|
346
|
+
readonly iteration?: {
|
|
347
|
+
readonly index: number;
|
|
348
|
+
readonly previous: Schema.Json;
|
|
349
|
+
} | undefined;
|
|
350
|
+
};
|
|
168
351
|
} | undefined;
|
|
169
352
|
}, WorkflowDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
170
|
-
readonly type: "
|
|
353
|
+
readonly type: "runtime.effect.ambiguous";
|
|
171
354
|
readonly payload: {
|
|
172
|
-
readonly
|
|
355
|
+
readonly effectId: string;
|
|
356
|
+
readonly attempt: number;
|
|
357
|
+
readonly error: string;
|
|
173
358
|
};
|
|
174
359
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
175
|
-
readonly type: "
|
|
360
|
+
readonly type: "runtime.effect.attempt.started";
|
|
176
361
|
readonly payload: {
|
|
177
|
-
readonly
|
|
178
|
-
readonly
|
|
179
|
-
readonly error: string | null;
|
|
362
|
+
readonly effectId: string;
|
|
363
|
+
readonly attempt: number;
|
|
180
364
|
};
|
|
181
365
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
182
|
-
readonly type: "
|
|
366
|
+
readonly type: "runtime.effect.cancel.requested";
|
|
183
367
|
readonly payload: {
|
|
184
|
-
readonly
|
|
185
|
-
readonly
|
|
368
|
+
readonly effectId: string;
|
|
369
|
+
readonly attempt: number;
|
|
370
|
+
readonly deadlineAt: number | null;
|
|
186
371
|
};
|
|
187
372
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
188
|
-
readonly type: "
|
|
373
|
+
readonly type: "runtime.effect.cancelled";
|
|
189
374
|
readonly payload: {
|
|
190
|
-
readonly
|
|
191
|
-
readonly
|
|
192
|
-
readonly kind: string;
|
|
193
|
-
readonly definitionName: string;
|
|
194
|
-
readonly input: Schema.Json;
|
|
375
|
+
readonly effectId: string;
|
|
376
|
+
readonly attempt: number;
|
|
195
377
|
};
|
|
196
378
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
197
|
-
readonly type: "
|
|
379
|
+
readonly type: "runtime.effect.completed";
|
|
198
380
|
readonly payload: {
|
|
199
|
-
readonly
|
|
200
|
-
readonly
|
|
201
|
-
readonly wakeAt: number;
|
|
381
|
+
readonly effectId: string;
|
|
382
|
+
readonly attempt: number;
|
|
202
383
|
};
|
|
203
384
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
204
|
-
readonly type: "
|
|
385
|
+
readonly type: "runtime.effect.dispatched";
|
|
205
386
|
readonly payload: {
|
|
206
|
-
readonly
|
|
207
|
-
readonly
|
|
387
|
+
readonly effectId: string;
|
|
388
|
+
readonly attempt: number;
|
|
389
|
+
readonly deadlineAt: number | null;
|
|
208
390
|
};
|
|
209
391
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
210
|
-
readonly type: "runtime.
|
|
392
|
+
readonly type: "runtime.effect.failed";
|
|
211
393
|
readonly payload: {
|
|
212
|
-
readonly
|
|
213
|
-
readonly
|
|
214
|
-
|
|
215
|
-
|
|
394
|
+
readonly effectId: string;
|
|
395
|
+
readonly error: string;
|
|
396
|
+
};
|
|
397
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
398
|
+
readonly type: "runtime.effect.heartbeat";
|
|
399
|
+
readonly payload: {
|
|
400
|
+
readonly effectId: string;
|
|
401
|
+
readonly attempt: number;
|
|
402
|
+
readonly heartbeatAt: number;
|
|
403
|
+
readonly deadlineAt: number | null;
|
|
404
|
+
};
|
|
405
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
406
|
+
readonly type: "runtime.effect.queued";
|
|
407
|
+
readonly payload: {
|
|
408
|
+
readonly effectId: string;
|
|
409
|
+
readonly attempt: number;
|
|
410
|
+
readonly deadlineAt: number | null;
|
|
411
|
+
};
|
|
412
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
413
|
+
readonly type: "runtime.effect.retry.scheduled";
|
|
414
|
+
readonly payload: {
|
|
415
|
+
readonly effectId: string;
|
|
416
|
+
readonly attempt: number;
|
|
417
|
+
readonly nextAttemptAt: number;
|
|
418
|
+
readonly error: string;
|
|
419
|
+
};
|
|
420
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
421
|
+
readonly type: "runtime.effect.timed_out";
|
|
422
|
+
readonly payload: {
|
|
423
|
+
readonly effectId: string;
|
|
424
|
+
readonly attempt: number;
|
|
425
|
+
readonly timeout: string;
|
|
426
|
+
};
|
|
427
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
428
|
+
readonly type: "runtime.effect.worker.started";
|
|
429
|
+
readonly payload: {
|
|
430
|
+
readonly effectId: string;
|
|
431
|
+
readonly attempt: number;
|
|
432
|
+
readonly deadlineAt: number | null;
|
|
433
|
+
};
|
|
434
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
435
|
+
readonly type: "runtime.run.cancelled";
|
|
436
|
+
readonly payload: {
|
|
437
|
+
readonly reason?: string | undefined;
|
|
216
438
|
};
|
|
217
439
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
218
440
|
readonly type: "runtime.run.completed";
|
|
@@ -221,13 +443,37 @@ export declare const runNodeEffect: NoInfer<import("@swirls/looms/core").EffectD
|
|
|
221
443
|
readonly error: string | null;
|
|
222
444
|
};
|
|
223
445
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
224
|
-
readonly type: "runtime.
|
|
446
|
+
readonly type: "runtime.run.started";
|
|
225
447
|
readonly payload: {
|
|
226
|
-
readonly
|
|
448
|
+
readonly rootThreadId?: string | undefined;
|
|
227
449
|
readonly kind: string;
|
|
228
450
|
readonly definitionName: string;
|
|
451
|
+
readonly definitionVersion: string;
|
|
229
452
|
readonly input: Schema.Json;
|
|
230
|
-
readonly
|
|
453
|
+
readonly requestedThreadId?: string | null | undefined;
|
|
454
|
+
};
|
|
455
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
456
|
+
readonly type: "runtime.signal.received";
|
|
457
|
+
readonly payload: {
|
|
458
|
+
readonly signalType: string;
|
|
459
|
+
};
|
|
460
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
461
|
+
readonly type: "runtime.snapshot.taken";
|
|
462
|
+
readonly payload: {
|
|
463
|
+
readonly seq: number;
|
|
464
|
+
readonly stateHash: string;
|
|
465
|
+
readonly state?: Schema.Json | undefined;
|
|
466
|
+
};
|
|
467
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
468
|
+
readonly type: "runtime.thread.cancel.requested";
|
|
469
|
+
readonly payload: {
|
|
470
|
+
readonly threadId: string;
|
|
471
|
+
};
|
|
472
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
473
|
+
readonly type: "runtime.thread.cancelled";
|
|
474
|
+
readonly payload: {
|
|
475
|
+
readonly threadId: string;
|
|
476
|
+
readonly reason?: string | undefined;
|
|
231
477
|
};
|
|
232
478
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
233
479
|
readonly type: "runtime.thread.completed";
|
|
@@ -242,10 +488,27 @@ export declare const runNodeEffect: NoInfer<import("@swirls/looms/core").EffectD
|
|
|
242
488
|
readonly error: string;
|
|
243
489
|
};
|
|
244
490
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
245
|
-
readonly type: "runtime.thread.
|
|
491
|
+
readonly type: "runtime.thread.started";
|
|
246
492
|
readonly payload: {
|
|
247
493
|
readonly threadId: string;
|
|
248
|
-
readonly
|
|
494
|
+
readonly kind: string;
|
|
495
|
+
readonly definitionName: string;
|
|
496
|
+
readonly definitionVersion: string;
|
|
497
|
+
readonly input: Schema.Json;
|
|
498
|
+
readonly parentThreadId: string | null;
|
|
499
|
+
};
|
|
500
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
501
|
+
readonly type: "runtime.timer.fired";
|
|
502
|
+
readonly payload: {
|
|
503
|
+
readonly timerId: string;
|
|
504
|
+
readonly waitId: string;
|
|
505
|
+
};
|
|
506
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
507
|
+
readonly type: "runtime.timer.set";
|
|
508
|
+
readonly payload: {
|
|
509
|
+
readonly timerId: string;
|
|
510
|
+
readonly waitId: string;
|
|
511
|
+
readonly wakeAt: number;
|
|
249
512
|
};
|
|
250
513
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
251
514
|
readonly type: "runtime.wait.registered";
|
|
@@ -272,34 +535,117 @@ export declare const runNodeEffect: NoInfer<import("@swirls/looms/core").EffectD
|
|
|
272
535
|
};
|
|
273
536
|
};
|
|
274
537
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
275
|
-
readonly type: "
|
|
538
|
+
readonly type: "workflow.effects.requested";
|
|
276
539
|
readonly payload: {
|
|
277
|
-
readonly
|
|
278
|
-
readonly
|
|
279
|
-
|
|
540
|
+
readonly nodeId: string;
|
|
541
|
+
readonly effects: readonly ({
|
|
542
|
+
readonly type: "runtime.spawn";
|
|
543
|
+
readonly childThreadId: string;
|
|
544
|
+
readonly kind: string;
|
|
545
|
+
readonly definitionName: string;
|
|
546
|
+
readonly definitionVersion: string;
|
|
547
|
+
readonly input: Schema.Json;
|
|
548
|
+
} | {
|
|
549
|
+
readonly type: "runtime.wait";
|
|
550
|
+
readonly waitId: string;
|
|
551
|
+
readonly on: {
|
|
552
|
+
readonly type: string | readonly string[];
|
|
553
|
+
readonly match?: Schema.Json | undefined;
|
|
554
|
+
} | {
|
|
555
|
+
readonly timerAt: number;
|
|
556
|
+
};
|
|
557
|
+
readonly tag?: Schema.Json | undefined;
|
|
558
|
+
} | {
|
|
559
|
+
readonly type: "runtime.emit";
|
|
560
|
+
readonly event: {
|
|
561
|
+
readonly type: string;
|
|
562
|
+
readonly payload: Schema.Json;
|
|
563
|
+
readonly threadId?: string | null | undefined;
|
|
564
|
+
readonly parentThreadId?: string | null | undefined;
|
|
565
|
+
readonly causationId?: string | null | undefined;
|
|
566
|
+
readonly correlationId?: string | null | undefined;
|
|
567
|
+
readonly effectId?: string | null | undefined;
|
|
568
|
+
readonly origin?: {
|
|
569
|
+
readonly type: "thread";
|
|
570
|
+
readonly threadId: string;
|
|
571
|
+
} | {
|
|
572
|
+
readonly type: "external";
|
|
573
|
+
readonly actorId?: string | undefined;
|
|
574
|
+
} | {
|
|
575
|
+
readonly type: "system";
|
|
576
|
+
} | undefined;
|
|
577
|
+
readonly ephemeral?: boolean | undefined;
|
|
578
|
+
readonly id?: string | undefined;
|
|
579
|
+
readonly ts?: number | undefined;
|
|
580
|
+
readonly idempotencyKey?: string | null | undefined;
|
|
581
|
+
};
|
|
582
|
+
readonly tag?: string | undefined;
|
|
583
|
+
} | {
|
|
584
|
+
readonly type: "runtime.complete";
|
|
585
|
+
readonly output: Schema.Json;
|
|
586
|
+
} | {
|
|
587
|
+
readonly type: "runtime.fail";
|
|
588
|
+
readonly error: string;
|
|
589
|
+
} | {
|
|
590
|
+
readonly type: "runtime.cancel";
|
|
591
|
+
readonly threadId: string;
|
|
592
|
+
readonly tag?: string | undefined;
|
|
593
|
+
} | {
|
|
594
|
+
readonly type: string;
|
|
595
|
+
readonly input: Schema.Json;
|
|
596
|
+
readonly tag?: string | undefined;
|
|
597
|
+
})[];
|
|
280
598
|
};
|
|
281
599
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
282
|
-
readonly type: "
|
|
600
|
+
readonly type: "workflow.map.requested";
|
|
283
601
|
readonly payload: {
|
|
284
|
-
readonly
|
|
285
|
-
readonly
|
|
602
|
+
readonly nodeId: string;
|
|
603
|
+
readonly attempt: number;
|
|
604
|
+
readonly kind: string;
|
|
605
|
+
readonly definitionName: string;
|
|
606
|
+
readonly definitionVersion: string;
|
|
607
|
+
readonly items: readonly Schema.Json[];
|
|
608
|
+
readonly concurrency: number;
|
|
609
|
+
readonly limitBytes: number;
|
|
286
610
|
};
|
|
287
611
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
288
|
-
readonly type: "
|
|
612
|
+
readonly type: "workflow.node.finished";
|
|
289
613
|
readonly payload: {
|
|
290
|
-
readonly
|
|
291
|
-
readonly
|
|
614
|
+
readonly nodeId: string;
|
|
615
|
+
readonly result: Schema.Json;
|
|
616
|
+
readonly error: string | null;
|
|
617
|
+
readonly branch?: string | undefined;
|
|
292
618
|
};
|
|
293
619
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
294
|
-
readonly type: "
|
|
620
|
+
readonly type: "workflow.node.skipped";
|
|
295
621
|
readonly payload: {
|
|
296
|
-
readonly
|
|
297
|
-
readonly
|
|
298
|
-
readonly
|
|
622
|
+
readonly nodeId: string;
|
|
623
|
+
readonly reason: string;
|
|
624
|
+
readonly cause: "inactive" | "policy";
|
|
299
625
|
};
|
|
300
626
|
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
301
|
-
readonly type: "
|
|
627
|
+
readonly type: "workflow.node.started";
|
|
302
628
|
readonly payload: {
|
|
303
|
-
readonly
|
|
629
|
+
readonly nodeId: string;
|
|
630
|
+
};
|
|
631
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
632
|
+
readonly type: "workflow.sleep.requested";
|
|
633
|
+
readonly payload: {
|
|
634
|
+
readonly nodeId: string;
|
|
635
|
+
readonly waitId: string;
|
|
636
|
+
readonly wakeAt: number;
|
|
637
|
+
};
|
|
638
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
639
|
+
readonly type: "workflow.spawn.requested";
|
|
640
|
+
readonly payload: {
|
|
641
|
+
readonly nodeId: string;
|
|
642
|
+
readonly attempt: number;
|
|
643
|
+
readonly childThreadId: string;
|
|
644
|
+
readonly kind: string;
|
|
645
|
+
readonly definitionName: string;
|
|
646
|
+
readonly definitionVersion: string;
|
|
647
|
+
readonly input: Schema.Json;
|
|
648
|
+
readonly loopIndex: number | null;
|
|
304
649
|
};
|
|
305
650
|
})>>;
|
|
651
|
+
export {};
|