@vm0/cli 9.102.9 → 9.102.10
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-MHEPYHLR.js → chunk-OCZK25RZ.js} +4 -3
- package/index.js +10 -10
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +28 -4
- package/zero.js.map +1 -1
- /package/{chunk-MHEPYHLR.js.map → chunk-OCZK25RZ.js.map} +0 -0
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -113,8 +113,9 @@ import {
|
|
|
113
113
|
updateZeroOrgModelProviderModel,
|
|
114
114
|
updateZeroUserPreferences,
|
|
115
115
|
upsertZeroOrgModelProvider,
|
|
116
|
-
withErrorHandler
|
|
117
|
-
|
|
116
|
+
withErrorHandler,
|
|
117
|
+
zeroAgentCustomSkillNameSchema
|
|
118
|
+
} from "./chunk-OCZK25RZ.js";
|
|
118
119
|
|
|
119
120
|
// src/zero.ts
|
|
120
121
|
import { Command as Command77 } from "commander";
|
|
@@ -1161,6 +1162,16 @@ Examples:
|
|
|
1161
1162
|
const customSkills = options.skills ? options.skills.split(",").map((s) => {
|
|
1162
1163
|
return s.trim();
|
|
1163
1164
|
}) : void 0;
|
|
1165
|
+
if (customSkills) {
|
|
1166
|
+
for (const name of customSkills) {
|
|
1167
|
+
const result = zeroAgentCustomSkillNameSchema.safeParse(name);
|
|
1168
|
+
if (!result.success) {
|
|
1169
|
+
throw new Error(
|
|
1170
|
+
`Invalid skill name "${name}": must be 2-64 characters, lowercase alphanumeric and hyphens only (e.g. my-skill)`
|
|
1171
|
+
);
|
|
1172
|
+
}
|
|
1173
|
+
}
|
|
1174
|
+
}
|
|
1164
1175
|
const agent = await createZeroAgent({
|
|
1165
1176
|
displayName: options.displayName,
|
|
1166
1177
|
description: options.description,
|
|
@@ -1187,16 +1198,29 @@ Examples:
|
|
|
1187
1198
|
import { Command as Command25 } from "commander";
|
|
1188
1199
|
import { readFileSync as readFileSync2 } from "fs";
|
|
1189
1200
|
import chalk22 from "chalk";
|
|
1201
|
+
function validateSkillName(name) {
|
|
1202
|
+
const result = zeroAgentCustomSkillNameSchema.safeParse(name);
|
|
1203
|
+
if (!result.success) {
|
|
1204
|
+
throw new Error(
|
|
1205
|
+
`Invalid skill name "${name}": must be 2-64 characters, lowercase alphanumeric and hyphens only (e.g. my-skill)`
|
|
1206
|
+
);
|
|
1207
|
+
}
|
|
1208
|
+
}
|
|
1190
1209
|
function resolveCustomSkills(options, existing) {
|
|
1191
1210
|
if (options.skills && (options.addSkill || options.removeSkill)) {
|
|
1192
1211
|
throw new Error("Cannot use --skills with --add-skill or --remove-skill");
|
|
1193
1212
|
}
|
|
1194
1213
|
if (options.skills) {
|
|
1195
|
-
|
|
1214
|
+
const names = options.skills.split(",").map((s) => {
|
|
1196
1215
|
return s.trim();
|
|
1197
1216
|
});
|
|
1217
|
+
for (const name of names) {
|
|
1218
|
+
validateSkillName(name);
|
|
1219
|
+
}
|
|
1220
|
+
return names;
|
|
1198
1221
|
}
|
|
1199
1222
|
if (options.addSkill) {
|
|
1223
|
+
validateSkillName(options.addSkill);
|
|
1200
1224
|
if (existing.includes(options.addSkill)) {
|
|
1201
1225
|
throw new Error(
|
|
1202
1226
|
`Skill "${options.addSkill}" is already attached to this agent`
|
|
@@ -5729,7 +5753,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
5729
5753
|
var program = new Command77();
|
|
5730
5754
|
program.name("zero").description(
|
|
5731
5755
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
5732
|
-
).version("9.102.
|
|
5756
|
+
).version("9.102.10").addHelpText(
|
|
5733
5757
|
"after",
|
|
5734
5758
|
`
|
|
5735
5759
|
Examples:
|