@oomol-lab/open-flow 0.1.0-beta.66 → 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 (36) hide show
  1. package/dist/browser/{createResourceDialog-C-Si_cYs.js → createResourceDialog-BQVD8Rqb.js} +2 -2
  2. package/dist/browser/{icons-BD3m0RQq.js → dialog-CS2Vt2if.js} +1225 -1224
  3. package/dist/browser/event-sources.d.ts +4 -1
  4. package/dist/browser/flow-authoring-node.d.ts +2 -0
  5. package/dist/browser/flow-authoring.js +6 -5
  6. package/dist/browser/flow-change.js +6 -5
  7. package/dist/browser/{flowChanges-T4_R5p1f.js → flowChanges-VB9Y4iy7.js} +2186 -1939
  8. package/dist/browser/{flowWorkspace-C0J5C0oM.js → flowWorkspace-C1hlTnZq.js} +801 -666
  9. package/dist/browser/preview.css +121 -55
  10. package/dist/browser/preview.js +34156 -33896
  11. package/dist/browser/theme.css +1 -0
  12. package/dist/browser/ui.css +34 -4
  13. package/dist/browser/workbench-contract.d.ts +1 -1
  14. package/dist/browser/workbench.css +130 -98
  15. package/dist/browser/workbench.d.ts +0 -1
  16. package/dist/browser/workbench.js +361 -120
  17. package/dist/browser/{workbenchSelect-B-PFpF_Q.js → workbenchSelect-CpXhjUou.js} +1 -1
  18. package/dist/command/index.js +25 -25
  19. package/dist/common/authoringExamples.d.ts +2 -2
  20. package/dist/common/control-api-conformance.js +31 -9
  21. package/dist/common/control-api.d.ts +4 -1
  22. package/dist/common/control-api.js +15 -5
  23. package/dist/common/control-requests.js +7 -6
  24. package/dist/common/decision.js +5 -4
  25. package/dist/common/flow-encoding.js +7 -4
  26. package/dist/common/flow-semantics.js +11 -8
  27. package/dist/common/integration-trigger.js +5 -4
  28. package/dist/common/mcp.js +16 -6
  29. package/dist/common/openapi.js +5 -4
  30. package/dist/common/poll-trigger.js +5 -4
  31. package/dist/common/scheduler.js +5 -4
  32. package/dist/common/webhook-trigger.js +5 -4
  33. package/dist/common/workflow.js +5 -4
  34. package/package.json +1 -1
  35. package/skills/open-flow/SKILL.md +9 -0
  36. package/skills/open-flow/references/flow-authoring.md +2 -0
@@ -8,7 +8,7 @@ declare const descriptions: {
8
8
  readonly integration: 'Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.';
9
9
  readonly decision: 'AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running.';
10
10
  readonly openapi: 'A fixed JSON API operation. Replace the example document and URL before running.';
11
- readonly connector: 'A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show.';
11
+ readonly connector: 'A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show. Set connectionId to an empty string to defer account configuration; execution will require an account.';
12
12
  readonly code: 'A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions.';
13
13
  readonly condition: 'A condition with true and false execution branches.';
14
14
  readonly value: 'A fixed value node.';
@@ -22,7 +22,7 @@ declare const descriptions: {
22
22
  export declare const authoringExampleNames: (keyof typeof descriptions)[];
23
23
  export declare const authoringExamples: {
24
24
  name: "agent" | "approval" | "code" | "condition" | "connector" | "cron" | "decision" | "error" | "integration" | "llm-chat" | "llm-json" | "openapi" | "poll" | "poll-notification" | "start" | "value" | "wait" | "webhook";
25
- description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show." | "A Flow Error node. Select upstream Flows, then publish and enable this Flow to listen for failures in their automatic runs." | "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions." | "A Start node with a required message parameter. Supply it through trigger.outputs." | "A Wait with a continue action and a built-in notification output." | "A Webhook start node." | "A condition with true and false execution branches." | "A fixed JSON API operation. Replace the example document and URL before running." | "A fixed value node." | "AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running." | "An Agent with code computation enabled. Configure a model available in the deployment." | "An Approval with approve and reject decision branches and a built-in notification output." | "An LLM JSON Task and its node; configure a model available in the deployment." | "An LLM chat Task and its node; configure a model available in the deployment." | "An hourly scheduled start node." | "Gmail events → JavaScript text formatting → Connector notification. Replace connection/action IDs and match the notification input ports." | "Gmail polling by key; replace CONNECTION_ID with an active Gmail connection." | "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.";
25
+ description: "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show. Set connectionId to an empty string to defer account configuration; execution will require an account." | "A Flow Error node. Select upstream Flows, then publish and enable this Flow to listen for failures in their automatic runs." | "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions." | "A Start node with a required message parameter. Supply it through trigger.outputs." | "A Wait with a continue action and a built-in notification output." | "A Webhook start node." | "A condition with true and false execution branches." | "A fixed JSON API operation. Replace the example document and URL before running." | "A fixed value node." | "AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running." | "An Agent with code computation enabled. Configure a model available in the deployment." | "An Approval with approve and reject decision branches and a built-in notification output." | "An LLM JSON Task and its node; configure a model available in the deployment." | "An LLM chat Task and its node; configure a model available in the deployment." | "An hourly scheduled start node." | "Gmail events → JavaScript text formatting → Connector notification. Replace connection/action IDs and match the notification input ports." | "Gmail polling by key; replace CONNECTION_ID with an active Gmail connection." | "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.";
26
26
  }[];
27
27
  export declare function authoringExample(name: string): {
28
28
  version: 1;
@@ -8579,6 +8579,7 @@ function webhookSupportsBody(method) {
8579
8579
  return method !== "GET";
8580
8580
  }
8581
8581
  var text = string$1();
8582
+ 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.");
8582
8583
  var json$3 = json$4();
8583
8584
  var strings$1 = array(text);
8584
8585
  var port$1 = object({
@@ -8634,7 +8635,7 @@ var capability = union([
8634
8635
  mode: literal("independent"),
8635
8636
  actions: array(strictObject({
8636
8637
  action: text,
8637
- connectionId: text.optional()
8638
+ connectionId: actionConnection.optional()
8638
8639
  }))
8639
8640
  }),
8640
8641
  strictObject({
@@ -8694,7 +8695,7 @@ var managedFields = object({
8694
8695
  object({
8695
8696
  kind: literal("connector"),
8696
8697
  action: text,
8697
- connectionId: text.optional(),
8698
+ connectionId: actionConnection.optional(),
8698
8699
  outputMode: literal("value").optional()
8699
8700
  }),
8700
8701
  object({
@@ -8734,13 +8735,13 @@ var managedFields = object({
8734
8735
  name: text,
8735
8736
  description: text,
8736
8737
  action: text,
8737
- connectionId: text.optional(),
8738
+ connectionId: actionConnection.optional(),
8738
8739
  approval: boolean(),
8739
8740
  inputs: array(input.extend({ source: agentInput }))
8740
8741
  })),
8741
8742
  notification: object({
8742
8743
  action: text,
8743
- connectionId: text.optional(),
8744
+ connectionId: actionConnection.optional(),
8744
8745
  inputDefinitions: array(input),
8745
8746
  messageHandle: text,
8746
8747
  inputs: record$3(text, agentValue)
@@ -10891,6 +10892,15 @@ function flow(value) {
10891
10892
  version: 1
10892
10893
  };
10893
10894
  }
10895
+ function flowListItem(value) {
10896
+ const source = record$1(value);
10897
+ const referenceCount = integer(source.referenceCount);
10898
+ if (referenceCount < 0) return invalidResponse();
10899
+ return {
10900
+ ...flow(source),
10901
+ referenceCount
10902
+ };
10903
+ }
10894
10904
  function flowPage(value) {
10895
10905
  const source = record$1(value);
10896
10906
  if (source.version != 1 || !Array.isArray(source.flows)) return invalidResponse();
@@ -10900,7 +10910,7 @@ function flowPage(value) {
10900
10910
  if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
10901
10911
  return {
10902
10912
  ...nextCursor == null ? {} : { nextCursor },
10903
- flows: source.flows.map(flow),
10913
+ flows: source.flows.map(flowListItem),
10904
10914
  ...total == null ? {} : { total },
10905
10915
  version: 1
10906
10916
  };
@@ -12712,13 +12722,22 @@ var controlApiConformanceCases = [
12712
12722
  await error(await createFlowRequest(harness, "Different flow", "flow-lifecycle"), 409, "flow.conflict", "Conflicting Flow");
12713
12723
  equal(await json(await request(harness, `/v1/flows/${flowId}`), 200, "Read Flow"), created, "Read Flow");
12714
12724
  const page = await json(await request(harness, "/v1/flows?includeTotal=true"), 200, "List Flows");
12715
- equal(page.flows, [created], "Listed Flows");
12725
+ equal(page.flows, [{
12726
+ ...created,
12727
+ referenceCount: 0
12728
+ }], "Listed Flows");
12716
12729
  equal(page.total, 1, "Flow total");
12717
12730
  const second = await createFlow(harness, "Second control flow", "flow-lifecycle-second");
12718
12731
  const firstPage = await json(await request(harness, "/v1/flows?limit=1"), 200, "List first Flow page");
12719
- equal(firstPage.flows, [created], "First Flow page");
12732
+ equal(firstPage.flows, [{
12733
+ ...created,
12734
+ referenceCount: 0
12735
+ }], "First Flow page");
12720
12736
  const cursor = requiredString(firstPage.nextCursor, "Flow cursor");
12721
- equal((await json(await request(harness, `/v1/flows?limit=1&cursor=${encodeURIComponent(cursor)}`), 200, "List second Flow page")).flows, [second], "Second Flow page");
12737
+ equal((await json(await request(harness, `/v1/flows?limit=1&cursor=${encodeURIComponent(cursor)}`), 200, "List second Flow page")).flows, [{
12738
+ ...second,
12739
+ referenceCount: 0
12740
+ }], "Second Flow page");
12722
12741
  equal((await json(await request(harness, `/v1/flows/${flowId}`, {
12723
12742
  body: JSON.stringify({
12724
12743
  name: "Renamed flow",
@@ -13259,7 +13278,10 @@ var publicationControlApiConformanceCases = [
13259
13278
  publicationId,
13260
13279
  revisionId
13261
13280
  }, "Disabled summary");
13262
- equal((await json(await request(harness, "/v1/flows"), 200, "List disabled Flow")).flows, [disabled], "List includes Live state");
13281
+ equal((await json(await request(harness, "/v1/flows"), 200, "List disabled Flow")).flows, [{
13282
+ ...disabled,
13283
+ referenceCount: 0
13284
+ }], "List includes Live state");
13263
13285
  equal((await json(await request(harness, `/v1/flows/${flowId}/live`), 200, "Disabled Live")).status, "suspended", "Disabled Live status");
13264
13286
  await error(await liveRunRequest(harness, publicationId, "disabled-run"), 412, "live.conflict", "Disabled Live rejects Run");
13265
13287
  await json(await request(harness, `/v1/flows/${flowId}/revisions/${revisionId}/runs`, {
@@ -86,8 +86,11 @@ export interface Presentation {
86
86
  readonly value: Readonly<Record<string, JsonValue>>;
87
87
  readonly version: 1;
88
88
  }
89
+ export interface FlowListItem extends Flow {
90
+ readonly referenceCount: number;
91
+ }
89
92
  export interface FlowPage {
90
- readonly flows: readonly Flow[];
93
+ readonly flows: readonly FlowListItem[];
91
94
  readonly nextCursor?: string;
92
95
  readonly total?: number;
93
96
  readonly version: 1;
@@ -5823,6 +5823,7 @@ function webhookSupportsBody(method) {
5823
5823
  return method !== "GET";
5824
5824
  }
5825
5825
  var text = string$1();
5826
+ 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.");
5826
5827
  var json$2 = json$3();
5827
5828
  var strings$1 = array(text);
5828
5829
  var port$1 = object({
@@ -5878,7 +5879,7 @@ var capability = union([
5878
5879
  mode: literal("independent"),
5879
5880
  actions: array(strictObject({
5880
5881
  action: text,
5881
- connectionId: text.optional()
5882
+ connectionId: actionConnection.optional()
5882
5883
  }))
5883
5884
  }),
5884
5885
  strictObject({
@@ -5938,7 +5939,7 @@ var managedFields = object({
5938
5939
  object({
5939
5940
  kind: literal("connector"),
5940
5941
  action: text,
5941
- connectionId: text.optional(),
5942
+ connectionId: actionConnection.optional(),
5942
5943
  outputMode: literal("value").optional()
5943
5944
  }),
5944
5945
  object({
@@ -5978,13 +5979,13 @@ var managedFields = object({
5978
5979
  name: text,
5979
5980
  description: text,
5980
5981
  action: text,
5981
- connectionId: text.optional(),
5982
+ connectionId: actionConnection.optional(),
5982
5983
  approval: boolean(),
5983
5984
  inputs: array(input.extend({ source: agentInput }))
5984
5985
  })),
5985
5986
  notification: object({
5986
5987
  action: text,
5987
- connectionId: text.optional(),
5988
+ connectionId: actionConnection.optional(),
5988
5989
  inputDefinitions: array(input),
5989
5990
  messageHandle: text,
5990
5991
  inputs: record$2(text, agentValue)
@@ -11538,6 +11539,15 @@ function flow(value) {
11538
11539
  version: 1
11539
11540
  };
11540
11541
  }
11542
+ function flowListItem(value) {
11543
+ const source = record(value);
11544
+ const referenceCount = integer(source.referenceCount);
11545
+ if (referenceCount < 0) return invalidResponse();
11546
+ return {
11547
+ ...flow(source),
11548
+ referenceCount
11549
+ };
11550
+ }
11541
11551
  function flowPage(value) {
11542
11552
  const source = record(value);
11543
11553
  if (source.version != 1 || !Array.isArray(source.flows)) return invalidResponse();
@@ -11547,7 +11557,7 @@ function flowPage(value) {
11547
11557
  if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
11548
11558
  return {
11549
11559
  ...nextCursor == null ? {} : { nextCursor },
11550
- flows: source.flows.map(flow),
11560
+ flows: source.flows.map(flowListItem),
11551
11561
  ...total == null ? {} : { total },
11552
11562
  version: 1
11553
11563
  };
@@ -6887,7 +6887,7 @@ function decodeConnectorCapabilities(value) {
6887
6887
  const actions = source.actions.map((entry) => {
6888
6888
  if (entry == null || typeof entry != "object" || Array.isArray(entry)) throw new TypeError("Invalid Connector Action.");
6889
6889
  const action = entry;
6890
- if (Object.keys(action).some((key) => !["action", "connectionId"].includes(key)) || typeof action.action != "string" || !/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(action.action) || Object.hasOwn(action, "connectionId") && (typeof action.connectionId != "string" || action.connectionId.length == 0)) throw new TypeError("Invalid Connector Action permission.");
6890
+ if (Object.keys(action).some((key) => !["action", "connectionId"].includes(key)) || typeof action.action != "string" || !/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(action.action) || Object.hasOwn(action, "connectionId") && typeof action.connectionId != "string") throw new TypeError("Invalid Connector Action permission.");
6891
6891
  return action.connectionId == null ? { action: action.action } : {
6892
6892
  action: action.action,
6893
6893
  connectionId: action.connectionId
@@ -10423,6 +10423,7 @@ function webhookSupportsBody(method) {
10423
10423
  return method !== "GET";
10424
10424
  }
10425
10425
  var text$1 = string();
10426
+ var actionConnection = text$1.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.");
10426
10427
  var json$4 = json$5();
10427
10428
  var strings = array(text$1);
10428
10429
  var port = object$1({
@@ -10478,7 +10479,7 @@ var capability = union([
10478
10479
  mode: literal("independent"),
10479
10480
  actions: array(strictObject({
10480
10481
  action: text$1,
10481
- connectionId: text$1.optional()
10482
+ connectionId: actionConnection.optional()
10482
10483
  }))
10483
10484
  }),
10484
10485
  strictObject({
@@ -10538,7 +10539,7 @@ var managedFields = object$1({
10538
10539
  object$1({
10539
10540
  kind: literal("connector"),
10540
10541
  action: text$1,
10541
- connectionId: text$1.optional(),
10542
+ connectionId: actionConnection.optional(),
10542
10543
  outputMode: literal("value").optional()
10543
10544
  }),
10544
10545
  object$1({
@@ -10578,13 +10579,13 @@ var managedFields = object$1({
10578
10579
  name: text$1,
10579
10580
  description: text$1,
10580
10581
  action: text$1,
10581
- connectionId: text$1.optional(),
10582
+ connectionId: actionConnection.optional(),
10582
10583
  approval: boolean(),
10583
10584
  inputs: array(input.extend({ source: agentInput }))
10584
10585
  })),
10585
10586
  notification: object$1({
10586
10587
  action: text$1,
10587
- connectionId: text$1.optional(),
10588
+ connectionId: actionConnection.optional(),
10588
10589
  inputDefinitions: array(input),
10589
10590
  messageHandle: text$1,
10590
10591
  inputs: record$3(text$1, agentValue)
@@ -14170,7 +14171,7 @@ var descriptions = {
14170
14171
  "integration": "Telegram webhook integration by key; replace CONNECTION_ID with an active Telegram connection.",
14171
14172
  "decision": "AI Decision evaluates named questions against target and returns a complete answer object per output. Configure target before running.",
14172
14173
  "openapi": "A fixed JSON API operation. Replace the example document and URL before running.",
14173
- "connector": "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show.",
14174
+ "connector": "A Connector Task and its node. Replace ACTION_ID, CONNECTION_ID and port definitions using connector_get / connector show. Set connectionId to an empty string to defer account configuration; execution will require an account.",
14174
14175
  "code": "A JavaScript module and its node. Use Code for custom computation; use Connector Tasks for existing actions.",
14175
14176
  "condition": "A condition with true and false execution branches.",
14176
14177
  "value": "A fixed value node.",
@@ -6597,6 +6597,7 @@ var webhookMethods = [
6597
6597
  "DELETE"
6598
6598
  ];
6599
6599
  var text = string();
6600
+ 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.");
6600
6601
  var json = json$1();
6601
6602
  var strings = array(text);
6602
6603
  var port = object({
@@ -6652,7 +6653,7 @@ var capability = union([
6652
6653
  mode: literal("independent"),
6653
6654
  actions: array(strictObject({
6654
6655
  action: text,
6655
- connectionId: text.optional()
6656
+ connectionId: actionConnection.optional()
6656
6657
  }))
6657
6658
  }),
6658
6659
  strictObject({
@@ -6712,7 +6713,7 @@ var managedFields = object({
6712
6713
  object({
6713
6714
  kind: literal("connector"),
6714
6715
  action: text,
6715
- connectionId: text.optional(),
6716
+ connectionId: actionConnection.optional(),
6716
6717
  outputMode: literal("value").optional()
6717
6718
  }),
6718
6719
  object({
@@ -6752,13 +6753,13 @@ var managedFields = object({
6752
6753
  name: text,
6753
6754
  description: text,
6754
6755
  action: text,
6755
- connectionId: text.optional(),
6756
+ connectionId: actionConnection.optional(),
6756
6757
  approval: boolean(),
6757
6758
  inputs: array(input.extend({ source: agentInput }))
6758
6759
  })),
6759
6760
  notification: object({
6760
6761
  action: text,
6761
- connectionId: text.optional(),
6762
+ connectionId: actionConnection.optional(),
6762
6763
  inputDefinitions: array(input),
6763
6764
  messageHandle: text,
6764
6765
  inputs: record$1(text, agentValue)
@@ -8579,6 +8579,7 @@ var webhookMethods = [
8579
8579
  "DELETE"
8580
8580
  ];
8581
8581
  var text = string();
8582
+ 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.");
8582
8583
  var json = json$1();
8583
8584
  var strings = array(text);
8584
8585
  var port = object({
@@ -8634,7 +8635,7 @@ var capability = union([
8634
8635
  mode: literal("independent"),
8635
8636
  actions: array(strictObject({
8636
8637
  action: text,
8637
- connectionId: text.optional()
8638
+ connectionId: actionConnection.optional()
8638
8639
  }))
8639
8640
  }),
8640
8641
  strictObject({
@@ -8694,7 +8695,7 @@ var managedFields = object({
8694
8695
  object({
8695
8696
  kind: literal("connector"),
8696
8697
  action: text,
8697
- connectionId: text.optional(),
8698
+ connectionId: actionConnection.optional(),
8698
8699
  outputMode: literal("value").optional()
8699
8700
  }),
8700
8701
  object({
@@ -8734,13 +8735,13 @@ var managedFields = object({
8734
8735
  name: text,
8735
8736
  description: text,
8736
8737
  action: text,
8737
- connectionId: text.optional(),
8738
+ connectionId: actionConnection.optional(),
8738
8739
  approval: boolean(),
8739
8740
  inputs: array(input.extend({ source: agentInput }))
8740
8741
  })),
8741
8742
  notification: object({
8742
8743
  action: text,
8743
- connectionId: text.optional(),
8744
+ connectionId: actionConnection.optional(),
8744
8745
  inputDefinitions: array(input),
8745
8746
  messageHandle: text,
8746
8747
  inputs: record$1(text, agentValue)
@@ -9522,6 +9523,7 @@ function clearNodeConnections(graph, connectionId) {
9522
9523
  if ("executor" in node.task) {
9523
9524
  const executor = node.task.executor;
9524
9525
  const clear = (value) => {
9526
+ if (value.connectionId === "") return value;
9525
9527
  if (connectionId != null && value.connectionId != connectionId) return value;
9526
9528
  const { connectionId: _, ...rest } = value;
9527
9529
  return rest;
@@ -9566,6 +9568,7 @@ function clearNodeConnections(graph, connectionId) {
9566
9568
  return {
9567
9569
  ...capability,
9568
9570
  actions: capability.actions.map((action) => {
9571
+ if (action.connectionId === "") return action;
9569
9572
  if (connectionId != null && action.connectionId != connectionId) return action;
9570
9573
  const { connectionId: _, ...remaining } = action;
9571
9574
  return remaining;
@@ -6611,6 +6611,7 @@ function webhookSupportsBody(method) {
6611
6611
  return method !== "GET";
6612
6612
  }
6613
6613
  var text = string();
6614
+ 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.");
6614
6615
  var json = json$1();
6615
6616
  var strings = array(text);
6616
6617
  var port = object$1({
@@ -6666,7 +6667,7 @@ var capability = union([
6666
6667
  mode: literal("independent"),
6667
6668
  actions: array(strictObject({
6668
6669
  action: text,
6669
- connectionId: text.optional()
6670
+ connectionId: actionConnection.optional()
6670
6671
  }))
6671
6672
  }),
6672
6673
  strictObject({
@@ -6726,7 +6727,7 @@ var managedFields = object$1({
6726
6727
  object$1({
6727
6728
  kind: literal("connector"),
6728
6729
  action: text,
6729
- connectionId: text.optional(),
6730
+ connectionId: actionConnection.optional(),
6730
6731
  outputMode: literal("value").optional()
6731
6732
  }),
6732
6733
  object$1({
@@ -6766,13 +6767,13 @@ var managedFields = object$1({
6766
6767
  name: text,
6767
6768
  description: text,
6768
6769
  action: text,
6769
- connectionId: text.optional(),
6770
+ connectionId: actionConnection.optional(),
6770
6771
  approval: boolean(),
6771
6772
  inputs: array(input.extend({ source: agentInput$1 }))
6772
6773
  })),
6773
6774
  notification: object$1({
6774
6775
  action: text,
6775
- connectionId: text.optional(),
6776
+ connectionId: actionConnection.optional(),
6776
6777
  inputDefinitions: array(input),
6777
6778
  messageHandle: text,
6778
6779
  inputs: record$1(text, agentValue)
@@ -7367,7 +7368,7 @@ function decodeConnectorCapabilities(value) {
7367
7368
  const actions = source.actions.map((entry) => {
7368
7369
  if (entry == null || typeof entry != "object" || Array.isArray(entry)) throw new TypeError("Invalid Connector Action.");
7369
7370
  const action = entry;
7370
- if (Object.keys(action).some((key) => !["action", "connectionId"].includes(key)) || typeof action.action != "string" || !/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(action.action) || Object.hasOwn(action, "connectionId") && (typeof action.connectionId != "string" || action.connectionId.length == 0)) throw new TypeError("Invalid Connector Action permission.");
7371
+ if (Object.keys(action).some((key) => !["action", "connectionId"].includes(key)) || typeof action.action != "string" || !/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(action.action) || Object.hasOwn(action, "connectionId") && typeof action.connectionId != "string") throw new TypeError("Invalid Connector Action permission.");
7371
7372
  return action.connectionId == null ? { action: action.action } : {
7372
7373
  action: action.action,
7373
7374
  connectionId: action.connectionId
@@ -11097,6 +11098,7 @@ function clearNodeConnections(graph, connectionId) {
11097
11098
  if ("executor" in node.task) {
11098
11099
  const executor = node.task.executor;
11099
11100
  const clear = (value) => {
11101
+ if (value.connectionId === "") return value;
11100
11102
  if (connectionId != null && value.connectionId != connectionId) return value;
11101
11103
  const { connectionId: _, ...rest } = value;
11102
11104
  return rest;
@@ -11141,6 +11143,7 @@ function clearNodeConnections(graph, connectionId) {
11141
11143
  return {
11142
11144
  ...capability,
11143
11145
  actions: capability.actions.map((action) => {
11146
+ if (action.connectionId === "") return action;
11144
11147
  if (connectionId != null && action.connectionId != connectionId) return action;
11145
11148
  const { connectionId: _, ...remaining } = action;
11146
11149
  return remaining;
@@ -11606,7 +11609,7 @@ function agentConfigIssues(task) {
11606
11609
  ids.add(tool.id);
11607
11610
  names.add(tool.name);
11608
11611
  if (tool.description.trim().length == 0) issues.push(`Tool ${tool.name} requires a description.`);
11609
- if (!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(tool.action) || tool.connectionId === "") issues.push(`Tool ${tool.name} has an invalid Action or Connection.`);
11612
+ if (!/^[A-Za-z0-9_-]+\.[A-Za-z0-9_.-]+$/.test(tool.action)) issues.push(`Tool ${tool.name} has an invalid Action or Connection.`);
11610
11613
  const fields = /* @__PURE__ */ new Set();
11611
11614
  for (const port of tool.inputs) {
11612
11615
  if (port.handle.length == 0 || fields.has(port.handle)) issues.push(`Tool ${tool.name} has an empty or duplicate input.`);
@@ -24177,7 +24180,7 @@ function variableBindings(revision, bindingIds) {
24177
24180
  function flowResourceReferences(content) {
24178
24181
  const connections = /* @__PURE__ */ new Map();
24179
24182
  for (const use of connectionUsage(content.document)) {
24180
- if (use.connectionId == null) continue;
24183
+ if (use.connectionId == null || use.connectionId === "") continue;
24181
24184
  connections.set(JSON.stringify([use.providerId, use.connectionId]), {
24182
24185
  providerId: use.providerId,
24183
24186
  connectionId: use.connectionId
@@ -24432,7 +24435,7 @@ function agentActions(flow) {
24432
24435
  const task = node.task;
24433
24436
  if (task.executor.kind != "agent") return [];
24434
24437
  const notice = task.executor.notification;
24435
- return [...task.executor.tools, ...notice != null ? [notice] : []].map((tool) => ({
24438
+ return [...task.executor.tools, ...notice != null ? [notice] : []].filter((tool) => tool.connectionId !== "").map((tool) => ({
24436
24439
  kind: "connector",
24437
24440
  action: tool.action,
24438
24441
  connections: tool.connectionId == null ? [] : [{ connectionId: tool.connectionId }]
@@ -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({
@@ -6749,7 +6750,7 @@ var capability = union([
6749
6750
  mode: literal("independent"),
6750
6751
  actions: array(strictObject({
6751
6752
  action: text,
6752
- connectionId: text.optional()
6753
+ connectionId: actionConnection.optional()
6753
6754
  }))
6754
6755
  }),
6755
6756
  strictObject({
@@ -6809,7 +6810,7 @@ var managedFields = object({
6809
6810
  object({
6810
6811
  kind: literal("connector"),
6811
6812
  action: text,
6812
- connectionId: text.optional(),
6813
+ connectionId: actionConnection.optional(),
6813
6814
  outputMode: literal("value").optional()
6814
6815
  }),
6815
6816
  object({
@@ -6849,13 +6850,13 @@ var managedFields = object({
6849
6850
  name: text,
6850
6851
  description: text,
6851
6852
  action: text,
6852
- connectionId: text.optional(),
6853
+ connectionId: actionConnection.optional(),
6853
6854
  approval: boolean(),
6854
6855
  inputs: array(input.extend({ source: agentInput }))
6855
6856
  })),
6856
6857
  notification: object({
6857
6858
  action: text,
6858
- connectionId: text.optional(),
6859
+ connectionId: actionConnection.optional(),
6859
6860
  inputDefinitions: array(input),
6860
6861
  messageHandle: text,
6861
6862
  inputs: record$2(text, agentValue)
@@ -6037,6 +6037,7 @@ function webhookSupportsBody(method) {
6037
6037
  return method !== "GET";
6038
6038
  }
6039
6039
  var text = string$1();
6040
+ 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.");
6040
6041
  var json$3 = json$4();
6041
6042
  var strings$1 = array(text);
6042
6043
  var port$1 = object({
@@ -6092,7 +6093,7 @@ var capability = union([
6092
6093
  mode: literal("independent"),
6093
6094
  actions: array(strictObject({
6094
6095
  action: text,
6095
- connectionId: text.optional()
6096
+ connectionId: actionConnection.optional()
6096
6097
  }))
6097
6098
  }),
6098
6099
  strictObject({
@@ -6152,7 +6153,7 @@ var managedFields = object({
6152
6153
  object({
6153
6154
  kind: literal("connector"),
6154
6155
  action: text,
6155
- connectionId: text.optional(),
6156
+ connectionId: actionConnection.optional(),
6156
6157
  outputMode: literal("value").optional()
6157
6158
  }),
6158
6159
  object({
@@ -6192,13 +6193,13 @@ var managedFields = object({
6192
6193
  name: text,
6193
6194
  description: text,
6194
6195
  action: text,
6195
- connectionId: text.optional(),
6196
+ connectionId: actionConnection.optional(),
6196
6197
  approval: boolean(),
6197
6198
  inputs: array(input.extend({ source: agentInput }))
6198
6199
  })),
6199
6200
  notification: object({
6200
6201
  action: text,
6201
- connectionId: text.optional(),
6202
+ connectionId: actionConnection.optional(),
6202
6203
  inputDefinitions: array(input),
6203
6204
  messageHandle: text,
6204
6205
  inputs: record$2(text, agentValue)
@@ -11093,6 +11094,15 @@ function flow$1(value) {
11093
11094
  version: 1
11094
11095
  };
11095
11096
  }
11097
+ function flowListItem(value) {
11098
+ const source = record(value);
11099
+ const referenceCount = integer(source.referenceCount);
11100
+ if (referenceCount < 0) return invalidResponse();
11101
+ return {
11102
+ ...flow$1(source),
11103
+ referenceCount
11104
+ };
11105
+ }
11096
11106
  function flowPage(value) {
11097
11107
  const source = record(value);
11098
11108
  if (source.version != 1 || !Array.isArray(source.flows)) return invalidResponse();
@@ -11102,7 +11112,7 @@ function flowPage(value) {
11102
11112
  if (total != null && !Number.isSafeInteger(total)) return invalidResponse();
11103
11113
  return {
11104
11114
  ...nextCursor == null ? {} : { nextCursor },
11105
- flows: source.flows.map(flow$1),
11115
+ flows: source.flows.map(flowListItem),
11106
11116
  ...total == null ? {} : { total },
11107
11117
  version: 1
11108
11118
  };
@@ -12565,7 +12575,7 @@ var mutationKey = id.max(256).describe("Stable identity for this mutation. Retry
12565
12575
  var pageLimit = int().min(1).max(100).default(50);
12566
12576
  var flow = id.describe("Exact Flow ID returned by flow_list or flow_create.");
12567
12577
  var run = id.describe("Exact Run ID returned by flow_run or run_list.");
12568
- var mcpInstructions = "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.";
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.";
12569
12579
  function tool(description, schema, readOnly, idempotent = true) {
12570
12580
  return {
12571
12581
  description,
@@ -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({
@@ -6742,7 +6743,7 @@ var capability = union([
6742
6743
  mode: literal("independent"),
6743
6744
  actions: array(strictObject({
6744
6745
  action: text,
6745
- connectionId: text.optional()
6746
+ connectionId: actionConnection.optional()
6746
6747
  }))
6747
6748
  }),
6748
6749
  strictObject({
@@ -6802,7 +6803,7 @@ var managedFields = object$1({
6802
6803
  object$1({
6803
6804
  kind: literal("connector"),
6804
6805
  action: text,
6805
- connectionId: text.optional(),
6806
+ connectionId: actionConnection.optional(),
6806
6807
  outputMode: literal("value").optional()
6807
6808
  }),
6808
6809
  object$1({
@@ -6842,13 +6843,13 @@ var managedFields = object$1({
6842
6843
  name: text,
6843
6844
  description: text,
6844
6845
  action: text,
6845
- connectionId: text.optional(),
6846
+ connectionId: actionConnection.optional(),
6846
6847
  approval: boolean(),
6847
6848
  inputs: array(input.extend({ source: agentInput }))
6848
6849
  })),
6849
6850
  notification: object$1({
6850
6851
  action: text,
6851
- connectionId: text.optional(),
6852
+ connectionId: actionConnection.optional(),
6852
6853
  inputDefinitions: array(input),
6853
6854
  messageHandle: text,
6854
6855
  inputs: record$1(text, agentValue)