@oomol-lab/open-flow 0.1.0-beta.67 → 0.1.0-beta.69

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 (72) hide show
  1. package/dist/browser/ContentIcon-CsECY5id.js +11868 -0
  2. package/dist/browser/FlowCanvas-C5X22xQ7.js +22721 -0
  3. package/dist/browser/{createResourceDialog-BQVD8Rqb.js → createResourceDialog-Di5BBrQv.js} +3 -2
  4. package/dist/browser/dialog-Bjo-r9B0.js +8862 -0
  5. package/dist/browser/event-sources.d.ts +4 -2
  6. package/dist/browser/exportSvg-Cj6Spxx-.js +659 -0
  7. package/dist/browser/flow-authoring-node.d.ts +3 -1
  8. package/dist/browser/flow-authoring.js +68 -7
  9. package/dist/browser/flow-change-schema.d.ts +3 -1
  10. package/dist/browser/flow-change.d.ts +17 -2
  11. package/dist/browser/flow-change.js +82 -9
  12. package/dist/browser/{flowChanges-VB9Y4iy7.js → flowChanges-Dp-rcEJ6.js} +4312 -16566
  13. package/dist/browser/{flowRunInputEditorStore-DJqmR6Qh.js → flowRunInputEditorStore-ys1-w9GW.js} +2 -1
  14. package/dist/browser/{flowWorkspace-C1hlTnZq.js → flowWorkspace-CB1QACku.js} +1304 -23538
  15. package/dist/browser/languages-gYzoQqCi.js +68 -0
  16. package/dist/browser/licenses.md +24 -0
  17. package/dist/browser/preview.css +53 -41
  18. package/dist/browser/preview.js +3974 -4094
  19. package/dist/browser/{dialog-CS2Vt2if.js → tooltip-CJjYs_2I.js} +710 -9472
  20. package/dist/browser/{typeScriptSession-D0bjYDeg.js → typeScriptSession-B0hC-C8y.js} +1 -1
  21. package/dist/browser/ui.css +12 -0
  22. package/dist/browser/{value-BADHeZ9I.js → value-BbFQZZ_V.js} +1 -68
  23. package/dist/browser/workbench.css +2840 -2824
  24. package/dist/browser/workbench.js +437 -337
  25. package/dist/browser/{workbenchSelect-CpXhjUou.js → workbenchSelect-C3hxUcYm.js} +2 -1
  26. package/dist/command/index.js +55 -51
  27. package/dist/common/authoring.d.ts +20 -0
  28. package/dist/common/authoringSchema.d.ts +243 -0
  29. package/dist/common/connector-proxy.d.ts +4 -0
  30. package/dist/common/control-api-conformance.js +173 -36
  31. package/dist/common/control-api.d.ts +22 -8
  32. package/dist/common/control-api.js +156 -18
  33. package/dist/common/control-requests.d.ts +32 -19
  34. package/dist/common/control-requests.js +2854 -152
  35. package/dist/common/decision.js +27 -3
  36. package/dist/common/engine-contract.d.ts +2 -2
  37. package/dist/common/event-source-definition.d.ts +34 -16
  38. package/dist/common/event-source.d.ts +63 -5
  39. package/dist/common/event-source.js +5744 -261
  40. package/dist/common/event-sources.d.ts +99 -6
  41. package/dist/common/flow-encoding.js +49 -10
  42. package/dist/common/flow-errorHandling.d.ts +36 -0
  43. package/dist/common/flow-graph.d.ts +4 -2
  44. package/dist/common/flow-retry.d.ts +19 -0
  45. package/dist/common/flow-semantics.js +94 -10
  46. package/dist/common/{fr-Du5gv3kM.js → fr-CNTSedYU.js} +259 -18
  47. package/dist/common/integration-trigger.d.ts +1 -1
  48. package/dist/common/integration-trigger.js +27 -3
  49. package/dist/common/{ja-D2wyPdTF.js → ja-CxQBHr2J.js} +259 -18
  50. package/dist/common/{ko-Cuu2AOaC.js → ko-D1Exiv1h.js} +259 -18
  51. package/dist/common/mcp.d.ts +30 -0
  52. package/dist/common/mcp.js +158 -20
  53. package/dist/common/openapi.js +27 -3
  54. package/dist/common/poll-trigger.js +27 -3
  55. package/dist/common/provider-triggers.d.ts +0 -2
  56. package/dist/common/provider-triggers.js +358 -155
  57. package/dist/common/{ru-BjI_JSsx.js → ru-BzLZv0B7.js} +259 -18
  58. package/dist/common/run-events.d.ts +2 -0
  59. package/dist/common/run-events.js +4 -2
  60. package/dist/common/runtime-contract.d.ts +1 -0
  61. package/dist/common/runtime-contract.js +4 -4
  62. package/dist/common/scheduler.d.ts +13 -2
  63. package/dist/common/scheduler.js +288 -98
  64. package/dist/common/webhook-trigger.js +27 -3
  65. package/dist/common/workflow.js +27 -3
  66. package/dist/common/{zh-CN-CnnXkzLh.js → zh-CN-Dg_xSGde.js} +259 -18
  67. package/dist/common/{zh-TW-CJnR2dgF.js → zh-TW-oxuLwsV0.js} +259 -18
  68. package/dist/index.d.ts +1 -0
  69. package/package.json +1 -1
  70. package/dist/common/event-source-feishu.d.ts +0 -3
  71. package/dist/common/feishu-events.d.ts +0 -19
  72. package/dist/common/feishu-subscriptions.d.ts +0 -6
@@ -6008,6 +6008,18 @@ function checkJsonDepth(value, depth = 0) {
6008
6008
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
6009
6009
  }
6010
6010
  //#endregion
6011
+ //#region src/flow/common/retry.ts
6012
+ var nodeRetryLimits = {
6013
+ maxRetries: 5,
6014
+ minIntervalMs: 1e3,
6015
+ maxIntervalMs: 6e4,
6016
+ intervalStepMs: 1e3
6017
+ };
6018
+ var retryConfigurationSchema = strictObject({
6019
+ maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
6020
+ intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
6021
+ });
6022
+ //#endregion
6011
6023
  //#region src/flow/common/triggerScheduleSchema.ts
6012
6024
  var triggerScheduleSchema = array(union([object({
6013
6025
  type: literal("cron"),
@@ -6056,6 +6068,7 @@ var source = union([object({
6056
6068
  kind: literal("node"),
6057
6069
  nodeId: text,
6058
6070
  output: text,
6071
+ system: literal(true).optional(),
6059
6072
  field: text.optional()
6060
6073
  }), object({
6061
6074
  kind: literal("binding"),
@@ -6314,7 +6327,9 @@ var base = {
6314
6327
  name: text.optional(),
6315
6328
  description: text.optional(),
6316
6329
  icon: text.optional(),
6317
- timeoutMs: number().optional()
6330
+ timeoutMs: number().optional(),
6331
+ retry: retryConfigurationSchema.optional(),
6332
+ onError: _enum(["stop", "error"]).optional()
6318
6333
  };
6319
6334
  var node = union([
6320
6335
  strictObject({
@@ -6450,7 +6465,8 @@ var revision = object({
6450
6465
  literal(5),
6451
6466
  literal(6),
6452
6467
  literal(7),
6453
- literal(8)
6468
+ literal(8),
6469
+ literal(9)
6454
6470
  ]),
6455
6471
  document,
6456
6472
  modules: record$2(text, module)
@@ -6519,6 +6535,13 @@ var shapes = {
6519
6535
  },
6520
6536
  "graph.node.delete": at,
6521
6537
  "graph.node.field.set": union([
6538
+ object({
6539
+ ...at,
6540
+ kind: literal("graph.node.field.set"),
6541
+ field: literal("retry"),
6542
+ before: retryConfigurationSchema.optional(),
6543
+ value: retryConfigurationSchema.optional()
6544
+ }),
6522
6545
  object({
6523
6546
  ...at,
6524
6547
  kind: literal("graph.node.field.set"),
@@ -6532,7 +6555,8 @@ var shapes = {
6532
6555
  field: _enum([
6533
6556
  "description",
6534
6557
  "icon",
6535
- "name"
6558
+ "name",
6559
+ "onError"
6536
6560
  ]),
6537
6561
  before: text.optional(),
6538
6562
  value: text.optional()
@@ -6637,6 +6661,12 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
6637
6661
  ...shape
6638
6662
  })])).values()])).min(1);
6639
6663
  function checkModelVersion(content) {
6664
+ if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => "retry" in candidateNode && candidateNode.retry != null)) throw new TypeError("Node retries require Flow model version 9.");
6665
+ if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => {
6666
+ if (candidateNode.onError != null) return true;
6667
+ if ([...Object.values("inputs" in candidateNode ? candidateNode.inputs : {}), ...Object.values(candidateNode.kind == "outputs" ? candidateNode.outputMappings : {})].some((candidateMapping) => candidateMapping.kind == "sources" && candidateMapping.sources.some((candidateSource) => candidateSource.kind == "node" && candidateSource.system))) return true;
6668
+ return candidateNode.kind == "condition" && candidateNode.cases.some((item) => item.groups.some((candidateGroup) => candidateGroup.expressions.some((expression) => [expression.left, expression.right].some((candidateOperand) => candidateOperand?.kind == "source" && candidateOperand.source.kind == "node" && candidateOperand.source.system))));
6669
+ })) throw new TypeError("Node error handling requires Flow model version 9.");
6640
6670
  if (content.modelVersion < 8 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "outputs")) throw new TypeError("Workflow outputs require Flow model version 8.");
6641
6671
  if (content.modelVersion < 7 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "start")) throw new TypeError("Start Triggers require Flow model version 7.");
6642
6672
  if (content.modelVersion < 6 && Object.values(content.document.graph.nodes).some((candidateNode) => candidateNode.kind == "task" && "executor" in candidateNode.task)) throw new TypeError("Node-owned managed Tasks require Flow model version 6.");
@@ -9494,12 +9524,19 @@ var output = strictObject({
9494
9524
  port: id$2.optional().describe("Omit for a node with one output. For multiple outputs, choose a name from node details."),
9495
9525
  field: string$1().optional()
9496
9526
  });
9527
+ var system = strictObject({
9528
+ kind: literal("system"),
9529
+ node: referenceSchema,
9530
+ port: literal("error"),
9531
+ field: string$1().optional()
9532
+ });
9497
9533
  var variable$1 = strictObject({
9498
9534
  kind: literal("variable"),
9499
9535
  name: id$2
9500
9536
  });
9501
9537
  var authoringSourceSchema = union([
9502
9538
  output,
9539
+ system,
9503
9540
  variable$1,
9504
9541
  strictObject({
9505
9542
  kind: literal("value"),
@@ -9509,7 +9546,11 @@ var authoringSourceSchema = union([
9509
9546
  strictObject({ kind: literal("default") }),
9510
9547
  strictObject({
9511
9548
  kind: literal("sources"),
9512
- sources: array(union([output, variable$1])).min(1)
9549
+ sources: array(union([
9550
+ output,
9551
+ system,
9552
+ variable$1
9553
+ ])).min(1)
9513
9554
  })
9514
9555
  ]);
9515
9556
  var operand = union([
@@ -9519,6 +9560,7 @@ var operand = union([
9519
9560
  schema: json$2.optional()
9520
9561
  }),
9521
9562
  output,
9563
+ system,
9522
9564
  variable$1
9523
9565
  ]);
9524
9566
  var agentTool = authoringDefinitionSchemas.agent.shape.tools.element.omit({
@@ -9610,11 +9652,13 @@ var authoringConfigurations = {
9610
9652
  approval: strictObject({ inputs: inputFields })
9611
9653
  };
9612
9654
  var updates = strictObject({
9655
+ onError: _enum(["stop", "error"]).optional(),
9613
9656
  name: id$2.optional(),
9614
9657
  description: string$1().optional(),
9615
9658
  icon: string$1().optional(),
9616
9659
  maxExecutions: int().positive().optional(),
9617
9660
  timeoutMs: number().nonnegative().optional(),
9661
+ retry: retryConfigurationSchema.partial().optional().describe("Node retry policy for Code, Connector, OpenAPI, LLM and AI Decision. Omitted update fields preserve the policy; use clear: [[\"retry\"]] to disable it. maxRetries counts additional attempts; intervalMs is 1000–60000 in whole seconds."),
9618
9662
  config: patch.optional().describe("Recursively merge configuration; omitted fields remain unchanged and arrays replace as a whole. This includes schema objects: {} does not clear an existing schema. Use clear paths to remove fields, e.g. [\"config\",\"inputs\",\"amount\",\"schema\",\"type\"].")
9619
9663
  });
9620
9664
  var authoringEditSchema = discriminatedUnion("op", [
@@ -9623,6 +9667,8 @@ var authoringEditSchema = discriminatedUnion("op", [
9623
9667
  as: id$2.regex(/^[A-Za-z][\w-]*$/).describe("Unique batch-local alias without the $ prefix. Later edits must reference this new node as $alias; the bare alias is not its node ID."),
9624
9668
  type,
9625
9669
  name: id$2,
9670
+ onError: _enum(["stop", "error"]).optional(),
9671
+ retry: retryConfigurationSchema.optional(),
9626
9672
  config: patch.optional(),
9627
9673
  inputs: record$2(id$2, authoringSourceSchema).optional().describe("Input data sources, applied after creation, as input.set operations. Execution edges are separate."),
9628
9674
  code: string$1().optional(),
@@ -9767,6 +9813,35 @@ var resultQuerySchema = strictObject({
9767
9813
  maxBytes: number().int().min(1).max(1048576).default(15e3)
9768
9814
  });
9769
9815
  //#endregion
9816
+ //#region src/execution/common/engineContract.ts
9817
+ var currentEngineContract = "open-flow-engine/v6";
9818
+ `${JSON.stringify(currentEngineContract)}`, new Set([
9819
+ "assert",
9820
+ "assert/strict",
9821
+ "buffer",
9822
+ "console",
9823
+ "constants",
9824
+ "crypto",
9825
+ "events",
9826
+ "fs",
9827
+ "fs/promises",
9828
+ "os",
9829
+ "path",
9830
+ "path/posix",
9831
+ "process",
9832
+ "punycode",
9833
+ "querystring",
9834
+ "stream",
9835
+ "stream/promises",
9836
+ "stream/web",
9837
+ "string_decoder",
9838
+ "timers",
9839
+ "timers/promises",
9840
+ "url",
9841
+ "util",
9842
+ "zlib"
9843
+ ].flatMap((name) => [name, `node:${name}`])), `${JSON.stringify("open-flow-engine/v6/nodejs-compat-v1")}`;
9844
+ //#endregion
9770
9845
  //#region src/workflow/common/workflow.ts
9771
9846
  var portSchema = object({
9772
9847
  handle: string$1().min(1),
@@ -10764,22 +10839,44 @@ function connectorProvider(value) {
10764
10839
  //#endregion
10765
10840
  //#region src/control/common/eventSources.ts
10766
10841
  var id$1 = string$1().min(1).max(256);
10767
- var eventType = string$1().regex(/^[a-z][a-z0-9_.]{0,127}$/);
10842
+ var eventType = string$1().regex(/^[a-z][a-z0-9_.:]{0,127}$/);
10768
10843
  var name = string$1().trim().min(1).max(128);
10769
10844
  var eventSourceSchema = object({
10770
10845
  version: literal(1),
10771
10846
  sourceId: id$1,
10772
10847
  revision: int().positive(),
10773
10848
  name,
10774
- provider: _enum(["feishu", "feishu_app_bot"]),
10775
- appId: id$1,
10849
+ provider: _enum([
10850
+ "feishu",
10851
+ "feishu_app_bot",
10852
+ "slackbot",
10853
+ "intercom",
10854
+ "sentry",
10855
+ "zoom",
10856
+ "fireflies",
10857
+ "jira"
10858
+ ]),
10859
+ appId: id$1.nullable(),
10860
+ workspaceId: id$1.optional(),
10861
+ installationId: id$1.optional(),
10862
+ organizationId: id$1.optional(),
10863
+ projectId: id$1.optional(),
10864
+ projectKey: id$1.optional(),
10865
+ subscriptionStatus: _enum([
10866
+ "idle",
10867
+ "pending",
10868
+ "ready",
10869
+ "error"
10870
+ ]).optional(),
10871
+ lastError: string$1().optional(),
10872
+ signingSecretConfigured: boolean().optional(),
10776
10873
  connectionId: id$1,
10777
10874
  teamId: id$1.nullable(),
10778
10875
  enabled: boolean(),
10779
10876
  eventTypes: array(eventType),
10780
- manageSubscriptions: boolean(),
10781
- verificationTokenConfigured: boolean(),
10782
- encryptKeyConfigured: boolean(),
10877
+ manageSubscriptions: boolean().nullable(),
10878
+ verificationTokenConfigured: boolean().nullable(),
10879
+ encryptKeyConfigured: boolean().nullable(),
10783
10880
  endpointUrl: string$1().nullable(),
10784
10881
  verifiedAt: string$1().nullable(),
10785
10882
  lastReceivedAt: string$1().nullable(),
@@ -10790,6 +10887,21 @@ var eventSourceSchema = object({
10790
10887
  triggerNodeId: id$1
10791
10888
  }))
10792
10889
  });
10890
+ eventSourceSchema.pick({
10891
+ appId: true,
10892
+ workspaceId: true,
10893
+ installationId: true,
10894
+ organizationId: true,
10895
+ projectId: true,
10896
+ projectKey: true,
10897
+ subscriptionStatus: true,
10898
+ lastError: true,
10899
+ signingSecretConfigured: true,
10900
+ manageSubscriptions: true,
10901
+ verificationTokenConfigured: true,
10902
+ encryptKeyConfigured: true,
10903
+ verifiedAt: true
10904
+ });
10793
10905
  function decodeEventSource(value) {
10794
10906
  return eventSourceSchema.parse(value);
10795
10907
  }
@@ -11302,6 +11414,21 @@ function workflowIdentity(value) {
11302
11414
  executionId: string(ref.executionId)
11303
11415
  };
11304
11416
  }
11417
+ function runInitiator(value) {
11418
+ const source = record(value);
11419
+ if (![
11420
+ "workbench",
11421
+ "cli",
11422
+ "mcp",
11423
+ "api",
11424
+ "trigger",
11425
+ "workflow"
11426
+ ].includes(source.channel)) return invalidResponse();
11427
+ return {
11428
+ channel: source.channel,
11429
+ ...source.actorId === void 0 ? {} : { actorId: string(source.actorId) }
11430
+ };
11431
+ }
11305
11432
  function runDetails(value) {
11306
11433
  const source = record(value);
11307
11434
  const summary = run$1(source);
@@ -11323,6 +11450,7 @@ function runDetails(value) {
11323
11450
  if (source.calls !== void 0 && !Array.isArray(source.calls)) return invalidResponse();
11324
11451
  const details = {
11325
11452
  ...summary,
11453
+ ...source.initiator === void 0 ? {} : { initiator: runInitiator(source.initiator) },
11326
11454
  ...errorHandling(source),
11327
11455
  ...source.triggerNodeId === void 0 ? {} : { triggerNodeId: string(source.triggerNodeId) },
11328
11456
  ...source.caller === void 0 ? {} : { caller: workflowIdentity(source.caller) },
@@ -11611,6 +11739,7 @@ function decodeRunEvent(value) {
11611
11739
  kind,
11612
11740
  payload: {
11613
11741
  ...node,
11742
+ ...payload.systemOutputs === void 0 ? {} : { systemOutputs: Object.fromEntries(Object.entries(record(payload.systemOutputs)).map(([key, item]) => [key, jsonValue(item)])) },
11614
11743
  outputs: Object.fromEntries(Object.entries(record(payload.outputs)).map(([key, item]) => [key, jsonValue(item)]))
11615
11744
  }
11616
11745
  };
@@ -11621,6 +11750,8 @@ function decodeRunEvent(value) {
11621
11750
  kind,
11622
11751
  payload: {
11623
11752
  ...node,
11753
+ ...payload.handled === true ? { handled: true } : {},
11754
+ ...payload.systemOutputs === void 0 ? {} : { systemOutputs: Object.fromEntries(Object.entries(record(payload.systemOutputs)).map(([key, item]) => [key, jsonValue(item)])) },
11624
11755
  error: {
11625
11756
  code: string(error.code),
11626
11757
  message: string(error.message)
@@ -11700,7 +11831,8 @@ function operationKey(operation) {
11700
11831
  return `${operation}-${randomId()}`;
11701
11832
  }
11702
11833
  var ControlClient = class {
11703
- constructor(requestControl) {
11834
+ constructor(requestControl, channel = "api") {
11835
+ this.channel = channel;
11704
11836
  this.requestControl = requestControl;
11705
11837
  }
11706
11838
  async loadOpenApiDocument(url, signal) {
@@ -11726,8 +11858,8 @@ var ControlClient = class {
11726
11858
  async listEventSources(flowId, signal) {
11727
11859
  return decodeEventSources(await this.request("/v1/event-sources" + (flowId == null ? "" : `?flowId=${segment(flowId)}`), { signal }));
11728
11860
  }
11729
- async listEventSourceConnections(teamId, signal) {
11730
- const source = record(await this.request(`/v1/event-sources/connections${teamId == null ? "" : `?teamId=${segment(teamId)}`}`, { signal }));
11861
+ async listEventSourceConnections(teamId, signal, kind = "feishu") {
11862
+ const source = record(await this.request(`/v1/event-sources/connections?kind=${kind}${teamId == null ? "" : `&teamId=${segment(teamId)}`}`, { signal }));
11731
11863
  requiredFields(source, ["version", "connections"]);
11732
11864
  if (source.version != 1 || !Array.isArray(source.connections)) return invalidResponse();
11733
11865
  return source.connections.map(connection);
@@ -12190,7 +12322,7 @@ var ControlClient = class {
12190
12322
  async checkFlow(flowId, revisionId) {
12191
12323
  return flowCheck(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/check`, {
12192
12324
  body: JSON.stringify({
12193
- engineContract: "open-flow-engine/v5",
12325
+ engineContract: currentEngineContract,
12194
12326
  version: 1
12195
12327
  }),
12196
12328
  method: "POST"
@@ -12215,12 +12347,15 @@ var ControlClient = class {
12215
12347
  async createDraftRun(flowId, revisionId, options) {
12216
12348
  const created = runDetails(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/runs`, {
12217
12349
  body: JSON.stringify({
12218
- engineContract: "open-flow-engine/v5",
12350
+ engineContract: currentEngineContract,
12219
12351
  inputs: options.inputs ?? {},
12220
12352
  trigger: options.trigger,
12221
12353
  version: 2
12222
12354
  }),
12223
- headers: { "idempotency-key": options.idempotencyKey ?? operationKey("run") },
12355
+ headers: {
12356
+ "idempotency-key": options.idempotencyKey ?? operationKey("run"),
12357
+ "x-open-flow-client": this.channel
12358
+ },
12224
12359
  method: "POST"
12225
12360
  }));
12226
12361
  return created.source == "draft" ? created : invalidResponse();
@@ -12233,7 +12368,10 @@ var ControlClient = class {
12233
12368
  publicationId,
12234
12369
  version: 2
12235
12370
  }),
12236
- headers: { "idempotency-key": options.idempotencyKey ?? operationKey("run") },
12371
+ headers: {
12372
+ "idempotency-key": options.idempotencyKey ?? operationKey("run"),
12373
+ "x-open-flow-client": this.channel
12374
+ },
12237
12375
  method: "POST"
12238
12376
  }));
12239
12377
  return created.source == "live" ? created : invalidResponse();
@@ -12251,7 +12389,7 @@ var ControlClient = class {
12251
12389
  async publishFlow(flowId, revisionId, expectedLivePublicationId, options = {}) {
12252
12390
  return publishOperation(await this.request(`/v1/flows/${segment(flowId)}/revisions/${segment(revisionId)}/publications`, {
12253
12391
  body: JSON.stringify({
12254
- engineContract: "open-flow-engine/v5",
12392
+ engineContract: currentEngineContract,
12255
12393
  expectedLivePublicationId,
12256
12394
  version: 1
12257
12395
  }),
@@ -12575,7 +12713,7 @@ var mutationKey = id.max(256).describe("Stable identity for this mutation. Retry
12575
12713
  var pageLimit = int().min(1).max(100).default(50);
12576
12714
  var flow = id.describe("Exact Flow ID returned by flow_list or flow_create.");
12577
12715
  var run = id.describe("Exact Run ID returned by flow_run or run_list.");
12578
- var mcpInstructions = "Keep generated Flow and node names short enough to scan on the canvas. Aim for 2–4 English words or 4–8 Chinese characters, using the user's language unless the workflow has an established naming language. Name a Flow by its main purpose and a node by its action and object, such as \"AI Trend Digest\", \"Fetch trends\", \"Verify sources\", or \"发布文章\". Keep only qualifiers needed to distinguish similar nodes. Put detailed behavior in descriptions; avoid sentences, repeated workflow context, and obscure abbreviations. Preserve names explicitly supplied by the user, and do not rename unrelated existing nodes. Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Before adding a Feishu Trigger, use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_live to inspect current online entries after publication. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_edit with identical arguments and the same requestId. Retry flow_create, flow_import, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Canvas commands are transient broadcasts without execution confirmation; never automatically retry flow_canvas because pan is relative. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
12716
+ var mcpInstructions = "Keep generated Flow and node names short enough to scan on the canvas. Aim for 2–4 English words or 4–8 Chinese characters, using the user's language unless the workflow has an established naming language. Name a Flow by its main purpose and a node by its action and object, such as \"AI Trend Digest\", \"Fetch trends\", \"Verify sources\", or \"发布文章\". Keep only qualifiers needed to distinguish similar nodes. Put detailed behavior in descriptions; avoid sentences, repeated workflow context, and obscure abbreviations. Preserve names explicitly supplied by the user, and do not rename unrelated existing nodes. Use flow_list, flow_read and flow_search to inspect root workflows. Read node type schemas with flow_schema. Use flow_edit with the observed baseRevision and a stable requestId. Node edits affect only the selected node. Text edits require exactly one match. Execution edges and input sources are independent. Legacy Subflow content is unsupported. Edits can save incomplete drafts; inspect returned diagnostics and use flow_check before running. Use flow_check before flow_run. Select an explicit Trigger node ID and fixed revision or publication. A new Flow has no Trigger until you add one. Before adding a shared-source Trigger (Feishu, Slack Bot, Intercom, Sentry, Zoom, Fireflies, or Jira), use event_source_list and compare its Connection IDs with connector_connections in the Flow scope. If no source is available, create and verify one in Workbench. Use flow_publish to publish a fixed Revision, then poll flow_publish_status until succeeded or failed. Use flow_live to inspect current online entries after publication. Use flow_set_enabled to enable or disable the observed Live publication. flow_run returns an accepted Run, not its final result. Find Runs with run_list, poll run_get and use run_result after terminal. Resolve a waiting Run only with an explicit run_resolve_wait action allowed by run_get. Use run_results and run_result_read to inspect stored Agent tool results; these are separate from the terminal Run result. Retry flow_edit with identical arguments and the same requestId. Retry flow_create, flow_import, flow_publish and flow_run only with identical arguments and the same idempotencyKey; a new key can execute the Flow again. Canvas commands are transient broadcasts without execution confirmation; never automatically retry flow_canvas because pan is relative. Other mutations use the same resource identity and arguments when retrying. Cancel a Run explicitly with run_cancel. Use nextCursor and nextAfter to read subsequent pages. Connector-backed deployments may require a Team; inspect connector_teams before creating a Flow.";
12579
12717
  function tool(description, schema, readOnly, idempotent = true) {
12580
12718
  return {
12581
12719
  description,
@@ -12736,7 +12874,7 @@ var mcpTools = {
12736
12874
  serviceId: id.max(256),
12737
12875
  flowId: flow.optional()
12738
12876
  }), true),
12739
- event_source_list: tool("List independent Feishu event sources, including Team, Connection, event types, enabled and verification status. Inspect consumers for Flows actually using each source.", strictObject({}), true),
12877
+ event_source_list: tool("List shared event sources for Feishu, Slack Bot, Intercom, Sentry, Zoom, Fireflies, and Jira, including Team, Connection, event types, enabled and verification status. Inspect consumers for Flows actually using each source.", strictObject({}), true),
12740
12878
  trigger_search: tool("Search provider Trigger summaries; omit query to list all. Flow trigger instances are in flow_read. Start, Webhook and Cron are built-in node kinds described by flow_schema.", strictObject({ query: string$1().trim().min(1).max(256).optional() }), true),
12741
12879
  trigger_get: tool("Read a provider Trigger definition before creating its node.", strictObject({ key: id }), true)
12742
12880
  };
@@ -6661,6 +6661,18 @@ function answerSchema(question) {
6661
6661
  };
6662
6662
  }
6663
6663
  //#endregion
6664
+ //#region src/flow/common/retry.ts
6665
+ var nodeRetryLimits = {
6666
+ maxRetries: 5,
6667
+ minIntervalMs: 1e3,
6668
+ maxIntervalMs: 6e4,
6669
+ intervalStepMs: 1e3
6670
+ };
6671
+ var retryConfigurationSchema = strictObject({
6672
+ maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
6673
+ intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
6674
+ });
6675
+ //#endregion
6664
6676
  //#region src/flow/common/triggerScheduleSchema.ts
6665
6677
  var triggerScheduleSchema = array(union([object$1({
6666
6678
  type: literal("cron"),
@@ -6706,6 +6718,7 @@ var source = union([object$1({
6706
6718
  kind: literal("node"),
6707
6719
  nodeId: text,
6708
6720
  output: text,
6721
+ system: literal(true).optional(),
6709
6722
  field: text.optional()
6710
6723
  }), object$1({
6711
6724
  kind: literal("binding"),
@@ -6964,7 +6977,9 @@ var base = {
6964
6977
  name: text.optional(),
6965
6978
  description: text.optional(),
6966
6979
  icon: text.optional(),
6967
- timeoutMs: number().optional()
6980
+ timeoutMs: number().optional(),
6981
+ retry: retryConfigurationSchema.optional(),
6982
+ onError: _enum(["stop", "error"]).optional()
6968
6983
  };
6969
6984
  var node = union([
6970
6985
  strictObject({
@@ -7085,7 +7100,8 @@ object$1({
7085
7100
  literal(5),
7086
7101
  literal(6),
7087
7102
  literal(7),
7088
- literal(8)
7103
+ literal(8),
7104
+ literal(9)
7089
7105
  ]),
7090
7106
  document,
7091
7107
  modules: record$1(text, module)
@@ -7146,6 +7162,13 @@ var shapes = {
7146
7162
  },
7147
7163
  "graph.node.delete": at,
7148
7164
  "graph.node.field.set": union([
7165
+ object$1({
7166
+ ...at,
7167
+ kind: literal("graph.node.field.set"),
7168
+ field: literal("retry"),
7169
+ before: retryConfigurationSchema.optional(),
7170
+ value: retryConfigurationSchema.optional()
7171
+ }),
7149
7172
  object$1({
7150
7173
  ...at,
7151
7174
  kind: literal("graph.node.field.set"),
@@ -7159,7 +7182,8 @@ var shapes = {
7159
7182
  field: _enum([
7160
7183
  "description",
7161
7184
  "icon",
7162
- "name"
7185
+ "name",
7186
+ "onError"
7163
7187
  ]),
7164
7188
  before: text.optional(),
7165
7189
  value: text.optional()
@@ -6668,6 +6668,18 @@ function answerSchema(question) {
6668
6668
  };
6669
6669
  }
6670
6670
  //#endregion
6671
+ //#region src/flow/common/retry.ts
6672
+ var nodeRetryLimits = {
6673
+ maxRetries: 5,
6674
+ minIntervalMs: 1e3,
6675
+ maxIntervalMs: 6e4,
6676
+ intervalStepMs: 1e3
6677
+ };
6678
+ var retryConfigurationSchema = strictObject({
6679
+ maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
6680
+ intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
6681
+ });
6682
+ //#endregion
6671
6683
  //#region src/flow/common/triggerScheduleSchema.ts
6672
6684
  var triggerScheduleSchema = array(union([object({
6673
6685
  type: literal("cron"),
@@ -6713,6 +6725,7 @@ var source = union([object({
6713
6725
  kind: literal("node"),
6714
6726
  nodeId: text,
6715
6727
  output: text,
6728
+ system: literal(true).optional(),
6716
6729
  field: text.optional()
6717
6730
  }), object({
6718
6731
  kind: literal("binding"),
@@ -6971,7 +6984,9 @@ var base = {
6971
6984
  name: text.optional(),
6972
6985
  description: text.optional(),
6973
6986
  icon: text.optional(),
6974
- timeoutMs: number().optional()
6987
+ timeoutMs: number().optional(),
6988
+ retry: retryConfigurationSchema.optional(),
6989
+ onError: _enum(["stop", "error"]).optional()
6975
6990
  };
6976
6991
  var node = union([
6977
6992
  strictObject({
@@ -7092,7 +7107,8 @@ object({
7092
7107
  literal(5),
7093
7108
  literal(6),
7094
7109
  literal(7),
7095
- literal(8)
7110
+ literal(8),
7111
+ literal(9)
7096
7112
  ]),
7097
7113
  document,
7098
7114
  modules: record$1(text, module)
@@ -7153,6 +7169,13 @@ var shapes = {
7153
7169
  },
7154
7170
  "graph.node.delete": at,
7155
7171
  "graph.node.field.set": union([
7172
+ object({
7173
+ ...at,
7174
+ kind: literal("graph.node.field.set"),
7175
+ field: literal("retry"),
7176
+ before: retryConfigurationSchema.optional(),
7177
+ value: retryConfigurationSchema.optional()
7178
+ }),
7156
7179
  object({
7157
7180
  ...at,
7158
7181
  kind: literal("graph.node.field.set"),
@@ -7166,7 +7189,8 @@ var shapes = {
7166
7189
  field: _enum([
7167
7190
  "description",
7168
7191
  "icon",
7169
- "name"
7192
+ "name",
7193
+ "onError"
7170
7194
  ]),
7171
7195
  before: text.optional(),
7172
7196
  value: text.optional()
@@ -1,5 +1,3 @@
1
- export { feishuSubscriptions } from './feishu-subscriptions.js';
2
- export { receiveFeishuEvent, matchesFeishuEvent, type FeishuEvent } from './feishu-events.js';
3
1
  import type { IntegrationDefinition } from './integration-trigger.js';
4
2
  import type { PollDefinition } from './poll-trigger.js';
5
3
  export type ProviderTriggerDefinition = IntegrationDefinition | PollDefinition;