@swirls/looms 0.0.1
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/LICENSE +190 -0
- package/README.md +9 -0
- package/dist/actor/cell.d.ts +27 -0
- package/dist/actor/cell.js +41 -0
- package/dist/actor/host.d.ts +27 -0
- package/dist/actor/host.js +82 -0
- package/dist/actor/index.d.ts +3 -0
- package/dist/actor/index.js +3 -0
- package/dist/actor/routing.d.ts +15 -0
- package/dist/actor/routing.js +80 -0
- package/dist/agent/definitions-store.d.ts +11 -0
- package/dist/agent/definitions-store.js +10 -0
- package/dist/agent/definitions.d.ts +152 -0
- package/dist/agent/definitions.js +74 -0
- package/dist/agent/effects.d.ts +425 -0
- package/dist/agent/effects.js +318 -0
- package/dist/agent/events.d.ts +170 -0
- package/dist/agent/events.js +61 -0
- package/dist/agent/index.d.ts +13 -0
- package/dist/agent/index.js +13 -0
- package/dist/agent/llm.d.ts +35 -0
- package/dist/agent/llm.js +48 -0
- package/dist/agent/module.d.ts +1037 -0
- package/dist/agent/module.js +27 -0
- package/dist/agent/projections.d.ts +17 -0
- package/dist/agent/projections.js +81 -0
- package/dist/agent/scope.d.ts +171 -0
- package/dist/agent/scope.js +7 -0
- package/dist/agent/signals.d.ts +17 -0
- package/dist/agent/signals.js +19 -0
- package/dist/agent/stop-when.d.ts +12 -0
- package/dist/agent/stop-when.js +6 -0
- package/dist/agent/threads.d.ts +34 -0
- package/dist/agent/threads.js +407 -0
- package/dist/agent/tool-schema.d.ts +21 -0
- package/dist/agent/tool-schema.js +67 -0
- package/dist/agent/types.d.ts +87 -0
- package/dist/agent/types.js +32 -0
- package/dist/ai-vercel/index.d.ts +2 -0
- package/dist/ai-vercel/index.js +2 -0
- package/dist/ai-vercel/messages.d.ts +9 -0
- package/dist/ai-vercel/messages.js +68 -0
- package/dist/ai-vercel/vercel-llm.d.ts +8 -0
- package/dist/ai-vercel/vercel-llm.js +98 -0
- package/dist/approval/effects.d.ts +133 -0
- package/dist/approval/effects.js +13 -0
- package/dist/approval/events.d.ts +52 -0
- package/dist/approval/events.js +28 -0
- package/dist/approval/index.d.ts +6 -0
- package/dist/approval/index.js +6 -0
- package/dist/approval/module.d.ts +342 -0
- package/dist/approval/module.js +10 -0
- package/dist/approval/projections.d.ts +42 -0
- package/dist/approval/projections.js +57 -0
- package/dist/approval/scope.d.ts +45 -0
- package/dist/approval/scope.js +7 -0
- package/dist/approval/signals.d.ts +19 -0
- package/dist/approval/signals.js +34 -0
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.js +6 -0
- package/dist/cli/commands.d.ts +13 -0
- package/dist/cli/commands.js +133 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +1 -0
- package/dist/client/client.d.ts +69 -0
- package/dist/client/client.js +179 -0
- package/dist/client/index.d.ts +2 -0
- package/dist/client/index.js +2 -0
- package/dist/client/sse.d.ts +10 -0
- package/dist/client/sse.js +103 -0
- package/dist/cloudflare/alarm-scheduler.d.ts +9 -0
- package/dist/cloudflare/alarm-scheduler.js +13 -0
- package/dist/cloudflare/durable-object.d.ts +24 -0
- package/dist/cloudflare/durable-object.js +43 -0
- package/dist/cloudflare/event-store.d.ts +10 -0
- package/dist/cloudflare/event-store.js +18 -0
- package/dist/cloudflare/index.d.ts +4 -0
- package/dist/cloudflare/index.js +4 -0
- package/dist/cloudflare/router.d.ts +12 -0
- package/dist/cloudflare/router.js +26 -0
- package/dist/core/bun-sqlite.d.ts +13 -0
- package/dist/core/bun-sqlite.js +19 -0
- package/dist/core/catalog.d.ts +49 -0
- package/dist/core/catalog.js +39 -0
- package/dist/core/coalesce.d.ts +21 -0
- package/dist/core/coalesce.js +178 -0
- package/dist/core/compose.d.ts +59 -0
- package/dist/core/compose.js +97 -0
- package/dist/core/cursor.d.ts +16 -0
- package/dist/core/cursor.js +46 -0
- package/dist/core/effects.d.ts +110 -0
- package/dist/core/effects.js +99 -0
- package/dist/core/envelope.d.ts +79 -0
- package/dist/core/envelope.js +68 -0
- package/dist/core/event-codec.d.ts +8 -0
- package/dist/core/event-codec.js +82 -0
- package/dist/core/event-index.d.ts +28 -0
- package/dist/core/event-index.js +86 -0
- package/dist/core/fold.d.ts +19 -0
- package/dist/core/fold.js +362 -0
- package/dist/core/ids.d.ts +11 -0
- package/dist/core/ids.js +47 -0
- package/dist/core/index.d.ts +26 -0
- package/dist/core/index.js +25 -0
- package/dist/core/match.d.ts +8 -0
- package/dist/core/match.js +58 -0
- package/dist/core/module-scope.d.ts +99 -0
- package/dist/core/module-scope.js +72 -0
- package/dist/core/module.d.ts +74 -0
- package/dist/core/module.js +3 -0
- package/dist/core/projection.d.ts +83 -0
- package/dist/core/projection.js +241 -0
- package/dist/core/protocol.d.ts +99 -0
- package/dist/core/protocol.js +101 -0
- package/dist/core/replay.d.ts +13 -0
- package/dist/core/replay.js +34 -0
- package/dist/core/schema.d.ts +35 -0
- package/dist/core/schema.js +130 -0
- package/dist/core/serialize.d.ts +14 -0
- package/dist/core/serialize.js +42 -0
- package/dist/core/snapshot-store.d.ts +39 -0
- package/dist/core/snapshot-store.js +53 -0
- package/dist/core/snapshots.d.ts +26 -0
- package/dist/core/snapshots.js +100 -0
- package/dist/core/sqlite-store.d.ts +31 -0
- package/dist/core/sqlite-store.js +328 -0
- package/dist/core/state.d.ts +43 -0
- package/dist/core/state.js +31 -0
- package/dist/core/store.d.ts +146 -0
- package/dist/core/store.js +229 -0
- package/dist/core/thread.d.ts +41 -0
- package/dist/core/thread.js +13 -0
- package/dist/core/types.d.ts +27 -0
- package/dist/core/types.js +42 -0
- package/dist/core/validate-event.d.ts +19 -0
- package/dist/core/validate-event.js +42 -0
- package/dist/debugger/components/debugger-split.d.ts +23 -0
- package/dist/debugger/components/debugger-split.js +25 -0
- package/dist/debugger/components/event-inspector.d.ts +5 -0
- package/dist/debugger/components/event-inspector.js +38 -0
- package/dist/debugger/components/event-stream.d.ts +13 -0
- package/dist/debugger/components/event-stream.js +119 -0
- package/dist/debugger/components/json-view.d.ts +5 -0
- package/dist/debugger/components/json-view.js +5 -0
- package/dist/debugger/components/run-tree.d.ts +14 -0
- package/dist/debugger/components/run-tree.js +38 -0
- package/dist/debugger/components/status-dot.d.ts +3 -0
- package/dist/debugger/components/status-dot.js +5 -0
- package/dist/debugger/contracts.d.ts +22 -0
- package/dist/debugger/contracts.js +1 -0
- package/dist/debugger/events/catalog.d.ts +6 -0
- package/dist/debugger/events/catalog.js +27 -0
- package/dist/debugger/events/domain-summarize.d.ts +3 -0
- package/dist/debugger/events/domain-summarize.js +107 -0
- package/dist/debugger/events/family.d.ts +8 -0
- package/dist/debugger/events/family.js +44 -0
- package/dist/debugger/events/protocol-summarize.d.ts +3 -0
- package/dist/debugger/events/protocol-summarize.js +70 -0
- package/dist/debugger/index.d.ts +17 -0
- package/dist/debugger/index.js +16 -0
- package/dist/debugger/lib/cn.d.ts +5 -0
- package/dist/debugger/lib/cn.js +17 -0
- package/dist/debugger/lib/event-counts.d.ts +5 -0
- package/dist/debugger/lib/event-counts.js +23 -0
- package/dist/debugger/lib/event-meta.d.ts +8 -0
- package/dist/debugger/lib/event-meta.js +20 -0
- package/dist/debugger/lib/project-run.d.ts +9 -0
- package/dist/debugger/lib/project-run.js +14 -0
- package/dist/debugger/lib/status.d.ts +3 -0
- package/dist/debugger/lib/status.js +31 -0
- package/dist/debugger/lib/visible-events.d.ts +8 -0
- package/dist/debugger/lib/visible-events.js +21 -0
- package/dist/debugger/styles.css +71 -0
- package/dist/debugger/ui/checkbox.d.ts +4 -0
- package/dist/debugger/ui/checkbox.js +9 -0
- package/dist/debugger/ui/input.d.ts +3 -0
- package/dist/debugger/ui/input.js +7 -0
- package/dist/debugger/ui/scroll-area.d.ts +9 -0
- package/dist/debugger/ui/scroll-area.js +10 -0
- package/dist/debugger/ui/tabs.d.ts +7 -0
- package/dist/debugger/ui/tabs.js +17 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/projectors/index-model.d.ts +56 -0
- package/dist/projectors/index-model.js +117 -0
- package/dist/projectors/index.d.ts +4 -0
- package/dist/projectors/index.js +3 -0
- package/dist/projectors/memory.d.ts +5 -0
- package/dist/projectors/memory.js +77 -0
- package/dist/projectors/postgres.d.ts +9 -0
- package/dist/projectors/postgres.js +108 -0
- package/dist/projectors/projector.d.ts +11 -0
- package/dist/projectors/projector.js +1 -0
- package/dist/projectors/schema.d.ts +5 -0
- package/dist/projectors/schema.js +43 -0
- package/dist/projectors/sqlite.d.ts +9 -0
- package/dist/projectors/sqlite.js +103 -0
- package/dist/projectors/with-projectors.d.ts +17 -0
- package/dist/projectors/with-projectors.js +55 -0
- package/dist/react/derived.d.ts +19 -0
- package/dist/react/derived.js +50 -0
- package/dist/react/index.d.ts +6 -0
- package/dist/react/index.js +5 -0
- package/dist/react/materialize.d.ts +3 -0
- package/dist/react/materialize.js +86 -0
- package/dist/react/notify.d.ts +18 -0
- package/dist/react/notify.js +80 -0
- package/dist/react/react.d.ts +61 -0
- package/dist/react/react.js +187 -0
- package/dist/react/register.d.ts +31 -0
- package/dist/react/register.js +1 -0
- package/dist/react/sse.d.ts +1 -0
- package/dist/react/sse.js +1 -0
- package/dist/react/store.d.ts +56 -0
- package/dist/react/store.js +340 -0
- package/dist/react/tables.d.ts +21 -0
- package/dist/react/tables.js +6 -0
- package/dist/runtime/dispatch-effect.d.ts +3 -0
- package/dist/runtime/dispatch-effect.js +113 -0
- package/dist/runtime/events-api.d.ts +4 -0
- package/dist/runtime/events-api.js +84 -0
- package/dist/runtime/index.d.ts +5 -0
- package/dist/runtime/index.js +5 -0
- package/dist/runtime/looms.d.ts +74 -0
- package/dist/runtime/looms.js +109 -0
- package/dist/runtime/runtime-helpers.d.ts +51 -0
- package/dist/runtime/runtime-helpers.js +230 -0
- package/dist/runtime/runtime.d.ts +91 -0
- package/dist/runtime/runtime.js +531 -0
- package/dist/runtime/server.d.ts +17 -0
- package/dist/runtime/server.js +226 -0
- package/dist/runtime/sse.d.ts +15 -0
- package/dist/runtime/sse.js +96 -0
- package/dist/runtime/wake-scheduler.d.ts +8 -0
- package/dist/runtime/wake-scheduler.js +38 -0
- package/dist/s2/config.d.ts +27 -0
- package/dist/s2/config.js +54 -0
- package/dist/s2/index.d.ts +6 -0
- package/dist/s2/index.js +6 -0
- package/dist/s2/lite.d.ts +26 -0
- package/dist/s2/lite.js +150 -0
- package/dist/s2/projector.d.ts +8 -0
- package/dist/s2/projector.js +28 -0
- package/dist/s2/serialize.d.ts +1 -0
- package/dist/s2/serialize.js +1 -0
- package/dist/s2/snapshot-store.d.ts +17 -0
- package/dist/s2/snapshot-store.js +320 -0
- package/dist/s2/store.d.ts +35 -0
- package/dist/s2/store.js +337 -0
- package/dist/testing/index.d.ts +11 -0
- package/dist/testing/index.js +63 -0
- package/dist/workflow/definitions-store.d.ts +11 -0
- package/dist/workflow/definitions-store.js +8 -0
- package/dist/workflow/definitions.d.ts +82 -0
- package/dist/workflow/definitions.js +32 -0
- package/dist/workflow/effects.d.ts +305 -0
- package/dist/workflow/effects.js +208 -0
- package/dist/workflow/events.d.ts +60 -0
- package/dist/workflow/events.js +39 -0
- package/dist/workflow/index.d.ts +8 -0
- package/dist/workflow/index.js +8 -0
- package/dist/workflow/module.d.ts +926 -0
- package/dist/workflow/module.js +19 -0
- package/dist/workflow/projections.d.ts +30 -0
- package/dist/workflow/projections.js +43 -0
- package/dist/workflow/scope.d.ts +61 -0
- package/dist/workflow/scope.js +7 -0
- package/dist/workflow/threads.d.ts +171 -0
- package/dist/workflow/threads.js +287 -0
- package/package.json +183 -0
|
@@ -0,0 +1,926 @@
|
|
|
1
|
+
import type { WorkflowDefinition } from './definitions';
|
|
2
|
+
export interface WorkflowModuleOptions {
|
|
3
|
+
readonly definitions?: readonly WorkflowDefinition[];
|
|
4
|
+
}
|
|
5
|
+
export declare function workflow(options?: WorkflowModuleOptions): import("@swirls/looms/core").RuntimeModule<"workflow", import("@swirls/looms/core").EventCatalog<"workflow", {
|
|
6
|
+
'node.started': import("effect/Schema").Struct<{
|
|
7
|
+
readonly nodeId: import("effect/Schema").String;
|
|
8
|
+
}>;
|
|
9
|
+
'node.finished': import("effect/Schema").Struct<{
|
|
10
|
+
readonly nodeId: import("effect/Schema").String;
|
|
11
|
+
readonly result: import("effect/Schema").NullOr<import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>>;
|
|
12
|
+
readonly error: import("effect/Schema").NullOr<import("effect/Schema").String>;
|
|
13
|
+
}>;
|
|
14
|
+
'node.skipped': import("effect/Schema").Struct<{
|
|
15
|
+
readonly nodeId: import("effect/Schema").String;
|
|
16
|
+
readonly reason: import("effect/Schema").String;
|
|
17
|
+
}>;
|
|
18
|
+
'spawn.requested': import("effect/Schema").Struct<{
|
|
19
|
+
readonly nodeId: import("effect/Schema").String;
|
|
20
|
+
readonly childThreadId: import("effect/Schema").String;
|
|
21
|
+
readonly kind: import("effect/Schema").String;
|
|
22
|
+
readonly definitionName: import("effect/Schema").String;
|
|
23
|
+
readonly input: import("effect/Schema").Codec<import("effect/Schema").Json, import("effect/Schema").Json, never, never>;
|
|
24
|
+
}>;
|
|
25
|
+
'sleep.requested': import("effect/Schema").Struct<{
|
|
26
|
+
readonly nodeId: import("effect/Schema").String;
|
|
27
|
+
readonly waitId: import("effect/Schema").String;
|
|
28
|
+
readonly wakeAt: import("effect/Schema").Number;
|
|
29
|
+
}>;
|
|
30
|
+
'effects.requested': import("effect/Schema").Struct<{
|
|
31
|
+
readonly nodeId: import("effect/Schema").String;
|
|
32
|
+
readonly effects: import("effect/Schema").$Array<import("effect/Schema").Schema<import("@swirls/looms/core").RuntimeEffect>>;
|
|
33
|
+
}>;
|
|
34
|
+
}>, {
|
|
35
|
+
schedule: import("@swirls/looms/core").EffectDefinition<{
|
|
36
|
+
readonly definitionName?: string | undefined;
|
|
37
|
+
readonly nodes?: {
|
|
38
|
+
readonly [x: string]: {
|
|
39
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
40
|
+
readonly result: import("effect/Schema").Json;
|
|
41
|
+
readonly error: string | null;
|
|
42
|
+
};
|
|
43
|
+
} | undefined;
|
|
44
|
+
readonly input?: import("effect/Schema").Json | undefined;
|
|
45
|
+
}, import("./definitions-store").WorkflowDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
46
|
+
readonly type: "runtime.effect.failed";
|
|
47
|
+
readonly payload: {
|
|
48
|
+
readonly effectId: string;
|
|
49
|
+
readonly error: string;
|
|
50
|
+
};
|
|
51
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
52
|
+
readonly type: "runtime.run.completed";
|
|
53
|
+
readonly payload: {
|
|
54
|
+
readonly output: import("effect/Schema").Json;
|
|
55
|
+
readonly error: string | null;
|
|
56
|
+
};
|
|
57
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
58
|
+
readonly type: "runtime.run.started";
|
|
59
|
+
readonly payload: {
|
|
60
|
+
readonly rootThreadId?: string | undefined;
|
|
61
|
+
readonly kind: string;
|
|
62
|
+
readonly definitionName: string;
|
|
63
|
+
readonly input: import("effect/Schema").Json;
|
|
64
|
+
};
|
|
65
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
66
|
+
readonly type: "runtime.signal.received";
|
|
67
|
+
readonly payload: {
|
|
68
|
+
readonly signalType: string;
|
|
69
|
+
};
|
|
70
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
71
|
+
readonly type: "runtime.snapshot.taken";
|
|
72
|
+
readonly payload: {
|
|
73
|
+
readonly seq: number;
|
|
74
|
+
readonly stateHash: string;
|
|
75
|
+
readonly state?: import("effect/Schema").Json | undefined;
|
|
76
|
+
};
|
|
77
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
78
|
+
readonly type: "runtime.thread.cancelled";
|
|
79
|
+
readonly payload: {
|
|
80
|
+
readonly threadId: string;
|
|
81
|
+
readonly reason?: string | undefined;
|
|
82
|
+
};
|
|
83
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
84
|
+
readonly type: "runtime.thread.completed";
|
|
85
|
+
readonly payload: {
|
|
86
|
+
readonly threadId: string;
|
|
87
|
+
readonly output: import("effect/Schema").Json;
|
|
88
|
+
};
|
|
89
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
90
|
+
readonly type: "runtime.thread.failed";
|
|
91
|
+
readonly payload: {
|
|
92
|
+
readonly threadId: string;
|
|
93
|
+
readonly error: string;
|
|
94
|
+
};
|
|
95
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
96
|
+
readonly type: "runtime.thread.started";
|
|
97
|
+
readonly payload: {
|
|
98
|
+
readonly threadId: string;
|
|
99
|
+
readonly kind: string;
|
|
100
|
+
readonly definitionName: string;
|
|
101
|
+
readonly input: import("effect/Schema").Json;
|
|
102
|
+
readonly parentThreadId: string | null;
|
|
103
|
+
};
|
|
104
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
105
|
+
readonly type: "runtime.timer.fired";
|
|
106
|
+
readonly payload: {
|
|
107
|
+
readonly timerId: string;
|
|
108
|
+
readonly waitId: string;
|
|
109
|
+
};
|
|
110
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
111
|
+
readonly type: "runtime.timer.set";
|
|
112
|
+
readonly payload: {
|
|
113
|
+
readonly timerId: string;
|
|
114
|
+
readonly waitId: string;
|
|
115
|
+
readonly wakeAt: number;
|
|
116
|
+
};
|
|
117
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
118
|
+
readonly type: "runtime.wait.registered";
|
|
119
|
+
readonly payload: {
|
|
120
|
+
readonly waitId: string;
|
|
121
|
+
readonly threadId?: string | undefined;
|
|
122
|
+
readonly on: {
|
|
123
|
+
readonly type: string | readonly string[];
|
|
124
|
+
readonly match?: import("effect/Schema").Json | undefined;
|
|
125
|
+
} | {
|
|
126
|
+
readonly timerAt: number;
|
|
127
|
+
};
|
|
128
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
129
|
+
};
|
|
130
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
131
|
+
readonly type: "runtime.wait.satisfied";
|
|
132
|
+
readonly payload: {
|
|
133
|
+
readonly waitId: string;
|
|
134
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
135
|
+
readonly event: {
|
|
136
|
+
readonly id: string;
|
|
137
|
+
readonly type: string;
|
|
138
|
+
readonly payload: import("effect/Schema").Json;
|
|
139
|
+
};
|
|
140
|
+
};
|
|
141
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
142
|
+
readonly type: "workflow.effects.requested";
|
|
143
|
+
readonly payload: {
|
|
144
|
+
readonly nodeId: string;
|
|
145
|
+
readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
|
|
146
|
+
};
|
|
147
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
148
|
+
readonly type: "workflow.node.finished";
|
|
149
|
+
readonly payload: {
|
|
150
|
+
readonly nodeId: string;
|
|
151
|
+
readonly result: import("effect/Schema").Json;
|
|
152
|
+
readonly error: string | null;
|
|
153
|
+
};
|
|
154
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
155
|
+
readonly type: "workflow.node.skipped";
|
|
156
|
+
readonly payload: {
|
|
157
|
+
readonly nodeId: string;
|
|
158
|
+
readonly reason: string;
|
|
159
|
+
};
|
|
160
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
161
|
+
readonly type: "workflow.node.started";
|
|
162
|
+
readonly payload: {
|
|
163
|
+
readonly nodeId: string;
|
|
164
|
+
};
|
|
165
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
166
|
+
readonly type: "workflow.sleep.requested";
|
|
167
|
+
readonly payload: {
|
|
168
|
+
readonly nodeId: string;
|
|
169
|
+
readonly waitId: string;
|
|
170
|
+
readonly wakeAt: number;
|
|
171
|
+
};
|
|
172
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
173
|
+
readonly type: "workflow.spawn.requested";
|
|
174
|
+
readonly payload: {
|
|
175
|
+
readonly nodeId: string;
|
|
176
|
+
readonly childThreadId: string;
|
|
177
|
+
readonly kind: string;
|
|
178
|
+
readonly definitionName: string;
|
|
179
|
+
readonly input: import("effect/Schema").Json;
|
|
180
|
+
};
|
|
181
|
+
})>;
|
|
182
|
+
runNode: import("@swirls/looms/core").EffectDefinition<{
|
|
183
|
+
readonly definitionName?: string | undefined;
|
|
184
|
+
readonly nodeId: string;
|
|
185
|
+
readonly input?: import("effect/Schema").Json | undefined;
|
|
186
|
+
readonly results?: {
|
|
187
|
+
readonly [x: string]: import("effect/Schema").Json;
|
|
188
|
+
} | undefined;
|
|
189
|
+
}, import("./definitions-store").WorkflowDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
190
|
+
readonly type: "runtime.effect.failed";
|
|
191
|
+
readonly payload: {
|
|
192
|
+
readonly effectId: string;
|
|
193
|
+
readonly error: string;
|
|
194
|
+
};
|
|
195
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
196
|
+
readonly type: "runtime.run.completed";
|
|
197
|
+
readonly payload: {
|
|
198
|
+
readonly output: import("effect/Schema").Json;
|
|
199
|
+
readonly error: string | null;
|
|
200
|
+
};
|
|
201
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
202
|
+
readonly type: "runtime.run.started";
|
|
203
|
+
readonly payload: {
|
|
204
|
+
readonly rootThreadId?: string | undefined;
|
|
205
|
+
readonly kind: string;
|
|
206
|
+
readonly definitionName: string;
|
|
207
|
+
readonly input: import("effect/Schema").Json;
|
|
208
|
+
};
|
|
209
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
210
|
+
readonly type: "runtime.signal.received";
|
|
211
|
+
readonly payload: {
|
|
212
|
+
readonly signalType: string;
|
|
213
|
+
};
|
|
214
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
215
|
+
readonly type: "runtime.snapshot.taken";
|
|
216
|
+
readonly payload: {
|
|
217
|
+
readonly seq: number;
|
|
218
|
+
readonly stateHash: string;
|
|
219
|
+
readonly state?: import("effect/Schema").Json | undefined;
|
|
220
|
+
};
|
|
221
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
222
|
+
readonly type: "runtime.thread.cancelled";
|
|
223
|
+
readonly payload: {
|
|
224
|
+
readonly threadId: string;
|
|
225
|
+
readonly reason?: string | undefined;
|
|
226
|
+
};
|
|
227
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
228
|
+
readonly type: "runtime.thread.completed";
|
|
229
|
+
readonly payload: {
|
|
230
|
+
readonly threadId: string;
|
|
231
|
+
readonly output: import("effect/Schema").Json;
|
|
232
|
+
};
|
|
233
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
234
|
+
readonly type: "runtime.thread.failed";
|
|
235
|
+
readonly payload: {
|
|
236
|
+
readonly threadId: string;
|
|
237
|
+
readonly error: string;
|
|
238
|
+
};
|
|
239
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
240
|
+
readonly type: "runtime.thread.started";
|
|
241
|
+
readonly payload: {
|
|
242
|
+
readonly threadId: string;
|
|
243
|
+
readonly kind: string;
|
|
244
|
+
readonly definitionName: string;
|
|
245
|
+
readonly input: import("effect/Schema").Json;
|
|
246
|
+
readonly parentThreadId: string | null;
|
|
247
|
+
};
|
|
248
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
249
|
+
readonly type: "runtime.timer.fired";
|
|
250
|
+
readonly payload: {
|
|
251
|
+
readonly timerId: string;
|
|
252
|
+
readonly waitId: string;
|
|
253
|
+
};
|
|
254
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
255
|
+
readonly type: "runtime.timer.set";
|
|
256
|
+
readonly payload: {
|
|
257
|
+
readonly timerId: string;
|
|
258
|
+
readonly waitId: string;
|
|
259
|
+
readonly wakeAt: number;
|
|
260
|
+
};
|
|
261
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
262
|
+
readonly type: "runtime.wait.registered";
|
|
263
|
+
readonly payload: {
|
|
264
|
+
readonly waitId: string;
|
|
265
|
+
readonly threadId?: string | undefined;
|
|
266
|
+
readonly on: {
|
|
267
|
+
readonly type: string | readonly string[];
|
|
268
|
+
readonly match?: import("effect/Schema").Json | undefined;
|
|
269
|
+
} | {
|
|
270
|
+
readonly timerAt: number;
|
|
271
|
+
};
|
|
272
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
273
|
+
};
|
|
274
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
275
|
+
readonly type: "runtime.wait.satisfied";
|
|
276
|
+
readonly payload: {
|
|
277
|
+
readonly waitId: string;
|
|
278
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
279
|
+
readonly event: {
|
|
280
|
+
readonly id: string;
|
|
281
|
+
readonly type: string;
|
|
282
|
+
readonly payload: import("effect/Schema").Json;
|
|
283
|
+
};
|
|
284
|
+
};
|
|
285
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
286
|
+
readonly type: "workflow.effects.requested";
|
|
287
|
+
readonly payload: {
|
|
288
|
+
readonly nodeId: string;
|
|
289
|
+
readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
|
|
290
|
+
};
|
|
291
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
292
|
+
readonly type: "workflow.node.finished";
|
|
293
|
+
readonly payload: {
|
|
294
|
+
readonly nodeId: string;
|
|
295
|
+
readonly result: import("effect/Schema").Json;
|
|
296
|
+
readonly error: string | null;
|
|
297
|
+
};
|
|
298
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
299
|
+
readonly type: "workflow.node.skipped";
|
|
300
|
+
readonly payload: {
|
|
301
|
+
readonly nodeId: string;
|
|
302
|
+
readonly reason: string;
|
|
303
|
+
};
|
|
304
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
305
|
+
readonly type: "workflow.node.started";
|
|
306
|
+
readonly payload: {
|
|
307
|
+
readonly nodeId: string;
|
|
308
|
+
};
|
|
309
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
310
|
+
readonly type: "workflow.sleep.requested";
|
|
311
|
+
readonly payload: {
|
|
312
|
+
readonly nodeId: string;
|
|
313
|
+
readonly waitId: string;
|
|
314
|
+
readonly wakeAt: number;
|
|
315
|
+
};
|
|
316
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
317
|
+
readonly type: "workflow.spawn.requested";
|
|
318
|
+
readonly payload: {
|
|
319
|
+
readonly nodeId: string;
|
|
320
|
+
readonly childThreadId: string;
|
|
321
|
+
readonly kind: string;
|
|
322
|
+
readonly definitionName: string;
|
|
323
|
+
readonly input: import("effect/Schema").Json;
|
|
324
|
+
};
|
|
325
|
+
})>;
|
|
326
|
+
}, {
|
|
327
|
+
workflow: import("@swirls/looms/core").ThreadDefinition<{
|
|
328
|
+
definitionName?: string;
|
|
329
|
+
concurrency: number;
|
|
330
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
331
|
+
nodeIds: string[];
|
|
332
|
+
nodes: {
|
|
333
|
+
[x: string]: {
|
|
334
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
335
|
+
readonly result: import("effect/Schema").Json;
|
|
336
|
+
readonly error: string | null;
|
|
337
|
+
} | {
|
|
338
|
+
status: string;
|
|
339
|
+
result: string | number | boolean | import("effect/Schema").JsonArray | import("effect/Schema").JsonObject | null;
|
|
340
|
+
error: string | null;
|
|
341
|
+
};
|
|
342
|
+
};
|
|
343
|
+
runningNodes: string[];
|
|
344
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
345
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
346
|
+
pendingEffects: import("./threads").WorkflowPendingEffects[];
|
|
347
|
+
pendingEmits: import("./threads").WorkflowPendingEmit[];
|
|
348
|
+
status: "completed" | "failed" | "running";
|
|
349
|
+
error: string | null;
|
|
350
|
+
needsSchedule: boolean;
|
|
351
|
+
} | {
|
|
352
|
+
definitionName?: string;
|
|
353
|
+
nodes: {
|
|
354
|
+
[nodeId: string]: import("./definitions").NodeState;
|
|
355
|
+
};
|
|
356
|
+
concurrency: number;
|
|
357
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
358
|
+
nodeIds: string[];
|
|
359
|
+
needsSchedule: boolean;
|
|
360
|
+
runningNodes: string[];
|
|
361
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
362
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
363
|
+
pendingEmits: import("./threads").WorkflowPendingEmit[];
|
|
364
|
+
status: 'running' | 'completed' | 'failed';
|
|
365
|
+
error: string | null;
|
|
366
|
+
pendingEffects: (import("./threads").WorkflowPendingEffects | {
|
|
367
|
+
nodeId: string;
|
|
368
|
+
effects: (import("@swirls/looms/core").InvokeEffect | import("@swirls/looms/core").WaitEffect | {
|
|
369
|
+
type: 'runtime.wait';
|
|
370
|
+
waitId: string;
|
|
371
|
+
on: import("@swirls/looms/core").WaitCondition;
|
|
372
|
+
tag: {
|
|
373
|
+
nodeId: string;
|
|
374
|
+
};
|
|
375
|
+
} | {
|
|
376
|
+
type: 'runtime.cancel';
|
|
377
|
+
threadId: string;
|
|
378
|
+
tag: string;
|
|
379
|
+
} | {
|
|
380
|
+
type: 'runtime.complete';
|
|
381
|
+
output: import("@swirls/looms/core").JsonValue;
|
|
382
|
+
tag: string;
|
|
383
|
+
} | {
|
|
384
|
+
type: 'runtime.emit';
|
|
385
|
+
event: import("@swirls/looms/core").EventInput;
|
|
386
|
+
tag: string;
|
|
387
|
+
} | {
|
|
388
|
+
type: 'runtime.fail';
|
|
389
|
+
error: string;
|
|
390
|
+
tag: string;
|
|
391
|
+
})[];
|
|
392
|
+
})[];
|
|
393
|
+
} | {
|
|
394
|
+
definitionName?: string;
|
|
395
|
+
concurrency: number;
|
|
396
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
397
|
+
nodeIds: string[];
|
|
398
|
+
needsSchedule: boolean;
|
|
399
|
+
status: 'running' | 'completed' | 'failed';
|
|
400
|
+
error: string | null;
|
|
401
|
+
nodes: {
|
|
402
|
+
[x: string]: {
|
|
403
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
404
|
+
readonly result: import("effect/Schema").Json;
|
|
405
|
+
readonly error: string | null;
|
|
406
|
+
} | {
|
|
407
|
+
status: string;
|
|
408
|
+
result: null;
|
|
409
|
+
error: string;
|
|
410
|
+
};
|
|
411
|
+
};
|
|
412
|
+
runningNodes: string[];
|
|
413
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
414
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
415
|
+
pendingEffects: import("./threads").WorkflowPendingEffects[];
|
|
416
|
+
pendingEmits: (import("./threads").WorkflowPendingEmit | {
|
|
417
|
+
id: string;
|
|
418
|
+
event: {
|
|
419
|
+
type: string;
|
|
420
|
+
payload: {
|
|
421
|
+
nodeId: string;
|
|
422
|
+
result: null;
|
|
423
|
+
error: string;
|
|
424
|
+
};
|
|
425
|
+
threadId: string;
|
|
426
|
+
};
|
|
427
|
+
})[];
|
|
428
|
+
} | {
|
|
429
|
+
definitionName?: string;
|
|
430
|
+
nodes: {
|
|
431
|
+
[nodeId: string]: import("./definitions").NodeState;
|
|
432
|
+
};
|
|
433
|
+
concurrency: number;
|
|
434
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
435
|
+
nodeIds: string[];
|
|
436
|
+
needsSchedule: boolean;
|
|
437
|
+
runningNodes: string[];
|
|
438
|
+
status: 'running' | 'completed' | 'failed';
|
|
439
|
+
error: string | null;
|
|
440
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
441
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
442
|
+
pendingEffects: import("./threads").WorkflowPendingEffects[];
|
|
443
|
+
pendingEmits: (import("./threads").WorkflowPendingEmit | {
|
|
444
|
+
id: string;
|
|
445
|
+
event: {
|
|
446
|
+
type: string;
|
|
447
|
+
payload: {
|
|
448
|
+
nodeId: string;
|
|
449
|
+
result: string | number | boolean | import("@swirls/looms/core").JsonObject | readonly import("@swirls/looms/core").JsonValue[] | null;
|
|
450
|
+
error: string | null;
|
|
451
|
+
};
|
|
452
|
+
threadId: string;
|
|
453
|
+
};
|
|
454
|
+
})[];
|
|
455
|
+
}>;
|
|
456
|
+
}, {
|
|
457
|
+
nodes: import("@swirls/looms/core").ProjectionDefinition<{
|
|
458
|
+
readonly nodes: {
|
|
459
|
+
readonly [x: string]: {
|
|
460
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
461
|
+
readonly result: import("effect/Schema").Json;
|
|
462
|
+
readonly error: string | null;
|
|
463
|
+
};
|
|
464
|
+
};
|
|
465
|
+
} | {
|
|
466
|
+
nodes: {
|
|
467
|
+
[x: string]: {
|
|
468
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
469
|
+
readonly result: import("effect/Schema").Json;
|
|
470
|
+
readonly error: string | null;
|
|
471
|
+
} | {
|
|
472
|
+
status: string;
|
|
473
|
+
result: string | number | boolean | import("effect/Schema").JsonArray | import("effect/Schema").JsonObject | null;
|
|
474
|
+
error: string | null;
|
|
475
|
+
};
|
|
476
|
+
};
|
|
477
|
+
}>;
|
|
478
|
+
}, any> & {
|
|
479
|
+
readonly effects: {
|
|
480
|
+
schedule: import("@swirls/looms/core").EffectDefinition<{
|
|
481
|
+
readonly definitionName?: string | undefined;
|
|
482
|
+
readonly nodes?: {
|
|
483
|
+
readonly [x: string]: {
|
|
484
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
485
|
+
readonly result: import("effect/Schema").Json;
|
|
486
|
+
readonly error: string | null;
|
|
487
|
+
};
|
|
488
|
+
} | undefined;
|
|
489
|
+
readonly input?: import("effect/Schema").Json | undefined;
|
|
490
|
+
}, import("./definitions-store").WorkflowDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
491
|
+
readonly type: "runtime.effect.failed";
|
|
492
|
+
readonly payload: {
|
|
493
|
+
readonly effectId: string;
|
|
494
|
+
readonly error: string;
|
|
495
|
+
};
|
|
496
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
497
|
+
readonly type: "runtime.run.completed";
|
|
498
|
+
readonly payload: {
|
|
499
|
+
readonly output: import("effect/Schema").Json;
|
|
500
|
+
readonly error: string | null;
|
|
501
|
+
};
|
|
502
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
503
|
+
readonly type: "runtime.run.started";
|
|
504
|
+
readonly payload: {
|
|
505
|
+
readonly rootThreadId?: string | undefined;
|
|
506
|
+
readonly kind: string;
|
|
507
|
+
readonly definitionName: string;
|
|
508
|
+
readonly input: import("effect/Schema").Json;
|
|
509
|
+
};
|
|
510
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
511
|
+
readonly type: "runtime.signal.received";
|
|
512
|
+
readonly payload: {
|
|
513
|
+
readonly signalType: string;
|
|
514
|
+
};
|
|
515
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
516
|
+
readonly type: "runtime.snapshot.taken";
|
|
517
|
+
readonly payload: {
|
|
518
|
+
readonly seq: number;
|
|
519
|
+
readonly stateHash: string;
|
|
520
|
+
readonly state?: import("effect/Schema").Json | undefined;
|
|
521
|
+
};
|
|
522
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
523
|
+
readonly type: "runtime.thread.cancelled";
|
|
524
|
+
readonly payload: {
|
|
525
|
+
readonly threadId: string;
|
|
526
|
+
readonly reason?: string | undefined;
|
|
527
|
+
};
|
|
528
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
529
|
+
readonly type: "runtime.thread.completed";
|
|
530
|
+
readonly payload: {
|
|
531
|
+
readonly threadId: string;
|
|
532
|
+
readonly output: import("effect/Schema").Json;
|
|
533
|
+
};
|
|
534
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
535
|
+
readonly type: "runtime.thread.failed";
|
|
536
|
+
readonly payload: {
|
|
537
|
+
readonly threadId: string;
|
|
538
|
+
readonly error: string;
|
|
539
|
+
};
|
|
540
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
541
|
+
readonly type: "runtime.thread.started";
|
|
542
|
+
readonly payload: {
|
|
543
|
+
readonly threadId: string;
|
|
544
|
+
readonly kind: string;
|
|
545
|
+
readonly definitionName: string;
|
|
546
|
+
readonly input: import("effect/Schema").Json;
|
|
547
|
+
readonly parentThreadId: string | null;
|
|
548
|
+
};
|
|
549
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
550
|
+
readonly type: "runtime.timer.fired";
|
|
551
|
+
readonly payload: {
|
|
552
|
+
readonly timerId: string;
|
|
553
|
+
readonly waitId: string;
|
|
554
|
+
};
|
|
555
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
556
|
+
readonly type: "runtime.timer.set";
|
|
557
|
+
readonly payload: {
|
|
558
|
+
readonly timerId: string;
|
|
559
|
+
readonly waitId: string;
|
|
560
|
+
readonly wakeAt: number;
|
|
561
|
+
};
|
|
562
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
563
|
+
readonly type: "runtime.wait.registered";
|
|
564
|
+
readonly payload: {
|
|
565
|
+
readonly waitId: string;
|
|
566
|
+
readonly threadId?: string | undefined;
|
|
567
|
+
readonly on: {
|
|
568
|
+
readonly type: string | readonly string[];
|
|
569
|
+
readonly match?: import("effect/Schema").Json | undefined;
|
|
570
|
+
} | {
|
|
571
|
+
readonly timerAt: number;
|
|
572
|
+
};
|
|
573
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
574
|
+
};
|
|
575
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
576
|
+
readonly type: "runtime.wait.satisfied";
|
|
577
|
+
readonly payload: {
|
|
578
|
+
readonly waitId: string;
|
|
579
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
580
|
+
readonly event: {
|
|
581
|
+
readonly id: string;
|
|
582
|
+
readonly type: string;
|
|
583
|
+
readonly payload: import("effect/Schema").Json;
|
|
584
|
+
};
|
|
585
|
+
};
|
|
586
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
587
|
+
readonly type: "workflow.effects.requested";
|
|
588
|
+
readonly payload: {
|
|
589
|
+
readonly nodeId: string;
|
|
590
|
+
readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
|
|
591
|
+
};
|
|
592
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
593
|
+
readonly type: "workflow.node.finished";
|
|
594
|
+
readonly payload: {
|
|
595
|
+
readonly nodeId: string;
|
|
596
|
+
readonly result: import("effect/Schema").Json;
|
|
597
|
+
readonly error: string | null;
|
|
598
|
+
};
|
|
599
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
600
|
+
readonly type: "workflow.node.skipped";
|
|
601
|
+
readonly payload: {
|
|
602
|
+
readonly nodeId: string;
|
|
603
|
+
readonly reason: string;
|
|
604
|
+
};
|
|
605
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
606
|
+
readonly type: "workflow.node.started";
|
|
607
|
+
readonly payload: {
|
|
608
|
+
readonly nodeId: string;
|
|
609
|
+
};
|
|
610
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
611
|
+
readonly type: "workflow.sleep.requested";
|
|
612
|
+
readonly payload: {
|
|
613
|
+
readonly nodeId: string;
|
|
614
|
+
readonly waitId: string;
|
|
615
|
+
readonly wakeAt: number;
|
|
616
|
+
};
|
|
617
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
618
|
+
readonly type: "workflow.spawn.requested";
|
|
619
|
+
readonly payload: {
|
|
620
|
+
readonly nodeId: string;
|
|
621
|
+
readonly childThreadId: string;
|
|
622
|
+
readonly kind: string;
|
|
623
|
+
readonly definitionName: string;
|
|
624
|
+
readonly input: import("effect/Schema").Json;
|
|
625
|
+
};
|
|
626
|
+
})>;
|
|
627
|
+
runNode: import("@swirls/looms/core").EffectDefinition<{
|
|
628
|
+
readonly definitionName?: string | undefined;
|
|
629
|
+
readonly nodeId: string;
|
|
630
|
+
readonly input?: import("effect/Schema").Json | undefined;
|
|
631
|
+
readonly results?: {
|
|
632
|
+
readonly [x: string]: import("effect/Schema").Json;
|
|
633
|
+
} | undefined;
|
|
634
|
+
}, import("./definitions-store").WorkflowDefinitionsTag, (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
635
|
+
readonly type: "runtime.effect.failed";
|
|
636
|
+
readonly payload: {
|
|
637
|
+
readonly effectId: string;
|
|
638
|
+
readonly error: string;
|
|
639
|
+
};
|
|
640
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
641
|
+
readonly type: "runtime.run.completed";
|
|
642
|
+
readonly payload: {
|
|
643
|
+
readonly output: import("effect/Schema").Json;
|
|
644
|
+
readonly error: string | null;
|
|
645
|
+
};
|
|
646
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
647
|
+
readonly type: "runtime.run.started";
|
|
648
|
+
readonly payload: {
|
|
649
|
+
readonly rootThreadId?: string | undefined;
|
|
650
|
+
readonly kind: string;
|
|
651
|
+
readonly definitionName: string;
|
|
652
|
+
readonly input: import("effect/Schema").Json;
|
|
653
|
+
};
|
|
654
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
655
|
+
readonly type: "runtime.signal.received";
|
|
656
|
+
readonly payload: {
|
|
657
|
+
readonly signalType: string;
|
|
658
|
+
};
|
|
659
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
660
|
+
readonly type: "runtime.snapshot.taken";
|
|
661
|
+
readonly payload: {
|
|
662
|
+
readonly seq: number;
|
|
663
|
+
readonly stateHash: string;
|
|
664
|
+
readonly state?: import("effect/Schema").Json | undefined;
|
|
665
|
+
};
|
|
666
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
667
|
+
readonly type: "runtime.thread.cancelled";
|
|
668
|
+
readonly payload: {
|
|
669
|
+
readonly threadId: string;
|
|
670
|
+
readonly reason?: string | undefined;
|
|
671
|
+
};
|
|
672
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
673
|
+
readonly type: "runtime.thread.completed";
|
|
674
|
+
readonly payload: {
|
|
675
|
+
readonly threadId: string;
|
|
676
|
+
readonly output: import("effect/Schema").Json;
|
|
677
|
+
};
|
|
678
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
679
|
+
readonly type: "runtime.thread.failed";
|
|
680
|
+
readonly payload: {
|
|
681
|
+
readonly threadId: string;
|
|
682
|
+
readonly error: string;
|
|
683
|
+
};
|
|
684
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
685
|
+
readonly type: "runtime.thread.started";
|
|
686
|
+
readonly payload: {
|
|
687
|
+
readonly threadId: string;
|
|
688
|
+
readonly kind: string;
|
|
689
|
+
readonly definitionName: string;
|
|
690
|
+
readonly input: import("effect/Schema").Json;
|
|
691
|
+
readonly parentThreadId: string | null;
|
|
692
|
+
};
|
|
693
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
694
|
+
readonly type: "runtime.timer.fired";
|
|
695
|
+
readonly payload: {
|
|
696
|
+
readonly timerId: string;
|
|
697
|
+
readonly waitId: string;
|
|
698
|
+
};
|
|
699
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
700
|
+
readonly type: "runtime.timer.set";
|
|
701
|
+
readonly payload: {
|
|
702
|
+
readonly timerId: string;
|
|
703
|
+
readonly waitId: string;
|
|
704
|
+
readonly wakeAt: number;
|
|
705
|
+
};
|
|
706
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
707
|
+
readonly type: "runtime.wait.registered";
|
|
708
|
+
readonly payload: {
|
|
709
|
+
readonly waitId: string;
|
|
710
|
+
readonly threadId?: string | undefined;
|
|
711
|
+
readonly on: {
|
|
712
|
+
readonly type: string | readonly string[];
|
|
713
|
+
readonly match?: import("effect/Schema").Json | undefined;
|
|
714
|
+
} | {
|
|
715
|
+
readonly timerAt: number;
|
|
716
|
+
};
|
|
717
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
718
|
+
};
|
|
719
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
720
|
+
readonly type: "runtime.wait.satisfied";
|
|
721
|
+
readonly payload: {
|
|
722
|
+
readonly waitId: string;
|
|
723
|
+
readonly tag?: import("effect/Schema").Json | undefined;
|
|
724
|
+
readonly event: {
|
|
725
|
+
readonly id: string;
|
|
726
|
+
readonly type: string;
|
|
727
|
+
readonly payload: import("effect/Schema").Json;
|
|
728
|
+
};
|
|
729
|
+
};
|
|
730
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
731
|
+
readonly type: "workflow.effects.requested";
|
|
732
|
+
readonly payload: {
|
|
733
|
+
readonly nodeId: string;
|
|
734
|
+
readonly effects: readonly import("@swirls/looms/core").RuntimeEffect[];
|
|
735
|
+
};
|
|
736
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
737
|
+
readonly type: "workflow.node.finished";
|
|
738
|
+
readonly payload: {
|
|
739
|
+
readonly nodeId: string;
|
|
740
|
+
readonly result: import("effect/Schema").Json;
|
|
741
|
+
readonly error: string | null;
|
|
742
|
+
};
|
|
743
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
744
|
+
readonly type: "workflow.node.skipped";
|
|
745
|
+
readonly payload: {
|
|
746
|
+
readonly nodeId: string;
|
|
747
|
+
readonly reason: string;
|
|
748
|
+
};
|
|
749
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
750
|
+
readonly type: "workflow.node.started";
|
|
751
|
+
readonly payload: {
|
|
752
|
+
readonly nodeId: string;
|
|
753
|
+
};
|
|
754
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
755
|
+
readonly type: "workflow.sleep.requested";
|
|
756
|
+
readonly payload: {
|
|
757
|
+
readonly nodeId: string;
|
|
758
|
+
readonly waitId: string;
|
|
759
|
+
readonly wakeAt: number;
|
|
760
|
+
};
|
|
761
|
+
}) | (Omit<import("@swirls/looms/core").EventInput, "payload" | "type"> & {
|
|
762
|
+
readonly type: "workflow.spawn.requested";
|
|
763
|
+
readonly payload: {
|
|
764
|
+
readonly nodeId: string;
|
|
765
|
+
readonly childThreadId: string;
|
|
766
|
+
readonly kind: string;
|
|
767
|
+
readonly definitionName: string;
|
|
768
|
+
readonly input: import("effect/Schema").Json;
|
|
769
|
+
};
|
|
770
|
+
})>;
|
|
771
|
+
};
|
|
772
|
+
readonly threads: {
|
|
773
|
+
workflow: import("@swirls/looms/core").ThreadDefinition<{
|
|
774
|
+
definitionName?: string;
|
|
775
|
+
concurrency: number;
|
|
776
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
777
|
+
nodeIds: string[];
|
|
778
|
+
nodes: {
|
|
779
|
+
[x: string]: {
|
|
780
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
781
|
+
readonly result: import("effect/Schema").Json;
|
|
782
|
+
readonly error: string | null;
|
|
783
|
+
} | {
|
|
784
|
+
status: string;
|
|
785
|
+
result: string | number | boolean | import("effect/Schema").JsonArray | import("effect/Schema").JsonObject | null;
|
|
786
|
+
error: string | null;
|
|
787
|
+
};
|
|
788
|
+
};
|
|
789
|
+
runningNodes: string[];
|
|
790
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
791
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
792
|
+
pendingEffects: import("./threads").WorkflowPendingEffects[];
|
|
793
|
+
pendingEmits: import("./threads").WorkflowPendingEmit[];
|
|
794
|
+
status: "completed" | "failed" | "running";
|
|
795
|
+
error: string | null;
|
|
796
|
+
needsSchedule: boolean;
|
|
797
|
+
} | {
|
|
798
|
+
definitionName?: string;
|
|
799
|
+
nodes: {
|
|
800
|
+
[nodeId: string]: import("./definitions").NodeState;
|
|
801
|
+
};
|
|
802
|
+
concurrency: number;
|
|
803
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
804
|
+
nodeIds: string[];
|
|
805
|
+
needsSchedule: boolean;
|
|
806
|
+
runningNodes: string[];
|
|
807
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
808
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
809
|
+
pendingEmits: import("./threads").WorkflowPendingEmit[];
|
|
810
|
+
status: 'running' | 'completed' | 'failed';
|
|
811
|
+
error: string | null;
|
|
812
|
+
pendingEffects: (import("./threads").WorkflowPendingEffects | {
|
|
813
|
+
nodeId: string;
|
|
814
|
+
effects: (import("@swirls/looms/core").InvokeEffect | import("@swirls/looms/core").WaitEffect | {
|
|
815
|
+
type: 'runtime.wait';
|
|
816
|
+
waitId: string;
|
|
817
|
+
on: import("@swirls/looms/core").WaitCondition;
|
|
818
|
+
tag: {
|
|
819
|
+
nodeId: string;
|
|
820
|
+
};
|
|
821
|
+
} | {
|
|
822
|
+
type: 'runtime.cancel';
|
|
823
|
+
threadId: string;
|
|
824
|
+
tag: string;
|
|
825
|
+
} | {
|
|
826
|
+
type: 'runtime.complete';
|
|
827
|
+
output: import("@swirls/looms/core").JsonValue;
|
|
828
|
+
tag: string;
|
|
829
|
+
} | {
|
|
830
|
+
type: 'runtime.emit';
|
|
831
|
+
event: import("@swirls/looms/core").EventInput;
|
|
832
|
+
tag: string;
|
|
833
|
+
} | {
|
|
834
|
+
type: 'runtime.fail';
|
|
835
|
+
error: string;
|
|
836
|
+
tag: string;
|
|
837
|
+
})[];
|
|
838
|
+
})[];
|
|
839
|
+
} | {
|
|
840
|
+
definitionName?: string;
|
|
841
|
+
concurrency: number;
|
|
842
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
843
|
+
nodeIds: string[];
|
|
844
|
+
needsSchedule: boolean;
|
|
845
|
+
status: 'running' | 'completed' | 'failed';
|
|
846
|
+
error: string | null;
|
|
847
|
+
nodes: {
|
|
848
|
+
[x: string]: {
|
|
849
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
850
|
+
readonly result: import("effect/Schema").Json;
|
|
851
|
+
readonly error: string | null;
|
|
852
|
+
} | {
|
|
853
|
+
status: string;
|
|
854
|
+
result: null;
|
|
855
|
+
error: string;
|
|
856
|
+
};
|
|
857
|
+
};
|
|
858
|
+
runningNodes: string[];
|
|
859
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
860
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
861
|
+
pendingEffects: import("./threads").WorkflowPendingEffects[];
|
|
862
|
+
pendingEmits: (import("./threads").WorkflowPendingEmit | {
|
|
863
|
+
id: string;
|
|
864
|
+
event: {
|
|
865
|
+
type: string;
|
|
866
|
+
payload: {
|
|
867
|
+
nodeId: string;
|
|
868
|
+
result: null;
|
|
869
|
+
error: string;
|
|
870
|
+
};
|
|
871
|
+
threadId: string;
|
|
872
|
+
};
|
|
873
|
+
})[];
|
|
874
|
+
} | {
|
|
875
|
+
definitionName?: string;
|
|
876
|
+
nodes: {
|
|
877
|
+
[nodeId: string]: import("./definitions").NodeState;
|
|
878
|
+
};
|
|
879
|
+
concurrency: number;
|
|
880
|
+
input: import("@swirls/looms/core").JsonValue;
|
|
881
|
+
nodeIds: string[];
|
|
882
|
+
needsSchedule: boolean;
|
|
883
|
+
runningNodes: string[];
|
|
884
|
+
status: 'running' | 'completed' | 'failed';
|
|
885
|
+
error: string | null;
|
|
886
|
+
pendingSpawns: import("./threads").WorkflowPendingSpawn[];
|
|
887
|
+
pendingSleeps: import("./threads").WorkflowPendingSleep[];
|
|
888
|
+
pendingEffects: import("./threads").WorkflowPendingEffects[];
|
|
889
|
+
pendingEmits: (import("./threads").WorkflowPendingEmit | {
|
|
890
|
+
id: string;
|
|
891
|
+
event: {
|
|
892
|
+
type: string;
|
|
893
|
+
payload: {
|
|
894
|
+
nodeId: string;
|
|
895
|
+
result: string | number | boolean | import("@swirls/looms/core").JsonObject | readonly import("@swirls/looms/core").JsonValue[] | null;
|
|
896
|
+
error: string | null;
|
|
897
|
+
};
|
|
898
|
+
threadId: string;
|
|
899
|
+
};
|
|
900
|
+
})[];
|
|
901
|
+
}>;
|
|
902
|
+
};
|
|
903
|
+
readonly projections: {
|
|
904
|
+
nodes: import("@swirls/looms/core").ProjectionDefinition<{
|
|
905
|
+
readonly nodes: {
|
|
906
|
+
readonly [x: string]: {
|
|
907
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
908
|
+
readonly result: import("effect/Schema").Json;
|
|
909
|
+
readonly error: string | null;
|
|
910
|
+
};
|
|
911
|
+
};
|
|
912
|
+
} | {
|
|
913
|
+
nodes: {
|
|
914
|
+
[x: string]: {
|
|
915
|
+
readonly status: "completed" | "failed" | "pending" | "running" | "skipped";
|
|
916
|
+
readonly result: import("effect/Schema").Json;
|
|
917
|
+
readonly error: string | null;
|
|
918
|
+
} | {
|
|
919
|
+
status: string;
|
|
920
|
+
result: string | number | boolean | import("effect/Schema").JsonArray | import("effect/Schema").JsonObject | null;
|
|
921
|
+
error: string | null;
|
|
922
|
+
};
|
|
923
|
+
};
|
|
924
|
+
}>;
|
|
925
|
+
};
|
|
926
|
+
};
|