@vm0/cli 9.83.3 → 9.84.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.
- package/{chunk-IFUYTPFH.js → chunk-A5NPNEP5.js} +5513 -5757
- package/chunk-A5NPNEP5.js.map +1 -0
- package/index.js +10 -10
- package/package.json +1 -1
- package/zero.js +98 -47
- package/zero.js.map +1 -1
- package/chunk-IFUYTPFH.js.map +0 -1
package/index.js
CHANGED
|
@@ -51,7 +51,7 @@ import {
|
|
|
51
51
|
searchLogs,
|
|
52
52
|
volumeConfigSchema,
|
|
53
53
|
withErrorHandler
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-A5NPNEP5.js";
|
|
55
55
|
|
|
56
56
|
// src/index.ts
|
|
57
57
|
import { Command as Command44 } from "commander";
|
|
@@ -436,7 +436,7 @@ function getConfigPath() {
|
|
|
436
436
|
return join(homedir(), ".vm0", "config.json");
|
|
437
437
|
}
|
|
438
438
|
var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
|
|
439
|
-
console.log(chalk3.bold(`VM0 CLI v${"9.
|
|
439
|
+
console.log(chalk3.bold(`VM0 CLI v${"9.84.1"}`));
|
|
440
440
|
console.log();
|
|
441
441
|
const config = await loadConfig();
|
|
442
442
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -1662,7 +1662,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
1662
1662
|
options.autoUpdate = false;
|
|
1663
1663
|
}
|
|
1664
1664
|
if (options.autoUpdate !== false) {
|
|
1665
|
-
await startSilentUpgrade("9.
|
|
1665
|
+
await startSilentUpgrade("9.84.1");
|
|
1666
1666
|
}
|
|
1667
1667
|
try {
|
|
1668
1668
|
let result;
|
|
@@ -2497,7 +2497,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
2497
2497
|
withErrorHandler(
|
|
2498
2498
|
async (identifier, prompt, options) => {
|
|
2499
2499
|
if (options.autoUpdate !== false) {
|
|
2500
|
-
await startSilentUpgrade("9.
|
|
2500
|
+
await startSilentUpgrade("9.84.1");
|
|
2501
2501
|
}
|
|
2502
2502
|
const { org, name, version } = parseIdentifier(identifier);
|
|
2503
2503
|
let composeId;
|
|
@@ -4253,7 +4253,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
|
|
|
4253
4253
|
withErrorHandler(
|
|
4254
4254
|
async (prompt, options) => {
|
|
4255
4255
|
if (options.autoUpdate !== false) {
|
|
4256
|
-
const shouldExit = await checkAndUpgrade("9.
|
|
4256
|
+
const shouldExit = await checkAndUpgrade("9.84.1", prompt);
|
|
4257
4257
|
if (shouldExit) {
|
|
4258
4258
|
process.exit(0);
|
|
4259
4259
|
}
|
|
@@ -4993,13 +4993,13 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
|
|
|
4993
4993
|
if (latestVersion === null) {
|
|
4994
4994
|
throw new Error("Could not check for updates. Please try again later.");
|
|
4995
4995
|
}
|
|
4996
|
-
if (latestVersion === "9.
|
|
4997
|
-
console.log(chalk36.green(`\u2713 Already up to date (${"9.
|
|
4996
|
+
if (latestVersion === "9.84.1") {
|
|
4997
|
+
console.log(chalk36.green(`\u2713 Already up to date (${"9.84.1"})`));
|
|
4998
4998
|
return;
|
|
4999
4999
|
}
|
|
5000
5000
|
console.log(
|
|
5001
5001
|
chalk36.yellow(
|
|
5002
|
-
`Current version: ${"9.
|
|
5002
|
+
`Current version: ${"9.84.1"} -> Latest version: ${latestVersion}`
|
|
5003
5003
|
)
|
|
5004
5004
|
);
|
|
5005
5005
|
console.log();
|
|
@@ -5026,7 +5026,7 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
|
|
|
5026
5026
|
const success = await performUpgrade(packageManager);
|
|
5027
5027
|
if (success) {
|
|
5028
5028
|
console.log(
|
|
5029
|
-
chalk36.green(`\u2713 Upgraded from ${"9.
|
|
5029
|
+
chalk36.green(`\u2713 Upgraded from ${"9.84.1"} to ${latestVersion}`)
|
|
5030
5030
|
);
|
|
5031
5031
|
return;
|
|
5032
5032
|
}
|
|
@@ -5094,7 +5094,7 @@ var whoamiCommand = new Command43().name("whoami").description("Show current ide
|
|
|
5094
5094
|
|
|
5095
5095
|
// src/index.ts
|
|
5096
5096
|
var program = new Command44();
|
|
5097
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
5097
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.84.1");
|
|
5098
5098
|
program.addCommand(authCommand);
|
|
5099
5099
|
program.addCommand(infoCommand);
|
|
5100
5100
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
getBaseUrl,
|
|
30
30
|
getComposeByName,
|
|
31
31
|
getConnectorDerivedNames,
|
|
32
|
+
getConnectorTypeForSecretName,
|
|
32
33
|
getCustomModelPlaceholder,
|
|
33
34
|
getDefaultAuthMethod,
|
|
34
35
|
getDefaultModel,
|
|
@@ -81,10 +82,10 @@ import {
|
|
|
81
82
|
updateZeroUserPreferences,
|
|
82
83
|
upsertZeroOrgModelProvider,
|
|
83
84
|
withErrorHandler
|
|
84
|
-
} from "./chunk-
|
|
85
|
+
} from "./chunk-A5NPNEP5.js";
|
|
85
86
|
|
|
86
87
|
// src/zero.ts
|
|
87
|
-
import { Command as
|
|
88
|
+
import { Command as Command57 } from "commander";
|
|
88
89
|
|
|
89
90
|
// src/commands/zero/org/index.ts
|
|
90
91
|
import { Command as Command23 } from "commander";
|
|
@@ -1049,7 +1050,7 @@ var setDefaultCommand = new Command21().name("set-default").description("Set an
|
|
|
1049
1050
|
var zeroOrgModelProviderCommand = new Command22().name("model-provider").description("Manage org-level model providers").addCommand(listCommand4).addCommand(setupCommand).addCommand(removeCommand4).addCommand(setDefaultCommand);
|
|
1050
1051
|
|
|
1051
1052
|
// src/commands/zero/org/index.ts
|
|
1052
|
-
var zeroOrgCommand = new Command23().name("org").description("Manage
|
|
1053
|
+
var zeroOrgCommand = new Command23().name("org").description("Manage organization settings, members, and providers").addCommand(statusCommand).addCommand(setCommand).addCommand(listCommand).addCommand(useCommand).addCommand(membersCommand).addCommand(inviteCommand).addCommand(removeCommand).addCommand(leaveCommand).addCommand(deleteCommand).addCommand(zeroOrgSecretCommand).addCommand(zeroOrgVariableCommand).addCommand(zeroOrgModelProviderCommand);
|
|
1053
1054
|
|
|
1054
1055
|
// src/commands/zero/agent/index.ts
|
|
1055
1056
|
import { Command as Command29 } from "commander";
|
|
@@ -1217,7 +1218,16 @@ var deleteCommand2 = new Command28().name("delete").alias("rm").description("Del
|
|
|
1217
1218
|
);
|
|
1218
1219
|
|
|
1219
1220
|
// src/commands/zero/agent/index.ts
|
|
1220
|
-
var zeroAgentCommand = new Command29("agent").description("
|
|
1221
|
+
var zeroAgentCommand = new Command29("agent").description("View or manage zero agents").addCommand(createCommand).addCommand(editCommand).addCommand(viewCommand).addCommand(listCommand5).addCommand(deleteCommand2).addHelpText(
|
|
1222
|
+
"after",
|
|
1223
|
+
`
|
|
1224
|
+
Self-management (inside sandbox):
|
|
1225
|
+
Your agent ID is in $ZERO_AGENT_ID (or run: zero whoami)
|
|
1226
|
+
View your config: zero agent view $ZERO_AGENT_ID --instructions
|
|
1227
|
+
Update description: zero agent edit $ZERO_AGENT_ID --description "new role"
|
|
1228
|
+
Update tone: zero agent edit $ZERO_AGENT_ID --sound friendly
|
|
1229
|
+
Update instructions: zero agent edit $ZERO_AGENT_ID --instructions-file <path>`
|
|
1230
|
+
);
|
|
1221
1231
|
|
|
1222
1232
|
// src/commands/zero/connector/index.ts
|
|
1223
1233
|
import { Command as Command34 } from "commander";
|
|
@@ -1811,10 +1821,38 @@ var disconnectCommand = new Command33().name("disconnect").description("Disconne
|
|
|
1811
1821
|
);
|
|
1812
1822
|
|
|
1813
1823
|
// src/commands/zero/connector/index.ts
|
|
1814
|
-
var zeroConnectorCommand = new Command34().name("connector").description("
|
|
1824
|
+
var zeroConnectorCommand = new Command34().name("connector").description("Check or connect third-party services (GitHub, Slack, etc.)").addCommand(listCommand6).addCommand(statusCommand2).addCommand(connectCommand).addCommand(disconnectCommand);
|
|
1815
1825
|
|
|
1816
|
-
// src/commands/zero/
|
|
1826
|
+
// src/commands/zero/doctor/index.ts
|
|
1827
|
+
import { Command as Command36 } from "commander";
|
|
1828
|
+
|
|
1829
|
+
// src/commands/zero/doctor/missing-token.ts
|
|
1817
1830
|
import { Command as Command35 } from "commander";
|
|
1831
|
+
var missingTokenCommand = new Command35().name("missing-token").description(
|
|
1832
|
+
"Diagnose a missing token and find the connector that provides it"
|
|
1833
|
+
).argument("<token-name>", "The environment variable / token name to look up").action(
|
|
1834
|
+
withErrorHandler(async (tokenName) => {
|
|
1835
|
+
const connectorType = getConnectorTypeForSecretName(tokenName);
|
|
1836
|
+
if (!connectorType) {
|
|
1837
|
+
throw new Error(
|
|
1838
|
+
`Unknown token: ${tokenName} \u2014 not managed by any connector`
|
|
1839
|
+
);
|
|
1840
|
+
}
|
|
1841
|
+
const { label } = CONNECTOR_TYPES[connectorType];
|
|
1842
|
+
const baseUrl = await getApiUrl();
|
|
1843
|
+
const agentId = process.env.ZERO_AGENT_ID;
|
|
1844
|
+
const path = agentId ? `/team/${agentId}` : "/team";
|
|
1845
|
+
const url = `${baseUrl}${path}?tab=connectors`;
|
|
1846
|
+
console.log(`${tokenName} is provided by the ${label} connector.`);
|
|
1847
|
+
console.log(`Ask the user to connect it at: ${url}`);
|
|
1848
|
+
})
|
|
1849
|
+
);
|
|
1850
|
+
|
|
1851
|
+
// src/commands/zero/doctor/index.ts
|
|
1852
|
+
var zeroDoctorCommand = new Command36().name("doctor").description("Diagnose runtime issues (missing tokens, connectors)").addCommand(missingTokenCommand);
|
|
1853
|
+
|
|
1854
|
+
// src/commands/zero/preference/index.ts
|
|
1855
|
+
import { Command as Command37 } from "commander";
|
|
1818
1856
|
import chalk31 from "chalk";
|
|
1819
1857
|
function detectTimezone2() {
|
|
1820
1858
|
return Intl.DateTimeFormat().resolvedOptions().timeZone;
|
|
@@ -1871,7 +1909,7 @@ System timezone detected: ${detectedTz}`));
|
|
|
1871
1909
|
}
|
|
1872
1910
|
}
|
|
1873
1911
|
}
|
|
1874
|
-
var zeroPreferenceCommand = new
|
|
1912
|
+
var zeroPreferenceCommand = new Command37().name("preference").description("View or update user preferences (timezone, notifications)").option("--timezone <timezone>", "IANA timezone (e.g., America/New_York)").action(
|
|
1875
1913
|
withErrorHandler(async (opts) => {
|
|
1876
1914
|
const updates = buildUpdates(opts);
|
|
1877
1915
|
if (updates) {
|
|
@@ -1896,10 +1934,10 @@ var zeroPreferenceCommand = new Command35().name("preference").description("View
|
|
|
1896
1934
|
);
|
|
1897
1935
|
|
|
1898
1936
|
// src/commands/zero/schedule/index.ts
|
|
1899
|
-
import { Command as
|
|
1937
|
+
import { Command as Command44 } from "commander";
|
|
1900
1938
|
|
|
1901
1939
|
// src/commands/zero/schedule/setup.ts
|
|
1902
|
-
import { Command as
|
|
1940
|
+
import { Command as Command38 } from "commander";
|
|
1903
1941
|
import chalk32 from "chalk";
|
|
1904
1942
|
var FREQUENCY_CHOICES = [
|
|
1905
1943
|
{ title: "Daily", value: "daily", description: "Run every day" },
|
|
@@ -2330,7 +2368,7 @@ async function handleScheduleEnabling(params) {
|
|
|
2330
2368
|
showEnableHint(agentName);
|
|
2331
2369
|
}
|
|
2332
2370
|
}
|
|
2333
|
-
var setupCommand2 = new
|
|
2371
|
+
var setupCommand2 = new Command38().name("setup").description("Create or edit a schedule for a zero agent").argument("<agent-name>", "Agent name to configure schedule for").option("-n, --name <schedule-name>", 'Schedule name (default: "default")').option("-f, --frequency <type>", "Frequency: daily|weekly|monthly|once|loop").option("-t, --time <HH:MM>", "Time to run (24-hour format)").option("-d, --day <day>", "Day of week (mon-sun) or day of month (1-31)").option("-i, --interval <seconds>", "Interval in seconds for loop mode").option("-z, --timezone <tz>", "IANA timezone").option("-p, --prompt <text>", "Prompt to run").option("--artifact-name <name>", "Artifact name", "artifact").option("-e, --enable", "Enable schedule immediately after creation").option("--notify-email", "Enable email notifications (default: true)").option("--no-notify-email", "Disable email notifications").option("--notify-slack", "Enable Slack notifications (default: true)").option("--no-notify-slack", "Disable Slack notifications").action(
|
|
2334
2372
|
withErrorHandler(async (agentName, options) => {
|
|
2335
2373
|
const compose = await getComposeByName(agentName);
|
|
2336
2374
|
if (!compose) {
|
|
@@ -2411,9 +2449,9 @@ var setupCommand2 = new Command36().name("setup").description("Create or edit a
|
|
|
2411
2449
|
);
|
|
2412
2450
|
|
|
2413
2451
|
// src/commands/zero/schedule/list.ts
|
|
2414
|
-
import { Command as
|
|
2452
|
+
import { Command as Command39 } from "commander";
|
|
2415
2453
|
import chalk33 from "chalk";
|
|
2416
|
-
var listCommand7 = new
|
|
2454
|
+
var listCommand7 = new Command39().name("list").alias("ls").description("List all zero schedules").action(
|
|
2417
2455
|
withErrorHandler(async () => {
|
|
2418
2456
|
const result = await listZeroSchedules();
|
|
2419
2457
|
if (result.schedules.length === 0) {
|
|
@@ -2462,7 +2500,7 @@ var listCommand7 = new Command37().name("list").alias("ls").description("List al
|
|
|
2462
2500
|
);
|
|
2463
2501
|
|
|
2464
2502
|
// src/commands/zero/schedule/status.ts
|
|
2465
|
-
import { Command as
|
|
2503
|
+
import { Command as Command40 } from "commander";
|
|
2466
2504
|
import chalk34 from "chalk";
|
|
2467
2505
|
function formatDateTimeStyled(dateStr) {
|
|
2468
2506
|
if (!dateStr) return chalk34.dim("-");
|
|
@@ -2521,7 +2559,7 @@ function printTimeSchedule(schedule) {
|
|
|
2521
2559
|
console.log(`${"Failures:".padEnd(16)}${failureText}`);
|
|
2522
2560
|
}
|
|
2523
2561
|
}
|
|
2524
|
-
var statusCommand3 = new
|
|
2562
|
+
var statusCommand3 = new Command40().name("status").description("Show detailed status of a zero schedule").argument("<agent-name>", "Agent name").option(
|
|
2525
2563
|
"-n, --name <schedule-name>",
|
|
2526
2564
|
"Schedule name (required when agent has multiple schedules)"
|
|
2527
2565
|
).action(
|
|
@@ -2540,9 +2578,9 @@ var statusCommand3 = new Command38().name("status").description("Show detailed s
|
|
|
2540
2578
|
);
|
|
2541
2579
|
|
|
2542
2580
|
// src/commands/zero/schedule/delete.ts
|
|
2543
|
-
import { Command as
|
|
2581
|
+
import { Command as Command41 } from "commander";
|
|
2544
2582
|
import chalk35 from "chalk";
|
|
2545
|
-
var deleteCommand3 = new
|
|
2583
|
+
var deleteCommand3 = new Command41().name("delete").alias("rm").description("Delete a zero schedule").argument("<agent-name>", "Agent name").option(
|
|
2546
2584
|
"-n, --name <schedule-name>",
|
|
2547
2585
|
"Schedule name (required when agent has multiple schedules)"
|
|
2548
2586
|
).option("-y, --yes", "Skip confirmation prompt").action(
|
|
@@ -2575,9 +2613,9 @@ var deleteCommand3 = new Command39().name("delete").alias("rm").description("Del
|
|
|
2575
2613
|
);
|
|
2576
2614
|
|
|
2577
2615
|
// src/commands/zero/schedule/enable.ts
|
|
2578
|
-
import { Command as
|
|
2616
|
+
import { Command as Command42 } from "commander";
|
|
2579
2617
|
import chalk36 from "chalk";
|
|
2580
|
-
var enableCommand = new
|
|
2618
|
+
var enableCommand = new Command42().name("enable").description("Enable a zero schedule").argument("<agent-name>", "Agent name").option(
|
|
2581
2619
|
"-n, --name <schedule-name>",
|
|
2582
2620
|
"Schedule name (required when agent has multiple schedules)"
|
|
2583
2621
|
).action(
|
|
@@ -2595,9 +2633,9 @@ var enableCommand = new Command40().name("enable").description("Enable a zero sc
|
|
|
2595
2633
|
);
|
|
2596
2634
|
|
|
2597
2635
|
// src/commands/zero/schedule/disable.ts
|
|
2598
|
-
import { Command as
|
|
2636
|
+
import { Command as Command43 } from "commander";
|
|
2599
2637
|
import chalk37 from "chalk";
|
|
2600
|
-
var disableCommand = new
|
|
2638
|
+
var disableCommand = new Command43().name("disable").description("Disable a zero schedule").argument("<agent-name>", "Agent name").option(
|
|
2601
2639
|
"-n, --name <schedule-name>",
|
|
2602
2640
|
"Schedule name (required when agent has multiple schedules)"
|
|
2603
2641
|
).action(
|
|
@@ -2615,15 +2653,15 @@ var disableCommand = new Command41().name("disable").description("Disable a zero
|
|
|
2615
2653
|
);
|
|
2616
2654
|
|
|
2617
2655
|
// src/commands/zero/schedule/index.ts
|
|
2618
|
-
var zeroScheduleCommand = new
|
|
2656
|
+
var zeroScheduleCommand = new Command44().name("schedule").description("Create or manage recurring scheduled tasks").addCommand(setupCommand2).addCommand(listCommand7).addCommand(statusCommand3).addCommand(deleteCommand3).addCommand(enableCommand).addCommand(disableCommand);
|
|
2619
2657
|
|
|
2620
2658
|
// src/commands/zero/secret/index.ts
|
|
2621
|
-
import { Command as
|
|
2659
|
+
import { Command as Command48 } from "commander";
|
|
2622
2660
|
|
|
2623
2661
|
// src/commands/zero/secret/list.ts
|
|
2624
|
-
import { Command as
|
|
2662
|
+
import { Command as Command45 } from "commander";
|
|
2625
2663
|
import chalk38 from "chalk";
|
|
2626
|
-
var listCommand8 = new
|
|
2664
|
+
var listCommand8 = new Command45().name("list").alias("ls").description("List all secrets").action(
|
|
2627
2665
|
withErrorHandler(async () => {
|
|
2628
2666
|
const result = await listZeroSecrets();
|
|
2629
2667
|
if (result.secrets.length === 0) {
|
|
@@ -2676,9 +2714,9 @@ var listCommand8 = new Command43().name("list").alias("ls").description("List al
|
|
|
2676
2714
|
);
|
|
2677
2715
|
|
|
2678
2716
|
// src/commands/zero/secret/set.ts
|
|
2679
|
-
import { Command as
|
|
2717
|
+
import { Command as Command46 } from "commander";
|
|
2680
2718
|
import chalk39 from "chalk";
|
|
2681
|
-
var setCommand4 = new
|
|
2719
|
+
var setCommand4 = new Command46().name("set").description("Create or update a secret").argument("<name>", "Secret name (uppercase, e.g., MY_API_KEY)").option(
|
|
2682
2720
|
"-b, --body <value>",
|
|
2683
2721
|
"Secret value (required in non-interactive mode)"
|
|
2684
2722
|
).option("-d, --description <description>", "Optional description").action(
|
|
@@ -2724,9 +2762,9 @@ var setCommand4 = new Command44().name("set").description("Create or update a se
|
|
|
2724
2762
|
);
|
|
2725
2763
|
|
|
2726
2764
|
// src/commands/zero/secret/delete.ts
|
|
2727
|
-
import { Command as
|
|
2765
|
+
import { Command as Command47 } from "commander";
|
|
2728
2766
|
import chalk40 from "chalk";
|
|
2729
|
-
var deleteCommand4 = new
|
|
2767
|
+
var deleteCommand4 = new Command47().name("delete").description("Delete a secret").argument("<name>", "Secret name to delete").option("-y, --yes", "Skip confirmation prompt").action(
|
|
2730
2768
|
withErrorHandler(async (name, options) => {
|
|
2731
2769
|
if (!options.yes) {
|
|
2732
2770
|
if (!isInteractive()) {
|
|
@@ -2747,19 +2785,19 @@ var deleteCommand4 = new Command45().name("delete").description("Delete a secret
|
|
|
2747
2785
|
);
|
|
2748
2786
|
|
|
2749
2787
|
// src/commands/zero/secret/index.ts
|
|
2750
|
-
var zeroSecretCommand = new
|
|
2788
|
+
var zeroSecretCommand = new Command48().name("secret").description("Read or write secrets (API keys, tokens)").addCommand(listCommand8).addCommand(setCommand4).addCommand(deleteCommand4);
|
|
2751
2789
|
|
|
2752
2790
|
// src/commands/zero/slack/index.ts
|
|
2753
|
-
import { Command as
|
|
2791
|
+
import { Command as Command51 } from "commander";
|
|
2754
2792
|
|
|
2755
2793
|
// src/commands/zero/slack/message/index.ts
|
|
2756
|
-
import { Command as
|
|
2794
|
+
import { Command as Command50 } from "commander";
|
|
2757
2795
|
|
|
2758
2796
|
// src/commands/zero/slack/message/send.ts
|
|
2759
2797
|
import { readFileSync as readFileSync3 } from "fs";
|
|
2760
|
-
import { Command as
|
|
2798
|
+
import { Command as Command49 } from "commander";
|
|
2761
2799
|
import chalk41 from "chalk";
|
|
2762
|
-
var sendCommand = new
|
|
2800
|
+
var sendCommand = new Command49().name("send").description("Send a message to a Slack channel").requiredOption("-c, --channel <id>", "Channel ID").option("-t, --text <message>", "Message text").option("--thread <ts>", "Thread timestamp for replies").option("--blocks <json>", "Block Kit JSON string").action(
|
|
2763
2801
|
withErrorHandler(
|
|
2764
2802
|
async (options) => {
|
|
2765
2803
|
let text = options.text;
|
|
@@ -2799,16 +2837,16 @@ var sendCommand = new Command47().name("send").description("Send a message to a
|
|
|
2799
2837
|
);
|
|
2800
2838
|
|
|
2801
2839
|
// src/commands/zero/slack/message/index.ts
|
|
2802
|
-
var zeroSlackMessageCommand = new
|
|
2840
|
+
var zeroSlackMessageCommand = new Command50().name("message").description("Manage Slack messages").addCommand(sendCommand);
|
|
2803
2841
|
|
|
2804
2842
|
// src/commands/zero/slack/index.ts
|
|
2805
|
-
var zeroSlackCommand = new
|
|
2843
|
+
var zeroSlackCommand = new Command51().name("slack").description("Send messages to Slack channels as the bot").addCommand(zeroSlackMessageCommand);
|
|
2806
2844
|
|
|
2807
2845
|
// src/commands/zero/variable/index.ts
|
|
2808
|
-
import { Command as
|
|
2846
|
+
import { Command as Command55 } from "commander";
|
|
2809
2847
|
|
|
2810
2848
|
// src/commands/zero/variable/list.ts
|
|
2811
|
-
import { Command as
|
|
2849
|
+
import { Command as Command52 } from "commander";
|
|
2812
2850
|
import chalk42 from "chalk";
|
|
2813
2851
|
function truncateValue2(value, maxLength = 60) {
|
|
2814
2852
|
if (value.length <= maxLength) {
|
|
@@ -2816,7 +2854,7 @@ function truncateValue2(value, maxLength = 60) {
|
|
|
2816
2854
|
}
|
|
2817
2855
|
return value.slice(0, maxLength - 15) + "... [truncated]";
|
|
2818
2856
|
}
|
|
2819
|
-
var listCommand9 = new
|
|
2857
|
+
var listCommand9 = new Command52().name("list").alias("ls").description("List all variables").action(
|
|
2820
2858
|
withErrorHandler(async () => {
|
|
2821
2859
|
const result = await listZeroVariables();
|
|
2822
2860
|
if (result.variables.length === 0) {
|
|
@@ -2844,9 +2882,9 @@ var listCommand9 = new Command50().name("list").alias("ls").description("List al
|
|
|
2844
2882
|
);
|
|
2845
2883
|
|
|
2846
2884
|
// src/commands/zero/variable/set.ts
|
|
2847
|
-
import { Command as
|
|
2885
|
+
import { Command as Command53 } from "commander";
|
|
2848
2886
|
import chalk43 from "chalk";
|
|
2849
|
-
var setCommand5 = new
|
|
2887
|
+
var setCommand5 = new Command53().name("set").description("Create or update a variable").argument("<name>", "Variable name (uppercase, e.g., MY_VAR)").argument("<value>", "Variable value").option("-d, --description <description>", "Optional description").action(
|
|
2850
2888
|
withErrorHandler(
|
|
2851
2889
|
async (name, value, options) => {
|
|
2852
2890
|
let variable;
|
|
@@ -2872,9 +2910,9 @@ var setCommand5 = new Command51().name("set").description("Create or update a va
|
|
|
2872
2910
|
);
|
|
2873
2911
|
|
|
2874
2912
|
// src/commands/zero/variable/delete.ts
|
|
2875
|
-
import { Command as
|
|
2913
|
+
import { Command as Command54 } from "commander";
|
|
2876
2914
|
import chalk44 from "chalk";
|
|
2877
|
-
var deleteCommand5 = new
|
|
2915
|
+
var deleteCommand5 = new Command54().name("delete").description("Delete a variable").argument("<name>", "Variable name to delete").option("-y, --yes", "Skip confirmation prompt").action(
|
|
2878
2916
|
withErrorHandler(async (name, options) => {
|
|
2879
2917
|
if (!options.yes) {
|
|
2880
2918
|
if (!isInteractive()) {
|
|
@@ -2895,10 +2933,10 @@ var deleteCommand5 = new Command52().name("delete").description("Delete a variab
|
|
|
2895
2933
|
);
|
|
2896
2934
|
|
|
2897
2935
|
// src/commands/zero/variable/index.ts
|
|
2898
|
-
var zeroVariableCommand = new
|
|
2936
|
+
var zeroVariableCommand = new Command55().name("variable").description("Read or write non-sensitive configuration values").addCommand(listCommand9).addCommand(setCommand5).addCommand(deleteCommand5);
|
|
2899
2937
|
|
|
2900
2938
|
// src/commands/zero/whoami.ts
|
|
2901
|
-
import { Command as
|
|
2939
|
+
import { Command as Command56 } from "commander";
|
|
2902
2940
|
import chalk45 from "chalk";
|
|
2903
2941
|
function isInsideSandbox() {
|
|
2904
2942
|
return !!process.env.ZERO_AGENT_ID;
|
|
@@ -2935,7 +2973,7 @@ async function showLocalInfo() {
|
|
|
2935
2973
|
console.log(` Active: ${activeOrg}`);
|
|
2936
2974
|
}
|
|
2937
2975
|
}
|
|
2938
|
-
var zeroWhoamiCommand = new
|
|
2976
|
+
var zeroWhoamiCommand = new Command56().name("whoami").description("Show agent identity, run ID, and capabilities").action(
|
|
2939
2977
|
withErrorHandler(async () => {
|
|
2940
2978
|
if (isInsideSandbox()) {
|
|
2941
2979
|
await showSandboxInfo();
|
|
@@ -2949,6 +2987,7 @@ var zeroWhoamiCommand = new Command54().name("whoami").description("Show current
|
|
|
2949
2987
|
var COMMAND_CAPABILITY_MAP = {
|
|
2950
2988
|
agent: "agent:read",
|
|
2951
2989
|
schedule: "schedule:read",
|
|
2990
|
+
doctor: null,
|
|
2952
2991
|
slack: "slack:write",
|
|
2953
2992
|
whoami: null
|
|
2954
2993
|
};
|
|
@@ -2956,6 +2995,7 @@ var DEFAULT_COMMANDS = [
|
|
|
2956
2995
|
zeroOrgCommand,
|
|
2957
2996
|
zeroAgentCommand,
|
|
2958
2997
|
zeroConnectorCommand,
|
|
2998
|
+
zeroDoctorCommand,
|
|
2959
2999
|
zeroPreferenceCommand,
|
|
2960
3000
|
zeroScheduleCommand,
|
|
2961
3001
|
zeroSecretCommand,
|
|
@@ -2977,8 +3017,19 @@ function registerZeroCommands(prog, commands) {
|
|
|
2977
3017
|
prog.addCommand(cmd, hidden ? { hidden: true } : {});
|
|
2978
3018
|
}
|
|
2979
3019
|
}
|
|
2980
|
-
var program = new
|
|
2981
|
-
program.name("zero").description(
|
|
3020
|
+
var program = new Command57();
|
|
3021
|
+
program.name("zero").description(
|
|
3022
|
+
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
3023
|
+
).version("9.84.1").addHelpText(
|
|
3024
|
+
"after",
|
|
3025
|
+
`
|
|
3026
|
+
Common scenarios:
|
|
3027
|
+
Missing a token? zero doctor missing-token <TOKEN_NAME>
|
|
3028
|
+
Send a Slack message? zero slack message send -c <channel> -t "text"
|
|
3029
|
+
Set up a schedule? zero schedule setup <agent-name>
|
|
3030
|
+
Update yourself? zero agent --help
|
|
3031
|
+
Check your identity? zero whoami`
|
|
3032
|
+
);
|
|
2982
3033
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|
|
2983
3034
|
configureGlobalProxyFromEnv();
|
|
2984
3035
|
registerZeroCommands(program);
|