@vm0/cli 9.263.1 → 9.264.1

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 (108) hide show
  1. package/{agent-A37X5XHI.js → agent-E2BPFAL6.js} +6 -6
  2. package/{banking-UO5BT4LV.js → banking-V23G5LOK.js} +4 -4
  3. package/{browser-4QRQVLDA.js → browser-52OL5JV4.js} +4 -4
  4. package/{chat-QB6VZHUD.js → chat-4QKOKXPH.js} +38 -16
  5. package/chat-4QKOKXPH.js.map +1 -0
  6. package/{chunk-MM2THXZU.js → chunk-4IYCDMRE.js} +110 -84
  7. package/chunk-4IYCDMRE.js.map +1 -0
  8. package/{chunk-WNXAEDU7.js → chunk-BLGKFC6X.js} +406 -210
  9. package/chunk-BLGKFC6X.js.map +1 -0
  10. package/{chunk-RM3CRZ3V.js → chunk-CIJTPQ5G.js} +2 -2
  11. package/chunk-CIJTPQ5G.js.map +1 -0
  12. package/{chunk-WFGOVUAO.js → chunk-F7CDJLEV.js} +11 -10
  13. package/chunk-F7CDJLEV.js.map +1 -0
  14. package/{chunk-7QZTAAET.js → chunk-HZXJAGKW.js} +4 -4
  15. package/{chunk-R5PFPDVD.js → chunk-I3ZM26CK.js} +2 -2
  16. package/{chunk-3XRJTKOC.js → chunk-L6C5PPMA.js} +2 -2
  17. package/chunk-LN2ATWKS.js +96 -0
  18. package/chunk-LN2ATWKS.js.map +1 -0
  19. package/{chunk-INWHTFKO.js → chunk-ULPX3TWL.js} +2 -2
  20. package/{chunk-42RDOHNK.js → chunk-VAHGUNHT.js} +2 -2
  21. package/{chunk-SZFRTXBU.js → chunk-XLEUQPCM.js} +2 -2
  22. package/{computer-use-4G526LVW.js → computer-use-VAHKOCCE.js} +4 -4
  23. package/{connector-OSF6NAZ3.js → connector-H6X4PKGM.js} +7 -7
  24. package/{credit-ILE37NVC.js → credit-4KI7Y67J.js} +5 -5
  25. package/{developer-support-CS4NUQKS.js → developer-support-ZF2EG6YH.js} +4 -4
  26. package/{doctor-FDGQRZX4.js → doctor-USWNR3KS.js} +5 -5
  27. package/{feishu-IZNLUXA6.js → feishu-MCUDH2ZG.js} +4 -4
  28. package/{finance-MI4RQTGE.js → finance-KQEASIZ4.js} +4 -4
  29. package/{generate-TBMH5BJW.js → generate-F3HLIF22.js} +5 -5
  30. package/{github-NC36DPAV.js → github-P45MHYQX.js} +4 -4
  31. package/{goal-E3O4CE6U.js → goal-R3GVIBQR.js} +4 -4
  32. package/{host-SEROEJ3X.js → host-7UGXRYZ7.js} +4 -4
  33. package/{logs-FX6QR3NW.js → logs-GZSFMQFQ.js} +7 -6
  34. package/{logs-FX6QR3NW.js.map → logs-GZSFMQFQ.js.map} +1 -1
  35. package/{mail-OJG76J7H.js → mail-56IYFAHE.js} +6 -6
  36. package/{maps-WQN5C55Q.js → maps-5NURIQNY.js} +4 -4
  37. package/{model-TRIO5V3B.js → model-547LC6EF.js} +5 -5
  38. package/{model-provider-F7IDCMER.js → model-provider-XXNSDSWH.js} +5 -5
  39. package/{org-L2H5G7UT.js → org-OXIABCOK.js} +4 -4
  40. package/package.json +1 -1
  41. package/{people-search-C543ABM2.js → people-search-KSX77FMJ.js} +4 -4
  42. package/{phone-LIC3TOX5.js → phone-Z3UVQ6JF.js} +4 -4
  43. package/{preference-F2WEDROK.js → preference-GHRGBL6B.js} +4 -4
  44. package/{resource-L3FONGQH.js → resource-GH6PXL45.js} +4 -4
  45. package/{scrape-YTZCRV4O.js → scrape-FE5FQSCC.js} +4 -4
  46. package/{search-5CMFCJEU.js → search-JNO65XT3.js} +7 -6
  47. package/{search-5CMFCJEU.js.map → search-JNO65XT3.js.map} +1 -1
  48. package/{secret-TOACFEGT.js → secret-4KWPWFHH.js} +4 -4
  49. package/{slack-24WMW2IR.js → slack-AONTXTZN.js} +4 -4
  50. package/{teams-4JCSRJHR.js → teams-QCAINXCJ.js} +4 -4
  51. package/{telegram-N6CYEREV.js → telegram-XSZU2ZQ2.js} +4 -4
  52. package/{upgrade-26SROMUW.js → upgrade-EVJAXUCS.js} +3 -3
  53. package/{variable-4D7HYG5Z.js → variable-RPZEOH6I.js} +4 -4
  54. package/{video-Y2W66YOG.js → video-OBKGR6OV.js} +3 -3
  55. package/{weather-QCUKUCSB.js → weather-3SWSSG25.js} +4 -4
  56. package/{web-K7ZZLS6C.js → web-XLIGH6R4.js} +4 -4
  57. package/{web-search-CTSJQ6KG.js → web-search-SR7S2ORY.js} +4 -4
  58. package/{whoami-XQRDEJ4Y.js → whoami-MHDRAO4F.js} +6 -6
  59. package/{workflow-3OEX2DBN.js → workflow-VODYK74Y.js} +204 -23
  60. package/workflow-VODYK74Y.js.map +1 -0
  61. package/zero.js +43 -43
  62. package/chat-QB6VZHUD.js.map +0 -1
  63. package/chunk-MM2THXZU.js.map +0 -1
  64. package/chunk-RM3CRZ3V.js.map +0 -1
  65. package/chunk-WFGOVUAO.js.map +0 -1
  66. package/chunk-WNXAEDU7.js.map +0 -1
  67. package/workflow-3OEX2DBN.js.map +0 -1
  68. /package/{agent-A37X5XHI.js.map → agent-E2BPFAL6.js.map} +0 -0
  69. /package/{banking-UO5BT4LV.js.map → banking-V23G5LOK.js.map} +0 -0
  70. /package/{browser-4QRQVLDA.js.map → browser-52OL5JV4.js.map} +0 -0
  71. /package/{chunk-7QZTAAET.js.map → chunk-HZXJAGKW.js.map} +0 -0
  72. /package/{chunk-R5PFPDVD.js.map → chunk-I3ZM26CK.js.map} +0 -0
  73. /package/{chunk-3XRJTKOC.js.map → chunk-L6C5PPMA.js.map} +0 -0
  74. /package/{chunk-INWHTFKO.js.map → chunk-ULPX3TWL.js.map} +0 -0
  75. /package/{chunk-42RDOHNK.js.map → chunk-VAHGUNHT.js.map} +0 -0
  76. /package/{chunk-SZFRTXBU.js.map → chunk-XLEUQPCM.js.map} +0 -0
  77. /package/{computer-use-4G526LVW.js.map → computer-use-VAHKOCCE.js.map} +0 -0
  78. /package/{connector-OSF6NAZ3.js.map → connector-H6X4PKGM.js.map} +0 -0
  79. /package/{credit-ILE37NVC.js.map → credit-4KI7Y67J.js.map} +0 -0
  80. /package/{developer-support-CS4NUQKS.js.map → developer-support-ZF2EG6YH.js.map} +0 -0
  81. /package/{doctor-FDGQRZX4.js.map → doctor-USWNR3KS.js.map} +0 -0
  82. /package/{feishu-IZNLUXA6.js.map → feishu-MCUDH2ZG.js.map} +0 -0
  83. /package/{finance-MI4RQTGE.js.map → finance-KQEASIZ4.js.map} +0 -0
  84. /package/{generate-TBMH5BJW.js.map → generate-F3HLIF22.js.map} +0 -0
  85. /package/{github-NC36DPAV.js.map → github-P45MHYQX.js.map} +0 -0
  86. /package/{goal-E3O4CE6U.js.map → goal-R3GVIBQR.js.map} +0 -0
  87. /package/{host-SEROEJ3X.js.map → host-7UGXRYZ7.js.map} +0 -0
  88. /package/{mail-OJG76J7H.js.map → mail-56IYFAHE.js.map} +0 -0
  89. /package/{maps-WQN5C55Q.js.map → maps-5NURIQNY.js.map} +0 -0
  90. /package/{model-TRIO5V3B.js.map → model-547LC6EF.js.map} +0 -0
  91. /package/{model-provider-F7IDCMER.js.map → model-provider-XXNSDSWH.js.map} +0 -0
  92. /package/{org-L2H5G7UT.js.map → org-OXIABCOK.js.map} +0 -0
  93. /package/{people-search-C543ABM2.js.map → people-search-KSX77FMJ.js.map} +0 -0
  94. /package/{phone-LIC3TOX5.js.map → phone-Z3UVQ6JF.js.map} +0 -0
  95. /package/{preference-F2WEDROK.js.map → preference-GHRGBL6B.js.map} +0 -0
  96. /package/{resource-L3FONGQH.js.map → resource-GH6PXL45.js.map} +0 -0
  97. /package/{scrape-YTZCRV4O.js.map → scrape-FE5FQSCC.js.map} +0 -0
  98. /package/{secret-TOACFEGT.js.map → secret-4KWPWFHH.js.map} +0 -0
  99. /package/{slack-24WMW2IR.js.map → slack-AONTXTZN.js.map} +0 -0
  100. /package/{teams-4JCSRJHR.js.map → teams-QCAINXCJ.js.map} +0 -0
  101. /package/{telegram-N6CYEREV.js.map → telegram-XSZU2ZQ2.js.map} +0 -0
  102. /package/{upgrade-26SROMUW.js.map → upgrade-EVJAXUCS.js.map} +0 -0
  103. /package/{variable-4D7HYG5Z.js.map → variable-RPZEOH6I.js.map} +0 -0
  104. /package/{video-Y2W66YOG.js.map → video-OBKGR6OV.js.map} +0 -0
  105. /package/{weather-QCUKUCSB.js.map → weather-3SWSSG25.js.map} +0 -0
  106. /package/{web-K7ZZLS6C.js.map → web-XLIGH6R4.js.map} +0 -0
  107. /package/{web-search-CTSJQ6KG.js.map → web-search-SR7S2ORY.js.map} +0 -0
  108. /package/{whoami-XQRDEJ4Y.js.map → whoami-MHDRAO4F.js.map} +0 -0
@@ -4,11 +4,11 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  downloadWebFile,
6
6
  transcribeAudio
7
- } from "./chunk-SZFRTXBU.js";
7
+ } from "./chunk-XLEUQPCM.js";
8
8
  import "./chunk-MA22KQYU.js";
9
9
  import {
10
10
  withErrorHandler
11
- } from "./chunk-RM3CRZ3V.js";
11
+ } from "./chunk-CIJTPQ5G.js";
12
12
  import "./chunk-MD3YWUKO.js";
13
13
  import {
14
14
  Command
@@ -247,4 +247,4 @@ Tip (video understanding):
247
247
  export {
248
248
  zeroVideoCommand
249
249
  };
250
- //# sourceMappingURL=video-Y2W66YOG.js.map
250
+ //# sourceMappingURL=video-OBKGR6OV.js.map
@@ -3,13 +3,13 @@ import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  callZeroWeather
6
- } from "./chunk-MM2THXZU.js";
7
- import "./chunk-SZFRTXBU.js";
6
+ } from "./chunk-4IYCDMRE.js";
7
+ import "./chunk-XLEUQPCM.js";
8
8
  import "./chunk-MA22KQYU.js";
9
9
  import {
10
10
  source_default,
11
11
  withErrorHandler
12
- } from "./chunk-RM3CRZ3V.js";
12
+ } from "./chunk-CIJTPQ5G.js";
13
13
  import "./chunk-MD3YWUKO.js";
14
14
  import {
15
15
  Command,
@@ -588,4 +588,4 @@ Notes:
588
588
  export {
589
589
  zeroWeatherCommand
590
590
  };
591
- //# sourceMappingURL=weather-QCUKUCSB.js.map
591
+ //# sourceMappingURL=weather-3SWSSG25.js.map
@@ -1,15 +1,15 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
- import "./chunk-MM2THXZU.js";
4
+ import "./chunk-4IYCDMRE.js";
5
5
  import {
6
6
  downloadWebFile,
7
7
  uploadWebFile
8
- } from "./chunk-SZFRTXBU.js";
8
+ } from "./chunk-XLEUQPCM.js";
9
9
  import "./chunk-MA22KQYU.js";
10
10
  import {
11
11
  withErrorHandler
12
- } from "./chunk-RM3CRZ3V.js";
12
+ } from "./chunk-CIJTPQ5G.js";
13
13
  import "./chunk-MD3YWUKO.js";
14
14
  import {
15
15
  Command
@@ -107,4 +107,4 @@ Examples:
107
107
  export {
108
108
  zeroWebCommand
109
109
  };
110
- //# sourceMappingURL=web-K7ZZLS6C.js.map
110
+ //# sourceMappingURL=web-XLIGH6R4.js.map
@@ -9,13 +9,13 @@ import {
9
9
  zeroWebSearchDomainSchema,
10
10
  zeroWebSearchRecencySchema,
11
11
  zeroWebSearchRequestSchema
12
- } from "./chunk-MM2THXZU.js";
13
- import "./chunk-SZFRTXBU.js";
12
+ } from "./chunk-4IYCDMRE.js";
13
+ import "./chunk-XLEUQPCM.js";
14
14
  import "./chunk-MA22KQYU.js";
15
15
  import {
16
16
  source_default,
17
17
  withErrorHandler
18
- } from "./chunk-RM3CRZ3V.js";
18
+ } from "./chunk-CIJTPQ5G.js";
19
19
  import "./chunk-MD3YWUKO.js";
20
20
  import {
21
21
  Command,
@@ -148,4 +148,4 @@ Notes:
148
148
  export {
149
149
  zeroWebSearchCommand
150
150
  };
151
- //# sourceMappingURL=web-search-CTSJQ6KG.js.map
151
+ //# sourceMappingURL=web-search-SR7S2ORY.js.map
@@ -4,16 +4,16 @@ const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  loadConnectorPermissionInfos,
6
6
  policyIcon
7
- } from "./chunk-7QZTAAET.js";
7
+ } from "./chunk-HZXJAGKW.js";
8
8
  import {
9
9
  permissionGrantsToFirewallPolicies
10
- } from "./chunk-INWHTFKO.js";
10
+ } from "./chunk-ULPX3TWL.js";
11
11
  import {
12
12
  getZeroAgentUserConnectors,
13
13
  listZeroConnectors,
14
14
  listZeroUserPermissionGrants
15
- } from "./chunk-MM2THXZU.js";
16
- import "./chunk-SZFRTXBU.js";
15
+ } from "./chunk-4IYCDMRE.js";
16
+ import "./chunk-XLEUQPCM.js";
17
17
  import "./chunk-MA22KQYU.js";
18
18
  import {
19
19
  getActiveOrg,
@@ -21,7 +21,7 @@ import {
21
21
  getToken,
22
22
  source_default,
23
23
  withErrorHandler
24
- } from "./chunk-RM3CRZ3V.js";
24
+ } from "./chunk-CIJTPQ5G.js";
25
25
  import {
26
26
  decodeZeroTokenPayload
27
27
  } from "./chunk-MD3YWUKO.js";
@@ -196,4 +196,4 @@ Notes:
196
196
  export {
197
197
  zeroWhoamiCommand
198
198
  };
199
- //# sourceMappingURL=whoami-XQRDEJ4Y.js.map
199
+ //# sourceMappingURL=whoami-MHDRAO4F.js.map
@@ -1,6 +1,9 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
+ import {
5
+ getModelDisplayName
6
+ } from "./chunk-LN2ATWKS.js";
4
7
  import {
5
8
  isInteractive,
6
9
  promptConfirm
@@ -15,20 +18,23 @@ import {
15
18
  enableWorkflowAutomation,
16
19
  getWorkflow,
17
20
  getWorkflowAutomation,
21
+ getZeroChatThread,
18
22
  listWorkflowAutomations,
19
23
  listWorkflows,
24
+ listWorkspaceWorkflowAutomations,
25
+ listZeroModelPolicies,
20
26
  updateWorkflow,
21
27
  updateWorkflowAutomation
22
- } from "./chunk-MM2THXZU.js";
23
- import "./chunk-SZFRTXBU.js";
28
+ } from "./chunk-4IYCDMRE.js";
29
+ import "./chunk-XLEUQPCM.js";
24
30
  import "./chunk-MA22KQYU.js";
25
31
  import {
26
32
  source_default,
27
33
  withErrorHandler
28
- } from "./chunk-RM3CRZ3V.js";
34
+ } from "./chunk-CIJTPQ5G.js";
29
35
  import {
30
36
  isFeatureEnabled
31
- } from "./chunk-WFGOVUAO.js";
37
+ } from "./chunk-F7CDJLEV.js";
32
38
  import {
33
39
  decodeZeroTokenPayload
34
40
  } from "./chunk-MD3YWUKO.js";
@@ -774,7 +780,118 @@ function printGithubFilters(automation) {
774
780
  }
775
781
  }
776
782
  }
777
- function printWorkflowAutomationDetails(automation, options) {
783
+ function printCommand(lines) {
784
+ for (const line of lines) {
785
+ console.log(source_default.cyan(` ${line}`));
786
+ }
787
+ }
788
+ function automationUpdateGuidance(automation) {
789
+ if (automation.kind !== "schedule") {
790
+ return {
791
+ label: "Edit automation",
792
+ command: ["zero workflow automation update --help"]
793
+ };
794
+ }
795
+ switch (automation.schedule.type) {
796
+ case "cron":
797
+ return {
798
+ label: "Change schedule",
799
+ command: [
800
+ "zero workflow automation update \\",
801
+ ` ${automation.id} \\`,
802
+ ' --expr "<cron-expression>" -z <timezone>'
803
+ ]
804
+ };
805
+ case "loop":
806
+ return {
807
+ label: "Change interval",
808
+ command: [
809
+ "zero workflow automation update \\",
810
+ ` ${automation.id} \\`,
811
+ " --every <duration>"
812
+ ]
813
+ };
814
+ case "once":
815
+ return {
816
+ label: "Change run time",
817
+ command: [
818
+ "zero workflow automation update \\",
819
+ ` ${automation.id} \\`,
820
+ ' --at "<iso-time>" -z <timezone>'
821
+ ]
822
+ };
823
+ }
824
+ }
825
+ function printManagementCommands(automation, options) {
826
+ if (!options.workflowId) {
827
+ return;
828
+ }
829
+ const update = automationUpdateGuidance(automation);
830
+ const statusAction = automation.enabled ? {
831
+ label: "Pause automation",
832
+ command: "disable"
833
+ } : {
834
+ label: "Resume automation",
835
+ command: "enable"
836
+ };
837
+ console.log("");
838
+ console.log(source_default.bold("Manage with Zero CLI:"));
839
+ console.log(" Edit workflow:");
840
+ printCommand([
841
+ `zero workflow edit ${options.workflowId} \\`,
842
+ " --instruction-file <path>"
843
+ ]);
844
+ console.log("");
845
+ console.log(` ${update.label}:`);
846
+ printCommand(update.command);
847
+ console.log("");
848
+ console.log(` ${statusAction.label}:`);
849
+ printCommand([
850
+ `zero workflow automation ${statusAction.command} \\`,
851
+ ` ${automation.id}`
852
+ ]);
853
+ console.log("");
854
+ console.log(" More automation options:");
855
+ printCommand(["zero workflow automation --help"]);
856
+ if (!automation.chatThreadId || !options.threadModel) {
857
+ return;
858
+ }
859
+ console.log("");
860
+ console.log(source_default.bold("About model selection:"));
861
+ console.log(
862
+ " The selected model affects run behavior, output quality, and cost."
863
+ );
864
+ console.log(
865
+ " Automations do not store a separate model. All automations on this workflow"
866
+ );
867
+ console.log(
868
+ " share one chat thread and use that thread's model. Changing the thread model"
869
+ );
870
+ console.log(" changes the model used by all of them.");
871
+ console.log("");
872
+ console.log(source_default.bold("Model commands:"));
873
+ console.log(" Show:");
874
+ printCommand(["zero chat model \\", ` --thread ${automation.chatThreadId}`]);
875
+ console.log("");
876
+ console.log(" Change:");
877
+ printCommand([
878
+ "zero chat model \\",
879
+ ` --thread ${automation.chatThreadId} \\`,
880
+ " <model-id>"
881
+ ]);
882
+ console.log("");
883
+ console.log(" Options:");
884
+ printCommand(["zero model list"]);
885
+ }
886
+ function printWorkflowAutomationThreadModel(model) {
887
+ if (!model) {
888
+ return;
889
+ }
890
+ console.log(
891
+ `${"Thread model:".padEnd(14)}${model.label} ${source_default.dim(`(${model.id})`)}`
892
+ );
893
+ }
894
+ function printWorkflowAutomationDetails(automation, options = {}) {
778
895
  const status = automation.enabled ? source_default.green("enabled") : source_default.yellow("disabled");
779
896
  console.log(`${"Kind:".padEnd(14)}${automation.kind}`);
780
897
  console.log(`${"ID:".padEnd(14)}${automation.id}`);
@@ -859,12 +976,14 @@ function printWorkflowAutomationDetails(automation, options) {
859
976
  console.log(
860
977
  `${"Chat thread:".padEnd(14)}${automation.chatThreadId ?? source_default.dim("-")}`
861
978
  );
979
+ printWorkflowAutomationThreadModel(options.threadModel);
862
980
  console.log(
863
981
  `${"Next run:".padEnd(14)}${formatRunTime(automation.nextRunAt)}`
864
982
  );
865
983
  console.log(
866
984
  `${"Last run:".padEnd(14)}${formatRunTime(automation.lastRunAt)}`
867
985
  );
986
+ printManagementCommands(automation, options);
868
987
  }
869
988
 
870
989
  // src/commands/zero/workflow/copy.ts
@@ -1167,6 +1286,36 @@ function automationKinds() {
1167
1286
  ...strapiIntegrationEnabled() ? STRAPI_EVENT_KINDS : []
1168
1287
  ];
1169
1288
  }
1289
+ async function loadWorkflowAutomationThreadModel(automation) {
1290
+ if (!automation.chatThreadId) {
1291
+ return void 0;
1292
+ }
1293
+ const thread = await getZeroChatThread({
1294
+ threadId: automation.chatThreadId
1295
+ });
1296
+ const modelId = thread.selectedModel ?? (await listZeroModelPolicies()).workspaceDefaultModel;
1297
+ if (!modelId) {
1298
+ throw new Error(
1299
+ `Chat thread "${automation.chatThreadId}" has no available model`
1300
+ );
1301
+ }
1302
+ return {
1303
+ id: modelId,
1304
+ label: getModelDisplayName(modelId)
1305
+ };
1306
+ }
1307
+ async function tryLoadWorkflowAutomationThreadModel(automation) {
1308
+ try {
1309
+ return await loadWorkflowAutomationThreadModel(automation);
1310
+ } catch (error) {
1311
+ console.warn(
1312
+ source_default.yellow(
1313
+ `\u26A0 Automation changed, but thread model details could not be loaded: ${error instanceof Error ? error.message : "Unknown error"}`
1314
+ )
1315
+ );
1316
+ return void 0;
1317
+ }
1318
+ }
1170
1319
  function githubWebhookEventKind(kind) {
1171
1320
  return GITHUB_WEBHOOK_EVENT_KINDS.some((eventKind) => {
1172
1321
  return eventKind === kind;
@@ -2058,22 +2207,31 @@ function buildNotionPageContentUpdatedCreateRequest(options) {
2058
2207
  }
2059
2208
  const pageUrl = options.pageUrl?.trim();
2060
2209
  const databaseUrl = options.databaseUrl?.trim();
2061
- if ((pageUrl !== void 0 && pageUrl.length > 0) === (databaseUrl !== void 0 && databaseUrl.length > 0)) {
2062
- throw new Error(
2063
- 'notion-page-content-updated automations require exactly one of --page-url "https://www.notion.so/..." or --database-url "https://www.notion.so/..."'
2064
- );
2210
+ const invalidScopeMessage = 'notion-page-content-updated automations require exactly one of --page-url "https://www.notion.so/..." or --database-url "https://www.notion.so/..."';
2211
+ if (pageUrl && databaseUrl) {
2212
+ throw new Error(invalidScopeMessage);
2213
+ }
2214
+ if (pageUrl) {
2215
+ return {
2216
+ kind: "event",
2217
+ eventType: "notion-page-content-updated",
2218
+ eventConfig: {
2219
+ provider: "notion",
2220
+ event: "page_content_updated",
2221
+ pageUrl
2222
+ }
2223
+ };
2224
+ }
2225
+ if (!databaseUrl) {
2226
+ throw new Error(invalidScopeMessage);
2065
2227
  }
2066
2228
  return {
2067
2229
  kind: "event",
2068
2230
  eventType: "notion-page-content-updated",
2069
- eventConfig: pageUrl !== void 0 && pageUrl.length > 0 ? {
2070
- provider: "notion",
2071
- event: "page_content_updated",
2072
- pageUrl
2073
- } : {
2231
+ eventConfig: {
2074
2232
  provider: "notion",
2075
2233
  event: "page_content_updated",
2076
- databaseUrl: databaseUrl ?? ""
2234
+ databaseUrl
2077
2235
  }
2078
2236
  };
2079
2237
  }
@@ -2465,7 +2623,12 @@ Notes:
2465
2623
  console.log(
2466
2624
  source_default.green(`\u2713 Automation added to workflow "${workflowRef}"`)
2467
2625
  );
2468
- printWorkflowAutomationDetails(automation, { workflowRef });
2626
+ const threadModel = await tryLoadWorkflowAutomationThreadModel(automation);
2627
+ printWorkflowAutomationDetails(automation, {
2628
+ workflowRef,
2629
+ workflowId,
2630
+ threadModel
2631
+ });
2469
2632
  }
2470
2633
  )
2471
2634
  );
@@ -2491,12 +2654,11 @@ Examples:
2491
2654
  ).action(
2492
2655
  withErrorHandler(async (id, options) => {
2493
2656
  const existing = await getWorkflowAutomation(id);
2494
- const automation = await updateWorkflowAutomation(
2495
- id,
2496
- buildUpdate(options, existing)
2497
- );
2657
+ const body = buildUpdate(options, existing);
2658
+ const automation = await updateWorkflowAutomation(id, body);
2498
2659
  console.log(source_default.green(`\u2713 Automation ${automation.id} updated`));
2499
- printWorkflowAutomationDetails(automation);
2660
+ const threadModel = await tryLoadWorkflowAutomationThreadModel(automation);
2661
+ printWorkflowAutomationDetails(automation, { threadModel });
2500
2662
  })
2501
2663
  );
2502
2664
  var listCommand2 = new Command().name("list").alias("ls").description("List a workflow's automations").argument("<workflow>", "Workflow ID or name").option("--agent <id>", "Agent ID for resolving a workflow name").addHelpText(
@@ -2526,7 +2688,22 @@ Examples:
2526
2688
  var showCommand = new Command().name("show").description("Show a workflow automation").argument("<automation>", "Workflow automation ID").action(
2527
2689
  withErrorHandler(async (id) => {
2528
2690
  const automation = await getWorkflowAutomation(id);
2529
- printWorkflowAutomationDetails(automation);
2691
+ const entries = await listWorkspaceWorkflowAutomations();
2692
+ const entry = entries.find(({ automation: automation2 }) => {
2693
+ return automation2.id === id;
2694
+ });
2695
+ if (!entry) {
2696
+ printWorkflowAutomationDetails(automation);
2697
+ return;
2698
+ }
2699
+ const threadModel = await loadWorkflowAutomationThreadModel(
2700
+ entry.automation
2701
+ );
2702
+ printWorkflowAutomationDetails(entry.automation, {
2703
+ workflowRef: entry.workflow.name,
2704
+ workflowId: entry.workflow.id,
2705
+ threadModel
2706
+ });
2530
2707
  })
2531
2708
  );
2532
2709
  var rmCommand = new Command().name("rm").alias("remove").description("Remove a workflow automation").argument("<automation>", "Workflow automation ID").action(
@@ -2539,12 +2716,16 @@ var enableCommand = new Command().name("enable").description("Enable a workflow
2539
2716
  withErrorHandler(async (id) => {
2540
2717
  const automation = await enableWorkflowAutomation(id);
2541
2718
  console.log(source_default.green(`\u2713 Automation ${automation.id} enabled`));
2719
+ const threadModel = await tryLoadWorkflowAutomationThreadModel(automation);
2720
+ printWorkflowAutomationThreadModel(threadModel);
2542
2721
  })
2543
2722
  );
2544
2723
  var disableCommand = new Command().name("disable").description("Disable a workflow automation").argument("<automation>", "Workflow automation ID").action(
2545
2724
  withErrorHandler(async (id) => {
2546
2725
  const automation = await disableWorkflowAutomation(id);
2547
2726
  console.log(source_default.green(`\u2713 Automation ${automation.id} disabled`));
2727
+ const threadModel = await tryLoadWorkflowAutomationThreadModel(automation);
2728
+ printWorkflowAutomationThreadModel(threadModel);
2548
2729
  })
2549
2730
  );
2550
2731
  var automationCommand = new Command().name("automation").description("Manage a workflow's automations").addCommand(addCommand).addCommand(updateCommand).addCommand(listCommand2).addCommand(showCommand).addCommand(rmCommand).addCommand(enableCommand).addCommand(disableCommand).addHelpText(
@@ -2576,4 +2757,4 @@ Examples:
2576
2757
  export {
2577
2758
  zeroWorkflowCommand
2578
2759
  };
2579
- //# sourceMappingURL=workflow-3OEX2DBN.js.map
2760
+ //# sourceMappingURL=workflow-VODYK74Y.js.map