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

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 (43) hide show
  1. package/README.md +5 -1
  2. package/dist/browser/addNodeOptions-JRHMwVOl.js +9597 -0
  3. package/dist/browser/{change-Cu6pQIit.js → change-BATEvjif.js} +2 -2
  4. package/dist/browser/createResourceDialog-CWD62rU0.js +467 -0
  5. package/dist/browser/{esm-CvAs_mAS.js → esm-C04lx1pd.js} +1 -1
  6. package/dist/browser/flow-authoring-node.d.ts +2 -0
  7. package/dist/browser/flow-authoring.d.ts +1 -1
  8. package/dist/browser/flow-authoring.js +387 -126
  9. package/dist/browser/flow-change.d.ts +9 -4
  10. package/dist/browser/flow-change.js +49 -46
  11. package/dist/browser/{flowRunInputEditorStore-DXOyyY7o.js → flowRunInputEditorStore-BUwR9Vbp.js} +1615 -882
  12. package/dist/browser/{flowWorkspace-X_T_DcQf.js → flowWorkspace-_qaqIyDi.js} +18174 -16631
  13. package/dist/browser/languages-DgJehE1g.js +62 -0
  14. package/dist/browser/lib-C5Ipyfps.js +7856 -0
  15. package/dist/browser/main-DmjVyuWr.js +76 -0
  16. package/dist/browser/{markdownContent-BI-2PmDX.js → markdownContent-CX77lBFM.js} +4795 -4787
  17. package/dist/browser/theme.css +63 -0
  18. package/dist/browser/theme.css.d.ts +1 -0
  19. package/dist/browser/typeScriptSession-D5neIpug.js +2560 -0
  20. package/dist/browser/{createLucideIcon-COMgwa_u.js → useOpenInteractionType-CRgOHg5M.js} +2484 -2254
  21. package/dist/browser/workbench-contract.d.ts +2 -1
  22. package/dist/browser/workbench.css +1 -1
  23. package/dist/browser/workbench.d.ts +16 -1
  24. package/dist/browser/workbench.js +1492 -1307
  25. package/dist/common/control-api-conformance.js +39 -0
  26. package/dist/common/control-api-errors.d.ts +12 -0
  27. package/dist/common/control-api.d.ts +13 -0
  28. package/dist/common/control-api.js +120 -73
  29. package/dist/common/flow-encoding.d.ts +2 -2
  30. package/dist/common/flow-encoding.js +4 -1
  31. package/dist/common/flow-semantics.d.ts +2 -0
  32. package/dist/common/flow-semantics.js +869 -838
  33. package/dist/common/licenses.md +1 -25
  34. package/dist/common/localization.d.ts +21 -0
  35. package/dist/common/localization.js +62 -0
  36. package/dist/common/scheduler.d.ts +1 -0
  37. package/dist/common/scheduler.js +64 -50
  38. package/package.json +9 -1
  39. package/dist/browser/addNodeOptions-BwrMvPQC.js +0 -5230
  40. package/dist/browser/assets/typeScriptWorker-CaA4llbX.js +0 -59850
  41. package/dist/browser/createResourceDialog-YgMLylQz.js +0 -467
  42. package/dist/browser/field-BrEG-7ap.js +0 -312
  43. package/dist/browser/typeScriptSession-Dagu_tRs.js +0 -2549
@@ -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) {
@@ -27,6 +27,9 @@ export declare const controlErrorCode: {
27
27
  readonly triggerKeyInvalid: 'trigger-key.invalid';
28
28
  readonly triggerKeyNotFound: 'trigger-key.not-found';
29
29
  readonly triggerNotFound: 'trigger.not-found';
30
+ readonly variableInvalid: 'variable.invalid';
31
+ readonly variableLimitReached: 'variable.limit-reached';
32
+ readonly variableNotFound: 'variable.not-found';
30
33
  };
31
34
  export type ControlErrorCode = (typeof controlErrorCode)[keyof typeof controlErrorCode];
32
35
  export declare const controlErrorMetadata: {
@@ -114,4 +117,13 @@ export declare const controlErrorMetadata: {
114
117
  readonly "trigger.not-found": {
115
118
  readonly status: 404;
116
119
  };
120
+ readonly "variable.invalid": {
121
+ readonly status: 400;
122
+ };
123
+ readonly "variable.limit-reached": {
124
+ readonly status: 409;
125
+ };
126
+ readonly "variable.not-found": {
127
+ readonly status: 404;
128
+ };
117
129
  };
@@ -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;
@@ -266,6 +272,13 @@ export declare class ControlClient {
266
272
  readonly includeTotal?: boolean;
267
273
  readonly limit?: number;
268
274
  }): Promise<FlowPage>;
275
+ listVariables(): Promise<{
276
+ readonly variables: readonly Variable[];
277
+ readonly version: 1;
278
+ }>;
279
+ getVariable(name: string): Promise<Variable>;
280
+ putVariable(name: string, value: string): Promise<Variable>;
281
+ deleteVariable(name: string): Promise<void>;
269
282
  createFlow(name: string, idempotencyKey?: string): Promise<Flow>;
270
283
  getFlow(flowId: string): Promise<Flow>;
271
284
  renameFlow(flowId: string, name: string): Promise<Flow>;
@@ -27,7 +27,10 @@ var e = {
27
27
  runOverloaded: "run.overloaded",
28
28
  triggerKeyInvalid: "trigger-key.invalid",
29
29
  triggerKeyNotFound: "trigger-key.not-found",
30
- triggerNotFound: "trigger.not-found"
30
+ triggerNotFound: "trigger.not-found",
31
+ variableInvalid: "variable.invalid",
32
+ variableLimitReached: "variable.limit-reached",
33
+ variableNotFound: "variable.not-found"
31
34
  }, t = {
32
35
  [e.authenticationRequired]: { status: 401 },
33
36
  [e.authorizationDenied]: { status: 403 },
@@ -56,7 +59,10 @@ var e = {
56
59
  [e.runOverloaded]: { status: 429 },
57
60
  [e.triggerKeyInvalid]: { status: 409 },
58
61
  [e.triggerKeyNotFound]: { status: 404 },
59
- [e.triggerNotFound]: { status: 404 }
62
+ [e.triggerNotFound]: { status: 404 },
63
+ [e.variableInvalid]: { status: 400 },
64
+ [e.variableLimitReached]: { status: 409 },
65
+ [e.variableNotFound]: { status: 404 }
60
66
  }, n = [
61
67
  "canceled",
62
68
  "completed",
@@ -326,6 +332,27 @@ function O(e) {
326
332
  };
327
333
  }
328
334
  function k(e) {
335
+ let t = a(e);
336
+ if (s(t, [
337
+ "name",
338
+ "updatedAt",
339
+ "value",
340
+ "version"
341
+ ]), t.version != 1 || typeof t.value != "string") return i();
342
+ let n = o(t.updatedAt);
343
+ try {
344
+ if (new Date(n).toISOString() != n) return i();
345
+ } catch {
346
+ return i();
347
+ }
348
+ return {
349
+ name: o(t.name),
350
+ updatedAt: n,
351
+ value: t.value,
352
+ version: 1
353
+ };
354
+ }
355
+ function A(e) {
329
356
  let t = a(e), n = t.parentRevisionId;
330
357
  return t.version != 1 || n !== null && typeof n != "string" ? i() : {
331
358
  actorId: o(t.actorId),
@@ -338,24 +365,24 @@ function k(e) {
338
365
  version: 1
339
366
  };
340
367
  }
341
- function A(e) {
368
+ function j(e) {
342
369
  let t = a(e), n = a(t.content);
343
370
  return n.modelVersion == 1 ? (a(n.document), a(n.modules), {
344
- ...k(t),
371
+ ...A(t),
345
372
  content: t.content
346
373
  }) : i();
347
374
  }
348
- function j(e) {
375
+ function M(e) {
349
376
  let t = a(e);
350
377
  return t.version == 1 ? {
351
- revision: k(t.revision),
378
+ revision: A(t.revision),
352
379
  version: 1
353
380
  } : i();
354
381
  }
355
- function M(e) {
382
+ function N(e) {
356
383
  let t = a(e);
357
384
  return t.version == 1 ? t.kind == "snapshot" ? {
358
- draft: A(t.draft),
385
+ draft: j(t.draft),
359
386
  kind: "snapshot",
360
387
  version: 1
361
388
  } : t.kind != "changes" || !Array.isArray(t.revisions) ? i() : {
@@ -366,13 +393,13 @@ function M(e) {
366
393
  for (let e of t.operations) if (typeof a(e).kind != "string") return i();
367
394
  return {
368
395
  operations: t.operations,
369
- revision: k(t.revision)
396
+ revision: A(t.revision)
370
397
  };
371
398
  }),
372
399
  version: 1
373
400
  } : i();
374
401
  }
375
- function N(e) {
402
+ function P(e) {
376
403
  let t = a(e), n = t.operation, r = t.sourcePublicationId;
377
404
  return t.version != 1 || n != "publish" && n != "rollback" || r != null && typeof r != "string" ? i() : {
378
405
  actorId: o(t.actorId),
@@ -389,7 +416,7 @@ function N(e) {
389
416
  version: 1
390
417
  };
391
418
  }
392
- function P(e) {
419
+ function F(e) {
393
420
  let t = a(e);
394
421
  return {
395
422
  code: o(t.code),
@@ -399,11 +426,11 @@ function P(e) {
399
426
  path: typeof t.path == "string" ? t.path : i()
400
427
  };
401
428
  }
402
- function F(e) {
429
+ function I(e) {
403
430
  let t = a(e);
404
431
  return t.version != 1 || typeof t.valid != "boolean" || !Array.isArray(t.diagnostics) ? i() : {
405
432
  closureDigest: o(t.closureDigest),
406
- diagnostics: t.diagnostics.map(P),
433
+ diagnostics: t.diagnostics.map(F),
407
434
  engineContract: o(t.engineContract),
408
435
  flowId: o(t.flowId),
409
436
  modelVersion: c(t.modelVersion),
@@ -413,31 +440,31 @@ function F(e) {
413
440
  version: 1
414
441
  };
415
442
  }
416
- function I(e) {
443
+ function L(e) {
417
444
  let t = a(e), n = t.status, r = t.publication;
418
445
  return t.version != 1 || typeof t.hasUnpublishedChanges != "boolean" || n != "not-published" && n != "runnable" && n != "suspended" || n == "not-published" && r !== null || n != "not-published" && r === null ? i() : {
419
446
  flowId: o(t.flowId),
420
447
  hasUnpublishedChanges: t.hasUnpublishedChanges,
421
- publication: r === null ? null : N(r),
448
+ publication: r === null ? null : P(r),
422
449
  revision: c(t.revision),
423
450
  status: n,
424
451
  version: 1
425
452
  };
426
453
  }
427
- function L(e) {
454
+ function R(e) {
428
455
  let t = a(e), n = t.nextCursor, r = t.total;
429
456
  return t.version != 1 || !Array.isArray(t.publications) || n != null && typeof n != "string" || r != null && !Number.isSafeInteger(r) ? i() : {
430
457
  ...n == null ? {} : { nextCursor: n },
431
- publications: t.publications.map(N),
458
+ publications: t.publications.map(P),
432
459
  ...r == null ? {} : { total: r },
433
460
  version: 1
434
461
  };
435
462
  }
436
- var R = new Set(n);
437
- function z(e) {
438
- return typeof e == "string" && R.has(e) ? e : i();
439
- }
463
+ var z = new Set(n);
440
464
  function B(e) {
465
+ return typeof e == "string" && z.has(e) ? e : i();
466
+ }
467
+ function V(e) {
441
468
  let t = a(e), n = t.source, r = t.startedAt, s = t.finishedAt;
442
469
  return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || s != null && typeof s != "string" ? i() : {
443
470
  createdAt: o(t.createdAt),
@@ -447,12 +474,12 @@ function B(e) {
447
474
  runId: o(t.runId),
448
475
  source: n,
449
476
  ...r == null ? {} : { startedAt: r },
450
- status: z(t.status),
477
+ status: B(t.status),
451
478
  version: 1
452
479
  };
453
480
  }
454
- function V(e) {
455
- let t = a(e), n = B(t), r = t.eventsExpiresAt;
481
+ function H(e) {
482
+ let t = a(e), n = V(t), r = t.eventsExpiresAt;
456
483
  if (r != null && typeof r != "string") return i();
457
484
  let s = {
458
485
  ...n,
@@ -482,16 +509,16 @@ function V(e) {
482
509
  };
483
510
  }
484
511
  }
485
- function H(e) {
512
+ function U(e) {
486
513
  let t = a(e), n = t.nextCursor;
487
514
  return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? i() : {
488
515
  flowId: o(t.flowId),
489
516
  ...n == null ? {} : { nextCursor: n },
490
- runs: t.runs.map(B),
517
+ runs: t.runs.map(V),
491
518
  version: 1
492
519
  };
493
520
  }
494
- var U = /* @__PURE__ */ new Set([
521
+ var W = /* @__PURE__ */ new Set([
495
522
  "node.artifact",
496
523
  "node.completed",
497
524
  "node.failed",
@@ -508,9 +535,9 @@ var U = /* @__PURE__ */ new Set([
508
535
  "run.queued",
509
536
  "run.started"
510
537
  ]);
511
- function W(e) {
538
+ function G(e) {
512
539
  let t = a(e), n = t.kind, r = c(t.sequence), s = t.sourceSequence;
513
- return typeof n != "string" || !U.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
540
+ return typeof n != "string" || !W.has(n) || r < 0 || s != null && (!Number.isSafeInteger(s) || s < 0) ? i() : {
514
541
  createdAt: o(t.createdAt),
515
542
  kind: n,
516
543
  payload: a(t.payload),
@@ -518,11 +545,11 @@ function W(e) {
518
545
  ...s == null ? {} : { sourceSequence: s }
519
546
  };
520
547
  }
521
- function G(e) {
548
+ function K(e) {
522
549
  let t = a(e), n = t.eventsExpiresAt, r = c(t.nextAfter);
523
550
  return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? i() : {
524
551
  done: t.done,
525
- events: t.events.map(W),
552
+ events: t.events.map(G),
526
553
  ...n == null ? {} : { eventsExpiresAt: n },
527
554
  historyComplete: t.historyComplete,
528
555
  nextAfter: r,
@@ -530,8 +557,8 @@ function G(e) {
530
557
  version: 1
531
558
  };
532
559
  }
533
- function K(e) {
534
- let t = a(e), n = z(t.status);
560
+ function q(e) {
561
+ let t = a(e), n = B(t.status);
535
562
  return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" ? i() : {
536
563
  cancelAccepted: t.cancelAccepted,
537
564
  runId: o(t.runId),
@@ -539,7 +566,7 @@ function K(e) {
539
566
  version: 1
540
567
  };
541
568
  }
542
- function q(e) {
569
+ function J(e) {
543
570
  let t = a(e), n = t.status;
544
571
  if (t.version != 1) return i();
545
572
  let r = {
@@ -580,11 +607,11 @@ function q(e) {
580
607
  }
581
608
  return i();
582
609
  }
583
- var J = encodeURIComponent;
584
- function Y(e) {
610
+ var Y = encodeURIComponent;
611
+ function X(e) {
585
612
  return `${e}-${crypto.randomUUID()}`;
586
613
  }
587
- var X = class {
614
+ var Z = class {
588
615
  constructor(e) {
589
616
  this.requestControl = e;
590
617
  }
@@ -594,6 +621,26 @@ var X = class {
594
621
  let n = t.size == 0 ? "" : `?${t}`;
595
622
  return O(await this.request(`/v1/flows${n}`));
596
623
  }
624
+ async listVariables() {
625
+ let e = a(await this.request("/v1/variables"));
626
+ return s(e, ["variables", "version"]), e.version != 1 || !Array.isArray(e.variables) ? i() : {
627
+ variables: e.variables.map(k),
628
+ version: 1
629
+ };
630
+ }
631
+ async getVariable(e) {
632
+ return k(await this.request(`/v1/variables/${Y(e)}`));
633
+ }
634
+ async putVariable(e, t) {
635
+ return k(await this.request(`/v1/variables/${Y(e)}`, {
636
+ body: JSON.stringify({ value: t }),
637
+ method: "PUT"
638
+ }));
639
+ }
640
+ async deleteVariable(e) {
641
+ let t = a(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
642
+ if (s(t, ["version"]), t.version != 1) return i();
643
+ }
597
644
  async createFlow(e, t = `flow-${crypto.randomUUID()}`) {
598
645
  return D(await this.request("/v1/flows", {
599
646
  body: JSON.stringify({
@@ -605,10 +652,10 @@ var X = class {
605
652
  }));
606
653
  }
607
654
  async getFlow(e) {
608
- return D(await this.request(`/v1/flows/${J(e)}`));
655
+ return D(await this.request(`/v1/flows/${Y(e)}`));
609
656
  }
610
657
  async renameFlow(e, t) {
611
- return D(await this.request(`/v1/flows/${J(e)}`, {
658
+ return D(await this.request(`/v1/flows/${Y(e)}`, {
612
659
  body: JSON.stringify({
613
660
  name: t,
614
661
  version: 1
@@ -617,7 +664,7 @@ var X = class {
617
664
  }));
618
665
  }
619
666
  async deleteFlow(e) {
620
- return D(await this.request(`/v1/flows/${J(e)}`, { method: "DELETE" }));
667
+ return D(await this.request(`/v1/flows/${Y(e)}`, { method: "DELETE" }));
621
668
  }
622
669
  async listTriggerKeys(e) {
623
670
  let t = a(await this.request("/v1/trigger-keys", { signal: e }));
@@ -628,49 +675,49 @@ var X = class {
628
675
  return t.version != 1 || !Array.isArray(t.definitions) ? i() : t.definitions.map(_);
629
676
  }
630
677
  async getTriggerKey(e, t) {
631
- let n = a(await this.request(`/v1/trigger-keys/${J(e)}`, { signal: t }));
678
+ let n = a(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
632
679
  return n.version == 1 ? _(n.definition) : i();
633
680
  }
634
681
  async listFlowTriggerBindings(e) {
635
- let t = a(await this.request(`/v1/flows/${J(e)}/triggers`));
682
+ let t = a(await this.request(`/v1/flows/${Y(e)}/triggers`));
636
683
  return t.version != 1 || o(t.flowId) != e || !Array.isArray(t.bindings) ? i() : t.bindings.map(S);
637
684
  }
638
685
  async getFlowTriggerBinding(e, t) {
639
- return C(await this.request(`/v1/flows/${J(e)}/triggers/${J(t)}`));
686
+ return C(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
640
687
  }
641
688
  async listFlowTriggerActivities(e, t, n = {}) {
642
689
  let r = new URLSearchParams();
643
690
  n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
644
691
  let i = r.size == 0 ? "" : `?${r}`;
645
- return T(await this.request(`/v1/flows/${J(e)}/triggers/${J(t)}/activities${i}`));
692
+ return T(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
646
693
  }
647
694
  async pauseFlowTrigger(e, t) {
648
- return S(await this.request(`/v1/flows/${J(e)}/triggers/${J(t)}/pause`, {
695
+ return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
649
696
  body: JSON.stringify({ version: 1 }),
650
697
  method: "POST"
651
698
  }));
652
699
  }
653
700
  async resumeFlowTrigger(e, t) {
654
- return S(await this.request(`/v1/flows/${J(e)}/triggers/${J(t)}/resume`, {
701
+ return S(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
655
702
  body: JSON.stringify({ version: 1 }),
656
703
  method: "POST"
657
704
  }));
658
705
  }
659
706
  async testFlowPollTrigger(e, t) {
660
- return E(await this.request(`/v1/flows/${J(e)}/triggers/${J(t)}/test`, {
707
+ return E(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
661
708
  body: JSON.stringify({ version: 1 }),
662
709
  method: "POST"
663
710
  }));
664
711
  }
665
712
  async getDraft(e) {
666
- return A(await this.request(`/v1/flows/${J(e)}/draft`));
713
+ return j(await this.request(`/v1/flows/${Y(e)}/draft`));
667
714
  }
668
715
  async syncDraft(e, t) {
669
- let n = t == null ? "" : `?fromRevisionId=${J(t)}`;
670
- return M(await this.request(`/v1/flows/${J(e)}/draft/sync${n}`));
716
+ let n = t == null ? "" : `?fromRevisionId=${Y(t)}`;
717
+ return N(await this.request(`/v1/flows/${Y(e)}/draft/sync${n}`));
671
718
  }
672
719
  async getRevision(e, t) {
673
- return A(await this.request(`/v1/flows/${J(e)}/revisions/${J(t)}`));
720
+ return j(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
674
721
  }
675
722
  async listConnectorProviders(e) {
676
723
  let t = a(await this.request("/v1/connector/providers", { signal: e }));
@@ -683,11 +730,11 @@ var X = class {
683
730
  return await this.connectorActions({ q: e.trim() }, t);
684
731
  }
685
732
  async getConnectorAction(e, t) {
686
- let n = a(await this.request(`/v1/connector/actions/${J(e)}`, { signal: t }));
733
+ let n = a(await this.request(`/v1/connector/actions/${Y(e)}`, { signal: t }));
687
734
  return s(n, ["action", "version"]), n.version == 1 ? m(n.action) : i();
688
735
  }
689
736
  async listConnectorConnections(e, t) {
690
- let n = a(await this.request(`/v1/connector/connections/${J(e)}`, { signal: t }));
737
+ let n = a(await this.request(`/v1/connector/connections/${Y(e)}`, { signal: t }));
691
738
  return s(n, [
692
739
  "connections",
693
740
  "serviceId",
@@ -695,7 +742,7 @@ var X = class {
695
742
  ]), n.version != 1 || o(n.serviceId) != e || !Array.isArray(n.connections) ? i() : n.connections.map(u);
696
743
  }
697
744
  async createConnectorConnectionPage(e) {
698
- let t = a(await this.request(`/v1/connector/connections/${J(e)}/page`, {
745
+ let t = a(await this.request(`/v1/connector/connections/${Y(e)}/page`, {
699
746
  body: JSON.stringify({ version: 1 }),
700
747
  method: "POST"
701
748
  }));
@@ -708,7 +755,7 @@ var X = class {
708
755
  }
709
756
  }
710
757
  async changeDraft(e, t, n) {
711
- return j(await this.request(`/v1/flows/${J(e)}/draft/changes`, {
758
+ return M(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
712
759
  body: JSON.stringify({
713
760
  expectedRevisionId: t,
714
761
  operations: n,
@@ -718,7 +765,7 @@ var X = class {
718
765
  }));
719
766
  }
720
767
  async checkFlow(e, t) {
721
- return F(await this.request(`/v1/flows/${J(e)}/revisions/${J(t)}/check`, {
768
+ return I(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
722
769
  body: JSON.stringify({
723
770
  engineContract: "open-flow-engine/v1",
724
771
  version: 1
@@ -727,85 +774,85 @@ var X = class {
727
774
  }));
728
775
  }
729
776
  async getLive(e) {
730
- return I(await this.request(`/v1/flows/${J(e)}/live`));
777
+ return L(await this.request(`/v1/flows/${Y(e)}/live`));
731
778
  }
732
779
  async listPublications(e, t = {}) {
733
780
  let n = new URLSearchParams();
734
781
  t.cursor != null && n.set("cursor", t.cursor), t.limit != null && n.set("limit", String(t.limit)), t.includeTotal != null && n.set("includeTotal", String(t.includeTotal));
735
782
  let r = n.size == 0 ? "" : `?${n}`;
736
- return L(await this.request(`/v1/flows/${J(e)}/publications${r}`));
783
+ return R(await this.request(`/v1/flows/${Y(e)}/publications${r}`));
737
784
  }
738
785
  async createDraftRun(e, t, n = {}) {
739
- let r = V(await this.request(`/v1/flows/${J(e)}/revisions/${J(t)}/runs`, {
786
+ let r = H(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
740
787
  body: JSON.stringify({
741
788
  engineContract: "open-flow-engine/v1",
742
789
  inputs: n.inputs ?? {},
743
790
  version: 1
744
791
  }),
745
- headers: { "idempotency-key": n.idempotencyKey ?? Y("run") },
792
+ headers: { "idempotency-key": n.idempotencyKey ?? X("run") },
746
793
  method: "POST"
747
794
  }));
748
795
  return r.source == "draft" ? r : i();
749
796
  }
750
797
  async createLiveRun(e, t = {}) {
751
- let n = V(await this.request("/v1/runs", {
798
+ let n = H(await this.request("/v1/runs", {
752
799
  body: JSON.stringify({
753
800
  inputs: t.inputs ?? {},
754
801
  publicationId: e,
755
802
  version: 1
756
803
  }),
757
- headers: { "idempotency-key": t.idempotencyKey ?? Y("run") },
804
+ headers: { "idempotency-key": t.idempotencyKey ?? X("run") },
758
805
  method: "POST"
759
806
  }));
760
807
  return n.source == "live" ? n : i();
761
808
  }
762
809
  async publishFlow(e, t, n, r = {}) {
763
- return N(await this.request(`/v1/flows/${J(e)}/revisions/${J(t)}/publications`, {
810
+ return P(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
764
811
  body: JSON.stringify({
765
812
  engineContract: "open-flow-engine/v1",
766
813
  expectedLivePublicationId: n,
767
814
  version: 1
768
815
  }),
769
- headers: { "idempotency-key": r.idempotencyKey ?? Y("publication") },
816
+ headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
770
817
  method: "POST"
771
818
  }));
772
819
  }
773
820
  async rollbackFlow(e, t, n, r = {}) {
774
- return N(await this.request(`/v1/flows/${J(e)}/publications/${J(t)}/rollback`, {
821
+ return P(await this.request(`/v1/flows/${Y(e)}/publications/${Y(t)}/rollback`, {
775
822
  body: JSON.stringify({
776
823
  expectedLivePublicationId: n,
777
824
  version: 1
778
825
  }),
779
- headers: { "idempotency-key": r.idempotencyKey ?? Y("publication") },
826
+ headers: { "idempotency-key": r.idempotencyKey ?? X("publication") },
780
827
  method: "POST"
781
828
  }));
782
829
  }
783
830
  async getRun(e) {
784
- return V(await this.request(`/v1/runs/${J(e)}`));
831
+ return H(await this.request(`/v1/runs/${Y(e)}`));
785
832
  }
786
833
  async listRuns(e, t = {}) {
787
834
  let n = new URLSearchParams();
788
835
  t.cursor != null && n.set("cursor", t.cursor), t.limit != null && n.set("limit", String(t.limit)), t.status != null && n.set("status", t.status);
789
836
  let r = n.size == 0 ? "" : `?${n}`;
790
- return H(await this.request(`/v1/flows/${J(e)}/runs${r}`));
837
+ return U(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
791
838
  }
792
839
  async getRunEvents(e, t = {}) {
793
840
  let n = new URLSearchParams();
794
841
  t.after != null && n.set("after", String(t.after)), t.limit != null && n.set("limit", String(t.limit));
795
842
  let r = n.size == 0 ? "" : `?${n}`;
796
- return G(await this.request(`/v1/runs/${J(e)}/events${r}`));
843
+ return K(await this.request(`/v1/runs/${Y(e)}/events${r}`));
797
844
  }
798
845
  async getRunResult(e) {
799
- return q(await this.request(`/v1/runs/${J(e)}/result`));
846
+ return J(await this.request(`/v1/runs/${Y(e)}/result`));
800
847
  }
801
848
  async cancelRun(e) {
802
- return K(await this.request(`/v1/runs/${J(e)}/cancel`, {
849
+ return q(await this.request(`/v1/runs/${Y(e)}/cancel`, {
803
850
  body: JSON.stringify({ version: 1 }),
804
851
  method: "POST"
805
852
  }));
806
853
  }
807
854
  async connectorActions(e, t) {
808
- let n = Object.entries(e).map(([e, t]) => `${J(e)}=${J(t)}`).join("&"), r = n == "" ? "" : `?${n}`, o = a(await this.request(`/v1/connector/actions${r}`, { signal: t }));
855
+ let n = Object.entries(e).map(([e, t]) => `${Y(e)}=${Y(t)}`).join("&"), r = n == "" ? "" : `?${n}`, o = a(await this.request(`/v1/connector/actions${r}`, { signal: t }));
809
856
  return s(o, ["actions", "version"]), o.version != 1 || !Array.isArray(o.actions) ? i() : o.actions.map(m);
810
857
  }
811
858
  async request(e, t = {}) {
@@ -828,4 +875,4 @@ var X = class {
828
875
  }
829
876
  };
830
877
  //#endregion
831
- export { r as ApiError, X as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
878
+ export { r as ApiError, Z as ControlClient, e as controlErrorCode, t as controlErrorMetadata };
@@ -1,8 +1,8 @@
1
- import type { CodeModule, FlowDocument, Graph, InputPort, JsonValue, OutputMapping, Port, RevisionContent } from '@oomol-lab/open-flow/flow-change';
1
+ import type { CodeModule, FlowDocument, Graph, Group, InputPort, JsonValue, OutputMapping, Port, RevisionContent } from '@oomol-lab/open-flow/flow-change';
2
2
  export declare const maxJsonDepth = 64;
3
3
  export declare function canonicalJsonBytes(value: JsonValue): Uint8Array;
4
4
  export declare function digestBytes(bytes: Uint8Array): Promise<string>;
5
- export declare function canonicalPorts(value: readonly (InputPort | Port)[]): JsonValue;
5
+ export declare function canonicalPorts(value: readonly (InputPort | Port | Group)[]): JsonValue;
6
6
  export declare function canonicalOutputs(value: readonly (OutputMapping & Port)[]): JsonValue;
7
7
  export declare function canonicalGraph(value: Graph): JsonValue;
8
8
  export declare function canonicalTask(task: FlowDocument['tasks'][string]): JsonValue;
@@ -17,12 +17,15 @@ function a(e) {
17
17
  return Object.keys(e).toSorted().map((t) => [t, e[t]]);
18
18
  }
19
19
  function o(e) {
20
- return {
20
+ return "handle" in e ? {
21
21
  ...e.description == null ? {} : { description: e.description },
22
22
  handle: e.handle,
23
23
  jsonSchema: e.jsonSchema,
24
24
  nullable: e.nullable,
25
25
  ...Object.hasOwn(e, "value") ? { value: e.value } : {}
26
+ } : e.collapsed == null ? { group: e.group } : {
27
+ collapsed: e.collapsed,
28
+ group: e.group
26
29
  };
27
30
  }
28
31
  function s(e) {
@@ -12,6 +12,7 @@ export interface SemanticClosure {
12
12
  readonly digest: string;
13
13
  }
14
14
  export declare function flowClosure(content: RevisionContent): Promise<SemanticClosure>;
15
+ export declare function variableBindings(revision: RevisionContent, bindingIds: Iterable<string>): Readonly<Record<string, string>>;
15
16
  export interface Diagnostic {
16
17
  readonly code: string;
17
18
  readonly column: number;
@@ -26,6 +27,7 @@ export interface FlowValidation {
26
27
  }
27
28
  export declare function triggerPayloadSchema(trigger: TriggerNode): JsonValue;
28
29
  export declare function matchesSchema(value: JsonValue, schema: JsonValue): boolean;
30
+ export declare function variableInputCompatible(jsonSchema: JsonValue): boolean;
29
31
  export type FlowInputsValidation = 'invalid' | 'valid';
30
32
  export declare function validateFlowInputs(revision: RevisionContent, value: unknown): FlowInputsValidation;
31
33
  export declare function validateModules(revision: RevisionContent, moduleIds: readonly string[], engine: EngineContract): readonly Diagnostic[];