@oomol-lab/open-flow 0.1.0-alpha.9 → 0.1.0-beta.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.
Files changed (55) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/{createResourceDialog-A64dDFCG.js → createResourceDialog-DXQz0thK.js} +228 -191
  3. package/dist/browser/diagnostics-BGoGFvHA.js +9237 -0
  4. package/dist/browser/{dist-DhsGR_K3.js → dist-3Mj8q8Pr.js} +27 -27
  5. package/dist/browser/{dist-n9WmBm5w.js → dist-BKuSVKCC.js} +1 -1
  6. package/dist/browser/{dist-DQVavPcf.js → dist-BMqL-qR5.js} +469 -903
  7. package/dist/browser/{dist-D5mdziGP.js → dist-BN4ZCyOB.js} +9 -9
  8. package/dist/browser/{dist-CVtP-E2c.js → dist-BpopSHwP.js} +1 -1
  9. package/dist/browser/{dist-B0Q2Mn0n.js → dist-CJpzJrLM.js} +191 -191
  10. package/dist/browser/{dist-DXgEYMFx.js → dist-CPuF50D9.js} +196 -196
  11. package/dist/browser/{dist-CUkceEvN.js → dist-CUSrALSX.js} +113 -113
  12. package/dist/browser/dist-CeSZ2xSM.js +444 -0
  13. package/dist/browser/{dist-Bc9TvHYl.js → dist-DUzA0Ukh.js} +20 -20
  14. package/dist/browser/{dist-DWzdGVm9.js → dist-DWADUsVB.js} +74 -74
  15. package/dist/browser/{esm-YIGXG-Js.js → esm-DGQbgYoJ.js} +13 -13
  16. package/dist/browser/flow-authoring-node.d.ts +3 -1
  17. package/dist/browser/flow-authoring.d.ts +2 -1
  18. package/dist/browser/flow-authoring.js +386 -96
  19. package/dist/browser/flow-change.d.ts +9 -4
  20. package/dist/browser/flow-change.js +49 -46
  21. package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BeyUSWpO.js} +1644 -908
  22. package/dist/browser/{flowWorkspace-D7-rBA1-.js → flowWorkspace-DwyxAOBH.js} +18384 -16381
  23. package/dist/browser/getPseudoElementBounds-ESJExRFX.js +7642 -0
  24. package/dist/browser/languages-DgJehE1g.js +62 -0
  25. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  26. package/dist/browser/licenses.md +119 -1
  27. package/dist/browser/main-DmjVyuWr.js +76 -0
  28. package/dist/browser/{markdownContent-ColGUxHy.js → markdownContent-DdlIRN3_.js} +4811 -4795
  29. package/dist/browser/theme.css +63 -0
  30. package/dist/browser/theme.css.d.ts +1 -0
  31. package/dist/browser/typeScriptSession-mPCiA9sV.js +2579 -0
  32. package/dist/browser/workbench-contract.d.ts +2 -1
  33. package/dist/browser/workbench.css +1 -1
  34. package/dist/browser/workbench.d.ts +45 -1
  35. package/dist/browser/workbench.js +980 -1322
  36. package/dist/browser/workbenchSelect-B2s1HV-Y.js +1374 -0
  37. package/dist/common/connector-action.d.ts +6 -0
  38. package/dist/common/connector-action.js +37 -29
  39. package/dist/common/control-api-conformance.js +45 -4
  40. package/dist/common/control-api-errors.d.ts +16 -0
  41. package/dist/common/control-api.d.ts +20 -6
  42. package/dist/common/control-api.js +151 -95
  43. package/dist/common/flow-encoding.d.ts +2 -2
  44. package/dist/common/flow-encoding.js +4 -1
  45. package/dist/common/flow-semantics.d.ts +3 -0
  46. package/dist/common/flow-semantics.js +939 -844
  47. package/dist/common/licenses.md +1 -25
  48. package/dist/common/localization.d.ts +21 -0
  49. package/dist/common/localization.js +62 -0
  50. package/dist/common/scheduler.d.ts +5 -5
  51. package/dist/common/scheduler.js +250 -236
  52. package/package.json +10 -1
  53. package/dist/browser/addNodeOptions-DRndy4EK.js +0 -6910
  54. package/dist/browser/createLucideIcon-CqjqCezK.js +0 -5537
  55. package/dist/browser/field-CKGQHCIi.js +0 -312
@@ -17,4 +17,10 @@ export interface ConnectorActionPorts {
17
17
  readonly nullable: boolean;
18
18
  }[];
19
19
  }
20
+ export interface ConnectorRuntimeInputPort {
21
+ readonly handle: string;
22
+ readonly jsonSchema: unknown;
23
+ readonly nullable: boolean;
24
+ }
20
25
  export declare function connectorActionPorts(inputSchema: unknown, outputSchema: unknown): ConnectorActionPorts;
26
+ export declare function normalizeConnectorRuntimeInputs<Value>(ports: readonly ConnectorRuntimeInputPort[], inputs: Readonly<Record<string, Value>>): Readonly<Record<string, Value>>;
@@ -3,82 +3,90 @@ var e = Array.isArray, t = (e) => typeof e == "object" && !!e, n = (n) => t(n) &
3
3
  //#endregion
4
4
  //#region src/connector/common/actionSchema.ts
5
5
  function i(e, t) {
6
- let n = a(e);
6
+ let n = o(e);
7
7
  return {
8
8
  inputs: n,
9
9
  initialInputs: n.flatMap((e) => e.value === void 0 ? [] : [{
10
10
  handle: e.handle,
11
11
  value: e.value
12
12
  }]),
13
- outputs: o(t)
13
+ outputs: s(t)
14
14
  };
15
15
  }
16
- function a(e) {
16
+ function a(e, t) {
17
+ let n = new Map(e.map((e) => [e.handle, e])), r = {};
18
+ for (let [e, i] of Object.entries(t)) {
19
+ let t = n.get(e);
20
+ i == null && t?.nullable == 1 && !f(t.jsonSchema) || (r[e] = i);
21
+ }
22
+ return r;
23
+ }
24
+ function o(e) {
17
25
  let t = r(e);
18
26
  if (t == null || t.type != "object" && t.properties == null) throw Error("Connector action inputSchema must be an object schema.");
19
27
  let n = r(t.properties);
20
28
  if (n == null) return [];
21
- let i = u(t.required);
29
+ let i = d(t.required);
22
30
  return Object.entries(n).map(([e, n]) => {
23
- let r = !i.has(e) || d(n, t);
31
+ let r = !i.has(e) || f(n, t);
24
32
  return {
25
- description: c(t, n),
33
+ description: l(t, n),
26
34
  handle: e,
27
- json_schema: s(t, n),
35
+ json_schema: c(t, n),
28
36
  nullable: r,
29
- value: l(t, n, r)
37
+ value: u(t, n, r)
30
38
  };
31
39
  });
32
40
  }
33
- function o(e) {
41
+ function s(e) {
34
42
  let t = r(e), n = r(t?.properties);
35
43
  if (t != null && (t.type == "object" || n != null)) {
36
44
  if (n == null) return [];
37
- let e = u(t.required);
45
+ let e = d(t.required);
38
46
  return Object.entries(n).map(([n, r]) => ({
39
- description: c(t, r),
47
+ description: l(t, r),
40
48
  handle: n,
41
- json_schema: s(t, r),
42
- nullable: !e.has(n) || d(r, t)
49
+ json_schema: c(t, r),
50
+ nullable: !e.has(n) || f(r, t)
43
51
  }));
44
52
  }
45
53
  return [{
46
- description: c(t, e),
54
+ description: l(t, e),
47
55
  handle: "output",
48
56
  json_schema: e,
49
- nullable: d(e)
57
+ nullable: f(e)
50
58
  }];
51
59
  }
52
- function s(e, t) {
60
+ function c(e, t) {
53
61
  let n = r(t);
54
62
  if (n == null) return t;
55
63
  let i = Object.assign({}, n);
56
64
  return i.$defs == null && e.$defs != null && (i.$defs = e.$defs), i.definitions == null && e.definitions != null && (i.definitions = e.definitions), i;
57
65
  }
58
- function c(e, t) {
59
- for (let n of f(e, t)) if (typeof n.description == "string") return n.description;
66
+ function l(e, t) {
67
+ for (let n of p(e, t)) if (typeof n.description == "string") return n.description;
60
68
  }
61
- function l(e, t, n) {
62
- for (let n of f(e, t)) if (Object.hasOwn(n, "default")) return n.default;
69
+ function u(e, t, n) {
70
+ for (let n of p(e, t)) if (Object.hasOwn(n, "default")) return n.default;
63
71
  return n ? null : void 0;
64
72
  }
65
- function u(e) {
73
+ function d(e) {
66
74
  return Array.isArray(e) ? new Set(e.filter((e) => typeof e == "string")) : /* @__PURE__ */ new Set();
67
75
  }
68
- function d(e, t = e, n = /* @__PURE__ */ new Set()) {
76
+ function f(e, t = e, n = /* @__PURE__ */ new Set()) {
69
77
  let i = r(e);
70
78
  if (i == null) return !1;
71
79
  if (Object.hasOwn(i, "type")) return i.type == "null" || Array.isArray(i.type) && i.type.includes("null");
72
80
  if (Object.hasOwn(i, "enum")) return Array.isArray(i.enum) && i.enum.includes(null);
73
- for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(i, e)) return Array.isArray(i[e]) && i[e].some((e) => d(e, t, n));
81
+ for (let e of ["anyOf", "oneOf"]) if (Object.hasOwn(i, e)) return Array.isArray(i[e]) && i[e].some((e) => f(e, t, n));
74
82
  let a = typeof i.$ref == "string" ? i.$ref : void 0;
75
83
  if (a == null || n.has(a)) return !1;
76
- let o = p(t, a);
84
+ let o = m(t, a);
77
85
  if (o === void 0) return !1;
78
86
  let s = new Set(n);
79
- return s.add(a), d(o, t, s);
87
+ return s.add(a), f(o, t, s);
80
88
  }
81
- function f(e, t) {
89
+ function p(e, t) {
82
90
  let n = [], i = /* @__PURE__ */ new Set(), a = t;
83
91
  for (;;) {
84
92
  let t = r(a);
@@ -86,12 +94,12 @@ function f(e, t) {
86
94
  n.push(t);
87
95
  let o = typeof t.$ref == "string" ? t.$ref : void 0;
88
96
  if (o == null || i.has(o)) return n;
89
- let s = p(e, o);
97
+ let s = m(e, o);
90
98
  if (s === void 0) return n;
91
99
  i.add(o), a = s;
92
100
  }
93
101
  }
94
- function p(e, t) {
102
+ function m(e, t) {
95
103
  if (t == "#") return e;
96
104
  if (!t.startsWith("#/")) return;
97
105
  let n = e;
@@ -103,4 +111,4 @@ function p(e, t) {
103
111
  return n;
104
112
  }
105
113
  //#endregion
106
- export { i as connectorActionPorts };
114
+ export { i as connectorActionPorts, a as normalizeConnectorRuntimeInputs };
@@ -126,6 +126,45 @@ function v(e, t, n) {
126
126
  });
127
127
  }
128
128
  var y = [
129
+ {
130
+ name: "manages deployment Variables with stable limits and exact-case identity",
131
+ async verify(e) {
132
+ i(await c(await u(e, "/v1/variables"), 200, "List empty Variables"), {
133
+ variables: [],
134
+ version: 1
135
+ }, "Empty Variables");
136
+ let t = (t, n, r = { value: n }) => u(e, `/v1/variables/${encodeURIComponent(t)}`, {
137
+ body: JSON.stringify(r),
138
+ method: "PUT"
139
+ }), n = await c(await t("Token", ""), 200, "Create Variable");
140
+ i(Object.keys(n).toSorted(), [
141
+ "name",
142
+ "updatedAt",
143
+ "value",
144
+ "version"
145
+ ], "Variable fields"), i(n.name, "Token", "Variable name"), i(n.value, "", "Empty Variable value"), i(n.version, 1, "Variable version"), s(n.updatedAt, "Variable updatedAt"), i(await c(await u(e, "/v1/variables/Token"), 200, "Read Variable"), n, "Read Variable"), i(await c(await t("Token", ""), 200, "Put same Variable"), n, "Same Variable update");
146
+ for (let e of [
147
+ "A",
148
+ "Z",
149
+ "a",
150
+ "token"
151
+ ]) await c(await t(e, e), 200, `Create ${e} Variable`);
152
+ i(o((await c(await u(e, "/v1/variables"), 200, "List Variables")).variables, "Variables").map((e) => a(e, "Variable").name), [
153
+ "A",
154
+ "Token",
155
+ "Z",
156
+ "a",
157
+ "token"
158
+ ], "Variable binary order");
159
+ let r = `${"值".repeat(21845)}x`;
160
+ i(new TextEncoder().encode(r).byteLength, 65536, "Variable UTF-8 boundary fixture"), await c(await t("BIG", r), 200, "Create maximum Variable value"), await l(await t("BIG", `${r}x`), 400, "variable.invalid", "Reject oversized Variable value"), await l(await t("OO_TOKEN", "value"), 400, "variable.invalid", "Reject reserved Variable name"), await l(await t("bad-name", "value"), 400, "variable.invalid", "Reject invalid Variable name"), await l(await t("EXTRA", "value", {
161
+ extra: !0,
162
+ value: "value"
163
+ }), 400, "variable.invalid", "Reject extra Variable field"), await l(await u(e, "/v1/variables/MISSING"), 404, "variable.not-found", "Read missing Variable"), await l(await u(e, "/v1/variables/MISSING", { method: "DELETE" }), 404, "variable.not-found", "Delete missing Variable"), i(await c(await u(e, "/v1/variables/Token", { method: "DELETE" }), 200, "Delete Variable"), { version: 1 }, "Delete response");
164
+ for (let e = 0; e < 195; e += 1) await c(await t(`V${String(e).padStart(3, "0")}`, "value"), 200, `Fill Variable ${e}`);
165
+ await l(await t("V195", "value"), 409, "variable.limit-reached", "Reject Variable over limit"), i((await c(await t("A", "updated"), 200, "Update full Variable catalog")).value, "updated", "Full catalog update");
166
+ }
167
+ },
129
168
  {
130
169
  name: "creates, replays, lists, reads, renames, and retires a Flow",
131
170
  async verify(e) {
@@ -221,7 +260,7 @@ var y = [
221
260
  method: "POST"
222
261
  }), h = await c(await m(), 202, "Create Draft Run"), g = s(h.runId, "Draft Run runId");
223
262
  i(await c(await m(), 200, "Replay Draft Run"), h, "Replayed Draft Run"), await l(await u(e, `/v1/runs/${g}/result`), 409, "run.not-terminal", "Read queued Run result");
224
- let _ = await c(await u(e, p, {
263
+ let _ = s((await c(await u(e, p, {
225
264
  body: JSON.stringify({
226
265
  engineContract: n,
227
266
  inputs: {},
@@ -229,11 +268,13 @@ var y = [
229
268
  }),
230
269
  headers: { "idempotency-key": "draft-run-second" },
231
270
  method: "POST"
232
- }), 202, "Create second Draft Run"), v = await c(await u(e, `/v1/flows/${r}/runs?limit=1`), 200, "List Runs");
233
- i(o(v.runs, "Runs").map((e) => a(e, "Run").runId), [g], "Listed Runs"), s(v.nextCursor, "Run cursor"), i((await c(await u(e, `/v1/runs/${g}/cancel`, {
271
+ }), 202, "Create second Draft Run")).runId, "Second Draft Run"), v = await c(await u(e, `/v1/flows/${r}/runs?limit=1`), 200, "List Runs");
272
+ i(o(v.runs, "Runs").map((e) => a(e, "Run").runId), [_], "Listed Runs");
273
+ let y = s(v.nextCursor, "Run cursor");
274
+ i(o((await c(await u(e, `/v1/flows/${r}/runs?limit=1&cursor=${encodeURIComponent(y)}`), 200, "List next Runs")).runs, "Next Runs").map((e) => a(e, "Run").runId), [g], "Listed next Runs"), i((await c(await u(e, `/v1/runs/${g}/cancel`, {
234
275
  body: JSON.stringify({ version: 1 }),
235
276
  method: "POST"
236
- }), 200, "Cancel Run")).status, "canceled", "Canceled Run status"), i((await c(await u(e, `/v1/runs/${g}/result`), 200, "Read canceled Run result")).status, "canceled", "Canceled Run result"), i((await c(await u(e, `/v1/runs/${g}/events`), 200, "Read canceled Run events")).done, !0, "Canceled Run events"), i((await c(await u(e, `/v1/runs/${s(_.runId, "Second Draft Run")}/cancel`, {
277
+ }), 200, "Cancel Run")).status, "canceled", "Canceled Run status"), i((await c(await u(e, `/v1/runs/${g}/result`), 200, "Read canceled Run result")).status, "canceled", "Canceled Run result"), i((await c(await u(e, `/v1/runs/${g}/events`), 200, "Read canceled Run events")).done, !0, "Canceled Run events"), i((await c(await u(e, `/v1/runs/${_}/cancel`, {
237
278
  body: JSON.stringify({ version: 1 }),
238
279
  method: "POST"
239
280
  }), 200, "Cancel second Draft Run")).status, "canceled", "Second canceled Run status");
@@ -3,6 +3,7 @@ export declare const controlErrorCode: {
3
3
  readonly authorizationDenied: 'authorization.denied';
4
4
  readonly bindingUnresolved: 'binding.unresolved';
5
5
  readonly connectorActionNotFound: 'connector.action-not-found';
6
+ readonly connectorUnconfigured: 'connector.unconfigured';
6
7
  readonly connectorUnavailable: 'connector.unavailable';
7
8
  readonly engineUnavailable: 'engine.unavailable';
8
9
  readonly engineUnsupported: 'engine.unsupported';
@@ -27,6 +28,9 @@ export declare const controlErrorCode: {
27
28
  readonly triggerKeyInvalid: 'trigger-key.invalid';
28
29
  readonly triggerKeyNotFound: 'trigger-key.not-found';
29
30
  readonly triggerNotFound: 'trigger.not-found';
31
+ readonly variableInvalid: 'variable.invalid';
32
+ readonly variableLimitReached: 'variable.limit-reached';
33
+ readonly variableNotFound: 'variable.not-found';
30
34
  };
31
35
  export type ControlErrorCode = (typeof controlErrorCode)[keyof typeof controlErrorCode];
32
36
  export declare const controlErrorMetadata: {
@@ -42,6 +46,9 @@ export declare const controlErrorMetadata: {
42
46
  readonly "connector.action-not-found": {
43
47
  readonly status: 404;
44
48
  };
49
+ readonly "connector.unconfigured": {
50
+ readonly status: 503;
51
+ };
45
52
  readonly "connector.unavailable": {
46
53
  readonly status: 503;
47
54
  };
@@ -114,4 +121,13 @@ export declare const controlErrorMetadata: {
114
121
  readonly "trigger.not-found": {
115
122
  readonly status: 404;
116
123
  };
124
+ readonly "variable.invalid": {
125
+ readonly status: 400;
126
+ };
127
+ readonly "variable.limit-reached": {
128
+ readonly status: 409;
129
+ };
130
+ readonly "variable.not-found": {
131
+ readonly status: 404;
132
+ };
117
133
  };
@@ -20,6 +20,12 @@ export interface FlowPage {
20
20
  readonly total?: number;
21
21
  readonly version: 1;
22
22
  }
23
+ export interface Variable {
24
+ readonly name: string;
25
+ readonly updatedAt: string;
26
+ readonly value: string;
27
+ readonly version: 1;
28
+ }
23
29
  export interface TriggerKeySummary {
24
30
  readonly description: string;
25
31
  readonly displayName: string;
@@ -137,6 +143,7 @@ export interface Diagnostic {
137
143
  readonly line: number;
138
144
  readonly message: string;
139
145
  readonly path: string;
146
+ readonly values?: Readonly<Record<string, string | number>>;
140
147
  }
141
148
  export interface FlowCheck {
142
149
  readonly closureDigest: string;
@@ -266,6 +273,13 @@ export declare class ControlClient {
266
273
  readonly includeTotal?: boolean;
267
274
  readonly limit?: number;
268
275
  }): Promise<FlowPage>;
276
+ listVariables(): Promise<{
277
+ readonly variables: readonly Variable[];
278
+ readonly version: 1;
279
+ }>;
280
+ getVariable(name: string): Promise<Variable>;
281
+ putVariable(name: string, value: string): Promise<Variable>;
282
+ deleteVariable(name: string): Promise<void>;
269
283
  createFlow(name: string, idempotencyKey?: string): Promise<Flow>;
270
284
  getFlow(flowId: string): Promise<Flow>;
271
285
  renameFlow(flowId: string, name: string): Promise<Flow>;
@@ -285,12 +299,12 @@ export declare class ControlClient {
285
299
  getDraft(flowId: string): Promise<Draft>;
286
300
  syncDraft(flowId: string, fromRevisionId?: string): Promise<DraftSync>;
287
301
  getRevision(flowId: string, revisionId: string): Promise<Draft>;
288
- listConnectorProviders(signal?: AbortSignal): Promise<readonly ConnectorProvider[]>;
289
- listConnectorActions(serviceId?: string, signal?: AbortSignal): Promise<readonly ConnectorAction[]>;
290
- searchConnectorActions(query: string, signal?: AbortSignal): Promise<readonly ConnectorAction[]>;
291
- getConnectorAction(actionId: string, signal?: AbortSignal): Promise<ConnectorAction>;
292
- listConnectorConnections(serviceId: string, signal?: AbortSignal): Promise<readonly ConnectorConnection[]>;
293
- createConnectorConnectionPage(serviceId: string): Promise<string>;
302
+ listConnectorProviders(signal?: AbortSignal, flowId?: string): Promise<readonly ConnectorProvider[]>;
303
+ listConnectorActions(serviceId?: string, signal?: AbortSignal, flowId?: string): Promise<readonly ConnectorAction[]>;
304
+ searchConnectorActions(query: string, signal?: AbortSignal, flowId?: string): Promise<readonly ConnectorAction[]>;
305
+ getConnectorAction(actionId: string, signal?: AbortSignal, flowId?: string): Promise<ConnectorAction>;
306
+ listConnectorConnections(serviceId: string, signal?: AbortSignal, flowId?: string): Promise<readonly ConnectorConnection[]>;
307
+ createConnectorConnectionPage(serviceId: string, flowId?: string): Promise<string>;
294
308
  changeDraft(flowId: string, expectedRevisionId: string, operations: readonly ChangeOperation[]): Promise<DraftChange>;
295
309
  checkFlow(flowId: string, revisionId: string): Promise<FlowCheck>;
296
310
  getLive(flowId: string): Promise<Live>;