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

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 (54) hide show
  1. package/dist/browser/{createResourceDialog-BAJXbzNH.js → createResourceDialog-BQVD8Rqb.js} +2 -2
  2. package/dist/browser/{icons-Db2Jb2iX.js → dialog-CS2Vt2if.js} +5736 -5621
  3. package/dist/browser/event-sources.d.ts +4 -1
  4. package/dist/browser/flow-authoring-node.d.ts +14 -3
  5. package/dist/browser/flow-authoring.js +120 -24
  6. package/dist/browser/flow-change-schema.d.ts +3 -1
  7. package/dist/browser/flow-change.d.ts +15 -3
  8. package/dist/browser/flow-change.js +117 -21
  9. package/dist/browser/{flowChanges-DkvG5uDq.js → flowChanges-VB9Y4iy7.js} +3423 -2380
  10. package/dist/browser/{flowRunInputEditorStore-B2Rw4VsT.js → flowRunInputEditorStore-DJqmR6Qh.js} +3 -2
  11. package/dist/browser/{flowWorkspace-BEp-lxqF.js → flowWorkspace-C1hlTnZq.js} +1410 -799
  12. package/dist/browser/preview.css +273 -119
  13. package/dist/browser/preview.js +17118 -15810
  14. package/dist/browser/theme.css +1 -0
  15. package/dist/browser/ui.css +119 -7
  16. package/dist/browser/ui.js +8 -5
  17. package/dist/browser/workbench-contract.d.ts +1 -1
  18. package/dist/browser/workbench.css +282 -162
  19. package/dist/browser/workbench.d.ts +0 -1
  20. package/dist/browser/workbench.js +503 -173
  21. package/dist/browser/{workbenchSelect-C-jf6NIM.js → workbenchSelect-CpXhjUou.js} +1 -1
  22. package/dist/command/index.js +49 -49
  23. package/dist/common/authoring.d.ts +7 -5
  24. package/dist/common/authoringExamples.d.ts +4 -4
  25. package/dist/common/authoringFields.d.ts +20 -0
  26. package/dist/common/authoringSchema.d.ts +404 -15
  27. package/dist/common/control-api-conformance.js +415 -146
  28. package/dist/common/control-api.d.ts +67 -8
  29. package/dist/common/control-api.js +3587 -3443
  30. package/dist/common/control-requests.d.ts +10 -3
  31. package/dist/common/control-requests.js +425 -49
  32. package/dist/common/decision.js +33 -7
  33. package/dist/common/flow-encoding.d.ts +4 -2
  34. package/dist/common/flow-encoding.js +151 -14
  35. package/dist/common/flow-graph.d.ts +1 -1
  36. package/dist/common/flow-semantics.d.ts +12 -2
  37. package/dist/common/flow-semantics.js +157 -41
  38. package/dist/common/integration-trigger.js +33 -7
  39. package/dist/common/liveDetails.d.ts +26 -11
  40. package/dist/common/mcp.d.ts +6 -3
  41. package/dist/common/mcp.js +219 -90
  42. package/dist/common/openapi.js +33 -7
  43. package/dist/common/poll-trigger.js +33 -7
  44. package/dist/common/run-events.d.ts +2 -0
  45. package/dist/common/run-events.js +9 -3
  46. package/dist/common/scheduler.d.ts +10 -1
  47. package/dist/common/scheduler.js +172 -49
  48. package/dist/common/trigger-contract.d.ts +2 -0
  49. package/dist/common/webhook-trigger.js +33 -7
  50. package/dist/common/workflow.d.ts +93 -0
  51. package/dist/common/workflow.js +10492 -0
  52. package/package.json +5 -1
  53. package/skills/open-flow/SKILL.md +9 -0
  54. package/skills/open-flow/references/flow-authoring.md +28 -16
@@ -6687,6 +6687,7 @@ var webhookMethods = [
6687
6687
  "DELETE"
6688
6688
  ];
6689
6689
  var text = string();
6690
+ var actionConnection = text.describe("Account selection: omit while unconfigured; use an account ID to select it; use \"\" to explicitly defer configuration. Deferred Actions fail if called; deferred Agent tools are excluded from the callable tool set. Not supported by Triggers.");
6690
6691
  var json = json$1();
6691
6692
  var strings = array(text);
6692
6693
  var port = object$1({
@@ -6695,6 +6696,7 @@ var port = object$1({
6695
6696
  nullable: boolean(),
6696
6697
  handle: text
6697
6698
  });
6699
+ var workflowInputDefs = array(port.strict());
6698
6700
  var input = port.extend({ value: json.optional() });
6699
6701
  var group = object$1({
6700
6702
  collapsed: boolean().optional(),
@@ -6741,7 +6743,7 @@ var capability = union([
6741
6743
  mode: literal("independent"),
6742
6744
  actions: array(strictObject({
6743
6745
  action: text,
6744
- connectionId: text.optional()
6746
+ connectionId: actionConnection.optional()
6745
6747
  }))
6746
6748
  }),
6747
6749
  strictObject({
@@ -6801,7 +6803,7 @@ var managedFields = object$1({
6801
6803
  object$1({
6802
6804
  kind: literal("connector"),
6803
6805
  action: text,
6804
- connectionId: text.optional(),
6806
+ connectionId: actionConnection.optional(),
6805
6807
  outputMode: literal("value").optional()
6806
6808
  }),
6807
6809
  object$1({
@@ -6841,17 +6843,22 @@ var managedFields = object$1({
6841
6843
  name: text,
6842
6844
  description: text,
6843
6845
  action: text,
6844
- connectionId: text.optional(),
6846
+ connectionId: actionConnection.optional(),
6845
6847
  approval: boolean(),
6846
6848
  inputs: array(input.extend({ source: agentInput }))
6847
6849
  })),
6848
6850
  notification: object$1({
6849
6851
  action: text,
6850
- connectionId: text.optional(),
6852
+ connectionId: actionConnection.optional(),
6851
6853
  inputDefinitions: array(input),
6852
6854
  messageHandle: text,
6853
6855
  inputs: record$1(text, agentValue)
6854
6856
  }).optional()
6857
+ }),
6858
+ strictObject({
6859
+ kind: literal("workflow"),
6860
+ flowId: text,
6861
+ revisionId: text
6855
6862
  })
6856
6863
  ])
6857
6864
  });
@@ -6960,6 +6967,12 @@ var base = {
6960
6967
  timeoutMs: number().optional()
6961
6968
  };
6962
6969
  var node = union([
6970
+ strictObject({
6971
+ ...base,
6972
+ kind: literal("outputs"),
6973
+ outputDefs: array(port.strict()),
6974
+ outputMappings: inputs
6975
+ }).omit({ inputs: true }),
6963
6976
  object$1({
6964
6977
  ...base,
6965
6978
  inputs: record$1(text, never()),
@@ -6992,6 +7005,11 @@ var node = union([
6992
7005
  ...trigger,
6993
7006
  kind: literal("manual")
6994
7007
  }),
7008
+ strictObject({
7009
+ ...trigger,
7010
+ kind: literal("start"),
7011
+ inputDefs: workflowInputDefs
7012
+ }),
6995
7013
  strictObject({
6996
7014
  ...trigger,
6997
7015
  kind: literal("error"),
@@ -7056,7 +7074,7 @@ var module = object$1({
7056
7074
  imports: strings,
7057
7075
  source: text
7058
7076
  });
7059
- var document = preprocess(rejectRetiredDefinitions, object$1({
7077
+ var document = preprocess(normalizeDocument, object$1({
7060
7078
  bindings: record$1(text, binding),
7061
7079
  graph
7062
7080
  }));
@@ -7065,7 +7083,9 @@ object$1({
7065
7083
  literal(2),
7066
7084
  literal(4),
7067
7085
  literal(5),
7068
- literal(6)
7086
+ literal(6),
7087
+ literal(7),
7088
+ literal(8)
7069
7089
  ]),
7070
7090
  document,
7071
7091
  modules: record$1(text, module)
@@ -7073,13 +7093,19 @@ object$1({
7073
7093
  kind: literal("open-flow-flow-revision"),
7074
7094
  version: literal(1)
7075
7095
  });
7076
- function rejectRetiredDefinitions(value) {
7096
+ function normalizeDocument(value) {
7077
7097
  const candidate = record(value);
7078
7098
  if (candidate.tasks !== void 0 && (candidate.tasks === null || typeof candidate.tasks !== "object" || Array.isArray(candidate.tasks) || Object.keys(candidate.tasks).length > 0)) throw new TypeError("Independent Task definitions are no longer supported.");
7079
7099
  if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => Object.hasOwn(record(candidateNode), "taskId"))) throw new TypeError("Task references are no longer supported.");
7080
7100
  const subflows = candidate.subflows;
7081
7101
  if (subflows !== void 0 && (subflows === null || typeof subflows !== "object" || Array.isArray(subflows) || Object.keys(subflows).length > 0)) throw new TypeError("Subflows are no longer supported.");
7082
7102
  if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind === "subflow")) throw new TypeError("Subflow nodes are no longer supported.");
7103
+ if ([
7104
+ "inputDefs",
7105
+ "outputDefs",
7106
+ "outputMappings"
7107
+ ].some((field) => Object.hasOwn(candidate, field))) throw new TypeError("Workflow interface configuration must belong to Start and Outputs nodes.");
7108
+ if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind == "start" && Object.hasOwn(record(candidateNode), "parameters"))) throw new TypeError("Legacy Start.parameters is unsupported; configure node.inputDefs.");
7083
7109
  return value;
7084
7110
  }
7085
7111
  function record(value) {
@@ -6694,6 +6694,7 @@ var webhookMethods = [
6694
6694
  "DELETE"
6695
6695
  ];
6696
6696
  var text = string();
6697
+ var actionConnection = text.describe("Account selection: omit while unconfigured; use an account ID to select it; use \"\" to explicitly defer configuration. Deferred Actions fail if called; deferred Agent tools are excluded from the callable tool set. Not supported by Triggers.");
6697
6698
  var json = json$1();
6698
6699
  var strings = array(text);
6699
6700
  var port = object({
@@ -6702,6 +6703,7 @@ var port = object({
6702
6703
  nullable: boolean(),
6703
6704
  handle: text
6704
6705
  });
6706
+ var workflowInputDefs = array(port.strict());
6705
6707
  var input = port.extend({ value: json.optional() });
6706
6708
  var group = object({
6707
6709
  collapsed: boolean().optional(),
@@ -6748,7 +6750,7 @@ var capability = union([
6748
6750
  mode: literal("independent"),
6749
6751
  actions: array(strictObject({
6750
6752
  action: text,
6751
- connectionId: text.optional()
6753
+ connectionId: actionConnection.optional()
6752
6754
  }))
6753
6755
  }),
6754
6756
  strictObject({
@@ -6808,7 +6810,7 @@ var managedFields = object({
6808
6810
  object({
6809
6811
  kind: literal("connector"),
6810
6812
  action: text,
6811
- connectionId: text.optional(),
6813
+ connectionId: actionConnection.optional(),
6812
6814
  outputMode: literal("value").optional()
6813
6815
  }),
6814
6816
  object({
@@ -6848,17 +6850,22 @@ var managedFields = object({
6848
6850
  name: text,
6849
6851
  description: text,
6850
6852
  action: text,
6851
- connectionId: text.optional(),
6853
+ connectionId: actionConnection.optional(),
6852
6854
  approval: boolean(),
6853
6855
  inputs: array(input.extend({ source: agentInput }))
6854
6856
  })),
6855
6857
  notification: object({
6856
6858
  action: text,
6857
- connectionId: text.optional(),
6859
+ connectionId: actionConnection.optional(),
6858
6860
  inputDefinitions: array(input),
6859
6861
  messageHandle: text,
6860
6862
  inputs: record$1(text, agentValue)
6861
6863
  }).optional()
6864
+ }),
6865
+ strictObject({
6866
+ kind: literal("workflow"),
6867
+ flowId: text,
6868
+ revisionId: text
6862
6869
  })
6863
6870
  ])
6864
6871
  });
@@ -6967,6 +6974,12 @@ var base = {
6967
6974
  timeoutMs: number().optional()
6968
6975
  };
6969
6976
  var node = union([
6977
+ strictObject({
6978
+ ...base,
6979
+ kind: literal("outputs"),
6980
+ outputDefs: array(port.strict()),
6981
+ outputMappings: inputs
6982
+ }).omit({ inputs: true }),
6970
6983
  object({
6971
6984
  ...base,
6972
6985
  inputs: record$1(text, never()),
@@ -6999,6 +7012,11 @@ var node = union([
6999
7012
  ...trigger,
7000
7013
  kind: literal("manual")
7001
7014
  }),
7015
+ strictObject({
7016
+ ...trigger,
7017
+ kind: literal("start"),
7018
+ inputDefs: workflowInputDefs
7019
+ }),
7002
7020
  strictObject({
7003
7021
  ...trigger,
7004
7022
  kind: literal("error"),
@@ -7063,7 +7081,7 @@ var module = object({
7063
7081
  imports: strings,
7064
7082
  source: text
7065
7083
  });
7066
- var document = preprocess(rejectRetiredDefinitions, object({
7084
+ var document = preprocess(normalizeDocument, object({
7067
7085
  bindings: record$1(text, binding),
7068
7086
  graph
7069
7087
  }));
@@ -7072,7 +7090,9 @@ object({
7072
7090
  literal(2),
7073
7091
  literal(4),
7074
7092
  literal(5),
7075
- literal(6)
7093
+ literal(6),
7094
+ literal(7),
7095
+ literal(8)
7076
7096
  ]),
7077
7097
  document,
7078
7098
  modules: record$1(text, module)
@@ -7080,13 +7100,19 @@ object({
7080
7100
  kind: literal("open-flow-flow-revision"),
7081
7101
  version: literal(1)
7082
7102
  });
7083
- function rejectRetiredDefinitions(value) {
7103
+ function normalizeDocument(value) {
7084
7104
  const candidate = record(value);
7085
7105
  if (candidate.tasks !== void 0 && (candidate.tasks === null || typeof candidate.tasks !== "object" || Array.isArray(candidate.tasks) || Object.keys(candidate.tasks).length > 0)) throw new TypeError("Independent Task definitions are no longer supported.");
7086
7106
  if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => Object.hasOwn(record(candidateNode), "taskId"))) throw new TypeError("Task references are no longer supported.");
7087
7107
  const subflows = candidate.subflows;
7088
7108
  if (subflows !== void 0 && (subflows === null || typeof subflows !== "object" || Array.isArray(subflows) || Object.keys(subflows).length > 0)) throw new TypeError("Subflows are no longer supported.");
7089
7109
  if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind === "subflow")) throw new TypeError("Subflow nodes are no longer supported.");
7110
+ if ([
7111
+ "inputDefs",
7112
+ "outputDefs",
7113
+ "outputMappings"
7114
+ ].some((field) => Object.hasOwn(candidate, field))) throw new TypeError("Workflow interface configuration must belong to Start and Outputs nodes.");
7115
+ if (Object.values(record(record(candidate.graph).nodes)).some((candidateNode) => record(candidateNode).kind == "start" && Object.hasOwn(record(candidateNode), "parameters"))) throw new TypeError("Legacy Start.parameters is unsupported; configure node.inputDefs.");
7090
7116
  return value;
7091
7117
  }
7092
7118
  function record(value) {
@@ -6,4 +6,6 @@ export type ProjectedRunEvent = {
6
6
  readonly kind: 'node.artifact' | 'node.failed' | 'node.log' | 'node.progress' | 'node.started' | 'run.progress' | 'run.started';
7
7
  readonly payload: Readonly<Record<string, unknown>>;
8
8
  };
9
+ /** Stable public identity shared by events and durable workflow-call provenance. */
10
+ export declare function projectExecutionId(platformRunId: string, rawRunId: string, jobId: string): Promise<string>;
9
11
  export declare function createEventProjector(platformRunId: string, nodeFailureCodes: ReadonlySet<string>): (event: unknown) => Promise<ProjectedRunEvent | undefined>;
@@ -10,7 +10,9 @@ var nodeKinds = /* @__PURE__ */ new Set([
10
10
  "openapi",
11
11
  "llm",
12
12
  "value",
13
- "wait"
13
+ "wait",
14
+ "outputs",
15
+ "workflow"
14
16
  ]);
15
17
  function object(value, description) {
16
18
  if (value == null || typeof value != "object" || Array.isArray(value)) throw new TypeError(`${description} must be an object.`);
@@ -36,12 +38,16 @@ function nodeContext(event, flows, platformRunId) {
36
38
  const flowId = flows.get(rawRunId);
37
39
  if (flowId == null) throw new TypeError("Runtime node event preceded its run.started event.");
38
40
  return {
39
- executionId: opaqueId("execution", platformRunId, rawRunId, string(event.jobId, "Runtime node event jobId")),
41
+ executionId: projectExecutionId(platformRunId, rawRunId, string(event.jobId, "Runtime node event jobId")),
40
42
  flowId,
41
43
  nodeId: string(event.nodeId, "Runtime node event nodeId"),
42
44
  rawRunId
43
45
  };
44
46
  }
47
+ /** Stable public identity shared by events and durable workflow-call provenance. */
48
+ function projectExecutionId(platformRunId, rawRunId, jobId) {
49
+ return opaqueId("execution", platformRunId, rawRunId, jobId);
50
+ }
45
51
  async function opaqueId(prefix, ...parts) {
46
52
  const bytes = encoder.encode(JSON.stringify([
47
53
  1,
@@ -227,4 +233,4 @@ function createEventProjector(platformRunId, nodeFailureCodes) {
227
233
  };
228
234
  }
229
235
  //#endregion
230
- export { createEventProjector };
236
+ export { createEventProjector, projectExecutionId };
@@ -28,7 +28,7 @@ export type SchedulerEvent = {
28
28
  readonly inputs: Readonly<Record<string, JsonValue>>;
29
29
  readonly jobId: string;
30
30
  readonly nodeId: string;
31
- readonly nodeKind: 'agent' | 'approval' | 'condition' | 'connector' | 'decision' | 'javascript' | 'openapi' | 'llm' | 'value' | 'wait';
31
+ readonly nodeKind: 'agent' | 'approval' | 'condition' | 'connector' | 'decision' | 'javascript' | 'openapi' | 'llm' | 'value' | 'wait' | 'outputs' | 'workflow';
32
32
  readonly nodeTitle?: string;
33
33
  readonly runId: string;
34
34
  readonly type: 'node.started';
@@ -66,6 +66,7 @@ export type SchedulerEvent = {
66
66
  };
67
67
  export interface FlowRunResult {
68
68
  readonly kind: 'node-results';
69
+ readonly outputs?: Readonly<Record<string, JsonValue>>;
69
70
  readonly nodes: readonly {
70
71
  readonly nodeId: string;
71
72
  readonly status: 'completed';
@@ -124,7 +125,14 @@ interface DependencyState {
124
125
  jobId?: string;
125
126
  seeded: boolean;
126
127
  }
128
+ export interface PendingWorkflowCall {
129
+ readonly jobId: string;
130
+ readonly nodeId: string;
131
+ readonly childRunId: string;
132
+ readonly input: Readonly<Record<string, JsonValue>>;
133
+ }
127
134
  export interface FlowRunCheckpoint {
135
+ readonly calls?: readonly PendingWorkflowCall[];
128
136
  readonly bindingValues: Readonly<Record<string, string>>;
129
137
  readonly inputs: Readonly<Record<string, Readonly<Record<string, JsonValue>>>>;
130
138
  readonly results: Readonly<Record<string, {
@@ -148,6 +156,7 @@ export type FlowRunOutcome = FlowRunResult | {
148
156
  readonly remainingMs?: number;
149
157
  };
150
158
  interface TaskInvocationBase {
159
+ readonly workflowRunId?: string;
151
160
  readonly agent?: {
152
161
  readonly action: 'approve' | 'reject';
153
162
  readonly checkpoint: AgentCheckpoint;