@vm0/cli 9.122.11 → 9.123.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-EL3VZKV3.js → chunk-ZHRTF6MS.js} +801 -16
- package/{chunk-EL3VZKV3.js.map → chunk-ZHRTF6MS.js.map} +1 -1
- package/index.js +9 -9
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +89 -32
- package/zero.js.map +1 -1
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -126,7 +126,7 @@ import {
|
|
|
126
126
|
upsertZeroOrgModelProvider,
|
|
127
127
|
withErrorHandler,
|
|
128
128
|
zeroAgentCustomSkillNameSchema
|
|
129
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-ZHRTF6MS.js";
|
|
130
130
|
import {
|
|
131
131
|
__toESM,
|
|
132
132
|
init_esm_shims
|
|
@@ -539,6 +539,20 @@ var listCommand4 = new Command().name("list").alias("ls").description("List all
|
|
|
539
539
|
const defaultTag = provider.isDefault ? source_default.green(" (default)") : "";
|
|
540
540
|
const modelTag = provider.selectedModel ? source_default.dim(` [${provider.selectedModel}]`) : "";
|
|
541
541
|
console.log(` ${provider.type}${defaultTag}${modelTag}`);
|
|
542
|
+
console.log(source_default.dim(` ID: ${provider.id}`));
|
|
543
|
+
if (provider.type in MODEL_PROVIDER_TYPES) {
|
|
544
|
+
const type = provider.type;
|
|
545
|
+
const available = getModels(type) ?? [];
|
|
546
|
+
if (available.length > 0) {
|
|
547
|
+
console.log(
|
|
548
|
+
source_default.dim(` Available models: ${available.join(", ")}`)
|
|
549
|
+
);
|
|
550
|
+
} else if (allowsCustomModel(type)) {
|
|
551
|
+
console.log(
|
|
552
|
+
source_default.dim(" Available models: (custom \u2014 any model name)")
|
|
553
|
+
);
|
|
554
|
+
}
|
|
555
|
+
}
|
|
542
556
|
console.log(
|
|
543
557
|
source_default.dim(
|
|
544
558
|
` Updated: ${new Date(provider.updatedAt).toLocaleString()}`
|
|
@@ -550,6 +564,12 @@ var listCommand4 = new Command().name("list").alias("ls").description("List all
|
|
|
550
564
|
console.log(
|
|
551
565
|
source_default.dim(`Total: ${result.modelProviders.length} provider(s)`)
|
|
552
566
|
);
|
|
567
|
+
console.log();
|
|
568
|
+
console.log(
|
|
569
|
+
source_default.dim(
|
|
570
|
+
"Use a provider ID with: zero agent edit <agent-id> --model-provider <id> --model <name>"
|
|
571
|
+
)
|
|
572
|
+
);
|
|
553
573
|
})
|
|
554
574
|
);
|
|
555
575
|
|
|
@@ -859,6 +879,11 @@ async function promptForSecrets(type, authMethod) {
|
|
|
859
879
|
function collectSecrets(value, previous) {
|
|
860
880
|
return previous.concat([value]);
|
|
861
881
|
}
|
|
882
|
+
function parseModelFlag(value) {
|
|
883
|
+
if (value === void 0) return void 0;
|
|
884
|
+
if (value === "default") return null;
|
|
885
|
+
return value;
|
|
886
|
+
}
|
|
862
887
|
|
|
863
888
|
// src/commands/zero/org/model-provider/setup.ts
|
|
864
889
|
async function handleInteractiveMode() {
|
|
@@ -1204,6 +1229,23 @@ Examples:
|
|
|
1204
1229
|
// src/commands/zero/agent/edit.ts
|
|
1205
1230
|
init_esm_shims();
|
|
1206
1231
|
import { readFileSync as readFileSync2 } from "fs";
|
|
1232
|
+
function hasAgentFieldUpdate(options) {
|
|
1233
|
+
return options.displayName !== void 0 || options.description !== void 0 || options.sound !== void 0 || options.skills !== void 0 || options.addSkill !== void 0 || options.removeSkill !== void 0 || options.modelProvider !== void 0 || options.model !== void 0;
|
|
1234
|
+
}
|
|
1235
|
+
async function applyAgentUpdate(agentId, options) {
|
|
1236
|
+
const current = await getZeroAgent(agentId);
|
|
1237
|
+
const customSkills = resolveCustomSkills(options, current.customSkills ?? []);
|
|
1238
|
+
const modelProviderId = options.modelProvider !== void 0 ? parseModelFlag(options.modelProvider) : current.modelProviderId;
|
|
1239
|
+
const selectedModel = options.model !== void 0 ? parseModelFlag(options.model) : current.selectedModel;
|
|
1240
|
+
await updateZeroAgent(agentId, {
|
|
1241
|
+
displayName: options.displayName !== void 0 ? options.displayName : current.displayName ?? void 0,
|
|
1242
|
+
description: options.description !== void 0 ? options.description : current.description ?? void 0,
|
|
1243
|
+
sound: options.sound !== void 0 ? options.sound : current.sound ?? void 0,
|
|
1244
|
+
customSkills,
|
|
1245
|
+
modelProviderId,
|
|
1246
|
+
selectedModel
|
|
1247
|
+
});
|
|
1248
|
+
}
|
|
1207
1249
|
function validateSkillName(name) {
|
|
1208
1250
|
const result = zeroAgentCustomSkillNameSchema.safeParse(name);
|
|
1209
1251
|
if (!result.success) {
|
|
@@ -1252,7 +1294,13 @@ var editCommand = new Command().name("edit").description("Edit a zero agent").ar
|
|
|
1252
1294
|
).option(
|
|
1253
1295
|
"--skills <items>",
|
|
1254
1296
|
"Comma-separated custom skill names to attach (replaces existing)"
|
|
1255
|
-
).option("--add-skill <name>", "Add a custom skill to the agent").option("--remove-skill <name>", "Remove a custom skill from the agent").option("--instructions-file <path>", "Path to new instructions file").
|
|
1297
|
+
).option("--add-skill <name>", "Add a custom skill to the agent").option("--remove-skill <name>", "Remove a custom skill from the agent").option("--instructions-file <path>", "Path to new instructions file").option(
|
|
1298
|
+
"--model-provider <id>",
|
|
1299
|
+
"Model provider UUID, or 'default' to inherit org default"
|
|
1300
|
+
).option(
|
|
1301
|
+
"--model <name>",
|
|
1302
|
+
"Model name (e.g. claude-sonnet-4-6, MiniMax-M2.7), or 'default' to inherit provider default"
|
|
1303
|
+
).addHelpText(
|
|
1256
1304
|
"after",
|
|
1257
1305
|
`
|
|
1258
1306
|
Examples:
|
|
@@ -1262,6 +1310,8 @@ Examples:
|
|
|
1262
1310
|
Add a skill: zero agent edit <agent-id> --add-skill my-skill
|
|
1263
1311
|
Remove a skill: zero agent edit <agent-id> --remove-skill my-skill
|
|
1264
1312
|
Update instructions: zero agent edit <agent-id> --instructions-file ./instructions.md
|
|
1313
|
+
Set model: zero agent edit <agent-id> --model-provider <provider-id> --model MiniMax-M2.7
|
|
1314
|
+
Reset model: zero agent edit <agent-id> --model-provider default --model default
|
|
1265
1315
|
Update yourself: zero agent edit $ZERO_AGENT_ID --description "new role"
|
|
1266
1316
|
|
|
1267
1317
|
Notes:
|
|
@@ -1269,36 +1319,25 @@ Notes:
|
|
|
1269
1319
|
- Unspecified fields are preserved (not cleared)
|
|
1270
1320
|
- --skills replaces the entire skill list; --add-skill/--remove-skill modify incrementally
|
|
1271
1321
|
- --skills cannot be combined with --add-skill or --remove-skill
|
|
1322
|
+
- Use 'zero org model-provider list' to see available providers and models
|
|
1272
1323
|
- To create or edit skill content, use: zero skill --help`
|
|
1273
1324
|
).action(
|
|
1274
|
-
withErrorHandler(
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
|
|
1278
|
-
|
|
1279
|
-
|
|
1280
|
-
);
|
|
1281
|
-
}
|
|
1282
|
-
if (hasAgentUpdate) {
|
|
1283
|
-
const current = await getZeroAgent(agentId);
|
|
1284
|
-
const customSkills = resolveCustomSkills(
|
|
1285
|
-
options,
|
|
1286
|
-
current.customSkills ?? []
|
|
1287
|
-
);
|
|
1288
|
-
await updateZeroAgent(agentId, {
|
|
1289
|
-
displayName: options.displayName !== void 0 ? options.displayName : current.displayName ?? void 0,
|
|
1290
|
-
description: options.description !== void 0 ? options.description : current.description ?? void 0,
|
|
1291
|
-
sound: options.sound !== void 0 ? options.sound : current.sound ?? void 0,
|
|
1292
|
-
customSkills
|
|
1293
|
-
});
|
|
1294
|
-
}
|
|
1295
|
-
if (options.instructionsFile) {
|
|
1296
|
-
const content = readFileSync2(options.instructionsFile, "utf-8");
|
|
1297
|
-
await updateZeroAgentInstructions(agentId, content);
|
|
1298
|
-
}
|
|
1299
|
-
console.log(source_default.green(`\u2713 Agent "${agentId}" updated`));
|
|
1325
|
+
withErrorHandler(async (agentId, options) => {
|
|
1326
|
+
const hasAgentUpdate = hasAgentFieldUpdate(options);
|
|
1327
|
+
if (!hasAgentUpdate && !options.instructionsFile) {
|
|
1328
|
+
throw new Error(
|
|
1329
|
+
"At least one option is required (--display-name, --description, --sound, --skills, --add-skill, --remove-skill, --model-provider, --model, --instructions-file)"
|
|
1330
|
+
);
|
|
1300
1331
|
}
|
|
1301
|
-
|
|
1332
|
+
if (hasAgentUpdate) {
|
|
1333
|
+
await applyAgentUpdate(agentId, options);
|
|
1334
|
+
}
|
|
1335
|
+
if (options.instructionsFile) {
|
|
1336
|
+
const content = readFileSync2(options.instructionsFile, "utf-8");
|
|
1337
|
+
await updateZeroAgentInstructions(agentId, content);
|
|
1338
|
+
}
|
|
1339
|
+
console.log(source_default.green(`\u2713 Agent "${agentId}" updated`));
|
|
1340
|
+
})
|
|
1302
1341
|
);
|
|
1303
1342
|
|
|
1304
1343
|
// src/commands/zero/agent/view.ts
|
|
@@ -3260,6 +3299,12 @@ Deploying schedule for agent ${source_default.cyan(params.agentName)}...`
|
|
|
3260
3299
|
prompt: params.prompt,
|
|
3261
3300
|
...params.existingEnabled !== void 0 && {
|
|
3262
3301
|
enabled: params.existingEnabled
|
|
3302
|
+
},
|
|
3303
|
+
...params.modelProviderId !== void 0 && {
|
|
3304
|
+
modelProviderId: params.modelProviderId
|
|
3305
|
+
},
|
|
3306
|
+
...params.selectedModel !== void 0 && {
|
|
3307
|
+
selectedModel: params.selectedModel
|
|
3263
3308
|
}
|
|
3264
3309
|
});
|
|
3265
3310
|
return deployResult;
|
|
@@ -3339,7 +3384,13 @@ async function handleScheduleEnabling(params) {
|
|
|
3339
3384
|
showEnableHint(agentName);
|
|
3340
3385
|
}
|
|
3341
3386
|
}
|
|
3342
|
-
var setupCommand2 = new Command().name("setup").description("Create or edit a schedule for a zero agent").argument("<agent-id>", "Agent ID").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("-e, --enable", "Enable schedule immediately after creation").
|
|
3387
|
+
var setupCommand2 = new Command().name("setup").description("Create or edit a schedule for a zero agent").argument("<agent-id>", "Agent ID").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("-e, --enable", "Enable schedule immediately after creation").option(
|
|
3388
|
+
"--model-provider <id>",
|
|
3389
|
+
"Model provider UUID, or 'default' to inherit from agent/org"
|
|
3390
|
+
).option(
|
|
3391
|
+
"--model <name>",
|
|
3392
|
+
"Model name (e.g. claude-sonnet-4-6, MiniMax-M2.7), or 'default' to inherit"
|
|
3393
|
+
).addHelpText(
|
|
3343
3394
|
"after",
|
|
3344
3395
|
`
|
|
3345
3396
|
Examples:
|
|
@@ -3349,10 +3400,14 @@ Examples:
|
|
|
3349
3400
|
One-time: zero schedule setup <agent-id> -f once -d 2026-04-01 -t 14:00 -p "one-off task"
|
|
3350
3401
|
Loop every 5 minutes: zero schedule setup <agent-id> -f loop -i 300 -p "poll for updates"
|
|
3351
3402
|
Create and enable: zero schedule setup <agent-id> -f daily -t 09:00 -p "run report" --enable
|
|
3403
|
+
Override model: zero schedule setup <agent-id> -f daily -t 09:00 -p "..." --model-provider <id> --model MiniMax-M2.7
|
|
3404
|
+
Reset model override: zero schedule setup <agent-id> -f daily -t 09:00 -p "..." --model-provider default --model default
|
|
3352
3405
|
|
|
3353
3406
|
Notes:
|
|
3354
3407
|
- Re-running setup with the same agent updates the existing "default" schedule
|
|
3355
3408
|
- Use -n to manage multiple named schedules for the same agent
|
|
3409
|
+
- --model-provider and --model default to inheriting the agent's configuration
|
|
3410
|
+
- Use 'zero org model-provider list' to see available providers and models
|
|
3356
3411
|
- All flags are required in non-interactive mode; interactive mode prompts for missing values
|
|
3357
3412
|
- If the user wants to be notified when a schedule completes, ask them where they want to receive the notification: web chat or Slack, then include it in the prompt`
|
|
3358
3413
|
).action(
|
|
@@ -3415,7 +3470,9 @@ Notes:
|
|
|
3415
3470
|
intervalSeconds,
|
|
3416
3471
|
timezone,
|
|
3417
3472
|
prompt: promptText_,
|
|
3418
|
-
existingEnabled: existingSchedule?.enabled
|
|
3473
|
+
existingEnabled: existingSchedule?.enabled,
|
|
3474
|
+
modelProviderId: parseModelFlag(options.modelProvider),
|
|
3475
|
+
selectedModel: parseModelFlag(options.model)
|
|
3419
3476
|
});
|
|
3420
3477
|
displayDeployResult(scheduleName, deployResult);
|
|
3421
3478
|
const shouldPromptEnable = deployResult.created || existingSchedule !== void 0 && !existingSchedule.enabled;
|
|
@@ -6323,7 +6380,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
6323
6380
|
var program = new Command();
|
|
6324
6381
|
program.name("zero").description(
|
|
6325
6382
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
6326
|
-
).version("9.
|
|
6383
|
+
).version("9.123.0").addHelpText(
|
|
6327
6384
|
"after",
|
|
6328
6385
|
`
|
|
6329
6386
|
Examples:
|