@vm0/cli 9.103.0 → 9.103.2
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-LIBXYI24.js → chunk-M2EPCU5K.js} +16 -32
- package/{chunk-LIBXYI24.js.map → chunk-M2EPCU5K.js.map} +1 -1
- package/index.js +10 -10
- package/package.json +1 -1
- package/zero.js +105 -119
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -61,7 +61,7 @@ import {
|
|
|
61
61
|
showNextSteps,
|
|
62
62
|
volumeConfigSchema,
|
|
63
63
|
withErrorHandler
|
|
64
|
-
} from "./chunk-
|
|
64
|
+
} from "./chunk-M2EPCU5K.js";
|
|
65
65
|
|
|
66
66
|
// src/index.ts
|
|
67
67
|
import { Command as Command44 } from "commander";
|
|
@@ -454,7 +454,7 @@ function getConfigPath() {
|
|
|
454
454
|
return join(homedir(), ".vm0", "config.json");
|
|
455
455
|
}
|
|
456
456
|
var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
|
|
457
|
-
console.log(chalk3.bold(`VM0 CLI v${"9.103.
|
|
457
|
+
console.log(chalk3.bold(`VM0 CLI v${"9.103.2"}`));
|
|
458
458
|
console.log();
|
|
459
459
|
const config = await loadConfig();
|
|
460
460
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -1581,7 +1581,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
|
|
|
1581
1581
|
options.autoUpdate = false;
|
|
1582
1582
|
}
|
|
1583
1583
|
if (options.autoUpdate !== false) {
|
|
1584
|
-
await startSilentUpgrade("9.103.
|
|
1584
|
+
await startSilentUpgrade("9.103.2");
|
|
1585
1585
|
}
|
|
1586
1586
|
try {
|
|
1587
1587
|
let result;
|
|
@@ -1655,7 +1655,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
|
|
|
1655
1655
|
withErrorHandler(
|
|
1656
1656
|
async (identifier, prompt, options) => {
|
|
1657
1657
|
if (options.autoUpdate !== false) {
|
|
1658
|
-
await startSilentUpgrade("9.103.
|
|
1658
|
+
await startSilentUpgrade("9.103.2");
|
|
1659
1659
|
}
|
|
1660
1660
|
const { name, version } = parseIdentifier(identifier);
|
|
1661
1661
|
let composeId;
|
|
@@ -3413,7 +3413,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
|
|
|
3413
3413
|
withErrorHandler(
|
|
3414
3414
|
async (prompt, options) => {
|
|
3415
3415
|
if (options.autoUpdate !== false) {
|
|
3416
|
-
const shouldExit = await checkAndUpgrade("9.103.
|
|
3416
|
+
const shouldExit = await checkAndUpgrade("9.103.2", prompt);
|
|
3417
3417
|
if (shouldExit) {
|
|
3418
3418
|
process.exit(0);
|
|
3419
3419
|
}
|
|
@@ -4156,13 +4156,13 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
|
|
|
4156
4156
|
if (latestVersion === null) {
|
|
4157
4157
|
throw new Error("Could not check for updates. Please try again later.");
|
|
4158
4158
|
}
|
|
4159
|
-
if (latestVersion === "9.103.
|
|
4160
|
-
console.log(chalk33.green(`\u2713 Already up to date (${"9.103.
|
|
4159
|
+
if (latestVersion === "9.103.2") {
|
|
4160
|
+
console.log(chalk33.green(`\u2713 Already up to date (${"9.103.2"})`));
|
|
4161
4161
|
return;
|
|
4162
4162
|
}
|
|
4163
4163
|
console.log(
|
|
4164
4164
|
chalk33.yellow(
|
|
4165
|
-
`Current version: ${"9.103.
|
|
4165
|
+
`Current version: ${"9.103.2"} -> Latest version: ${latestVersion}`
|
|
4166
4166
|
)
|
|
4167
4167
|
);
|
|
4168
4168
|
console.log();
|
|
@@ -4189,7 +4189,7 @@ var upgradeCommand = new Command42().name("upgrade").description("Upgrade vm0 CL
|
|
|
4189
4189
|
const success = await performUpgrade(packageManager);
|
|
4190
4190
|
if (success) {
|
|
4191
4191
|
console.log(
|
|
4192
|
-
chalk33.green(`\u2713 Upgraded from ${"9.103.
|
|
4192
|
+
chalk33.green(`\u2713 Upgraded from ${"9.103.2"} to ${latestVersion}`)
|
|
4193
4193
|
);
|
|
4194
4194
|
return;
|
|
4195
4195
|
}
|
|
@@ -4257,7 +4257,7 @@ var whoamiCommand = new Command43().name("whoami").description("Show current ide
|
|
|
4257
4257
|
|
|
4258
4258
|
// src/index.ts
|
|
4259
4259
|
var program = new Command44();
|
|
4260
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.103.
|
|
4260
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.103.2");
|
|
4261
4261
|
program.addCommand(authCommand);
|
|
4262
4262
|
program.addCommand(infoCommand);
|
|
4263
4263
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -115,7 +115,7 @@ import {
|
|
|
115
115
|
upsertZeroOrgModelProvider,
|
|
116
116
|
withErrorHandler,
|
|
117
117
|
zeroAgentCustomSkillNameSchema
|
|
118
|
-
} from "./chunk-
|
|
118
|
+
} from "./chunk-M2EPCU5K.js";
|
|
119
119
|
|
|
120
120
|
// src/zero.ts
|
|
121
121
|
import { Command as Command77 } from "commander";
|
|
@@ -2265,6 +2265,9 @@ Notes:
|
|
|
2265
2265
|
);
|
|
2266
2266
|
|
|
2267
2267
|
// src/commands/zero/doctor/firewall-deny.ts
|
|
2268
|
+
import { Command as Command37, Option as Option2 } from "commander";
|
|
2269
|
+
|
|
2270
|
+
// src/commands/zero/doctor/firewall-permissions-change.ts
|
|
2268
2271
|
import { Command as Command36, Option } from "commander";
|
|
2269
2272
|
|
|
2270
2273
|
// src/commands/zero/doctor/resolve-role.ts
|
|
@@ -2294,92 +2297,7 @@ async function resolveAgentRole(agentId) {
|
|
|
2294
2297
|
}
|
|
2295
2298
|
}
|
|
2296
2299
|
|
|
2297
|
-
// src/commands/zero/doctor/firewall-deny.ts
|
|
2298
|
-
var firewallDenyCommand = new Command36().name("firewall-deny").description(
|
|
2299
|
-
"Diagnose a firewall denial and find the permission that covers it"
|
|
2300
|
-
).argument("<firewall-ref>", "The firewall connector type (e.g. github)").addOption(
|
|
2301
|
-
new Option(
|
|
2302
|
-
"--method <method>",
|
|
2303
|
-
"The denied HTTP method"
|
|
2304
|
-
).makeOptionMandatory()
|
|
2305
|
-
).addOption(
|
|
2306
|
-
new Option("--path <path>", "The denied path").makeOptionMandatory()
|
|
2307
|
-
).addHelpText(
|
|
2308
|
-
"after",
|
|
2309
|
-
`
|
|
2310
|
-
Examples:
|
|
2311
|
-
zero doctor firewall-deny github --method GET --path /repos/owner/repo/pulls
|
|
2312
|
-
zero doctor firewall-deny slack --method POST --path /chat.postMessage
|
|
2313
|
-
|
|
2314
|
-
Notes:
|
|
2315
|
-
- Identifies which named permission covers a denied request
|
|
2316
|
-
- Outputs a platform URL for the user to allow the permission`
|
|
2317
|
-
).action(
|
|
2318
|
-
withErrorHandler(
|
|
2319
|
-
async (firewallRef, opts) => {
|
|
2320
|
-
if (!isFirewallConnectorType(firewallRef)) {
|
|
2321
|
-
throw new Error(`Unknown firewall connector type: ${firewallRef}`);
|
|
2322
|
-
}
|
|
2323
|
-
const { label } = CONNECTOR_TYPES[firewallRef];
|
|
2324
|
-
const config = getConnectorFirewall(firewallRef);
|
|
2325
|
-
const permissions = findMatchingPermissions(
|
|
2326
|
-
opts.method,
|
|
2327
|
-
opts.path,
|
|
2328
|
-
config
|
|
2329
|
-
);
|
|
2330
|
-
const platformOrigin = await getPlatformOrigin();
|
|
2331
|
-
const agentId = process.env.ZERO_AGENT_ID;
|
|
2332
|
-
const urlParams = new URLSearchParams({
|
|
2333
|
-
ref: firewallRef,
|
|
2334
|
-
method: opts.method,
|
|
2335
|
-
path: opts.path
|
|
2336
|
-
});
|
|
2337
|
-
if (permissions.length > 0) {
|
|
2338
|
-
urlParams.set("permission", permissions[0]);
|
|
2339
|
-
}
|
|
2340
|
-
const pagePath = agentId ? `/agents/${agentId}/permissions` : "/agents";
|
|
2341
|
-
const url = `${platformOrigin}${pagePath}?${urlParams.toString()}`;
|
|
2342
|
-
console.log(
|
|
2343
|
-
`The ${label} firewall blocked ${opts.method} ${opts.path}.`
|
|
2344
|
-
);
|
|
2345
|
-
if (permissions.length > 0) {
|
|
2346
|
-
console.log(`This is covered by the "${permissions[0]}" permission.`);
|
|
2347
|
-
} else {
|
|
2348
|
-
console.log("No named permission was found covering this request.");
|
|
2349
|
-
}
|
|
2350
|
-
if (firewallRef === "slack" && permissions[0] === "chat:write") {
|
|
2351
|
-
console.log("");
|
|
2352
|
-
console.log(
|
|
2353
|
-
"IMPORTANT: Granting chat:write allows sending messages AS THE USER's identity, not as a bot."
|
|
2354
|
-
);
|
|
2355
|
-
console.log(
|
|
2356
|
-
"Use `zero slack message send -c <channel> -t <text>` to send messages as the bot instead \u2014 this is the recommended approach for most use cases."
|
|
2357
|
-
);
|
|
2358
|
-
console.log(
|
|
2359
|
-
"Only request user approval below if acting as the user is specifically required."
|
|
2360
|
-
);
|
|
2361
|
-
console.log("");
|
|
2362
|
-
}
|
|
2363
|
-
const role = agentId ? await resolveAgentRole(agentId) : "unknown";
|
|
2364
|
-
if (role === "admin" || role === "owner") {
|
|
2365
|
-
console.log(
|
|
2366
|
-
`You can allow this permission directly: [Manage ${label} firewall](${url})`
|
|
2367
|
-
);
|
|
2368
|
-
} else if (role === "member") {
|
|
2369
|
-
console.log(
|
|
2370
|
-
`This change requires admin approval. Request access at: [Request ${label} access](${url})`
|
|
2371
|
-
);
|
|
2372
|
-
} else {
|
|
2373
|
-
console.log(
|
|
2374
|
-
`Ask the user to allow it at: [Allow ${label} access](${url})`
|
|
2375
|
-
);
|
|
2376
|
-
}
|
|
2377
|
-
}
|
|
2378
|
-
)
|
|
2379
|
-
);
|
|
2380
|
-
|
|
2381
2300
|
// src/commands/zero/doctor/firewall-permissions-change.ts
|
|
2382
|
-
import { Command as Command37, Option as Option2 } from "commander";
|
|
2383
2301
|
function findPermissionInConfig(ref, permissionName) {
|
|
2384
2302
|
if (!isFirewallConnectorType(ref)) return false;
|
|
2385
2303
|
const config = getConnectorFirewall(ref);
|
|
@@ -2391,17 +2309,62 @@ function findPermissionInConfig(ref, permissionName) {
|
|
|
2391
2309
|
}
|
|
2392
2310
|
return false;
|
|
2393
2311
|
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2312
|
+
async function outputPermissionChangeMessage(firewallRef, permission, action) {
|
|
2313
|
+
const { label } = CONNECTOR_TYPES[firewallRef];
|
|
2314
|
+
const platformOrigin = await getPlatformOrigin();
|
|
2315
|
+
const agentId = process.env.ZERO_AGENT_ID;
|
|
2316
|
+
const urlParams = new URLSearchParams({
|
|
2317
|
+
ref: firewallRef,
|
|
2318
|
+
permission,
|
|
2319
|
+
action: action === "enable" ? "allow" : "deny"
|
|
2320
|
+
});
|
|
2321
|
+
const pagePath = agentId ? `/agents/${agentId}/permissions` : "/agents";
|
|
2322
|
+
const url = `${platformOrigin}${pagePath}?${urlParams.toString()}`;
|
|
2323
|
+
if (firewallRef === "slack" && permission === "chat:write" && action === "enable") {
|
|
2324
|
+
console.log("");
|
|
2325
|
+
console.log(
|
|
2326
|
+
"IMPORTANT: Granting chat:write allows sending messages AS THE USER's identity, not as a bot."
|
|
2327
|
+
);
|
|
2328
|
+
console.log(
|
|
2329
|
+
"Use `zero slack message send -c <channel> -t <text>` to send messages as the bot instead \u2014 this is the recommended approach for most use cases."
|
|
2330
|
+
);
|
|
2331
|
+
console.log(
|
|
2332
|
+
"Only request user approval below if acting as the user is specifically required."
|
|
2333
|
+
);
|
|
2334
|
+
console.log("");
|
|
2335
|
+
}
|
|
2336
|
+
const role = agentId ? await resolveAgentRole(agentId) : "unknown";
|
|
2337
|
+
if (role === "admin" || role === "owner") {
|
|
2338
|
+
console.log(
|
|
2339
|
+
`You can ${action} the "${permission}" permission directly: [Manage ${label} firewall](${url})`
|
|
2340
|
+
);
|
|
2341
|
+
} else if (role === "member") {
|
|
2342
|
+
if (action === "enable") {
|
|
2343
|
+
console.log(
|
|
2344
|
+
`Permission changes require admin approval. Request access at: [Request ${label} access](${url})`
|
|
2345
|
+
);
|
|
2346
|
+
} else {
|
|
2347
|
+
console.log(
|
|
2348
|
+
`Permission changes require admin approval. Contact an org admin to disable this permission: [View ${label} firewall](${url})`
|
|
2349
|
+
);
|
|
2350
|
+
}
|
|
2351
|
+
} else {
|
|
2352
|
+
console.log(
|
|
2353
|
+
`To ${action} the "${permission}" permission on the ${label} firewall: [Manage ${label} firewall](${url})`
|
|
2354
|
+
);
|
|
2355
|
+
}
|
|
2356
|
+
}
|
|
2357
|
+
var firewallPermissionsChangeCommand = new Command36().name("firewall-permissions-change").description("Request a firewall permission change (enable or disable)").argument("<firewall-ref>", "The firewall connector type (e.g. github)").addOption(
|
|
2358
|
+
new Option(
|
|
2396
2359
|
"--permission <name>",
|
|
2397
2360
|
"The permission name to change"
|
|
2398
2361
|
).makeOptionMandatory()
|
|
2399
2362
|
).addOption(
|
|
2400
|
-
new
|
|
2363
|
+
new Option("--enable", "Request to enable the permission").conflicts(
|
|
2401
2364
|
"disable"
|
|
2402
2365
|
)
|
|
2403
2366
|
).addOption(
|
|
2404
|
-
new
|
|
2367
|
+
new Option("--disable", "Request to disable the permission").conflicts(
|
|
2405
2368
|
"enable"
|
|
2406
2369
|
)
|
|
2407
2370
|
).addHelpText(
|
|
@@ -2428,36 +2391,59 @@ Notes:
|
|
|
2428
2391
|
`Unknown permission "${opts.permission}" for ${firewallRef} firewall`
|
|
2429
2392
|
);
|
|
2430
2393
|
}
|
|
2431
|
-
const { label } = CONNECTOR_TYPES[firewallRef];
|
|
2432
2394
|
const action = opts.enable ? "enable" : "disable";
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2437
|
-
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2395
|
+
await outputPermissionChangeMessage(
|
|
2396
|
+
firewallRef,
|
|
2397
|
+
opts.permission,
|
|
2398
|
+
action
|
|
2399
|
+
);
|
|
2400
|
+
}
|
|
2401
|
+
)
|
|
2402
|
+
);
|
|
2403
|
+
|
|
2404
|
+
// src/commands/zero/doctor/firewall-deny.ts
|
|
2405
|
+
var firewallDenyCommand = new Command37().name("firewall-deny").description(
|
|
2406
|
+
"Diagnose a firewall denial and find the permission that covers it"
|
|
2407
|
+
).argument("<firewall-ref>", "The firewall connector type (e.g. github)").addOption(
|
|
2408
|
+
new Option2(
|
|
2409
|
+
"--method <method>",
|
|
2410
|
+
"The denied HTTP method"
|
|
2411
|
+
).makeOptionMandatory()
|
|
2412
|
+
).addOption(
|
|
2413
|
+
new Option2("--path <path>", "The denied path").makeOptionMandatory()
|
|
2414
|
+
).addHelpText(
|
|
2415
|
+
"after",
|
|
2416
|
+
`
|
|
2417
|
+
Examples:
|
|
2418
|
+
zero doctor firewall-deny github --method GET --path /repos/owner/repo/pulls
|
|
2419
|
+
zero doctor firewall-deny slack --method POST --path /chat.postMessage
|
|
2420
|
+
|
|
2421
|
+
Notes:
|
|
2422
|
+
- Identifies which named permission covers a denied request
|
|
2423
|
+
- Outputs a platform URL for the user to allow the permission`
|
|
2424
|
+
).action(
|
|
2425
|
+
withErrorHandler(
|
|
2426
|
+
async (firewallRef, opts) => {
|
|
2427
|
+
if (!isFirewallConnectorType(firewallRef)) {
|
|
2428
|
+
throw new Error(`Unknown firewall connector type: ${firewallRef}`);
|
|
2429
|
+
}
|
|
2430
|
+
const { label } = CONNECTOR_TYPES[firewallRef];
|
|
2431
|
+
const config = getConnectorFirewall(firewallRef);
|
|
2432
|
+
const permissions = findMatchingPermissions(
|
|
2433
|
+
opts.method,
|
|
2434
|
+
opts.path,
|
|
2435
|
+
config
|
|
2436
|
+
);
|
|
2437
|
+
console.log(
|
|
2438
|
+
`The ${label} firewall blocked ${opts.method} ${opts.path}.`
|
|
2439
|
+
);
|
|
2440
|
+
if (permissions.length === 0) {
|
|
2441
|
+
console.log("No named permission was found covering this request.");
|
|
2442
|
+
return;
|
|
2460
2443
|
}
|
|
2444
|
+
const permission = permissions[0];
|
|
2445
|
+
console.log(`This is covered by the "${permission}" permission.`);
|
|
2446
|
+
await outputPermissionChangeMessage(firewallRef, permission, "enable");
|
|
2461
2447
|
}
|
|
2462
2448
|
)
|
|
2463
2449
|
);
|
|
@@ -5752,7 +5738,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
5752
5738
|
var program = new Command77();
|
|
5753
5739
|
program.name("zero").description(
|
|
5754
5740
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
5755
|
-
).version("9.103.
|
|
5741
|
+
).version("9.103.2").addHelpText(
|
|
5756
5742
|
"after",
|
|
5757
5743
|
`
|
|
5758
5744
|
Examples:
|