@vm0/cli 9.148.0 → 9.148.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-7S6FB5HX.js → chunk-WSZTOGEW.js} +539 -480
- package/{chunk-7S6FB5HX.js.map → chunk-WSZTOGEW.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +17 -246
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -67,7 +67,7 @@ import {
|
|
|
67
67
|
source_default,
|
|
68
68
|
volumeConfigSchema,
|
|
69
69
|
withErrorHandler
|
|
70
|
-
} from "./chunk-
|
|
70
|
+
} from "./chunk-WSZTOGEW.js";
|
|
71
71
|
import {
|
|
72
72
|
__toESM,
|
|
73
73
|
init_esm_shims
|
|
@@ -386,7 +386,7 @@ function getConfigPath() {
|
|
|
386
386
|
return join(os.homedir(), ".vm0", "config.json");
|
|
387
387
|
}
|
|
388
388
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
389
|
-
console.log(source_default.bold(`VM0 CLI v${"9.148.
|
|
389
|
+
console.log(source_default.bold(`VM0 CLI v${"9.148.1"}`));
|
|
390
390
|
console.log();
|
|
391
391
|
const config = await loadConfig();
|
|
392
392
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -4279,7 +4279,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
4279
4279
|
options.autoUpdate = false;
|
|
4280
4280
|
}
|
|
4281
4281
|
if (options.autoUpdate !== false) {
|
|
4282
|
-
await startSilentUpgrade("9.148.
|
|
4282
|
+
await startSilentUpgrade("9.148.1");
|
|
4283
4283
|
}
|
|
4284
4284
|
try {
|
|
4285
4285
|
let result;
|
|
@@ -4371,7 +4371,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4371
4371
|
withErrorHandler(
|
|
4372
4372
|
async (identifier, prompt, options) => {
|
|
4373
4373
|
if (options.autoUpdate !== false) {
|
|
4374
|
-
await startSilentUpgrade("9.148.
|
|
4374
|
+
await startSilentUpgrade("9.148.1");
|
|
4375
4375
|
}
|
|
4376
4376
|
const { name, version } = parseIdentifier(identifier);
|
|
4377
4377
|
let composeId;
|
|
@@ -6158,13 +6158,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6158
6158
|
if (latestVersion === null) {
|
|
6159
6159
|
throw new Error("Could not check for updates. Please try again later.");
|
|
6160
6160
|
}
|
|
6161
|
-
if (latestVersion === "9.148.
|
|
6162
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.148.
|
|
6161
|
+
if (latestVersion === "9.148.1") {
|
|
6162
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.148.1"})`));
|
|
6163
6163
|
return;
|
|
6164
6164
|
}
|
|
6165
6165
|
console.log(
|
|
6166
6166
|
source_default.yellow(
|
|
6167
|
-
`Current version: ${"9.148.
|
|
6167
|
+
`Current version: ${"9.148.1"} -> Latest version: ${latestVersion}`
|
|
6168
6168
|
)
|
|
6169
6169
|
);
|
|
6170
6170
|
console.log();
|
|
@@ -6191,7 +6191,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6191
6191
|
const success = await performUpgrade(packageManager);
|
|
6192
6192
|
if (success) {
|
|
6193
6193
|
console.log(
|
|
6194
|
-
source_default.green(`\u2713 Upgraded from ${"9.148.
|
|
6194
|
+
source_default.green(`\u2713 Upgraded from ${"9.148.1"} to ${latestVersion}`)
|
|
6195
6195
|
);
|
|
6196
6196
|
return;
|
|
6197
6197
|
}
|
|
@@ -6258,7 +6258,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
6258
6258
|
|
|
6259
6259
|
// src/index.ts
|
|
6260
6260
|
var program = new Command();
|
|
6261
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.148.
|
|
6261
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.148.1");
|
|
6262
6262
|
program.addCommand(authCommand);
|
|
6263
6263
|
program.addCommand(infoCommand);
|
|
6264
6264
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -8,7 +8,6 @@ import {
|
|
|
8
8
|
EventRenderer,
|
|
9
9
|
MODEL_PROVIDER_TYPES,
|
|
10
10
|
Option,
|
|
11
|
-
allowsCustomModel,
|
|
12
11
|
completePhoneFileUpload,
|
|
13
12
|
completeSlackFileUpload,
|
|
14
13
|
completeTelegramFileUpload,
|
|
@@ -47,10 +46,7 @@ import {
|
|
|
47
46
|
getConnectorEnvironmentMapping,
|
|
48
47
|
getConnectorFirewall,
|
|
49
48
|
getConnectorTypeForSecretName,
|
|
50
|
-
getCustomModelPlaceholder,
|
|
51
49
|
getDefaultAuthMethod,
|
|
52
|
-
getDefaultModel,
|
|
53
|
-
getModels,
|
|
54
50
|
getScopeDiff,
|
|
55
51
|
getSecretsForAuthMethod,
|
|
56
52
|
getSelectableProviderTypes,
|
|
@@ -67,7 +63,6 @@ import {
|
|
|
67
63
|
getZeroRunContext,
|
|
68
64
|
getZeroUserPreferences,
|
|
69
65
|
hasAuthMethods,
|
|
70
|
-
hasModelSelection,
|
|
71
66
|
hasRequiredScopes,
|
|
72
67
|
initPhoneFileUpload,
|
|
73
68
|
initSlackFileUpload,
|
|
@@ -113,7 +108,6 @@ import {
|
|
|
113
108
|
sendPhoneMessage,
|
|
114
109
|
sendSlackMessage,
|
|
115
110
|
sendTelegramMessage,
|
|
116
|
-
setZeroOrgModelProviderDefault,
|
|
117
111
|
setZeroOrgSecret,
|
|
118
112
|
setZeroOrgVariable,
|
|
119
113
|
setZeroSecret,
|
|
@@ -126,14 +120,13 @@ import {
|
|
|
126
120
|
updateZeroAgent,
|
|
127
121
|
updateZeroAgentInstructions,
|
|
128
122
|
updateZeroOrg,
|
|
129
|
-
updateZeroOrgModelProviderModel,
|
|
130
123
|
updateZeroUserPreferences,
|
|
131
124
|
uploadWebFile,
|
|
132
125
|
upsertZeroOrgModelProvider,
|
|
133
126
|
withErrorHandler,
|
|
134
127
|
zeroAgentCustomSkillNameSchema,
|
|
135
128
|
zeroRemoteAgentCommand
|
|
136
|
-
} from "./chunk-
|
|
129
|
+
} from "./chunk-WSZTOGEW.js";
|
|
137
130
|
import {
|
|
138
131
|
__toESM,
|
|
139
132
|
init_esm_shims
|
|
@@ -543,23 +536,8 @@ var listCommand4 = new Command().name("list").alias("ls").description("List all
|
|
|
543
536
|
for (const [framework, providers] of Object.entries(byFramework)) {
|
|
544
537
|
console.log(` ${source_default.cyan(framework)}:`);
|
|
545
538
|
for (const provider of providers) {
|
|
546
|
-
|
|
547
|
-
const modelTag = provider.selectedModel ? source_default.dim(` [${provider.selectedModel}]`) : "";
|
|
548
|
-
console.log(` ${provider.type}${defaultTag}${modelTag}`);
|
|
539
|
+
console.log(` ${provider.type}`);
|
|
549
540
|
console.log(source_default.dim(` ID: ${provider.id}`));
|
|
550
|
-
if (provider.type in MODEL_PROVIDER_TYPES) {
|
|
551
|
-
const type = provider.type;
|
|
552
|
-
const available = getModels(type) ?? [];
|
|
553
|
-
if (available.length > 0) {
|
|
554
|
-
console.log(
|
|
555
|
-
source_default.dim(` Available models: ${available.join(", ")}`)
|
|
556
|
-
);
|
|
557
|
-
} else if (allowsCustomModel(type)) {
|
|
558
|
-
console.log(
|
|
559
|
-
source_default.dim(" Available models: (custom \u2014 any model name)")
|
|
560
|
-
);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
541
|
console.log(
|
|
564
542
|
source_default.dim(
|
|
565
543
|
` Updated: ${new Date(provider.updatedAt).toLocaleString()}`
|
|
@@ -571,12 +549,6 @@ var listCommand4 = new Command().name("list").alias("ls").description("List all
|
|
|
571
549
|
console.log(
|
|
572
550
|
source_default.dim(`Total: ${result.modelProviders.length} provider(s)`)
|
|
573
551
|
);
|
|
574
|
-
console.log();
|
|
575
|
-
console.log(
|
|
576
|
-
source_default.dim(
|
|
577
|
-
"Use a provider ID with: zero agent edit <agent-id> --model-provider <id> --model <name>"
|
|
578
|
-
)
|
|
579
|
-
);
|
|
580
552
|
})
|
|
581
553
|
);
|
|
582
554
|
|
|
@@ -596,18 +568,6 @@ function validateProviderType(typeStr) {
|
|
|
596
568
|
}
|
|
597
569
|
return typeStr;
|
|
598
570
|
}
|
|
599
|
-
function validateModel(type, modelStr) {
|
|
600
|
-
const models = getModels(type);
|
|
601
|
-
if (allowsCustomModel(type)) {
|
|
602
|
-
return modelStr;
|
|
603
|
-
}
|
|
604
|
-
if (models && !models.includes(modelStr)) {
|
|
605
|
-
throw new Error(`Invalid model "${modelStr}"`, {
|
|
606
|
-
cause: new Error(`Valid models: ${models.join(", ")}`)
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
|
-
return modelStr;
|
|
610
|
-
}
|
|
611
571
|
function validateAuthMethod(type, authMethodStr) {
|
|
612
572
|
const authMethods = getAuthMethodsForType(type);
|
|
613
573
|
if (!authMethods || !(authMethodStr in authMethods)) {
|
|
@@ -681,13 +641,6 @@ function validateSecrets(type, authMethod, secrets) {
|
|
|
681
641
|
function handleNonInteractiveMode(options) {
|
|
682
642
|
const type = validateProviderType(options.type);
|
|
683
643
|
const cmdPrefix = options.commandPrefix ?? "zero org model-provider setup";
|
|
684
|
-
let selectedModel;
|
|
685
|
-
if (options.model) {
|
|
686
|
-
selectedModel = validateModel(type, options.model);
|
|
687
|
-
} else if (hasModelSelection(type)) {
|
|
688
|
-
const defaultModel = getDefaultModel(type);
|
|
689
|
-
selectedModel = defaultModel || void 0;
|
|
690
|
-
}
|
|
691
644
|
if (hasAuthMethods(type)) {
|
|
692
645
|
let authMethod;
|
|
693
646
|
if (options.authMethod) {
|
|
@@ -719,7 +672,6 @@ function handleNonInteractiveMode(options) {
|
|
|
719
672
|
type,
|
|
720
673
|
authMethod,
|
|
721
674
|
secrets,
|
|
722
|
-
selectedModel,
|
|
723
675
|
isInteractiveMode: false
|
|
724
676
|
};
|
|
725
677
|
}
|
|
@@ -737,68 +689,9 @@ function handleNonInteractiveMode(options) {
|
|
|
737
689
|
return {
|
|
738
690
|
type,
|
|
739
691
|
secret,
|
|
740
|
-
selectedModel,
|
|
741
692
|
isInteractiveMode: false
|
|
742
693
|
};
|
|
743
694
|
}
|
|
744
|
-
async function promptForModelSelection(type) {
|
|
745
|
-
if (!hasModelSelection(type)) {
|
|
746
|
-
return void 0;
|
|
747
|
-
}
|
|
748
|
-
const models = getModels(type) ?? [];
|
|
749
|
-
const defaultModel = getDefaultModel(type);
|
|
750
|
-
const supportsCustomModel = allowsCustomModel(type);
|
|
751
|
-
const modelChoices = [];
|
|
752
|
-
if (defaultModel === "") {
|
|
753
|
-
modelChoices.push({ title: "auto (Recommended)", value: "" });
|
|
754
|
-
}
|
|
755
|
-
for (const model of models) {
|
|
756
|
-
modelChoices.push({
|
|
757
|
-
title: model === defaultModel ? `${model} (Recommended)` : model,
|
|
758
|
-
value: model
|
|
759
|
-
});
|
|
760
|
-
}
|
|
761
|
-
if (supportsCustomModel) {
|
|
762
|
-
modelChoices.push({ title: "Custom model ID", value: "__custom__" });
|
|
763
|
-
}
|
|
764
|
-
const modelResponse = await (0, import_prompts.default)(
|
|
765
|
-
{
|
|
766
|
-
type: "select",
|
|
767
|
-
name: "model",
|
|
768
|
-
message: "Select model:",
|
|
769
|
-
choices: modelChoices
|
|
770
|
-
},
|
|
771
|
-
{
|
|
772
|
-
onCancel: () => {
|
|
773
|
-
return process.exit(0);
|
|
774
|
-
}
|
|
775
|
-
}
|
|
776
|
-
);
|
|
777
|
-
const selected = modelResponse.model;
|
|
778
|
-
if (selected === "__custom__") {
|
|
779
|
-
const placeholder = getCustomModelPlaceholder(type);
|
|
780
|
-
if (placeholder) {
|
|
781
|
-
console.log(source_default.dim(`Example: ${placeholder}`));
|
|
782
|
-
}
|
|
783
|
-
const customResponse = await (0, import_prompts.default)(
|
|
784
|
-
{
|
|
785
|
-
type: "text",
|
|
786
|
-
name: "customModel",
|
|
787
|
-
message: "Enter model ID:",
|
|
788
|
-
validate: (value) => {
|
|
789
|
-
return value.length > 0 || "Model ID is required";
|
|
790
|
-
}
|
|
791
|
-
},
|
|
792
|
-
{
|
|
793
|
-
onCancel: () => {
|
|
794
|
-
return process.exit(0);
|
|
795
|
-
}
|
|
796
|
-
}
|
|
797
|
-
);
|
|
798
|
-
return customResponse.customModel;
|
|
799
|
-
}
|
|
800
|
-
return selected === "" ? void 0 : selected;
|
|
801
|
-
}
|
|
802
695
|
async function promptForAuthMethod(type) {
|
|
803
696
|
const authMethods = getAuthMethodsForType(type);
|
|
804
697
|
const defaultAuthMethod = getDefaultAuthMethod(type);
|
|
@@ -886,11 +779,6 @@ async function promptForSecrets(type, authMethod) {
|
|
|
886
779
|
function collectSecrets(value, previous) {
|
|
887
780
|
return previous.concat([value]);
|
|
888
781
|
}
|
|
889
|
-
function parseModelFlag(value) {
|
|
890
|
-
if (value === void 0) return void 0;
|
|
891
|
-
if (value === "default") return null;
|
|
892
|
-
return value;
|
|
893
|
-
}
|
|
894
782
|
|
|
895
783
|
// src/commands/zero/org/model-provider/setup.ts
|
|
896
784
|
async function handleInteractiveMode() {
|
|
@@ -966,11 +854,9 @@ async function handleInteractiveMode() {
|
|
|
966
854
|
return null;
|
|
967
855
|
}
|
|
968
856
|
if (actionResponse.action === "keep") {
|
|
969
|
-
const selectedModel2 = await promptForModelSelection(type);
|
|
970
857
|
return {
|
|
971
858
|
type,
|
|
972
859
|
keepExistingSecret: true,
|
|
973
|
-
selectedModel: selectedModel2,
|
|
974
860
|
isInteractiveMode: true
|
|
975
861
|
};
|
|
976
862
|
}
|
|
@@ -984,12 +870,10 @@ async function handleInteractiveMode() {
|
|
|
984
870
|
if (hasAuthMethods(type)) {
|
|
985
871
|
const authMethod = await promptForAuthMethod(type);
|
|
986
872
|
const secrets = await promptForSecrets(type, authMethod);
|
|
987
|
-
const selectedModel2 = await promptForModelSelection(type);
|
|
988
873
|
return {
|
|
989
874
|
type,
|
|
990
875
|
authMethod,
|
|
991
876
|
secrets,
|
|
992
|
-
selectedModel: selectedModel2,
|
|
993
877
|
isInteractiveMode: true
|
|
994
878
|
};
|
|
995
879
|
}
|
|
@@ -1010,34 +894,7 @@ async function handleInteractiveMode() {
|
|
|
1010
894
|
return null;
|
|
1011
895
|
}
|
|
1012
896
|
const secret = secretResponse.secret;
|
|
1013
|
-
|
|
1014
|
-
return { type, secret, selectedModel, isInteractiveMode: true };
|
|
1015
|
-
}
|
|
1016
|
-
async function promptSetAsDefault(type, framework, isDefault) {
|
|
1017
|
-
if (isDefault) return;
|
|
1018
|
-
let cancelled = false;
|
|
1019
|
-
const response = await (0, import_prompts2.default)(
|
|
1020
|
-
{
|
|
1021
|
-
type: "confirm",
|
|
1022
|
-
name: "setDefault",
|
|
1023
|
-
message: "Set this provider as default?",
|
|
1024
|
-
initial: false
|
|
1025
|
-
},
|
|
1026
|
-
{
|
|
1027
|
-
onCancel: () => {
|
|
1028
|
-
cancelled = true;
|
|
1029
|
-
return false;
|
|
1030
|
-
}
|
|
1031
|
-
}
|
|
1032
|
-
);
|
|
1033
|
-
if (cancelled) {
|
|
1034
|
-
console.log(source_default.dim("Cancelled"));
|
|
1035
|
-
return;
|
|
1036
|
-
}
|
|
1037
|
-
if (response.setDefault) {
|
|
1038
|
-
await setZeroOrgModelProviderDefault(type);
|
|
1039
|
-
console.log(source_default.green(`\u2713 Default for ${framework} set to "${type}"`));
|
|
1040
|
-
}
|
|
897
|
+
return { type, secret, isInteractiveMode: true };
|
|
1041
898
|
}
|
|
1042
899
|
var setupCommand = new Command().name("setup").description("Configure an org-level model provider").option("-t, --type <type>", "Provider type (for non-interactive mode)").option(
|
|
1043
900
|
"-s, --secret <value>",
|
|
@@ -1047,7 +904,7 @@ var setupCommand = new Command().name("setup").description("Configure an org-lev
|
|
|
1047
904
|
).option(
|
|
1048
905
|
"-a, --auth-method <method>",
|
|
1049
906
|
"Auth method (required for multi-auth providers like aws-bedrock)"
|
|
1050
|
-
).
|
|
907
|
+
).action(
|
|
1051
908
|
withErrorHandler(
|
|
1052
909
|
async (options) => {
|
|
1053
910
|
let input;
|
|
@@ -1057,7 +914,6 @@ var setupCommand = new Command().name("setup").description("Configure an org-lev
|
|
|
1057
914
|
type: options.type,
|
|
1058
915
|
secret: secretArgs,
|
|
1059
916
|
authMethod: options.authMethod,
|
|
1060
|
-
model: options.model,
|
|
1061
917
|
commandPrefix: "zero org model-provider setup"
|
|
1062
918
|
});
|
|
1063
919
|
} else if (options.type || secretArgs.length > 0) {
|
|
@@ -1070,54 +926,21 @@ var setupCommand = new Command().name("setup").description("Configure an org-lev
|
|
|
1070
926
|
input = result;
|
|
1071
927
|
}
|
|
1072
928
|
if (input.keepExistingSecret) {
|
|
1073
|
-
|
|
1074
|
-
input.type
|
|
1075
|
-
input.selectedModel
|
|
929
|
+
console.log(
|
|
930
|
+
source_default.green(`\u2713 Org model provider "${input.type}" unchanged`)
|
|
1076
931
|
);
|
|
1077
|
-
const defaultNote2 = provider2.isDefault ? ` (default for ${provider2.framework})` : "";
|
|
1078
|
-
const modelNote2 = provider2.selectedModel ? ` with model: ${provider2.selectedModel}` : "";
|
|
1079
|
-
if (!hasModelSelection(input.type)) {
|
|
1080
|
-
console.log(
|
|
1081
|
-
source_default.green(`\u2713 Org model provider "${input.type}" unchanged`)
|
|
1082
|
-
);
|
|
1083
|
-
} else {
|
|
1084
|
-
console.log(
|
|
1085
|
-
source_default.green(
|
|
1086
|
-
`\u2713 Org model provider "${input.type}" updated${defaultNote2}${modelNote2}`
|
|
1087
|
-
)
|
|
1088
|
-
);
|
|
1089
|
-
}
|
|
1090
|
-
if (input.isInteractiveMode) {
|
|
1091
|
-
await promptSetAsDefault(
|
|
1092
|
-
input.type,
|
|
1093
|
-
provider2.framework,
|
|
1094
|
-
provider2.isDefault
|
|
1095
|
-
);
|
|
1096
|
-
}
|
|
1097
932
|
return;
|
|
1098
933
|
}
|
|
1099
|
-
const {
|
|
934
|
+
const { created } = await upsertZeroOrgModelProvider({
|
|
1100
935
|
type: input.type,
|
|
1101
936
|
secret: input.secret,
|
|
1102
937
|
authMethod: input.authMethod,
|
|
1103
|
-
secrets: input.secrets
|
|
1104
|
-
selectedModel: input.selectedModel
|
|
938
|
+
secrets: input.secrets
|
|
1105
939
|
});
|
|
1106
940
|
const action = created ? "created" : "updated";
|
|
1107
|
-
const defaultNote = provider.isDefault ? ` (default for ${provider.framework})` : "";
|
|
1108
|
-
const modelNote = provider.selectedModel ? ` with model: ${provider.selectedModel}` : "";
|
|
1109
941
|
console.log(
|
|
1110
|
-
source_default.green(
|
|
1111
|
-
`\u2713 Org model provider "${input.type}" ${action}${defaultNote}${modelNote}`
|
|
1112
|
-
)
|
|
942
|
+
source_default.green(`\u2713 Org model provider "${input.type}" ${action}`)
|
|
1113
943
|
);
|
|
1114
|
-
if (input.isInteractiveMode) {
|
|
1115
|
-
await promptSetAsDefault(
|
|
1116
|
-
input.type,
|
|
1117
|
-
provider.framework,
|
|
1118
|
-
provider.isDefault
|
|
1119
|
-
);
|
|
1120
|
-
}
|
|
1121
944
|
}
|
|
1122
945
|
)
|
|
1123
946
|
);
|
|
@@ -1137,29 +960,8 @@ var removeCommand4 = new Command().name("remove").description("Remove an org-lev
|
|
|
1137
960
|
})
|
|
1138
961
|
);
|
|
1139
962
|
|
|
1140
|
-
// src/commands/zero/org/model-provider/set-default.ts
|
|
1141
|
-
init_esm_shims();
|
|
1142
|
-
var setDefaultCommand = new Command().name("set-default").description("Set an org-level model provider as default for its framework").argument("<type>", "Model provider type to set as default").action(
|
|
1143
|
-
withErrorHandler(async (type) => {
|
|
1144
|
-
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type)) {
|
|
1145
|
-
const validTypes = Object.keys(MODEL_PROVIDER_TYPES).join(", ");
|
|
1146
|
-
throw new Error(`Invalid type "${type}"`, {
|
|
1147
|
-
cause: new Error(`Valid types: ${validTypes}`)
|
|
1148
|
-
});
|
|
1149
|
-
}
|
|
1150
|
-
const provider = await setZeroOrgModelProviderDefault(
|
|
1151
|
-
type
|
|
1152
|
-
);
|
|
1153
|
-
console.log(
|
|
1154
|
-
source_default.green(
|
|
1155
|
-
`\u2713 Default for ${provider.framework} set to "${provider.type}"`
|
|
1156
|
-
)
|
|
1157
|
-
);
|
|
1158
|
-
})
|
|
1159
|
-
);
|
|
1160
|
-
|
|
1161
963
|
// src/commands/zero/org/model-provider/index.ts
|
|
1162
|
-
var zeroOrgModelProviderCommand = new Command().name("model-provider").description("Manage org-level model providers").addCommand(listCommand4).addCommand(setupCommand).addCommand(removeCommand4)
|
|
964
|
+
var zeroOrgModelProviderCommand = new Command().name("model-provider").description("Manage org-level model providers").addCommand(listCommand4).addCommand(setupCommand).addCommand(removeCommand4);
|
|
1163
965
|
|
|
1164
966
|
// src/commands/zero/org/index.ts
|
|
1165
967
|
var zeroOrgCommand = new Command().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);
|
|
@@ -1435,24 +1237,20 @@ function hasAvatarUpdate(options) {
|
|
|
1435
1237
|
return options.avatar !== void 0 || options.avatarRotation !== void 0 || options.avatarSkin !== void 0 || options.avatarHairStyle !== void 0 || options.avatarHairColor !== void 0 || options.avatarExpression !== void 0 || options.avatarIntensity !== void 0;
|
|
1436
1238
|
}
|
|
1437
1239
|
function hasAgentFieldUpdate(options) {
|
|
1438
|
-
return options.displayName !== void 0 || options.description !== void 0 || options.sound !== void 0 || hasAvatarUpdate(options) || options.skills !== void 0 || options.addSkill !== void 0 || options.removeSkill !== void 0
|
|
1240
|
+
return options.displayName !== void 0 || options.description !== void 0 || options.sound !== void 0 || hasAvatarUpdate(options) || options.skills !== void 0 || options.addSkill !== void 0 || options.removeSkill !== void 0;
|
|
1439
1241
|
}
|
|
1440
1242
|
async function applyAgentUpdate(agentId, options) {
|
|
1441
1243
|
const hasAvatar = hasAvatarUpdate(options);
|
|
1442
1244
|
const resolvedAvatarUrl = hasAvatar ? resolveAvatarUrl(options) : void 0;
|
|
1443
1245
|
const current = await getZeroAgent(agentId);
|
|
1444
1246
|
const customSkills = resolveCustomSkills(options, current.customSkills ?? []);
|
|
1445
|
-
const modelProviderId = options.modelProvider !== void 0 ? parseModelFlag(options.modelProvider) : current.modelProviderId;
|
|
1446
|
-
const selectedModel = options.model !== void 0 ? parseModelFlag(options.model) : current.selectedModel;
|
|
1447
1247
|
const avatarUrl = hasAvatar ? resolvedAvatarUrl : current.avatarUrl ?? void 0;
|
|
1448
1248
|
await updateZeroAgent(agentId, {
|
|
1449
1249
|
displayName: options.displayName !== void 0 ? options.displayName : current.displayName ?? void 0,
|
|
1450
1250
|
description: options.description !== void 0 ? options.description : current.description ?? void 0,
|
|
1451
1251
|
sound: options.sound !== void 0 ? options.sound : current.sound ?? void 0,
|
|
1452
1252
|
avatarUrl,
|
|
1453
|
-
customSkills
|
|
1454
|
-
modelProviderId,
|
|
1455
|
-
selectedModel
|
|
1253
|
+
customSkills
|
|
1456
1254
|
});
|
|
1457
1255
|
}
|
|
1458
1256
|
function validateSkillName(name) {
|
|
@@ -1515,13 +1313,7 @@ var editCommand = new Command().name("edit").description("Edit a zero agent").ar
|
|
|
1515
1313
|
).option("--avatar-intensity <level>", "Intensity: chill | normal | hyped").option(
|
|
1516
1314
|
"--skills <items>",
|
|
1517
1315
|
"Comma-separated custom skill names to attach (replaces existing)"
|
|
1518
|
-
).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").
|
|
1519
|
-
"--model-provider <id>",
|
|
1520
|
-
"Model provider UUID, or 'default' to inherit org default"
|
|
1521
|
-
).option(
|
|
1522
|
-
"--model <name>",
|
|
1523
|
-
"Model name (e.g. claude-sonnet-4-6, MiniMax-M2.7), or 'default' to inherit provider default"
|
|
1524
|
-
).addHelpText(
|
|
1316
|
+
).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").addHelpText(
|
|
1525
1317
|
"after",
|
|
1526
1318
|
`
|
|
1527
1319
|
Avatar:
|
|
@@ -1551,8 +1343,6 @@ Examples:
|
|
|
1551
1343
|
Add a skill: zero agent edit <agent-id> --add-skill my-skill
|
|
1552
1344
|
Remove a skill: zero agent edit <agent-id> --remove-skill my-skill
|
|
1553
1345
|
Update instructions: zero agent edit <agent-id> --instructions-file ./instructions.md
|
|
1554
|
-
Set model: zero agent edit <agent-id> --model-provider <provider-id> --model MiniMax-M2.7
|
|
1555
|
-
Reset model: zero agent edit <agent-id> --model-provider default --model default
|
|
1556
1346
|
Update yourself: zero agent edit $ZERO_AGENT_ID --description "new role"
|
|
1557
1347
|
|
|
1558
1348
|
Notes:
|
|
@@ -1560,14 +1350,13 @@ Notes:
|
|
|
1560
1350
|
- Unspecified fields are preserved (not cleared)
|
|
1561
1351
|
- --skills replaces the entire skill list; --add-skill/--remove-skill modify incrementally
|
|
1562
1352
|
- --skills cannot be combined with --add-skill or --remove-skill
|
|
1563
|
-
- Use 'zero org model-provider list' to see available providers and models
|
|
1564
1353
|
- To create or edit skill content, use: zero skill --help`
|
|
1565
1354
|
).action(
|
|
1566
1355
|
withErrorHandler(async (agentId, options) => {
|
|
1567
1356
|
const hasAgentUpdate = hasAgentFieldUpdate(options);
|
|
1568
1357
|
if (!hasAgentUpdate && !options.instructionsFile) {
|
|
1569
1358
|
throw new Error(
|
|
1570
|
-
"At least one option is required (--display-name, --description, --sound, --avatar, --avatar-*, --skills, --add-skill, --remove-skill, --
|
|
1359
|
+
"At least one option is required (--display-name, --description, --sound, --avatar, --avatar-*, --skills, --add-skill, --remove-skill, --instructions-file)"
|
|
1571
1360
|
);
|
|
1572
1361
|
}
|
|
1573
1362
|
if (hasAgentUpdate) {
|
|
@@ -3947,12 +3736,6 @@ Deploying schedule for agent ${source_default.cyan(params.agentName)}...`
|
|
|
3947
3736
|
prompt: params.prompt,
|
|
3948
3737
|
...params.existingEnabled !== void 0 && {
|
|
3949
3738
|
enabled: params.existingEnabled
|
|
3950
|
-
},
|
|
3951
|
-
...params.modelProviderId !== void 0 && {
|
|
3952
|
-
modelProviderId: params.modelProviderId
|
|
3953
|
-
},
|
|
3954
|
-
...params.selectedModel !== void 0 && {
|
|
3955
|
-
selectedModel: params.selectedModel
|
|
3956
3739
|
}
|
|
3957
3740
|
});
|
|
3958
3741
|
return deployResult;
|
|
@@ -4035,13 +3818,7 @@ async function handleScheduleEnabling(params) {
|
|
|
4035
3818
|
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(
|
|
4036
3819
|
"--prompt-file <path>",
|
|
4037
3820
|
"Read prompt from file (cannot be used with --prompt)"
|
|
4038
|
-
).option("-e, --enable", "Enable schedule immediately after creation").
|
|
4039
|
-
"--model-provider <id>",
|
|
4040
|
-
"Model provider UUID, or 'default' to inherit from agent/org"
|
|
4041
|
-
).option(
|
|
4042
|
-
"--model <name>",
|
|
4043
|
-
"Model name (e.g. claude-sonnet-4-6, MiniMax-M2.7), or 'default' to inherit"
|
|
4044
|
-
).addHelpText(
|
|
3821
|
+
).option("-e, --enable", "Enable schedule immediately after creation").addHelpText(
|
|
4045
3822
|
"after",
|
|
4046
3823
|
`
|
|
4047
3824
|
Examples:
|
|
@@ -4052,14 +3829,10 @@ Examples:
|
|
|
4052
3829
|
Loop every 5 minutes: zero schedule setup <agent-id> -f loop -i 300 -p "poll for updates"
|
|
4053
3830
|
Prompt from file: zero schedule setup <agent-id> -f daily -t 09:00 --prompt-file ./prompt.md
|
|
4054
3831
|
Create and enable: zero schedule setup <agent-id> -f daily -t 09:00 -p "run report" --enable
|
|
4055
|
-
Override model: zero schedule setup <agent-id> -f daily -t 09:00 -p "..." --model-provider <id> --model MiniMax-M2.7
|
|
4056
|
-
Reset model override: zero schedule setup <agent-id> -f daily -t 09:00 -p "..." --model-provider default --model default
|
|
4057
3832
|
|
|
4058
3833
|
Notes:
|
|
4059
3834
|
- Re-running setup with the same agent updates the existing "default" schedule
|
|
4060
3835
|
- Use -n to manage multiple named schedules for the same agent
|
|
4061
|
-
- --model-provider and --model default to inheriting the agent's configuration
|
|
4062
|
-
- Use 'zero org model-provider list' to see available providers and models
|
|
4063
3836
|
- All flags are required in non-interactive mode; interactive mode prompts for missing values
|
|
4064
3837
|
- 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`
|
|
4065
3838
|
).action(
|
|
@@ -4123,9 +3896,7 @@ Notes:
|
|
|
4123
3896
|
intervalSeconds,
|
|
4124
3897
|
timezone,
|
|
4125
3898
|
prompt: promptText_,
|
|
4126
|
-
existingEnabled: existingSchedule?.enabled
|
|
4127
|
-
modelProviderId: parseModelFlag(options.modelProvider),
|
|
4128
|
-
selectedModel: parseModelFlag(options.model)
|
|
3899
|
+
existingEnabled: existingSchedule?.enabled
|
|
4129
3900
|
});
|
|
4130
3901
|
displayDeployResult(scheduleName, deployResult);
|
|
4131
3902
|
const shouldPromptEnable = deployResult.created || existingSchedule !== void 0 && !existingSchedule.enabled;
|
|
@@ -7648,7 +7419,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
7648
7419
|
var program = new Command();
|
|
7649
7420
|
program.name("zero").description(
|
|
7650
7421
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
7651
|
-
).version("9.148.
|
|
7422
|
+
).version("9.148.1").addHelpText(
|
|
7652
7423
|
"after",
|
|
7653
7424
|
`
|
|
7654
7425
|
Examples:
|