@vm0/cli 9.83.1 → 9.83.3
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-5BLBSO2W.js → chunk-IFUYTPFH.js} +48 -66
- package/chunk-IFUYTPFH.js.map +1 -0
- package/index.js +12 -13
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +15 -34
- package/zero.js.map +1 -1
- package/chunk-5BLBSO2W.js.map +0 -1
|
@@ -47,7 +47,7 @@ if (DSN) {
|
|
|
47
47
|
Sentry.init({
|
|
48
48
|
dsn: DSN,
|
|
49
49
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
50
|
-
release: "9.83.
|
|
50
|
+
release: "9.83.3",
|
|
51
51
|
sendDefaultPii: false,
|
|
52
52
|
tracesSampleRate: 0,
|
|
53
53
|
shutdownTimeout: 500,
|
|
@@ -66,7 +66,7 @@ if (DSN) {
|
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
Sentry.setContext("cli", {
|
|
69
|
-
version: "9.83.
|
|
69
|
+
version: "9.83.3",
|
|
70
70
|
command: process.argv.slice(2).join(" ")
|
|
71
71
|
});
|
|
72
72
|
Sentry.setContext("runtime", {
|
|
@@ -170,9 +170,16 @@ import { existsSync } from "fs";
|
|
|
170
170
|
function decodeCliTokenPayload(token) {
|
|
171
171
|
const raw = token ?? void 0;
|
|
172
172
|
if (!raw) return void 0;
|
|
173
|
-
const
|
|
174
|
-
|
|
175
|
-
|
|
173
|
+
const patPrefix = "vm0_pat_";
|
|
174
|
+
const legacyPrefix = "vm0_sandbox_";
|
|
175
|
+
let jwt;
|
|
176
|
+
if (raw.startsWith(patPrefix)) {
|
|
177
|
+
jwt = raw.slice(patPrefix.length);
|
|
178
|
+
} else if (raw.startsWith(legacyPrefix)) {
|
|
179
|
+
jwt = raw.slice(legacyPrefix.length);
|
|
180
|
+
} else {
|
|
181
|
+
return void 0;
|
|
182
|
+
}
|
|
176
183
|
const parts = jwt.split(".");
|
|
177
184
|
if (parts.length !== 3) return void 0;
|
|
178
185
|
try {
|
|
@@ -237,11 +244,7 @@ async function getActiveOrg() {
|
|
|
237
244
|
const token = await getToken();
|
|
238
245
|
const cliPayload = decodeCliTokenPayload(token);
|
|
239
246
|
if (cliPayload) return cliPayload.orgId;
|
|
240
|
-
|
|
241
|
-
return process.env.VM0_ACTIVE_ORG;
|
|
242
|
-
}
|
|
243
|
-
const config = await loadConfig();
|
|
244
|
-
return config.activeOrg;
|
|
247
|
+
return void 0;
|
|
245
248
|
}
|
|
246
249
|
async function clearConfig() {
|
|
247
250
|
const configFile = getConfigFile();
|
|
@@ -11522,18 +11525,21 @@ var ANTHROPIC_API_BASE = "https://api.anthropic.com";
|
|
|
11522
11525
|
function getFirewallBaseUrl(type) {
|
|
11523
11526
|
return getEnvironmentMapping(type)?.ANTHROPIC_BASE_URL ?? ANTHROPIC_API_BASE;
|
|
11524
11527
|
}
|
|
11525
|
-
function mpFirewall(type,
|
|
11528
|
+
function mpFirewall(type, authHeader, placeholderValue) {
|
|
11529
|
+
const secretName = MODEL_PROVIDER_TYPES[type].secretName;
|
|
11530
|
+
const secretRef = `\${{ secrets.${secretName} }}`;
|
|
11531
|
+
const headerValue = authHeader.valuePrefix ? `${authHeader.valuePrefix} ${secretRef}` : secretRef;
|
|
11526
11532
|
return {
|
|
11527
11533
|
name: `model-provider:${type}`,
|
|
11528
11534
|
ref: "__auto__",
|
|
11529
11535
|
apis: [
|
|
11530
11536
|
{
|
|
11531
11537
|
base: getFirewallBaseUrl(type),
|
|
11532
|
-
auth: { headers:
|
|
11538
|
+
auth: { headers: { [authHeader.name]: headerValue } },
|
|
11533
11539
|
permissions: [{ name: "unrestricted", rules: ["ANY /{path*}"] }]
|
|
11534
11540
|
}
|
|
11535
11541
|
],
|
|
11536
|
-
placeholders
|
|
11542
|
+
placeholders: { [secretName]: placeholderValue }
|
|
11537
11543
|
};
|
|
11538
11544
|
}
|
|
11539
11545
|
var MODEL_PROVIDER_FIREWALL_CONFIGS = {
|
|
@@ -11542,10 +11548,8 @@ var MODEL_PROVIDER_FIREWALL_CONFIGS = {
|
|
|
11542
11548
|
// https://semgrep.dev/blog/2025/secrets-story-and-prefixed-secrets/
|
|
11543
11549
|
"anthropic-api-key": mpFirewall(
|
|
11544
11550
|
"anthropic-api-key",
|
|
11545
|
-
{ "x-api-key"
|
|
11546
|
-
|
|
11547
|
-
ANTHROPIC_API_KEY: "sk-ant-api03-vm0placeholder0000000000000000000000000000000000000000000000000000000000000000000000000000000AA"
|
|
11548
|
-
}
|
|
11551
|
+
{ name: "x-api-key" },
|
|
11552
|
+
"sk-ant-api03-vm0placeholder0000000000000000000000000000000000000000000000000000000000000000000000000000000AA"
|
|
11549
11553
|
),
|
|
11550
11554
|
// Placeholder: sk-ant-oat01-{93 word/hyphen chars}AA (108 chars total)
|
|
11551
11555
|
// Source: same structure as API key; prefix from claude setup-token output
|
|
@@ -11553,10 +11557,8 @@ var MODEL_PROVIDER_FIREWALL_CONFIGS = {
|
|
|
11553
11557
|
// Example: sk-ant-oat01-xxxxx...xxxxx (1-year OAuth token)
|
|
11554
11558
|
"claude-code-oauth-token": mpFirewall(
|
|
11555
11559
|
"claude-code-oauth-token",
|
|
11556
|
-
{
|
|
11557
|
-
|
|
11558
|
-
CLAUDE_CODE_OAUTH_TOKEN: "sk-ant-oat01-vm0placeholder0000000000000000000000000000000000000000000000000000000000000000000000000000000AA"
|
|
11559
|
-
}
|
|
11560
|
+
{ name: "Authorization", valuePrefix: "Bearer" },
|
|
11561
|
+
"sk-ant-oat01-vm0placeholder0000000000000000000000000000000000000000000000000000000000000000000000000000000AA"
|
|
11560
11562
|
),
|
|
11561
11563
|
// Placeholder: sk-or-v1-{64 hex chars} (73 chars total)
|
|
11562
11564
|
// Source: real key observed in GitHub issue
|
|
@@ -11564,47 +11566,45 @@ var MODEL_PROVIDER_FIREWALL_CONFIGS = {
|
|
|
11564
11566
|
// Example: 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
|
|
11565
11567
|
"openrouter-api-key": mpFirewall(
|
|
11566
11568
|
"openrouter-api-key",
|
|
11567
|
-
{
|
|
11568
|
-
|
|
11569
|
-
OPENROUTER_API_KEY: "sk-or-v1-vm0placeholder00000000000000000000000000000000000000000000000000"
|
|
11570
|
-
}
|
|
11569
|
+
{ name: "Authorization", valuePrefix: "Bearer" },
|
|
11570
|
+
"sk-or-v1-vm0placeholder00000000000000000000000000000000000000000000000000"
|
|
11571
11571
|
),
|
|
11572
11572
|
// Placeholder: sk-{32 chars} (35 chars total)
|
|
11573
11573
|
// Source: no authoritative format documentation found; using generic sk- prefix
|
|
11574
11574
|
"moonshot-api-key": mpFirewall(
|
|
11575
11575
|
"moonshot-api-key",
|
|
11576
|
-
{
|
|
11577
|
-
|
|
11576
|
+
{ name: "Authorization", valuePrefix: "Bearer" },
|
|
11577
|
+
"sk-vm0placeholder000000000000000000"
|
|
11578
11578
|
),
|
|
11579
11579
|
// Placeholder: eyJ... (JWT-style, variable length)
|
|
11580
11580
|
// Source: no authoritative format documentation found; MiniMax docs do not disclose key format
|
|
11581
11581
|
// https://platform.minimax.io/docs/api-reference/api-overview
|
|
11582
11582
|
"minimax-api-key": mpFirewall(
|
|
11583
11583
|
"minimax-api-key",
|
|
11584
|
-
{
|
|
11585
|
-
|
|
11584
|
+
{ name: "Authorization", valuePrefix: "Bearer" },
|
|
11585
|
+
"eyvm0placeholder000000000000000000000000000000000000"
|
|
11586
11586
|
),
|
|
11587
11587
|
// Placeholder: sk-{32 hex chars} (35 chars total)
|
|
11588
11588
|
// Source: Semgrep regex \bsk-[a-f0-9]{32}\b
|
|
11589
11589
|
// https://semgrep.dev/blog/2025/secrets-story-and-prefixed-secrets/
|
|
11590
11590
|
"deepseek-api-key": mpFirewall(
|
|
11591
11591
|
"deepseek-api-key",
|
|
11592
|
-
{
|
|
11593
|
-
|
|
11592
|
+
{ name: "Authorization", valuePrefix: "Bearer" },
|
|
11593
|
+
"sk-vm0placeholder000000000000000000"
|
|
11594
11594
|
),
|
|
11595
11595
|
// Placeholder: sk-{32 chars} (35 chars total)
|
|
11596
11596
|
// Source: no authoritative format documentation found; using generic sk- prefix
|
|
11597
11597
|
"zai-api-key": mpFirewall(
|
|
11598
11598
|
"zai-api-key",
|
|
11599
|
-
{
|
|
11600
|
-
|
|
11599
|
+
{ name: "Authorization", valuePrefix: "Bearer" },
|
|
11600
|
+
"sk-vm0placeholder000000000000000000"
|
|
11601
11601
|
),
|
|
11602
11602
|
// Placeholder: sk-{32 chars} (35 chars total)
|
|
11603
11603
|
// Source: no authoritative format documentation found; Vercel gateway proxies upstream providers
|
|
11604
11604
|
"vercel-ai-gateway": mpFirewall(
|
|
11605
11605
|
"vercel-ai-gateway",
|
|
11606
|
-
{
|
|
11607
|
-
|
|
11606
|
+
{ name: "Authorization", valuePrefix: "Bearer" },
|
|
11607
|
+
"sk-vm0placeholder000000000000000000"
|
|
11608
11608
|
)
|
|
11609
11609
|
};
|
|
11610
11610
|
var modelProviderTypeSchema = z16.enum([
|
|
@@ -16753,7 +16753,8 @@ var memberUsageSchema = z37.object({
|
|
|
16753
16753
|
outputTokens: z37.number(),
|
|
16754
16754
|
cacheReadInputTokens: z37.number(),
|
|
16755
16755
|
cacheCreationInputTokens: z37.number(),
|
|
16756
|
-
creditsCharged: z37.number()
|
|
16756
|
+
creditsCharged: z37.number(),
|
|
16757
|
+
creditCap: z37.number().nullable()
|
|
16757
16758
|
});
|
|
16758
16759
|
var usageMembersResponseSchema = z37.object({
|
|
16759
16760
|
period: z37.object({
|
|
@@ -17055,9 +17056,7 @@ var STAFF_ORG_ID_HASHES = [
|
|
|
17055
17056
|
var FEATURE_SWITCHES = {
|
|
17056
17057
|
["pricing" /* Pricing */]: {
|
|
17057
17058
|
maintainer: "ethan@vm0.ai",
|
|
17058
|
-
enabled:
|
|
17059
|
-
enabledUserHashes: STAFF_USER_HASHES,
|
|
17060
|
-
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
17059
|
+
enabled: true
|
|
17061
17060
|
},
|
|
17062
17061
|
["dummy" /* Dummy */]: {
|
|
17063
17062
|
maintainer: "ethan@vm0.ai",
|
|
@@ -17240,6 +17239,14 @@ var FEATURE_SWITCHES = {
|
|
|
17240
17239
|
enabled: false,
|
|
17241
17240
|
enabledUserHashes: STAFF_USER_HASHES,
|
|
17242
17241
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
17242
|
+
},
|
|
17243
|
+
["concurrentAddOn" /* ConcurrentAddOn */]: {
|
|
17244
|
+
maintainer: "ethan@vm0.ai",
|
|
17245
|
+
enabled: false
|
|
17246
|
+
},
|
|
17247
|
+
["creditAddOn" /* CreditAddOn */]: {
|
|
17248
|
+
maintainer: "ethan@vm0.ai",
|
|
17249
|
+
enabled: false
|
|
17243
17250
|
}
|
|
17244
17251
|
};
|
|
17245
17252
|
async function isFeatureEnabled(key, ctx) {
|
|
@@ -17290,7 +17297,6 @@ function parseSkillFrontmatter(content) {
|
|
|
17290
17297
|
import chalk from "chalk";
|
|
17291
17298
|
|
|
17292
17299
|
// src/lib/api/core/client-factory.ts
|
|
17293
|
-
import { tsRestFetchApi } from "@ts-rest/core";
|
|
17294
17300
|
var ApiRequestError = class extends Error {
|
|
17295
17301
|
constructor(message, code, status) {
|
|
17296
17302
|
super(message);
|
|
@@ -17323,30 +17329,7 @@ async function getClientConfig() {
|
|
|
17323
17329
|
throw new ApiRequestError("Not authenticated", "UNAUTHORIZED", 401);
|
|
17324
17330
|
}
|
|
17325
17331
|
const baseHeaders = buildHeaders(token);
|
|
17326
|
-
|
|
17327
|
-
if (jwtPayload) {
|
|
17328
|
-
return { baseUrl, baseHeaders, jsonQuery: false };
|
|
17329
|
-
}
|
|
17330
|
-
const activeOrg = await getActiveOrg();
|
|
17331
|
-
if (!activeOrg) {
|
|
17332
|
-
throw new Error(
|
|
17333
|
-
"No active organization configured. Run: zero org use <slug>"
|
|
17334
|
-
);
|
|
17335
|
-
}
|
|
17336
|
-
return {
|
|
17337
|
-
baseUrl,
|
|
17338
|
-
baseHeaders,
|
|
17339
|
-
jsonQuery: false,
|
|
17340
|
-
api: async (args) => {
|
|
17341
|
-
const [pathPart, queryPart] = args.path.split("?");
|
|
17342
|
-
const params = new URLSearchParams(queryPart ?? "");
|
|
17343
|
-
if (!params.has("org")) {
|
|
17344
|
-
params.set("org", activeOrg);
|
|
17345
|
-
}
|
|
17346
|
-
args.path = params.toString() ? `${pathPart}?${params.toString()}` : pathPart;
|
|
17347
|
-
return tsRestFetchApi(args);
|
|
17348
|
-
}
|
|
17349
|
-
};
|
|
17332
|
+
return { baseUrl, baseHeaders, jsonQuery: false };
|
|
17350
17333
|
}
|
|
17351
17334
|
function handleError(result, defaultMessage) {
|
|
17352
17335
|
const errorBody = result.body;
|
|
@@ -18319,7 +18302,6 @@ async function promptPassword(message) {
|
|
|
18319
18302
|
|
|
18320
18303
|
export {
|
|
18321
18304
|
configureGlobalProxyFromEnv,
|
|
18322
|
-
decodeCliTokenPayload,
|
|
18323
18305
|
decodeZeroTokenPayload,
|
|
18324
18306
|
loadConfig,
|
|
18325
18307
|
saveConfig,
|
|
@@ -18437,4 +18419,4 @@ export {
|
|
|
18437
18419
|
promptSelect,
|
|
18438
18420
|
promptPassword
|
|
18439
18421
|
};
|
|
18440
|
-
//# sourceMappingURL=chunk-
|
|
18422
|
+
//# sourceMappingURL=chunk-IFUYTPFH.js.map
|