@vm0/cli 9.215.3 → 9.217.0

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 (81) hide show
  1. package/{agent-AZQKRG4B.js → agent-ERBSWLZY.js} +4 -4
  2. package/{automation-ZIEV4Q72.js → automation-W6KYCENX.js} +2 -2
  3. package/{banking-2CDU223M.js → banking-PPUSVFJQ.js} +2 -2
  4. package/chat-3R5ABJIF.js +123 -0
  5. package/chat-3R5ABJIF.js.map +1 -0
  6. package/{chunk-WL7EL2UG.js → chunk-66CRY7ZE.js} +2 -2
  7. package/{chunk-SS5WCV7W.js → chunk-B4YVYCNP.js} +2 -2
  8. package/{chunk-SS5WCV7W.js.map → chunk-B4YVYCNP.js.map} +1 -1
  9. package/{chunk-2MYK53HJ.js → chunk-B5PHHGBT.js} +2 -2
  10. package/{chunk-QE6HJUL2.js → chunk-CGGDMYJR.js} +3 -3
  11. package/{chunk-GBGNRPZ5.js → chunk-G6N7QXRB.js} +3 -3
  12. package/{chunk-EWITRIWZ.js → chunk-HBSUM372.js} +2 -2
  13. package/{chunk-LCMCP2WQ.js → chunk-O76AI2N5.js} +2 -2
  14. package/{chunk-RVZTMBZ7.js → chunk-QUGHDCZQ.js} +2 -2
  15. package/{chunk-DMAXHLSM.js → chunk-TKAJDWGT.js} +62 -5
  16. package/chunk-TKAJDWGT.js.map +1 -0
  17. package/{computer-use-AZPPQK7I.js → computer-use-XVETFRXU.js} +2 -2
  18. package/{connector-NADUUXPW.js → connector-5Q3B37PN.js} +3 -3
  19. package/{credit-JHOMWMFK.js → credit-KNBDBYJB.js} +2 -2
  20. package/{developer-support-U7JULAYC.js → developer-support-RSGBOGAF.js} +2 -2
  21. package/{doctor-A7V3ZJEY.js → doctor-5WYECMCQ.js} +5 -5
  22. package/{generate-2SJTN5W2.js → generate-JAHTJGHR.js} +3 -3
  23. package/{github-GRU4EHAJ.js → github-VE2A52PI.js} +2 -2
  24. package/{goal-GURJHZXL.js → goal-ZEQ2CC5O.js} +2 -2
  25. package/{host-GYT2IEH4.js → host-TRFD623R.js} +2 -2
  26. package/index.js +13 -13
  27. package/{logs-N3PNIAGS.js → logs-LU7Z663V.js} +6 -6
  28. package/{maps-D5QH3GHE.js → maps-BRFCMUY7.js} +2 -2
  29. package/{model-MM25EQUD.js → model-KEMRYJ2I.js} +3 -3
  30. package/{model-provider-5OZ222EJ.js → model-provider-RCMELAX6.js} +3 -3
  31. package/{org-QBMRMNB4.js → org-GDC6DUTT.js} +2 -2
  32. package/package.json +1 -1
  33. package/{phone-FXXNTGIC.js → phone-AP75IXA4.js} +2 -2
  34. package/{preference-KHMX4NLR.js → preference-XKLJQO3H.js} +2 -2
  35. package/{resource-EZHY7PAW.js → resource-T6UPZ5Y6.js} +2 -2
  36. package/{search-PXKNMVKT.js → search-ILDCIRYL.js} +6 -6
  37. package/{secret-Y32Q5NUL.js → secret-AVR2GOHR.js} +3 -3
  38. package/{slack-DTGXXB4X.js → slack-KFPHHQKL.js} +2 -2
  39. package/{telegram-SXAGLUSM.js → telegram-APEI4GYU.js} +2 -2
  40. package/{variable-POHEUC5N.js → variable-H5N6QKDJ.js} +2 -2
  41. package/{web-NHHGB5F5.js → web-3EUABPMX.js} +2 -2
  42. package/{whoami-QVS4BRD6.js → whoami-LHX2USZO.js} +4 -4
  43. package/{workflow-65JJ6IXI.js → workflow-ML33WY2M.js} +2 -2
  44. package/zero.js +39 -30
  45. package/zero.js.map +1 -1
  46. package/chunk-DMAXHLSM.js.map +0 -1
  47. /package/{agent-AZQKRG4B.js.map → agent-ERBSWLZY.js.map} +0 -0
  48. /package/{automation-ZIEV4Q72.js.map → automation-W6KYCENX.js.map} +0 -0
  49. /package/{banking-2CDU223M.js.map → banking-PPUSVFJQ.js.map} +0 -0
  50. /package/{chunk-WL7EL2UG.js.map → chunk-66CRY7ZE.js.map} +0 -0
  51. /package/{chunk-2MYK53HJ.js.map → chunk-B5PHHGBT.js.map} +0 -0
  52. /package/{chunk-QE6HJUL2.js.map → chunk-CGGDMYJR.js.map} +0 -0
  53. /package/{chunk-GBGNRPZ5.js.map → chunk-G6N7QXRB.js.map} +0 -0
  54. /package/{chunk-EWITRIWZ.js.map → chunk-HBSUM372.js.map} +0 -0
  55. /package/{chunk-LCMCP2WQ.js.map → chunk-O76AI2N5.js.map} +0 -0
  56. /package/{chunk-RVZTMBZ7.js.map → chunk-QUGHDCZQ.js.map} +0 -0
  57. /package/{computer-use-AZPPQK7I.js.map → computer-use-XVETFRXU.js.map} +0 -0
  58. /package/{connector-NADUUXPW.js.map → connector-5Q3B37PN.js.map} +0 -0
  59. /package/{credit-JHOMWMFK.js.map → credit-KNBDBYJB.js.map} +0 -0
  60. /package/{developer-support-U7JULAYC.js.map → developer-support-RSGBOGAF.js.map} +0 -0
  61. /package/{doctor-A7V3ZJEY.js.map → doctor-5WYECMCQ.js.map} +0 -0
  62. /package/{generate-2SJTN5W2.js.map → generate-JAHTJGHR.js.map} +0 -0
  63. /package/{github-GRU4EHAJ.js.map → github-VE2A52PI.js.map} +0 -0
  64. /package/{goal-GURJHZXL.js.map → goal-ZEQ2CC5O.js.map} +0 -0
  65. /package/{host-GYT2IEH4.js.map → host-TRFD623R.js.map} +0 -0
  66. /package/{logs-N3PNIAGS.js.map → logs-LU7Z663V.js.map} +0 -0
  67. /package/{maps-D5QH3GHE.js.map → maps-BRFCMUY7.js.map} +0 -0
  68. /package/{model-MM25EQUD.js.map → model-KEMRYJ2I.js.map} +0 -0
  69. /package/{model-provider-5OZ222EJ.js.map → model-provider-RCMELAX6.js.map} +0 -0
  70. /package/{org-QBMRMNB4.js.map → org-GDC6DUTT.js.map} +0 -0
  71. /package/{phone-FXXNTGIC.js.map → phone-AP75IXA4.js.map} +0 -0
  72. /package/{preference-KHMX4NLR.js.map → preference-XKLJQO3H.js.map} +0 -0
  73. /package/{resource-EZHY7PAW.js.map → resource-T6UPZ5Y6.js.map} +0 -0
  74. /package/{search-PXKNMVKT.js.map → search-ILDCIRYL.js.map} +0 -0
  75. /package/{secret-Y32Q5NUL.js.map → secret-AVR2GOHR.js.map} +0 -0
  76. /package/{slack-DTGXXB4X.js.map → slack-KFPHHQKL.js.map} +0 -0
  77. /package/{telegram-SXAGLUSM.js.map → telegram-APEI4GYU.js.map} +0 -0
  78. /package/{variable-POHEUC5N.js.map → variable-H5N6QKDJ.js.map} +0 -0
  79. /package/{web-NHHGB5F5.js.map → web-3EUABPMX.js.map} +0 -0
  80. /package/{whoami-QVS4BRD6.js.map → whoami-LHX2USZO.js.map} +0 -0
  81. /package/{workflow-65JJ6IXI.js.map → workflow-ML33WY2M.js.map} +0 -0
package/zero.js CHANGED
@@ -3,7 +3,7 @@ import { createRequire as __createRequire } from "node:module";
3
3
  const require = __createRequire(import.meta.url);
4
4
  import {
5
5
  configureGlobalProxyFromEnv
6
- } from "./chunk-GBGNRPZ5.js";
6
+ } from "./chunk-G6N7QXRB.js";
7
7
  import {
8
8
  decodeZeroTokenPayload
9
9
  } from "./chunk-LRHXR7JT.js";
@@ -30,6 +30,7 @@ var COMMAND_CAPABILITY_MAP = {
30
30
  "model-provider": null,
31
31
  logs: "agent-run:read",
32
32
  search: "chat-message:read",
33
+ chat: ["chat-thread:read", "chat-thread:write"],
33
34
  resource: null,
34
35
  github: ["github:read", "github:write"],
35
36
  slack: "slack:write",
@@ -50,56 +51,56 @@ var ZERO_COMMAND_DEFINITIONS = [
50
51
  name: "org",
51
52
  description: "Manage organization settings, members, and providers",
52
53
  load: async () => {
53
- return (await import("./org-QBMRMNB4.js")).zeroOrgCommand;
54
+ return (await import("./org-GDC6DUTT.js")).zeroOrgCommand;
54
55
  }
55
56
  },
56
57
  {
57
58
  name: "model",
58
59
  description: "List available models and model-switching guidance",
59
60
  load: async () => {
60
- return (await import("./model-MM25EQUD.js")).zeroModelCommand;
61
+ return (await import("./model-KEMRYJ2I.js")).zeroModelCommand;
61
62
  }
62
63
  },
63
64
  {
64
65
  name: "model-provider",
65
66
  description: "Inspect model provider routing",
66
67
  load: async () => {
67
- return (await import("./model-provider-5OZ222EJ.js")).zeroModelProviderCommand;
68
+ return (await import("./model-provider-RCMELAX6.js")).zeroModelProviderCommand;
68
69
  }
69
70
  },
70
71
  {
71
72
  name: "agent",
72
73
  description: "View or manage zero agents",
73
74
  load: async () => {
74
- return (await import("./agent-AZQKRG4B.js")).zeroAgentCommand;
75
+ return (await import("./agent-ERBSWLZY.js")).zeroAgentCommand;
75
76
  }
76
77
  },
77
78
  {
78
79
  name: "connector",
79
80
  description: "Check third-party service connections (GitHub, Slack, etc.)",
80
81
  load: async () => {
81
- return (await import("./connector-NADUUXPW.js")).zeroConnectorCommand;
82
+ return (await import("./connector-5Q3B37PN.js")).zeroConnectorCommand;
82
83
  }
83
84
  },
84
85
  {
85
86
  name: "credit",
86
87
  description: "Create a Stripe checkout link to buy credits",
87
88
  load: async () => {
88
- return (await import("./credit-JHOMWMFK.js")).zeroCreditCommand;
89
+ return (await import("./credit-KNBDBYJB.js")).zeroCreditCommand;
89
90
  }
90
91
  },
91
92
  {
92
93
  name: "doctor",
93
94
  description: "Diagnose runtime issues (connector health, permission denials)",
94
95
  load: async () => {
95
- return (await import("./doctor-A7V3ZJEY.js")).zeroDoctorCommand;
96
+ return (await import("./doctor-5WYECMCQ.js")).zeroDoctorCommand;
96
97
  }
97
98
  },
98
99
  {
99
100
  name: "preference",
100
101
  description: "View or update user preferences (timezone, notifications)",
101
102
  load: async () => {
102
- return (await import("./preference-KHMX4NLR.js")).zeroPreferenceCommand;
103
+ return (await import("./preference-XKLJQO3H.js")).zeroPreferenceCommand;
103
104
  }
104
105
  },
105
106
  {
@@ -113,119 +114,126 @@ var ZERO_COMMAND_DEFINITIONS = [
113
114
  name: "automation",
114
115
  description: "Create or manage scheduled automations",
115
116
  load: async () => {
116
- return (await import("./automation-ZIEV4Q72.js")).zeroAutomationCommand;
117
+ return (await import("./automation-W6KYCENX.js")).zeroAutomationCommand;
117
118
  }
118
119
  },
119
120
  {
120
121
  name: "secret",
121
122
  description: "Read or write secrets (API keys, tokens)",
122
123
  load: async () => {
123
- return (await import("./secret-Y32Q5NUL.js")).zeroSecretCommand;
124
+ return (await import("./secret-AVR2GOHR.js")).zeroSecretCommand;
124
125
  }
125
126
  },
126
127
  {
127
128
  name: "github",
128
129
  description: "Manage GitHub integration files and label listeners",
129
130
  load: async () => {
130
- return (await import("./github-GRU4EHAJ.js")).zeroGithubCommand;
131
+ return (await import("./github-VE2A52PI.js")).zeroGithubCommand;
131
132
  }
132
133
  },
133
134
  {
134
135
  name: "slack",
135
136
  description: "Send messages, upload files, and download files from Slack as the bot",
136
137
  load: async () => {
137
- return (await import("./slack-DTGXXB4X.js")).zeroSlackCommand;
138
+ return (await import("./slack-KFPHHQKL.js")).zeroSlackCommand;
138
139
  }
139
140
  },
140
141
  {
141
142
  name: "telegram",
142
143
  description: "Inspect bots, send messages, upload files, and download files from Telegram",
143
144
  load: async () => {
144
- return (await import("./telegram-SXAGLUSM.js")).zeroTelegramCommand;
145
+ return (await import("./telegram-APEI4GYU.js")).zeroTelegramCommand;
145
146
  }
146
147
  },
147
148
  {
148
149
  name: "phone",
149
150
  description: "Send AgentPhone messages, upload files, and download media",
150
151
  load: async () => {
151
- return (await import("./phone-FXXNTGIC.js")).zeroPhoneCommand;
152
+ return (await import("./phone-AP75IXA4.js")).zeroPhoneCommand;
152
153
  }
153
154
  },
154
155
  {
155
156
  name: "variable",
156
157
  description: "Read or write non-sensitive configuration values",
157
158
  load: async () => {
158
- return (await import("./variable-POHEUC5N.js")).zeroVariableCommand;
159
+ return (await import("./variable-H5N6QKDJ.js")).zeroVariableCommand;
159
160
  }
160
161
  },
161
162
  {
162
163
  name: "logs",
163
164
  description: "View and search agent run logs",
164
165
  load: async () => {
165
- return (await import("./logs-N3PNIAGS.js")).zeroLogsCommand;
166
+ return (await import("./logs-LU7Z663V.js")).zeroLogsCommand;
166
167
  }
167
168
  },
168
169
  {
169
170
  name: "search",
170
171
  description: "Search logs, chat, or get a recipe for external sources",
171
172
  load: async () => {
172
- return (await import("./search-PXKNMVKT.js")).zeroSearchCommand;
173
+ return (await import("./search-ILDCIRYL.js")).zeroSearchCommand;
174
+ }
175
+ },
176
+ {
177
+ name: "chat",
178
+ description: "Manage the current web chat thread",
179
+ load: async () => {
180
+ return (await import("./chat-3R5ABJIF.js")).zeroChatCommand;
173
181
  }
174
182
  },
175
183
  {
176
184
  name: "resource",
177
185
  description: "Pull registry resources from private R2-backed archives",
178
186
  load: async () => {
179
- return (await import("./resource-EZHY7PAW.js")).zeroResourceCommand;
187
+ return (await import("./resource-T6UPZ5Y6.js")).zeroResourceCommand;
180
188
  }
181
189
  },
182
190
  {
183
191
  name: "whoami",
184
192
  description: "Show agent identity, run ID, and capabilities",
185
193
  load: async () => {
186
- return (await import("./whoami-QVS4BRD6.js")).zeroWhoamiCommand;
194
+ return (await import("./whoami-LHX2USZO.js")).zeroWhoamiCommand;
187
195
  }
188
196
  },
189
197
  {
190
198
  name: "workflow",
191
199
  description: "Manage workflows",
192
200
  load: async () => {
193
- return (await import("./workflow-65JJ6IXI.js")).zeroWorkflowCommand;
201
+ return (await import("./workflow-ML33WY2M.js")).zeroWorkflowCommand;
194
202
  }
195
203
  },
196
204
  {
197
205
  name: "goal",
198
206
  description: "Manage the current thread goal",
199
207
  load: async () => {
200
- return (await import("./goal-GURJHZXL.js")).zeroGoalCommand;
208
+ return (await import("./goal-ZEQ2CC5O.js")).zeroGoalCommand;
201
209
  }
202
210
  },
203
211
  {
204
212
  name: "developer-support",
205
213
  description: "Submit a diagnostic report to the dev team",
206
214
  load: async () => {
207
- return (await import("./developer-support-U7JULAYC.js")).zeroDeveloperSupportCommand;
215
+ return (await import("./developer-support-RSGBOGAF.js")).zeroDeveloperSupportCommand;
208
216
  }
209
217
  },
210
218
  {
211
219
  name: "computer-use",
212
220
  description: "Desktop app computer use through Zero CLI",
213
221
  load: async () => {
214
- return (await import("./computer-use-AZPPQK7I.js")).zeroComputerUseCommand;
222
+ return (await import("./computer-use-XVETFRXU.js")).zeroComputerUseCommand;
215
223
  }
216
224
  },
217
225
  {
218
226
  name: "generate",
219
227
  description: "Generate assets via vm0's built-in pipelines or get connector skill-invocation guidance",
220
228
  load: async () => {
221
- return (await import("./generate-2SJTN5W2.js")).generateCommand;
229
+ return (await import("./generate-JAHTJGHR.js")).generateCommand;
222
230
  }
223
231
  },
224
232
  {
225
233
  name: "web",
226
234
  description: "Upload and download files via the web chat endpoint",
227
235
  load: async () => {
228
- return (await import("./web-NHHGB5F5.js")).zeroWebCommand;
236
+ return (await import("./web-3EUABPMX.js")).zeroWebCommand;
229
237
  }
230
238
  },
231
239
  {
@@ -239,21 +247,21 @@ var ZERO_COMMAND_DEFINITIONS = [
239
247
  name: "host",
240
248
  description: "Publish static sites and clone owned hosted site files",
241
249
  load: async () => {
242
- return (await import("./host-GYT2IEH4.js")).zeroHostCommand;
250
+ return (await import("./host-TRFD623R.js")).zeroHostCommand;
243
251
  }
244
252
  },
245
253
  {
246
254
  name: "maps",
247
255
  description: "Use managed zero maps services",
248
256
  load: async () => {
249
- return (await import("./maps-D5QH3GHE.js")).zeroMapsCommand;
257
+ return (await import("./maps-BRFCMUY7.js")).zeroMapsCommand;
250
258
  }
251
259
  },
252
260
  {
253
261
  name: "banking",
254
262
  description: "Use managed zero banking services",
255
263
  load: async () => {
256
- return (await import("./banking-2CDU223M.js")).zeroBankingCommand;
264
+ return (await import("./banking-PPUSVFJQ.js")).zeroBankingCommand;
257
265
  }
258
266
  }
259
267
  ];
@@ -335,6 +343,7 @@ function buildZeroHelpText(payload = decodeZeroTokenPayload()) {
335
343
  " Model routing? zero model-provider ls",
336
344
  " Update yourself? zero agent --help",
337
345
  " Manage workflows? zero workflow --help",
346
+ ...shouldHideCommand("chat", payload) ? [] : [' Rename this chat? zero chat rename "New title"'],
338
347
  " List generators? zero generate --help",
339
348
  ' Generate image? zero generate image --prompt "..."',
340
349
  ' Generate website? zero generate website --prompt "..."',
@@ -361,7 +370,7 @@ function registerZeroCommands(prog, commands) {
361
370
  var program = new Command();
362
371
  program.name("zero").description(
363
372
  "Zero CLI \u2014 interact with the zero platform from inside the sandbox"
364
- ).version("9.215.3").addHelpText("after", () => {
373
+ ).version("9.217.0").addHelpText("after", () => {
365
374
  return buildZeroHelpText();
366
375
  });
367
376
  if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
package/zero.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/zero.ts"],"sourcesContent":["// Zero CLI entry point - standalone binary for zero platform commands\n// Sentry must be initialized before any other imports\nimport \"./instrument.js\";\nimport { Command } from \"commander\";\nimport { configureGlobalProxyFromEnv } from \"./lib/network/proxy.js\";\nimport {\n decodeZeroTokenPayload,\n type ZeroTokenPayload,\n} from \"./lib/api/zero-token.js\";\n\ninterface ZeroCommandDefinition {\n name: string;\n description: string;\n load: () => Promise<Command>;\n}\n\n/**\n * Map of command names to the capability required to see them.\n * Commands not in this map are hidden when ZERO_TOKEN is active.\n * Use an array when a top-level command has subcommands with different\n * capability gates and any one of them should make the command visible.\n * Use `null` for commands that should always be visible in sandbox.\n */\nconst COMMAND_CAPABILITY_MAP: Record<\n string,\n string | readonly string[] | null\n> = {\n agent: \"agent:read\",\n workflow: \"agent:read\",\n goal: [\"goal:read\", \"goal:agent-result:write\", \"goal:user-control:write\"],\n connector: \"connector:read\",\n // \"schedule\" is deliberately absent: the rename stub stays out of\n // token-scoped (agent) help but remains invokable and visible to humans.\n automation: \"automation:read\",\n doctor: null,\n credit: \"billing:write\",\n model: null,\n \"model-provider\": null,\n logs: \"agent-run:read\",\n search: \"chat-message:read\",\n resource: null,\n github: [\"github:read\", \"github:write\"],\n slack: \"slack:write\",\n telegram: [\"telegram:read\", \"telegram:write\"],\n phone: [\"phone:read\", \"phone:write\"],\n whoami: null,\n \"developer-support\": null,\n \"computer-use\": \"computer-use:write\",\n generate: null,\n web: null,\n video: null,\n host: [\"host:read\", \"host:write\"],\n maps: \"maps:read\",\n banking: \"banking:read\",\n};\n\nconst ZERO_COMMAND_DEFINITIONS: readonly ZeroCommandDefinition[] = [\n {\n name: \"org\",\n description: \"Manage organization settings, members, and providers\",\n load: async () => {\n return (await import(\"./commands/zero/org\")).zeroOrgCommand;\n },\n },\n {\n name: \"model\",\n description: \"List available models and model-switching guidance\",\n load: async () => {\n return (await import(\"./commands/zero/model\")).zeroModelCommand;\n },\n },\n {\n name: \"model-provider\",\n description: \"Inspect model provider routing\",\n load: async () => {\n return (await import(\"./commands/zero/model-provider\"))\n .zeroModelProviderCommand;\n },\n },\n {\n name: \"agent\",\n description: \"View or manage zero agents\",\n load: async () => {\n return (await import(\"./commands/zero/agent\")).zeroAgentCommand;\n },\n },\n {\n name: \"connector\",\n description: \"Check third-party service connections (GitHub, Slack, etc.)\",\n load: async () => {\n return (await import(\"./commands/zero/connector\")).zeroConnectorCommand;\n },\n },\n {\n name: \"credit\",\n description: \"Create a Stripe checkout link to buy credits\",\n load: async () => {\n return (await import(\"./commands/zero/credit\")).zeroCreditCommand;\n },\n },\n {\n name: \"doctor\",\n description:\n \"Diagnose runtime issues (connector health, permission denials)\",\n load: async () => {\n return (await import(\"./commands/zero/doctor\")).zeroDoctorCommand;\n },\n },\n {\n name: \"preference\",\n description: \"View or update user preferences (timezone, notifications)\",\n load: async () => {\n return (await import(\"./commands/zero/preference\")).zeroPreferenceCommand;\n },\n },\n {\n name: \"schedule\",\n description:\n \"(removed: use `zero automation`) Schedules are Automations now\",\n load: async () => {\n return (await import(\"./commands/zero/schedule\")).zeroScheduleCommand;\n },\n },\n {\n name: \"automation\",\n description: \"Create or manage scheduled automations\",\n load: async () => {\n return (await import(\"./commands/zero/automation\")).zeroAutomationCommand;\n },\n },\n {\n name: \"secret\",\n description: \"Read or write secrets (API keys, tokens)\",\n load: async () => {\n return (await import(\"./commands/zero/secret\")).zeroSecretCommand;\n },\n },\n {\n name: \"github\",\n description: \"Manage GitHub integration files and label listeners\",\n load: async () => {\n return (await import(\"./commands/zero/github\")).zeroGithubCommand;\n },\n },\n {\n name: \"slack\",\n description:\n \"Send messages, upload files, and download files from Slack as the bot\",\n load: async () => {\n return (await import(\"./commands/zero/slack\")).zeroSlackCommand;\n },\n },\n {\n name: \"telegram\",\n description:\n \"Inspect bots, send messages, upload files, and download files from Telegram\",\n load: async () => {\n return (await import(\"./commands/zero/telegram\")).zeroTelegramCommand;\n },\n },\n {\n name: \"phone\",\n description: \"Send AgentPhone messages, upload files, and download media\",\n load: async () => {\n return (await import(\"./commands/zero/phone\")).zeroPhoneCommand;\n },\n },\n {\n name: \"variable\",\n description: \"Read or write non-sensitive configuration values\",\n load: async () => {\n return (await import(\"./commands/zero/variable\")).zeroVariableCommand;\n },\n },\n {\n name: \"logs\",\n description: \"View and search agent run logs\",\n load: async () => {\n return (await import(\"./commands/zero/logs\")).zeroLogsCommand;\n },\n },\n {\n name: \"search\",\n description: \"Search logs, chat, or get a recipe for external sources\",\n load: async () => {\n return (await import(\"./commands/zero/search\")).zeroSearchCommand;\n },\n },\n {\n name: \"resource\",\n description: \"Pull registry resources from private R2-backed archives\",\n load: async () => {\n return (await import(\"./commands/zero/resource\")).zeroResourceCommand;\n },\n },\n {\n name: \"whoami\",\n description: \"Show agent identity, run ID, and capabilities\",\n load: async () => {\n return (await import(\"./commands/zero/whoami\")).zeroWhoamiCommand;\n },\n },\n {\n name: \"workflow\",\n description: \"Manage workflows\",\n load: async () => {\n return (await import(\"./commands/zero/workflow\")).zeroWorkflowCommand;\n },\n },\n {\n name: \"goal\",\n description: \"Manage the current thread goal\",\n load: async () => {\n return (await import(\"./commands/zero/goal\")).zeroGoalCommand;\n },\n },\n {\n name: \"developer-support\",\n description: \"Submit a diagnostic report to the dev team\",\n load: async () => {\n return (await import(\"./commands/zero/developer-support\"))\n .zeroDeveloperSupportCommand;\n },\n },\n {\n name: \"computer-use\",\n description: \"Desktop app computer use through Zero CLI\",\n load: async () => {\n return (await import(\"./commands/zero/computer-use\"))\n .zeroComputerUseCommand;\n },\n },\n {\n name: \"generate\",\n description:\n \"Generate assets via vm0's built-in pipelines or get connector skill-invocation guidance\",\n load: async () => {\n return (await import(\"./commands/zero/generate\")).generateCommand;\n },\n },\n {\n name: \"web\",\n description: \"Upload and download files via the web chat endpoint\",\n load: async () => {\n return (await import(\"./commands/zero/web\")).zeroWebCommand;\n },\n },\n {\n name: \"video\",\n description: \"Video processing utilities\",\n load: async () => {\n return (await import(\"./commands/zero/video\")).zeroVideoCommand;\n },\n },\n {\n name: \"host\",\n description: \"Publish static sites and clone owned hosted site files\",\n load: async () => {\n return (await import(\"./commands/zero/host\")).zeroHostCommand;\n },\n },\n {\n name: \"maps\",\n description: \"Use managed zero maps services\",\n load: async () => {\n return (await import(\"./commands/zero/maps\")).zeroMapsCommand;\n },\n },\n {\n name: \"banking\",\n description: \"Use managed zero banking services\",\n load: async () => {\n return (await import(\"./commands/zero/banking\")).zeroBankingCommand;\n },\n },\n];\n\nconst ZERO_COMMAND_DEFINITION_BY_NAME = new Map(\n ZERO_COMMAND_DEFINITIONS.map((definition) => {\n return [definition.name, definition];\n }),\n);\n\nfunction createZeroCommandStub(definition: ZeroCommandDefinition): Command {\n return new Command(definition.name).description(definition.description);\n}\n\nfunction buildDefaultCommands(): Command[] {\n return ZERO_COMMAND_DEFINITIONS.map(createZeroCommandStub);\n}\n\nfunction shouldHideCommand(\n name: string,\n payload: ZeroTokenPayload | undefined,\n): boolean {\n if (!payload) return false;\n const requiredCap = COMMAND_CAPABILITY_MAP[name];\n if (requiredCap === undefined) return true;\n if (requiredCap === null) return false;\n if (typeof requiredCap !== \"string\") {\n return !requiredCap.some((capability) => {\n return payload.capabilities.includes(capability);\n });\n }\n return !payload.capabilities.includes(requiredCap);\n}\n\nfunction addZeroCommand(\n prog: Command,\n cmd: Command,\n payload: ZeroTokenPayload | undefined,\n): void {\n const hidden = shouldHideCommand(cmd.name(), payload);\n prog.addCommand(cmd, hidden ? { hidden: true } : {});\n}\n\nfunction getNonOptionArgs(argv: string[]): string[] {\n const args: string[] = [];\n\n for (const arg of argv.slice(2)) {\n if (arg === \"--\") {\n break;\n }\n if (arg.startsWith(\"-\")) {\n continue;\n }\n args.push(arg);\n }\n\n return args;\n}\n\nfunction getRequestedZeroCommandName(argv = process.argv): string | undefined {\n const [firstArg, secondArg] = getNonOptionArgs(argv);\n\n if (!firstArg) {\n return undefined;\n }\n\n if (firstArg === \"help\") {\n return secondArg;\n }\n\n return firstArg;\n}\n\nasync function loadZeroCommand(\n name: string | undefined,\n): Promise<Command | undefined> {\n if (!name) {\n return undefined;\n }\n\n return ZERO_COMMAND_DEFINITION_BY_NAME.get(name)?.load();\n}\n\nexport function buildZeroHelpText(\n payload: ZeroTokenPayload | undefined = decodeZeroTokenPayload(),\n): string {\n const canReadHost = !payload || payload.capabilities.includes(\"host:read\");\n const canWriteHost = !payload || payload.capabilities.includes(\"host:write\");\n const examples = [\n \" Check a connector? zero doctor check-connector --env-name <ENV_NAME>\",\n ...(payload && !payload.capabilities.includes(\"billing:read\")\n ? []\n : [\" Check credits? zero doctor credit\"]),\n ...(shouldHideCommand(\"credit\", payload)\n ? []\n : [\" Buy credits? zero credit 20000\"]),\n \" Send a Slack message? zero slack message send --help\",\n \" Upload GitHub? zero github upload-file --help\",\n \" Download GitHub? zero github download-file --help\",\n \" List Telegram bots? zero telegram bot list\",\n \" Send Telegram? zero telegram message send --help\",\n \" Upload Telegram? zero telegram upload-file --help\",\n \" Download Telegram? zero telegram download-file --help\",\n \" Send AgentPhone? zero phone message --help\",\n \" Upload AgentPhone? zero phone upload-file --help\",\n \" Download AgentPhone? zero phone download-file --help\",\n \" Automate a task? zero automation create --help\",\n \" List models? zero model ls\",\n \" Model routing? zero model-provider ls\",\n \" Update yourself? zero agent --help\",\n \" Manage workflows? zero workflow --help\",\n \" List generators? zero generate --help\",\n ' Generate image? zero generate image --prompt \"...\"',\n ' Generate website? zero generate website --prompt \"...\"',\n ' Generate voice? zero generate voice --prompt \"...\"',\n ...(canWriteHost\n ? [\" Host a static site? zero host ./dist --site my-site --spa\"]\n : []),\n ...(canReadHost\n ? [\" Clone hosted site? zero host clone <public-slug>\"]\n : []),\n ...(shouldHideCommand(\"maps\", payload)\n ? []\n : [\n ' Get directions? zero maps directions --origin \"SFO\" --destination \"Mountain View\" --json',\n ]),\n ...(shouldHideCommand(\"banking\", payload)\n ? []\n : [\" Read bank data? zero banking accounts --json\"]),\n \" Check your identity? zero whoami\",\n ];\n\n return `\\nExamples:\\n${examples.join(\"\\n\")}`;\n}\n\n/**\n * Register commands with visibility based on ZERO_TOKEN capabilities.\n * Commands not granted by the token are registered as hidden via\n * Commander's public `addCommand(cmd, { hidden: true })` API.\n * When no ZERO_TOKEN is present, all commands remain visible.\n *\n * @param commands - override default commands (used in tests)\n */\nexport function registerZeroCommands(\n prog: Command,\n commands?: Command[],\n): void {\n const token = process.env.ZERO_TOKEN;\n const payload = token ? decodeZeroTokenPayload(token) : undefined;\n\n for (const cmd of commands ?? buildDefaultCommands()) {\n addZeroCommand(prog, cmd, payload);\n }\n}\n\nconst program = new Command();\n\ndeclare const __CLI_VERSION__: string;\n\nprogram\n .name(\"zero\")\n .description(\n \"Zero CLI — interact with the zero platform from inside the sandbox\",\n )\n .version(__CLI_VERSION__)\n .addHelpText(\"after\", () => {\n return buildZeroHelpText();\n });\n\nexport { program };\n\nif (\n process.argv[1]?.endsWith(\"zero.js\") ||\n process.argv[1]?.endsWith(\"zero.ts\") ||\n process.argv[1]?.endsWith(\"zero\")\n) {\n await configureGlobalProxyFromEnv();\n const requestedCommand = await loadZeroCommand(getRequestedZeroCommandName());\n registerZeroCommands(\n program,\n requestedCommand ? [requestedCommand] : undefined,\n );\n program.parse();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAuBA,IAAM,yBAGF;AAAA,EACF,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM,CAAC,aAAa,2BAA2B,yBAAyB;AAAA,EACxE,WAAW;AAAA;AAAA;AAAA,EA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ACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA,GAAI,eACA,CAAC,gEAAgE,IACjE,CAAC;AAAA,IACL,GAAI,cACA,CAAC,wDAAwD,IACzD,CAAC;AAAA,IACL,GAAI,kBAAkB,QAAQ,OAAO,IACjC,CAAC,IACD;AAAA,MACE;AAAA,IACF;AAAA,IACJ,GAAI,kBAAkB,WAAW,OAAO,IACpC,CAAC,IACD,CAAC,sDAAsD;AAAA,IAC3D;AAAA,EACF;AAEA,SAAO;AAAA;AAAA,EAAgB,SAAS,KAAK,IAAI,CAAC;AAC5C;AAUO,SAAS,qBACd,MACA,UACM;AACN,QAAM,QAAQ,QAAQ,IAAI;AAC1B,QAAM,UAAU,QAAQ,uBAAuB,KAAK,IAAI;AAExD,aAAW,OAAO,YAAY,qBAAqB,GAAG;AACpD,mBAAe,MAAM,KAAK,OAAO;AAAA,EACnC;AACF;AAEA,IAAM,UAAU,IAAI,QAAQ;AAI5B,QACG,KAAK,MAAM,EACX;AAAA,EACC;AACF,EACC,QAAQ,SAAe,EACvB,YAAY,SAAS,MAAM;AAC1B,SAAO,kBAAkB;AAC3B,CAAC;AAIH,IACE,QAAQ,KAAK,CAAC,GAAG,SAAS,SAAS,KACnC,QAAQ,KAAK,CAAC,GAAG,SAAS,SAAS,KACnC,QAAQ,KAAK,CAAC,GAAG,SAAS,MAAM,GAChC;AACA,QAAM,4BAA4B;AAClC,QAAM,mBAAmB,MAAM,gBAAgB,4BAA4B,CAAC;AAC5E;AAAA,IACE;AAAA,IACA,mBAAmB,CAAC,gBAAgB,IAAI;AAAA,EAC1C;AACA,UAAQ,MAAM;AAChB;","names":[]}
1
+ {"version":3,"sources":["../src/zero.ts"],"sourcesContent":["// Zero CLI entry point - standalone binary for zero platform commands\n// Sentry must be initialized before any other imports\nimport \"./instrument.js\";\nimport { Command } from \"commander\";\nimport { configureGlobalProxyFromEnv } from \"./lib/network/proxy.js\";\nimport {\n decodeZeroTokenPayload,\n type ZeroTokenPayload,\n} from \"./lib/api/zero-token.js\";\n\ninterface ZeroCommandDefinition {\n name: string;\n description: string;\n load: () => Promise<Command>;\n}\n\n/**\n * Map of command names to the capability required to see them.\n * Commands not in this map are hidden when ZERO_TOKEN is active.\n * Use an array when a top-level command has subcommands with different\n * capability gates and any one of them should make the command visible.\n * Use `null` for commands that should always be visible in sandbox.\n */\nconst COMMAND_CAPABILITY_MAP: Record<\n string,\n string | readonly string[] | null\n> = {\n agent: \"agent:read\",\n workflow: \"agent:read\",\n goal: [\"goal:read\", \"goal:agent-result:write\", \"goal:user-control:write\"],\n connector: \"connector:read\",\n // \"schedule\" is deliberately absent: the rename stub stays out of\n // token-scoped (agent) help but remains invokable and visible to humans.\n automation: \"automation:read\",\n doctor: null,\n credit: \"billing:write\",\n model: null,\n \"model-provider\": null,\n logs: \"agent-run:read\",\n search: \"chat-message:read\",\n chat: [\"chat-thread:read\", \"chat-thread:write\"],\n resource: null,\n github: [\"github:read\", \"github:write\"],\n slack: \"slack:write\",\n telegram: [\"telegram:read\", \"telegram:write\"],\n phone: [\"phone:read\", \"phone:write\"],\n whoami: null,\n \"developer-support\": null,\n \"computer-use\": \"computer-use:write\",\n generate: null,\n web: null,\n video: null,\n host: [\"host:read\", \"host:write\"],\n maps: \"maps:read\",\n banking: \"banking:read\",\n};\n\nconst ZERO_COMMAND_DEFINITIONS: readonly ZeroCommandDefinition[] = [\n {\n name: \"org\",\n description: \"Manage organization settings, members, and providers\",\n load: async () => {\n return (await import(\"./commands/zero/org\")).zeroOrgCommand;\n },\n },\n {\n name: \"model\",\n description: \"List available models and model-switching guidance\",\n load: async () => {\n return (await import(\"./commands/zero/model\")).zeroModelCommand;\n },\n },\n {\n name: \"model-provider\",\n description: \"Inspect model provider routing\",\n load: async () => {\n return (await import(\"./commands/zero/model-provider\"))\n .zeroModelProviderCommand;\n },\n },\n {\n name: \"agent\",\n description: \"View or manage zero agents\",\n load: async () => {\n return (await import(\"./commands/zero/agent\")).zeroAgentCommand;\n },\n },\n {\n name: \"connector\",\n description: \"Check third-party service connections (GitHub, Slack, etc.)\",\n load: async () => {\n return (await import(\"./commands/zero/connector\")).zeroConnectorCommand;\n },\n },\n {\n name: \"credit\",\n description: \"Create a Stripe checkout link to buy credits\",\n load: async () => {\n return (await import(\"./commands/zero/credit\")).zeroCreditCommand;\n },\n },\n {\n name: \"doctor\",\n description:\n \"Diagnose runtime issues (connector health, permission denials)\",\n load: async () => {\n return (await import(\"./commands/zero/doctor\")).zeroDoctorCommand;\n },\n },\n {\n name: \"preference\",\n description: \"View or update user preferences (timezone, notifications)\",\n load: async () => {\n return (await import(\"./commands/zero/preference\")).zeroPreferenceCommand;\n },\n },\n {\n name: \"schedule\",\n description:\n \"(removed: use `zero automation`) Schedules are Automations now\",\n load: async () => {\n return (await import(\"./commands/zero/schedule\")).zeroScheduleCommand;\n },\n },\n {\n name: \"automation\",\n description: \"Create or manage scheduled automations\",\n load: async () => {\n return (await import(\"./commands/zero/automation\")).zeroAutomationCommand;\n },\n },\n {\n name: \"secret\",\n description: \"Read or write secrets (API keys, tokens)\",\n load: async () => {\n return (await import(\"./commands/zero/secret\")).zeroSecretCommand;\n },\n },\n {\n name: \"github\",\n description: \"Manage GitHub integration files and label listeners\",\n load: async () => {\n return (await import(\"./commands/zero/github\")).zeroGithubCommand;\n },\n },\n {\n name: \"slack\",\n description:\n \"Send messages, upload files, and download files from Slack as the bot\",\n load: async () => {\n return (await import(\"./commands/zero/slack\")).zeroSlackCommand;\n },\n },\n {\n name: \"telegram\",\n description:\n \"Inspect bots, send messages, upload files, and download files from Telegram\",\n load: async () => {\n return (await import(\"./commands/zero/telegram\")).zeroTelegramCommand;\n },\n },\n {\n name: \"phone\",\n description: \"Send AgentPhone messages, upload files, and download media\",\n load: async () => {\n return (await import(\"./commands/zero/phone\")).zeroPhoneCommand;\n },\n },\n {\n name: \"variable\",\n description: \"Read or write non-sensitive configuration values\",\n load: async () => {\n return (await import(\"./commands/zero/variable\")).zeroVariableCommand;\n },\n },\n {\n name: \"logs\",\n description: \"View and search agent run logs\",\n load: async () => {\n return (await import(\"./commands/zero/logs\")).zeroLogsCommand;\n },\n },\n {\n name: \"search\",\n description: \"Search logs, chat, or get a recipe for external sources\",\n load: async () => {\n return (await import(\"./commands/zero/search\")).zeroSearchCommand;\n },\n },\n {\n name: \"chat\",\n description: \"Manage the current web chat thread\",\n load: async () => {\n return (await import(\"./commands/zero/chat\")).zeroChatCommand;\n },\n },\n {\n name: \"resource\",\n description: \"Pull registry resources from private R2-backed archives\",\n load: async () => {\n return (await import(\"./commands/zero/resource\")).zeroResourceCommand;\n },\n },\n {\n name: \"whoami\",\n description: \"Show agent identity, run ID, and capabilities\",\n load: async () => {\n return (await import(\"./commands/zero/whoami\")).zeroWhoamiCommand;\n },\n },\n {\n name: \"workflow\",\n description: \"Manage workflows\",\n load: async () => {\n return (await import(\"./commands/zero/workflow\")).zeroWorkflowCommand;\n },\n },\n {\n name: \"goal\",\n description: \"Manage the current thread goal\",\n load: async () => {\n return (await import(\"./commands/zero/goal\")).zeroGoalCommand;\n },\n },\n {\n name: \"developer-support\",\n description: \"Submit a diagnostic report to the dev team\",\n load: async () => {\n return (await import(\"./commands/zero/developer-support\"))\n .zeroDeveloperSupportCommand;\n },\n },\n {\n name: \"computer-use\",\n description: \"Desktop app computer use through Zero CLI\",\n load: async () => {\n return (await import(\"./commands/zero/computer-use\"))\n .zeroComputerUseCommand;\n },\n },\n {\n name: \"generate\",\n description:\n \"Generate assets via vm0's built-in pipelines or get connector skill-invocation guidance\",\n load: async () => {\n return (await import(\"./commands/zero/generate\")).generateCommand;\n },\n },\n {\n name: \"web\",\n description: \"Upload and download files via the web chat endpoint\",\n load: async () => {\n return (await import(\"./commands/zero/web\")).zeroWebCommand;\n },\n },\n {\n name: \"video\",\n description: \"Video processing utilities\",\n load: async () => {\n return (await import(\"./commands/zero/video\")).zeroVideoCommand;\n },\n },\n {\n name: \"host\",\n description: \"Publish static sites and clone owned hosted site files\",\n load: async () => {\n return (await import(\"./commands/zero/host\")).zeroHostCommand;\n },\n },\n {\n name: \"maps\",\n description: \"Use managed zero maps services\",\n load: async () => {\n return (await import(\"./commands/zero/maps\")).zeroMapsCommand;\n },\n },\n {\n name: \"banking\",\n description: \"Use managed zero banking services\",\n load: async () => {\n return (await import(\"./commands/zero/banking\")).zeroBankingCommand;\n },\n },\n];\n\nconst ZERO_COMMAND_DEFINITION_BY_NAME = new Map(\n ZERO_COMMAND_DEFINITIONS.map((definition) => {\n return [definition.name, definition];\n }),\n);\n\nfunction createZeroCommandStub(definition: ZeroCommandDefinition): Command {\n return new Command(definition.name).description(definition.description);\n}\n\nfunction buildDefaultCommands(): Command[] {\n return ZERO_COMMAND_DEFINITIONS.map(createZeroCommandStub);\n}\n\nfunction shouldHideCommand(\n name: string,\n payload: ZeroTokenPayload | undefined,\n): boolean {\n if (!payload) return false;\n const requiredCap = COMMAND_CAPABILITY_MAP[name];\n if (requiredCap === undefined) return true;\n if (requiredCap === null) return false;\n if (typeof requiredCap !== \"string\") {\n return !requiredCap.some((capability) => {\n return payload.capabilities.includes(capability);\n });\n }\n return !payload.capabilities.includes(requiredCap);\n}\n\nfunction addZeroCommand(\n prog: Command,\n cmd: Command,\n payload: ZeroTokenPayload | undefined,\n): void {\n const hidden = shouldHideCommand(cmd.name(), payload);\n prog.addCommand(cmd, hidden ? { hidden: true } : {});\n}\n\nfunction getNonOptionArgs(argv: string[]): string[] {\n const args: string[] = [];\n\n for (const arg of argv.slice(2)) {\n if (arg === \"--\") {\n break;\n }\n if (arg.startsWith(\"-\")) {\n continue;\n }\n args.push(arg);\n }\n\n return args;\n}\n\nfunction getRequestedZeroCommandName(argv = process.argv): string | undefined {\n const [firstArg, secondArg] = getNonOptionArgs(argv);\n\n if (!firstArg) {\n return undefined;\n }\n\n if (firstArg === \"help\") {\n return secondArg;\n }\n\n return firstArg;\n}\n\nasync function loadZeroCommand(\n name: string | undefined,\n): Promise<Command | undefined> {\n if (!name) {\n return undefined;\n }\n\n return ZERO_COMMAND_DEFINITION_BY_NAME.get(name)?.load();\n}\n\nexport function buildZeroHelpText(\n payload: ZeroTokenPayload | undefined = decodeZeroTokenPayload(),\n): string {\n const canReadHost = !payload || payload.capabilities.includes(\"host:read\");\n const canWriteHost = !payload || payload.capabilities.includes(\"host:write\");\n const examples = [\n \" Check a connector? zero doctor check-connector --env-name <ENV_NAME>\",\n ...(payload && !payload.capabilities.includes(\"billing:read\")\n ? []\n : [\" Check credits? zero doctor credit\"]),\n ...(shouldHideCommand(\"credit\", payload)\n ? []\n : [\" Buy credits? zero credit 20000\"]),\n \" Send a Slack message? zero slack message send --help\",\n \" Upload GitHub? zero github upload-file --help\",\n \" Download GitHub? zero github download-file --help\",\n \" List Telegram bots? zero telegram bot list\",\n \" Send Telegram? zero telegram message send --help\",\n \" Upload Telegram? zero telegram upload-file --help\",\n \" Download Telegram? zero telegram download-file --help\",\n \" Send AgentPhone? zero phone message --help\",\n \" Upload AgentPhone? zero phone upload-file --help\",\n \" Download AgentPhone? zero phone download-file --help\",\n \" Automate a task? zero automation create --help\",\n \" List models? zero model ls\",\n \" Model routing? zero model-provider ls\",\n \" Update yourself? zero agent --help\",\n \" Manage workflows? zero workflow --help\",\n ...(shouldHideCommand(\"chat\", payload)\n ? []\n : [' Rename this chat? zero chat rename \"New title\"']),\n \" List generators? zero generate --help\",\n ' Generate image? zero generate image --prompt \"...\"',\n ' Generate website? zero generate website --prompt \"...\"',\n ' Generate voice? zero generate voice --prompt \"...\"',\n ...(canWriteHost\n ? [\" Host a static site? zero host ./dist --site my-site --spa\"]\n : []),\n ...(canReadHost\n ? [\" Clone hosted site? zero host clone <public-slug>\"]\n : []),\n ...(shouldHideCommand(\"maps\", payload)\n ? []\n : [\n ' Get directions? zero maps directions --origin \"SFO\" --destination \"Mountain View\" --json',\n ]),\n ...(shouldHideCommand(\"banking\", payload)\n ? []\n : [\" Read bank data? zero banking accounts --json\"]),\n \" Check your identity? zero whoami\",\n ];\n\n return `\\nExamples:\\n${examples.join(\"\\n\")}`;\n}\n\n/**\n * Register commands with visibility based on ZERO_TOKEN capabilities.\n * Commands not granted by the token are registered as hidden via\n * Commander's public `addCommand(cmd, { hidden: true })` API.\n * When no ZERO_TOKEN is present, all commands remain visible.\n *\n * @param commands - override default commands (used in tests)\n */\nexport function registerZeroCommands(\n prog: Command,\n commands?: Command[],\n): void {\n const token = process.env.ZERO_TOKEN;\n const payload = token ? decodeZeroTokenPayload(token) : undefined;\n\n for (const cmd of commands ?? buildDefaultCommands()) {\n addZeroCommand(prog, cmd, payload);\n }\n}\n\nconst program = new Command();\n\ndeclare const __CLI_VERSION__: string;\n\nprogram\n .name(\"zero\")\n .description(\n \"Zero CLI — interact with the zero platform from inside the sandbox\",\n )\n .version(__CLI_VERSION__)\n .addHelpText(\"after\", () => {\n return buildZeroHelpText();\n });\n\nexport { program };\n\nif (\n process.argv[1]?.endsWith(\"zero.js\") ||\n process.argv[1]?.endsWith(\"zero.ts\") ||\n process.argv[1]?.endsWith(\"zero\")\n) {\n await configureGlobalProxyFromEnv();\n const requestedCommand = await loadZeroCommand(getRequestedZeroCommandName());\n registerZeroCommands(\n program,\n requestedCommand ? [requestedCommand] : undefined,\n );\n program.parse();\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAuBA,IAAM,yBAGF;AAAA,EACF,OAAO;AAAA,EACP,UAAU;AAAA,EACV,MAAM,CAAC,aAAa,2BAA2B,yBAAyB;AAAA,EACxE,WAAW;AAAA;AAAA;AAAA,EAGX,YAAY;AAAA,EACZ,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,kBAAkB;AAAA,EAClB,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,MAAM,CAAC,oBAAoB,mBAAmB;AAAA,EAC9C,UAAU;AAAA,EACV,QAAQ,CAAC,eAAe,cAAc;AAAA,EACtC,OAAO;AAAA,EACP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