@vm0/cli 9.154.2 → 9.156.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-4F34B6ZK.js → chunk-EESCNG6H.js} +429 -196
- package/{chunk-4F34B6ZK.js.map → chunk-EESCNG6H.js.map} +1 -1
- package/index.js +9 -9
- package/package.json +1 -1
- package/zero.js +275 -98
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -68,7 +68,7 @@ import {
|
|
|
68
68
|
source_default,
|
|
69
69
|
volumeConfigSchema,
|
|
70
70
|
withErrorHandler
|
|
71
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-EESCNG6H.js";
|
|
72
72
|
import {
|
|
73
73
|
__toESM,
|
|
74
74
|
init_esm_shims
|
|
@@ -387,7 +387,7 @@ function getConfigPath() {
|
|
|
387
387
|
return join(os.homedir(), ".vm0", "config.json");
|
|
388
388
|
}
|
|
389
389
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
390
|
-
console.log(source_default.bold(`VM0 CLI v${"9.
|
|
390
|
+
console.log(source_default.bold(`VM0 CLI v${"9.156.0"}`));
|
|
391
391
|
console.log();
|
|
392
392
|
const config = await loadConfig();
|
|
393
393
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -4280,7 +4280,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
4280
4280
|
options.autoUpdate = false;
|
|
4281
4281
|
}
|
|
4282
4282
|
if (options.autoUpdate !== false) {
|
|
4283
|
-
await startSilentUpgrade("9.
|
|
4283
|
+
await startSilentUpgrade("9.156.0");
|
|
4284
4284
|
}
|
|
4285
4285
|
try {
|
|
4286
4286
|
let result;
|
|
@@ -4372,7 +4372,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4372
4372
|
withErrorHandler(
|
|
4373
4373
|
async (identifier, prompt, options) => {
|
|
4374
4374
|
if (options.autoUpdate !== false) {
|
|
4375
|
-
await startSilentUpgrade("9.
|
|
4375
|
+
await startSilentUpgrade("9.156.0");
|
|
4376
4376
|
}
|
|
4377
4377
|
const { name, version } = parseIdentifier(identifier);
|
|
4378
4378
|
let composeId;
|
|
@@ -6165,13 +6165,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6165
6165
|
if (latestVersion === null) {
|
|
6166
6166
|
throw new Error("Could not check for updates. Please try again later.");
|
|
6167
6167
|
}
|
|
6168
|
-
if (latestVersion === "9.
|
|
6169
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.
|
|
6168
|
+
if (latestVersion === "9.156.0") {
|
|
6169
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.156.0"})`));
|
|
6170
6170
|
return;
|
|
6171
6171
|
}
|
|
6172
6172
|
console.log(
|
|
6173
6173
|
source_default.yellow(
|
|
6174
|
-
`Current version: ${"9.
|
|
6174
|
+
`Current version: ${"9.156.0"} -> Latest version: ${latestVersion}`
|
|
6175
6175
|
)
|
|
6176
6176
|
);
|
|
6177
6177
|
console.log();
|
|
@@ -6198,7 +6198,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6198
6198
|
const success = await performUpgrade(packageManager);
|
|
6199
6199
|
if (success) {
|
|
6200
6200
|
console.log(
|
|
6201
|
-
source_default.green(`\u2713 Upgraded from ${"9.
|
|
6201
|
+
source_default.green(`\u2713 Upgraded from ${"9.156.0"} to ${latestVersion}`)
|
|
6202
6202
|
);
|
|
6203
6203
|
return;
|
|
6204
6204
|
}
|
|
@@ -6265,7 +6265,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
6265
6265
|
|
|
6266
6266
|
// src/index.ts
|
|
6267
6267
|
var program = new Command();
|
|
6268
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
6268
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.156.0");
|
|
6269
6269
|
program.addCommand(authCommand);
|
|
6270
6270
|
program.addCommand(infoCommand);
|
|
6271
6271
|
program.addCommand(composeCommand);
|
package/package.json
CHANGED
package/zero.js
CHANGED
|
@@ -61,6 +61,7 @@ import {
|
|
|
61
61
|
getSelectableProviderTypes,
|
|
62
62
|
getSkill,
|
|
63
63
|
getToken,
|
|
64
|
+
getVm0ModelMultiplier,
|
|
64
65
|
getZeroAgent,
|
|
65
66
|
getZeroAgentInstructions,
|
|
66
67
|
getZeroAgentUserConnectors,
|
|
@@ -88,6 +89,7 @@ import {
|
|
|
88
89
|
listZeroAgents,
|
|
89
90
|
listZeroConnectors,
|
|
90
91
|
listZeroLogs,
|
|
92
|
+
listZeroModelPolicies,
|
|
91
93
|
listZeroOrgModelProviders,
|
|
92
94
|
listZeroOrgSecrets,
|
|
93
95
|
listZeroOrgVariables,
|
|
@@ -138,7 +140,7 @@ import {
|
|
|
138
140
|
withErrorHandler,
|
|
139
141
|
zeroAgentCustomSkillNameSchema,
|
|
140
142
|
zeroLocalAgentCommand
|
|
141
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-EESCNG6H.js";
|
|
142
144
|
import {
|
|
143
145
|
__toESM,
|
|
144
146
|
init_esm_shims
|
|
@@ -522,47 +524,53 @@ init_esm_shims();
|
|
|
522
524
|
|
|
523
525
|
// src/commands/zero/org/model-provider/list.ts
|
|
524
526
|
init_esm_shims();
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
527
|
+
function createListCommand(options = {}) {
|
|
528
|
+
const scopeLabel = options.scopeLabel ?? "org-level";
|
|
529
|
+
const title = options.title ?? "Org Model Providers";
|
|
530
|
+
const setupCommand3 = options.setupCommand ?? "zero org model-provider setup";
|
|
531
|
+
return new Command().name("list").alias("ls").description(`List all ${scopeLabel} model providers`).action(
|
|
532
|
+
withErrorHandler(async () => {
|
|
533
|
+
const result = await listZeroOrgModelProviders();
|
|
534
|
+
if (result.modelProviders.length === 0) {
|
|
535
|
+
console.log(source_default.dim(`No ${scopeLabel} model providers configured`));
|
|
536
|
+
console.log();
|
|
537
|
+
console.log(`To add a ${scopeLabel} model provider:`);
|
|
538
|
+
console.log(source_default.cyan(` ${setupCommand3}`));
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
const byFramework = result.modelProviders.reduce(
|
|
542
|
+
(acc, p) => {
|
|
543
|
+
const fw = p.framework;
|
|
544
|
+
if (!acc[fw]) {
|
|
545
|
+
acc[fw] = [];
|
|
546
|
+
}
|
|
547
|
+
acc[fw].push(p);
|
|
548
|
+
return acc;
|
|
549
|
+
},
|
|
550
|
+
{}
|
|
551
|
+
);
|
|
552
|
+
console.log(source_default.bold(`${title}:`));
|
|
530
553
|
console.log();
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
554
|
+
for (const [framework, providers] of Object.entries(byFramework)) {
|
|
555
|
+
console.log(` ${source_default.cyan(framework)}:`);
|
|
556
|
+
for (const provider of providers) {
|
|
557
|
+
console.log(` ${provider.type}`);
|
|
558
|
+
console.log(source_default.dim(` ID: ${provider.id}`));
|
|
559
|
+
console.log(
|
|
560
|
+
source_default.dim(
|
|
561
|
+
` Updated: ${new Date(provider.updatedAt).toLocaleString()}`
|
|
562
|
+
)
|
|
563
|
+
);
|
|
540
564
|
}
|
|
541
|
-
|
|
542
|
-
return acc;
|
|
543
|
-
},
|
|
544
|
-
{}
|
|
545
|
-
);
|
|
546
|
-
console.log(source_default.bold("Org Model Providers:"));
|
|
547
|
-
console.log();
|
|
548
|
-
for (const [framework, providers] of Object.entries(byFramework)) {
|
|
549
|
-
console.log(` ${source_default.cyan(framework)}:`);
|
|
550
|
-
for (const provider of providers) {
|
|
551
|
-
console.log(` ${provider.type}`);
|
|
552
|
-
console.log(source_default.dim(` ID: ${provider.id}`));
|
|
553
|
-
console.log(
|
|
554
|
-
source_default.dim(
|
|
555
|
-
` Updated: ${new Date(provider.updatedAt).toLocaleString()}`
|
|
556
|
-
)
|
|
557
|
-
);
|
|
565
|
+
console.log();
|
|
558
566
|
}
|
|
559
|
-
console.log(
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
);
|
|
567
|
+
console.log(
|
|
568
|
+
source_default.dim(`Total: ${result.modelProviders.length} provider(s)`)
|
|
569
|
+
);
|
|
570
|
+
})
|
|
571
|
+
);
|
|
572
|
+
}
|
|
573
|
+
var listCommand4 = createListCommand();
|
|
566
574
|
|
|
567
575
|
// src/commands/zero/org/model-provider/setup.ts
|
|
568
576
|
init_esm_shims();
|
|
@@ -793,11 +801,11 @@ function collectSecrets(value, previous) {
|
|
|
793
801
|
}
|
|
794
802
|
|
|
795
803
|
// src/commands/zero/org/model-provider/setup.ts
|
|
796
|
-
async function handleInteractiveMode() {
|
|
804
|
+
async function handleInteractiveMode(commandPrefix) {
|
|
797
805
|
if (!isInteractive()) {
|
|
798
806
|
throw new Error("Interactive mode requires a TTY", {
|
|
799
807
|
cause: new Error(
|
|
800
|
-
|
|
808
|
+
`Use non-interactive mode: ${commandPrefix} --type <type> --secret "<value>"`
|
|
801
809
|
)
|
|
802
810
|
});
|
|
803
811
|
}
|
|
@@ -908,72 +916,100 @@ async function handleInteractiveMode() {
|
|
|
908
916
|
const secret = secretResponse.secret;
|
|
909
917
|
return { type, secret, isInteractiveMode: true };
|
|
910
918
|
}
|
|
911
|
-
|
|
912
|
-
"-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
if (
|
|
919
|
+
function createSetupCommand(options = {}) {
|
|
920
|
+
const commandPrefix = options.commandPrefix ?? "zero org model-provider setup";
|
|
921
|
+
const description = options.description ?? "Configure an org-level model provider";
|
|
922
|
+
const scopeLabel = options.scopeLabel ?? "Org";
|
|
923
|
+
return new Command().name("setup").description(description).option("-t, --type <type>", "Provider type (for non-interactive mode)").option(
|
|
924
|
+
"-s, --secret <value>",
|
|
925
|
+
"Secret value (can be used multiple times, supports VALUE or KEY=VALUE format)",
|
|
926
|
+
collectSecrets,
|
|
927
|
+
[]
|
|
928
|
+
).option(
|
|
929
|
+
"-a, --auth-method <method>",
|
|
930
|
+
"Auth method (required for multi-auth providers like aws-bedrock)"
|
|
931
|
+
).action(
|
|
932
|
+
withErrorHandler(
|
|
933
|
+
async (options2) => {
|
|
934
|
+
let input;
|
|
935
|
+
const secretArgs = options2.secret ?? [];
|
|
936
|
+
if (options2.type && secretArgs.length > 0) {
|
|
937
|
+
input = handleNonInteractiveMode({
|
|
938
|
+
type: options2.type,
|
|
939
|
+
secret: secretArgs,
|
|
940
|
+
authMethod: options2.authMethod,
|
|
941
|
+
commandPrefix
|
|
942
|
+
});
|
|
943
|
+
} else if (options2.type || secretArgs.length > 0) {
|
|
944
|
+
throw new Error("Both --type and --secret are required");
|
|
945
|
+
} else {
|
|
946
|
+
const result = await handleInteractiveMode(commandPrefix);
|
|
947
|
+
if (result === null) {
|
|
948
|
+
return;
|
|
949
|
+
}
|
|
950
|
+
input = result;
|
|
951
|
+
}
|
|
952
|
+
if (input.keepExistingSecret) {
|
|
953
|
+
console.log(
|
|
954
|
+
source_default.green(
|
|
955
|
+
`\u2713 ${scopeLabel} model provider "${input.type}" unchanged`
|
|
956
|
+
)
|
|
957
|
+
);
|
|
936
958
|
return;
|
|
937
959
|
}
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
960
|
+
const { created } = await upsertZeroOrgModelProvider({
|
|
961
|
+
type: input.type,
|
|
962
|
+
secret: input.secret,
|
|
963
|
+
authMethod: input.authMethod,
|
|
964
|
+
secrets: input.secrets
|
|
965
|
+
});
|
|
966
|
+
const action = created ? "created" : "updated";
|
|
941
967
|
console.log(
|
|
942
|
-
source_default.green(
|
|
968
|
+
source_default.green(
|
|
969
|
+
`\u2713 ${scopeLabel} model provider "${input.type}" ${action}`
|
|
970
|
+
)
|
|
943
971
|
);
|
|
944
|
-
return;
|
|
945
972
|
}
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
secrets: input.secrets
|
|
951
|
-
});
|
|
952
|
-
const action = created ? "created" : "updated";
|
|
953
|
-
console.log(
|
|
954
|
-
source_default.green(`\u2713 Org model provider "${input.type}" ${action}`)
|
|
955
|
-
);
|
|
956
|
-
}
|
|
957
|
-
)
|
|
958
|
-
);
|
|
973
|
+
)
|
|
974
|
+
);
|
|
975
|
+
}
|
|
976
|
+
var setupCommand = createSetupCommand();
|
|
959
977
|
|
|
960
978
|
// src/commands/zero/org/model-provider/remove.ts
|
|
961
979
|
init_esm_shims();
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
980
|
+
function createRemoveCommand(options = {}) {
|
|
981
|
+
const scopeLabel = options.scopeLabel ?? "Org";
|
|
982
|
+
return new Command().name("remove").description(`Remove a ${scopeLabel.toLowerCase()} model provider`).argument("<type>", "Model provider type to remove").action(
|
|
983
|
+
withErrorHandler(async (type) => {
|
|
984
|
+
if (!Object.keys(MODEL_PROVIDER_TYPES).includes(type)) {
|
|
985
|
+
const validTypes = Object.keys(MODEL_PROVIDER_TYPES).join(", ");
|
|
986
|
+
throw new Error(`Invalid type "${type}"`, {
|
|
987
|
+
cause: new Error(`Valid types: ${validTypes}`)
|
|
988
|
+
});
|
|
989
|
+
}
|
|
990
|
+
await deleteZeroOrgModelProvider(type);
|
|
991
|
+
console.log(
|
|
992
|
+
source_default.green(`\u2713 ${scopeLabel} model provider "${type}" removed`)
|
|
993
|
+
);
|
|
994
|
+
})
|
|
995
|
+
);
|
|
996
|
+
}
|
|
997
|
+
var removeCommand4 = createRemoveCommand();
|
|
974
998
|
|
|
975
999
|
// src/commands/zero/org/model-provider/index.ts
|
|
976
|
-
var zeroOrgModelProviderCommand = new Command().name("model-provider").description("Manage org-level model providers").addCommand(
|
|
1000
|
+
var zeroOrgModelProviderCommand = new Command().name("model-provider").description("Manage org-level model providers").addCommand(
|
|
1001
|
+
createListCommand({
|
|
1002
|
+
scopeLabel: "org-level",
|
|
1003
|
+
title: "Org Model Providers",
|
|
1004
|
+
setupCommand: "zero org model-provider setup"
|
|
1005
|
+
})
|
|
1006
|
+
).addCommand(
|
|
1007
|
+
createSetupCommand({
|
|
1008
|
+
commandPrefix: "zero org model-provider setup",
|
|
1009
|
+
description: "Configure an org-level model provider",
|
|
1010
|
+
scopeLabel: "Org"
|
|
1011
|
+
})
|
|
1012
|
+
).addCommand(createRemoveCommand({ scopeLabel: "Org" }));
|
|
977
1013
|
|
|
978
1014
|
// src/commands/zero/org/index.ts
|
|
979
1015
|
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);
|
|
@@ -8446,6 +8482,141 @@ Notes:
|
|
|
8446
8482
|
})
|
|
8447
8483
|
);
|
|
8448
8484
|
|
|
8485
|
+
// src/commands/zero/model/index.ts
|
|
8486
|
+
init_esm_shims();
|
|
8487
|
+
|
|
8488
|
+
// src/lib/domain/model-policy-display.ts
|
|
8489
|
+
init_esm_shims();
|
|
8490
|
+
function getModelProviderRouteKind(policy) {
|
|
8491
|
+
if (policy.defaultProviderType === "vm0") {
|
|
8492
|
+
return "built-in";
|
|
8493
|
+
}
|
|
8494
|
+
if (policy.credentialScope === "member") {
|
|
8495
|
+
return "subscription";
|
|
8496
|
+
}
|
|
8497
|
+
return "api key";
|
|
8498
|
+
}
|
|
8499
|
+
function getModelProviderTypeLabel(type) {
|
|
8500
|
+
return MODEL_PROVIDER_TYPES[type].label;
|
|
8501
|
+
}
|
|
8502
|
+
function formatModelProviderRoute(policy) {
|
|
8503
|
+
const kind = getModelProviderRouteKind(policy);
|
|
8504
|
+
const label = getModelProviderTypeLabel(policy.defaultProviderType);
|
|
8505
|
+
return `${kind} (${label}; ${policy.defaultProviderType})`;
|
|
8506
|
+
}
|
|
8507
|
+
function formatModelPolicyStatus(policy) {
|
|
8508
|
+
if (policy.routeStatus === "valid") {
|
|
8509
|
+
return null;
|
|
8510
|
+
}
|
|
8511
|
+
return policy.routeStatusReason ? `${policy.routeStatus}: ${policy.routeStatusReason}` : policy.routeStatus;
|
|
8512
|
+
}
|
|
8513
|
+
|
|
8514
|
+
// src/commands/zero/model/index.ts
|
|
8515
|
+
function formatCreditMultiplier(multiplier) {
|
|
8516
|
+
return multiplier === void 0 ? "unknown" : `x${multiplier}`;
|
|
8517
|
+
}
|
|
8518
|
+
function getCurrentIntegration() {
|
|
8519
|
+
const prompt = process.env.VM0_APPEND_SYSTEM_PROMPT;
|
|
8520
|
+
if (!prompt) {
|
|
8521
|
+
return null;
|
|
8522
|
+
}
|
|
8523
|
+
const match = prompt.match(/You are currently running inside:\s*([^\n]+)/i);
|
|
8524
|
+
return match?.[1]?.trim().toLowerCase() ?? null;
|
|
8525
|
+
}
|
|
8526
|
+
function getModelSwitchGuidance(integration = getCurrentIntegration()) {
|
|
8527
|
+
const normalizedIntegration = integration?.toLowerCase();
|
|
8528
|
+
if (normalizedIntegration === "web") {
|
|
8529
|
+
return "Switch models from the model selector next to the input box in the web chat.";
|
|
8530
|
+
}
|
|
8531
|
+
if (normalizedIntegration === "telegram") {
|
|
8532
|
+
return "Use /model in Telegram to switch models.";
|
|
8533
|
+
}
|
|
8534
|
+
return "Open https://app.vm0.ai and switch models from the model selector next to the input box.";
|
|
8535
|
+
}
|
|
8536
|
+
var listCommand13 = new Command().name("list").alias("ls").description("List models allowed by the current organization").action(
|
|
8537
|
+
withErrorHandler(async () => {
|
|
8538
|
+
const result = await listZeroModelPolicies();
|
|
8539
|
+
if (result.policies.length === 0) {
|
|
8540
|
+
console.log(source_default.dim("No models are allowed for this organization"));
|
|
8541
|
+
return;
|
|
8542
|
+
}
|
|
8543
|
+
console.log(source_default.bold("Allowed Models:"));
|
|
8544
|
+
console.log();
|
|
8545
|
+
for (const policy of result.policies) {
|
|
8546
|
+
const defaultMarker = policy.isDefault ? source_default.dim(" (default)") : "";
|
|
8547
|
+
console.log(
|
|
8548
|
+
` - ${policy.modelLabel} ${source_default.dim(`(${policy.model})`)}${defaultMarker}`
|
|
8549
|
+
);
|
|
8550
|
+
console.log(` provider: ${formatModelProviderRoute(policy)}`);
|
|
8551
|
+
if (getModelProviderRouteKind(policy) === "built-in") {
|
|
8552
|
+
console.log(
|
|
8553
|
+
` price coefficient: ${formatCreditMultiplier(getVm0ModelMultiplier(policy.model))}`
|
|
8554
|
+
);
|
|
8555
|
+
}
|
|
8556
|
+
const status = formatModelPolicyStatus(policy);
|
|
8557
|
+
if (status) {
|
|
8558
|
+
console.log(source_default.yellow(` status: ${status}`));
|
|
8559
|
+
}
|
|
8560
|
+
}
|
|
8561
|
+
console.log();
|
|
8562
|
+
console.log(
|
|
8563
|
+
source_default.dim(
|
|
8564
|
+
"Use `zero model-provider set --help` to see how to switch each model between built-in and BYOK."
|
|
8565
|
+
)
|
|
8566
|
+
);
|
|
8567
|
+
})
|
|
8568
|
+
);
|
|
8569
|
+
var switchCommand = new Command().name("switch").description("Show how to switch models in the current environment").action(() => {
|
|
8570
|
+
console.log(getModelSwitchGuidance());
|
|
8571
|
+
});
|
|
8572
|
+
var zeroModelCommand = new Command().name("model").description("List available models and model-switching guidance").addCommand(listCommand13).addCommand(switchCommand);
|
|
8573
|
+
|
|
8574
|
+
// src/commands/zero/model-provider/index.ts
|
|
8575
|
+
init_esm_shims();
|
|
8576
|
+
var MODEL_PROVIDER_SET_GUIDANCE = [
|
|
8577
|
+
"Model provider routing is configured in the web app.",
|
|
8578
|
+
"",
|
|
8579
|
+
"Organization admins: open https://app.vm0.ai, use the top-left organization menu, choose Manage, then add, delete, or adjust model providers.",
|
|
8580
|
+
"",
|
|
8581
|
+
"If an organization admin sets a model provider to subscription, members must use the bottom-left user menu, choose Preferences / Personal Models, and connect their personal subscription."
|
|
8582
|
+
].join("\n");
|
|
8583
|
+
var listCommand14 = new Command().name("list").alias("ls").description(
|
|
8584
|
+
"List provider routing for each model allowed by the organization"
|
|
8585
|
+
).action(
|
|
8586
|
+
withErrorHandler(async () => {
|
|
8587
|
+
const result = await listZeroModelPolicies();
|
|
8588
|
+
if (result.policies.length === 0) {
|
|
8589
|
+
console.log(
|
|
8590
|
+
source_default.dim(
|
|
8591
|
+
"No model provider routes are allowed for this organization"
|
|
8592
|
+
)
|
|
8593
|
+
);
|
|
8594
|
+
return;
|
|
8595
|
+
}
|
|
8596
|
+
console.log(source_default.bold("Model Provider Routes:"));
|
|
8597
|
+
console.log();
|
|
8598
|
+
for (const policy of result.policies) {
|
|
8599
|
+
const defaultMarker = policy.isDefault ? source_default.dim(" (default)") : "";
|
|
8600
|
+
console.log(
|
|
8601
|
+
` - ${policy.modelLabel} ${source_default.dim(`(${policy.model})`)}${defaultMarker}`
|
|
8602
|
+
);
|
|
8603
|
+
console.log(` provider: ${getModelProviderRouteKind(policy)}`);
|
|
8604
|
+
console.log(
|
|
8605
|
+
` provider type: ${policy.defaultProviderType} (${getModelProviderTypeLabel(policy.defaultProviderType)})`
|
|
8606
|
+
);
|
|
8607
|
+
const status = formatModelPolicyStatus(policy);
|
|
8608
|
+
if (status) {
|
|
8609
|
+
console.log(source_default.yellow(` status: ${status}`));
|
|
8610
|
+
}
|
|
8611
|
+
}
|
|
8612
|
+
})
|
|
8613
|
+
);
|
|
8614
|
+
var setCommand6 = new Command().name("set").description("Show where to adjust model provider routing").addHelpText("after", `
|
|
8615
|
+
${MODEL_PROVIDER_SET_GUIDANCE}`).action(() => {
|
|
8616
|
+
console.log(MODEL_PROVIDER_SET_GUIDANCE);
|
|
8617
|
+
});
|
|
8618
|
+
var zeroModelProviderCommand = new Command().name("model-provider").description("Inspect model provider routing").addCommand(listCommand14).addCommand(setCommand6);
|
|
8619
|
+
|
|
8449
8620
|
// src/zero.ts
|
|
8450
8621
|
var COMMAND_CAPABILITY_MAP = {
|
|
8451
8622
|
agent: "agent:read",
|
|
@@ -8454,6 +8625,8 @@ var COMMAND_CAPABILITY_MAP = {
|
|
|
8454
8625
|
run: "agent-run:write",
|
|
8455
8626
|
schedule: "schedule:read",
|
|
8456
8627
|
doctor: null,
|
|
8628
|
+
model: null,
|
|
8629
|
+
"model-provider": null,
|
|
8457
8630
|
logs: "agent-run:read",
|
|
8458
8631
|
search: "chat-message:read",
|
|
8459
8632
|
chat: "chat-message:write",
|
|
@@ -8471,6 +8644,8 @@ var COMMAND_CAPABILITY_MAP = {
|
|
|
8471
8644
|
};
|
|
8472
8645
|
var DEFAULT_COMMANDS = [
|
|
8473
8646
|
zeroOrgCommand,
|
|
8647
|
+
zeroModelCommand,
|
|
8648
|
+
zeroModelProviderCommand,
|
|
8474
8649
|
zeroAgentCommand,
|
|
8475
8650
|
zeroConnectorCommand,
|
|
8476
8651
|
zeroDoctorCommand,
|
|
@@ -8519,6 +8694,8 @@ function buildZeroHelpText(payload = decodeZeroTokenPayload()) {
|
|
|
8519
8694
|
" Upload AgentPhone? zero phone upload-file --help",
|
|
8520
8695
|
" Download AgentPhone? zero phone download-file --help",
|
|
8521
8696
|
" Set up a schedule? zero schedule setup --help",
|
|
8697
|
+
" List models? zero model ls",
|
|
8698
|
+
" Model routing? zero model-provider ls",
|
|
8522
8699
|
" Update yourself? zero agent --help",
|
|
8523
8700
|
" Manage custom skills? zero skill --help",
|
|
8524
8701
|
" Generate image? zero built-in generate image --help",
|
|
@@ -8542,7 +8719,7 @@ function registerZeroCommands(prog, commands) {
|
|
|
8542
8719
|
var program = new Command();
|
|
8543
8720
|
program.name("zero").description(
|
|
8544
8721
|
"Zero CLI \u2014 interact with the zero platform from inside the sandbox"
|
|
8545
|
-
).version("9.
|
|
8722
|
+
).version("9.156.0").addHelpText("after", () => {
|
|
8546
8723
|
return buildZeroHelpText();
|
|
8547
8724
|
});
|
|
8548
8725
|
if (process.argv[1]?.endsWith("zero.js") || process.argv[1]?.endsWith("zero.ts") || process.argv[1]?.endsWith("zero")) {
|