@oomol-lab/open-flow 0.1.0-beta.27 → 0.1.0-beta.28

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 (49) hide show
  1. package/dist/browser/{createResourceDialog-BwI2JmPE.js → createResourceDialog-C2ZLGPla.js} +1 -1
  2. package/dist/browser/flow-authoring-node.d.ts +3 -2
  3. package/dist/browser/flow-authoring.js +933 -915
  4. package/dist/browser/flow-change-schema.d.ts +4 -0
  5. package/dist/browser/flow-change.d.ts +8 -7
  6. package/dist/browser/flow-change.js +1067 -1050
  7. package/dist/browser/flow-notifications.d.ts +6 -2
  8. package/dist/browser/{flowChanges-DhEjA0n5.js → flowChanges-Z49mslMz.js} +1096 -1014
  9. package/dist/browser/{flowWorkspace-zcweMsLS.js → flowWorkspace-DCaVDqtY.js} +40105 -43746
  10. package/dist/browser/host-conformance.js +7 -1
  11. package/dist/browser/{inputValues-C5ExCCf0.js → inputValues-CLnpqFAf.js} +1 -1
  12. package/dist/browser/{markdownContent-SIlWuHve.js → markdownContent-Bon8uhjM.js} +23 -23
  13. package/dist/browser/{switch-CyZ96-UF.js → switch-DuB8aovT.js} +5035 -513
  14. package/dist/browser/ui.css +1 -1
  15. package/dist/browser/workbench.css +1 -1
  16. package/dist/browser/workbench.js +890 -727
  17. package/dist/browser/{workbenchSelect-BUu7CjUA.js → workbenchSelect-DX9IFmX-.js} +1187 -1156
  18. package/dist/common/authoringExamples.d.ts +27 -0
  19. package/dist/common/control-api-conformance.js +838 -820
  20. package/dist/common/control-api-errors.d.ts +8 -0
  21. package/dist/common/control-api.d.ts +7 -3
  22. package/dist/common/control-api.js +1423 -1368
  23. package/dist/common/control-requests.d.ts +13 -6
  24. package/dist/common/control-requests.js +2034 -1510
  25. package/dist/common/cron-trigger.d.ts +2 -1
  26. package/dist/common/cron-trigger.js +27 -24
  27. package/dist/common/draftOperations.d.ts +14 -0
  28. package/dist/common/engine-contract.d.ts +2 -2
  29. package/dist/common/flow-encoding.d.ts +3 -0
  30. package/dist/common/flow-encoding.js +1067 -968
  31. package/dist/common/flow-notifications.d.ts +6 -2
  32. package/dist/common/flow-schema.d.ts +1 -2
  33. package/dist/common/flow-semantics.d.ts +2 -1
  34. package/dist/common/flow-semantics.js +7935 -7812
  35. package/dist/common/flowInspection.d.ts +16 -0
  36. package/dist/common/integration-trigger.d.ts +2 -2
  37. package/dist/common/integration-trigger.js +8 -8
  38. package/dist/common/mcp.d.ts +2 -1
  39. package/dist/common/mcp.js +138 -105
  40. package/dist/common/poll-trigger.d.ts +3 -0
  41. package/dist/common/poll-trigger.js +26 -22
  42. package/dist/common/provider-triggers.js +2704 -2599
  43. package/dist/common/runtime-contract.js +3 -3
  44. package/dist/common/scheduler.d.ts +4 -3
  45. package/dist/common/scheduler.js +1855 -1725
  46. package/dist/common/trigger-contract.d.ts +5 -0
  47. package/dist/common/webhook-trigger.d.ts +3 -3
  48. package/dist/common/webhook-trigger.js +64 -18
  49. package/package.json +1 -1
@@ -0,0 +1,16 @@
1
+ import type { Draft, Flow } from './control-api.js';
2
+ export declare function inspectFlowDraft(flow: Flow, readDraft: () => Draft | Promise<Draft>): Promise<{
3
+ flow: Flow;
4
+ draft: Draft;
5
+ version: 1;
6
+ draftIssue?: undefined;
7
+ } | {
8
+ flow: Flow;
9
+ draft: null;
10
+ draftIssue: {
11
+ code: unknown;
12
+ message: string;
13
+ revisionId: string;
14
+ };
15
+ version: 1;
16
+ }>;
@@ -14,7 +14,7 @@ export interface ListenerPage {
14
14
  readonly checkpoint: JsonValue;
15
15
  readonly dedupeKey: string;
16
16
  readonly hasMore: boolean;
17
- readonly payload: Readonly<Record<string, JsonValue>> | null;
17
+ readonly outputs: Readonly<Record<string, JsonValue>> | null;
18
18
  }
19
19
  export interface ListenerSource {
20
20
  readonly intervalMs: number;
@@ -28,7 +28,7 @@ export type IntegrationReceiveResult = {
28
28
  readonly continue?: boolean;
29
29
  readonly dedupeKey?: string;
30
30
  readonly outcome: 'event';
31
- readonly payload: Readonly<Record<string, JsonValue>>;
31
+ readonly outputs: Readonly<Record<string, JsonValue>>;
32
32
  } | {
33
33
  readonly checkpoint?: JsonValue;
34
34
  readonly continue?: boolean;
@@ -90,7 +90,7 @@ var a = 65536, o = 5, s = /^\/v1\/integrations\/(endpoint_[0-9a-f]{32})$/, c = n
90
90
  function l(e) {
91
91
  if (!i(e) || e.checkpoint == null || !r(e.checkpoint) || typeof e.hasMore != "boolean") throw TypeError("Listener page must contain a JSON checkpoint and a boolean hasMore.");
92
92
  if (typeof e.dedupeKey != "string" || e.dedupeKey.length == 0 || c.encode(e.dedupeKey).byteLength > 1024) throw TypeError("Listener page identity must contain between 1 and 1024 bytes.");
93
- if (e.payload !== null && !i(e.payload)) throw TypeError("Listener page payload must be an object or null.");
93
+ if (e.outputs !== null && !i(e.outputs)) throw TypeError("Listener page outputs must be an object or null.");
94
94
  if (c.encode(JSON.stringify(e.checkpoint)).byteLength > 65536) throw TypeError("Listener checkpoint exceeds 64 KiB.");
95
95
  }
96
96
  var u = class extends Error {
@@ -163,11 +163,11 @@ var g = {
163
163
  continue: r < i,
164
164
  dedupeKey: `${a}:${r}`,
165
165
  outcome: "event",
166
- payload: {
166
+ outputs: { payload: {
167
167
  body: { page: r },
168
168
  deliveryId: a,
169
169
  event: "conformance"
170
- }
170
+ } }
171
171
  };
172
172
  }
173
173
  let n = typeof t?.deliveryId == "string" ? t.deliveryId : "delivery", r = C(t?.body) ?? {};
@@ -175,11 +175,11 @@ var g = {
175
175
  checkpoint: { deliveryId: n },
176
176
  dedupeKey: n,
177
177
  outcome: "event",
178
- payload: {
178
+ outputs: { payload: {
179
179
  body: r,
180
180
  deliveryId: n,
181
181
  event: "conformance"
182
- }
182
+ } }
183
183
  };
184
184
  },
185
185
  async reconcile(e) {
@@ -359,16 +359,16 @@ var g = {
359
359
  checkpoint: n + 1,
360
360
  dedupeKey: String(n),
361
361
  hasMore: n + 1 < r,
362
- payload: {
362
+ outputs: { payload: {
363
363
  body: {},
364
364
  deliveryId: String(n),
365
365
  event: "change"
366
- }
366
+ } }
367
367
  } : {
368
368
  checkpoint: e,
369
369
  dedupeKey: String(n),
370
370
  hasMore: !1,
371
- payload: null
371
+ outputs: null
372
372
  };
373
373
  }
374
374
  }
@@ -80,6 +80,7 @@ export declare const mcpTools: {
80
80
  validate(value: unknown): {
81
81
  value: {
82
82
  kind?: string | undefined;
83
+ example?: string | undefined;
83
84
  };
84
85
  } | {
85
86
  issues: {
@@ -300,7 +301,7 @@ export declare const mcpTools: {
300
301
  publicationId?: string | undefined;
301
302
  trigger: {
302
303
  nodeId: string;
303
- payload: JsonValue;
304
+ outputs: Record<string, JsonValue>;
304
305
  };
305
306
  inputs: Record<string, Record<string, JsonValue>>;
306
307
  idempotencyKey: string;
@@ -4458,39 +4458,53 @@ function sc(e, t = 0) {
4458
4458
  if (typeof e == "object" && e) for (let n of Object.values(e)) sc(n, t + 1);
4459
4459
  }
4460
4460
  //#endregion
4461
- //#region src/flow/common/changeSchema.ts
4462
- var R = D(), z = rc(), cc = j(R), lc = M({
4461
+ //#region src/flow/common/triggerScheduleSchema.ts
4462
+ var cc = j(P([M({
4463
+ type: L("cron"),
4464
+ expression: D(),
4465
+ timezone: D()
4466
+ }), M({
4467
+ type: L("every"),
4468
+ unit: I([
4469
+ "day",
4470
+ "hour",
4471
+ "minute",
4472
+ "month",
4473
+ "week"
4474
+ ]),
4475
+ value: k()
4476
+ })])), R = D(), z = rc(), lc = j(R), uc = M({
4463
4477
  description: R.optional(),
4464
4478
  jsonSchema: z,
4465
4479
  nullable: A(),
4466
4480
  handle: R
4467
- }), B = lc.extend({ value: z.optional() }), uc = M({
4481
+ }), B = uc.extend({ value: z.optional() }), dc = M({
4468
4482
  collapsed: A().optional(),
4469
4483
  group: R
4470
- }), dc = M({
4484
+ }), fc = M({
4471
4485
  kind: L("node"),
4472
4486
  nodeId: R,
4473
4487
  output: R
4474
- }), fc = M({
4488
+ }), pc = M({
4475
4489
  kind: L("flow"),
4476
4490
  input: R
4477
- }), pc = P([
4478
- dc,
4491
+ }), mc = P([
4479
4492
  fc,
4493
+ pc,
4480
4494
  M({
4481
4495
  kind: L("binding"),
4482
4496
  bindingId: R
4483
4497
  })
4484
- ]), mc = P([M({
4498
+ ]), hc = P([M({
4485
4499
  kind: L("value"),
4486
4500
  value: z
4487
4501
  }), M({
4488
4502
  kind: L("sources"),
4489
- sources: j(pc)
4490
- })]), hc = F(R, mc), gc = {
4491
- inputs: j(P([B, uc])),
4492
- outputs: j(P([lc, uc]))
4493
- }, _c = M({
4503
+ sources: j(mc)
4504
+ })]), gc = F(R, hc), _c = {
4505
+ inputs: j(P([B, dc])),
4506
+ outputs: j(P([uc, dc]))
4507
+ }, vc = M({
4494
4508
  kind: L("connector"),
4495
4509
  action: R,
4496
4510
  connectionId: R.optional(),
@@ -4498,19 +4512,19 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4498
4512
  connectionId: R,
4499
4513
  alias: R.optional()
4500
4514
  }))
4501
- }), vc = M({
4502
- ...gc,
4515
+ }), yc = M({
4516
+ ..._c,
4503
4517
  name: R,
4504
4518
  moduleId: R,
4505
- capabilities: j(_c).optional()
4506
- }), yc = P([M({
4519
+ capabilities: j(vc).optional()
4520
+ }), bc = P([M({
4507
4521
  kind: L("value"),
4508
4522
  value: z
4509
4523
  }), M({
4510
4524
  kind: L("input"),
4511
4525
  input: R
4512
- })]), bc = P([yc, M({ kind: L("model") })]), xc = M({
4513
- ...gc,
4526
+ })]), xc = P([bc, M({ kind: L("model") })]), Sc = M({
4527
+ ..._c,
4514
4528
  name: R,
4515
4529
  executor: P([
4516
4530
  M({
@@ -4526,7 +4540,7 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4526
4540
  kind: L("agent"),
4527
4541
  code: A().optional(),
4528
4542
  model: R,
4529
- prompt: yc,
4543
+ prompt: bc,
4530
4544
  system: R,
4531
4545
  maxRounds: k(),
4532
4546
  tools: j(M({
@@ -4536,16 +4550,16 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4536
4550
  action: R,
4537
4551
  connectionId: R.optional(),
4538
4552
  approval: A(),
4539
- inputs: j(B.extend({ source: bc }))
4553
+ inputs: j(B.extend({ source: xc }))
4540
4554
  })),
4541
4555
  notification: M({
4542
4556
  taskId: R,
4543
4557
  messageHandle: R,
4544
- inputs: F(R, yc)
4558
+ inputs: F(R, bc)
4545
4559
  }).optional()
4546
4560
  })
4547
4561
  ])
4548
- }), Sc = {
4562
+ }), Cc = {
4549
4563
  input: B,
4550
4564
  cases: j(M({
4551
4565
  output: R,
@@ -4578,41 +4592,27 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4578
4592
  }))
4579
4593
  })),
4580
4594
  defaultOutput: R.optional()
4581
- }, Cc = {
4595
+ }, wc = {
4582
4596
  actions: P([Os([L("continue")]), Os([L("approve"), L("reject")])]),
4583
4597
  prompt: R
4584
- }, wc = {
4585
- inputsDef: j(B),
4598
+ }, Tc = {
4599
+ bodyFields: j(B),
4586
4600
  options: M({
4587
- allowedMethods: cc.optional(),
4588
- allowedOrigins: cc.optional(),
4601
+ allowedMethods: lc.optional(),
4602
+ allowedOrigins: lc.optional(),
4589
4603
  noResponseBody: A().optional(),
4590
4604
  responseData: R.optional(),
4591
4605
  responseHeaders: F(R, R).optional(),
4592
4606
  responseStatusCode: k().optional()
4593
4607
  }).optional()
4594
- }, Tc = j(P([M({
4595
- type: L("cron"),
4596
- expression: R,
4597
- timezone: R
4598
- }), M({
4599
- type: L("every"),
4600
- unit: I([
4601
- "day",
4602
- "hour",
4603
- "minute",
4604
- "month",
4605
- "week"
4606
- ]),
4607
- value: k()
4608
- })])), Ec = {
4608
+ }, Ec = {
4609
4609
  configSchema: z,
4610
- definitionVersion: k(),
4610
+ definitionVersion: L(2),
4611
4611
  description: R,
4612
4612
  displayName: R,
4613
4613
  key: R,
4614
4614
  name: R,
4615
- payloadSchema: z,
4615
+ outputs: j(uc).refine((e) => new Set(e.map((e) => e.handle)).size === e.length, "Duplicate Trigger output handle."),
4616
4616
  provider: R
4617
4617
  }, Dc = M({
4618
4618
  body: M({
@@ -4639,7 +4639,8 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4639
4639
  description: R.optional(),
4640
4640
  icon: R.optional()
4641
4641
  }, kc = {
4642
- inputs: hc,
4642
+ maxExecutions: k().int().positive().max(2 ** 53 - 1).optional(),
4643
+ inputs: gc,
4643
4644
  name: R.optional(),
4644
4645
  description: R.optional(),
4645
4646
  icon: R.optional(),
@@ -4648,7 +4649,7 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4648
4649
  M({
4649
4650
  ...kc,
4650
4651
  kind: L("condition"),
4651
- ...Sc
4652
+ ...Cc
4652
4653
  }),
4653
4654
  M({
4654
4655
  ...kc,
@@ -4664,7 +4665,7 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4664
4665
  M({
4665
4666
  ...kc,
4666
4667
  kind: L("task"),
4667
- task: vc,
4668
+ task: yc,
4668
4669
  additionalInputs: j(B).optional()
4669
4670
  }),
4670
4671
  M({
@@ -4677,7 +4678,7 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4677
4678
  ...kc,
4678
4679
  kind: L("wait"),
4679
4680
  input: B,
4680
- ...Cc
4681
+ ...wc
4681
4682
  }).omit({ timeoutMs: !0 }),
4682
4683
  M({
4683
4684
  ...Oc,
@@ -4686,12 +4687,12 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4686
4687
  M({
4687
4688
  ...Oc,
4688
4689
  kind: L("webhook"),
4689
- ...wc
4690
+ ...Tc
4690
4691
  }),
4691
4692
  M({
4692
4693
  ...Oc,
4693
4694
  kind: L("cron"),
4694
- cronTimes: Tc
4695
+ cronTimes: cc
4695
4696
  }),
4696
4697
  M({
4697
4698
  ...Oc,
@@ -4702,7 +4703,7 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4702
4703
  ...Ec,
4703
4704
  type: L("poll")
4704
4705
  }),
4705
- pollTimes: Tc
4706
+ pollTimes: cc
4706
4707
  }),
4707
4708
  M({
4708
4709
  ...Oc,
@@ -4728,7 +4729,7 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4728
4729
  }, Nc = M({
4729
4730
  name: R,
4730
4731
  inputs: j(B),
4731
- outputs: j(lc.extend({ sources: j(P([dc, fc])) }))
4732
+ outputs: j(uc.extend({ sources: j(P([fc, pc])) }))
4732
4733
  }), Pc = M({
4733
4734
  nodes: F(R, Ac),
4734
4735
  edges: j(Mc).default([])
@@ -4737,15 +4738,15 @@ var R = D(), z = rc(), cc = j(R), lc = M({
4737
4738
  target: R
4738
4739
  }), Ic = M({
4739
4740
  name: R,
4740
- imports: cc,
4741
+ imports: lc,
4741
4742
  source: R
4742
4743
  }), Lc = M({
4743
4744
  bindings: F(R, Fc),
4744
4745
  graph: Pc,
4745
4746
  subflows: F(R, Nc.extend({ graph: Pc })),
4746
- tasks: F(R, xc)
4747
+ tasks: F(R, Sc)
4747
4748
  }), Rc = M({
4748
- modelVersion: L(1),
4749
+ modelVersion: L(2),
4749
4750
  document: Lc,
4750
4751
  modules: F(R, Ic)
4751
4752
  });
@@ -4780,28 +4781,38 @@ var Bc = {
4780
4781
  node: Ac
4781
4782
  },
4782
4783
  "graph.node.delete": V,
4783
- "graph.node.field.set": P([M({
4784
- ...V,
4785
- kind: L("graph.node.field.set"),
4786
- field: I([
4787
- "description",
4788
- "icon",
4789
- "name"
4790
- ]),
4791
- before: R.optional(),
4792
- value: R.optional()
4793
- }), M({
4794
- ...V,
4795
- kind: L("graph.node.field.set"),
4796
- field: L("timeoutMs"),
4797
- before: k().optional(),
4798
- value: k().optional()
4799
- })]),
4784
+ "graph.node.field.set": P([
4785
+ M({
4786
+ ...V,
4787
+ kind: L("graph.node.field.set"),
4788
+ field: I([
4789
+ "description",
4790
+ "icon",
4791
+ "name"
4792
+ ]),
4793
+ before: R.optional(),
4794
+ value: R.optional()
4795
+ }),
4796
+ M({
4797
+ ...V,
4798
+ kind: L("graph.node.field.set"),
4799
+ field: L("maxExecutions"),
4800
+ before: k().int().positive().max(2 ** 53 - 1).optional(),
4801
+ value: k().int().positive().max(2 ** 53 - 1).optional()
4802
+ }),
4803
+ M({
4804
+ ...V,
4805
+ kind: L("graph.node.field.set"),
4806
+ field: L("timeoutMs"),
4807
+ before: k().optional(),
4808
+ value: k().optional()
4809
+ })
4810
+ ]),
4800
4811
  "graph.node.input.set": {
4801
4812
  ...V,
4802
4813
  handle: R,
4803
- before: mc.optional(),
4804
- value: mc.optional()
4814
+ before: hc.optional(),
4815
+ value: hc.optional()
4805
4816
  },
4806
4817
  "graph.node.additional-inputs.set": {
4807
4818
  ...V,
@@ -4810,8 +4821,8 @@ var Bc = {
4810
4821
  },
4811
4822
  "graph.node.condition.set": {
4812
4823
  ...V,
4813
- before: M(Sc),
4814
- value: M(Sc)
4824
+ before: M(Cc),
4825
+ value: M(Cc)
4815
4826
  },
4816
4827
  "graph.node.values.set": {
4817
4828
  ...V,
@@ -4821,19 +4832,19 @@ var Bc = {
4821
4832
  "graph.node.wait.set": {
4822
4833
  ...V,
4823
4834
  target: M({ kind: L("flow") }),
4824
- before: M(Cc),
4825
- value: M(Cc)
4835
+ before: M(wc),
4836
+ value: M(wc)
4826
4837
  },
4827
4838
  "graph.node.webhook.set": {
4828
4839
  ...V,
4829
4840
  target: M({ kind: L("flow") }),
4830
- before: M(wc),
4831
- value: M(wc)
4841
+ before: M(Tc),
4842
+ value: M(Tc)
4832
4843
  },
4833
4844
  "graph.node.task.ports.set": {
4834
4845
  ...V,
4835
- before: M(gc),
4836
- value: M(gc)
4846
+ before: M(_c),
4847
+ value: M(_c)
4837
4848
  },
4838
4849
  "graph.node.task.name.set": {
4839
4850
  ...V,
@@ -4842,8 +4853,8 @@ var Bc = {
4842
4853
  },
4843
4854
  "graph.node.task.capabilities.set": {
4844
4855
  ...V,
4845
- before: j(_c).optional(),
4846
- value: j(_c).optional()
4856
+ before: j(vc).optional(),
4857
+ value: j(vc).optional()
4847
4858
  },
4848
4859
  "graph.trigger.config.set": {
4849
4860
  nodeId: R,
@@ -4853,8 +4864,8 @@ var Bc = {
4853
4864
  },
4854
4865
  "graph.trigger.schedule.set": {
4855
4866
  nodeId: R,
4856
- before: Tc,
4857
- value: Tc
4867
+ before: cc,
4868
+ value: cc
4858
4869
  },
4859
4870
  "module.create": {
4860
4871
  moduleId: R,
@@ -4868,9 +4879,9 @@ var Bc = {
4868
4879
  },
4869
4880
  "module.source.replace": {
4870
4881
  moduleId: R,
4871
- beforeImports: cc,
4882
+ beforeImports: lc,
4872
4883
  beforeSource: R,
4873
- imports: cc,
4884
+ imports: lc,
4874
4885
  source: R
4875
4886
  },
4876
4887
  "subflow.create": {
@@ -4885,7 +4896,7 @@ var Bc = {
4885
4896
  "subflow.delete": { subflowId: R },
4886
4897
  "task.create": {
4887
4898
  taskId: R,
4888
- task: xc
4899
+ task: Sc
4889
4900
  },
4890
4901
  "task.delete": { taskId: R },
4891
4902
  "task.connector.connection.set": {
@@ -4895,8 +4906,8 @@ var Bc = {
4895
4906
  },
4896
4907
  "task.agent.set": {
4897
4908
  taskId: R,
4898
- before: xc,
4899
- value: xc
4909
+ before: Sc,
4910
+ value: Sc
4900
4911
  },
4901
4912
  "task.llm.mode.set": {
4902
4913
  taskId: R,
@@ -5017,6 +5028,8 @@ var H = {
5017
5028
  eventSourceNotFound: "event-source.not-found",
5018
5029
  eventSourceConflict: "event-source.conflict",
5019
5030
  flowInvalid: "flow.invalid",
5031
+ flowRepairRequired: "flow.repair-required",
5032
+ flowUpgradeRequired: "flow.upgrade-required",
5020
5033
  flowNotFound: "flow.not-found",
5021
5034
  flowBusy: "flow.busy",
5022
5035
  flowConflict: "flow.conflict",
@@ -5044,7 +5057,7 @@ var H = {
5044
5057
  variableLimitReached: "variable.limit-reached",
5045
5058
  variableNotFound: "variable.not-found"
5046
5059
  };
5047
- H.eventSourceInvalid, H.eventSourceIdentityUnavailable, H.eventSourceNotFound, H.eventSourceConflict, H.authenticationRequired, H.authorizationDenied, H.bindingUnresolved, H.connectorActionNotFound, H.connectorUnconfigured, H.connectorUnavailable, H.connectorConsoleUnconfigured, H.engineUnavailable, H.engineUnsupported, H.flowInvalid, H.flowNotFound, H.flowBusy, H.flowConflict, H.flowPresentationConflict, H.flowRevisionConflict, H.liveConflict, H.liveNotFound, H.pageInvalidCursor, H.publicationConflict, H.publicationNotFound, H.publicationUnsupported, H.publishOperationNotFound, H.routeNotFound, H.runConflict, H.runEventsExpired, H.runInvalid, H.runNotFound, H.runNotTerminal, H.runOverloaded, H.runWaitNotFound, H.triggerKeyInvalid, H.triggerKeyNotFound, H.triggerNotFound, H.variableInvalid, H.variableLimitReached, H.variableNotFound;
5060
+ H.eventSourceInvalid, H.eventSourceIdentityUnavailable, H.eventSourceNotFound, H.eventSourceConflict, H.authenticationRequired, H.authorizationDenied, H.bindingUnresolved, H.connectorActionNotFound, H.connectorUnconfigured, H.connectorUnavailable, H.connectorConsoleUnconfigured, H.engineUnavailable, H.engineUnsupported, H.flowInvalid, H.flowRepairRequired, H.flowUpgradeRequired, H.flowNotFound, H.flowBusy, H.flowConflict, H.flowPresentationConflict, H.flowRevisionConflict, H.liveConflict, H.liveNotFound, H.pageInvalidCursor, H.publicationConflict, H.publicationNotFound, H.publicationUnsupported, H.publishOperationNotFound, H.routeNotFound, H.runConflict, H.runEventsExpired, H.runInvalid, H.runNotFound, H.runNotTerminal, H.runOverloaded, H.runWaitNotFound, H.triggerKeyInvalid, H.triggerKeyNotFound, H.triggerNotFound, H.variableInvalid, H.variableLimitReached, H.variableNotFound;
5048
5061
  var $c = class extends Error {
5049
5062
  constructor(e, t, n) {
5050
5063
  super(n), this.code = t, this.name = "ApiError", this.status = e;
@@ -5093,12 +5106,19 @@ function tl(e) {
5093
5106
  function nl(e) {
5094
5107
  let t = W(e), n = tl(t), r = {
5095
5108
  configSchema: J(t.configSchema),
5096
- definitionVersion: q(t.definitionVersion),
5109
+ definitionVersion: t.definitionVersion === 2 ? 2 : U(),
5097
5110
  description: n.description,
5098
5111
  displayName: n.displayName,
5099
5112
  key: n.key,
5100
5113
  name: n.name,
5101
- payloadSchema: J(t.payloadSchema),
5114
+ outputs: (Array.isArray(t.outputs) ? t.outputs : U()).map((e) => {
5115
+ let t = W(e);
5116
+ return Object.assign({
5117
+ handle: G(t.handle),
5118
+ jsonSchema: J(t.jsonSchema),
5119
+ nullable: typeof t.nullable == "boolean" ? t.nullable : U()
5120
+ }, t.description == null ? {} : { description: G(t.description) });
5121
+ }),
5102
5122
  provider: n.provider
5103
5123
  };
5104
5124
  if (n.type == "poll") return {
@@ -5695,7 +5715,7 @@ M({
5695
5715
  }).strict(), M({
5696
5716
  kind: L("open-flow-project-revision"),
5697
5717
  version: L(1),
5698
- modelVersion: L(1),
5718
+ modelVersion: P([L(1), L(2)]),
5699
5719
  modules: F(D(), M({
5700
5720
  name: D(),
5701
5721
  source: D(),
@@ -6378,10 +6398,20 @@ var mu = class {
6378
6398
  method: "POST"
6379
6399
  }));
6380
6400
  }
6401
+ async repairDraft(e, t, n = pu("repair")) {
6402
+ return Ql(await this.request(`/v1/flows/${Y(e)}/draft/repair`, {
6403
+ body: JSON.stringify({
6404
+ expectedRevisionId: t,
6405
+ version: 1
6406
+ }),
6407
+ headers: { "idempotency-key": n },
6408
+ method: "POST"
6409
+ }));
6410
+ }
6381
6411
  async checkFlow(e, t) {
6382
6412
  return Cl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/check`, {
6383
6413
  body: JSON.stringify({
6384
- engineContract: "open-flow-engine/v4",
6414
+ engineContract: "open-flow-engine/v5",
6385
6415
  version: 1
6386
6416
  }),
6387
6417
  method: "POST"
@@ -6399,10 +6429,10 @@ var mu = class {
6399
6429
  async createDraftRun(e, t, n) {
6400
6430
  let r = iu(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/runs`, {
6401
6431
  body: JSON.stringify({
6402
- engineContract: "open-flow-engine/v4",
6432
+ engineContract: "open-flow-engine/v5",
6403
6433
  inputs: n.inputs ?? {},
6404
6434
  trigger: n.trigger,
6405
- version: 1
6435
+ version: 2
6406
6436
  }),
6407
6437
  headers: { "idempotency-key": n.idempotencyKey ?? pu("run") },
6408
6438
  method: "POST"
@@ -6415,7 +6445,7 @@ var mu = class {
6415
6445
  inputs: t.inputs ?? {},
6416
6446
  trigger: t.trigger,
6417
6447
  publicationId: e,
6418
- version: 1
6448
+ version: 2
6419
6449
  }),
6420
6450
  headers: { "idempotency-key": t.idempotencyKey ?? pu("run") },
6421
6451
  method: "POST"
@@ -6435,7 +6465,7 @@ var mu = class {
6435
6465
  async publishFlow(e, t, n, r = {}) {
6436
6466
  return Bl(await this.request(`/v1/flows/${Y(e)}/revisions/${Y(t)}/publications`, {
6437
6467
  body: JSON.stringify({
6438
- engineContract: "open-flow-engine/v4",
6468
+ engineContract: "open-flow-engine/v5",
6439
6469
  expectedLivePublicationId: n,
6440
6470
  version: 1
6441
6471
  }),
@@ -6600,7 +6630,7 @@ var gu = [
6600
6630
  revisionId: r.revision.revisionId,
6601
6631
  trigger: {
6602
6632
  nodeId: "start",
6603
- payload: {}
6633
+ outputs: {}
6604
6634
  }
6605
6635
  }, a = [];
6606
6636
  for (let t = 0; t < 2; t++) {
@@ -6711,8 +6741,11 @@ var Cu = {
6711
6741
  cursor: Z.optional(),
6712
6742
  limit: bu
6713
6743
  }), !0),
6714
- flow_get: $("Read Flow metadata, the full Draft and current Live publication. Use draft.revisionId as the base of an edit.", N({ flowId: Q }), !0),
6715
- flow_schema: $("Get the JSON Schema for atomic change operations, optionally one operation kind. Node titles must be non-empty and unique within a graph.", N({ kind: Z.optional() }), !0),
6744
+ flow_get: $("Read Flow metadata, the full Draft and current Live publication. Unreadable Drafts return draft=null and draftIssue; flow.live still identifies the published version. Use draft.revisionId as the base of an edit.", N({ flowId: Q }), !0),
6745
+ flow_schema: $("Get an operation schema by kind, or a complete apply batch by example (connector, poll, poll-notification, code, wait). Use example=index to list examples. graph.trigger.create resolves a provider key into a fixed definition at commit.", N({
6746
+ kind: Z.optional(),
6747
+ example: Z.optional()
6748
+ }).refine((e) => e.kind == null || e.example == null, "Choose kind or example, not both."), !0),
6716
6749
  flow_create: $("Create an empty Flow. If this deployment uses OOMOL Connector, choose a teamId from connector_teams. Keep the key and arguments stable when retrying.", N({
6717
6750
  name: Z.refine((e) => e == e.trim() && Uc(e) == null, "Flow name is invalid."),
6718
6751
  idempotencyKey: yu,
@@ -6750,7 +6783,7 @@ var Cu = {
6750
6783
  publicationId: Z.optional(),
6751
6784
  trigger: N({
6752
6785
  nodeId: Z,
6753
- payload: vu
6786
+ outputs: F(D(), vu)
6754
6787
  }),
6755
6788
  inputs: F(D(), F(D(), vu)).default({}),
6756
6789
  idempotencyKey: yu
@@ -21,7 +21,10 @@ export interface PollContext {
21
21
  readonly now: Date;
22
22
  readonly signal?: AbortSignal;
23
23
  }
24
+ export declare function payloadPollOutputs(events: readonly PollEvent[]): Readonly<Record<string, JsonValue>>;
24
25
  export interface PollDefinition {
26
+ /** Constructs one Run's outputs from a nonempty batch of fresh, deduplicated events. */
27
+ readonly buildOutputs: (events: readonly PollEvent[]) => Readonly<Record<string, JsonValue>>;
25
28
  readonly configOptions?: (context: TriggerConfigOptionsContext) => Promise<readonly TriggerConfigOption[]>;
26
29
  readonly poll: (context: PollContext) => Promise<PollResult>;
27
30
  readonly snapshot: TriggerKeySnapshot & {