@oomol-lab/open-flow 0.1.0-beta.20 → 0.1.0-beta.21

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.
@@ -5329,9 +5329,70 @@ function pl(e) {
5329
5329
  };
5330
5330
  }
5331
5331
  new TextEncoder();
5332
+ var ml = F(D(), _s()), hl = M({
5333
+ jsonSchema: _s(),
5334
+ nullable: A(),
5335
+ value: _s().optional(),
5336
+ description: D().optional()
5337
+ }).strict(), gl = F(D(), hl), _l = P([M({
5338
+ kind: L("value"),
5339
+ value: _s()
5340
+ }).strict(), M({
5341
+ kind: L("sources"),
5342
+ sources: j(M({
5343
+ kind: L("node"),
5344
+ nodeId: D(),
5345
+ output: D()
5346
+ }).strict())
5347
+ }).strict()]), vl = {
5348
+ name: D().optional(),
5349
+ description: D().optional(),
5350
+ icon: D().optional()
5351
+ }, yl = P([
5352
+ M({
5353
+ ...vl,
5354
+ kind: L("cron"),
5355
+ cronTimes: j(_s())
5356
+ }).strict(),
5357
+ M({
5358
+ ...vl,
5359
+ kind: L("manual")
5360
+ }).strict(),
5361
+ M({
5362
+ ...vl,
5363
+ kind: L("task"),
5364
+ concurrency: L(1).optional(),
5365
+ inputs: F(D(), _l),
5366
+ task: M({
5367
+ name: D(),
5368
+ moduleId: D(),
5369
+ inputs: gl,
5370
+ outputs: F(D(), hl.omit({ value: !0 }))
5371
+ }).strict()
5372
+ }).strict()
5373
+ ]);
5374
+ M({
5375
+ name: D(),
5376
+ graph: M({ nodes: F(D(), yl) }).strict()
5377
+ }).strict(), M({
5378
+ kind: L("open-flow-project-revision"),
5379
+ version: L(1),
5380
+ modelVersion: L(1),
5381
+ modules: F(D(), M({
5382
+ name: D(),
5383
+ source: D(),
5384
+ imports: j(D())
5385
+ }).strict()),
5386
+ document: M({
5387
+ bindings: ml,
5388
+ flows: ml,
5389
+ subflows: ml,
5390
+ tasks: ml
5391
+ }).strict()
5392
+ }).strict();
5332
5393
  //#endregion
5333
5394
  //#region src/control/common/revisionDecoders.ts
5334
- function ml(e) {
5395
+ function bl(e) {
5335
5396
  let t = W(e), n = t.parentRevisionId;
5336
5397
  return t.version != 1 || n !== null && typeof n != "string" ? U() : {
5337
5398
  actorId: G(t.actorId),
@@ -5344,18 +5405,18 @@ function ml(e) {
5344
5405
  version: 1
5345
5406
  };
5346
5407
  }
5347
- function hl(e) {
5408
+ function xl(e) {
5348
5409
  let t = W(e);
5349
5410
  try {
5350
5411
  return {
5351
- ...ml(t),
5412
+ ...bl(t),
5352
5413
  content: zc(t.content)
5353
5414
  };
5354
5415
  } catch {
5355
5416
  return U();
5356
5417
  }
5357
5418
  }
5358
- function gl(e) {
5419
+ function Sl(e) {
5359
5420
  let t = W(e);
5360
5421
  return K(t, [
5361
5422
  "revision",
@@ -5369,28 +5430,28 @@ function gl(e) {
5369
5430
  version: 1
5370
5431
  };
5371
5432
  }
5372
- function _l(e) {
5433
+ function Cl(e) {
5373
5434
  let t = W(e);
5374
5435
  return t.version == 1 ? {
5375
- revision: ml(t.revision),
5436
+ revision: bl(t.revision),
5376
5437
  version: 1
5377
5438
  } : U();
5378
5439
  }
5379
- function vl(e) {
5440
+ function wl(e) {
5380
5441
  let t = W(e);
5381
5442
  return t.version != 1 || t.kind != "snapshot" ? U() : {
5382
- draft: hl(t.draft),
5443
+ draft: xl(t.draft),
5383
5444
  kind: "snapshot",
5384
5445
  version: 1
5385
5446
  };
5386
5447
  }
5387
5448
  //#endregion
5388
5449
  //#region src/control/common/runDecoders.ts
5389
- var yl = new Set(oc);
5390
- function bl(e) {
5391
- return typeof e == "string" && yl.has(e) ? e : U();
5450
+ var Tl = new Set(oc);
5451
+ function El(e) {
5452
+ return typeof e == "string" && Tl.has(e) ? e : U();
5392
5453
  }
5393
- function xl(e) {
5454
+ function Dl(e) {
5394
5455
  let t = W(e), n = t.source, r = t.startedAt, i = t.finishedAt;
5395
5456
  return t.version != 1 || n != "draft" && n != "live" && n != "trigger" || r != null && typeof r != "string" || i != null && typeof i != "string" ? U() : {
5396
5457
  createdAt: G(t.createdAt),
@@ -5400,11 +5461,11 @@ function xl(e) {
5400
5461
  runId: G(t.runId),
5401
5462
  source: n,
5402
5463
  ...r == null ? {} : { startedAt: r },
5403
- status: bl(t.status),
5464
+ status: El(t.status),
5404
5465
  version: 1
5405
5466
  };
5406
5467
  }
5407
- function Sl(e) {
5468
+ function Ol(e) {
5408
5469
  let t = W(e);
5409
5470
  K(t, [
5410
5471
  "actions",
@@ -5424,12 +5485,12 @@ function Sl(e) {
5424
5485
  waitingSince: G(t.waitingSince)
5425
5486
  };
5426
5487
  }
5427
- function Cl(e) {
5428
- let t = W(e), n = xl(t), r = t.eventsExpiresAt;
5488
+ function kl(e) {
5489
+ let t = W(e), n = Dl(t), r = t.eventsExpiresAt;
5429
5490
  if (r != null && typeof r != "string" || n.status != "waiting" && t.waiting !== void 0) return U();
5430
5491
  let i = n.status == "waiting" ? {
5431
5492
  status: "waiting",
5432
- waiting: Sl(t.waiting)
5493
+ waiting: Ol(t.waiting)
5433
5494
  } : { status: n.status }, a = {
5434
5495
  ...n,
5435
5496
  closureDigest: G(t.closureDigest),
@@ -5459,17 +5520,17 @@ function Cl(e) {
5459
5520
  };
5460
5521
  }
5461
5522
  }
5462
- function wl(e) {
5523
+ function Al(e) {
5463
5524
  let t = W(e), n = t.nextCursor;
5464
5525
  return t.version != 1 || !Array.isArray(t.runs) || n != null && typeof n != "string" ? U() : {
5465
5526
  flowId: G(t.flowId),
5466
5527
  ...n == null ? {} : { nextCursor: n },
5467
- runs: t.runs.map(xl),
5528
+ runs: t.runs.map(Dl),
5468
5529
  version: 1
5469
5530
  };
5470
5531
  }
5471
- function Tl(e) {
5472
- let t = W(e), n = bl(t.status);
5532
+ function jl(e) {
5533
+ let t = W(e), n = El(t.status);
5473
5534
  return t.version != 1 || typeof t.cancelAccepted != "boolean" || n == "queued" || n == "starting" || n == "running" || n == "waiting" ? U() : {
5474
5535
  cancelAccepted: t.cancelAccepted,
5475
5536
  runId: G(t.runId),
@@ -5477,7 +5538,7 @@ function Tl(e) {
5477
5538
  version: 1
5478
5539
  };
5479
5540
  }
5480
- function El(e) {
5541
+ function Ml(e) {
5481
5542
  let t = W(e);
5482
5543
  K(t, [
5483
5544
  "action",
@@ -5494,12 +5555,12 @@ function El(e) {
5494
5555
  resolutionAccepted: t.resolutionAccepted,
5495
5556
  resolvedAt: r,
5496
5557
  runId: G(t.runId),
5497
- status: bl(t.status),
5558
+ status: El(t.status),
5498
5559
  version: 1,
5499
5560
  waitId: G(t.waitId)
5500
5561
  };
5501
5562
  }
5502
- function Dl(e) {
5563
+ function Nl(e) {
5503
5564
  let t = W(e), n = t.status;
5504
5565
  if (t.version != 1) return U();
5505
5566
  let r = {
@@ -5542,7 +5603,7 @@ function Dl(e) {
5542
5603
  }
5543
5604
  //#endregion
5544
5605
  //#region src/control/common/triggerDecoders.ts
5545
- function Ol(e) {
5606
+ function Pl(e) {
5546
5607
  let t = W(e), n = t.type;
5547
5608
  return n != "integration" && n != "poll" ? U() : {
5548
5609
  description: typeof t.description == "string" ? t.description : U(),
@@ -5553,8 +5614,8 @@ function Ol(e) {
5553
5614
  type: n
5554
5615
  };
5555
5616
  }
5556
- function kl(e) {
5557
- let t = W(e), n = Ol(t), r = {
5617
+ function Fl(e) {
5618
+ let t = W(e), n = Pl(t), r = {
5558
5619
  configSchema: J(t.configSchema),
5559
5620
  definitionVersion: q(t.definitionVersion),
5560
5621
  description: n.description,
@@ -5597,18 +5658,18 @@ function kl(e) {
5597
5658
  type: "integration"
5598
5659
  };
5599
5660
  }
5600
- var Al = /* @__PURE__ */ new Set([
5661
+ var Il = /* @__PURE__ */ new Set([
5601
5662
  "cron",
5602
5663
  "integration",
5603
5664
  "poll",
5604
5665
  "webhook"
5605
- ]), jl = /* @__PURE__ */ new Set([
5666
+ ]), Ll = /* @__PURE__ */ new Set([
5606
5667
  "failed",
5607
5668
  "healthy",
5608
5669
  "initializing",
5609
5670
  "needs_reauth",
5610
5671
  "suspended"
5611
- ]), Ml = /* @__PURE__ */ new Set([
5672
+ ]), Rl = /* @__PURE__ */ new Set([
5612
5673
  "delivery.failed",
5613
5674
  "health.failed",
5614
5675
  "health.needs_reauth",
@@ -5617,11 +5678,11 @@ var Al = /* @__PURE__ */ new Set([
5617
5678
  "operator.paused",
5618
5679
  "operator.resumed"
5619
5680
  ]);
5620
- function Nl(e) {
5681
+ function zl(e) {
5621
5682
  let t = W(e), n = t.health, r = t.listener == null ? void 0 : W(t.listener);
5622
5683
  if (r != null && r.health != "healthy" && r.health != "failed" && r.health != "needs_reauth") return U();
5623
5684
  let i = t.kind, a = t.operatorState, o = q(t.runtimeVersion);
5624
- return t.version != 1 || typeof n != "string" || !jl.has(n) || typeof i != "string" || !Al.has(i) || a != "active" && a != "paused" || o <= 0 ? U() : {
5685
+ return t.version != 1 || typeof n != "string" || !Ll.has(n) || typeof i != "string" || !Il.has(i) || a != "active" && a != "paused" || o <= 0 ? U() : {
5625
5686
  ...t.currentPublicationId == null ? {} : { currentPublicationId: G(t.currentPublicationId) },
5626
5687
  ...t.currentRevisionId == null ? {} : { currentRevisionId: G(t.currentRevisionId) },
5627
5688
  ...t.endpointUrl == null ? {} : { endpointUrl: G(t.endpointUrl) },
@@ -5640,16 +5701,16 @@ function Nl(e) {
5640
5701
  version: 1
5641
5702
  };
5642
5703
  }
5643
- function Pl(e) {
5704
+ function Bl(e) {
5644
5705
  let t = W(e);
5645
5706
  return t.version == 1 ? {
5646
- binding: Nl(t.binding),
5707
+ binding: zl(t.binding),
5647
5708
  version: 1
5648
5709
  } : U();
5649
5710
  }
5650
- function Fl(e) {
5711
+ function Vl(e) {
5651
5712
  let t = W(e), n = t.kind;
5652
- if (typeof n != "string" || !Ml.has(n)) return U();
5713
+ if (typeof n != "string" || !Rl.has(n)) return U();
5653
5714
  let r = Qc(t.errorCode), i = Qc(t.errorMessage);
5654
5715
  return i != null && i.length > 512 ? U() : {
5655
5716
  activityId: G(t.activityId),
@@ -5659,15 +5720,15 @@ function Fl(e) {
5659
5720
  kind: n
5660
5721
  };
5661
5722
  }
5662
- function Il(e) {
5723
+ function Hl(e) {
5663
5724
  let t = W(e), n = Qc(t.nextCursor);
5664
5725
  return t.version != 1 || !Array.isArray(t.activities) ? U() : {
5665
- activities: t.activities.map(Fl),
5726
+ activities: t.activities.map(Vl),
5666
5727
  ...n == null ? {} : { nextCursor: n },
5667
5728
  version: 1
5668
5729
  };
5669
5730
  }
5670
- function Ll(e) {
5731
+ function Ul(e) {
5671
5732
  let t = W(e), n = q(t.filtered);
5672
5733
  return t.version != 1 || !Array.isArray(t.events) || typeof t.hasMore != "boolean" || n < 0 ? U() : {
5673
5734
  events: t.events.map((e) => {
@@ -5681,7 +5742,7 @@ function Ll(e) {
5681
5742
  }
5682
5743
  //#endregion
5683
5744
  //#region src/control/common/random.ts
5684
- function Rl() {
5745
+ function Wl() {
5685
5746
  let e = globalThis.crypto;
5686
5747
  if (e != null) {
5687
5748
  try {
@@ -5698,7 +5759,7 @@ function Rl() {
5698
5759
  }
5699
5760
  //#endregion
5700
5761
  //#region src/control/common/api.ts
5701
- function zl(e) {
5762
+ function Gl(e) {
5702
5763
  let t = W(e), n = q(t.sequence);
5703
5764
  if (n < 0) return U();
5704
5765
  let r = {
@@ -5726,7 +5787,7 @@ function zl(e) {
5726
5787
  payload: {
5727
5788
  flowId: G(i.flowId),
5728
5789
  scopeId: G(i.scopeId),
5729
- progress: Bl(i.progress)
5790
+ progress: Kl(i.progress)
5730
5791
  }
5731
5792
  };
5732
5793
  case "run.waiting": return {
@@ -5829,7 +5890,7 @@ function zl(e) {
5829
5890
  kind: a,
5830
5891
  payload: {
5831
5892
  ...e,
5832
- progress: Bl(i.progress)
5893
+ progress: Kl(i.progress)
5833
5894
  }
5834
5895
  };
5835
5896
  case "node.artifact": {
@@ -5855,14 +5916,14 @@ function zl(e) {
5855
5916
  default: return U();
5856
5917
  }
5857
5918
  }
5858
- function Bl(e) {
5919
+ function Kl(e) {
5859
5920
  return typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 100 ? e : U();
5860
5921
  }
5861
- function Vl(e) {
5922
+ function ql(e) {
5862
5923
  let t = W(e), n = t.eventsExpiresAt, r = q(t.nextAfter);
5863
5924
  return t.version != 1 || !Array.isArray(t.events) || typeof t.done != "boolean" || typeof t.historyComplete != "boolean" || n != null && typeof n != "string" || r < 0 ? U() : {
5864
5925
  done: t.done,
5865
- events: t.events.map(zl),
5926
+ events: t.events.map(Gl),
5866
5927
  ...n == null ? {} : { eventsExpiresAt: n },
5867
5928
  historyComplete: t.historyComplete,
5868
5929
  nextAfter: r,
@@ -5871,10 +5932,10 @@ function Vl(e) {
5871
5932
  };
5872
5933
  }
5873
5934
  var Y = encodeURIComponent;
5874
- function Hl(e) {
5875
- return `${e}-${Rl()}`;
5935
+ function Jl(e) {
5936
+ return `${e}-${Wl()}`;
5876
5937
  }
5877
- var Ul = class {
5938
+ var Yl = class {
5878
5939
  constructor(e) {
5879
5940
  this.requestControl = e;
5880
5941
  }
@@ -5904,7 +5965,7 @@ var Ul = class {
5904
5965
  let t = W(await this.request(`/v1/variables/${Y(e)}`, { method: "DELETE" }));
5905
5966
  if (K(t, ["version"]), t.version != 1) return U();
5906
5967
  }
5907
- async createFlow(e, t = `flow-${Rl()}`) {
5968
+ async createFlow(e, t = `flow-${Wl()}`) {
5908
5969
  return sl(await this.request("/v1/flows", {
5909
5970
  body: JSON.stringify({
5910
5971
  name: e,
@@ -5931,43 +5992,43 @@ var Ul = class {
5931
5992
  }
5932
5993
  async listTriggerKeys(e) {
5933
5994
  let t = W(await this.request("/v1/trigger-keys", { signal: e }));
5934
- return t.version != 1 || !Array.isArray(t.keys) ? U() : t.keys.map(Ol);
5995
+ return t.version != 1 || !Array.isArray(t.keys) ? U() : t.keys.map(Pl);
5935
5996
  }
5936
5997
  async listTriggerDefinitions(e) {
5937
5998
  let t = W(await this.request("/v1/trigger-keys/catalog", { signal: e }));
5938
- return t.version != 1 || !Array.isArray(t.definitions) ? U() : t.definitions.map(kl);
5999
+ return t.version != 1 || !Array.isArray(t.definitions) ? U() : t.definitions.map(Fl);
5939
6000
  }
5940
6001
  async getTriggerKey(e, t) {
5941
6002
  let n = W(await this.request(`/v1/trigger-keys/${Y(e)}`, { signal: t }));
5942
- return n.version == 1 ? kl(n.definition) : U();
6003
+ return n.version == 1 ? Fl(n.definition) : U();
5943
6004
  }
5944
6005
  async listFlowTriggerBindings(e, t) {
5945
6006
  let n = W(await this.request(`/v1/flows/${Y(e)}/triggers`, { signal: t }));
5946
- return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(Nl);
6007
+ return n.version != 1 || G(n.flowId) != e || !Array.isArray(n.bindings) ? U() : n.bindings.map(zl);
5947
6008
  }
5948
6009
  async getFlowTriggerBinding(e, t) {
5949
- return Pl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
6010
+ return Bl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}`));
5950
6011
  }
5951
6012
  async listFlowTriggerActivities(e, t, n = {}) {
5952
6013
  let r = new URLSearchParams();
5953
6014
  n.cursor != null && r.set("cursor", n.cursor), n.limit != null && r.set("limit", String(n.limit));
5954
6015
  let i = r.size == 0 ? "" : `?${r}`;
5955
- return Il(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
6016
+ return Hl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/activities${i}`));
5956
6017
  }
5957
6018
  async pauseFlowTrigger(e, t) {
5958
- return Nl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
6019
+ return zl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/pause`, {
5959
6020
  body: JSON.stringify({ version: 1 }),
5960
6021
  method: "POST"
5961
6022
  }));
5962
6023
  }
5963
6024
  async resumeFlowTrigger(e, t) {
5964
- return Nl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
6025
+ return zl(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/resume`, {
5965
6026
  body: JSON.stringify({ version: 1 }),
5966
6027
  method: "POST"
5967
6028
  }));
5968
6029
  }
5969
6030
  async testFlowPollTrigger(e, t) {
5970
- return Ll(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
6031
+ return Ul(await this.request(`/v1/flows/${Y(e)}/triggers/${Y(t)}/test`, {
5971
6032
  body: JSON.stringify({ version: 1 }),
5972
6033
  method: "POST"
5973
6034
  }));
@@ -5983,24 +6044,24 @@ var Ul = class {
5983
6044
  ]), t.version != 1) return U();
5984
6045
  let n = {
5985
6046
  flow: sl(t.flow),
5986
- draft: hl(t.draft),
6047
+ draft: xl(t.draft),
5987
6048
  live: fl(t.live),
5988
- presentation: gl(t.presentation),
6049
+ presentation: Sl(t.presentation),
5989
6050
  version: 1
5990
6051
  };
5991
6052
  return n.flow.flowId != e || n.draft.flowId != e || n.live.flowId != e || n.flow.draftRevisionId != n.draft.revisionId ? U() : n;
5992
6053
  }
5993
6054
  async getPresentation(e) {
5994
- return gl(await this.request(`/v1/flows/${Y(e)}/presentation`));
6055
+ return Sl(await this.request(`/v1/flows/${Y(e)}/presentation`));
5995
6056
  }
5996
6057
  async getDraft(e) {
5997
- return hl(await this.request(`/v1/flows/${Y(e)}/draft`));
6058
+ return xl(await this.request(`/v1/flows/${Y(e)}/draft`));
5998
6059
  }
5999
6060
  async syncDraft(e) {
6000
- return vl(await this.request(`/v1/flows/${Y(e)}/draft/sync`));
6061
+ return wl(await this.request(`/v1/flows/${Y(e)}/draft/sync`));
6001
6062
  }
6002
6063
  async getRevision(e, t) {
6003
- return hl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
6064
+ return xl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}`));
6004
6065
  }
6005
6066
  async listConnectorProviders(e, t) {
6006
6067
  let n = W(await this.request(`/v1/connector/providers${t == null ? "" : `?flowId=${Y(t)}`}`, { signal: e }));
@@ -6043,8 +6104,8 @@ var Ul = class {
6043
6104
  return U();
6044
6105
  }
6045
6106
  }
6046
- async changeDraft(e, t, n, r = Hl("change")) {
6047
- return _l(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
6107
+ async changeDraft(e, t, n, r = Jl("change")) {
6108
+ return Cl(await this.request(`/v1/flows/${Y(e)}/draft/changes`, {
6048
6109
  body: JSON.stringify({
6049
6110
  expectedRevisionId: t,
6050
6111
  operations: n,
@@ -6073,27 +6134,27 @@ var Ul = class {
6073
6134
  return pl(await this.request(`/v1/flows/${Y(e)}/publications${i}`, { signal: n }));
6074
6135
  }
6075
6136
  async createDraftRun(e, t, n) {
6076
- let r = Cl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
6137
+ let r = kl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
6077
6138
  body: JSON.stringify({
6078
6139
  engineContract: "open-flow-engine/v2",
6079
6140
  inputs: n.inputs ?? {},
6080
6141
  trigger: n.trigger,
6081
6142
  version: 1
6082
6143
  }),
6083
- headers: { "idempotency-key": n.idempotencyKey ?? Hl("run") },
6144
+ headers: { "idempotency-key": n.idempotencyKey ?? Jl("run") },
6084
6145
  method: "POST"
6085
6146
  }));
6086
6147
  return r.source == "draft" ? r : U();
6087
6148
  }
6088
6149
  async createLiveRun(e, t) {
6089
- let n = Cl(await this.request("/v1/runs", {
6150
+ let n = kl(await this.request("/v1/runs", {
6090
6151
  body: JSON.stringify({
6091
6152
  inputs: t.inputs ?? {},
6092
6153
  trigger: t.trigger,
6093
6154
  publicationId: e,
6094
6155
  version: 1
6095
6156
  }),
6096
- headers: { "idempotency-key": t.idempotencyKey ?? Hl("run") },
6157
+ headers: { "idempotency-key": t.idempotencyKey ?? Jl("run") },
6097
6158
  method: "POST"
6098
6159
  }));
6099
6160
  return n.source == "live" ? n : U();
@@ -6115,7 +6176,7 @@ var Ul = class {
6115
6176
  expectedLivePublicationId: n,
6116
6177
  version: 1
6117
6178
  }),
6118
- headers: { "idempotency-key": r.idempotencyKey ?? Hl("publication") },
6179
+ headers: { "idempotency-key": r.idempotencyKey ?? Jl("publication") },
6119
6180
  method: "POST"
6120
6181
  }));
6121
6182
  }
@@ -6128,24 +6189,24 @@ var Ul = class {
6128
6189
  expectedLivePublicationId: n,
6129
6190
  version: 1
6130
6191
  }),
6131
- headers: { "idempotency-key": r.idempotencyKey ?? Hl("publication") },
6192
+ headers: { "idempotency-key": r.idempotencyKey ?? Jl("publication") },
6132
6193
  method: "POST"
6133
6194
  }));
6134
6195
  }
6135
6196
  async getRun(e, t) {
6136
- return Cl(await this.request(`/v1/runs/${Y(e)}`, { signal: t }));
6197
+ return kl(await this.request(`/v1/runs/${Y(e)}`, { signal: t }));
6137
6198
  }
6138
6199
  async listRuns(e, t = {}) {
6139
6200
  let n = new URLSearchParams();
6140
6201
  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);
6141
6202
  let r = n.size == 0 ? "" : `?${n}`;
6142
- return wl(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
6203
+ return Al(await this.request(`/v1/flows/${Y(e)}/runs${r}`));
6143
6204
  }
6144
6205
  async getRunEvents(e, t = {}, n) {
6145
6206
  let r = new URLSearchParams();
6146
6207
  t.after != null && r.set("after", String(t.after)), t.limit != null && r.set("limit", String(t.limit));
6147
6208
  let i = r.size == 0 ? "" : `?${r}`;
6148
- return Vl(await this.request(`/v1/runs/${Y(e)}/events${i}`, { signal: n }));
6209
+ return ql(await this.request(`/v1/runs/${Y(e)}/events${i}`, { signal: n }));
6149
6210
  }
6150
6211
  async listRunResults(e, t, n) {
6151
6212
  return Yc(await this.request(`/v1/runs/${Y(e)}/results${t == null ? "" : `?after=${encodeURIComponent(t)}`}`, { signal: n }));
@@ -6158,16 +6219,16 @@ var Ul = class {
6158
6219
  return (await this.response(`/v1/runs/${Y(e)}/results/${Y(t)}/content`, { signal: n })).blob();
6159
6220
  }
6160
6221
  async getRunResult(e, t) {
6161
- return Dl(await this.request(`/v1/runs/${Y(e)}/result`, { signal: t }));
6222
+ return Nl(await this.request(`/v1/runs/${Y(e)}/result`, { signal: t }));
6162
6223
  }
6163
6224
  async cancelRun(e) {
6164
- return Tl(await this.request(`/v1/runs/${Y(e)}/cancel`, {
6225
+ return jl(await this.request(`/v1/runs/${Y(e)}/cancel`, {
6165
6226
  body: JSON.stringify({ version: 1 }),
6166
6227
  method: "POST"
6167
6228
  }));
6168
6229
  }
6169
6230
  async resolveRunWait(e, t, n) {
6170
- return El(await this.request(`/v1/runs/${Y(e)}/waits/${Y(t)}/resolve`, {
6231
+ return Ml(await this.request(`/v1/runs/${Y(e)}/waits/${Y(t)}/resolve`, {
6171
6232
  body: JSON.stringify({
6172
6233
  action: n,
6173
6234
  version: 1
@@ -6212,13 +6273,13 @@ var Ul = class {
6212
6273
  function X(e, t) {
6213
6274
  if (!e) throw Error(t);
6214
6275
  }
6215
- async function Wl(e, t, n) {
6276
+ async function Xl(e, t, n) {
6216
6277
  let r = await e.request(new Request(new URL("/v1/mcp", e.origin), {
6217
6278
  method: "POST",
6218
6279
  headers: {
6219
6280
  "content-type": "application/json",
6220
6281
  accept: "application/json, text/event-stream",
6221
- "mcp-protocol-version": Kl,
6282
+ "mcp-protocol-version": Ql,
6222
6283
  "mcp-method": t,
6223
6284
  ...t == "tools/call" ? { "mcp-name": String(n?.name) } : {}
6224
6285
  },
@@ -6229,7 +6290,7 @@ async function Wl(e, t, n) {
6229
6290
  params: {
6230
6291
  ...n,
6231
6292
  _meta: {
6232
- "io.modelcontextprotocol/protocolVersion": Kl,
6293
+ "io.modelcontextprotocol/protocolVersion": Ql,
6233
6294
  "io.modelcontextprotocol/clientCapabilities": {}
6234
6295
  }
6235
6296
  }
@@ -6239,13 +6300,13 @@ async function Wl(e, t, n) {
6239
6300
  let i = await r.text(), a = r.headers.get("content-type")?.includes("text/event-stream") ? JSON.parse(i.split("\n").findLast((e) => e.startsWith("data:"))?.slice(5) ?? "null") : JSON.parse(i);
6240
6301
  return X(a != null && a.error == null, `MCP ${t} failed: ${JSON.stringify(a)}.`), a.result;
6241
6302
  }
6242
- var Gl = [
6303
+ var Zl = [
6243
6304
  {
6244
6305
  name: "publishes the public MCP catalog, input schemas and annotations",
6245
6306
  async verify(e) {
6246
- let t = await Wl(e, "tools/list");
6247
- X(Array.isArray(t.tools), "MCP tools must be an array."), X(t.tools.length == Object.keys(Ql).length, "MCP tool count differs from the public contract.");
6248
- for (let [e, n] of Object.entries(Ql)) {
6307
+ let t = await Xl(e, "tools/list");
6308
+ X(Array.isArray(t.tools), "MCP tools must be an array."), X(t.tools.length == Object.keys(iu).length, "MCP tool count differs from the public contract.");
6309
+ for (let [e, n] of Object.entries(iu)) {
6249
6310
  let r = t.tools.find((t) => t.name == e);
6250
6311
  X(r != null, `Missing MCP tool ${e}.`), X(r.description == n.description, `${e} description differs.`), X(ac(r.annotations, n.annotations), `${e} annotations differ.`);
6251
6312
  let { $schema: i, ...a } = n.inputSchema["~standard"].jsonSchema.input(), { $schema: o, ...s } = r.inputSchema;
@@ -6256,7 +6317,7 @@ var Gl = [
6256
6317
  {
6257
6318
  name: "shares Run pagination, status filters and cancellation between MCP and REST",
6258
6319
  async verify(e) {
6259
- let t = new Ul((t, n) => e.request(new Request(new URL(t, e.origin), n))), n = await t.createFlow("MCP Run listing"), r = await t.changeDraft(n.flowId, n.draftRevisionId, [{
6320
+ let t = new Yl((t, n) => e.request(new Request(new URL(t, e.origin), n))), n = await t.createFlow("MCP Run listing"), r = await t.changeDraft(n.flowId, n.draftRevisionId, [{
6260
6321
  kind: "graph.node.create",
6261
6322
  target: { kind: "flow" },
6262
6323
  nodeId: "start",
@@ -6274,7 +6335,7 @@ var Gl = [
6274
6335
  }
6275
6336
  }, a = [];
6276
6337
  for (let t = 0; t < 2; t++) {
6277
- let t = (await Wl(e, "tools/call", {
6338
+ let t = (await Xl(e, "tools/call", {
6278
6339
  name: "flow_run",
6279
6340
  arguments: {
6280
6341
  ...i,
@@ -6283,7 +6344,7 @@ var Gl = [
6283
6344
  })).structuredContent;
6284
6345
  X(typeof t.runId == "string", "MCP must return an accepted Run ID."), a.push(t.runId);
6285
6346
  }
6286
- let o = (await Wl(e, "tools/call", {
6347
+ let o = (await Xl(e, "tools/call", {
6287
6348
  name: "run_list",
6288
6349
  arguments: {
6289
6350
  flowId: n.flowId,
@@ -6297,24 +6358,24 @@ var Gl = [
6297
6358
  });
6298
6359
  X(s.runs.length == 1 && s.runs[0]?.runId != o.runs[0]?.runId, "REST must continue the MCP Run cursor without duplicates.");
6299
6360
  let c = await t.listRuns(n.flowId, { limit: 1 });
6300
- X(ac((await Wl(e, "tools/call", {
6361
+ X(ac((await Xl(e, "tools/call", {
6301
6362
  name: "run_list",
6302
6363
  arguments: {
6303
6364
  flowId: n.flowId,
6304
6365
  cursor: c.nextCursor,
6305
6366
  limit: 1
6306
6367
  }
6307
- })).structuredContent, s), "MCP must continue the REST Run cursor."), await Wl(e, "tools/call", {
6368
+ })).structuredContent, s), "MCP must continue the REST Run cursor."), await Xl(e, "tools/call", {
6308
6369
  name: "run_cancel",
6309
6370
  arguments: { runId: a[0] }
6310
- }), X(ac((await Wl(e, "tools/call", {
6371
+ }), X(ac((await Xl(e, "tools/call", {
6311
6372
  name: "run_list",
6312
6373
  arguments: {
6313
6374
  flowId: n.flowId,
6314
6375
  status: "canceled"
6315
6376
  }
6316
6377
  })).structuredContent, await t.listRuns(n.flowId, { status: "canceled" })), "MCP and REST status filters differ.");
6317
- let l = await Wl(e, "tools/call", {
6378
+ let l = await Xl(e, "tools/call", {
6318
6379
  name: "run_list",
6319
6380
  arguments: {
6320
6381
  flowId: (await t.createFlow("Other Run scope")).flowId,
@@ -6330,7 +6391,7 @@ var Gl = [
6330
6391
  let t = {
6331
6392
  name: "MCP conformance",
6332
6393
  idempotencyKey: crypto.randomUUID()
6333
- }, n = () => Wl(e, "tools/call", {
6394
+ }, n = () => Xl(e, "tools/call", {
6334
6395
  name: "flow_create",
6335
6396
  arguments: t
6336
6397
  }), r = await n();
@@ -6339,7 +6400,7 @@ var Gl = [
6339
6400
  X(typeof i.flowId == "string", "MCP did not return a Flow ID."), X(ac((await n()).structuredContent, i), "MCP mutation replay changed identity.");
6340
6401
  let a = await e.request(new Request(new URL(`/v1/flows/${encodeURIComponent(i.flowId)}/draft`, e.origin)));
6341
6402
  X(a.ok, "REST cannot read the Flow created through MCP."), X((await a.json()).revisionId == i.draftRevisionId, "MCP and REST disagree on the Draft head.");
6342
- let o = await Wl(e, "tools/call", {
6403
+ let o = await Xl(e, "tools/call", {
6343
6404
  name: "flow_create",
6344
6405
  arguments: {
6345
6406
  ...t,
@@ -6349,7 +6410,7 @@ var Gl = [
6349
6410
  X(o.isError == 1, "MCP must reject a changed idempotent replay."), X(o.structuredContent.error.code == "flow.conflict", "MCP must preserve the Control error code.");
6350
6411
  }
6351
6412
  }
6352
- ], Kl = "2026-07-28", ql = rc(), Z = D().min(1), Jl = Z.max(256).describe("Stable identity for this mutation. Retry with the same key and identical arguments, even after a lost response."), Yl = fs().min(1).max(100).default(50), Q = Z.describe("Exact Flow ID returned by flow_list or flow_create."), Xl = Z.describe("Exact Run ID returned by flow_run or run_list."), Zl = "Use flow_list and flow_get to inspect a Flow. Use flow_schema to learn atomic edit operations, then flow_apply with the observed expectedRevisionId and a stable idempotencyKey. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_create, flow_apply, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
6413
+ ], Ql = "2026-07-28", $l = rc(), Z = D().min(1), eu = Z.max(256).describe("Stable identity for this mutation. Retry with the same key and identical arguments, even after a lost response."), tu = fs().min(1).max(100).default(50), Q = Z.describe("Exact Flow ID returned by flow_list or flow_create."), nu = Z.describe("Exact Run ID returned by flow_run or run_list."), ru = "Use flow_list and flow_get to inspect a Flow. Use flow_schema to learn atomic edit operations, then flow_apply with the observed expectedRevisionId and a stable idempotencyKey. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_create, flow_apply, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
6353
6414
  function $(e, t, n) {
6354
6415
  return {
6355
6416
  description: e,
@@ -6376,23 +6437,23 @@ function $(e, t, n) {
6376
6437
  } }
6377
6438
  };
6378
6439
  }
6379
- var Ql = {
6440
+ var iu = {
6380
6441
  flow_list: $("List Flows in this deployment. Continue with nextCursor; cursors are compatible with the Control API.", N({
6381
6442
  cursor: Z.optional(),
6382
- limit: Yl
6443
+ limit: tu
6383
6444
  }), !0),
6384
6445
  flow_get: $("Read Flow metadata, the full Draft and current Live publication. Use draft.revisionId as the base of an edit.", N({ flowId: Q }), !0),
6385
6446
  flow_schema: $("Get the JSON Schema for atomic change operations, optionally one operation kind. Node titles must be non-empty and unique within a graph.", N({ kind: Z.optional() }), !0),
6386
6447
  flow_create: $("Create an empty Flow. If this deployment uses OOMOL Connector, choose a teamId from connector_teams. Keep the key and arguments stable when retrying.", N({
6387
6448
  name: Z.refine((e) => e == e.trim() && Vc(e) == null, "Flow name is invalid."),
6388
- idempotencyKey: Jl,
6449
+ idempotencyKey: eu,
6389
6450
  teamId: Z.optional()
6390
6451
  }), !1),
6391
6452
  flow_apply: $("Apply ordered atomic changes. Read flow_schema first. A stale expectedRevisionId is a conflict; reread the Draft before deciding on a new edit.", N({
6392
6453
  flowId: Q,
6393
6454
  expectedRevisionId: Z,
6394
- idempotencyKey: Jl,
6395
- operations: j(ql).min(1).describe("Change operations defined by flow_schema. Explicit IDs and before values refer to the base Revision.")
6455
+ idempotencyKey: eu,
6456
+ operations: j($l).min(1).describe("Change operations defined by flow_schema. Explicit IDs and before values refer to the base Revision.")
6396
6457
  }), !1),
6397
6458
  flow_check: $("Validate a fixed Revision and return diagnostics. Get its revisionId from flow_get or flow_apply.", N({
6398
6459
  flowId: Q,
@@ -6402,7 +6463,7 @@ var Ql = {
6402
6463
  flowId: Q,
6403
6464
  revisionId: Z,
6404
6465
  expectedLivePublicationId: Z.nullable(),
6405
- idempotencyKey: Jl
6466
+ idempotencyKey: eu
6406
6467
  }), !1),
6407
6468
  flow_publish_status: $("Read a publish operation. Only succeeded confirms publication; failed includes the failure details. Keep polling while pending.", N({
6408
6469
  flowId: Q,
@@ -6420,34 +6481,34 @@ var Ql = {
6420
6481
  publicationId: Z.optional(),
6421
6482
  trigger: N({
6422
6483
  nodeId: Z,
6423
- payload: ql
6484
+ payload: $l
6424
6485
  }),
6425
- inputs: F(D(), F(D(), ql)).default({}),
6426
- idempotencyKey: Jl
6486
+ inputs: F(D(), F(D(), $l)).default({}),
6487
+ idempotencyKey: eu
6427
6488
  }), !1),
6428
6489
  run_list: $("List Runs for a Flow, optionally filtered by status. Continue with nextCursor; cursors are compatible with the Control API.", N({
6429
6490
  flowId: Q,
6430
6491
  status: I(oc).optional(),
6431
6492
  cursor: Z.optional(),
6432
- limit: Yl
6493
+ limit: tu
6433
6494
  }), !0),
6434
- run_get: $("Read Run status, including waiting details and allowed actions. Completed, failed, canceled and indeterminate are terminal.", N({ runId: Xl }), !0),
6495
+ run_get: $("Read Run status, including waiting details and allowed actions. Completed, failed, canceled and indeterminate are terminal.", N({ runId: nu }), !0),
6435
6496
  run_events: $("Read one page of Run events. Continue with nextAfter. Events can expire independently of the terminal result.", N({
6436
- runId: Xl,
6497
+ runId: nu,
6437
6498
  after: fs().min(0).default(0),
6438
- limit: Yl
6499
+ limit: tu
6439
6500
  }), !0),
6440
- run_result: $("Read the terminal result. A queued, running or waiting Run returns run.not-terminal; inspect run_get first.", N({ runId: Xl }), !0),
6501
+ run_result: $("Read the terminal result. A queued, running or waiting Run returns run.not-terminal; inspect run_get first.", N({ runId: nu }), !0),
6441
6502
  run_results: $("List stored Agent tool result metadata for a Run, including Connector and code results. Continue with nextAfter as after. Use run_result_read to inspect content.", N({
6442
- runId: Xl,
6503
+ runId: nu,
6443
6504
  after: Z.optional()
6444
6505
  }), !0),
6445
6506
  run_result_read: $("Read a bounded page of a stored Agent tool result. Select a JSON Pointer with pointer and continue with nextOffset as offset at the same pointer. A complete value contains all data at that pointer.", Hc.extend({
6446
- runId: Xl,
6507
+ runId: nu,
6447
6508
  resultId: Z
6448
6509
  }), !0),
6449
6510
  run_resolve_wait: $("Explicitly resolve the waitId observed in run_get with one of its allowed actions. The first decision wins; inspect resolutionAccepted and action. Resume the same Run and poll run_get; do not create a replacement Run.", N({
6450
- runId: Xl,
6511
+ runId: nu,
6451
6512
  waitId: Z,
6452
6513
  action: I([
6453
6514
  "approve",
@@ -6455,7 +6516,7 @@ var Ql = {
6455
6516
  "reject"
6456
6517
  ])
6457
6518
  }), !1),
6458
- run_cancel: $("Explicitly cancel a Run. Inspect cancelAccepted and the authoritative status; completion can win the race.", N({ runId: Xl }), !1),
6519
+ run_cancel: $("Explicitly cancel a Run. Inspect cancelAccepted and the authoritative status; completion can win the race.", N({ runId: nu }), !1),
6459
6520
  connector_teams: $("List OOMOL Teams available for Flow creation. An unconfigured or custom Connector may not provide Teams.", N({}), !0),
6460
6521
  connector_list: $("List Connector providers available in the Flow scope.", N({ flowId: Q.optional() }), !0),
6461
6522
  connector_search: $("Search Connector actions in the Flow scope.", N({
@@ -6474,4 +6535,4 @@ var Ql = {
6474
6535
  trigger_get: $("Read a provider Trigger definition before creating its node.", N({ key: Z }), !0)
6475
6536
  };
6476
6537
  //#endregion
6477
- export { Gl as mcpConformanceCases, Zl as mcpInstructions, Kl as mcpProtocolVersion, Ql as mcpTools };
6538
+ export { Zl as mcpConformanceCases, ru as mcpInstructions, Ql as mcpProtocolVersion, iu as mcpTools };