@oomol-lab/open-flow 0.1.0-beta.62 → 0.1.0-beta.63

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 (51) hide show
  1. package/dist/browser/{createResourceDialog-DZgJsr3e.js → createResourceDialog-BAJXbzNH.js} +20 -7
  2. package/dist/browser/flow-authoring.js +8 -7
  3. package/dist/browser/flow-change-schema.d.ts +1 -0
  4. package/dist/browser/flow-change.d.ts +1 -0
  5. package/dist/browser/flow-change.js +8 -7
  6. package/dist/browser/{flowChanges-CzYIVevI.js → flowChanges-DpZOQuJE.js} +784 -443
  7. package/dist/browser/{flowRunInputEditorStore-Dsxyfwae.js → flowRunInputEditorStore-B2Rw4VsT.js} +1 -1
  8. package/dist/browser/{flowWorkspace-BgZaFKZm.js → flowWorkspace-B7a5NNA_.js} +41 -29
  9. package/dist/browser/{icons-CajfDpy_.js → icons-Db2Jb2iX.js} +30 -10
  10. package/dist/browser/preview.css +5 -6
  11. package/dist/browser/preview.js +437 -402
  12. package/dist/browser/{typeScriptSession-fXPMFGjW.js → typeScriptSession-D0bjYDeg.js} +1 -1
  13. package/dist/browser/ui.css +4 -5
  14. package/dist/browser/ui.js +2 -2
  15. package/dist/browser/{value-DL_poNiC.js → value-BADHeZ9I.js} +12 -1
  16. package/dist/browser/workbench-contract.d.ts +10 -0
  17. package/dist/browser/workbench.css +5 -6
  18. package/dist/browser/workbench.d.ts +5 -3
  19. package/dist/browser/workbench.js +198 -171
  20. package/dist/browser/{workbenchSelect-H9wzEFkH.js → workbenchSelect-C-jf6NIM.js} +1 -1
  21. package/dist/command/index.js +40 -39
  22. package/dist/common/authoringSchema.d.ts +1 -0
  23. package/dist/common/connector-action.d.ts +1 -0
  24. package/dist/common/connector-action.js +15 -12
  25. package/dist/common/control-api-conformance.js +107 -8
  26. package/dist/common/control-api.d.ts +8 -0
  27. package/dist/common/control-api.js +47 -8
  28. package/dist/common/control-requests.d.ts +6 -0
  29. package/dist/common/control-requests.js +41 -18
  30. package/dist/common/decision.js +8 -7
  31. package/dist/common/flow-connectionUsage.d.ts +1 -0
  32. package/dist/common/flow-encoding.d.ts +1 -0
  33. package/dist/common/flow-encoding.js +202 -10
  34. package/dist/common/flow-semantics.js +64 -46
  35. package/dist/common/flow-workflowFile.d.ts +23 -0
  36. package/dist/common/integration-trigger.js +8 -7
  37. package/dist/common/localization.d.ts +1 -0
  38. package/dist/common/localization.js +12 -1
  39. package/dist/common/mcp.d.ts +61 -0
  40. package/dist/common/mcp.js +92 -9
  41. package/dist/common/openapi.js +8 -7
  42. package/dist/common/poll-trigger.js +8 -7
  43. package/dist/common/runtime-contract.js +1 -1
  44. package/dist/common/scheduler.d.ts +22 -2
  45. package/dist/common/scheduler.js +354 -83
  46. package/dist/common/trigger-config.d.ts +2 -0
  47. package/dist/common/webhook-trigger.js +8 -7
  48. package/dist/index.d.ts +2 -2
  49. package/package.json +1 -1
  50. package/skills/open-flow/SKILL.md +1 -1
  51. package/skills/open-flow/references/flow-authoring.md +20 -0
@@ -6649,10 +6649,10 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
6649
6649
  }
6650
6650
  if (compiledEnum.length === 0) recordWarn(context, "all of elements from list is rejected by currently schema object", "enum");
6651
6651
  }
6652
- if (constValue && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
6652
+ if (constValue !== void 0 && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
6653
6653
  if (compiledEnum) {
6654
6654
  if (compiledEnum.length === 0) isNever = true;
6655
- else if (constValue) {
6655
+ else if (constValue !== void 0) {
6656
6656
  let foundEquals = false;
6657
6657
  for (const enumValue of compiledEnum) if (isDeepEquals(enumValue, constValue)) {
6658
6658
  foundEquals = true;
@@ -6665,7 +6665,7 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
6665
6665
  const compiledSchema = {};
6666
6666
  if (schema.type) compiledSchema.type = schema.type;
6667
6667
  if (compiledEnum) compiledSchema.enum = compiledEnum;
6668
- if (constValue) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
6668
+ if (constValue !== void 0) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
6669
6669
  return wrapCompiledSchema(kind, compiledSchema, context.delegate, context.path);
6670
6670
  }
6671
6671
  //#endregion
@@ -7060,7 +7060,7 @@ function compileSchema(context, schema) {
7060
7060
  let targetSchema = schema;
7061
7061
  let shouldHandleEnumAndConst = false;
7062
7062
  const { enum: enumList, const: constValue } = schema;
7063
- if (enumList || constValue) {
7063
+ if (enumList || constValue !== void 0) {
7064
7064
  const { enum: _0, const: _1, ...rest } = schema;
7065
7065
  targetSchema = rest;
7066
7066
  shouldHandleEnumAndConst = true;
@@ -7650,7 +7650,7 @@ function schemaEqualsChecker(extendsContext) {
7650
7650
  }
7651
7651
  function isValueEquals(value1, value2) {
7652
7652
  if (value1 === value2) return true;
7653
- if (value1 === null) return false;
7653
+ if (value1 === null || value2 === null) return false;
7654
7654
  if (typeof value1 !== "object") return false;
7655
7655
  if (typeof value1 !== typeof value2) return false;
7656
7656
  if (isCompiledSchema(value1) && isCompiledSchema(value2)) return isCompiledSchemaEquals(value1, value2);
@@ -8216,7 +8216,7 @@ function findMismatchPath(source, target) {
8216
8216
  if ((sourceSchema.maxProperties ?? Number.POSITIVE_INFINITY) > (targetSchema.maxProperties ?? Number.POSITIVE_INFINITY)) return [...targetPath, "maxProperties"];
8217
8217
  break;
8218
8218
  }
8219
- case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const == null ? "enum" : "const"];
8219
+ case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const === void 0 ? "enum" : "const"];
8220
8220
  }
8221
8221
  return targetPath;
8222
8222
  }
@@ -8693,7 +8693,8 @@ var managedFields = object({
8693
8693
  object({
8694
8694
  kind: literal("connector"),
8695
8695
  action: text,
8696
- connectionId: text.optional()
8696
+ connectionId: text.optional(),
8697
+ outputMode: literal("value").optional()
8697
8698
  }),
8698
8699
  object({
8699
8700
  kind: literal("openapi"),
@@ -8961,7 +8962,7 @@ var revision = object({
8961
8962
  document,
8962
8963
  modules: record$1(text, module)
8963
8964
  });
8964
- var envelope = revision.extend({
8965
+ var envelope$1 = revision.extend({
8965
8966
  kind: literal("open-flow-flow-revision"),
8966
8967
  version: literal(1)
8967
8968
  });
@@ -9186,7 +9187,7 @@ function decodeRevisionEnvelope(value) {
9186
9187
  ...revisionSource,
9187
9188
  document: upgradeLegacyDocument(revisionSource.document)
9188
9189
  } : value;
9189
- const content = envelope.parse(candidate);
9190
+ const content = envelope$1.parse(candidate);
9190
9191
  checkModelVersion(content);
9191
9192
  assertOpenApiAuthBindings(content.document);
9192
9193
  return {
@@ -9352,6 +9353,197 @@ function checkModelVersion(content) {
9352
9353
  if (content.modelVersion < 5 && Object.values(content.document.graph.nodes).some((itemNode) => itemNode.kind == "error")) throw new TypeError("Error workflows require Flow model version 5.");
9353
9354
  }
9354
9355
  //#endregion
9356
+ //#region src/flow/common/condition.ts
9357
+ function clearConditionBinding(operand) {
9358
+ return operand.kind == "source" && operand.source.kind == "binding" ? { kind: "value" } : operand;
9359
+ }
9360
+ function clearConditionBindings(node) {
9361
+ return {
9362
+ ...node,
9363
+ cases: node.cases.map((item) => ({
9364
+ ...item,
9365
+ groups: item.groups.map((group) => ({
9366
+ ...group,
9367
+ expressions: group.expressions.map((expression) => ({
9368
+ ...expression,
9369
+ left: clearConditionBinding(expression.left),
9370
+ ...expression.right == null ? {} : { right: clearConditionBinding(expression.right) }
9371
+ }))
9372
+ }))
9373
+ }))
9374
+ };
9375
+ }
9376
+ //#endregion
9377
+ //#region src/trigger/common/config.ts
9378
+ /** Deployment-bound selections owned by the Trigger configuration contract. */
9379
+ function clearTriggerExternalConfig(key, config) {
9380
+ const fields = key == "feishu_app_bot.on_event" ? [
9381
+ "sourceId",
9382
+ "eventTypes",
9383
+ "resource",
9384
+ "chatIds"
9385
+ ] : key == "linear.on_issue_changed" ? ["teamId", "stateIds"] : [];
9386
+ return {
9387
+ ...config,
9388
+ ...Object.fromEntries(fields.map((field) => [field, { kind: "unset" }]))
9389
+ };
9390
+ }
9391
+ //#endregion
9392
+ //#region src/flow/common/connectionUsage.ts
9393
+ function clearNodeConnections(graph, connectionId) {
9394
+ return {
9395
+ ...graph,
9396
+ nodes: Object.fromEntries(Object.entries(graph.nodes).map(([id, node]) => {
9397
+ if ((node.kind == "poll" || node.kind == "integration") && (connectionId == null || node.connectionId == connectionId)) {
9398
+ const { connectionId: _, ...remaining } = node;
9399
+ return [id, remaining];
9400
+ }
9401
+ if (node.kind != "task") return [id, node];
9402
+ if ("executor" in node.task) {
9403
+ const executor = node.task.executor;
9404
+ const clear = (value) => {
9405
+ if (connectionId != null && value.connectionId != connectionId) return value;
9406
+ const { connectionId: _, ...rest } = value;
9407
+ return rest;
9408
+ };
9409
+ if (executor.kind == "connector") return [id, {
9410
+ ...node,
9411
+ task: {
9412
+ ...node.task,
9413
+ executor: clear(executor)
9414
+ }
9415
+ }];
9416
+ if (executor.kind == "agent") return [id, {
9417
+ ...node,
9418
+ task: {
9419
+ ...node.task,
9420
+ executor: {
9421
+ ...executor,
9422
+ tools: executor.tools.map(clear),
9423
+ ...executor.notification == null ? {} : { notification: clear(executor.notification) }
9424
+ }
9425
+ }
9426
+ }];
9427
+ return [id, node];
9428
+ }
9429
+ const capabilities = node.task.capabilities?.map((capability) => {
9430
+ if (!("mode" in capability)) {
9431
+ if ("action" in capability) {
9432
+ const { connectionId: selected, ...rest } = capability;
9433
+ return {
9434
+ ...rest,
9435
+ connections: capability.connections.filter((item) => connectionId != null && item.connectionId != connectionId),
9436
+ ...selected != null && connectionId != null && selected != connectionId ? { connectionId: selected } : {}
9437
+ };
9438
+ }
9439
+ return {
9440
+ ...capability,
9441
+ ...connectionId == null && (capability.connectionHints?.length ?? 0) > 0 ? { actionHints: [.../* @__PURE__ */ new Set([...capability.actionHints ?? [], ...capability.connectionHints.map((hint) => hint.action)])] } : {},
9442
+ ...capability.connectionHints == null ? {} : { connectionHints: capability.connectionHints.filter((item) => connectionId != null && item.connectionId != connectionId) }
9443
+ };
9444
+ }
9445
+ if (capability.mode != "independent") return capability;
9446
+ return {
9447
+ ...capability,
9448
+ actions: capability.actions.map((action) => {
9449
+ if (connectionId != null && action.connectionId != connectionId) return action;
9450
+ const { connectionId: _, ...remaining } = action;
9451
+ return remaining;
9452
+ })
9453
+ };
9454
+ });
9455
+ return [id, capabilities == null ? node : {
9456
+ ...node,
9457
+ task: {
9458
+ ...node.task,
9459
+ capabilities
9460
+ }
9461
+ }];
9462
+ }))
9463
+ };
9464
+ }
9465
+ //#endregion
9466
+ //#region src/flow/common/workflowFile.ts
9467
+ var envelope = strictObject({
9468
+ kind: literal("open-flow-workflow"),
9469
+ version: literal(1),
9470
+ name: string().optional(),
9471
+ content: unknown(),
9472
+ presentation: record$1(string(), json$1()).optional()
9473
+ });
9474
+ /** Structural decoding only: incomplete drafts are supported, repair is never attempted. */
9475
+ function decodeWorkflowFile(value) {
9476
+ checkJsonDepth(value, -1);
9477
+ const file = envelope.parse(value);
9478
+ return {
9479
+ ...file,
9480
+ content: decodeRevisionContent(file.content)
9481
+ };
9482
+ }
9483
+ function parseWorkflowFile(text) {
9484
+ return decodeWorkflowFile(JSON.parse(text));
9485
+ }
9486
+ function cleanInput(input) {
9487
+ if (input.kind != "sources" || !input.sources.some((source) => source.kind == "binding")) return input;
9488
+ const sources = input.sources.filter((source) => source.kind != "binding");
9489
+ return sources.length == 0 ? { kind: "unset" } : {
9490
+ kind: "sources",
9491
+ sources
9492
+ };
9493
+ }
9494
+ /** Clear only owned structured references, never strings in code or business values. */
9495
+ function cleanWorkflowFile(value) {
9496
+ const file = decodeWorkflowFile(value);
9497
+ const original = file.content.document.graph;
9498
+ const graph = clearNodeConnections(original);
9499
+ const nodes = Object.fromEntries(Object.entries(graph.nodes).map(([id, source]) => {
9500
+ let node = source;
9501
+ if ("inputs" in node) node = {
9502
+ ...node,
9503
+ inputs: Object.fromEntries(Object.entries(node.inputs).map(([key, input]) => [key, cleanInput(input)]))
9504
+ };
9505
+ if (node.kind == "condition") node = clearConditionBindings(node);
9506
+ if (node.kind == "error" && node.sourceFlowIds != null) node = {
9507
+ ...node,
9508
+ sourceFlowIds: []
9509
+ };
9510
+ if (node.kind == "poll" || node.kind == "integration") node = {
9511
+ ...node,
9512
+ config: clearTriggerExternalConfig(node.definition.key, node.config)
9513
+ };
9514
+ return [id, node];
9515
+ }));
9516
+ return {
9517
+ file: {
9518
+ ...file,
9519
+ content: {
9520
+ ...file.content,
9521
+ document: {
9522
+ ...file.content.document,
9523
+ bindings: {},
9524
+ graph: {
9525
+ ...graph,
9526
+ nodes
9527
+ }
9528
+ }
9529
+ }
9530
+ },
9531
+ summary: {
9532
+ changedNodeIds: Object.keys(nodes).filter((id) => !dequal(nodes[id], original.nodes[id])),
9533
+ removedBindings: Object.keys(file.content.document.bindings).length
9534
+ }
9535
+ };
9536
+ }
9537
+ function encodeWorkflowFile(file) {
9538
+ return `${JSON.stringify(cleanWorkflowFile(file).file, null, 2)}\n`;
9539
+ }
9540
+ function workflowFileName(name) {
9541
+ return `${name.replace(/[<>:"/\\|?*\u0000-\u001f]/g, "_").replace(/[. ]+$/g, "") || "workflow"}.openflow.json`;
9542
+ }
9543
+ function workflowNameFromFile(name) {
9544
+ return name.replace(/(?:\.openflow)?\.json$/i, "");
9545
+ }
9546
+ //#endregion
9355
9547
  //#region src/flow/common/encoding.ts
9356
9548
  var encoder = new TextEncoder();
9357
9549
  function canonicalText(value) {
@@ -9700,4 +9892,4 @@ function repairRevision(bytes) {
9700
9892
  return repairRevisionEnvelope(revisionValue(bytes));
9701
9893
  }
9702
9894
  //#endregion
9703
- export { canonicalDocument, canonicalGraph, canonicalJsonBytes, canonicalModule, canonicalPorts, canonicalRevisionGraph, canonicalTask, decodeFlowDocument, decodeRevision, decodeRevisionContent, digestBytes, encodeRevision, maxJsonDepth, repairRevision, revisionRepairKind, triggerRuntimeJson };
9895
+ export { canonicalDocument, canonicalGraph, canonicalJsonBytes, canonicalModule, canonicalPorts, canonicalRevisionGraph, canonicalTask, cleanWorkflowFile, decodeFlowDocument, decodeRevision, decodeRevisionContent, decodeWorkflowFile, digestBytes, encodeRevision, encodeWorkflowFile, maxJsonDepth, parseWorkflowFile, repairRevision, revisionRepairKind, triggerRuntimeJson, workflowFileName, workflowNameFromFile };
@@ -6725,7 +6725,8 @@ var managedFields = object$1({
6725
6725
  object$1({
6726
6726
  kind: literal("connector"),
6727
6727
  action: text,
6728
- connectionId: text.optional()
6728
+ connectionId: text.optional(),
6729
+ outputMode: literal("value").optional()
6729
6730
  }),
6730
6731
  object$1({
6731
6732
  kind: literal("openapi"),
@@ -8382,10 +8383,10 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
8382
8383
  }
8383
8384
  if (compiledEnum.length === 0) recordWarn(context, "all of elements from list is rejected by currently schema object", "enum");
8384
8385
  }
8385
- if (constValue && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
8386
+ if (constValue !== void 0 && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
8386
8387
  if (compiledEnum) {
8387
8388
  if (compiledEnum.length === 0) isNever = true;
8388
- else if (constValue) {
8389
+ else if (constValue !== void 0) {
8389
8390
  let foundEquals = false;
8390
8391
  for (const enumValue of compiledEnum) if (isDeepEquals(enumValue, constValue)) {
8391
8392
  foundEquals = true;
@@ -8398,7 +8399,7 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
8398
8399
  const compiledSchema = {};
8399
8400
  if (schema.type) compiledSchema.type = schema.type;
8400
8401
  if (compiledEnum) compiledSchema.enum = compiledEnum;
8401
- if (constValue) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
8402
+ if (constValue !== void 0) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
8402
8403
  return wrapCompiledSchema(kind, compiledSchema, context.delegate, context.path);
8403
8404
  }
8404
8405
  //#endregion
@@ -8793,7 +8794,7 @@ function compileSchema(context, schema) {
8793
8794
  let targetSchema = schema;
8794
8795
  let shouldHandleEnumAndConst = false;
8795
8796
  const { enum: enumList, const: constValue } = schema;
8796
- if (enumList || constValue) {
8797
+ if (enumList || constValue !== void 0) {
8797
8798
  const { enum: _0, const: _1, ...rest } = schema;
8798
8799
  targetSchema = rest;
8799
8800
  shouldHandleEnumAndConst = true;
@@ -9383,7 +9384,7 @@ function schemaEqualsChecker(extendsContext) {
9383
9384
  }
9384
9385
  function isValueEquals(value1, value2) {
9385
9386
  if (value1 === value2) return true;
9386
- if (value1 === null) return false;
9387
+ if (value1 === null || value2 === null) return false;
9387
9388
  if (typeof value1 !== "object") return false;
9388
9389
  if (typeof value1 !== typeof value2) return false;
9389
9390
  if (isCompiledSchema(value1) && isCompiledSchema(value2)) return isCompiledSchemaEquals(value1, value2);
@@ -9949,7 +9950,7 @@ function findMismatchPath(source, target) {
9949
9950
  if ((sourceSchema.maxProperties ?? Number.POSITIVE_INFINITY) > (targetSchema.maxProperties ?? Number.POSITIVE_INFINITY)) return [...targetPath, "maxProperties"];
9950
9951
  break;
9951
9952
  }
9952
- case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const == null ? "enum" : "const"];
9953
+ case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const === void 0 ? "enum" : "const"];
9953
9954
  }
9954
9955
  return targetPath;
9955
9956
  }
@@ -11051,7 +11052,7 @@ function clearNodeConnections(graph, connectionId) {
11051
11052
  return {
11052
11053
  ...graph,
11053
11054
  nodes: Object.fromEntries(Object.entries(graph.nodes).map(([id, node]) => {
11054
- if ((node.kind == "poll" || node.kind == "integration") && node.connectionId == connectionId) {
11055
+ if ((node.kind == "poll" || node.kind == "integration") && (connectionId == null || node.connectionId == connectionId)) {
11055
11056
  const { connectionId: _, ...remaining } = node;
11056
11057
  return [id, remaining];
11057
11058
  }
@@ -11059,7 +11060,7 @@ function clearNodeConnections(graph, connectionId) {
11059
11060
  if ("executor" in node.task) {
11060
11061
  const executor = node.task.executor;
11061
11062
  const clear = (value) => {
11062
- if (value.connectionId != connectionId) return value;
11063
+ if (connectionId != null && value.connectionId != connectionId) return value;
11063
11064
  const { connectionId: _, ...rest } = value;
11064
11065
  return rest;
11065
11066
  };
@@ -11084,11 +11085,26 @@ function clearNodeConnections(graph, connectionId) {
11084
11085
  return [id, node];
11085
11086
  }
11086
11087
  const capabilities = node.task.capabilities?.map((capability) => {
11087
- if (!("mode" in capability) || capability.mode != "independent") return capability;
11088
+ if (!("mode" in capability)) {
11089
+ if ("action" in capability) {
11090
+ const { connectionId: selected, ...rest } = capability;
11091
+ return {
11092
+ ...rest,
11093
+ connections: capability.connections.filter((item) => connectionId != null && item.connectionId != connectionId),
11094
+ ...selected != null && connectionId != null && selected != connectionId ? { connectionId: selected } : {}
11095
+ };
11096
+ }
11097
+ return {
11098
+ ...capability,
11099
+ ...connectionId == null && (capability.connectionHints?.length ?? 0) > 0 ? { actionHints: [.../* @__PURE__ */ new Set([...capability.actionHints ?? [], ...capability.connectionHints.map((hint) => hint.action)])] } : {},
11100
+ ...capability.connectionHints == null ? {} : { connectionHints: capability.connectionHints.filter((item) => connectionId != null && item.connectionId != connectionId) }
11101
+ };
11102
+ }
11103
+ if (capability.mode != "independent") return capability;
11088
11104
  return {
11089
11105
  ...capability,
11090
11106
  actions: capability.actions.map((action) => {
11091
- if (action.connectionId != connectionId) return action;
11107
+ if (connectionId != null && action.connectionId != connectionId) return action;
11092
11108
  const { connectionId: _, ...remaining } = action;
11093
11109
  return remaining;
11094
11110
  })
@@ -11603,6 +11619,36 @@ function agentToolInput(tool, input, argumentsValue) {
11603
11619
  }));
11604
11620
  }
11605
11621
  //#endregion
11622
+ //#region src/trigger/common/config.ts
11623
+ function triggerConfigValue(input, config) {
11624
+ return inputValue(config[input.handle], input.value);
11625
+ }
11626
+ function missingTriggerConfig(inputs, config) {
11627
+ return inputs.flatMap((input) => "handle" in input && !input.nullable && triggerConfigValue(input, config) === void 0 ? [input.handle] : []);
11628
+ }
11629
+ /** Resolves fixed inputs before a Provider sees them, using the same defaults/null semantics as node inputs. */
11630
+ function resolveTriggerConfig(inputs, config) {
11631
+ const fields = inputs.filter((input) => "handle" in input);
11632
+ const handles = new Set(fields.map((input) => input.handle));
11633
+ if (handles.size !== fields.length) throw new TypeError("Trigger config has duplicate input handles.");
11634
+ const unknown = Object.keys(config).find((handle) => !handles.has(handle));
11635
+ if (unknown != null) throw new TypeError(`Unknown Trigger config input "${unknown}".`);
11636
+ const resolved = Object.fromEntries(fields.map((input) => {
11637
+ const value = triggerConfigValue(input, config) ?? null;
11638
+ if (!(value === null && input.nullable) && !matchesSchema(value, input.jsonSchema)) throw new TypeError(`Trigger config input "${input.handle}" does not match its declared schema.`);
11639
+ return [input.handle, value];
11640
+ }));
11641
+ if (new TextEncoder().encode(JSON.stringify(resolved)).byteLength > 65536) throw new TypeError("Trigger config exceeds the 65536-byte limit.");
11642
+ return resolved;
11643
+ }
11644
+ strictObject({
11645
+ kind: literal("open-flow-workflow"),
11646
+ version: literal(1),
11647
+ name: string().optional(),
11648
+ content: unknown(),
11649
+ presentation: record$1(string(), json$1()).optional()
11650
+ });
11651
+ //#endregion
11606
11652
  //#region src/flow/common/encoding.ts
11607
11653
  var encoder = new TextEncoder();
11608
11654
  function canonicalText(value) {
@@ -11890,29 +11936,6 @@ function canonicalModule(module) {
11890
11936
  };
11891
11937
  }
11892
11938
  //#endregion
11893
- //#region src/trigger/common/config.ts
11894
- function triggerConfigValue(input, config) {
11895
- return inputValue(config[input.handle], input.value);
11896
- }
11897
- function missingTriggerConfig(inputs, config) {
11898
- return inputs.flatMap((input) => "handle" in input && !input.nullable && triggerConfigValue(input, config) === void 0 ? [input.handle] : []);
11899
- }
11900
- /** Resolves fixed inputs before a Provider sees them, using the same defaults/null semantics as node inputs. */
11901
- function resolveTriggerConfig(inputs, config) {
11902
- const fields = inputs.filter((input) => "handle" in input);
11903
- const handles = new Set(fields.map((input) => input.handle));
11904
- if (handles.size !== fields.length) throw new TypeError("Trigger config has duplicate input handles.");
11905
- const unknown = Object.keys(config).find((handle) => !handles.has(handle));
11906
- if (unknown != null) throw new TypeError(`Unknown Trigger config input "${unknown}".`);
11907
- const resolved = Object.fromEntries(fields.map((input) => {
11908
- const value = triggerConfigValue(input, config) ?? null;
11909
- if (!(value === null && input.nullable) && !matchesSchema(value, input.jsonSchema)) throw new TypeError(`Trigger config input "${input.handle}" does not match its declared schema.`);
11910
- return [input.handle, value];
11911
- }));
11912
- if (new TextEncoder().encode(JSON.stringify(resolved)).byteLength > 65536) throw new TypeError("Trigger config exceeds the 65536-byte limit.");
11913
- return resolved;
11914
- }
11915
- //#endregion
11916
11939
  //#region src/flow/common/sourceField.ts
11917
11940
  /** Only explicitly declared, first-level object properties are selectable. */
11918
11941
  function sourceFields(output) {
@@ -12194,18 +12217,13 @@ function mappingAvailable(graph, target, mapping, analysis) {
12194
12217
  if (target != null && mapping.sources.some((source) => source.kind == "node" && isResolutionNode(graph.nodes[source.nodeId]) && !analysis.resolutionOutputs.get(target)?.has(resolutionOutputKey(source.nodeId, source.output)))) return false;
12195
12218
  const sources = mapping.sources.map((source) => sourcePaths(graph, paths, source));
12196
12219
  const targetPaths = target == null ? [{}] : paths.get(target) ?? [];
12197
- for (const [index, routes] of sources.entries()) for (const [offset, other] of sources.slice(index + 1).entries()) {
12198
- const leftSource = mapping.sources[index];
12199
- const rightSource = mapping.sources[index + offset + 1];
12200
- if (target != null && leftSource.kind == "node" && rightSource.kind == "node" && leftSource.nodeId != rightSource.nodeId && !ancestors.get(leftSource.nodeId)?.has(rightSource.nodeId) && !ancestors.get(rightSource.nodeId)?.has(leftSource.nodeId)) continue;
12201
- for (const left of routes) for (const targetRoute of targetPaths) {
12202
- if (!routesCompatible(left, targetRoute)) continue;
12203
- const path = {
12204
- ...targetRoute,
12205
- ...left
12206
- };
12207
- if (other.some((right) => routesCompatible(right, path))) return false;
12208
- }
12220
+ for (const [index, routes] of sources.entries()) for (const other of sources.slice(index + 1)) for (const left of routes) for (const targetRoute of targetPaths) {
12221
+ if (!routesCompatible(left, targetRoute)) continue;
12222
+ const path = {
12223
+ ...targetRoute,
12224
+ ...left
12225
+ };
12226
+ if (other.some((right) => routesCompatible(right, path))) return false;
12209
12227
  }
12210
12228
  return true;
12211
12229
  }
@@ -0,0 +1,23 @@
1
+ import type { JsonValue, RevisionContent } from '../browser/flow-change.js';
2
+ export interface WorkflowFile {
3
+ readonly kind: 'open-flow-workflow';
4
+ readonly version: 1;
5
+ readonly name?: string;
6
+ readonly content: RevisionContent;
7
+ readonly presentation?: Readonly<Record<string, JsonValue>>;
8
+ }
9
+ export interface WorkflowCleanupSummary {
10
+ readonly changedNodeIds: readonly string[];
11
+ readonly removedBindings: number;
12
+ }
13
+ /** Structural decoding only: incomplete drafts are supported, repair is never attempted. */
14
+ export declare function decodeWorkflowFile(value: unknown): WorkflowFile;
15
+ export declare function parseWorkflowFile(text: string): WorkflowFile;
16
+ /** Clear only owned structured references, never strings in code or business values. */
17
+ export declare function cleanWorkflowFile(value: unknown): {
18
+ readonly file: WorkflowFile;
19
+ readonly summary: WorkflowCleanupSummary;
20
+ };
21
+ export declare function encodeWorkflowFile(file: WorkflowFile): string;
22
+ export declare function workflowFileName(name: string): string;
23
+ export declare function workflowNameFromFile(name: string): string;
@@ -6808,7 +6808,8 @@ var managedFields = object({
6808
6808
  object({
6809
6809
  kind: literal("connector"),
6810
6810
  action: text,
6811
- connectionId: text.optional()
6811
+ connectionId: text.optional(),
6812
+ outputMode: literal("value").optional()
6812
6813
  }),
6813
6814
  object({
6814
6815
  kind: literal("openapi"),
@@ -8193,10 +8194,10 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
8193
8194
  }
8194
8195
  if (compiledEnum.length === 0) recordWarn(context, "all of elements from list is rejected by currently schema object", "enum");
8195
8196
  }
8196
- if (constValue && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
8197
+ if (constValue !== void 0 && valid(schema, constValue) === ValidResult.Invalid) isNever = true;
8197
8198
  if (compiledEnum) {
8198
8199
  if (compiledEnum.length === 0) isNever = true;
8199
- else if (constValue) {
8200
+ else if (constValue !== void 0) {
8200
8201
  let foundEquals = false;
8201
8202
  for (const enumValue of compiledEnum) if (isDeepEquals(enumValue, constValue)) {
8202
8203
  foundEquals = true;
@@ -8209,7 +8210,7 @@ function compileEnumAndConst(context, enumList, constValue, schema) {
8209
8210
  const compiledSchema = {};
8210
8211
  if (schema.type) compiledSchema.type = schema.type;
8211
8212
  if (compiledEnum) compiledSchema.enum = compiledEnum;
8212
- if (constValue) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
8213
+ if (constValue !== void 0) compiledSchema.const = wrapCompiledValue(deepCopy(constValue));
8213
8214
  return wrapCompiledSchema(kind, compiledSchema, context.delegate, context.path);
8214
8215
  }
8215
8216
  //#endregion
@@ -8604,7 +8605,7 @@ function compileSchema(context, schema) {
8604
8605
  let targetSchema = schema;
8605
8606
  let shouldHandleEnumAndConst = false;
8606
8607
  const { enum: enumList, const: constValue } = schema;
8607
- if (enumList || constValue) {
8608
+ if (enumList || constValue !== void 0) {
8608
8609
  const { enum: _0, const: _1, ...rest } = schema;
8609
8610
  targetSchema = rest;
8610
8611
  shouldHandleEnumAndConst = true;
@@ -9194,7 +9195,7 @@ function schemaEqualsChecker(extendsContext) {
9194
9195
  }
9195
9196
  function isValueEquals(value1, value2) {
9196
9197
  if (value1 === value2) return true;
9197
- if (value1 === null) return false;
9198
+ if (value1 === null || value2 === null) return false;
9198
9199
  if (typeof value1 !== "object") return false;
9199
9200
  if (typeof value1 !== typeof value2) return false;
9200
9201
  if (isCompiledSchema(value1) && isCompiledSchema(value2)) return isCompiledSchemaEquals(value1, value2);
@@ -9760,7 +9761,7 @@ function findMismatchPath(source, target) {
9760
9761
  if ((sourceSchema.maxProperties ?? Number.POSITIVE_INFINITY) > (targetSchema.maxProperties ?? Number.POSITIVE_INFINITY)) return [...targetPath, "maxProperties"];
9761
9762
  break;
9762
9763
  }
9763
- case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const == null ? "enum" : "const"];
9764
+ case CompiledKind.EnumOrConst: return [...targetPath, targetSchema.const === void 0 ? "enum" : "const"];
9764
9765
  }
9765
9766
  return targetPath;
9766
9767
  }
@@ -21,3 +21,4 @@ export declare function isCjkLanguage(language: string): boolean;
21
21
  export declare function userLocaleFallbackChain(language: string): readonly string[];
22
22
  /** Resolve metadata query/header preferences using the same language mapping as the UI. */
23
23
  export declare function resolveMetadataLanguage(query: string | undefined, acceptLanguage?: string): UiLanguage;
24
+ export declare function importedWorkflowName(language: UiLanguage): string;
@@ -124,5 +124,16 @@ function resolveMetadataLanguage(query, acceptLanguage) {
124
124
  }];
125
125
  }).toSorted((a, b) => b.q - a.q || a.order - b.order)[0]?.language ?? "en";
126
126
  }
127
+ function importedWorkflowName(language) {
128
+ return {
129
+ "en": "Imported workflow",
130
+ "zh-CN": "导入的工作流",
131
+ "zh-TW": "匯入的工作流",
132
+ "ja": "インポートしたワークフロー",
133
+ "ko": "가져온 워크플로",
134
+ "fr": "Workflow importé",
135
+ "ru": "Импортированный процесс"
136
+ }[language];
137
+ }
127
138
  //#endregion
128
- export { defaultUiLanguage, isCjkLanguage, isUiLanguage, resolveMetadataLanguage, resolveUiLanguage, uiLanguageNames, uiLanguages, userLocaleFallbackChain };
139
+ export { defaultUiLanguage, importedWorkflowName, isCjkLanguage, isUiLanguage, resolveMetadataLanguage, resolveUiLanguage, uiLanguageNames, uiLanguages, userLocaleFallbackChain };
@@ -164,6 +164,67 @@ export declare const mcpTools: {
164
164
  };
165
165
  };
166
166
  };
167
+ flow_export: {
168
+ description: string;
169
+ annotations: {
170
+ readOnlyHint: boolean;
171
+ destructiveHint: boolean;
172
+ idempotentHint: boolean;
173
+ openWorldHint: boolean;
174
+ };
175
+ inputSchema: {
176
+ '~standard': {
177
+ version: 1;
178
+ vendor: string;
179
+ jsonSchema: {
180
+ input: () => Record<string, unknown>;
181
+ output: () => Record<string, unknown>;
182
+ };
183
+ validate(value: unknown): {
184
+ value: {
185
+ flowId: string;
186
+ };
187
+ } | {
188
+ issues: {
189
+ message: string;
190
+ path: string[];
191
+ }[];
192
+ };
193
+ };
194
+ };
195
+ };
196
+ flow_import: {
197
+ description: string;
198
+ annotations: {
199
+ readOnlyHint: boolean;
200
+ destructiveHint: boolean;
201
+ idempotentHint: boolean;
202
+ openWorldHint: boolean;
203
+ };
204
+ inputSchema: {
205
+ '~standard': {
206
+ version: 1;
207
+ vendor: string;
208
+ jsonSchema: {
209
+ input: () => Record<string, unknown>;
210
+ output: () => Record<string, unknown>;
211
+ };
212
+ validate(value: unknown): {
213
+ value: {
214
+ file: JsonValue;
215
+ name?: string | undefined;
216
+ teamId?: string | undefined;
217
+ idempotencyKey: string;
218
+ };
219
+ } | {
220
+ issues: {
221
+ message: string;
222
+ path: string[];
223
+ }[];
224
+ };
225
+ };
226
+ };
227
+ };
167
228
  flow_create: {
168
229
  description: string;
169
230
  annotations: {