@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
@@ -1,4 +1,26 @@
1
- export interface CreateEventSource {
1
+ import { z } from 'zod';
2
+ export declare const eventSourceViewSchema: z.ZodObject<{
3
+ appId: z.ZodNullable<z.ZodString>;
4
+ workspaceId: z.ZodOptional<z.ZodString>;
5
+ installationId: z.ZodOptional<z.ZodString>;
6
+ organizationId: z.ZodOptional<z.ZodString>;
7
+ projectId: z.ZodOptional<z.ZodString>;
8
+ projectKey: z.ZodOptional<z.ZodString>;
9
+ subscriptionStatus: z.ZodOptional<z.ZodEnum<{
10
+ error: "error";
11
+ idle: "idle";
12
+ pending: "pending";
13
+ ready: "ready";
14
+ }>>;
15
+ lastError: z.ZodOptional<z.ZodString>;
16
+ signingSecretConfigured: z.ZodOptional<z.ZodBoolean>;
17
+ manageSubscriptions: z.ZodNullable<z.ZodBoolean>;
18
+ verificationTokenConfigured: z.ZodNullable<z.ZodBoolean>;
19
+ encryptKeyConfigured: z.ZodNullable<z.ZodBoolean>;
20
+ verifiedAt: z.ZodNullable<z.ZodString>;
21
+ }, z.core.$strip>;
22
+ export interface CreateFeishuEventSource {
23
+ readonly kind?: 'feishu';
2
24
  readonly version: 1;
3
25
  readonly name: string;
4
26
  readonly connectionId: string;
@@ -8,7 +30,70 @@ export interface CreateEventSource {
8
30
  readonly eventTypes: string[];
9
31
  readonly manageSubscriptions: boolean;
10
32
  }
33
+ export interface CreateSlackEventSource {
34
+ readonly kind: 'slack';
35
+ readonly version: 1;
36
+ readonly name: string;
37
+ readonly connectionId: string;
38
+ readonly teamId: string | null;
39
+ readonly appId: string;
40
+ readonly workspaceId: string;
41
+ readonly signingSecret: string;
42
+ readonly eventTypes: string[];
43
+ }
44
+ export interface CreateIntercomEventSource {
45
+ readonly kind: 'intercom';
46
+ readonly version: 1;
47
+ readonly name: string;
48
+ readonly connectionId: string;
49
+ readonly teamId: string | null;
50
+ readonly appId: string;
51
+ readonly signingSecret: string;
52
+ readonly eventTypes: string[];
53
+ }
54
+ export interface CreateSentryEventSource {
55
+ readonly kind: 'sentry';
56
+ readonly version: 1;
57
+ readonly name: string;
58
+ readonly connectionId: string;
59
+ readonly teamId: string | null;
60
+ readonly appId: string;
61
+ readonly installationId: string;
62
+ readonly organizationId: string;
63
+ readonly signingSecret: string;
64
+ readonly eventTypes: string[];
65
+ }
66
+ export interface CreateZoomEventSource {
67
+ readonly kind: 'zoom';
68
+ readonly version: 1;
69
+ readonly name: string;
70
+ readonly connectionId: string;
71
+ readonly teamId: string | null;
72
+ readonly appId: string;
73
+ readonly signingSecret: string;
74
+ readonly eventTypes: string[];
75
+ }
76
+ export interface CreateFirefliesEventSource {
77
+ readonly kind: 'fireflies';
78
+ readonly version: 1;
79
+ readonly name: string;
80
+ readonly connectionId: string;
81
+ readonly teamId: string | null;
82
+ readonly signingSecret: string;
83
+ readonly eventTypes: string[];
84
+ }
85
+ export interface CreateJiraEventSource {
86
+ readonly kind: 'jira';
87
+ readonly version: 1;
88
+ readonly name: string;
89
+ readonly connectionId: string;
90
+ readonly teamId: string | null;
91
+ readonly project: string;
92
+ readonly eventTypes: string[];
93
+ }
94
+ export type CreateEventSource = CreateFeishuEventSource | CreateSlackEventSource | CreateIntercomEventSource | CreateSentryEventSource | CreateZoomEventSource | CreateFirefliesEventSource | CreateJiraEventSource;
11
95
  export interface UpdateEventSource {
96
+ readonly signingSecret?: string;
12
97
  readonly version: 1;
13
98
  readonly expectedRevision: number;
14
99
  readonly name: string;
@@ -22,15 +107,23 @@ export interface EventSource {
22
107
  readonly sourceId: string;
23
108
  readonly revision: number;
24
109
  readonly name: string;
25
- readonly provider: 'feishu' | 'feishu_app_bot';
26
- readonly appId: string;
110
+ readonly provider: 'feishu' | 'feishu_app_bot' | 'slackbot' | 'intercom' | 'sentry' | 'zoom' | 'fireflies' | 'jira';
111
+ readonly appId: string | null;
112
+ readonly workspaceId?: string;
113
+ readonly installationId?: string;
114
+ readonly organizationId?: string;
115
+ readonly projectId?: string;
116
+ readonly projectKey?: string;
117
+ readonly subscriptionStatus?: 'idle' | 'pending' | 'ready' | 'error';
118
+ readonly lastError?: string;
119
+ readonly signingSecretConfigured?: boolean;
27
120
  readonly connectionId: string;
28
121
  readonly teamId: string | null;
29
122
  readonly enabled: boolean;
30
123
  readonly eventTypes: string[];
31
- readonly manageSubscriptions: boolean;
32
- readonly verificationTokenConfigured: boolean;
33
- readonly encryptKeyConfigured: boolean;
124
+ readonly manageSubscriptions: boolean | null;
125
+ readonly verificationTokenConfigured: boolean | null;
126
+ readonly encryptKeyConfigured: boolean | null;
34
127
  readonly endpointUrl: string | null;
35
128
  readonly verifiedAt: string | null;
36
129
  readonly lastReceivedAt: string | null;
@@ -8553,6 +8553,18 @@ function checkJsonDepth(value, depth = 0) {
8553
8553
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
8554
8554
  }
8555
8555
  //#endregion
8556
+ //#region src/flow/common/retry.ts
8557
+ var nodeRetryLimits = {
8558
+ maxRetries: 5,
8559
+ minIntervalMs: 1e3,
8560
+ maxIntervalMs: 6e4,
8561
+ intervalStepMs: 1e3
8562
+ };
8563
+ var retryConfigurationSchema = strictObject({
8564
+ maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
8565
+ intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
8566
+ });
8567
+ //#endregion
8556
8568
  //#region src/flow/common/triggerScheduleSchema.ts
8557
8569
  var triggerScheduleSchema = array(union([object({
8558
8570
  type: literal("cron"),
@@ -8598,6 +8610,7 @@ var source = union([object({
8598
8610
  kind: literal("node"),
8599
8611
  nodeId: text,
8600
8612
  output: text,
8613
+ system: literal(true).optional(),
8601
8614
  field: text.optional()
8602
8615
  }), object({
8603
8616
  kind: literal("binding"),
@@ -8856,7 +8869,9 @@ var base = {
8856
8869
  name: text.optional(),
8857
8870
  description: text.optional(),
8858
8871
  icon: text.optional(),
8859
- timeoutMs: number().optional()
8872
+ timeoutMs: number().optional(),
8873
+ retry: retryConfigurationSchema.optional(),
8874
+ onError: _enum(["stop", "error"]).optional()
8860
8875
  };
8861
8876
  var node = union([
8862
8877
  strictObject({
@@ -8977,7 +8992,8 @@ var revision = object({
8977
8992
  literal(5),
8978
8993
  literal(6),
8979
8994
  literal(7),
8980
- literal(8)
8995
+ literal(8),
8996
+ literal(9)
8981
8997
  ]),
8982
8998
  document,
8983
8999
  modules: record$1(text, module)
@@ -9232,14 +9248,14 @@ function repairRevisionEnvelope(value) {
9232
9248
  checkJsonDepth(value);
9233
9249
  const envelopeSource = record(value);
9234
9250
  if (envelopeSource.kind != "open-flow-flow-revision" || envelopeSource.version != 1) throw new TypeError("The value is not an Open Flow Revision envelope.");
9235
- if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 8) throw new TypeError("The Flow model is newer than this package.");
9251
+ if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion > 9) throw new TypeError("The Flow model is newer than this package.");
9236
9252
  let sourceDocument = record(envelopeSource.modelVersion == 1 || envelopeSource.modelVersion == 2 ? upgradeLegacyDocument(envelopeSource.document) : envelopeSource.document);
9237
9253
  if (typeof envelopeSource.modelVersion == "number" && envelopeSource.modelVersion < 6) sourceDocument = upgradeTaskNodes(sourceDocument);
9238
9254
  sourceDocument = record(normalizeDocument(sourceDocument));
9239
9255
  const bindings = record(sourceDocument.bindings);
9240
9256
  const sourceGraph = repairGraph(sourceDocument.graph, bindings);
9241
9257
  return decodeRevisionContent({
9242
- modelVersion: 8,
9258
+ modelVersion: 9,
9243
9259
  document: {
9244
9260
  bindings: repairedEntries(sourceDocument.bindings, binding),
9245
9261
  graph: sourceGraph
@@ -9309,6 +9325,13 @@ var shapes = {
9309
9325
  },
9310
9326
  "graph.node.delete": at,
9311
9327
  "graph.node.field.set": union([
9328
+ object({
9329
+ ...at,
9330
+ kind: literal("graph.node.field.set"),
9331
+ field: literal("retry"),
9332
+ before: retryConfigurationSchema.optional(),
9333
+ value: retryConfigurationSchema.optional()
9334
+ }),
9312
9335
  object({
9313
9336
  ...at,
9314
9337
  kind: literal("graph.node.field.set"),
@@ -9322,7 +9345,8 @@ var shapes = {
9322
9345
  field: _enum([
9323
9346
  "description",
9324
9347
  "icon",
9325
- "name"
9348
+ "name",
9349
+ "onError"
9326
9350
  ]),
9327
9351
  before: text.optional(),
9328
9352
  value: text.optional()
@@ -9427,6 +9451,12 @@ array(union([...new Map(Object.entries(shapes).map(([kind, shape]) => [kind, sha
9427
9451
  ...shape
9428
9452
  })])).values()])).min(1);
9429
9453
  function checkModelVersion(content) {
9454
+ 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.");
9455
+ if (content.modelVersion < 9 && Object.values(content.document.graph.nodes).some((candidateNode) => {
9456
+ if (candidateNode.onError != null) return true;
9457
+ 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;
9458
+ 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))));
9459
+ })) throw new TypeError("Node error handling requires Flow model version 9.");
9430
9460
  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.");
9431
9461
  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.");
9432
9462
  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.");
@@ -9474,10 +9504,10 @@ function upgradeRevisionContent(content) {
9474
9504
  function upgradeDecodedRevisionContent(content) {
9475
9505
  const graph = content.document.graph;
9476
9506
  const hasManual = Object.values(graph.nodes).some((node) => node.kind == "manual");
9477
- if (!hasManual && content.modelVersion == 8) return content;
9507
+ if (!hasManual && content.modelVersion == 9) return content;
9478
9508
  return {
9479
9509
  ...content,
9480
- modelVersion: 8,
9510
+ modelVersion: 9,
9481
9511
  document: {
9482
9512
  ...content.document,
9483
9513
  graph: hasManual ? {
@@ -9498,7 +9528,11 @@ function upgradeManualTrigger(node) {
9498
9528
  //#region src/trigger/common/config.ts
9499
9529
  /** Deployment-bound selections owned by the Trigger configuration contract. */
9500
9530
  function clearTriggerExternalConfig(key, config) {
9501
- const fields = key == "feishu_app_bot.on_event" ? [
9531
+ const fields = key == "jira.on_issue_event" || key == "intercom.on_conversation_event" || key == "sentry.on_issue_alert" || key == "zoom.on_recording_ready" || key == "fireflies.on_meeting_ready" ? ["sourceId", "eventTypes"] : key == "slackbot.on_event" ? [
9532
+ "sourceId",
9533
+ "eventTypes",
9534
+ "channelIds"
9535
+ ] : key == "feishu_app_bot.on_event" ? [
9502
9536
  "sourceId",
9503
9537
  "eventTypes",
9504
9538
  "resource",
@@ -9740,7 +9774,12 @@ function canonicalNode(value) {
9740
9774
  ...value.kind == "outputs" ? {} : { inputs: canonicalInputs(value.inputs) },
9741
9775
  ...value.name == null ? {} : { name: value.name },
9742
9776
  ...value.maxExecutions == null ? {} : { maxExecutions: value.maxExecutions },
9743
- ...value.timeoutMs == null ? {} : { timeoutMs: value.timeoutMs }
9777
+ ...value.timeoutMs == null ? {} : { timeoutMs: value.timeoutMs },
9778
+ ...value.onError == null ? {} : { onError: value.onError },
9779
+ ...value.retry == null ? {} : { retry: {
9780
+ maxRetries: value.retry.maxRetries,
9781
+ intervalMs: value.retry.intervalMs
9782
+ } }
9744
9783
  };
9745
9784
  switch (value.kind) {
9746
9785
  case "outputs": return {
@@ -10023,7 +10062,7 @@ function revisionRepairKind(bytes) {
10023
10062
  return;
10024
10063
  }
10025
10064
  const source = value;
10026
- return typeof source.modelVersion == "number" && source.modelVersion < 8 ? "upgrade" : "repair";
10065
+ return typeof source.modelVersion == "number" && source.modelVersion < 9 ? "upgrade" : "repair";
10027
10066
  }
10028
10067
  function repairRevision(bytes) {
10029
10068
  return repairRevisionEnvelope(revisionValue(bytes));
@@ -0,0 +1,36 @@
1
+ import type { GraphNode, PortDefinition } from '../browser/flow-change.js';
2
+ export type NodeErrorData = {
3
+ readonly code: string;
4
+ readonly message: string;
5
+ readonly nodeId: string;
6
+ readonly nodeName: string;
7
+ readonly runId: string;
8
+ readonly executionId: string;
9
+ };
10
+ export declare const nodeErrorSchema: {
11
+ readonly type: 'object';
12
+ readonly additionalProperties: false;
13
+ readonly required: readonly ['code', 'message', 'nodeId', 'nodeName', 'runId', 'executionId'];
14
+ readonly properties: {
15
+ readonly code: {
16
+ readonly type: 'string';
17
+ };
18
+ readonly message: {
19
+ readonly type: 'string';
20
+ };
21
+ readonly nodeId: {
22
+ readonly type: 'string';
23
+ };
24
+ readonly nodeName: {
25
+ readonly type: 'string';
26
+ };
27
+ readonly runId: {
28
+ readonly type: 'string';
29
+ };
30
+ readonly executionId: {
31
+ readonly type: 'string';
32
+ };
33
+ };
34
+ };
35
+ export declare function supportsNodeErrorHandling(node: GraphNode): boolean;
36
+ export declare function nodeSystemOutputPorts(node: GraphNode): Readonly<Record<string, PortDefinition>>;
@@ -33,12 +33,14 @@ export type InputSourceCandidateCheck = Extract<InputSourceCheck, {
33
33
  readonly kind: 'available' | 'schema' | 'schema-error';
34
34
  }>;
35
35
  interface InputSourceFieldCandidate {
36
+ readonly system?: true;
36
37
  readonly description?: string;
37
38
  readonly output: string;
38
39
  readonly field: string;
39
40
  readonly check: InputSourceCandidateCheck;
40
41
  }
41
42
  export interface InputSourceCandidate {
43
+ readonly system?: true;
42
44
  readonly description?: string;
43
45
  readonly field?: string;
44
46
  readonly fields?: readonly InputSourceFieldCandidate[];
@@ -50,8 +52,8 @@ export interface InputSourcesCheck {
50
52
  readonly sources: readonly InputSourceCheck[];
51
53
  }
52
54
  /** Check one saved binding without enumerating candidate ports. */
53
- export declare function checkInputSource(graph: Graph, target: string, handle: string, source: Pick<NodeSource, 'nodeId' | 'output' | 'field'>): InputSourceCheck;
54
- export declare function checkInputSources(graph: Graph, target: string, handle: string, sources: readonly Pick<NodeSource, 'nodeId' | 'output' | 'field'>[]): InputSourcesCheck;
55
+ export declare function checkInputSource(graph: Graph, target: string, handle: string, source: Pick<NodeSource, 'nodeId' | 'output' | 'field' | 'system'>): InputSourceCheck;
56
+ export declare function checkInputSources(graph: Graph, target: string, handle: string, sources: readonly Pick<NodeSource, 'nodeId' | 'output' | 'field' | 'system'>[]): InputSourcesCheck;
55
57
  /** Enumerate structurally available outputs while retaining their compatibility with one input. */
56
58
  export declare function inputSourceCandidates(graph: Graph, target: string, handle: string): Readonly<Record<string, readonly InputSourceCandidate[]>>;
57
59
  export declare function availableOutputs(graph: Graph, target: string, handle: string | undefined): Readonly<Record<string, readonly string[]>>;
@@ -0,0 +1,19 @@
1
+ import type { GraphNode } from '../browser/flow-change.js';
2
+ import { z } from 'zod';
3
+ export interface RetryConfiguration {
4
+ readonly maxRetries: number;
5
+ readonly intervalMs: number;
6
+ }
7
+ export declare const retryNodeTypes: readonly ['code', 'connector', 'openapi', 'llm', 'decision'];
8
+ export declare const nodeRetryLimits: {
9
+ readonly maxRetries: 5;
10
+ readonly minIntervalMs: 1000;
11
+ readonly maxIntervalMs: 60000;
12
+ readonly intervalStepMs: 1000;
13
+ };
14
+ export declare const defaultNodeRetry: RetryConfiguration;
15
+ export declare const retryConfigurationSchema: z.ZodObject<{
16
+ maxRetries: z.ZodNumber;
17
+ intervalMs: z.ZodNumber;
18
+ }, z.core.$strict>;
19
+ export declare function supportsNodeRetry(node: GraphNode): boolean;
@@ -6582,6 +6582,28 @@ function checkJsonDepth(value, depth = 0) {
6582
6582
  if (value != null && typeof value == "object") for (const child of Object.values(value)) checkJsonDepth(child, depth + 1);
6583
6583
  }
6584
6584
  //#endregion
6585
+ //#region src/flow/common/retry.ts
6586
+ var retryNodeTypes = [
6587
+ "code",
6588
+ "connector",
6589
+ "openapi",
6590
+ "llm",
6591
+ "decision"
6592
+ ];
6593
+ var nodeRetryLimits = {
6594
+ maxRetries: 5,
6595
+ minIntervalMs: 1e3,
6596
+ maxIntervalMs: 6e4,
6597
+ intervalStepMs: 1e3
6598
+ };
6599
+ var retryConfigurationSchema = strictObject({
6600
+ maxRetries: number().int().min(0).max(nodeRetryLimits.maxRetries),
6601
+ intervalMs: number().int().min(nodeRetryLimits.minIntervalMs).max(nodeRetryLimits.maxIntervalMs).multipleOf(nodeRetryLimits.intervalStepMs)
6602
+ });
6603
+ function supportsNodeRetry(node) {
6604
+ return node.kind == "task" && retryNodeTypes.some((type) => type == ("moduleId" in node.task ? "code" : node.task.executor.kind));
6605
+ }
6606
+ //#endregion
6585
6607
  //#region src/flow/common/triggerScheduleSchema.ts
6586
6608
  var triggerScheduleSchema = array(union([object$1({
6587
6609
  type: literal("cron"),
@@ -6630,6 +6652,7 @@ var source = union([object$1({
6630
6652
  kind: literal("node"),
6631
6653
  nodeId: text,
6632
6654
  output: text,
6655
+ system: literal(true).optional(),
6633
6656
  field: text.optional()
6634
6657
  }), object$1({
6635
6658
  kind: literal("binding"),
@@ -6888,7 +6911,9 @@ var base = {
6888
6911
  name: text.optional(),
6889
6912
  description: text.optional(),
6890
6913
  icon: text.optional(),
6891
- timeoutMs: number().optional()
6914
+ timeoutMs: number().optional(),
6915
+ retry: retryConfigurationSchema.optional(),
6916
+ onError: _enum(["stop", "error"]).optional()
6892
6917
  };
6893
6918
  var node = union([
6894
6919
  strictObject({
@@ -7009,7 +7034,8 @@ object$1({
7009
7034
  literal(5),
7010
7035
  literal(6),
7011
7036
  literal(7),
7012
- literal(8)
7037
+ literal(8),
7038
+ literal(9)
7013
7039
  ]),
7014
7040
  document,
7015
7041
  modules: record$1(text, module)
@@ -7070,6 +7096,13 @@ var shapes = {
7070
7096
  },
7071
7097
  "graph.node.delete": at,
7072
7098
  "graph.node.field.set": union([
7099
+ object$1({
7100
+ ...at,
7101
+ kind: literal("graph.node.field.set"),
7102
+ field: literal("retry"),
7103
+ before: retryConfigurationSchema.optional(),
7104
+ value: retryConfigurationSchema.optional()
7105
+ }),
7073
7106
  object$1({
7074
7107
  ...at,
7075
7108
  kind: literal("graph.node.field.set"),
@@ -7083,7 +7116,8 @@ var shapes = {
7083
7116
  field: _enum([
7084
7117
  "description",
7085
7118
  "icon",
7086
- "name"
7119
+ "name",
7120
+ "onError"
7087
7121
  ]),
7088
7122
  before: text.optional(),
7089
7123
  value: text.optional()
@@ -7319,6 +7353,37 @@ function comparisonIssue(operator, leftType, rightType) {
7319
7353
  };
7320
7354
  }
7321
7355
  //#endregion
7356
+ //#region src/flow/common/errorHandling.ts
7357
+ var nodeErrorSchema = {
7358
+ type: "object",
7359
+ additionalProperties: false,
7360
+ required: [
7361
+ "code",
7362
+ "message",
7363
+ "nodeId",
7364
+ "nodeName",
7365
+ "runId",
7366
+ "executionId"
7367
+ ],
7368
+ properties: {
7369
+ code: { type: "string" },
7370
+ message: { type: "string" },
7371
+ nodeId: { type: "string" },
7372
+ nodeName: { type: "string" },
7373
+ runId: { type: "string" },
7374
+ executionId: { type: "string" }
7375
+ }
7376
+ };
7377
+ function supportsNodeErrorHandling(node) {
7378
+ return supportsNodeRetry(node);
7379
+ }
7380
+ function nodeSystemOutputPorts(node) {
7381
+ return supportsNodeErrorHandling(node) && node.onError == "error" ? { error: {
7382
+ jsonSchema: nodeErrorSchema,
7383
+ nullable: true
7384
+ } } : {};
7385
+ }
7386
+ //#endregion
7322
7387
  //#region src/flow/common/change.ts
7323
7388
  var schemaKeywords = /* @__PURE__ */ new Set([
7324
7389
  "const",
@@ -11369,8 +11434,8 @@ function normalizeTriggerOutputs(trigger, outputs) {
11369
11434
  }
11370
11435
  //#endregion
11371
11436
  //#region src/execution/common/engineContract.ts
11372
- var currentEngineContract = "open-flow-engine/v5";
11373
- var nodejsEngineContract = "open-flow-engine/v5/nodejs-compat-v1";
11437
+ var currentEngineContract = "open-flow-engine/v6";
11438
+ var nodejsEngineContract = "open-flow-engine/v6/nodejs-compat-v1";
11374
11439
  var currentContract = {
11375
11440
  platformExports: /* @__PURE__ */ new Set(["engineContract", "identity"]),
11376
11441
  platformModule: "open-flow:platform",
@@ -11411,8 +11476,8 @@ export function identity(value) { return value }
11411
11476
  `
11412
11477
  };
11413
11478
  function findEngineContract(contract) {
11414
- if (contract == "open-flow-engine/v5") return currentContract;
11415
- if (contract == "open-flow-engine/v5/nodejs-compat-v1") return nodejsContract;
11479
+ if (contract == "open-flow-engine/v6") return currentContract;
11480
+ if (contract == "open-flow-engine/v6/nodejs-compat-v1") return nodejsContract;
11416
11481
  }
11417
11482
  //#endregion
11418
11483
  //#region src/flow/common/agent.ts
@@ -11768,7 +11833,12 @@ function canonicalNode(value) {
11768
11833
  ...value.kind == "outputs" ? {} : { inputs: canonicalInputs(value.inputs) },
11769
11834
  ...value.name == null ? {} : { name: value.name },
11770
11835
  ...value.maxExecutions == null ? {} : { maxExecutions: value.maxExecutions },
11771
- ...value.timeoutMs == null ? {} : { timeoutMs: value.timeoutMs }
11836
+ ...value.timeoutMs == null ? {} : { timeoutMs: value.timeoutMs },
11837
+ ...value.onError == null ? {} : { onError: value.onError },
11838
+ ...value.retry == null ? {} : { retry: {
11839
+ maxRetries: value.retry.maxRetries,
11840
+ intervalMs: value.retry.intervalMs
11841
+ } }
11772
11842
  };
11773
11843
  switch (value.kind) {
11774
11844
  case "outputs": return {
@@ -12023,7 +12093,8 @@ function sourcePort(output, field) {
12023
12093
  }
12024
12094
  /** Present a selected first-level field as a compact path from its output. */
12025
12095
  function sourceOutputLabel(source) {
12026
- return source.field === void 0 ? source.output : `${source.output} / ${source.field}`;
12096
+ const output = source.system ? `$system / ${source.output}` : source.output;
12097
+ return source.field === void 0 ? output : `${output} / ${source.field}`;
12027
12098
  }
12028
12099
  //#endregion
12029
12100
  //#region src/flow/common/graph.ts
@@ -12144,6 +12215,14 @@ function nodeOutputPorts(node) {
12144
12215
  case "webhook": return triggerOutputPorts(node);
12145
12216
  }
12146
12217
  }
12218
+ function nodeSourceOutputPorts(node, system) {
12219
+ if (system) return nodeSystemOutputPorts(node);
12220
+ const ports = nodeOutputPorts(node);
12221
+ return node.onError == "error" ? Object.fromEntries(Object.entries(ports).map(([key, port]) => [key, {
12222
+ ...port,
12223
+ nullable: true
12224
+ }])) : ports;
12225
+ }
12147
12226
  function checkSource(source, graph, document, targetInput, path, diagnostics) {
12148
12227
  switch (source.kind) {
12149
12228
  case "binding":
@@ -12160,7 +12239,7 @@ function checkSource(source, graph, document, targetInput, path, diagnostics) {
12160
12239
  }));
12161
12240
  return;
12162
12241
  }
12163
- const output = nodeOutputPorts(upstream)[source.output];
12242
+ const output = nodeSourceOutputPorts(upstream, source.system)[source.output];
12164
12243
  if (output == null) diagnostics.push(graphDiagnostic("graph.source-missing", `Upstream node "${source.nodeId}" does not expose output "${source.output}".`, path, {
12165
12244
  nodeId: source.nodeId,
12166
12245
  output: source.output,
@@ -12366,6 +12445,11 @@ function validateGraph(graph, document, path, diagnostics) {
12366
12445
  for (const [nodeId, node] of Object.entries(graph.nodes)) {
12367
12446
  const nodePath = `${path}/nodes/${nodeId}`;
12368
12447
  if (!isTriggerNode(node) && node.maxExecutions != null && (!Number.isSafeInteger(node.maxExecutions) || node.maxExecutions < 1)) diagnostics.push(graphDiagnostic("node.max-executions-invalid", "Maximum executions must be a positive safe integer.", `${nodePath}/maxExecutions`));
12448
+ if (node.onError != null && (!supportsNodeErrorHandling(node) || !["stop", "error"].includes(node.onError))) diagnostics.push(graphDiagnostic("node.error-handling-invalid", "This node does not support this error handling setting.", `${nodePath}/onError`));
12449
+ if ("retry" in node && node.retry != null) {
12450
+ if (!supportsNodeRetry(node)) diagnostics.push(graphDiagnostic("node.retry-unsupported", "This node does not support retries.", `${nodePath}/retry`));
12451
+ if (!retryConfigurationSchema.safeParse(node.retry).success) diagnostics.push(graphDiagnostic("node.retry-invalid", "Retries must be 0–5 with an interval of 1–60 whole seconds.", `${nodePath}/retry`));
12452
+ }
12369
12453
  if (isTriggerNode(node)) {
12370
12454
  validateTrigger(nodeId, node, nodePath, diagnostics);
12371
12455
  continue;