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

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 (63) hide show
  1. package/dist/browser/{createResourceDialog-FBRnCMK6.js → createResourceDialog-DRB0OEtr.js} +2 -2
  2. package/dist/browser/{editorComponent-CyH2o-Ji.js → editorComponent-bXA-KosC.js} +2744 -1113
  3. package/dist/browser/flow-authoring-node.d.ts +5 -3
  4. package/dist/browser/flow-authoring.js +1569 -1462
  5. package/dist/browser/flow-change.d.ts +44 -17
  6. package/dist/browser/flow-change.js +1614 -1492
  7. package/dist/browser/flow-input-value.d.ts +6 -0
  8. package/dist/browser/flow-notifications.d.ts +5 -0
  9. package/dist/browser/flowChanges-FiZJreeB.js +9855 -0
  10. package/dist/browser/{flowRunInputEditorStore-CTORQcA2.js → flowRunInputEditorStore-Bgb5vSeS.js} +3 -3
  11. package/dist/browser/flowWorkspace-CBo6Ih_c.js +40987 -0
  12. package/dist/browser/{inputValues-C21gYJuc.js → inputValues-CUyjbECo.js} +2 -2
  13. package/dist/browser/licenses.md +0 -58
  14. package/dist/browser/{lite-BuKZ8joP.js → lite-BA96NG4M.js} +8 -4
  15. package/dist/browser/theme.css +2 -0
  16. package/dist/browser/ui.css +2 -1
  17. package/dist/browser/ui.d.ts +31 -3
  18. package/dist/browser/ui.js +3547 -772
  19. package/dist/browser/{value-DPg_9yXB.js → value-B_yE9ean.js} +22 -14
  20. package/dist/browser/workbench.css +1 -1
  21. package/dist/browser/workbench.d.ts +1 -0
  22. package/dist/browser/workbench.js +3944 -1077
  23. package/dist/browser/{workbenchSelect-DAaGuZwP.js → workbenchSelect-DNteZJYP.js} +1695 -1471
  24. package/dist/common/control-api-conformance.d.ts +6 -0
  25. package/dist/common/control-api-conformance.js +502 -388
  26. package/dist/common/control-api-errors.d.ts +16 -0
  27. package/dist/common/control-api.d.ts +49 -6
  28. package/dist/common/control-api.js +1715 -1564
  29. package/dist/common/control-requests.d.ts +10 -0
  30. package/dist/common/control-requests.js +1182 -1137
  31. package/dist/common/event-sources.d.ts +0 -1
  32. package/dist/common/feishu-events.d.ts +0 -1
  33. package/dist/common/flow-encoding.js +580 -557
  34. package/dist/common/flow-graph.d.ts +16 -9
  35. package/dist/common/flow-notifications.d.ts +5 -0
  36. package/dist/common/flow-semantics.d.ts +2 -2
  37. package/dist/common/flow-semantics.js +2184 -1912
  38. package/dist/common/fr-ClB96SQY.js +298 -0
  39. package/dist/common/integration-trigger.d.ts +1 -0
  40. package/dist/common/integration-trigger.js +7572 -88
  41. package/dist/common/ja-BJF-VrP2.js +298 -0
  42. package/dist/common/ko-Bght_VaB.js +298 -0
  43. package/dist/common/mcp.js +1718 -1571
  44. package/dist/common/poll-trigger.d.ts +3 -1
  45. package/dist/common/poll-trigger.js +7512 -28
  46. package/dist/common/provider-triggers.js +6798 -3518
  47. package/dist/common/ru-DrP4BRM5.js +298 -0
  48. package/dist/common/runtime-contract.d.ts +1 -1
  49. package/dist/common/runtime-contract.js +41 -27
  50. package/dist/common/scheduler.js +921 -738
  51. package/dist/common/trigger-catalog.d.ts +3 -1
  52. package/dist/common/trigger-config.d.ts +7 -0
  53. package/dist/common/zh-CN-D2od3TNw.js +298 -0
  54. package/dist/common/zh-TW-CRmc3FMz.js +298 -0
  55. package/package.json +1 -1
  56. package/dist/browser/flowChanges-ScpWTKtQ.js +0 -12293
  57. package/dist/browser/flowWorkspace-CY1r6dwz.js +0 -153101
  58. package/dist/common/fr-iv1541dF.js +0 -93
  59. package/dist/common/ja-Bq-ZDOD4.js +0 -93
  60. package/dist/common/ko-Z-k9R2c6.js +0 -93
  61. package/dist/common/ru-B4gFecYZ.js +0 -93
  62. package/dist/common/zh-CN-ByQ6nYam.js +0 -93
  63. package/dist/common/zh-TW-QjIarvX9.js +0 -93
@@ -4208,7 +4208,6 @@ j({
4208
4208
  name: Bs,
4209
4209
  provider: P(["feishu", "feishu_app_bot"]),
4210
4210
  appId: Rs,
4211
- tenantKey: Rs,
4212
4211
  connectionId: Rs,
4213
4212
  teamId: Rs.nullable(),
4214
4213
  enabled: O(),
@@ -4241,6 +4240,10 @@ var I = {
4241
4240
  authorizationDenied: "authorization.denied",
4242
4241
  bindingUnresolved: "binding.unresolved",
4243
4242
  connectorActionNotFound: "connector.action-not-found",
4243
+ connectorAccessConflict: "connector.access-conflict",
4244
+ connectorAccessInvalid: "connector.access-invalid",
4245
+ connectorAccessRequired: "connector.access-required",
4246
+ connectorAccessUnsupported: "connector.access-unsupported",
4244
4247
  connectorUnconfigured: "connector.unconfigured",
4245
4248
  connectorUnavailable: "connector.unavailable",
4246
4249
  connectorConsoleUnconfigured: "connector.console-unconfigured",
@@ -4280,7 +4283,7 @@ var I = {
4280
4283
  variableLimitReached: "variable.limit-reached",
4281
4284
  variableNotFound: "variable.not-found"
4282
4285
  };
4283
- I.eventSourceInvalid, I.eventSourceIdentityUnavailable, I.eventSourceNotFound, I.eventSourceConflict, I.authenticationRequired, I.authorizationDenied, I.bindingUnresolved, I.connectorActionNotFound, I.connectorUnconfigured, I.connectorUnavailable, I.connectorConsoleUnconfigured, I.engineUnavailable, I.engineUnsupported, I.flowInvalid, I.flowRepairRequired, I.flowUpgradeRequired, I.flowNotFound, I.flowBusy, I.flowConflict, I.flowPresentationConflict, I.flowRevisionConflict, I.liveConflict, I.liveNotFound, I.pageInvalidCursor, I.publicationConflict, I.publicationNotFound, I.publicationUnsupported, I.publishOperationNotFound, I.routeNotFound, I.runConflict, I.runEventsExpired, I.runInvalid, I.runNotFound, I.runNotTerminal, I.runOverloaded, I.runWaitNotFound, I.triggerKeyInvalid, I.triggerKeyNotFound, I.triggerNotFound, I.variableInvalid, I.variableLimitReached, I.variableNotFound;
4286
+ I.eventSourceInvalid, I.eventSourceIdentityUnavailable, I.eventSourceNotFound, I.eventSourceConflict, I.authenticationRequired, I.authorizationDenied, I.bindingUnresolved, I.connectorActionNotFound, I.connectorAccessConflict, I.connectorAccessInvalid, I.connectorAccessRequired, I.connectorAccessUnsupported, I.connectorUnconfigured, I.connectorUnavailable, I.connectorConsoleUnconfigured, I.engineUnavailable, I.engineUnsupported, I.flowInvalid, I.flowRepairRequired, I.flowUpgradeRequired, I.flowNotFound, I.flowBusy, I.flowConflict, I.flowPresentationConflict, I.flowRevisionConflict, I.liveConflict, I.liveNotFound, I.pageInvalidCursor, I.publicationConflict, I.publicationNotFound, I.publicationUnsupported, I.publishOperationNotFound, I.routeNotFound, I.runConflict, I.runEventsExpired, I.runInvalid, I.runNotFound, I.runNotTerminal, I.runOverloaded, I.runWaitNotFound, I.triggerKeyInvalid, I.triggerKeyNotFound, I.triggerNotFound, I.variableInvalid, I.variableLimitReached, I.variableNotFound;
4284
4287
  var Vs = class extends Error {
4285
4288
  constructor(e, t, n) {
4286
4289
  super(n), this.code = t, this.name = "ApiError", this.status = e;
@@ -4306,7 +4309,16 @@ function Ws(e) {
4306
4309
  let t = Hs(e);
4307
4310
  return Object.fromEntries(Object.entries(t).map(([e, t]) => [e, Ws(t)]));
4308
4311
  }
4309
- j({
4312
+ M([j({
4313
+ handle: T().min(1),
4314
+ description: T().optional(),
4315
+ jsonSchema: Ls(),
4316
+ nullable: O(),
4317
+ value: Ls().optional()
4318
+ }), j({
4319
+ group: T(),
4320
+ collapsed: O().optional()
4321
+ })]), j({
4310
4322
  pointer: T().max(4096).default(""),
4311
4323
  offset: D().int().nonnegative().default(0),
4312
4324
  limit: D().int().min(1).max(100).default(20),
@@ -4370,58 +4382,67 @@ var Ys = k(M([A({
4370
4382
  "week"
4371
4383
  ]),
4372
4384
  value: D()
4373
- })])), z = T(), B = Ls(), Xs = k(z), Zs = A({
4385
+ })])), z = T(), Xs = Ls(), Zs = k(z), Qs = A({
4374
4386
  description: z.optional(),
4375
- jsonSchema: B,
4387
+ jsonSchema: Xs,
4376
4388
  nullable: O(),
4377
4389
  handle: z
4378
- }), V = Zs.extend({ value: B.optional() }), Qs = A({
4390
+ }), B = Qs.extend({ value: Xs.optional() }), $s = A({
4379
4391
  collapsed: O().optional(),
4380
4392
  group: z
4381
- }), $s = A({
4393
+ }), ec = A({
4382
4394
  kind: F("node"),
4383
4395
  nodeId: z,
4384
- output: z
4385
- }), ec = A({
4396
+ output: z,
4397
+ field: z.optional()
4398
+ }), tc = A({
4386
4399
  kind: F("flow"),
4387
4400
  input: z
4388
- }), tc = M([
4389
- $s,
4401
+ }), nc = M([
4390
4402
  ec,
4403
+ tc,
4391
4404
  A({
4392
4405
  kind: F("binding"),
4393
4406
  bindingId: z
4394
4407
  })
4395
- ]), nc = M([A({
4408
+ ]), rc = M([A({ kind: F("unset") }), A({
4396
4409
  kind: F("value"),
4397
- value: B
4398
- }), A({
4410
+ value: Xs
4411
+ })]), ic = M([rc, A({
4399
4412
  kind: F("sources"),
4400
- sources: k(tc)
4401
- })]), rc = N(z, nc), ic = {
4402
- inputs: k(M([V, Qs])),
4403
- outputs: k(M([Zs, Qs]))
4404
- }, ac = A({
4413
+ sources: k(nc)
4414
+ })]), ac = N(z, ic), oc = {
4415
+ inputs: k(M([B, $s])),
4416
+ outputs: k(M([Qs, $s]))
4417
+ }, sc = M([j({
4405
4418
  kind: F("connector"),
4406
4419
  action: z,
4407
4420
  connectionId: z.optional(),
4408
- connections: k(A({
4421
+ connections: k(j({
4409
4422
  connectionId: z,
4410
4423
  alias: z.optional()
4411
4424
  }))
4412
- }), oc = A({
4413
- ...ic,
4425
+ }), j({
4426
+ kind: F("connector"),
4427
+ actionHints: k(z).optional(),
4428
+ connectionHints: k(j({
4429
+ action: z,
4430
+ connectionId: z,
4431
+ alias: z.optional()
4432
+ })).optional()
4433
+ })]), cc = A({
4434
+ ...oc,
4414
4435
  name: z,
4415
4436
  moduleId: z,
4416
- capabilities: k(ac).optional()
4417
- }), sc = M([A({
4437
+ capabilities: k(sc).optional()
4438
+ }), lc = M([A({
4418
4439
  kind: F("value"),
4419
- value: B
4440
+ value: Xs
4420
4441
  }), A({
4421
4442
  kind: F("input"),
4422
4443
  input: z
4423
- })]), cc = M([sc, A({ kind: F("model") })]), lc = A({
4424
- ...ic,
4444
+ })]), uc = M([lc, A({ kind: F("model") })]), dc = A({
4445
+ ...oc,
4425
4446
  name: z,
4426
4447
  executor: M([
4427
4448
  A({
@@ -4437,7 +4458,7 @@ var Ys = k(M([A({
4437
4458
  kind: F("agent"),
4438
4459
  code: O().optional(),
4439
4460
  model: z,
4440
- prompt: sc,
4461
+ prompt: lc,
4441
4462
  system: z,
4442
4463
  maxRounds: D(),
4443
4464
  tools: k(A({
@@ -4447,22 +4468,29 @@ var Ys = k(M([A({
4447
4468
  action: z,
4448
4469
  connectionId: z.optional(),
4449
4470
  approval: O(),
4450
- inputs: k(V.extend({ source: cc }))
4471
+ inputs: k(B.extend({ source: uc }))
4451
4472
  })),
4452
4473
  notification: A({
4453
4474
  taskId: z,
4454
4475
  messageHandle: z,
4455
- inputs: N(z, sc)
4476
+ inputs: N(z, lc)
4456
4477
  }).optional()
4457
4478
  })
4458
4479
  ])
4459
- }), uc = {
4460
- input: V,
4480
+ }), fc = M([A({
4481
+ kind: F("value"),
4482
+ value: Xs.optional(),
4483
+ jsonSchema: Xs.optional()
4484
+ }), A({
4485
+ kind: F("source"),
4486
+ source: nc
4487
+ })]), pc = {
4488
+ matchMode: P(["first", "all"]),
4461
4489
  cases: k(A({
4490
+ description: z.optional(),
4462
4491
  output: z,
4463
- relation: P(["all", "any"]),
4464
- expressions: k(A({
4465
- input: z,
4492
+ groups: k(A({ expressions: k(A({
4493
+ left: fc,
4466
4494
  operator: P([
4467
4495
  "!=",
4468
4496
  "<",
@@ -4485,33 +4513,32 @@ var Ys = k(M([A({
4485
4513
  "notHasValue",
4486
4514
  "startsWith"
4487
4515
  ]),
4488
- value: B.optional()
4489
- }))
4490
- })),
4491
- defaultOutput: z.optional()
4492
- }, dc = {
4493
- inputDefinitions: k(V),
4516
+ right: fc.optional()
4517
+ })) }))
4518
+ }))
4519
+ }, mc = {
4520
+ inputDefinitions: k(B),
4494
4521
  prompt: z
4495
- }, fc = {
4496
- bodyFields: k(V),
4522
+ }, hc = {
4523
+ bodyFields: k(B),
4497
4524
  options: A({
4498
- allowedMethods: Xs.optional(),
4499
- allowedOrigins: Xs.optional(),
4525
+ allowedMethods: Zs.optional(),
4526
+ allowedOrigins: Zs.optional(),
4500
4527
  noResponseBody: O().optional(),
4501
4528
  responseData: z.optional(),
4502
4529
  responseHeaders: N(z, z).optional(),
4503
4530
  responseStatusCode: D().optional()
4504
4531
  }).optional()
4505
- }, pc = {
4506
- configSchema: B,
4532
+ }, gc = {
4533
+ configInputs: oc.inputs,
4507
4534
  definitionVersion: F(2),
4508
4535
  description: z,
4509
4536
  displayName: z,
4510
4537
  key: z,
4511
4538
  name: z,
4512
- outputs: k(Zs).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
4539
+ outputs: k(Qs).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
4513
4540
  provider: z
4514
- }, mc = A({
4541
+ }, _c = A({
4515
4542
  body: A({
4516
4543
  allowArray: O(),
4517
4544
  allowEmpty: O(),
@@ -4531,134 +4558,135 @@ var Ys = k(M([A({
4531
4558
  "PUT"
4532
4559
  ])),
4533
4560
  successStatus: D()
4534
- }), hc = {
4561
+ }), vc = {
4535
4562
  name: z,
4536
4563
  description: z.optional(),
4537
4564
  icon: z.optional()
4538
- }, gc = {
4565
+ }, yc = {
4539
4566
  maxExecutions: D().int().positive().max(2 ** 53 - 1).optional(),
4540
- inputs: rc,
4567
+ inputs: ac,
4541
4568
  name: z.optional(),
4542
4569
  description: z.optional(),
4543
4570
  icon: z.optional(),
4544
4571
  timeoutMs: D().optional()
4545
- }, _c = M([
4572
+ }, bc = M([
4546
4573
  A({
4547
- ...gc,
4574
+ ...yc,
4575
+ inputs: N(z, ts()),
4548
4576
  kind: F("condition"),
4549
- ...uc
4577
+ ...pc
4550
4578
  }),
4551
4579
  A({
4552
- ...gc,
4580
+ ...yc,
4553
4581
  inputs: $o().transform(() => ({})).default({}),
4554
4582
  kind: F("value"),
4555
- values: k(V)
4583
+ values: k(B)
4556
4584
  }),
4557
4585
  A({
4558
- ...gc,
4586
+ ...yc,
4559
4587
  kind: F("subflow"),
4560
4588
  subflowId: z
4561
4589
  }),
4562
4590
  A({
4563
- ...gc,
4591
+ ...yc,
4564
4592
  kind: F("task"),
4565
- task: oc,
4566
- additionalInputs: k(V).optional()
4593
+ task: cc,
4594
+ additionalInputs: k(B).optional()
4567
4595
  }),
4568
4596
  A({
4569
- ...gc,
4597
+ ...yc,
4570
4598
  kind: F("task"),
4571
4599
  taskId: z,
4572
- additionalInputs: k(V).optional()
4600
+ additionalInputs: k(B).optional()
4573
4601
  }),
4574
4602
  j({
4575
- ...gc,
4603
+ ...yc,
4576
4604
  kind: F("approval"),
4577
- ...dc
4605
+ ...mc
4578
4606
  }).omit({ timeoutMs: !0 }),
4579
4607
  j({
4580
- ...gc,
4608
+ ...yc,
4581
4609
  kind: F("wait"),
4582
- ...dc
4610
+ ...mc
4583
4611
  }).omit({ timeoutMs: !0 }),
4584
4612
  A({
4585
- ...hc,
4613
+ ...vc,
4586
4614
  kind: F("manual")
4587
4615
  }),
4588
4616
  A({
4589
- ...hc,
4617
+ ...vc,
4590
4618
  kind: F("webhook"),
4591
- ...fc
4619
+ ...hc
4592
4620
  }),
4593
4621
  A({
4594
- ...hc,
4622
+ ...vc,
4595
4623
  kind: F("cron"),
4596
4624
  cronTimes: Ys
4597
4625
  }),
4598
4626
  A({
4599
- ...hc,
4627
+ ...vc,
4600
4628
  kind: F("poll"),
4601
4629
  bindingId: z,
4602
- config: N(z, B),
4630
+ config: N(z, rc),
4603
4631
  definition: A({
4604
- ...pc,
4632
+ ...gc,
4605
4633
  type: F("poll")
4606
4634
  }),
4607
4635
  pollTimes: Ys
4608
4636
  }),
4609
4637
  A({
4610
- ...hc,
4638
+ ...vc,
4611
4639
  kind: F("integration"),
4612
4640
  bindingId: z,
4613
- config: N(z, B),
4641
+ config: N(z, rc),
4614
4642
  definition: A({
4615
- ...pc,
4643
+ ...gc,
4616
4644
  type: F("integration"),
4617
- endpoint: mc
4645
+ endpoint: _c
4618
4646
  })
4619
4647
  })
4620
- ]), vc = M([A({ kind: F("flow") }), A({
4648
+ ]), xc = M([A({ kind: F("flow") }), A({
4621
4649
  kind: F("subflow"),
4622
4650
  id: z
4623
- })]), yc = A({
4651
+ })]), Sc = A({
4624
4652
  source: z,
4625
4653
  target: z,
4626
4654
  sourceHandle: z.optional()
4627
- }), H = {
4655
+ }), V = {
4628
4656
  nodeId: z,
4629
- target: vc
4630
- }, bc = A({
4657
+ target: xc
4658
+ }, Cc = A({
4631
4659
  name: z,
4632
- inputs: k(V),
4633
- outputs: k(Zs.extend({ sources: k(M([$s, ec])) }))
4634
- }), xc = A({
4635
- nodes: N(z, _c),
4636
- edges: k(yc).default([])
4637
- }), Sc = A({
4660
+ inputs: k(B),
4661
+ outputs: k(Qs.extend({ sources: k(M([ec, tc])) }))
4662
+ }), wc = A({
4663
+ nodes: N(z, bc),
4664
+ edges: k(Sc).default([])
4665
+ }), Tc = A({
4638
4666
  kind: P(["connection", "variable"]),
4639
4667
  target: z
4640
- }), Cc = A({
4668
+ }), Ec = A({
4641
4669
  name: z,
4642
- imports: Xs,
4670
+ imports: Zs,
4643
4671
  source: z
4644
- }), wc = A({
4645
- bindings: N(z, Sc),
4646
- graph: xc,
4647
- subflows: N(z, bc.extend({ graph: xc })),
4648
- tasks: N(z, lc)
4672
+ }), Dc = A({
4673
+ bindings: N(z, Tc),
4674
+ graph: wc,
4675
+ subflows: N(z, Cc.extend({ graph: wc })),
4676
+ tasks: N(z, dc)
4649
4677
  });
4650
4678
  A({
4651
4679
  modelVersion: M([F(2), F(3)]),
4652
- document: wc,
4653
- modules: N(z, Cc)
4680
+ document: Dc,
4681
+ modules: N(z, Ec)
4654
4682
  }).extend({
4655
4683
  kind: F("open-flow-flow-revision"),
4656
4684
  version: F(1)
4657
4685
  });
4658
- var Tc = {
4686
+ var Oc = {
4659
4687
  "binding.create": {
4660
4688
  bindingId: z,
4661
- binding: Sc
4689
+ binding: Tc
4662
4690
  },
4663
4691
  "binding.delete": { bindingId: z },
4664
4692
  "binding.target.set": {
@@ -4667,21 +4695,21 @@ var Tc = {
4667
4695
  value: z
4668
4696
  },
4669
4697
  "graph.edge.connect": {
4670
- target: vc,
4671
- edge: yc
4698
+ target: xc,
4699
+ edge: Sc
4672
4700
  },
4673
4701
  "graph.edge.disconnect": {
4674
- target: vc,
4675
- edge: yc
4702
+ target: xc,
4703
+ edge: Sc
4676
4704
  },
4677
4705
  "graph.node.create": {
4678
- ...H,
4679
- node: _c
4706
+ ...V,
4707
+ node: bc
4680
4708
  },
4681
- "graph.node.delete": H,
4709
+ "graph.node.delete": V,
4682
4710
  "graph.node.field.set": M([
4683
4711
  A({
4684
- ...H,
4712
+ ...V,
4685
4713
  kind: F("graph.node.field.set"),
4686
4714
  field: P([
4687
4715
  "description",
@@ -4692,14 +4720,14 @@ var Tc = {
4692
4720
  value: z.optional()
4693
4721
  }),
4694
4722
  A({
4695
- ...H,
4723
+ ...V,
4696
4724
  kind: F("graph.node.field.set"),
4697
4725
  field: F("maxExecutions"),
4698
4726
  before: D().int().positive().max(2 ** 53 - 1).optional(),
4699
4727
  value: D().int().positive().max(2 ** 53 - 1).optional()
4700
4728
  }),
4701
4729
  A({
4702
- ...H,
4730
+ ...V,
4703
4731
  kind: F("graph.node.field.set"),
4704
4732
  field: F("timeoutMs"),
4705
4733
  before: D().optional(),
@@ -4707,58 +4735,58 @@ var Tc = {
4707
4735
  })
4708
4736
  ]),
4709
4737
  "graph.node.input.set": {
4710
- ...H,
4738
+ ...V,
4711
4739
  handle: z,
4712
- before: nc.optional(),
4713
- value: nc.optional()
4740
+ before: ic.optional(),
4741
+ value: ic.optional()
4714
4742
  },
4715
4743
  "graph.node.additional-inputs.set": {
4716
- ...H,
4717
- before: k(V).optional(),
4718
- value: k(V).optional()
4744
+ ...V,
4745
+ before: k(B).optional(),
4746
+ value: k(B).optional()
4719
4747
  },
4720
4748
  "graph.node.condition.set": {
4721
- ...H,
4722
- before: A(uc),
4723
- value: A(uc)
4749
+ ...V,
4750
+ before: A(pc),
4751
+ value: A(pc)
4724
4752
  },
4725
4753
  "graph.node.values.set": {
4726
- ...H,
4727
- before: k(V),
4728
- value: k(V)
4754
+ ...V,
4755
+ before: k(B),
4756
+ value: k(B)
4729
4757
  },
4730
4758
  "graph.node.resolution.set": {
4731
- ...H,
4759
+ ...V,
4732
4760
  target: A({ kind: F("flow") }),
4733
- before: A(dc),
4734
- value: A(dc)
4761
+ before: A(mc),
4762
+ value: A(mc)
4735
4763
  },
4736
4764
  "graph.node.webhook.set": {
4737
- ...H,
4765
+ ...V,
4738
4766
  target: A({ kind: F("flow") }),
4739
- before: A(fc),
4740
- value: A(fc)
4767
+ before: A(hc),
4768
+ value: A(hc)
4741
4769
  },
4742
4770
  "graph.node.task.ports.set": {
4743
- ...H,
4744
- before: A(ic),
4745
- value: A(ic)
4771
+ ...V,
4772
+ before: A(oc),
4773
+ value: A(oc)
4746
4774
  },
4747
4775
  "graph.node.task.name.set": {
4748
- ...H,
4776
+ ...V,
4749
4777
  before: z,
4750
4778
  value: z
4751
4779
  },
4752
4780
  "graph.node.task.capabilities.set": {
4753
- ...H,
4754
- before: k(ac).optional(),
4755
- value: k(ac).optional()
4781
+ ...V,
4782
+ before: k(sc).optional(),
4783
+ value: k(sc).optional()
4756
4784
  },
4757
4785
  "graph.trigger.config.set": {
4758
4786
  nodeId: z,
4759
4787
  name: z,
4760
- before: B.optional(),
4761
- value: B.optional()
4788
+ before: rc.optional(),
4789
+ value: rc.optional()
4762
4790
  },
4763
4791
  "graph.trigger.schedule.set": {
4764
4792
  nodeId: z,
@@ -4767,7 +4795,7 @@ var Tc = {
4767
4795
  },
4768
4796
  "module.create": {
4769
4797
  moduleId: z,
4770
- module: Cc
4798
+ module: Ec
4771
4799
  },
4772
4800
  "module.delete": { moduleId: z },
4773
4801
  "module.rename": {
@@ -4777,24 +4805,24 @@ var Tc = {
4777
4805
  },
4778
4806
  "module.source.replace": {
4779
4807
  moduleId: z,
4780
- beforeImports: Xs,
4808
+ beforeImports: Zs,
4781
4809
  beforeSource: z,
4782
- imports: Xs,
4810
+ imports: Zs,
4783
4811
  source: z
4784
4812
  },
4785
4813
  "subflow.create": {
4786
4814
  subflowId: z,
4787
- subflow: bc.extend({ graph: xc })
4815
+ subflow: Cc.extend({ graph: wc })
4788
4816
  },
4789
4817
  "subflow.definition.set": {
4790
4818
  subflowId: z,
4791
- before: bc,
4792
- definition: bc
4819
+ before: Cc,
4820
+ definition: Cc
4793
4821
  },
4794
4822
  "subflow.delete": { subflowId: z },
4795
4823
  "task.create": {
4796
4824
  taskId: z,
4797
- task: lc
4825
+ task: dc
4798
4826
  },
4799
4827
  "task.delete": { taskId: z },
4800
4828
  "task.connector.connection.set": {
@@ -4804,8 +4832,8 @@ var Tc = {
4804
4832
  },
4805
4833
  "task.agent.set": {
4806
4834
  taskId: z,
4807
- before: lc,
4808
- value: lc
4835
+ before: dc,
4836
+ value: dc
4809
4837
  },
4810
4838
  "task.llm.mode.set": {
4811
4839
  taskId: z,
@@ -4818,16 +4846,16 @@ var Tc = {
4818
4846
  value: z
4819
4847
  }
4820
4848
  };
4821
- k(M([...new Map(Object.entries(Tc).map(([e, t]) => [e, t instanceof w ? t : A({
4849
+ k(M([...new Map(Object.entries(Oc).map(([e, t]) => [e, t instanceof w ? t : A({
4822
4850
  kind: F(e),
4823
4851
  ...t
4824
4852
  })])).values()])).min(1), new TextEncoder();
4825
- var Ec = N(T(), $o()), Dc = A({
4853
+ var kc = N(T(), $o()), Ac = A({
4826
4854
  jsonSchema: $o(),
4827
4855
  nullable: O(),
4828
4856
  value: $o().optional(),
4829
4857
  description: T().optional()
4830
- }).strict(), Oc = N(T(), Dc), kc = M([A({
4858
+ }).strict(), jc = N(T(), Ac), Mc = M([A({
4831
4859
  kind: F("value"),
4832
4860
  value: $o()
4833
4861
  }).strict(), A({
@@ -4837,36 +4865,36 @@ var Ec = N(T(), $o()), Dc = A({
4837
4865
  nodeId: T(),
4838
4866
  output: T()
4839
4867
  }).strict())
4840
- }).strict()]), Ac = {
4868
+ }).strict()]), Nc = {
4841
4869
  name: T().optional(),
4842
4870
  description: T().optional(),
4843
4871
  icon: T().optional()
4844
- }, jc = M([
4872
+ }, Pc = M([
4845
4873
  A({
4846
- ...Ac,
4874
+ ...Nc,
4847
4875
  kind: F("cron"),
4848
4876
  cronTimes: k($o())
4849
4877
  }).strict(),
4850
4878
  A({
4851
- ...Ac,
4879
+ ...Nc,
4852
4880
  kind: F("manual")
4853
4881
  }).strict(),
4854
4882
  A({
4855
- ...Ac,
4883
+ ...Nc,
4856
4884
  kind: F("task"),
4857
4885
  concurrency: F(1).optional(),
4858
- inputs: N(T(), kc),
4886
+ inputs: N(T(), Mc),
4859
4887
  task: A({
4860
4888
  name: T(),
4861
4889
  moduleId: T(),
4862
- inputs: Oc,
4863
- outputs: N(T(), Dc.omit({ value: !0 }))
4890
+ inputs: jc,
4891
+ outputs: N(T(), Ac.omit({ value: !0 }))
4864
4892
  }).strict()
4865
4893
  }).strict()
4866
4894
  ]);
4867
4895
  A({
4868
4896
  name: T(),
4869
- graph: A({ nodes: N(T(), jc) }).strict()
4897
+ graph: A({ nodes: N(T(), Pc) }).strict()
4870
4898
  }).strict(), A({
4871
4899
  kind: F("open-flow-project-revision"),
4872
4900
  version: F(1),
@@ -4877,15 +4905,15 @@ A({
4877
4905
  imports: k(T())
4878
4906
  }).strict()),
4879
4907
  document: A({
4880
- bindings: Ec,
4881
- flows: Ec,
4882
- subflows: Ec,
4883
- tasks: Ec
4908
+ bindings: kc,
4909
+ flows: kc,
4910
+ subflows: kc,
4911
+ tasks: kc
4884
4912
  }).strict()
4885
4913
  }).strict();
4886
4914
  //#endregion
4887
4915
  //#region src/control/common/api.ts
4888
- function Mc(e) {
4916
+ function Fc(e) {
4889
4917
  let t = Hs(e), n = Us(t.sequence);
4890
4918
  if (n < 0) return L();
4891
4919
  let r = {
@@ -4913,7 +4941,7 @@ function Mc(e) {
4913
4941
  payload: {
4914
4942
  flowId: R(i.flowId),
4915
4943
  scopeId: R(i.scopeId),
4916
- progress: Nc(i.progress)
4944
+ progress: Ic(i.progress)
4917
4945
  }
4918
4946
  };
4919
4947
  case "run.waiting": return Array.isArray(i.waitIds) ? {
@@ -5022,7 +5050,7 @@ function Mc(e) {
5022
5050
  kind: a,
5023
5051
  payload: {
5024
5052
  ...e,
5025
- progress: Nc(i.progress)
5053
+ progress: Ic(i.progress)
5026
5054
  }
5027
5055
  };
5028
5056
  case "node.artifact": {
@@ -5048,45 +5076,45 @@ function Mc(e) {
5048
5076
  default: return L();
5049
5077
  }
5050
5078
  }
5051
- function Nc(e) {
5079
+ function Ic(e) {
5052
5080
  return typeof e == "number" && Number.isFinite(e) && e >= 0 && e <= 100 ? e : L();
5053
5081
  }
5054
5082
  //#endregion
5055
5083
  //#region src/control/common/conformance.ts
5056
- var U = "open-flow-engine/v5";
5057
- function W(e) {
5084
+ var H = "open-flow-engine/v5";
5085
+ function U(e) {
5058
5086
  throw Error(e);
5059
5087
  }
5060
- function G(e, n, r) {
5061
- t(e, n) || W(`${r}: expected ${JSON.stringify(n)}, received ${JSON.stringify(e)}.`);
5088
+ function W(e, n, r) {
5089
+ t(e, n) || U(`${r}: expected ${JSON.stringify(n)}, received ${JSON.stringify(e)}.`);
5090
+ }
5091
+ function G(e, t) {
5092
+ return (typeof e != "object" || !e || Array.isArray(e)) && U(`${t}: expected an object.`), e;
5062
5093
  }
5063
5094
  function K(e, t) {
5064
- return (typeof e != "object" || !e || Array.isArray(e)) && W(`${t}: expected an object.`), e;
5095
+ return Array.isArray(e) || U(`${t}: expected an array.`), e;
5065
5096
  }
5066
5097
  function q(e, t) {
5067
- return Array.isArray(e) || W(`${t}: expected an array.`), e;
5068
- }
5069
- function J(e, t) {
5070
- return (typeof e != "string" || e.length == 0) && W(`${t}: expected a non-empty string.`), e;
5098
+ return (typeof e != "string" || e.length == 0) && U(`${t}: expected a non-empty string.`), e;
5071
5099
  }
5072
- async function Y(e, t, n) {
5073
- return G(e.status, t, `${n} status`), K(await e.json().catch(() => W(`${n} body: expected JSON.`)), `${n} body`);
5100
+ async function J(e, t, n) {
5101
+ return W(e.status, t, `${n} status`), G(await e.json().catch(() => U(`${n} body: expected JSON.`)), `${n} body`);
5074
5102
  }
5075
- async function X(e, t, n, r, i) {
5076
- let a = await Y(e, t, r), o = K(a.error, `${r} error`);
5077
- G(o.code, n, `${r} error code`);
5078
- let s = J(o.message, `${r} error message`);
5079
- i != null && !s.includes(i) && W(`${r} error message: expected ${JSON.stringify(i)} in ${JSON.stringify(s)}.`), G(a.version, 1, `${r} version`);
5103
+ async function Y(e, t, n, r, i) {
5104
+ let a = await J(e, t, r), o = G(a.error, `${r} error`);
5105
+ W(o.code, n, `${r} error code`);
5106
+ let s = q(o.message, `${r} error message`);
5107
+ i != null && !s.includes(i) && U(`${r} error message: expected ${JSON.stringify(i)} in ${JSON.stringify(s)}.`), W(a.version, 1, `${r} version`);
5080
5108
  }
5081
- function Z(e, t, n = {}) {
5109
+ function X(e, t, n = {}) {
5082
5110
  let r = new Headers(n.headers);
5083
5111
  return n.body != null && !r.has("content-type") && r.set("content-type", "application/json"), e.request(new Request(new URL(t, e.origin), {
5084
5112
  ...n,
5085
5113
  headers: r
5086
5114
  }));
5087
5115
  }
5088
- function Pc(e, t, n) {
5089
- return Z(e, "/v1/flows", {
5116
+ function Lc(e, t, n) {
5117
+ return X(e, "/v1/flows", {
5090
5118
  body: JSON.stringify({
5091
5119
  name: t,
5092
5120
  version: 1
@@ -5095,11 +5123,11 @@ function Pc(e, t, n) {
5095
5123
  method: "POST"
5096
5124
  });
5097
5125
  }
5098
- async function Q(e, t, n) {
5099
- return Y(await Pc(e, t, n), 201, "Create Flow");
5126
+ async function Z(e, t, n) {
5127
+ return J(await Lc(e, t, n), 201, "Create Flow");
5100
5128
  }
5101
- function Fc(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
5102
- return Z(e, `/v1/flows/${encodeURIComponent(t)}/draft/changes`, {
5129
+ function Rc(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
5130
+ return X(e, `/v1/flows/${encodeURIComponent(t)}/draft/changes`, {
5103
5131
  body: JSON.stringify({
5104
5132
  expectedRevisionId: n,
5105
5133
  operations: r,
@@ -5109,8 +5137,8 @@ function Fc(e, t, n, r, i = `change-${crypto.randomUUID()}`) {
5109
5137
  method: "POST"
5110
5138
  });
5111
5139
  }
5112
- function $(e, t, n, r = "marker", i) {
5113
- return Fc(e, t, n, [{
5140
+ function Q(e, t, n, r = "marker", i) {
5141
+ return Rc(e, t, n, [{
5114
5142
  kind: "graph.node.create",
5115
5143
  node: {
5116
5144
  inputs: {},
@@ -5127,8 +5155,8 @@ function $(e, t, n, r = "marker", i) {
5127
5155
  target: { kind: "flow" }
5128
5156
  }], i);
5129
5157
  }
5130
- async function Ic(e, t, n) {
5131
- return Lc(await Y(await Fc(e, t, n, [{
5158
+ async function zc(e, t, n) {
5159
+ return Bc(await J(await Rc(e, t, n, [{
5132
5160
  kind: "graph.node.create",
5133
5161
  node: {
5134
5162
  kind: "manual",
@@ -5138,13 +5166,13 @@ async function Ic(e, t, n) {
5138
5166
  target: { kind: "flow" }
5139
5167
  }]), 200, "Add manual trigger"), "Manual trigger Revision");
5140
5168
  }
5141
- function Lc(e, t) {
5142
- return J(K(e.revision, `${t} revision`).revisionId, `${t} revisionId`);
5169
+ function Bc(e, t) {
5170
+ return q(G(e.revision, `${t} revision`).revisionId, `${t} revisionId`);
5143
5171
  }
5144
- function Rc(e, t, n, r, i) {
5145
- return Z(e, `/v1/flows/${encodeURIComponent(t)}/revisions/${encodeURIComponent(n)}/publications`, {
5172
+ function $(e, t, n, r, i) {
5173
+ return X(e, `/v1/flows/${encodeURIComponent(t)}/revisions/${encodeURIComponent(n)}/publications`, {
5146
5174
  body: JSON.stringify({
5147
- engineContract: U,
5175
+ engineContract: H,
5148
5176
  expectedLivePublicationId: r,
5149
5177
  version: 1
5150
5178
  }),
@@ -5152,18 +5180,18 @@ function Rc(e, t, n, r, i) {
5152
5180
  method: "POST"
5153
5181
  });
5154
5182
  }
5155
- async function zc(e, t, n, r) {
5156
- let i = await Y(t, n, r), a = J(i.operationId, `${r} operationId`);
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`);
5158
- G(i.status, "succeeded", `${r} terminal status`);
5159
- let o = J(i.publicationId, `${r} publicationId`), s = K((await Y(await Z(e, `/v1/flows/${J(i.flowId, `${r} flowId`)}/live`), 200, `${r} Live`)).publication, `${r} Publication`);
5160
- return G(s.publicationId, o, `${r} Live Publication`), {
5183
+ async function Vc(e, t, n, r) {
5184
+ let i = await J(t, n, r), a = q(i.operationId, `${r} operationId`);
5185
+ for (let t = 0; i.status == "pending" && t < 100; t += 1) await new Promise((e) => setTimeout(e, 10)), i = await J(await X(e, `/v1/flows/${q(i.flowId, `${r} flowId`)}/publish-operations/${a}`), 200, `${r} operation`);
5186
+ W(i.status, "succeeded", `${r} terminal status`);
5187
+ let o = q(i.publicationId, `${r} publicationId`), s = G((await J(await X(e, `/v1/flows/${q(i.flowId, `${r} flowId`)}/live`), 200, `${r} Live`)).publication, `${r} Publication`);
5188
+ return W(s.publicationId, o, `${r} Live Publication`), {
5161
5189
  operation: i,
5162
5190
  publication: s
5163
5191
  };
5164
5192
  }
5165
- function Bc(e, t, n, r, i) {
5166
- return Z(e, `/v1/flows/${encodeURIComponent(t)}/publications/${encodeURIComponent(n)}/rollback`, {
5193
+ function Hc(e, t, n, r, i) {
5194
+ return X(e, `/v1/flows/${encodeURIComponent(t)}/publications/${encodeURIComponent(n)}/rollback`, {
5167
5195
  body: JSON.stringify({
5168
5196
  expectedLivePublicationId: r,
5169
5197
  version: 1
@@ -5172,8 +5200,8 @@ function Bc(e, t, n, r, i) {
5172
5200
  method: "POST"
5173
5201
  });
5174
5202
  }
5175
- function Vc(e, t, n) {
5176
- return Z(e, "/v1/runs", {
5203
+ function Uc(e, t, n) {
5204
+ return X(e, "/v1/runs", {
5177
5205
  body: JSON.stringify({
5178
5206
  inputs: {},
5179
5207
  trigger: {
@@ -5187,15 +5215,15 @@ function Vc(e, t, n) {
5187
5215
  method: "POST"
5188
5216
  });
5189
5217
  }
5190
- var Hc = [
5218
+ var Wc = [
5191
5219
  {
5192
5220
  name: "admits simultaneous retries as one Run and preserves its Trigger identity",
5193
5221
  async verify(e) {
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`, {
5222
+ let t = await Z(e, "Concurrent Run", "concurrent-run-flow"), n = q(t.flowId, "Flow ID"), r = await zc(e, n, q(t.draftRevisionId, "Revision ID")), i = (t = {}) => X(e, `/v1/flows/${n}/revisions/${r}/runs`, {
5195
5223
  method: "POST",
5196
5224
  headers: { "idempotency-key": "concurrent-run" },
5197
5225
  body: JSON.stringify({
5198
- engineContract: U,
5226
+ engineContract: H,
5199
5227
  inputs: {},
5200
5228
  trigger: {
5201
5229
  nodeId: "start",
@@ -5209,69 +5237,69 @@ var Hc = [
5209
5237
  i(),
5210
5238
  i()
5211
5239
  ]);
5212
- G(a.map((e) => e.status).toSorted(), [
5240
+ W(a.map((e) => e.status).toSorted(), [
5213
5241
  200,
5214
5242
  200,
5215
5243
  200,
5216
5244
  202
5217
5245
  ], "One Run is admitted");
5218
- let o = await Promise.all(a.map((e) => e.json())), s = J(K(o[0], "Run").runId, "Run ID");
5219
- for (let e of o) G(K(e, "Run").runId, s, "Concurrent Run identity");
5220
- await X(await i({ changed: !0 }), 409, "run.conflict", "Reject changed Trigger replay"), G(q((await Y(await Z(e, `/v1/flows/${n}/runs`), 200, "List admitted Runs")).runs, "Runs").length, 1, "No duplicate Run");
5246
+ let o = await Promise.all(a.map((e) => e.json())), s = q(G(o[0], "Run").runId, "Run ID");
5247
+ for (let e of o) W(G(e, "Run").runId, s, "Concurrent Run identity");
5248
+ await Y(await i({ changed: !0 }), 409, "run.conflict", "Reject changed Trigger replay"), W(K((await J(await X(e, `/v1/flows/${n}/runs`), 200, "List admitted Runs")).runs, "Runs").length, 1, "No duplicate Run");
5221
5249
  }
5222
5250
  },
5223
5251
  {
5224
5252
  name: "deduplicates simultaneous creation and lost-response retries",
5225
5253
  async verify(e) {
5226
- let t = await Promise.all(Array.from({ length: 4 }, () => Pc(e, "Concurrent Flow", "concurrent-create")));
5227
- G(t.map((e) => e.status).toSorted(), [
5254
+ let t = await Promise.all(Array.from({ length: 4 }, () => Lc(e, "Concurrent Flow", "concurrent-create")));
5255
+ W(t.map((e) => e.status).toSorted(), [
5228
5256
  200,
5229
5257
  200,
5230
5258
  200,
5231
5259
  201
5232
5260
  ], "One creation commits");
5233
5261
  let n = await Promise.all(t.map((e) => e.json()));
5234
- for (let e of n) G(e, n[0], "Concurrent replay identity");
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");
5262
+ for (let e of n) W(e, n[0], "Concurrent replay identity");
5263
+ W(await J(await Lc(e, "Concurrent Flow", "concurrent-create"), 200, "Retry lost creation response"), n[0], "Lost-response replay"), await Y(await Lc(e, "Different Flow", "concurrent-create"), 409, "flow.conflict", "Reject changed retry");
5236
5264
  }
5237
5265
  },
5238
5266
  {
5239
5267
  name: "commits one concurrent Draft change and replays the winning key",
5240
5268
  async verify(e) {
5241
- let t = await Q(e, "Concurrent Draft", "concurrent-draft"), n = J(t.flowId, "Flow ID"), r = J(t.draftRevisionId, "Revision ID"), i = await Promise.all([$(e, n, r, "left", "concurrent-left"), $(e, n, r, "right", "concurrent-right")]);
5242
- G(i.map((e) => e.status).toSorted(), [200, 412], "One Draft CAS commits");
5243
- let a = i.findIndex((e) => e.status == 200), o = await Y(i[a] ?? W("Missing winning response"), 200, "Winning Draft change");
5244
- await X(i[1 - a] ?? W("Missing losing response"), 412, "flow.revision-conflict", "Losing Draft change");
5269
+ let t = await Z(e, "Concurrent Draft", "concurrent-draft"), n = q(t.flowId, "Flow ID"), r = q(t.draftRevisionId, "Revision ID"), i = await Promise.all([Q(e, n, r, "left", "concurrent-left"), Q(e, n, r, "right", "concurrent-right")]);
5270
+ W(i.map((e) => e.status).toSorted(), [200, 412], "One Draft CAS commits");
5271
+ let a = i.findIndex((e) => e.status == 200), o = await J(i[a] ?? U("Missing winning response"), 200, "Winning Draft change");
5272
+ await Y(i[1 - a] ?? U("Missing losing response"), 412, "flow.revision-conflict", "Losing Draft change");
5245
5273
  let s = a == 0 ? "left" : "right";
5246
- G(await Y(await $(e, n, r, s, `concurrent-${s}`), 200, "Replay winning change"), o, "Replay precedes stale Revision check");
5247
- let c = K(K(K((await Y(await Z(e, `/v1/flows/${n}/draft`), 200, "Read authoritative Draft")).content, "Content").document, "Document").graph, "Graph").nodes;
5248
- G(Object.keys(K(c, "Nodes")), [s], "No partial losing edit");
5274
+ W(await J(await Q(e, n, r, s, `concurrent-${s}`), 200, "Replay winning change"), o, "Replay precedes stale Revision check");
5275
+ let c = G(G(G((await J(await X(e, `/v1/flows/${n}/draft`), 200, "Read authoritative Draft")).content, "Content").document, "Document").graph, "Graph").nodes;
5276
+ W(Object.keys(G(c, "Nodes")), [s], "No partial losing edit");
5249
5277
  }
5250
5278
  },
5251
5279
  {
5252
5280
  name: "manages deployment Variables with stable limits and exact-case identity",
5253
5281
  async verify(e) {
5254
- G(await Y(await Z(e, "/v1/variables"), 200, "List empty Variables"), {
5282
+ W(await J(await X(e, "/v1/variables"), 200, "List empty Variables"), {
5255
5283
  variables: [],
5256
5284
  version: 1
5257
5285
  }, "Empty Variables");
5258
- let t = (t, n, r = { value: n }) => Z(e, `/v1/variables/${encodeURIComponent(t)}`, {
5286
+ let t = (t, n, r = { value: n }) => X(e, `/v1/variables/${encodeURIComponent(t)}`, {
5259
5287
  body: JSON.stringify(r),
5260
5288
  method: "PUT"
5261
- }), n = await Y(await t("Token", ""), 200, "Create Variable");
5262
- G(Object.keys(n).toSorted(), [
5289
+ }), n = await J(await t("Token", ""), 200, "Create Variable");
5290
+ W(Object.keys(n).toSorted(), [
5263
5291
  "name",
5264
5292
  "updatedAt",
5265
5293
  "value",
5266
5294
  "version"
5267
- ], "Variable fields"), G(n.name, "Token", "Variable name"), G(n.value, "", "Empty Variable value"), G(n.version, 1, "Variable version"), J(n.updatedAt, "Variable updatedAt"), G(await Y(await Z(e, "/v1/variables/Token"), 200, "Read Variable"), n, "Read Variable"), G(await Y(await t("Token", ""), 200, "Put same Variable"), n, "Same Variable update");
5295
+ ], "Variable fields"), W(n.name, "Token", "Variable name"), W(n.value, "", "Empty Variable value"), W(n.version, 1, "Variable version"), q(n.updatedAt, "Variable updatedAt"), W(await J(await X(e, "/v1/variables/Token"), 200, "Read Variable"), n, "Read Variable"), W(await J(await t("Token", ""), 200, "Put same Variable"), n, "Same Variable update");
5268
5296
  for (let e of [
5269
5297
  "A",
5270
5298
  "Z",
5271
5299
  "a",
5272
5300
  "token"
5273
- ]) await Y(await t(e, e), 200, `Create ${e} Variable`);
5274
- G(q((await Y(await Z(e, "/v1/variables"), 200, "List Variables")).variables, "Variables").map((e) => K(e, "Variable").name), [
5301
+ ]) await J(await t(e, e), 200, `Create ${e} Variable`);
5302
+ W(K((await J(await X(e, "/v1/variables"), 200, "List Variables")).variables, "Variables").map((e) => G(e, "Variable").name), [
5275
5303
  "A",
5276
5304
  "Token",
5277
5305
  "Z",
@@ -5279,38 +5307,38 @@ var Hc = [
5279
5307
  "token"
5280
5308
  ], "Variable binary order");
5281
5309
  let r = `${"值".repeat(21845)}x`;
5282
- G(new TextEncoder().encode(r).byteLength, 65536, "Variable UTF-8 boundary fixture"), await Y(await t("BIG", r), 200, "Create maximum Variable value"), await X(await t("BIG", `${r}x`), 400, "variable.invalid", "Reject oversized Variable value"), await X(await t("OO_TOKEN", "value"), 400, "variable.invalid", "Reject reserved Variable name"), await X(await t("bad-name", "value"), 400, "variable.invalid", "Reject invalid Variable name"), await X(await t("EXTRA", "value", {
5310
+ W(new TextEncoder().encode(r).byteLength, 65536, "Variable UTF-8 boundary fixture"), await J(await t("BIG", r), 200, "Create maximum Variable value"), await Y(await t("BIG", `${r}x`), 400, "variable.invalid", "Reject oversized Variable value"), await Y(await t("OO_TOKEN", "value"), 400, "variable.invalid", "Reject reserved Variable name"), await Y(await t("bad-name", "value"), 400, "variable.invalid", "Reject invalid Variable name"), await Y(await t("EXTRA", "value", {
5283
5311
  extra: !0,
5284
5312
  value: "value"
5285
- }), 400, "variable.invalid", "Reject extra Variable field"), await X(await Z(e, "/v1/variables/MISSING"), 404, "variable.not-found", "Read missing Variable"), await X(await Z(e, "/v1/variables/MISSING", { method: "DELETE" }), 404, "variable.not-found", "Delete missing Variable"), G(await Y(await Z(e, "/v1/variables/Token", { method: "DELETE" }), 200, "Delete Variable"), { version: 1 }, "Delete response");
5286
- for (let e = 0; e < 195; e += 1) await Y(await t(`V${String(e).padStart(3, "0")}`, "value"), 200, `Fill Variable ${e}`);
5287
- await X(await t("V195", "value"), 409, "variable.limit-reached", "Reject Variable over limit"), G((await Y(await t("A", "updated"), 200, "Update full Variable catalog")).value, "updated", "Full catalog update");
5313
+ }), 400, "variable.invalid", "Reject extra Variable field"), await Y(await X(e, "/v1/variables/MISSING"), 404, "variable.not-found", "Read missing Variable"), await Y(await X(e, "/v1/variables/MISSING", { method: "DELETE" }), 404, "variable.not-found", "Delete missing Variable"), W(await J(await X(e, "/v1/variables/Token", { method: "DELETE" }), 200, "Delete Variable"), { version: 1 }, "Delete response");
5314
+ for (let e = 0; e < 195; e += 1) await J(await t(`V${String(e).padStart(3, "0")}`, "value"), 200, `Fill Variable ${e}`);
5315
+ await Y(await t("V195", "value"), 409, "variable.limit-reached", "Reject Variable over limit"), W((await J(await t("A", "updated"), 200, "Update full Variable catalog")).value, "updated", "Full catalog update");
5288
5316
  }
5289
5317
  },
5290
5318
  {
5291
5319
  name: "creates, replays, lists, reads, renames, and retires a Flow",
5292
5320
  async verify(e) {
5293
- let t = await Q(e, "Control flow", "flow-lifecycle"), n = J(t.flowId, "Created Flow flowId"), r = J(t.draftRevisionId, "Created Flow draftRevisionId");
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");
5295
- let i = await Y(await Z(e, "/v1/flows?includeTotal=true"), 200, "List Flows");
5296
- G(i.flows, [t], "Listed Flows"), G(i.total, 1, "Flow total");
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");
5298
- G(o.flows, [t], "First Flow page");
5299
- let s = J(o.nextCursor, "Flow cursor");
5300
- G((await Y(await Z(e, `/v1/flows?limit=1&cursor=${encodeURIComponent(s)}`), 200, "List second Flow page")).flows, [a], "Second Flow page"), G((await Y(await Z(e, `/v1/flows/${n}`, {
5321
+ let t = await Z(e, "Control flow", "flow-lifecycle"), n = q(t.flowId, "Created Flow flowId"), r = q(t.draftRevisionId, "Created Flow draftRevisionId");
5322
+ W(t.name, "Control flow", "Created Flow name"), W(t.status, "active", "Created Flow status"), W(await J(await Lc(e, "Control flow", "flow-lifecycle"), 200, "Replay Flow"), t, "Replayed Flow"), await Y(await Lc(e, "Different flow", "flow-lifecycle"), 409, "flow.conflict", "Conflicting Flow"), W(await J(await X(e, `/v1/flows/${n}`), 200, "Read Flow"), t, "Read Flow");
5323
+ let i = await J(await X(e, "/v1/flows?includeTotal=true"), 200, "List Flows");
5324
+ W(i.flows, [t], "Listed Flows"), W(i.total, 1, "Flow total");
5325
+ let a = await Z(e, "Second control flow", "flow-lifecycle-second"), o = await J(await X(e, "/v1/flows?limit=1"), 200, "List first Flow page");
5326
+ W(o.flows, [t], "First Flow page");
5327
+ let s = q(o.nextCursor, "Flow cursor");
5328
+ W((await J(await X(e, `/v1/flows?limit=1&cursor=${encodeURIComponent(s)}`), 200, "List second Flow page")).flows, [a], "Second Flow page"), W((await J(await X(e, `/v1/flows/${n}`, {
5301
5329
  body: JSON.stringify({
5302
5330
  name: "Renamed flow",
5303
5331
  version: 1
5304
5332
  }),
5305
5333
  method: "PATCH"
5306
- }), 200, "Rename Flow")).name, "Renamed flow", "Renamed Flow name"), G((await Y(await Z(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow")).status, "retiring", "Retired Flow status"), await X(await $(e, n, r), 409, "flow.busy", "Mutation after retirement");
5334
+ }), 200, "Rename Flow")).name, "Renamed flow", "Renamed Flow name"), W((await J(await X(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow")).status, "retiring", "Retired Flow status"), await Y(await Q(e, n, r), 409, "flow.busy", "Mutation after retirement");
5307
5335
  }
5308
5336
  },
5309
5337
  {
5310
5338
  name: "commits immutable Draft Revisions for one Flow",
5311
5339
  async verify(e) {
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, [{
5340
+ let t = await Z(e, "Draft flow", "draft-flow"), n = q(t.flowId, "Draft Flow flowId"), r = q(t.draftRevisionId, "Draft Flow revisionId"), i = await J(await Q(e, n, r, "marker", "draft-change"), 200, "Change Draft"), a = Bc(i, "Changed Draft");
5341
+ W(G(i.revision, "Changed Draft revision").parentRevisionId, r, "Changed Draft parent"), W(await J(await Q(e, n, r, "marker", "draft-change"), 200, "Replay Draft change"), i, "Replayed Draft change"), await Y(await Q(e, n, r, "another-marker", "draft-change"), 409, "flow.conflict", "Conflicting Draft change replay"), await Y(await Q(e, n, a, "marker"), 400, "flow.invalid", "Duplicate Draft Node", "A Node with this ID already exists"), await Y(await Rc(e, n, a, [{
5314
5342
  before: [{
5315
5343
  handle: "ready",
5316
5344
  jsonSchema: { type: "boolean" },
@@ -5326,15 +5354,15 @@ var Hc = [
5326
5354
  nullable: !1,
5327
5355
  value: !0
5328
5356
  }]
5329
- }]), 400, "flow.invalid", "No-op Draft change"), await X(await $(e, n, r, "stale"), 412, "flow.revision-conflict", "Stale Draft change"), G(K(K(K(K((await Y(await Z(e, `/v1/flows/${n}/revisions/${r}`), 200, "Read old Revision")).content, "Old content").document, "Old document").graph, "Old graph").nodes, "Old nodes"), {}, "Old Revision nodes"), G((await Y(await Z(e, `/v1/flows/${n}/draft`), 200, "Read Draft")).revisionId, a, "Draft revisionId");
5330
- let o = await Y(await Z(e, `/v1/flows/${n}/draft/sync`), 200, "Sync Draft");
5331
- G(o.kind, "snapshot", "Draft sync kind"), G(K(o.draft, "Draft snapshot").revisionId, a, "Draft snapshot revisionId");
5357
+ }]), 400, "flow.invalid", "No-op Draft change"), await Y(await Q(e, n, r, "stale"), 412, "flow.revision-conflict", "Stale Draft change"), W(G(G(G(G((await J(await X(e, `/v1/flows/${n}/revisions/${r}`), 200, "Read old Revision")).content, "Old content").document, "Old document").graph, "Old graph").nodes, "Old nodes"), {}, "Old Revision nodes"), W((await J(await X(e, `/v1/flows/${n}/draft`), 200, "Read Draft")).revisionId, a, "Draft revisionId");
5358
+ let o = await J(await X(e, `/v1/flows/${n}/draft/sync`), 200, "Sync Draft");
5359
+ W(o.kind, "snapshot", "Draft sync kind"), W(G(o.draft, "Draft snapshot").revisionId, a, "Draft snapshot revisionId");
5332
5360
  }
5333
5361
  },
5334
5362
  {
5335
5363
  name: "loads the current editor without changing Draft or Presentation",
5336
5364
  async verify(e) {
5337
- let t = await Q(e, "Editor flow", "editor-flow"), n = J(t.flowId, "Editor Flow identity"), r = await Y(await $(e, n, J(t.draftRevisionId, "Editor Draft identity"), "marker"), 200, "Change editor Draft"), i = await Y(await Z(e, `/v1/flows/${n}/presentation`, {
5365
+ let t = await Z(e, "Editor flow", "editor-flow"), n = q(t.flowId, "Editor Flow identity"), r = await J(await Q(e, n, q(t.draftRevisionId, "Editor Draft identity"), "marker"), 200, "Change editor Draft"), i = await J(await X(e, `/v1/flows/${n}/presentation`, {
5338
5366
  method: "PUT",
5339
5367
  body: JSON.stringify({
5340
5368
  expectedRevision: 1,
@@ -5344,8 +5372,8 @@ var Hc = [
5344
5372
  } } },
5345
5373
  version: 1
5346
5374
  })
5347
- }), 200, "Update editor Presentation"), a = await Y(await Z(e, `/v1/flows/${n}/editor`), 200, "Read editor");
5348
- G(a.version, 1, "Editor version"), G(K(a.flow, "Editor Flow").draftRevisionId, Lc(r, "Editor change"), "Editor Draft head");
5375
+ }), 200, "Update editor Presentation"), a = await J(await X(e, `/v1/flows/${n}/editor`), 200, "Read editor");
5376
+ W(a.version, 1, "Editor version"), W(G(a.flow, "Editor Flow").draftRevisionId, Bc(r, "Editor change"), "Editor Draft head");
5349
5377
  for (let t of [
5350
5378
  "flow",
5351
5379
  "draft",
@@ -5353,21 +5381,21 @@ var Hc = [
5353
5381
  "presentation"
5354
5382
  ]) {
5355
5383
  let r = t == "flow" ? `/v1/flows/${n}` : `/v1/flows/${n}/${t}`;
5356
- G(a[t], await Y(await Z(e, r), 200, `Read editor ${t}`), `Editor ${t}`);
5384
+ W(a[t], await J(await X(e, r), 200, `Read editor ${t}`), `Editor ${t}`);
5357
5385
  }
5358
- G(a.presentation, i, "Reading editor preserves Presentation"), await X(await Z(e, "/v1/flows/missing-editor/editor"), 404, "flow.not-found", "Read missing editor");
5386
+ W(a.presentation, i, "Reading editor preserves Presentation"), await Y(await X(e, "/v1/flows/missing-editor/editor"), 404, "flow.not-found", "Read missing editor");
5359
5387
  }
5360
5388
  },
5361
5389
  {
5362
5390
  name: "keeps Presentation CAS independent from the Draft head",
5363
5391
  async verify(e) {
5364
- let t = await Q(e, "Presentation flow", "presentation-flow"), n = J(t.flowId, "Presentation Flow flowId"), r = J(t.draftRevisionId, "Presentation Flow revisionId"), i = `/v1/flows/${n}/presentation`, a = {
5392
+ let t = await Z(e, "Presentation flow", "presentation-flow"), n = q(t.flowId, "Presentation Flow flowId"), r = q(t.draftRevisionId, "Presentation Flow revisionId"), i = `/v1/flows/${n}/presentation`, a = {
5365
5393
  edges: [],
5366
5394
  nodes: { task: {
5367
5395
  x: 120,
5368
5396
  y: 80
5369
5397
  } }
5370
- }, o = await Y(await Z(e, i, {
5398
+ }, o = await J(await X(e, i, {
5371
5399
  body: JSON.stringify({
5372
5400
  expectedRevision: 1,
5373
5401
  value: a,
@@ -5375,27 +5403,27 @@ var Hc = [
5375
5403
  }),
5376
5404
  method: "PUT"
5377
5405
  }), 200, "Update Presentation");
5378
- G(o.revision, 2, "Presentation revision"), G(o.value, a, "Presentation value"), await X(await Z(e, i, {
5406
+ W(o.revision, 2, "Presentation revision"), W(o.value, a, "Presentation value"), await Y(await X(e, i, {
5379
5407
  body: JSON.stringify({
5380
5408
  expectedRevision: 1,
5381
5409
  value: {},
5382
5410
  version: 1
5383
5411
  }),
5384
5412
  method: "PUT"
5385
- }), 412, "flow.presentation-conflict", "Stale Presentation update"), G((await Y(await Z(e, i), 200, "Read Presentation")).value, a, "Presentation value after conflict"), await Y(await Z(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Presentation Flow"), await X(await Z(e, i, {
5413
+ }), 412, "flow.presentation-conflict", "Stale Presentation update"), W((await J(await X(e, i), 200, "Read Presentation")).value, a, "Presentation value after conflict"), await J(await X(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Presentation Flow"), await Y(await X(e, i, {
5386
5414
  body: JSON.stringify({
5387
5415
  expectedRevision: 2,
5388
5416
  value: {},
5389
5417
  version: 1
5390
5418
  }),
5391
5419
  method: "PUT"
5392
- }), 409, "flow.busy", "Update retired Presentation"), G((await Y(await Z(e, `/v1/flows/${n}`), 200, "Read Flow")).draftRevisionId, r, "Draft head");
5420
+ }), 409, "flow.busy", "Update retired Presentation"), W((await J(await X(e, `/v1/flows/${n}`), 200, "Read Flow")).draftRevisionId, r, "Draft head");
5393
5421
  }
5394
5422
  },
5395
5423
  {
5396
5424
  name: "admits a Draft entry while unrelated branches remain invalid",
5397
5425
  async verify(e) {
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")), [
5426
+ let t = await Z(e, "Partial Draft", "partial-draft"), n = q(t.flowId, "Partial Flow identity"), r = Bc(await J(await Rc(e, n, await zc(e, n, q(t.draftRevisionId, "Partial Draft identity")), [
5399
5427
  {
5400
5428
  kind: "graph.node.create",
5401
5429
  nodeId: "other",
@@ -5431,18 +5459,18 @@ var Hc = [
5431
5459
  }
5432
5460
  }
5433
5461
  ]), 200, "Add unfinished branch"), "Partial Draft"), i = `/v1/flows/${n}/revisions/${r}`;
5434
- G((await Y(await Z(e, `${i}/check`, {
5462
+ W((await J(await X(e, `${i}/check`, {
5435
5463
  method: "POST",
5436
5464
  body: JSON.stringify({
5437
- engineContract: U,
5465
+ engineContract: H,
5438
5466
  version: 1
5439
5467
  })
5440
5468
  }), 200, "Check entire Draft")).valid, !1, "Entire Draft remains invalid");
5441
- let a = (t) => Z(e, `${i}/runs`, {
5469
+ let a = (t) => X(e, `${i}/runs`, {
5442
5470
  method: "POST",
5443
5471
  headers: { "idempotency-key": `partial-${t}` },
5444
5472
  body: JSON.stringify({
5445
- engineContract: U,
5473
+ engineContract: H,
5446
5474
  inputs: {},
5447
5475
  trigger: {
5448
5476
  nodeId: t,
@@ -5456,16 +5484,16 @@ var Hc = [
5456
5484
  version: 2
5457
5485
  })
5458
5486
  });
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");
5487
+ await J(await a("start"), 202, "Run valid entry"), await Y(await a("other"), 400, "flow.invalid", "Reject invalid entry branch"), await Y(await $(e, n, r, null, "partial-publish"), 400, "flow.invalid", "Reject incomplete publication");
5460
5488
  }
5461
5489
  },
5462
5490
  {
5463
5491
  name: "validates, admits, lists, and cancels one Draft Run",
5464
5492
  async verify(e) {
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"));
5466
- G((await Y(await Z(e, `/v1/flows/${n}/revisions/${r}/check`, {
5493
+ let t = await Z(e, "Run flow", "run-flow"), n = q(t.flowId, "Run Flow flowId"), r = await zc(e, n, q(t.draftRevisionId, "Run Flow revisionId"));
5494
+ W((await J(await X(e, `/v1/flows/${n}/revisions/${r}/check`, {
5467
5495
  body: JSON.stringify({
5468
- engineContract: U,
5496
+ engineContract: H,
5469
5497
  version: 1
5470
5498
  }),
5471
5499
  method: "POST"
@@ -5481,9 +5509,9 @@ var Hc = [
5481
5509
  nodeId: "start",
5482
5510
  outputs: { payload: { unexpected: !0 } }
5483
5511
  }
5484
- ]) await X(await Z(e, i, {
5512
+ ]) await Y(await X(e, i, {
5485
5513
  body: JSON.stringify({
5486
- engineContract: U,
5514
+ engineContract: H,
5487
5515
  inputs: {},
5488
5516
  trigger: t,
5489
5517
  version: 2
@@ -5491,9 +5519,9 @@ var Hc = [
5491
5519
  headers: { "idempotency-key": `invalid-entry-${JSON.stringify(t)}` },
5492
5520
  method: "POST"
5493
5521
  }), 400, "run.invalid", "Reject invalid start node or payload");
5494
- let a = () => Z(e, i, {
5522
+ let a = () => X(e, i, {
5495
5523
  body: JSON.stringify({
5496
- engineContract: U,
5524
+ engineContract: H,
5497
5525
  inputs: {},
5498
5526
  trigger: {
5499
5527
  nodeId: "start",
@@ -5503,10 +5531,10 @@ var Hc = [
5503
5531
  }),
5504
5532
  headers: { "idempotency-key": "draft-run" },
5505
5533
  method: "POST"
5506
- }), o = await Y(await a(), 202, "Create Draft Run"), s = J(o.runId, "Draft Run runId");
5507
- G(await Y(await a(), 200, "Replay Draft Run"), o, "Replayed Draft Run"), await X(await Z(e, i, {
5534
+ }), o = await J(await a(), 202, "Create Draft Run"), s = q(o.runId, "Draft Run runId");
5535
+ W(await J(await a(), 200, "Replay Draft Run"), o, "Replayed Draft Run"), await Y(await X(e, i, {
5508
5536
  body: JSON.stringify({
5509
- engineContract: U,
5537
+ engineContract: H,
5510
5538
  inputs: {},
5511
5539
  trigger: {
5512
5540
  nodeId: "another",
@@ -5516,10 +5544,10 @@ var Hc = [
5516
5544
  }),
5517
5545
  headers: { "idempotency-key": "draft-run" },
5518
5546
  method: "POST"
5519
- }), 409, "run.conflict", "Changing the entry conflicts with the original Run request"), await X(await Z(e, `/v1/runs/${s}/result`), 409, "run.not-terminal", "Read queued Run result");
5520
- let c = J((await Y(await Z(e, i, {
5547
+ }), 409, "run.conflict", "Changing the entry conflicts with the original Run request"), await Y(await X(e, `/v1/runs/${s}/result`), 409, "run.not-terminal", "Read queued Run result");
5548
+ let c = q((await J(await X(e, i, {
5521
5549
  body: JSON.stringify({
5522
- engineContract: U,
5550
+ engineContract: H,
5523
5551
  inputs: {},
5524
5552
  trigger: {
5525
5553
  nodeId: "start",
@@ -5529,34 +5557,34 @@ var Hc = [
5529
5557
  }),
5530
5558
  headers: { "idempotency-key": "draft-run-second" },
5531
5559
  method: "POST"
5532
- }), 202, "Create second Draft Run")).runId, "Second Draft Run"), l = await Y(await Z(e, `/v1/flows/${n}/runs?limit=1`), 200, "List Runs");
5533
- G(q(l.runs, "Runs").map((e) => K(e, "Run").runId), [c], "Listed Runs");
5534
- let u = J(l.nextCursor, "Run cursor");
5535
- G(q((await Y(await Z(e, `/v1/flows/${n}/runs?limit=1&cursor=${encodeURIComponent(u)}`), 200, "List next Runs")).runs, "Next Runs").map((e) => K(e, "Run").runId), [s], "Listed next Runs"), await X(await Z(e, `/v1/flows/${J((await Q(e, "Other Run flow", "other-run-flow")).flowId, "Other Run Flow flowId")}/runs?limit=1&cursor=${encodeURIComponent(u)}`), 400, "page.invalid-cursor", "Reject Run cursor from another Flow"), G((await Y(await Z(e, `/v1/runs/${s}/cancel`, {
5560
+ }), 202, "Create second Draft Run")).runId, "Second Draft Run"), l = await J(await X(e, `/v1/flows/${n}/runs?limit=1`), 200, "List Runs");
5561
+ W(K(l.runs, "Runs").map((e) => G(e, "Run").runId), [c], "Listed Runs");
5562
+ let u = q(l.nextCursor, "Run cursor");
5563
+ W(K((await J(await X(e, `/v1/flows/${n}/runs?limit=1&cursor=${encodeURIComponent(u)}`), 200, "List next Runs")).runs, "Next Runs").map((e) => G(e, "Run").runId), [s], "Listed next Runs"), await Y(await X(e, `/v1/flows/${q((await Z(e, "Other Run flow", "other-run-flow")).flowId, "Other Run Flow flowId")}/runs?limit=1&cursor=${encodeURIComponent(u)}`), 400, "page.invalid-cursor", "Reject Run cursor from another Flow"), W((await J(await X(e, `/v1/runs/${s}/cancel`, {
5536
5564
  body: JSON.stringify({ version: 1 }),
5537
5565
  method: "POST"
5538
- }), 200, "Cancel Run")).status, "canceled", "Canceled Run status"), G((await Y(await Z(e, `/v1/runs/${s}/result`), 200, "Read canceled Run result")).status, "canceled", "Canceled Run result"), G((await Y(await Z(e, `/v1/runs/${s}/events`), 200, "Read canceled Run events")).done, !0, "Canceled Run events"), G((await Y(await Z(e, `/v1/runs/${c}/cancel`, {
5566
+ }), 200, "Cancel Run")).status, "canceled", "Canceled Run status"), W((await J(await X(e, `/v1/runs/${s}/result`), 200, "Read canceled Run result")).status, "canceled", "Canceled Run result"), W((await J(await X(e, `/v1/runs/${s}/events`), 200, "Read canceled Run events")).done, !0, "Canceled Run events"), W((await J(await X(e, `/v1/runs/${c}/cancel`, {
5539
5567
  body: JSON.stringify({ version: 1 }),
5540
5568
  method: "POST"
5541
5569
  }), 200, "Cancel second Draft Run")).status, "canceled", "Second canceled Run status");
5542
- let d = J(o.createdAt, "Run createdAt"), f = new Date(Date.parse(d) + 1).toISOString(), p = await Y(await Z(e, `/v1/flows/${n}/runs?limit=1&status=canceled&source=draft`), 200, "Filter paginated Runs");
5543
- G(q(p.runs, "Filtered Run page").map((e) => K(e, "Filtered Run").runId), [c], "Filtered first Run page");
5544
- let ee = J(p.nextCursor, "Filtered Run cursor");
5545
- G(q((await Y(await Z(e, `/v1/flows/${n}/runs?limit=1&status=canceled&source=draft&cursor=${encodeURIComponent(ee)}`), 200, "Continue filtered Runs")).runs, "Next filtered Run page").map((e) => K(e, "Filtered Run").runId), [s], "Filtered next Run page"), G(q((await Y(await Z(e, `/v1/flows/${n}/runs?status=canceled&source=draft&createdFrom=${encodeURIComponent(d)}&createdBefore=${encodeURIComponent(f)}&runId=${encodeURIComponent(s)}`), 200, "Filter Runs")).runs, "Filtered Runs").map((e) => K(e, "Filtered Run").runId), [s], "Filtered Run list"), G(q((await Y(await Z(e, `/v1/flows/${n}/runs?createdBefore=${encodeURIComponent(d)}`), 200, "Filter Run boundary")).runs, "Boundary Runs"), [], "Exclusive Run upper boundary");
5570
+ let d = q(o.createdAt, "Run createdAt"), f = new Date(Date.parse(d) + 1).toISOString(), p = await J(await X(e, `/v1/flows/${n}/runs?limit=1&status=canceled&source=draft`), 200, "Filter paginated Runs");
5571
+ W(K(p.runs, "Filtered Run page").map((e) => G(e, "Filtered Run").runId), [c], "Filtered first Run page");
5572
+ let ee = q(p.nextCursor, "Filtered Run cursor");
5573
+ W(K((await J(await X(e, `/v1/flows/${n}/runs?limit=1&status=canceled&source=draft&cursor=${encodeURIComponent(ee)}`), 200, "Continue filtered Runs")).runs, "Next filtered Run page").map((e) => G(e, "Filtered Run").runId), [s], "Filtered next Run page"), W(K((await J(await X(e, `/v1/flows/${n}/runs?status=canceled&source=draft&createdFrom=${encodeURIComponent(d)}&createdBefore=${encodeURIComponent(f)}&runId=${encodeURIComponent(s)}`), 200, "Filter Runs")).runs, "Filtered Runs").map((e) => G(e, "Filtered Run").runId), [s], "Filtered Run list"), W(K((await J(await X(e, `/v1/flows/${n}/runs?createdBefore=${encodeURIComponent(d)}`), 200, "Filter Run boundary")).runs, "Boundary Runs"), [], "Exclusive Run upper boundary");
5546
5574
  for (let t of [
5547
5575
  "source=manual",
5548
5576
  "createdFrom=invalid",
5549
5577
  "createdFrom=2026-02-30T00%3A00%3A00Z",
5550
5578
  `createdFrom=${encodeURIComponent(f)}&createdBefore=${encodeURIComponent(d)}`,
5551
5579
  "runId="
5552
- ]) await X(await Z(e, `/v1/flows/${n}/runs?${t}`), 400, "run.invalid", `Reject Run filter ${t}`);
5580
+ ]) await Y(await X(e, `/v1/flows/${n}/runs?${t}`), 400, "run.invalid", `Reject Run filter ${t}`);
5553
5581
  }
5554
5582
  },
5555
5583
  {
5556
5584
  name: "pauses, resolves, resumes, and cancels waiting Draft Runs",
5557
5585
  runtime: !0,
5558
5586
  async verify(e) {
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")), [{
5587
+ let t = await Z(e, "Wait flow", "wait-flow"), n = q(t.flowId, "Wait Flow flowId"), r = `/v1/flows/${n}/revisions/${Bc(await J(await Rc(e, n, await zc(e, n, q(t.draftRevisionId, "Wait Flow revisionId")), [{
5560
5588
  kind: "graph.node.create",
5561
5589
  node: {
5562
5590
  inputDefinitions: [{
@@ -5582,9 +5610,9 @@ var Hc = [
5582
5610
  target: "approval"
5583
5611
  },
5584
5612
  target: { kind: "flow" }
5585
- }]), 200, "Create Wait"), "Wait Revision")}/runs`, i = async (t, n) => Y(await Z(e, r, {
5613
+ }]), 200, "Create Wait"), "Wait Revision")}/runs`, i = async (t, n) => J(await X(e, r, {
5586
5614
  body: JSON.stringify({
5587
- engineContract: U,
5615
+ engineContract: H,
5588
5616
  inputs: {},
5589
5617
  trigger: {
5590
5618
  nodeId: "start",
@@ -5594,38 +5622,38 @@ var Hc = [
5594
5622
  }),
5595
5623
  headers: { "idempotency-key": t },
5596
5624
  method: "POST"
5597
- }), 202, n), a = await i("wait-run", "Create Wait Run"), o = J(a.runId, "Wait Run runId"), s = a;
5598
- for (let t = 0; q(s.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await Y(await Z(e, `/v1/runs/${o}`), 200, "Read Wait Run");
5599
- G(s.status, "running", "Wait Run status");
5600
- let c = K(q(s.waits, "Waits")[0], "Active Wait");
5601
- G(c.actions, ["approve", "reject"], "Wait actions"), G(c.nodeId, "approval", "Wait node"), G(c.prompt, "Approve request 1?", "Wait prompt"), J(c.expiresAt, "Wait expiry"), J(c.waitingSince, "Wait start");
5602
- let l = J(c.waitId, "Wait id");
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");
5604
- let u = await Y(await Z(e, `/v1/runs/${o}/events`), 200, "Read waiting Run events");
5605
- for (let e of q(u.events, "Run events")) Mc(e);
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");
5607
- let d = `/v1/runs/${o}/waits/${l}/resolve`, f = (t) => Z(e, d, {
5625
+ }), 202, n), a = await i("wait-run", "Create Wait Run"), o = q(a.runId, "Wait Run runId"), s = a;
5626
+ for (let t = 0; K(s.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await J(await X(e, `/v1/runs/${o}`), 200, "Read Wait Run");
5627
+ W(s.status, "running", "Wait Run status");
5628
+ let c = G(K(s.waits, "Waits")[0], "Active Wait");
5629
+ W(c.actions, ["approve", "reject"], "Wait actions"), W(c.nodeId, "approval", "Wait node"), W(c.prompt, "Approve request 1?", "Wait prompt"), q(c.expiresAt, "Wait expiry"), q(c.waitingSince, "Wait start");
5630
+ let l = q(c.waitId, "Wait id");
5631
+ W(K((await J(await X(e, `/v1/flows/${n}/runs?pendingWait=true`), 200, "List waiting Runs")).runs, "Waiting Runs").map((e) => G(e, "Waiting Run").runId), [o], "Waiting Run list");
5632
+ let u = await J(await X(e, `/v1/runs/${o}/events`), 200, "Read waiting Run events");
5633
+ for (let e of K(u.events, "Run events")) Fc(e);
5634
+ W(u.done, !1, "Waiting events done"), K(u.events, "Waiting events").some((e) => G(e, "Waiting event").kind == "wait.created") || U("Waiting Run must contain wait.created."), await Y(await X(e, `/v1/runs/${o}/result`), 409, "run.not-terminal", "Read waiting Run result");
5635
+ let d = `/v1/runs/${o}/waits/${l}/resolve`, f = (t) => X(e, d, {
5608
5636
  body: JSON.stringify({
5609
5637
  action: t,
5610
5638
  version: 1
5611
5639
  }),
5612
5640
  method: "POST"
5613
5641
  });
5614
- await X(await f("continue"), 400, "run.invalid", "Reject unsupported Wait action");
5615
- let p = await Y(await f("approve"), 200, "Approve Wait");
5616
- G(p.action, "approve", "Approved action"), G(p.resolutionAccepted, !0, "Approved resolution"), G(p.status, "running", "Resolved Run status"), J(p.resolvedAt, "Wait resolution time");
5617
- let ee = await Y(await f("reject"), 200, "Reject resolved Wait");
5618
- G(ee.action, "approve", "Winning action"), G(ee.resolutionAccepted, !1, "Competing resolution");
5619
- for (let t = 0; s.status != "completed" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await Y(await Z(e, `/v1/runs/${o}`), 200, "Read resumed Run");
5620
- G(s.status, "completed", "Resumed Run status"), G(s.waits, [], "Completed Wait projection");
5621
- let te = await Y(await f("approve"), 200, "Replay approved Wait");
5622
- G(te.resolutionAccepted, !0, "Replayed resolution"), G(te.status, "completed", "Replayed terminal status");
5623
- let ne = await Y(await Z(e, `/v1/runs/${o}/events`), 200, "Read resumed Run events");
5624
- for (let e of q(ne.events, "Run events")) Mc(e);
5625
- G(q(ne.events, "Completed events").filter((e) => K(e, "Completed event").kind == "run.resolved").length, 1, "Resolved event count");
5626
- let re = await i("wait-run-cancel", "Create cancelable Wait Run"), ie = J(re.runId, "Cancelable Wait Run id"), ae = re;
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");
5628
- G(ae.status, "running", "Cancelable Wait status"), G((await Y(await Z(e, `/v1/runs/${ie}/cancel`, {
5642
+ await Y(await f("continue"), 400, "run.invalid", "Reject unsupported Wait action");
5643
+ let p = await J(await f("approve"), 200, "Approve Wait");
5644
+ W(p.action, "approve", "Approved action"), W(p.resolutionAccepted, !0, "Approved resolution"), W(p.status, "running", "Resolved Run status"), q(p.resolvedAt, "Wait resolution time");
5645
+ let ee = await J(await f("reject"), 200, "Reject resolved Wait");
5646
+ W(ee.action, "approve", "Winning action"), W(ee.resolutionAccepted, !1, "Competing resolution");
5647
+ for (let t = 0; s.status != "completed" && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), s = await J(await X(e, `/v1/runs/${o}`), 200, "Read resumed Run");
5648
+ W(s.status, "completed", "Resumed Run status"), W(s.waits, [], "Completed Wait projection");
5649
+ let te = await J(await f("approve"), 200, "Replay approved Wait");
5650
+ W(te.resolutionAccepted, !0, "Replayed resolution"), W(te.status, "completed", "Replayed terminal status");
5651
+ let ne = await J(await X(e, `/v1/runs/${o}/events`), 200, "Read resumed Run events");
5652
+ for (let e of K(ne.events, "Run events")) Fc(e);
5653
+ W(K(ne.events, "Completed events").filter((e) => G(e, "Completed event").kind == "run.resolved").length, 1, "Resolved event count");
5654
+ let re = await i("wait-run-cancel", "Create cancelable Wait Run"), ie = q(re.runId, "Cancelable Wait Run id"), ae = re;
5655
+ for (let t = 0; K(ae.waits, "Waits").length == 0 && t < 200; t += 1) await new Promise((e) => setTimeout(e, 10)), ae = await J(await X(e, `/v1/runs/${ie}`), 200, "Read cancelable Wait Run");
5656
+ W(ae.status, "running", "Cancelable Wait status"), W((await J(await X(e, `/v1/runs/${ie}/cancel`, {
5629
5657
  body: JSON.stringify({ version: 1 }),
5630
5658
  method: "POST"
5631
5659
  }), 200, "Cancel waiting Run")).status, "canceled", "Canceled waiting Run status");
@@ -5635,32 +5663,32 @@ var Hc = [
5635
5663
  name: "rejects invalid and missing Flow control targets",
5636
5664
  async verify(e) {
5637
5665
  let t = "00000000-0000-7000-8000-000000000001", n = "00000000-0000-7000-8000-000000000002", r = "00000000-0000-7000-8000-000000000003";
5638
- await X(await Z(e, `/v1/flows/${t}`), 404, "flow.not-found", "Read missing Flow"), await X(await Z(e, `/v1/flows/${t}`, {
5666
+ await Y(await X(e, `/v1/flows/${t}`), 404, "flow.not-found", "Read missing Flow"), await Y(await X(e, `/v1/flows/${t}`, {
5639
5667
  body: JSON.stringify({
5640
5668
  name: "Missing",
5641
5669
  version: 1
5642
5670
  }),
5643
5671
  method: "PATCH"
5644
- }), 404, "flow.not-found", "Rename missing Flow"), await X(await Z(e, `/v1/flows/${t}`, { method: "DELETE" }), 404, "flow.not-found", "Retire missing Flow"), await X(await Z(e, `/v1/flows/${t}/draft`), 404, "flow.not-found", "Read missing Draft"), await X(await Z(e, `/v1/flows/${t}/revisions/${n}`), 404, "flow.not-found", "Read missing Revision"), await X(await Z(e, `/v1/flows/${t}/presentation`), 404, "flow.not-found", "Read missing Presentation"), await X(await Z(e, `/v1/flows/${t}/presentation`, {
5672
+ }), 404, "flow.not-found", "Rename missing Flow"), await Y(await X(e, `/v1/flows/${t}`, { method: "DELETE" }), 404, "flow.not-found", "Retire missing Flow"), await Y(await X(e, `/v1/flows/${t}/draft`), 404, "flow.not-found", "Read missing Draft"), await Y(await X(e, `/v1/flows/${t}/revisions/${n}`), 404, "flow.not-found", "Read missing Revision"), await Y(await X(e, `/v1/flows/${t}/presentation`), 404, "flow.not-found", "Read missing Presentation"), await Y(await X(e, `/v1/flows/${t}/presentation`, {
5645
5673
  body: JSON.stringify({
5646
5674
  expectedRevision: 1,
5647
5675
  value: {},
5648
5676
  version: 1
5649
5677
  }),
5650
5678
  method: "PUT"
5651
- }), 404, "flow.not-found", "Update missing Presentation"), await X(await Z(e, `/v1/flows/${t}/runs`), 404, "flow.not-found", "List missing Flow Runs"), await X(await Z(e, `/v1/runs/${r}`), 404, "run.not-found", "Read missing Run"), await X(await Z(e, `/v1/runs/${r}/events`), 404, "run.not-found", "Read missing Run events"), await X(await Z(e, `/v1/runs/${r}/result`), 404, "run.not-found", "Read missing Run result"), await X(await Z(e, `/v1/runs/${r}/cancel`, {
5679
+ }), 404, "flow.not-found", "Update missing Presentation"), await Y(await X(e, `/v1/flows/${t}/runs`), 404, "flow.not-found", "List missing Flow Runs"), await Y(await X(e, `/v1/runs/${r}`), 404, "run.not-found", "Read missing Run"), await Y(await X(e, `/v1/runs/${r}/events`), 404, "run.not-found", "Read missing Run events"), await Y(await X(e, `/v1/runs/${r}/result`), 404, "run.not-found", "Read missing Run result"), await Y(await X(e, `/v1/runs/${r}/cancel`, {
5652
5680
  body: JSON.stringify({ version: 1 }),
5653
5681
  method: "POST"
5654
5682
  }), 404, "run.not-found", "Cancel missing Run");
5655
- let i = await Q(e, "Invalid targets", "invalid-targets"), a = J(i.flowId, "Invalid targets Flow"), o = J(i.draftRevisionId, "Invalid targets Revision"), s = (t, n) => Z(e, `/v1/flows/${a}/revisions/${t}/check`, {
5683
+ let i = await Z(e, "Invalid targets", "invalid-targets"), a = q(i.flowId, "Invalid targets Flow"), o = q(i.draftRevisionId, "Invalid targets Revision"), s = (t, n) => X(e, `/v1/flows/${a}/revisions/${t}/check`, {
5656
5684
  body: JSON.stringify({
5657
5685
  engineContract: n,
5658
5686
  version: 1
5659
5687
  }),
5660
5688
  method: "POST"
5661
5689
  });
5662
- await X(await s(o, "unsupported-engine/v1"), 409, "engine.unsupported", "Check unsupported Engine"), await X(await s(n, U), 404, "flow.not-found", "Check missing Revision");
5663
- let c = (t, n, r) => Z(e, `/v1/flows/${a}/revisions/${t}/runs`, {
5690
+ await Y(await s(o, "unsupported-engine/v1"), 409, "engine.unsupported", "Check unsupported Engine"), await Y(await s(n, H), 404, "flow.not-found", "Check missing Revision");
5691
+ let c = (t, n, r) => X(e, `/v1/flows/${a}/revisions/${t}/runs`, {
5664
5692
  body: JSON.stringify({
5665
5693
  engineContract: n,
5666
5694
  inputs: {},
@@ -5673,14 +5701,14 @@ var Hc = [
5673
5701
  headers: { "idempotency-key": r },
5674
5702
  method: "POST"
5675
5703
  });
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");
5704
+ await Y(await c(o, "unsupported-engine/v1", "unsupported-run"), 409, "engine.unsupported", "Run unsupported Engine"), await Y(await c(n, H, "missing-revision-run"), 404, "flow.not-found", "Run missing Revision");
5677
5705
  }
5678
5706
  }
5679
- ], Uc = [
5707
+ ], Gc = [
5680
5708
  {
5681
5709
  name: "controls Live admission independently from publishing and Draft testing",
5682
5710
  async verify(e) {
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`, {
5711
+ let t = await Z(e, "Enabled flow", "enabled-flow"), n = q(t.flowId, "Flow id"), r = await zc(e, n, q(t.draftRevisionId, "Draft id")), i = (t, r) => X(e, `/v1/flows/${n}/enabled`, {
5684
5712
  method: "PUT",
5685
5713
  body: JSON.stringify({
5686
5714
  enabled: t,
@@ -5688,17 +5716,17 @@ var Hc = [
5688
5716
  version: 1
5689
5717
  })
5690
5718
  });
5691
- await X(await i(!0, "missing"), 409, "flow.conflict", "Cannot enable unpublished Flow");
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");
5693
- G(o.live, {
5719
+ await Y(await i(!0, "missing"), 409, "flow.conflict", "Cannot enable unpublished Flow");
5720
+ let a = q((await Vc(e, await $(e, n, r, null, "enable-first"), 202, "Publish")).publication.publicationId, "Publication id"), o = await J(await i(!1, a), 200, "Disable");
5721
+ W(o.live, {
5694
5722
  enabled: !1,
5695
5723
  publicationId: a,
5696
5724
  revisionId: r
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`, {
5725
+ }, "Disabled summary"), W((await J(await X(e, "/v1/flows"), 200, "List disabled Flow")).flows, [o], "List includes Live state"), W((await J(await X(e, `/v1/flows/${n}/live`), 200, "Disabled Live")).status, "suspended", "Disabled Live status"), await Y(await Uc(e, a, "disabled-run"), 412, "live.conflict", "Disabled Live rejects Run"), await J(await X(e, `/v1/flows/${n}/revisions/${r}/runs`, {
5698
5726
  method: "POST",
5699
5727
  headers: { "idempotency-key": "disabled-draft" },
5700
5728
  body: JSON.stringify({
5701
- engineContract: U,
5729
+ engineContract: H,
5702
5730
  inputs: {},
5703
5731
  trigger: {
5704
5732
  nodeId: "start",
@@ -5707,21 +5735,21 @@ var Hc = [
5707
5735
  version: 2
5708
5736
  })
5709
5737
  }), 202, "Disabled Flow permits Draft test");
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");
5738
+ let s = q((await Vc(e, await $(e, n, r, a, "enable-next"), 202, "Publish disabled Flow")).publication.publicationId, "Next Publication id");
5739
+ W(G((await J(await X(e, `/v1/flows/${n}`), 200, "Read Flow")).live, "Live").enabled, !1, "Publish preserves disabled state"), await Y(await i(!0, a), 409, "flow.conflict", "Stale switch rejects"), await J(await i(!0, s), 200, "Enable"), await J(await Uc(e, s, "enabled-run"), 202, "Enabled Live accepts Run");
5712
5740
  }
5713
5741
  },
5714
5742
  {
5715
5743
  name: "publishes one immutable Flow with idempotent Live CAS",
5716
5744
  async verify(e) {
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"));
5718
- G((await Y(await Z(e, `/v1/flows/${n}/live`), 200, "Read Live")).status, "not-published", "Initial Live status");
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");
5721
- let c = await Y(await Z(e, `/v1/flows/${n}/live`), 200, "Read published Live");
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");
5723
- let l = await Y(await Z(e, `/v1/flows/${n}/publications?includeTotal=true`), 200, "List Publications");
5724
- G(l.publications, [o], "Publication history"), G(l.total, 1, "Publication total"), await X(await Z(e, `/v1/flows/${n}/revisions/${r}/publications`, {
5745
+ let t = await Z(e, "Publication flow", "publication-flow"), n = q(t.flowId, "Publication Flow flowId"), r = await zc(e, n, q(t.draftRevisionId, "Publication Flow revisionId"));
5746
+ W((await J(await X(e, `/v1/flows/${n}/live`), 200, "Read Live")).status, "not-published", "Initial Live status");
5747
+ let i = () => $(e, n, r, null, "publication-first"), a = await Vc(e, await i(), 202, "Publish Flow"), o = a.publication, s = q(o.publicationId, "Publication id");
5748
+ W(await J(await i(), 202, "Replay Publish"), a.operation, "Replayed Publish operation"), await Y(await $(e, n, r, s, "publication-first"), 409, "publication.conflict", "Conflicting replay");
5749
+ let c = await J(await X(e, `/v1/flows/${n}/live`), 200, "Read published Live");
5750
+ W(c.publication, o, "Live Publication"), W((await J(await X(e, `/v1/flows/${n}/editor`), 200, "Read published editor")).live, c, "Published editor Live projection");
5751
+ let l = await J(await X(e, `/v1/flows/${n}/publications?includeTotal=true`), 200, "List Publications");
5752
+ W(l.publications, [o], "Publication history"), W(l.total, 1, "Publication total"), await Y(await X(e, `/v1/flows/${n}/revisions/${r}/publications`, {
5725
5753
  body: JSON.stringify({
5726
5754
  engineContract: "unsupported-engine/v1",
5727
5755
  expectedLivePublicationId: s,
@@ -5729,35 +5757,35 @@ var Hc = [
5729
5757
  }),
5730
5758
  headers: { "idempotency-key": "unsupported-publication" },
5731
5759
  method: "POST"
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");
5760
+ }), 409, "engine.unsupported", "Publish unsupported Engine"), await Y(await $(e, n, "00000000-0000-7000-8000-000000000002", s, "missing-revision-publication"), 404, "flow.not-found", "Publish missing Revision"), await Y(await Hc(e, n, "00000000-0000-7000-8000-000000000004", s, "missing-rollback"), 404, "publication.not-found", "Rollback missing Publication"), await Y(await Uc(e, "00000000-0000-7000-8000-000000000004", "missing-publication-run"), 404, "publication.not-found", "Run missing Publication");
5733
5761
  }
5734
5762
  },
5735
5763
  {
5736
5764
  name: "rolls back immutable history and fixes a Live Run target",
5737
5765
  async verify(e) {
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");
5741
- G(l.operation, "rollback", "Rollback operation"), G(l.sourcePublicationId, a, "Rollback source"), G(await Y(await c(), 200, "Replay Rollback"), l, "Replayed Rollback");
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");
5766
+ let t = await Z(e, "Rollback flow", "rollback-flow"), n = q(t.flowId, "Rollback Flow flowId"), r = await zc(e, n, q(t.draftRevisionId, "Rollback Flow revisionId")), i = (await Vc(e, await $(e, n, r, null, "publish-first"), 202, "Publish first Revision")).publication, a = q(i.publicationId, "First Publication"), o = (await Vc(e, await $(e, n, Bc(await J(await Q(e, n, r), 200, "Change Draft"), "Second Revision"), a, "publish-second"), 202, "Publish second Revision")).publication, s = q(o.publicationId, "Second Publication");
5767
+ await Y(await Uc(e, a, "stale-live-run"), 412, "live.conflict", "Run stale Publication");
5768
+ let c = () => Hc(e, n, a, s, "rollback-first"), l = await J(await c(), 201, "Rollback Flow"), u = q(l.publicationId, "Rollback Publication");
5769
+ W(l.operation, "rollback", "Rollback operation"), W(l.sourcePublicationId, a, "Rollback source"), W(await J(await c(), 200, "Replay Rollback"), l, "Replayed Rollback");
5770
+ let d = await J(await Uc(e, u, "rollback-run"), 202, "Create Live Run");
5771
+ W(d.flowId, n, "Live Run flowId"), W(d.revisionId, r, "Live Run revisionId"), await J(await X(e, `/v1/flows/${n}`, { method: "DELETE" }), 202, "Retire Flow"), await Y(await Uc(e, u, "retired-run"), 409, "flow.busy", "Run retired Flow");
5744
5772
  }
5745
5773
  }
5746
- ], Wc = [{
5774
+ ], Kc = [{
5747
5775
  name: "exposes one deployment-scoped Trigger Key catalog",
5748
5776
  async verify(e) {
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"));
5750
- G(r.map((e) => e.key), i.map((e) => e.key), "Trigger catalog identities");
5777
+ let t = await J(await X(e, "/v1/trigger-keys"), 200, "List Trigger Keys"), n = await J(await X(e, "/v1/trigger-keys/catalog"), 200, "List Trigger definitions"), r = K(t.keys, "Trigger Keys").map((e) => G(e, "Trigger Key")), i = K(n.definitions, "Trigger definitions").map((e) => G(e, "Trigger definition"));
5778
+ W(r.map((e) => e.key), i.map((e) => e.key), "Trigger catalog identities");
5751
5779
  for (let [t, n] of r.entries()) {
5752
- let r = J(n.key, "Trigger Key");
5753
- G((await Y(await Z(e, `/v1/trigger-keys/${encodeURIComponent(r)}`), 200, "Read Trigger Key")).definition, i[t], "Trigger detail");
5780
+ let r = q(n.key, "Trigger Key");
5781
+ W((await J(await X(e, `/v1/trigger-keys/${encodeURIComponent(r)}`), 200, "Read Trigger Key")).definition, i[t], "Trigger detail");
5754
5782
  }
5755
- await X(await Z(e, "/v1/trigger-keys/conformance.missing"), 404, "trigger-key.not-found", "Missing Trigger Key");
5783
+ await Y(await X(e, "/v1/trigger-keys/conformance.missing"), 404, "trigger-key.not-found", "Missing Trigger Key");
5756
5784
  }
5757
5785
  }, {
5758
5786
  name: "operates and retires one Live Trigger binding",
5759
5787
  async verify(e) {
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"), [{
5788
+ let t = await Z(e, "Trigger flow", "trigger-flow"), n = q(t.flowId, "Trigger Flow flowId"), r = Bc(await J(await Rc(e, n, q(t.draftRevisionId, "Trigger Flow revisionId"), [{
5761
5789
  kind: "graph.node.create",
5762
5790
  node: {
5763
5791
  cronTimes: [{
@@ -5779,15 +5807,15 @@ var Hc = [
5779
5807
  },
5780
5808
  nodeId: "webhook",
5781
5809
  target: { kind: "flow" }
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"));
5783
- G(s.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
5784
- for (let e of s) G(e.currentPublicationId, a, "Trigger Publication");
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}`, {
5810
+ }]), 200, "Create Trigger nodes"), "Trigger Revision"), i = (await Vc(e, await $(e, n, r, null, "trigger-publication"), 202, "Publish Trigger Flow")).publication, a = q(i.publicationId, "Trigger Publication"), o = `/v1/flows/${n}/triggers`, s = K((await J(await X(e, o), 200, "List Trigger bindings")).bindings, "Trigger bindings").map((e) => G(e, "Trigger binding"));
5811
+ W(s.map((e) => e.triggerNodeId), ["cron", "webhook"], "Trigger binding order");
5812
+ for (let e of s) W(e.currentPublicationId, a, "Trigger Publication");
5813
+ let c = `${o}/webhook`, l = q(G((await J(await X(e, c), 200, "Read Webhook")).binding, "Webhook").endpointUrl, "Webhook endpoint"), u = (t) => X(e, `${c}/${t}`, {
5786
5814
  body: JSON.stringify({ version: 1 }),
5787
5815
  method: "POST"
5788
5816
  });
5789
- G((await Y(await u("pause"), 200, "Pause Webhook")).operatorState, "paused", "Paused state"), G((await e.request(new Request(l, { method: "POST" }))).status, 404, "Paused callback"), G((await Y(await u("resume"), 200, "Resume Webhook")).operatorState, "active", "Resumed state"), G((await e.request(new Request(l, { method: "POST" }))).status, 200, "Resumed callback");
5790
- let d = (t) => Z(e, `/v1/flows/${n}/enabled`, {
5817
+ W((await J(await u("pause"), 200, "Pause Webhook")).operatorState, "paused", "Paused state"), W((await e.request(new Request(l, { method: "POST" }))).status, 404, "Paused callback"), W((await J(await u("resume"), 200, "Resume Webhook")).operatorState, "active", "Resumed state"), W((await e.request(new Request(l, { method: "POST" }))).status, 200, "Resumed callback");
5818
+ let d = (t) => X(e, `/v1/flows/${n}/enabled`, {
5791
5819
  method: "PUT",
5792
5820
  body: JSON.stringify({
5793
5821
  enabled: t,
@@ -5795,38 +5823,124 @@ var Hc = [
5795
5823
  version: 1
5796
5824
  })
5797
5825
  });
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, [{
5826
+ await J(await d(!1), 200, "Disable Trigger Flow"), W((await e.request(new Request(l, { method: "POST" }))).status, 404, "Disabled Flow blocks callback"), await J(await u("pause"), 200, "Pause binding while Flow disabled"), await J(await d(!0), 200, "Enable Trigger Flow"), W((await e.request(new Request(l, { method: "POST" }))).status, 404, "Enabling preserves binding pause"), await J(await u("resume"), 200, "Resume binding after enabling Flow"), W((await e.request(new Request(l, { method: "POST" }))).status, 200, "Enabled Flow permits callback"), await Vc(e, await $(e, n, Bc(await J(await Rc(e, n, r, [{
5799
5827
  kind: "graph.node.delete",
5800
5828
  nodeId: "webhook",
5801
5829
  target: { kind: "flow" }
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");
5830
+ }]), 200, "Delete Webhook"), "Retired Trigger Revision"), a, "retire-trigger"), 202, "Publish retired Trigger"), W(G((await J(await X(e, c), 200, "Read retired Webhook")).binding, "Retired Webhook").currentPublicationId, void 0, "Retired Publication");
5803
5831
  }
5804
- }], Gc = [{
5805
- name: "projects the deployment Connector catalog and authorized Connections",
5806
- async verify(e) {
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"));
5808
- (t.length == 0 || n.length == 0) && W("Connector conformance deployment must expose a Provider and Action.");
5809
- let r = n[0], i = J(r.actionId, "Connector Action id"), a = J(r.serviceId, "Connector Action serviceId");
5810
- t.some((e) => e.serviceId == a) || W("Connector Action must refer to a listed Provider."), G((await Y(await Z(e, `/v1/connector/actions/${encodeURIComponent(i)}`), 200, "Read Connector Action")).action, r, "Connector Action detail");
5811
- let o = await Y(await Z(e, `/v1/connector/connections/${encodeURIComponent(a)}`), 200, "List Connector Connections");
5812
- Array.isArray(o.connections) || W("Connector Connections must be an array.");
5813
- let s = await Y(await Z(e, `/v1/connector/connections/${encodeURIComponent(a)}/page`, {
5814
- body: JSON.stringify({ version: 1 }),
5815
- method: "POST"
5816
- }), 200, "Create Connector Connection page"), c = new URL(J(s.url, "Connector Connection page URL"));
5817
- c.protocol != "http:" && c.protocol != "https:" && W("Connector Connection page URL must use HTTP.");
5818
- }
5819
- }, {
5820
- name: "rejects invalid Connector discovery requests",
5821
- async verify(e) {
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");
5832
+ }], qc = [
5833
+ {
5834
+ name: "projects implicit Connector access without writable binding state",
5835
+ async verify(e) {
5836
+ let t = q((await Z(e, "Connector access", "connector-access-create")).flowId, "Flow ID"), n = await J(await X(e, `/v1/flows/${t}/connector-access`), 200, "Read Connector access");
5837
+ W(n.accessRevision, 0, "Implicit Connector access revision"), W(n.bindings, [], "Implicit Connector access bindings"), W(n.mode, "implicit", "Implicit Connector access mode"), q(n.providerAccessDigest, "Implicit Connector access digest").startsWith("implicit") || U("Implicit Connector access digest must identify the implicit authority generation."), W(n.version, 1, "Implicit Connector access version"), W(await J(await X(e, `/v1/flows/${t}/connector-access/mail/candidates`), 200, "Read Connector access candidates"), {
5838
+ candidates: [],
5839
+ mode: "implicit",
5840
+ providerId: "mail",
5841
+ version: 1
5842
+ }, "Implicit Connector access candidates"), await Y(await X(e, `/v1/flows/${t}/connector-access/mail`, {
5843
+ body: JSON.stringify({
5844
+ accessBindingId: "editors",
5845
+ expectedAccessRevision: 0,
5846
+ version: 1
5847
+ }),
5848
+ method: "PUT"
5849
+ }), 409, "connector.access-unsupported", "Set implicit Connector access"), await Y(await X(e, `/v1/flows/${t}/connector-access/mail`, {
5850
+ body: JSON.stringify({
5851
+ accessBindingId: "editors",
5852
+ expectedAccessRevision: 0,
5853
+ version: 1
5854
+ }),
5855
+ method: "DELETE"
5856
+ }), 409, "connector.access-unsupported", "Clear implicit Connector access");
5857
+ }
5858
+ },
5859
+ {
5860
+ name: "projects the deployment Connector catalog and authorized Connections",
5861
+ async verify(e) {
5862
+ let t = K((await J(await X(e, "/v1/connector/providers"), 200, "List Connector Providers")).providers, "Connector Providers").map((e) => G(e, "Connector Provider")), n = K((await J(await X(e, "/v1/connector/actions"), 200, "List Connector Actions")).actions, "Connector Actions").map((e) => G(e, "Connector Action"));
5863
+ (t.length == 0 || n.length == 0) && U("Connector conformance deployment must expose a Provider and Action.");
5864
+ let r = n[0], i = q(r.actionId, "Connector Action id"), a = q(r.serviceId, "Connector Action serviceId");
5865
+ t.some((e) => e.serviceId == a) || U("Connector Action must refer to a listed Provider."), W((await J(await X(e, `/v1/connector/actions/${encodeURIComponent(i)}`), 200, "Read Connector Action")).action, r, "Connector Action detail");
5866
+ let o = await J(await X(e, `/v1/connector/connections/${encodeURIComponent(a)}`), 200, "List Connector Connections");
5867
+ Array.isArray(o.connections) || U("Connector Connections must be an array.");
5868
+ let s = await J(await X(e, `/v1/connector/connections/${encodeURIComponent(a)}/page`, {
5869
+ body: JSON.stringify({ version: 1 }),
5870
+ method: "POST"
5871
+ }), 200, "Create Connector Connection page"), c = new URL(q(s.url, "Connector Connection page URL"));
5872
+ c.protocol != "http:" && c.protocol != "https:" && U("Connector Connection page URL must use HTTP.");
5873
+ }
5874
+ },
5875
+ {
5876
+ name: "rejects invalid Connector discovery requests",
5877
+ async verify(e) {
5878
+ await Y(await X(e, "/v1/connector/actions?service=mail&q=send"), 400, "flow.invalid", "Conflicting Connector query"), await Y(await X(e, "/v1/connector/actions?q=%20%20"), 400, "flow.invalid", "Empty Connector query"), await Y(await X(e, `/v1/connector/connections/${"a".repeat(257)}`), 400, "flow.invalid", "Oversized Connector service"), await Y(await X(e, "/v1/connector/actions/conformance.missing"), 404, "connector.action-not-found", "Missing Connector Action");
5879
+ }
5823
5880
  }
5824
- }], Kc = [{
5881
+ ];
5882
+ function Jc(e) {
5883
+ return [{
5884
+ name: "selects Provider access with optimistic concurrency",
5885
+ async verify(t) {
5886
+ let n = await Z(t, "Selectable Connector access", "selectable-connector-access-create"), r = q(n.flowId, "Flow ID"), i = `/v1/flows/${r}/connector-access/${encodeURIComponent(e.providerId)}`, a = await J(await X(t, `/v1/flows/${r}/connector-access`), 200, "Read selectable Connector access");
5887
+ W(a.mode, "selectable", "Selectable Connector access mode"), W(a.accessRevision, 0, "Initial selectable Connector access revision");
5888
+ let o = await J(await X(t, `${i}/candidates`), 200, "Read Provider access candidates");
5889
+ W(o.mode, "selectable", "Provider access candidate mode"), W(o.providerId, e.providerId, "Provider access candidate Provider");
5890
+ let s = K(o.candidates, "Provider access candidates").find((t) => G(t, "Provider access candidate").accessBindingId == e.accessBindingId);
5891
+ s ?? U("Expected selectable Provider access candidate was not returned."), W(G(s, "Provider access candidate").connectionDisplayName, e.connectionDisplayName, "Provider access candidate connection display name"), W(G(s, "Provider access candidate").permissionGroupName, e.permissionGroupName, "Provider access candidate permission group name");
5892
+ let c = await J(await X(t, i, {
5893
+ body: JSON.stringify({
5894
+ accessBindingId: e.accessBindingId,
5895
+ expectedAccessRevision: 0,
5896
+ version: 1
5897
+ }),
5898
+ method: "PUT"
5899
+ }), 200, "Select Provider access");
5900
+ W(c.accessRevision, 1, "Selected Connector access revision"), W(c.mode, "selectable", "Selected Connector access mode");
5901
+ let l = K(c.bindings, "Selected Connector access bindings").find((t) => G(t, "Selected Connector access binding").providerId == e.providerId);
5902
+ l ?? U("Selected Provider access binding was not projected."), W(G(l, "Selected Connector access binding").accessBindingId, e.accessBindingId, "Selected Provider access binding ID"), W(G(l, "Selected Connector access binding").connectionDisplayName, e.connectionDisplayName, "Selected Provider access binding connection display name"), W(G(l, "Selected Connector access binding").permissionGroupName, e.permissionGroupName, "Selected Provider access binding permission group name");
5903
+ let u = q(c.providerAccessDigest, "Selected Connector access digest"), d = await zc(t, r, q(n.draftRevisionId, "Draft Revision ID"));
5904
+ W((await J(await X(t, `/v1/flows/${r}/revisions/${d}/runs`, {
5905
+ body: JSON.stringify({
5906
+ engineContract: H,
5907
+ inputs: {},
5908
+ trigger: {
5909
+ nodeId: "start",
5910
+ outputs: {}
5911
+ },
5912
+ version: 2
5913
+ }),
5914
+ headers: { "idempotency-key": "selectable-connector-access-draft-run" },
5915
+ method: "POST"
5916
+ }), 202, "Admit Draft Run with selected Provider access")).providerAccessDigest, u, "Draft Run Provider access snapshot");
5917
+ let f = await Vc(t, await $(t, r, d, null, "selectable-connector-access-publish"), 202, "Publish selected Provider access");
5918
+ W(f.publication.providerAccessDigest, u, "Publication Provider access snapshot"), await Y(await X(t, i, {
5919
+ body: JSON.stringify({
5920
+ accessBindingId: e.accessBindingId,
5921
+ expectedAccessRevision: 0,
5922
+ version: 1
5923
+ }),
5924
+ method: "PUT"
5925
+ }), 412, "connector.access-conflict", "Overwrite Provider access with a stale revision");
5926
+ let p = await J(await X(t, i, {
5927
+ body: JSON.stringify({
5928
+ accessBindingId: e.accessBindingId,
5929
+ expectedAccessRevision: 1,
5930
+ version: 1
5931
+ }),
5932
+ method: "DELETE"
5933
+ }), 200, "Clear Provider access");
5934
+ W(p.accessRevision, 2, "Cleared Connector access revision"), W(p.bindings, [], "Cleared Connector access bindings"), W((await J(await X(t, `/v1/flows/${r}/live`), 200, "Read Live after clearing Provider access")).hasUnpublishedChanges, !0, "Cleared Draft access marks Live as unpublished"), W((await J(await Uc(t, q(f.publication.publicationId, "Publication ID"), "selectable-connector-access-live-run"), 202, "Admit Live Run after clearing Draft access")).providerAccessDigest, u, "Live Run preserves Publication Provider access snapshot");
5935
+ }
5936
+ }];
5937
+ }
5938
+ var Yc = [{
5825
5939
  name: "preserves committed mutations and idempotency receipts after restart",
5826
5940
  async verify(e) {
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");
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");
5941
+ let t = await Z(e, "Recovery", "recovery-create"), n = q(t.flowId, "Flow ID"), r = q(t.draftRevisionId, "Revision ID"), i = await J(await Q(e, n, r, "marker", "recovery-change"), 200, "Commit change");
5942
+ await e.restart(), W((await J(await Lc(e, "Recovery", "recovery-create"), 200, "Replay creation after restart")).flowId, n, "Durable creation identity"), W(await J(await Q(e, n, r, "marker", "recovery-change"), 200, "Replay change after restart"), i, "Durable change receipt"), W((await J(await X(e, `/v1/flows/${n}/draft`), 200, "Recovered Draft")).revisionId, G(i.revision, "Revision").revisionId, "Recovered head");
5829
5943
  }
5830
5944
  }];
5831
5945
  //#endregion
5832
- export { Gc as connectorControlApiConformanceCases, Hc as controlApiConformanceCases, Kc as controlRecoveryConformanceCases, Uc as publicationControlApiConformanceCases, Wc as triggerControlApiConformanceCases };
5946
+ export { qc as connectorControlApiConformanceCases, Wc as controlApiConformanceCases, Yc as controlRecoveryConformanceCases, Gc as publicationControlApiConformanceCases, Jc as selectableConnectorAccessControlApiConformanceCases, Kc as triggerControlApiConformanceCases };