@oomol-lab/open-flow 0.1.0-beta.30 → 0.1.0-beta.31

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.
@@ -4489,7 +4489,10 @@ var Ys = k(M([A({
4489
4489
  }))
4490
4490
  })),
4491
4491
  defaultOutput: z.optional()
4492
- }, dc = { prompt: z }, fc = {
4492
+ }, dc = {
4493
+ inputDefinitions: k(V),
4494
+ prompt: z
4495
+ }, fc = {
4493
4496
  bodyFields: k(V),
4494
4497
  options: A({
4495
4498
  allowedMethods: Xs.optional(),
@@ -4571,13 +4574,11 @@ var Ys = k(M([A({
4571
4574
  j({
4572
4575
  ...gc,
4573
4576
  kind: F("approval"),
4574
- input: V,
4575
4577
  ...dc
4576
4578
  }).omit({ timeoutMs: !0 }),
4577
4579
  j({
4578
4580
  ...gc,
4579
4581
  kind: F("wait"),
4580
- input: V,
4581
4582
  ...dc
4582
4583
  }).omit({ timeoutMs: !0 }),
4583
4584
  A({
@@ -4645,16 +4646,16 @@ var Ys = k(M([A({
4645
4646
  graph: xc,
4646
4647
  subflows: N(z, bc.extend({ graph: xc })),
4647
4648
  tasks: N(z, lc)
4648
- }), Tc = A({
4649
+ });
4650
+ A({
4649
4651
  modelVersion: M([F(2), F(3)]),
4650
4652
  document: wc,
4651
4653
  modules: N(z, Cc)
4652
- });
4653
- Tc.extend({ modelVersion: F(3) }), Tc.extend({
4654
+ }).extend({
4654
4655
  kind: F("open-flow-flow-revision"),
4655
4656
  version: F(1)
4656
4657
  });
4657
- var Ec = {
4658
+ var Tc = {
4658
4659
  "binding.create": {
4659
4660
  bindingId: z,
4660
4661
  binding: Sc
@@ -4817,16 +4818,16 @@ var Ec = {
4817
4818
  value: z
4818
4819
  }
4819
4820
  };
4820
- k(M([...new Map(Object.entries(Ec).map(([e, t]) => [e, t instanceof w ? t : A({
4821
+ k(M([...new Map(Object.entries(Tc).map(([e, t]) => [e, t instanceof w ? t : A({
4821
4822
  kind: F(e),
4822
4823
  ...t
4823
4824
  })])).values()])).min(1), new TextEncoder();
4824
- var Dc = N(T(), $o()), Oc = A({
4825
+ var Ec = N(T(), $o()), Dc = A({
4825
4826
  jsonSchema: $o(),
4826
4827
  nullable: O(),
4827
4828
  value: $o().optional(),
4828
4829
  description: T().optional()
4829
- }).strict(), kc = N(T(), Oc), Ac = M([A({
4830
+ }).strict(), Oc = N(T(), Dc), kc = M([A({
4830
4831
  kind: F("value"),
4831
4832
  value: $o()
4832
4833
  }).strict(), A({
@@ -4836,36 +4837,36 @@ var Dc = N(T(), $o()), Oc = A({
4836
4837
  nodeId: T(),
4837
4838
  output: T()
4838
4839
  }).strict())
4839
- }).strict()]), jc = {
4840
+ }).strict()]), Ac = {
4840
4841
  name: T().optional(),
4841
4842
  description: T().optional(),
4842
4843
  icon: T().optional()
4843
- }, Mc = M([
4844
+ }, jc = M([
4844
4845
  A({
4845
- ...jc,
4846
+ ...Ac,
4846
4847
  kind: F("cron"),
4847
4848
  cronTimes: k($o())
4848
4849
  }).strict(),
4849
4850
  A({
4850
- ...jc,
4851
+ ...Ac,
4851
4852
  kind: F("manual")
4852
4853
  }).strict(),
4853
4854
  A({
4854
- ...jc,
4855
+ ...Ac,
4855
4856
  kind: F("task"),
4856
4857
  concurrency: F(1).optional(),
4857
- inputs: N(T(), Ac),
4858
+ inputs: N(T(), kc),
4858
4859
  task: A({
4859
4860
  name: T(),
4860
4861
  moduleId: T(),
4861
- inputs: kc,
4862
- outputs: N(T(), Oc.omit({ value: !0 }))
4862
+ inputs: Oc,
4863
+ outputs: N(T(), Dc.omit({ value: !0 }))
4863
4864
  }).strict()
4864
4865
  }).strict()
4865
4866
  ]);
4866
4867
  A({
4867
4868
  name: T(),
4868
- graph: A({ nodes: N(T(), Mc) }).strict()
4869
+ graph: A({ nodes: N(T(), jc) }).strict()
4869
4870
  }).strict(), A({
4870
4871
  kind: F("open-flow-project-revision"),
4871
4872
  version: F(1),
@@ -4876,15 +4877,15 @@ A({
4876
4877
  imports: k(T())
4877
4878
  }).strict()),
4878
4879
  document: A({
4879
- bindings: Dc,
4880
- flows: Dc,
4881
- subflows: Dc,
4882
- tasks: Dc
4880
+ bindings: Ec,
4881
+ flows: Ec,
4882
+ subflows: Ec,
4883
+ tasks: Ec
4883
4884
  }).strict()
4884
4885
  }).strict();
4885
4886
  //#endregion
4886
4887
  //#region src/control/common/api.ts
4887
- function Nc(e) {
4888
+ function Mc(e) {
4888
4889
  let t = Hs(e), n = Us(t.sequence);
4889
4890
  if (n < 0) return L();
4890
4891
  let r = {
@@ -4912,7 +4913,7 @@ function Nc(e) {
4912
4913
  payload: {
4913
4914
  flowId: R(i.flowId),
4914
4915
  scopeId: R(i.scopeId),
4915
- progress: Pc(i.progress)
4916
+ progress: Nc(i.progress)
4916
4917
  }
4917
4918
  };
4918
4919
  case "run.waiting": return Array.isArray(i.waitIds) ? {
@@ -4932,11 +4933,12 @@ function Nc(e) {
4932
4933
  };
4933
4934
  case "run.resolved": {
4934
4935
  let e = i.action;
4935
- return e !== "approve" && e !== "continue" && e !== "reject" ? L() : {
4936
+ return e !== "approve" && e !== "continue" && e !== "reject" || i.comment !== null && typeof i.comment != "string" ? L() : {
4936
4937
  ...r,
4937
4938
  kind: a,
4938
4939
  payload: {
4939
4940
  action: e,
4941
+ comment: i.comment,
4940
4942
  resolvedAt: R(i.resolvedAt),
4941
4943
  waitId: R(i.waitId)
4942
4944
  }
@@ -5020,7 +5022,7 @@ function Nc(e) {
5020
5022
  kind: a,
5021
5023
  payload: {
5022
5024
  ...e,
5023
- progress: Pc(i.progress)
5025
+ progress: Nc(i.progress)
5024
5026
  }
5025
5027
  };
5026
5028
  case "node.artifact": {
@@ -5046,7 +5048,7 @@ function Nc(e) {
5046
5048
  default: return L();
5047
5049
  }
5048
5050
  }
5049
- function Pc(e) {
5051
+ function Nc(e) {
5050
5052
  return typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 100 ? e : L();
5051
5053
  }
5052
5054
  //#endregion
@@ -5083,7 +5085,7 @@ function Z(e, t, n = {}) {
5083
5085
  headers: r
5084
5086
  }));
5085
5087
  }
5086
- function Fc(e, t, n) {
5088
+ function Pc(e, t, n) {
5087
5089
  return Z(e, "/v1/flows", {
5088
5090
  body: JSON.stringify({
5089
5091
  name: t,
@@ -5094,9 +5096,9 @@ function Fc(e, t, n) {
5094
5096
  });
5095
5097
  }
5096
5098
  async function Q(e, t, n) {
5097
- return Y(await Fc(e, t, n), 201, "Create Flow");
5099
+ return Y(await Pc(e, t, n), 201, "Create Flow");
5098
5100
  }
5099
- function Ic(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
5101
+ function Fc(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
5100
5102
  return Z(e, `/v1/flows/${encodeURIComponent(t)}/draft/changes`, {
5101
5103
  body: JSON.stringify({
5102
5104
  expectedRevisionId: n,
@@ -5108,7 +5110,7 @@ function Ic(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
5108
5110
  });
5109
5111
  }
5110
5112
  function $(e, t, n, r = "marker", i) {
5111
- return Ic(e, t, n, [{
5113
+ return Fc(e, t, n, [{
5112
5114
  kind: "graph.node.create",
5113
5115
  node: {
5114
5116
  inputs: {},
@@ -5125,8 +5127,8 @@ function $(e, t, n, r = "marker", i) {
5125
5127
  target: { kind: "flow" }
5126
5128
  }], i);
5127
5129
  }
5128
- async function Lc(e, t, n) {
5129
- return Rc(await Y(await Ic(e, t, n, [{
5130
+ async function Ic(e, t, n) {
5131
+ return Lc(await Y(await Fc(e, t, n, [{
5130
5132
  kind: "graph.node.create",
5131
5133
  node: {
5132
5134
  kind: "manual",
@@ -5136,10 +5138,10 @@ async function Lc(e, t, n) {
5136
5138
  target: { kind: "flow" }
5137
5139
  }]), 200, "Add manual trigger"), "Manual trigger Revision");
5138
5140
  }
5139
- function Rc(e, t) {
5141
+ function Lc(e, t) {
5140
5142
  return J(K(e.revision, `${t} revision`).revisionId, `${t} revisionId`);
5141
5143
  }
5142
- function zc(e, t, n, r, i) {
5144
+ function Rc(e, t, n, r, i) {
5143
5145
  return Z(e, `/v1/flows/${encodeURIComponent(t)}/revisions/${encodeURIComponent(n)}/publications`, {
5144
5146
  body: JSON.stringify({
5145
5147
  engineContract: U,
@@ -5150,7 +5152,7 @@ function zc(e, t, n, r, i) {
5150
5152
  method: "POST"
5151
5153
  });
5152
5154
  }
5153
- async function Bc(e, t, n, r) {
5155
+ async function zc(e, t, n, r) {
5154
5156
  let i = await Y(t, n, r), a = J(i.operationId, `${r} operationId`);
5155
5157
  for (let t = 0; i.status == "pending" && t < 100; t += 1) await new Promise((e) => setTimeout(e, 10)), i = await Y(await Z(e, `/v1/flows/${J(i.flowId, `${r} flowId`)}/publish-operations/${a}`), 200, `${r} operation`);
5156
5158
  G(i.status, "succeeded", `${r} terminal status`);
@@ -5160,7 +5162,7 @@ async function Bc(e, t, n, r) {
5160
5162
  publication: s
5161
5163
  };
5162
5164
  }
5163
- function Vc(e, t, n, r, i) {
5165
+ function Bc(e, t, n, r, i) {
5164
5166
  return Z(e, `/v1/flows/${encodeURIComponent(t)}/publications/${encodeURIComponent(n)}/rollback`, {
5165
5167
  body: JSON.stringify({
5166
5168
  expectedLivePublicationId: r,
@@ -5170,7 +5172,7 @@ function Vc(e, t, n, r, i) {
5170
5172
  method: "POST"
5171
5173
  });
5172
5174
  }
5173
- function Hc(e, t, n) {
5175
+ function Vc(e, t, n) {
5174
5176
  return Z(e, "/v1/runs", {
5175
5177
  body: JSON.stringify({
5176
5178
  inputs: {},
@@ -5185,11 +5187,11 @@ function Hc(e, t, n) {
5185
5187
  method: "POST"
5186
5188
  });
5187
5189
  }
5188
- var Uc = [
5190
+ var Hc = [
5189
5191
  {
5190
5192
  name: "admits simultaneous retries as one Run and preserves its Trigger identity",
5191
5193
  async verify(e) {
5192
- let t = await Q(e, "Concurrent Run", "concurrent-run-flow"), n = J(t.flowId, "Flow ID"), r = await Lc(e, n, J(t.draftRevisionId, "Revision ID")), i = (t = {}) => Z(e, `/v1/flows/${n}/revisions/${r}/runs`, {
5194
+ let t = await Q(e, "Concurrent Run", "concurrent-run-flow"), n = J(t.flowId, "Flow ID"), r = await Ic(e, n, J(t.draftRevisionId, "Revision ID")), i = (t = {}) => Z(e, `/v1/flows/${n}/revisions/${r}/runs`, {
5193
5195
  method: "POST",
5194
5196
  headers: { "idempotency-key": "concurrent-run" },
5195
5197
  body: JSON.stringify({
@@ -5221,7 +5223,7 @@ var Uc = [
5221
5223
  {
5222
5224
  name: "deduplicates simultaneous creation and lost-response retries",
5223
5225
  async verify(e) {
5224
- let t = await Promise.all(Array.from({ length: 4 }, () => Fc(e, "Concurrent Flow", "concurrent-create")));
5226
+ let t = await Promise.all(Array.from({ length: 4 }, () => Pc(e, "Concurrent Flow", "concurrent-create")));
5225
5227
  G(t.map((e) => e.status).toSorted(), [
5226
5228
  200,
5227
5229
  200,
@@ -5230,7 +5232,7 @@ var Uc = [
5230
5232
  ], "One creation commits");
5231
5233
  let n = await Promise.all(t.map((e) => e.json()));
5232
5234
  for (let e of n) G(e, n[0], "Concurrent replay identity");
5233
- G(await Y(await Fc(e, "Concurrent Flow", "concurrent-create"), 200, "Retry lost creation response"), n[0], "Lost-response replay"), await X(await Fc(e, "Different Flow", "concurrent-create"), 409, "flow.conflict", "Reject changed retry");
5235
+ G(await Y(await Pc(e, "Concurrent Flow", "concurrent-create"), 200, "Retry lost creation response"), n[0], "Lost-response replay"), await X(await Pc(e, "Different Flow", "concurrent-create"), 409, "flow.conflict", "Reject changed retry");
5234
5236
  }
5235
5237
  },
5236
5238
  {
@@ -5289,7 +5291,7 @@ var Uc = [
5289
5291
  name: "creates, replays, lists, reads, renames, and retires a Flow",
5290
5292
  async verify(e) {
5291
5293
  let t = await Q(e, "Control flow", "flow-lifecycle"), n = J(t.flowId, "Created Flow flowId"), r = J(t.draftRevisionId, "Created Flow draftRevisionId");
5292
- G(t.name, "Control flow", "Created Flow name"), G(t.status, "active", "Created Flow status"), G(await Y(await Fc(e, "Control flow", "flow-lifecycle"), 200, "Replay Flow"), t, "Replayed Flow"), await X(await Fc(e, "Different flow", "flow-lifecycle"), 409, "flow.conflict", "Conflicting Flow"), G(await Y(await Z(e, `/v1/flows/${n}`), 200, "Read Flow"), t, "Read Flow");
5294
+ G(t.name, "Control flow", "Created Flow name"), G(t.status, "active", "Created Flow status"), G(await Y(await Pc(e, "Control flow", "flow-lifecycle"), 200, "Replay Flow"), t, "Replayed Flow"), await X(await Pc(e, "Different flow", "flow-lifecycle"), 409, "flow.conflict", "Conflicting Flow"), G(await Y(await Z(e, `/v1/flows/${n}`), 200, "Read Flow"), t, "Read Flow");
5293
5295
  let i = await Y(await Z(e, "/v1/flows?includeTotal=true"), 200, "List Flows");
5294
5296
  G(i.flows, [t], "Listed Flows"), G(i.total, 1, "Flow total");
5295
5297
  let a = await Q(e, "Second control flow", "flow-lifecycle-second"), o = await Y(await Z(e, "/v1/flows?limit=1"), 200, "List first Flow page");
@@ -5307,8 +5309,8 @@ var Uc = [
5307
5309
  {
5308
5310
  name: "commits immutable Draft Revisions for one Flow",
5309
5311
  async verify(e) {
5310
- let t = await Q(e, "Draft flow", "draft-flow"), n = J(t.flowId, "Draft Flow flowId"), r = J(t.draftRevisionId, "Draft Flow revisionId"), i = await Y(await $(e, n, r, "marker", "draft-change"), 200, "Change Draft"), a = Rc(i, "Changed Draft");
5311
- G(K(i.revision, "Changed Draft revision").parentRevisionId, r, "Changed Draft parent"), G(await Y(await $(e, n, r, "marker", "draft-change"), 200, "Replay Draft change"), i, "Replayed Draft change"), await X(await $(e, n, r, "another-marker", "draft-change"), 409, "flow.conflict", "Conflicting Draft change replay"), await X(await $(e, n, a, "marker"), 400, "flow.invalid", "Duplicate Draft Node", "A Node with this ID already exists"), await X(await Ic(e, n, a, [{
5312
+ let t = await Q(e, "Draft flow", "draft-flow"), n = J(t.flowId, "Draft Flow flowId"), r = J(t.draftRevisionId, "Draft Flow revisionId"), i = await Y(await $(e, n, r, "marker", "draft-change"), 200, "Change Draft"), a = Lc(i, "Changed Draft");
5313
+ G(K(i.revision, "Changed Draft revision").parentRevisionId, r, "Changed Draft parent"), G(await Y(await $(e, n, r, "marker", "draft-change"), 200, "Replay Draft change"), i, "Replayed Draft change"), await X(await $(e, n, r, "another-marker", "draft-change"), 409, "flow.conflict", "Conflicting Draft change replay"), await X(await $(e, n, a, "marker"), 400, "flow.invalid", "Duplicate Draft Node", "A Node with this ID already exists"), await X(await Fc(e, n, a, [{
5312
5314
  before: [{
5313
5315
  handle: "ready",
5314
5316
  jsonSchema: { type: "boolean" },
@@ -5343,7 +5345,7 @@ var Uc = [
5343
5345
  version: 1
5344
5346
  })
5345
5347
  }), 200, "Update editor Presentation"), a = await Y(await Z(e, `/v1/flows/${n}/editor`), 200, "Read editor");
5346
- G(a.version, 1, "Editor version"), G(K(a.flow, "Editor Flow").draftRevisionId, Rc(r, "Editor change"), "Editor Draft head");
5348
+ G(a.version, 1, "Editor version"), G(K(a.flow, "Editor Flow").draftRevisionId, Lc(r, "Editor change"), "Editor Draft head");
5347
5349
  for (let t of [
5348
5350
  "flow",
5349
5351
  "draft",
@@ -5393,7 +5395,7 @@ var Uc = [
5393
5395
  {
5394
5396
  name: "admits a Draft entry while unrelated branches remain invalid",
5395
5397
  async verify(e) {
5396
- let t = await Q(e, "Partial Draft", "partial-draft"), n = J(t.flowId, "Partial Flow identity"), r = Rc(await Y(await Ic(e, n, await Lc(e, n, J(t.draftRevisionId, "Partial Draft identity")), [
5398
+ let t = await Q(e, "Partial Draft", "partial-draft"), n = J(t.flowId, "Partial Flow identity"), r = Lc(await Y(await Fc(e, n, await Ic(e, n, J(t.draftRevisionId, "Partial Draft identity")), [
5397
5399
  {
5398
5400
  kind: "graph.node.create",
5399
5401
  nodeId: "other",
@@ -5454,13 +5456,13 @@ var Uc = [
5454
5456
  version: 2
5455
5457
  })
5456
5458
  });
5457
- await Y(await a("start"), 202, "Run valid entry"), await X(await a("other"), 400, "flow.invalid", "Reject invalid entry branch"), await X(await zc(e, n, r, null, "partial-publish"), 400, "flow.invalid", "Reject incomplete publication");
5459
+ await Y(await a("start"), 202, "Run valid entry"), await X(await a("other"), 400, "flow.invalid", "Reject invalid entry branch"), await X(await Rc(e, n, r, null, "partial-publish"), 400, "flow.invalid", "Reject incomplete publication");
5458
5460
  }
5459
5461
  },
5460
5462
  {
5461
5463
  name: "validates, admits, lists, and cancels one Draft Run",
5462
5464
  async verify(e) {
5463
- let t = await Q(e, "Run flow", "run-flow"), n = J(t.flowId, "Run Flow flowId"), r = await Lc(e, n, J(t.draftRevisionId, "Run Flow revisionId"));
5465
+ let t = await Q(e, "Run flow", "run-flow"), n = J(t.flowId, "Run Flow flowId"), r = await Ic(e, n, J(t.draftRevisionId, "Run Flow revisionId"));
5464
5466
  G((await Y(await Z(e, `/v1/flows/${n}/revisions/${r}/check`, {
5465
5467
  body: JSON.stringify({
5466
5468
  engineContract: U,
@@ -5554,15 +5556,15 @@ var Uc = [
5554
5556
  name: "pauses, resolves, resumes, and cancels waiting Draft Runs",
5555
5557
  runtime: !0,
5556
5558
  async verify(e) {
5557
- let t = await Q(e, "Wait flow", "wait-flow"), n = J(t.flowId, "Wait Flow flowId"), r = `/v1/flows/${n}/revisions/${Rc(await Y(await Ic(e, n, await Lc(e, n, J(t.draftRevisionId, "Wait Flow revisionId")), [{
5559
+ let t = await Q(e, "Wait flow", "wait-flow"), n = J(t.flowId, "Wait Flow flowId"), r = `/v1/flows/${n}/revisions/${Lc(await Y(await Fc(e, n, await Ic(e, n, J(t.draftRevisionId, "Wait Flow revisionId")), [{
5558
5560
  kind: "graph.node.create",
5559
5561
  node: {
5560
- input: {
5562
+ inputDefinitions: [{
5561
5563
  handle: "value",
5562
5564
  jsonSchema: {},
5563
5565
  nullable: !0,
5564
5566
  value: null
5565
- },
5567
+ }],
5566
5568
  inputs: { value: {
5567
5569
  kind: "value",
5568
5570
  value: { request: 1 }
@@ -5600,7 +5602,7 @@ var Uc = [
5600
5602
  let l = J(c.waitId, "Wait id");
5601
5603
  G(q((await Y(await Z(e, `/v1/flows/${n}/runs?pendingWait=true`), 200, "List waiting Runs")).runs, "Waiting Runs").map((e) => K(e, "Waiting Run").runId), [o], "Waiting Run list");
5602
5604
  let u = await Y(await Z(e, `/v1/runs/${o}/events`), 200, "Read waiting Run events");
5603
- for (let e of q(u.events, "Run events")) Nc(e);
5605
+ for (let e of q(u.events, "Run events")) Mc(e);
5604
5606
  G(u.done, !1, "Waiting events done"), q(u.events, "Waiting events").some((e) => K(e, "Waiting event").kind == "wait.created") || W("Waiting Run must contain wait.created."), await X(await Z(e, `/v1/runs/${o}/result`), 409, "run.not-terminal", "Read waiting Run result");
5605
5607
  let d = `/v1/runs/${o}/waits/${l}/resolve`, f = (t) => Z(e, d, {
5606
5608
  body: JSON.stringify({
@@ -5619,7 +5621,7 @@ var Uc = [
5619
5621
  let te = await Y(await f("approve"), 200, "Replay approved Wait");
5620
5622
  G(te.resolutionAccepted, !0, "Replayed resolution"), G(te.status, "completed", "Replayed terminal status");
5621
5623
  let ne = await Y(await Z(e, `/v1/runs/${o}/events`), 200, "Read resumed Run events");
5622
- for (let e of q(ne.events, "Run events")) Nc(e);
5624
+ for (let e of q(ne.events, "Run events")) Mc(e);
5623
5625
  G(q(ne.events, "Completed events").filter((e) => K(e, "Completed event").kind == "run.resolved").length, 1, "Resolved event count");
5624
5626
  let re = await i("wait-run-cancel", "Create cancelable Wait Run"), ie = J(re.runId, "Cancelable Wait Run id"), ae = re;
5625
5627
  for (let t = 0; q(ae.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), ae = await Y(await Z(e, `/v1/runs/${ie}`), 200, "Read cancelable Wait Run");
@@ -5674,11 +5676,11 @@ var Uc = [
5674
5676
  await X(await c(o, "unsupported-engine/v1", "unsupported-run"), 409, "engine.unsupported", "Run unsupported Engine"), await X(await c(n, U, "missing-revision-run"), 404, "flow.not-found", "Run missing Revision");
5675
5677
  }
5676
5678
  }
5677
- ], Wc = [
5679
+ ], Uc = [
5678
5680
  {
5679
5681
  name: "controls Live admission independently from publishing and Draft testing",
5680
5682
  async verify(e) {
5681
- let t = await Q(e, "Enabled flow", "enabled-flow"), n = J(t.flowId, "Flow id"), r = await Lc(e, n, J(t.draftRevisionId, "Draft id")), i = (t, r) => Z(e, `/v1/flows/${n}/enabled`, {
5683
+ let t = await Q(e, "Enabled flow", "enabled-flow"), n = J(t.flowId, "Flow id"), r = await Ic(e, n, J(t.draftRevisionId, "Draft id")), i = (t, r) => Z(e, `/v1/flows/${n}/enabled`, {
5682
5684
  method: "PUT",
5683
5685
  body: JSON.stringify({
5684
5686
  enabled: t,
@@ -5687,12 +5689,12 @@ var Uc = [
5687
5689
  })
5688
5690
  });
5689
5691
  await X(await i(!0, "missing"), 409, "flow.conflict", "Cannot enable unpublished Flow");
5690
- let a = J((await Bc(e, await zc(e, n, r, null, "enable-first"), 202, "Publish")).publication.publicationId, "Publication id"), o = await Y(await i(!1, a), 200, "Disable");
5692
+ let a = J((await zc(e, await Rc(e, n, r, null, "enable-first"), 202, "Publish")).publication.publicationId, "Publication id"), o = await Y(await i(!1, a), 200, "Disable");
5691
5693
  G(o.live, {
5692
5694
  enabled: !1,
5693
5695
  publicationId: a,
5694
5696
  revisionId: r
5695
- }, "Disabled summary"), G((await Y(await Z(e, "/v1/flows"), 200, "List disabled Flow")).flows, [o], "List includes Live state"), G((await Y(await Z(e, `/v1/flows/${n}/live`), 200, "Disabled Live")).status, "suspended", "Disabled Live status"), await X(await Hc(e, a, "disabled-run"), 412, "live.conflict", "Disabled Live rejects Run"), await Y(await Z(e, `/v1/flows/${n}/revisions/${r}/runs`, {
5697
+ }, "Disabled summary"), G((await Y(await Z(e, "/v1/flows"), 200, "List disabled Flow")).flows, [o], "List includes Live state"), G((await Y(await Z(e, `/v1/flows/${n}/live`), 200, "Disabled Live")).status, "suspended", "Disabled Live status"), await X(await Vc(e, a, "disabled-run"), 412, "live.conflict", "Disabled Live rejects Run"), await Y(await Z(e, `/v1/flows/${n}/revisions/${r}/runs`, {
5696
5698
  method: "POST",
5697
5699
  headers: { "idempotency-key": "disabled-draft" },
5698
5700
  body: JSON.stringify({
@@ -5705,17 +5707,17 @@ var Uc = [
5705
5707
  version: 2
5706
5708
  })
5707
5709
  }), 202, "Disabled Flow permits Draft test");
5708
- let s = J((await Bc(e, await zc(e, n, r, a, "enable-next"), 202, "Publish disabled Flow")).publication.publicationId, "Next Publication id");
5709
- G(K((await Y(await Z(e, `/v1/flows/${n}`), 200, "Read Flow")).live, "Live").enabled, !1, "Publish preserves disabled state"), await X(await i(!0, a), 409, "flow.conflict", "Stale switch rejects"), await Y(await i(!0, s), 200, "Enable"), await Y(await Hc(e, s, "enabled-run"), 202, "Enabled Live accepts Run");
5710
+ let s = J((await zc(e, await Rc(e, n, r, a, "enable-next"), 202, "Publish disabled Flow")).publication.publicationId, "Next Publication id");
5711
+ G(K((await Y(await Z(e, `/v1/flows/${n}`), 200, "Read Flow")).live, "Live").enabled, !1, "Publish preserves disabled state"), await X(await i(!0, a), 409, "flow.conflict", "Stale switch rejects"), await Y(await i(!0, s), 200, "Enable"), await Y(await Vc(e, s, "enabled-run"), 202, "Enabled Live accepts Run");
5710
5712
  }
5711
5713
  },
5712
5714
  {
5713
5715
  name: "publishes one immutable Flow with idempotent Live CAS",
5714
5716
  async verify(e) {
5715
- let t = await Q(e, "Publication flow", "publication-flow"), n = J(t.flowId, "Publication Flow flowId"), r = await Lc(e, n, J(t.draftRevisionId, "Publication Flow revisionId"));
5717
+ let t = await Q(e, "Publication flow", "publication-flow"), n = J(t.flowId, "Publication Flow flowId"), r = await Ic(e, n, J(t.draftRevisionId, "Publication Flow revisionId"));
5716
5718
  G((await Y(await Z(e, `/v1/flows/${n}/live`), 200, "Read Live")).status, "not-published", "Initial Live status");
5717
- let i = () => zc(e, n, r, null, "publication-first"), a = await Bc(e, await i(), 202, "Publish Flow"), o = a.publication, s = J(o.publicationId, "Publication id");
5718
- G(await Y(await i(), 202, "Replay Publish"), a.operation, "Replayed Publish operation"), await X(await zc(e, n, r, s, "publication-first"), 409, "publication.conflict", "Conflicting replay");
5719
+ let i = () => Rc(e, n, r, null, "publication-first"), a = await zc(e, await i(), 202, "Publish Flow"), o = a.publication, s = J(o.publicationId, "Publication id");
5720
+ G(await Y(await i(), 202, "Replay Publish"), a.operation, "Replayed Publish operation"), await X(await Rc(e, n, r, s, "publication-first"), 409, "publication.conflict", "Conflicting replay");
5719
5721
  let c = await Y(await Z(e, `/v1/flows/${n}/live`), 200, "Read published Live");
5720
5722
  G(c.publication, o, "Live Publication"), G((await Y(await Z(e, `/v1/flows/${n}/editor`), 200, "Read published editor")).live, c, "Published editor Live projection");
5721
5723
  let l = await Y(await Z(e, `/v1/flows/${n}/publications?includeTotal=true`), 200, "List Publications");
@@ -5727,21 +5729,21 @@ var Uc = [
5727
5729
  }),
5728
5730
  headers: { "idempotency-key": "unsupported-publication" },
5729
5731
  method: "POST"
5730
- }), 409, "engine.unsupported", "Publish unsupported Engine"), await X(await zc(e, n, "00000000-0000-7000-8000-000000000002", s, "missing-revision-publication"), 404, "flow.not-found", "Publish missing Revision"), await X(await Vc(e, n, "00000000-0000-7000-8000-000000000004", s, "missing-rollback"), 404, "publication.not-found", "Rollback missing Publication"), await X(await Hc(e, "00000000-0000-7000-8000-000000000004", "missing-publication-run"), 404, "publication.not-found", "Run missing Publication");
5732
+ }), 409, "engine.unsupported", "Publish unsupported Engine"), await X(await Rc(e, n, "00000000-0000-7000-8000-000000000002", s, "missing-revision-publication"), 404, "flow.not-found", "Publish missing Revision"), await X(await Bc(e, n, "00000000-0000-7000-8000-000000000004", s, "missing-rollback"), 404, "publication.not-found", "Rollback missing Publication"), await X(await Vc(e, "00000000-0000-7000-8000-000000000004", "missing-publication-run"), 404, "publication.not-found", "Run missing Publication");
5731
5733
  }
5732
5734
  },
5733
5735
  {
5734
5736
  name: "rolls back immutable history and fixes a Live Run target",
5735
5737
  async verify(e) {
5736
- let t = await Q(e, "Rollback flow", "rollback-flow"), n = J(t.flowId, "Rollback Flow flowId"), r = await Lc(e, n, J(t.draftRevisionId, "Rollback Flow revisionId")), i = (await Bc(e, await zc(e, n, r, null, "publish-first"), 202, "Publish first Revision")).publication, a = J(i.publicationId, "First Publication"), o = (await Bc(e, await zc(e, n, Rc(await Y(await $(e, n, r), 200, "Change Draft"), "Second Revision"), a, "publish-second"), 202, "Publish second Revision")).publication, s = J(o.publicationId, "Second Publication");
5737
- await X(await Hc(e, a, "stale-live-run"), 412, "live.conflict", "Run stale Publication");
5738
- let c = () => Vc(e, n, a, s, "rollback-first"), l = await Y(await c(), 201, "Rollback Flow"), u = J(l.publicationId, "Rollback Publication");
5738
+ let t = await Q(e, "Rollback flow", "rollback-flow"), n = J(t.flowId, "Rollback Flow flowId"), r = await Ic(e, n, J(t.draftRevisionId, "Rollback Flow revisionId")), i = (await zc(e, await Rc(e, n, r, null, "publish-first"), 202, "Publish first Revision")).publication, a = J(i.publicationId, "First Publication"), o = (await zc(e, await Rc(e, n, Lc(await Y(await $(e, n, r), 200, "Change Draft"), "Second Revision"), a, "publish-second"), 202, "Publish second Revision")).publication, s = J(o.publicationId, "Second Publication");
5739
+ await X(await Vc(e, a, "stale-live-run"), 412, "live.conflict", "Run stale Publication");
5740
+ let c = () => Bc(e, n, a, s, "rollback-first"), l = await Y(await c(), 201, "Rollback Flow"), u = J(l.publicationId, "Rollback Publication");
5739
5741
  G(l.operation, "rollback", "Rollback operation"), G(l.sourcePublicationId, a, "Rollback source"), G(await Y(await c(), 200, "Replay Rollback"), l, "Replayed Rollback");
5740
- let d = await Y(await Hc(e, u, "rollback-run"), 202, "Create Live Run");
5741
- G(d.flowId, n, "Live Run flowId"), G(d.revisionId, r, "Live Run revisionId"), await Y(await Z(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow"), await X(await Hc(e, u, "retired-run"), 409, "flow.busy", "Run retired Flow");
5742
+ let d = await Y(await Vc(e, u, "rollback-run"), 202, "Create Live Run");
5743
+ G(d.flowId, n, "Live Run flowId"), G(d.revisionId, r, "Live Run revisionId"), await Y(await Z(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow"), await X(await Vc(e, u, "retired-run"), 409, "flow.busy", "Run retired Flow");
5742
5744
  }
5743
5745
  }
5744
- ], Gc = [{
5746
+ ], Wc = [{
5745
5747
  name: "exposes one deployment-scoped Trigger Key catalog",
5746
5748
  async verify(e) {
5747
5749
  let t = await Y(await Z(e, "/v1/trigger-keys"), 200, "List Trigger Keys"), n = await Y(await Z(e, "/v1/trigger-keys/catalog"), 200, "List Trigger definitions"), r = q(t.keys, "Trigger Keys").map((e) => K(e, "Trigger Key")), i = q(n.definitions, "Trigger definitions").map((e) => K(e, "Trigger definition"));
@@ -5755,7 +5757,7 @@ var Uc = [
5755
5757
  }, {
5756
5758
  name: "operates and retires one Live Trigger binding",
5757
5759
  async verify(e) {
5758
- let t = await Q(e, "Trigger flow", "trigger-flow"), n = J(t.flowId, "Trigger Flow flowId"), r = Rc(await Y(await Ic(e, n, J(t.draftRevisionId, "Trigger Flow revisionId"), [{
5760
+ let t = await Q(e, "Trigger flow", "trigger-flow"), n = J(t.flowId, "Trigger Flow flowId"), r = Lc(await Y(await Fc(e, n, J(t.draftRevisionId, "Trigger Flow revisionId"), [{
5759
5761
  kind: "graph.node.create",
5760
5762
  node: {
5761
5763
  cronTimes: [{
@@ -5777,7 +5779,7 @@ var Uc = [
5777
5779
  },
5778
5780
  nodeId: "webhook",
5779
5781
  target: { kind: "flow" }
5780
- }]), 200, "Create Trigger nodes"), "Trigger Revision"), i = (await Bc(e, await zc(e, n, r, null, "trigger-publication"), 202, "Publish Trigger Flow")).publication, a = J(i.publicationId, "Trigger Publication"), o = `/v1/flows/${n}/triggers`, s = q((await Y(await Z(e, o), 200, "List Trigger bindings")).bindings, "Trigger bindings").map((e) => K(e, "Trigger binding"));
5782
+ }]), 200, "Create Trigger nodes"), "Trigger Revision"), i = (await zc(e, await Rc(e, n, r, null, "trigger-publication"), 202, "Publish Trigger Flow")).publication, a = J(i.publicationId, "Trigger Publication"), o = `/v1/flows/${n}/triggers`, s = q((await Y(await Z(e, o), 200, "List Trigger bindings")).bindings, "Trigger bindings").map((e) => K(e, "Trigger binding"));
5781
5783
  G(s.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
5782
5784
  for (let e of s) G(e.currentPublicationId, a, "Trigger Publication");
5783
5785
  let c = `${o}/webhook`, l = J(K((await Y(await Z(e, c), 200, "Read Webhook")).binding, "Webhook").endpointUrl, "Webhook endpoint"), u = (t) => Z(e, `${c}/${t}`, {
@@ -5793,13 +5795,13 @@ var Uc = [
5793
5795
  version: 1
5794
5796
  })
5795
5797
  });
5796
- await Y(await d(!1), 200, "Disable Trigger Flow"), G((await e.request(new Request(l, { method: "POST" }))).status, 404, "Disabled Flow blocks callback"), await Y(await u("pause"), 200, "Pause binding while Flow disabled"), await Y(await d(!0), 200, "Enable Trigger Flow"), G((await e.request(new Request(l, { method: "POST" }))).status, 404, "Enabling preserves binding pause"), await Y(await u("resume"), 200, "Resume binding after enabling Flow"), G((await e.request(new Request(l, { method: "POST" }))).status, 200, "Enabled Flow permits callback"), await Bc(e, await zc(e, n, Rc(await Y(await Ic(e, n, r, [{
5798
+ await Y(await d(!1), 200, "Disable Trigger Flow"), G((await e.request(new Request(l, { method: "POST" }))).status, 404, "Disabled Flow blocks callback"), await Y(await u("pause"), 200, "Pause binding while Flow disabled"), await Y(await d(!0), 200, "Enable Trigger Flow"), G((await e.request(new Request(l, { method: "POST" }))).status, 404, "Enabling preserves binding pause"), await Y(await u("resume"), 200, "Resume binding after enabling Flow"), G((await e.request(new Request(l, { method: "POST" }))).status, 200, "Enabled Flow permits callback"), await zc(e, await Rc(e, n, Lc(await Y(await Fc(e, n, r, [{
5797
5799
  kind: "graph.node.delete",
5798
5800
  nodeId: "webhook",
5799
5801
  target: { kind: "flow" }
5800
5802
  }]), 200, "Delete Webhook"), "Retired Trigger Revision"), a, "retire-trigger"), 202, "Publish retired Trigger"), G(K((await Y(await Z(e, c), 200, "Read retired Webhook")).binding, "Retired Webhook").currentPublicationId, void 0, "Retired Publication");
5801
5803
  }
5802
- }], Kc = [{
5804
+ }], Gc = [{
5803
5805
  name: "projects the deployment Connector catalog and authorized Connections",
5804
5806
  async verify(e) {
5805
5807
  let t = q((await Y(await Z(e, "/v1/connector/providers"), 200, "List Connector Providers")).providers, "Connector Providers").map((e) => K(e, "Connector Provider")), n = q((await Y(await Z(e, "/v1/connector/actions"), 200, "List Connector Actions")).actions, "Connector Actions").map((e) => K(e, "Connector Action"));
@@ -5819,12 +5821,12 @@ var Uc = [
5819
5821
  async verify(e) {
5820
5822
  await X(await Z(e, "/v1/connector/actions?service=mail&q=send"), 400, "flow.invalid", "Conflicting Connector query"), await X(await Z(e, "/v1/connector/actions?q=%20%20"), 400, "flow.invalid", "Empty Connector query"), await X(await Z(e, `/v1/connector/connections/${"a".repeat(257)}`), 400, "flow.invalid", "Oversized Connector service"), await X(await Z(e, "/v1/connector/actions/conformance.missing"), 404, "connector.action-not-found", "Missing Connector Action");
5821
5823
  }
5822
- }], qc = [{
5824
+ }], Kc = [{
5823
5825
  name: "preserves committed mutations and idempotency receipts after restart",
5824
5826
  async verify(e) {
5825
5827
  let t = await Q(e, "Recovery", "recovery-create"), n = J(t.flowId, "Flow ID"), r = J(t.draftRevisionId, "Revision ID"), i = await Y(await $(e, n, r, "marker", "recovery-change"), 200, "Commit change");
5826
- await e.restart(), G((await Y(await Fc(e, "Recovery", "recovery-create"), 200, "Replay creation after restart")).flowId, n, "Durable creation identity"), G(await Y(await $(e, n, r, "marker", "recovery-change"), 200, "Replay change after restart"), i, "Durable change receipt"), G((await Y(await Z(e, `/v1/flows/${n}/draft`), 200, "Recovered Draft")).revisionId, K(i.revision, "Revision").revisionId, "Recovered head");
5828
+ await e.restart(), G((await Y(await Pc(e, "Recovery", "recovery-create"), 200, "Replay creation after restart")).flowId, n, "Durable creation identity"), G(await Y(await $(e, n, r, "marker", "recovery-change"), 200, "Replay change after restart"), i, "Durable change receipt"), G((await Y(await Z(e, `/v1/flows/${n}/draft`), 200, "Recovered Draft")).revisionId, K(i.revision, "Revision").revisionId, "Recovered head");
5827
5829
  }
5828
5830
  }];
5829
5831
  //#endregion
5830
- export { Kc as connectorControlApiConformanceCases, Uc as controlApiConformanceCases, qc as controlRecoveryConformanceCases, Wc as publicationControlApiConformanceCases, Gc as triggerControlApiConformanceCases };
5832
+ export { Gc as connectorControlApiConformanceCases, Hc as controlApiConformanceCases, Kc as controlRecoveryConformanceCases, Uc as publicationControlApiConformanceCases, Wc as triggerControlApiConformanceCases };
@@ -348,6 +348,7 @@ export declare function decodeRunEvent(value: unknown): {
348
348
  readonly nodeId?: undefined;
349
349
  readonly waitingSince?: undefined;
350
350
  readonly action?: undefined;
351
+ readonly comment?: undefined;
351
352
  readonly resolvedAt?: undefined;
352
353
  readonly waitId?: undefined;
353
354
  readonly result?: undefined;
@@ -366,6 +367,7 @@ export declare function decodeRunEvent(value: unknown): {
366
367
  readonly nodeId?: undefined;
367
368
  readonly waitingSince?: undefined;
368
369
  readonly action?: undefined;
370
+ readonly comment?: undefined;
369
371
  readonly resolvedAt?: undefined;
370
372
  readonly waitId?: undefined;
371
373
  readonly result?: undefined;
@@ -383,6 +385,7 @@ export declare function decodeRunEvent(value: unknown): {
383
385
  readonly nodeId?: undefined;
384
386
  readonly waitingSince?: undefined;
385
387
  readonly action?: undefined;
388
+ readonly comment?: undefined;
386
389
  readonly resolvedAt?: undefined;
387
390
  readonly waitId?: undefined;
388
391
  readonly result?: undefined;
@@ -400,6 +403,7 @@ export declare function decodeRunEvent(value: unknown): {
400
403
  readonly nodeId?: undefined;
401
404
  readonly waitingSince?: undefined;
402
405
  readonly action?: undefined;
406
+ readonly comment?: undefined;
403
407
  readonly resolvedAt?: undefined;
404
408
  readonly waitId?: undefined;
405
409
  readonly result?: undefined;
@@ -418,6 +422,7 @@ export declare function decodeRunEvent(value: unknown): {
418
422
  readonly waitId: string;
419
423
  readonly waitingSince: string;
420
424
  readonly action?: undefined;
425
+ readonly comment?: undefined;
421
426
  readonly resolvedAt?: undefined;
422
427
  readonly result?: undefined;
423
428
  };
@@ -434,6 +439,7 @@ export declare function decodeRunEvent(value: unknown): {
434
439
  readonly nodeId?: undefined;
435
440
  readonly waitingSince?: undefined;
436
441
  readonly action: "approve" | "continue" | "reject";
442
+ readonly comment: string | null;
437
443
  readonly resolvedAt: string;
438
444
  readonly waitId: string;
439
445
  readonly result?: undefined;
@@ -451,6 +457,7 @@ export declare function decodeRunEvent(value: unknown): {
451
457
  readonly nodeId?: undefined;
452
458
  readonly waitingSince?: undefined;
453
459
  readonly action?: undefined;
460
+ readonly comment?: undefined;
454
461
  readonly resolvedAt?: undefined;
455
462
  readonly waitId?: undefined;
456
463
  readonly result: JsonValue;
@@ -472,6 +479,7 @@ export declare function decodeRunEvent(value: unknown): {
472
479
  readonly expiresAt?: undefined;
473
480
  readonly waitingSince?: undefined;
474
481
  readonly action?: undefined;
482
+ readonly comment?: undefined;
475
483
  readonly resolvedAt?: undefined;
476
484
  readonly waitId?: undefined;
477
485
  readonly result?: undefined;
@@ -493,6 +501,7 @@ export declare function decodeRunEvent(value: unknown): {
493
501
  readonly expiresAt?: undefined;
494
502
  readonly waitingSince?: undefined;
495
503
  readonly action?: undefined;
504
+ readonly comment?: undefined;
496
505
  readonly resolvedAt?: undefined;
497
506
  readonly waitId?: undefined;
498
507
  readonly result?: undefined;
@@ -514,6 +523,7 @@ export declare function decodeRunEvent(value: unknown): {
514
523
  readonly expiresAt?: undefined;
515
524
  readonly waitingSince?: undefined;
516
525
  readonly action?: undefined;
526
+ readonly comment?: undefined;
517
527
  readonly resolvedAt?: undefined;
518
528
  readonly waitId?: undefined;
519
529
  readonly result?: undefined;
@@ -536,6 +546,7 @@ export declare function decodeRunEvent(value: unknown): {
536
546
  readonly expiresAt?: undefined;
537
547
  readonly waitingSince?: undefined;
538
548
  readonly action?: undefined;
549
+ readonly comment?: undefined;
539
550
  readonly resolvedAt?: undefined;
540
551
  readonly waitId?: undefined;
541
552
  readonly result?: undefined;
@@ -555,6 +566,7 @@ export declare function decodeRunEvent(value: unknown): {
555
566
  readonly expiresAt?: undefined;
556
567
  readonly waitingSince?: undefined;
557
568
  readonly action?: undefined;
569
+ readonly comment?: undefined;
558
570
  readonly resolvedAt?: undefined;
559
571
  readonly waitId?: undefined;
560
572
  readonly result?: undefined;
@@ -574,6 +586,7 @@ export declare function decodeRunEvent(value: unknown): {
574
586
  readonly expiresAt?: undefined;
575
587
  readonly waitingSince?: undefined;
576
588
  readonly action?: undefined;
589
+ readonly comment?: undefined;
577
590
  readonly resolvedAt?: undefined;
578
591
  readonly waitId?: undefined;
579
592
  readonly result?: undefined;
@@ -698,8 +711,9 @@ export declare class ControlClient {
698
711
  downloadRunResult(runId: string, resultId: string, signal?: AbortSignal): Promise<Blob>;
699
712
  getRunResult(runId: string, signal?: AbortSignal): Promise<RunResult>;
700
713
  cancelRun(runId: string): Promise<RunCancellation>;
701
- resolveRunWait(runId: string, waitId: string, action: WaitAction): Promise<{
714
+ resolveRunWait(runId: string, waitId: string, action: WaitAction, comment?: string | null): Promise<{
702
715
  readonly action: WaitAction | null;
716
+ readonly comment: string | null;
703
717
  readonly resolutionAccepted: boolean;
704
718
  readonly resolvedAt: string | null;
705
719
  readonly runId: string;