@vm0/cli 9.98.1 → 9.99.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.
- package/{chunk-F2IYWURQ.js → chunk-52LSZTSN.js} +103 -6
- package/chunk-52LSZTSN.js.map +1 -0
- package/index.js +10 -10
- package/package.json +1 -1
- package/zero.js +103 -6
- package/zero.js.map +1 -1
- package/chunk-F2IYWURQ.js.map +0 -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-52LSZTSN.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.
|
|
457
|
+
console.log(chalk3.bold(`VM0 CLI v${"9.99.0"}`));
|
|
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.
|
|
1584
|
+
await startSilentUpgrade("9.99.0");
|
|
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.
|
|
1658
|
+
await startSilentUpgrade("9.99.0");
|
|
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.
|
|
3416
|
+
const shouldExit = await checkAndUpgrade("9.99.0", 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.
|
|
4160
|
-
console.log(chalk33.green(`\u2713 Already up to date (${"9.
|
|
4159
|
+
if (latestVersion === "9.99.0") {
|
|
4160
|
+
console.log(chalk33.green(`\u2713 Already up to date (${"9.99.0"})`));
|
|
4161
4161
|
return;
|
|
4162
4162
|
}
|
|
4163
4163
|
console.log(
|
|
4164
4164
|
chalk33.yellow(
|
|
4165
|
-
`Current version: ${"9.
|
|
4165
|
+
`Current version: ${"9.99.0"} -> 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.
|
|
4192
|
+
chalk33.green(`\u2713 Upgraded from ${"9.99.0"} 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.
|
|
4260
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.99.0");
|
|
4261
4261
|
program.addCommand(authCommand);
|
|
4262
4262
|
program.addCommand(infoCommand);
|
|
4263
4263
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -90,6 +90,7 @@ import {
|
|
|
90
90
|
removeZeroOrgMember,
|
|
91
91
|
renderRunCreated,
|
|
92
92
|
resolveCompose,
|
|
93
|
+
resolveFirewallPolicies,
|
|
93
94
|
resolveZeroScheduleByAgent,
|
|
94
95
|
saveConfig,
|
|
95
96
|
searchZeroLogs,
|
|
@@ -108,7 +109,7 @@ import {
|
|
|
108
109
|
updateZeroUserPreferences,
|
|
109
110
|
upsertZeroOrgModelProvider,
|
|
110
111
|
withErrorHandler
|
|
111
|
-
} from "./chunk-
|
|
112
|
+
} from "./chunk-52LSZTSN.js";
|
|
112
113
|
|
|
113
114
|
// src/zero.ts
|
|
114
115
|
import { Command as Command73 } from "commander";
|
|
@@ -1268,12 +1269,40 @@ Notes:
|
|
|
1268
1269
|
// src/commands/zero/agent/view.ts
|
|
1269
1270
|
import { Command as Command26 } from "commander";
|
|
1270
1271
|
import chalk23 from "chalk";
|
|
1271
|
-
|
|
1272
|
+
function getConnectorPermissionInfo(type, resolvedPolicies) {
|
|
1273
|
+
if (!isFirewallConnectorType(type)) {
|
|
1274
|
+
return {
|
|
1275
|
+
type,
|
|
1276
|
+
hasFirewall: false,
|
|
1277
|
+
permissions: [],
|
|
1278
|
+
policies: null,
|
|
1279
|
+
allowed: 0,
|
|
1280
|
+
total: 0
|
|
1281
|
+
};
|
|
1282
|
+
}
|
|
1283
|
+
const policies = resolvedPolicies?.[type] ?? null;
|
|
1284
|
+
const config = getConnectorFirewall(type);
|
|
1285
|
+
const permissions = config.apis.flatMap((a) => {
|
|
1286
|
+
return a.permissions ?? [];
|
|
1287
|
+
});
|
|
1288
|
+
const total = permissions.length;
|
|
1289
|
+
const allowed = policies ? permissions.filter((p) => {
|
|
1290
|
+
return policies[p.name] === "allow";
|
|
1291
|
+
}).length : 0;
|
|
1292
|
+
return { type, hasFirewall: true, permissions, policies, allowed, total };
|
|
1293
|
+
}
|
|
1294
|
+
function formatConnectorSummary(info) {
|
|
1295
|
+
if (!info.hasFirewall) return info.type;
|
|
1296
|
+
if (!info.policies) return `${info.type} (full access)`;
|
|
1297
|
+
return `${info.type} (${info.allowed}/${info.total} allowed)`;
|
|
1298
|
+
}
|
|
1299
|
+
var viewCommand = new Command26().name("view").description("View a zero agent").argument("<agent-id>", "Agent ID").option("--instructions", "Also show instructions content").option("--permissions", "Show full permission details for each connector").addHelpText(
|
|
1272
1300
|
"after",
|
|
1273
1301
|
`
|
|
1274
1302
|
Examples:
|
|
1275
1303
|
View basic info: zero agent view <agent-id>
|
|
1276
1304
|
Include instructions: zero agent view <agent-id> --instructions
|
|
1305
|
+
Show permissions: zero agent view <agent-id> --permissions
|
|
1277
1306
|
View yourself: zero agent view $ZERO_AGENT_ID --instructions`
|
|
1278
1307
|
).action(
|
|
1279
1308
|
withErrorHandler(
|
|
@@ -1284,14 +1313,56 @@ Examples:
|
|
|
1284
1313
|
console.log();
|
|
1285
1314
|
console.log(`Agent ID: ${agent.agentId}`);
|
|
1286
1315
|
const connectors = await getZeroAgentUserConnectors(agentId);
|
|
1287
|
-
|
|
1288
|
-
|
|
1316
|
+
const resolvedPolicies = resolveFirewallPolicies(
|
|
1317
|
+
agent.firewallPolicies,
|
|
1318
|
+
connectors
|
|
1319
|
+
);
|
|
1320
|
+
const connectorInfos = connectors.map((type) => {
|
|
1321
|
+
return getConnectorPermissionInfo(type, resolvedPolicies);
|
|
1322
|
+
});
|
|
1323
|
+
if (connectorInfos.length > 0) {
|
|
1324
|
+
const summaries = connectorInfos.map(formatConnectorSummary);
|
|
1325
|
+
console.log(`Connectors: ${summaries.join(", ")}`);
|
|
1326
|
+
}
|
|
1289
1327
|
if (agent.customSkills?.length > 0) {
|
|
1290
1328
|
console.log(`Skills: ${agent.customSkills.join(", ")}`);
|
|
1291
1329
|
}
|
|
1292
1330
|
if (agent.description)
|
|
1293
1331
|
console.log(`Description: ${agent.description}`);
|
|
1294
1332
|
if (agent.sound) console.log(`Sound: ${agent.sound}`);
|
|
1333
|
+
if (options.permissions && connectorInfos.length > 0) {
|
|
1334
|
+
console.log();
|
|
1335
|
+
for (const info of connectorInfos) {
|
|
1336
|
+
if (!info.hasFirewall) {
|
|
1337
|
+
console.log(chalk23.dim(`\u2500\u2500 ${info.type} \u2500\u2500`));
|
|
1338
|
+
console.log(" No firewall configured.");
|
|
1339
|
+
continue;
|
|
1340
|
+
}
|
|
1341
|
+
if (!info.policies) {
|
|
1342
|
+
console.log(chalk23.dim(`\u2500\u2500 ${info.type} (full access) \u2500\u2500`));
|
|
1343
|
+
console.log(
|
|
1344
|
+
" No permission rules configured \u2014 all API calls allowed."
|
|
1345
|
+
);
|
|
1346
|
+
continue;
|
|
1347
|
+
}
|
|
1348
|
+
console.log(
|
|
1349
|
+
chalk23.dim(
|
|
1350
|
+
`\u2500\u2500 ${info.type} (${info.allowed}/${info.total} allowed) \u2500\u2500`
|
|
1351
|
+
)
|
|
1352
|
+
);
|
|
1353
|
+
const nameWidth = Math.max(
|
|
1354
|
+
...info.permissions.map((p) => {
|
|
1355
|
+
return p.name.length;
|
|
1356
|
+
})
|
|
1357
|
+
);
|
|
1358
|
+
for (const perm of info.permissions) {
|
|
1359
|
+
const policy = info.policies[perm.name] ?? "deny";
|
|
1360
|
+
const icon = policy === "allow" ? chalk23.green("\u2713") : policy === "ask" ? chalk23.yellow("?") : chalk23.dim("\u2717");
|
|
1361
|
+
const desc = perm.description ?? "";
|
|
1362
|
+
console.log(` ${icon} ${perm.name.padEnd(nameWidth)} ${desc}`);
|
|
1363
|
+
}
|
|
1364
|
+
}
|
|
1365
|
+
}
|
|
1295
1366
|
if (options.instructions) {
|
|
1296
1367
|
console.log();
|
|
1297
1368
|
const result = await getZeroAgentInstructions(agentId);
|
|
@@ -2101,7 +2172,7 @@ Notes:
|
|
|
2101
2172
|
const isConnected = connector !== null;
|
|
2102
2173
|
const hasPermission = enabledTypes !== null && enabledTypes.includes(connectorType);
|
|
2103
2174
|
if (!isConnected) {
|
|
2104
|
-
const url = `${platformUrl.origin}/connectors`;
|
|
2175
|
+
const url = `${platformUrl.origin}/connectors/${connectorType}/connect`;
|
|
2105
2176
|
console.log(
|
|
2106
2177
|
`The ${label} connector is not connected. Ask the user to connect it at: [Connect ${label}](${url})`
|
|
2107
2178
|
);
|
|
@@ -3741,6 +3812,31 @@ async function showSandboxInfo() {
|
|
|
3741
3812
|
console.log(chalk47.bold("Capabilities:"));
|
|
3742
3813
|
console.log(` ${payload.capabilities.join(", ")}`);
|
|
3743
3814
|
}
|
|
3815
|
+
try {
|
|
3816
|
+
const result = await listZeroConnectors();
|
|
3817
|
+
const identities = result.connectors.filter((c) => {
|
|
3818
|
+
return c.externalUsername !== null || c.externalEmail !== null;
|
|
3819
|
+
});
|
|
3820
|
+
if (identities.length > 0) {
|
|
3821
|
+
console.log();
|
|
3822
|
+
console.log(chalk47.bold("Connected Services:"));
|
|
3823
|
+
for (const connector of identities) {
|
|
3824
|
+
let identity = "";
|
|
3825
|
+
if (connector.externalUsername && connector.externalEmail) {
|
|
3826
|
+
identity = `@${connector.externalUsername} (${connector.externalEmail})`;
|
|
3827
|
+
} else if (connector.externalUsername) {
|
|
3828
|
+
identity = `@${connector.externalUsername}`;
|
|
3829
|
+
} else if (connector.externalEmail) {
|
|
3830
|
+
identity = connector.externalEmail;
|
|
3831
|
+
}
|
|
3832
|
+
if (connector.needsReconnect) {
|
|
3833
|
+
identity += ` ${chalk47.yellow("(needs reconnect)")}`;
|
|
3834
|
+
}
|
|
3835
|
+
console.log(` ${connector.type.padEnd(14)}${identity}`);
|
|
3836
|
+
}
|
|
3837
|
+
}
|
|
3838
|
+
} catch {
|
|
3839
|
+
}
|
|
3744
3840
|
}
|
|
3745
3841
|
async function showLocalInfo() {
|
|
3746
3842
|
const token = await getToken();
|
|
@@ -4458,6 +4554,7 @@ Examples:
|
|
|
4458
4554
|
var COMMAND_CAPABILITY_MAP = {
|
|
4459
4555
|
agent: "agent:read",
|
|
4460
4556
|
skill: "agent:read",
|
|
4557
|
+
connector: "connector:read",
|
|
4461
4558
|
run: "agent-run:write",
|
|
4462
4559
|
schedule: "schedule:read",
|
|
4463
4560
|
doctor: null,
|
|
@@ -4499,7 +4596,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
4499
4596
|
var program = new Command73();
|
|
4500
4597
|
program.name("zero").description(
|
|
4501
4598
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
4502
|
-
).version("9.
|
|
4599
|
+
).version("9.99.0").addHelpText(
|
|
4503
4600
|
"after",
|
|
4504
4601
|
`
|
|
4505
4602
|
Examples:
|