@oomol-lab/open-flow 0.1.0-alpha.9 → 0.1.0-beta.10

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.
Files changed (74) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/DesignerIcon-DjgOMYI5.js +2065 -0
  3. package/dist/browser/createResourceDialog-DNBueSYZ.js +505 -0
  4. package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
  5. package/dist/browser/dist-BMRLCebL.js +1893 -0
  6. package/dist/browser/{dist-DWzdGVm9.js → dist-By46o5UV.js} +74 -74
  7. package/dist/browser/dist-CP0883sY.js +4 -0
  8. package/dist/browser/{dist-B0Q2Mn0n.js → dist-Cc0y2Pli.js} +809 -810
  9. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  10. package/dist/browser/{dist-Bc9TvHYl.js → dist-Dg_VXC8f.js} +134 -135
  11. package/dist/browser/{dist-DhsGR_K3.js → dist-DmuE3M0R.js} +47 -48
  12. package/dist/browser/{dist-D5mdziGP.js → dist-DpDLsYtO.js} +18 -19
  13. package/dist/browser/dist-DxahK_I8.js +2688 -0
  14. package/dist/browser/{dist-DXgEYMFx.js → dist-meg_oHVR.js} +230 -230
  15. package/dist/browser/{esm-YIGXG-Js.js → esm-yhVU_KbQ.js} +14 -15
  16. package/dist/browser/flow-authoring-module.d.ts +2 -2
  17. package/dist/browser/flow-authoring-node.d.ts +9 -4
  18. package/dist/browser/flow-authoring.d.ts +2 -1
  19. package/dist/browser/flow-authoring.js +752 -162
  20. package/dist/browser/flow-change.d.ts +122 -13
  21. package/dist/browser/flow-change.js +326 -96
  22. package/dist/browser/flow-notifications.d.ts +5 -0
  23. package/dist/browser/flowChanges-B2ttnaj9.js +12265 -0
  24. package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-DDidwd8h.js} +1528 -783
  25. package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-Dr8-Hut9.js} +42428 -42499
  26. package/dist/browser/getPseudoElementBounds-5LArT6Xc.js +7147 -0
  27. package/dist/browser/icons-KIOgjHpD.js +730 -0
  28. package/dist/browser/languages-DgJehE1g.js +62 -0
  29. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  30. package/dist/browser/licenses.md +119 -1
  31. package/dist/browser/main-DmjVyuWr.js +76 -0
  32. package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DUfLdnUt.js} +4811 -4795
  33. package/dist/browser/theme.css +63 -0
  34. package/dist/browser/theme.css.d.ts +1 -0
  35. package/dist/browser/typeScriptSession-_TgJ_7Oq.js +2578 -0
  36. package/dist/browser/waitNotificationInputs-BPulOxYt.js +26 -0
  37. package/dist/browser/workbench-contract.d.ts +2 -1
  38. package/dist/browser/workbench.css +1 -1
  39. package/dist/browser/workbench.d.ts +47 -1
  40. package/dist/browser/workbench.js +1524 -1768
  41. package/dist/browser/workbenchSelect-CbXrdwxW.js +1375 -0
  42. package/dist/common/connector-action.d.ts +6 -0
  43. package/dist/common/connector-action.js +37 -29
  44. package/dist/common/control-api-conformance.d.ts +1 -0
  45. package/dist/common/control-api-conformance.js +171 -51
  46. package/dist/common/control-api-errors.d.ts +28 -0
  47. package/dist/common/control-api.d.ts +80 -21
  48. package/dist/common/control-api.js +311 -131
  49. package/dist/common/flow-encoding.d.ts +2 -2
  50. package/dist/common/flow-encoding.js +28 -9
  51. package/dist/common/flow-notifications.d.ts +5 -0
  52. package/dist/common/flow-semantics.d.ts +4 -0
  53. package/dist/common/flow-semantics.js +3544 -1098
  54. package/dist/common/integration-trigger.d.ts +1 -0
  55. package/dist/common/licenses.md +1 -25
  56. package/dist/common/localization.d.ts +21 -0
  57. package/dist/common/localization.js +62 -0
  58. package/dist/common/provider-triggers.js +4 -1
  59. package/dist/common/run-events.js +2 -1
  60. package/dist/common/run-lifecycle.d.ts +17 -2
  61. package/dist/common/run-lifecycle.js +53 -2
  62. package/dist/common/runtime-contract.d.ts +1 -1
  63. package/dist/common/runtime-contract.js +27 -0
  64. package/dist/common/scheduler.d.ts +68 -7
  65. package/dist/common/scheduler.js +528 -240
  66. package/dist/index.d.ts +2 -1
  67. package/package.json +10 -1
  68. package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
  69. package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
  70. package/dist/browser/createResourceDialog-A64dDFCG.js +0 -467
  71. package/dist/browser/dist-CUkceEvN.js +0 -1620
  72. package/dist/browser/dist-CVtP-E2c.js +0 -1543
  73. package/dist/browser/dist-DQVavPcf.js +0 -2328
  74. package/dist/browser/field-CKGQHCIi.js +0 -312
@@ -48,6 +48,7 @@ export interface IntegrationReconcileContext {
48
48
  readonly config: Readonly<Record<string, JsonValue>>;
49
49
  readonly connector: ConnectorProxy;
50
50
  readonly endpointUrl: string;
51
+ readonly idempotencyKey: string;
51
52
  readonly now: Date;
52
53
  readonly signal?: AbortSignal;
53
54
  readonly state?: IntegrationStateContext;
@@ -1,27 +1,3 @@
1
1
  # Licenses
2
2
 
3
- The app bundles dependencies which contain the following licenses:
4
-
5
- ## dequal - 2.0.3 (MIT)
6
-
7
- The MIT License (MIT)
8
-
9
- Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
10
-
11
- Permission is hereby granted, free of charge, to any person obtaining a copy
12
- of this software and associated documentation files (the "Software"), to deal
13
- in the Software without restriction, including without limitation the rights
14
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15
- copies of the Software, and to permit persons to whom the Software is
16
- furnished to do so, subject to the following conditions:
17
-
18
- The above copyright notice and this permission notice shall be included in
19
- all copies or substantial portions of the Software.
20
-
21
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
22
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
23
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
24
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
25
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
26
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
27
- THE SOFTWARE.
3
+ The app does not bundle any dependencies with licenses.
@@ -0,0 +1,21 @@
1
+ export declare const uiLanguages: readonly ['en', 'zh-CN', 'zh-TW', 'ja', 'ko', 'ru', 'fr'];
2
+ export type UiLanguage = (typeof uiLanguages)[number];
3
+ export declare const defaultUiLanguage: UiLanguage;
4
+ /** Endonyms, shown in language pickers regardless of the current UI language. */
5
+ export declare const uiLanguageNames: Readonly<Record<UiLanguage, string>>;
6
+ export declare function isUiLanguage(value: unknown): value is UiLanguage;
7
+ /**
8
+ * BCP 47 aware resolution over candidates such as `navigator.languages`: an exact tag match
9
+ * (case-insensitive) wins; for zh an explicit script subtag beats the region (zh-Hant-* to zh-TW,
10
+ * zh-Hans-* to zh-CN), then zh-TW, zh-HK and zh-MO map to zh-TW and any other zh* to zh-CN; en, ja,
11
+ * ko, ru and fr also match on their primary subtag (fr-CA to fr, ja-JP to ja).
12
+ */
13
+ export declare function resolveUiLanguage(candidates: Iterable<string | null | undefined>, fallback?: UiLanguage): UiLanguage;
14
+ /** Languages written with CJK scripts: zh-CN, zh-TW, ja and ko. */
15
+ export declare function isCjkLanguage(language: string): boolean;
16
+ /**
17
+ * Lookup order for package-author locale files (`oo-locales/<lang>.json`), which only exist for en
18
+ * and zh-CN today. Traditional Chinese readers prefer Simplified Chinese over English; every other
19
+ * language falls back to English first. The chain never repeats a locale.
20
+ */
21
+ export declare function userLocaleFallbackChain(language: string): readonly string[];
@@ -0,0 +1,62 @@
1
+ //#region src/localization/common/languages.ts
2
+ var e = [
3
+ "en",
4
+ "zh-CN",
5
+ "zh-TW",
6
+ "ja",
7
+ "ko",
8
+ "ru",
9
+ "fr"
10
+ ], t = "en", n = {
11
+ en: "English",
12
+ "zh-CN": "简体中文",
13
+ "zh-TW": "繁體中文",
14
+ ja: "日本語",
15
+ ko: "한국어",
16
+ ru: "Русский",
17
+ fr: "Français"
18
+ }, r = new Map(e.map((e) => [e.toLowerCase(), e])), i = /* @__PURE__ */ new Set([
19
+ "hk",
20
+ "mo",
21
+ "tw"
22
+ ]), a = /* @__PURE__ */ new Set([
23
+ "zh-CN",
24
+ "zh-TW",
25
+ "ja",
26
+ "ko"
27
+ ]);
28
+ function o(e) {
29
+ return typeof e == "string" && r.get(e.toLowerCase()) == e;
30
+ }
31
+ function s(e, t = "en") {
32
+ for (let t of e) {
33
+ let e = t == null ? void 0 : u(t);
34
+ if (e != null) return e;
35
+ }
36
+ return t;
37
+ }
38
+ function c(e) {
39
+ let t = u(e);
40
+ return t != null && a.has(t);
41
+ }
42
+ function l(e) {
43
+ return e == "zh-TW" ? [
44
+ "zh-TW",
45
+ "zh-CN",
46
+ "en"
47
+ ] : e == "zh-CN" ? ["zh-CN", "en"] : e == "en" ? ["en", "zh-CN"] : [
48
+ e,
49
+ "en",
50
+ "zh-CN"
51
+ ];
52
+ }
53
+ function u(e) {
54
+ let t = e.trim().toLowerCase();
55
+ if (t.length == 0) return;
56
+ let n = r.get(t);
57
+ if (n != null) return n;
58
+ let a = t.split("-");
59
+ return a[0] == "zh" ? a.includes("hant") ? "zh-TW" : a.includes("hans") ? "zh-CN" : a.some((e) => i.has(e)) ? "zh-TW" : "zh-CN" : r.get(a[0]);
60
+ }
61
+ //#endregion
62
+ export { t as defaultUiLanguage, c as isCjkLanguage, o as isUiLanguage, s as resolveUiLanguage, n as uiLanguageNames, e as uiLanguages, l as userLocaleFallbackChain };
@@ -3923,7 +3923,10 @@ var ci = 300, H = "/v1/webhook_endpoints", li = { "Content-Type": "application/x
3923
3923
  let t = await U(e, "endpoint create", {
3924
3924
  body: fi(e.endpointUrl, n),
3925
3925
  endpoint: H,
3926
- headers: li,
3926
+ headers: {
3927
+ ...li,
3928
+ "Idempotency-Key": e.idempotencyKey
3929
+ },
3927
3930
  method: "POST"
3928
3931
  });
3929
3932
  W(t, "endpoint create");
@@ -5,7 +5,8 @@ var e = new TextEncoder(), t = /* @__PURE__ */ new Set([
5
5
  "javascript",
6
6
  "llm",
7
7
  "subflow",
8
- "value"
8
+ "value",
9
+ "wait"
9
10
  ]);
10
11
  function n(e, t) {
11
12
  if (typeof e != "object" || !e || Array.isArray(e)) throw TypeError(`${t} must be an object.`);
@@ -1,11 +1,15 @@
1
1
  export declare const runTerminalStatuses: readonly ['canceled', 'completed', 'failed', 'indeterminate'];
2
- export declare const runStatuses: readonly ["canceled", "completed", "failed", "indeterminate", "queued", "running", "starting"];
2
+ export declare const runStatuses: readonly ["canceled", "completed", "failed", "indeterminate", "queued", "running", "starting", "waiting"];
3
3
  export type RunStatus = (typeof runStatuses)[number];
4
4
  export type RunTerminalStatus = (typeof runTerminalStatuses)[number];
5
5
  export type RunOperation = {
6
6
  readonly kind: 'claim';
7
7
  } | {
8
8
  readonly kind: 'start';
9
+ } | {
10
+ readonly kind: 'wait';
11
+ } | {
12
+ readonly kind: 'resolve';
9
13
  } | {
10
14
  readonly kind: 'commit';
11
15
  readonly status: RunTerminalStatus;
@@ -16,6 +20,9 @@ export type RunTransition = {
16
20
  } | {
17
21
  readonly kind: 'running';
18
22
  readonly status: 'running';
23
+ } | {
24
+ readonly kind: 'waiting';
25
+ readonly status: 'waiting';
19
26
  } | {
20
27
  readonly kind: 'terminal';
21
28
  readonly status: RunTerminalStatus;
@@ -28,12 +35,18 @@ export type RunTransition = {
28
35
  } | {
29
36
  readonly kind: 'committed';
30
37
  readonly status: RunTerminalStatus;
38
+ } | {
39
+ readonly kind: 'waited';
40
+ readonly status: 'waiting';
41
+ } | {
42
+ readonly kind: 'resolved';
43
+ readonly status: 'queued';
31
44
  } | {
32
45
  readonly kind: 'stale';
33
46
  readonly status: RunStatus;
34
47
  };
35
48
  export type RunClaim = Extract<RunTransition, {
36
- readonly kind: 'ready' | 'running' | 'terminal';
49
+ readonly kind: 'ready' | 'running' | 'terminal' | 'waiting';
37
50
  }>;
38
51
  export type RunStart = Extract<RunTransition, {
39
52
  readonly kind: 'already-started' | 'started' | 'stale';
@@ -60,7 +73,9 @@ export interface RunLifecycleHarness {
60
73
  claim(runId: string): Promise<RunClaim>;
61
74
  commit(runId: string, status: RunTerminalStatus): Promise<boolean>;
62
75
  observe(runId: string): Promise<RunObservation>;
76
+ resolve(runId: string): Promise<boolean>;
63
77
  start(runId: string): Promise<RunStart>;
78
+ wait(runId: string): Promise<boolean>;
64
79
  }
65
80
  export interface RunLifecycleConformanceCase {
66
81
  readonly name: string;
@@ -28,7 +28,8 @@ var n = [
28
28
  ...n,
29
29
  "queued",
30
30
  "running",
31
- "starting"
31
+ "starting",
32
+ "waiting"
32
33
  ];
33
34
  function i(e) {
34
35
  return e == "canceled" || e == "completed" || e == "failed" || e == "indeterminate";
@@ -45,6 +46,10 @@ function a(e, t) {
45
46
  kind: "running",
46
47
  status: e
47
48
  };
49
+ case "waiting": return {
50
+ kind: "waiting",
51
+ status: e
52
+ };
48
53
  case "canceled":
49
54
  case "completed":
50
55
  case "failed":
@@ -63,6 +68,7 @@ function a(e, t) {
63
68
  status: e
64
69
  };
65
70
  case "queued":
71
+ case "waiting":
66
72
  case "canceled":
67
73
  case "completed":
68
74
  case "failed":
@@ -71,10 +77,24 @@ function a(e, t) {
71
77
  status: e
72
78
  };
73
79
  }
80
+ case "wait": return e == "running" ? {
81
+ kind: "waited",
82
+ status: "waiting"
83
+ } : {
84
+ kind: "stale",
85
+ status: e
86
+ };
87
+ case "resolve": return e == "waiting" ? {
88
+ kind: "resolved",
89
+ status: "queued"
90
+ } : {
91
+ kind: "stale",
92
+ status: e
93
+ };
74
94
  case "commit": return i(e) ? {
75
95
  kind: "stale",
76
96
  status: e
77
- } : t.status == "canceled" || e == "running" ? {
97
+ } : t.status == "canceled" || e == "running" || t.status == "failed" && e == "waiting" ? {
78
98
  kind: "committed",
79
99
  status: t.status
80
100
  } : {
@@ -95,6 +115,37 @@ async function s(e, t = "request", n = "request-a") {
95
115
  return r.runId;
96
116
  }
97
117
  var c = [
118
+ {
119
+ name: "pauses and resumes the same Run through the ordinary start barrier",
120
+ async verify(e) {
121
+ let t = await s(e), n = await e.claim(t);
122
+ if (n.kind != "ready") throw Error("Initial Run claim was not ready.");
123
+ o(await e.start(t), a(n.status, { kind: "start" }), "Initial start"), o(await e.wait(t), !0, "Wait commit"), o(await e.observe(t), {
124
+ status: "waiting",
125
+ terminalEvents: []
126
+ }, "Waiting Run observation"), o(await e.claim(t), a("waiting", { kind: "claim" }), "Claim while waiting"), o(await e.resolve(t), !0, "Wait resolution"), o(await e.resolve(t), !1, "Repeated Wait resolution");
127
+ let r = await e.claim(t);
128
+ if (r.kind != "ready") throw Error("Resolved Run claim was not ready.");
129
+ o(await e.start(t), a(r.status, { kind: "start" }), "Resume start"), o(await e.commit(t, "completed"), !0, "Completion after resume"), o(await e.observe(t), {
130
+ status: "completed",
131
+ terminalEvents: ["completed"]
132
+ }, "Resumed Run observation");
133
+ }
134
+ },
135
+ {
136
+ name: "allows cancellation and expiry failure while waiting",
137
+ async verify(e) {
138
+ let t = await s(e, "cancel-wait");
139
+ if ((await e.claim(t)).kind != "ready") throw Error("Canceled Run claim was not ready.");
140
+ await e.start(t), o(await e.wait(t), !0, "Canceled Run Wait commit"), o(await e.commit(t, "canceled"), !0, "Waiting cancellation"), o(await e.resolve(t), !1, "Resolution after cancellation");
141
+ let n = await s(e, "expire-wait");
142
+ if ((await e.claim(n)).kind != "ready") throw Error("Expired Run claim was not ready.");
143
+ await e.start(n), o(await e.wait(n), !0, "Expired Run Wait commit"), o(await e.commit(n, "failed"), !0, "Waiting expiry failure"), o(await e.observe(n), {
144
+ status: "failed",
145
+ terminalEvents: ["failed"]
146
+ }, "Expired Run observation");
147
+ }
148
+ },
98
149
  {
99
150
  name: "replays idempotent acceptance and rejects a conflicting request",
100
151
  async verify(e) {
@@ -44,7 +44,7 @@ export interface RuntimeInvocation {
44
44
  }
45
45
  export interface RuntimeHarness {
46
46
  readonly engineDigest: string;
47
- invoke(invocation: RuntimeInvocation): Promise<JsonValue>;
47
+ invoke(invocation: RuntimeInvocation): Promise<JsonValue | undefined>;
48
48
  }
49
49
  export interface RuntimeConformanceCase {
50
50
  readonly name: string;
@@ -129,6 +129,33 @@ var c = [
129
129
  }], "Capability request");
130
130
  }
131
131
  },
132
+ {
133
+ name: "submits Task outputs and accepts a void result",
134
+ async verify(e) {
135
+ let t = [];
136
+ o(await e.invoke({
137
+ capability: async (e) => (t.push(e), {
138
+ body: null,
139
+ status: 200
140
+ }),
141
+ input: null,
142
+ invocationId: "task-outputs",
143
+ program: a(e, "export default async (_input, context) => {\n await context.outputs({ first: 1 })\n await context.outputs({ second: 2 })\n}")
144
+ }), void 0, "Void Task result"), o(t.map(({ invocationId: e, kind: t, payload: n }) => ({
145
+ invocationId: e,
146
+ kind: t,
147
+ payload: n
148
+ })), [{
149
+ invocationId: "task-outputs",
150
+ kind: "outputs",
151
+ payload: { first: 1 }
152
+ }, {
153
+ invocationId: "task-outputs",
154
+ kind: "outputs",
155
+ payload: { second: 2 }
156
+ }], "Task outputs request");
157
+ }
158
+ },
132
159
  {
133
160
  name: "cancels a pending Capability and the user invocation",
134
161
  async verify(e) {
@@ -1,5 +1,6 @@
1
- import type { ConnectorCapability, JsonValue } from '../browser/flow-change.js';
1
+ import type { ConnectorCapability, JsonValue, WaitAction } from '../browser/flow-change.js';
2
2
  import type { PreparedFlow } from './flow-semantics.js';
3
+ import * as Effect from 'effect/Effect';
3
4
  export type SchedulerEvent = {
4
5
  readonly flowId: string;
5
6
  readonly parentJobId?: string;
@@ -16,7 +17,7 @@ export type SchedulerEvent = {
16
17
  readonly inputs: Readonly<Record<string, JsonValue>>;
17
18
  readonly jobId: string;
18
19
  readonly nodeId: string;
19
- readonly nodeKind: 'condition' | 'connector' | 'javascript' | 'llm' | 'subflow' | 'value';
20
+ readonly nodeKind: 'condition' | 'connector' | 'javascript' | 'llm' | 'subflow' | 'value' | 'wait';
20
21
  readonly nodeTitle?: string;
21
22
  readonly runId: string;
22
23
  readonly type: 'node.started';
@@ -39,6 +40,13 @@ export type SchedulerEvent = {
39
40
  readonly nodeId: string;
40
41
  readonly runId: string;
41
42
  readonly type: 'node.failed';
43
+ } | {
44
+ readonly jobId: string;
45
+ readonly level: 'debug' | 'error' | 'info' | 'warn';
46
+ readonly message: string;
47
+ readonly nodeId: string;
48
+ readonly runId: string;
49
+ readonly type: 'node.log';
42
50
  } | {
43
51
  readonly result: FlowRunResult | SubflowRunResult;
44
52
  readonly runId: string;
@@ -58,18 +66,66 @@ export interface FlowRunResult {
58
66
  readonly nodeId: string;
59
67
  }[];
60
68
  }
69
+ export interface FlowRunCheckpoint {
70
+ readonly bindingValues: Readonly<Record<string, string>>;
71
+ readonly buffers: Readonly<Record<string, {
72
+ readonly slots: Readonly<Record<string, {
73
+ readonly provided: boolean;
74
+ readonly queue: readonly JsonValue[];
75
+ readonly value: JsonValue;
76
+ }>>;
77
+ readonly staticTaken: boolean;
78
+ }>>;
79
+ readonly completedNodes: readonly string[];
80
+ readonly nextJobs: Readonly<Record<string, number>>;
81
+ readonly outputs: Readonly<Record<string, JsonValue>>;
82
+ readonly results: readonly {
83
+ readonly jobs: readonly {
84
+ readonly jobId: string;
85
+ readonly order: number;
86
+ readonly outputs: Readonly<Record<string, JsonValue>>;
87
+ }[];
88
+ readonly nodeId: string;
89
+ }[];
90
+ readonly version: 1;
91
+ readonly wait: {
92
+ readonly jobId: string;
93
+ readonly nodeId: string;
94
+ readonly order: number;
95
+ readonly value: JsonValue;
96
+ readonly waitId: string;
97
+ };
98
+ }
99
+ export type FlowRunOutcome = FlowRunResult | {
100
+ readonly checkpoint: FlowRunCheckpoint;
101
+ readonly kind: 'waiting';
102
+ readonly notification?: {
103
+ readonly input: Readonly<Record<string, JsonValue>>;
104
+ readonly messageHandle: string;
105
+ readonly taskId: string;
106
+ };
107
+ readonly wait: {
108
+ readonly actions: readonly ['continue'] | readonly ['approve', 'reject'];
109
+ readonly jobId: string;
110
+ readonly nodeId: string;
111
+ readonly order: number;
112
+ readonly waitId: string;
113
+ };
114
+ };
61
115
  export interface SubflowRunResult {
62
116
  readonly kind: 'function-outputs';
63
117
  readonly outputs: Readonly<Record<string, JsonValue>>;
64
118
  readonly target: 'subflow';
65
119
  }
66
120
  interface TaskInvocationBase {
121
+ readonly additionalInputs: Readonly<Record<string, JsonValue>>;
122
+ readonly blockId: string;
123
+ readonly flowId: string;
67
124
  readonly input: Readonly<Record<string, JsonValue>>;
68
125
  readonly invocationId: string;
69
126
  readonly jobId: string;
70
127
  readonly nodeId: string;
71
128
  readonly runId: string;
72
- readonly signal: AbortSignal;
73
129
  }
74
130
  export type TaskInvocation = TaskInvocationBase & ({
75
131
  readonly capabilities: readonly ConnectorCapability[];
@@ -86,15 +142,20 @@ export interface SchedulerFailure {
86
142
  readonly message: string;
87
143
  }
88
144
  export interface FlowRunOptions {
145
+ readonly bindingValues?: Readonly<Record<string, string>>;
89
146
  readonly createId: () => string;
90
- readonly emit?: (event: SchedulerEvent) => void | Promise<void>;
147
+ readonly emit?: (event: SchedulerEvent) => Effect.Effect<void, Error>;
91
148
  readonly flowId: string;
92
149
  readonly inputs?: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
93
- readonly invokeTask: (invocation: TaskInvocation) => Promise<unknown>;
150
+ readonly invokeTask: (invocation: TaskInvocation, outputs: (value: unknown) => Effect.Effect<void, Error>) => Effect.Effect<unknown, Error>;
94
151
  readonly projectFailure?: (error: unknown) => SchedulerFailure;
152
+ readonly resume?: {
153
+ readonly action: WaitAction;
154
+ readonly checkpoint: unknown;
155
+ };
95
156
  readonly runId: string;
96
- readonly signal?: AbortSignal;
97
157
  readonly trigger?: TriggerSeed;
98
158
  }
99
- export declare function runFlow(prepared: PreparedFlow, options: FlowRunOptions): Promise<FlowRunResult>;
159
+ export declare function decodeFlowRunCheckpoint(value: unknown): FlowRunCheckpoint;
160
+ export declare function runFlow(prepared: PreparedFlow, options: FlowRunOptions): Effect.Effect<FlowRunOutcome, Error>;
100
161
  export {};