@vm0/cli 9.90.3 → 9.90.5
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-HZQ6GQVS.js → chunk-4ZDCMT63.js} +109 -45
- package/chunk-4ZDCMT63.js.map +1 -0
- package/index.js +134 -49
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +168 -61
- package/zero.js.map +1 -1
- package/chunk-HZQ6GQVS.js.map +0 -1
|
@@ -41,13 +41,15 @@ function isOperationalError(error) {
|
|
|
41
41
|
return false;
|
|
42
42
|
}
|
|
43
43
|
const message = error.message;
|
|
44
|
-
return OPERATIONAL_ERROR_PATTERNS.some((pattern) =>
|
|
44
|
+
return OPERATIONAL_ERROR_PATTERNS.some((pattern) => {
|
|
45
|
+
return pattern.test(message);
|
|
46
|
+
});
|
|
45
47
|
}
|
|
46
48
|
if (DSN) {
|
|
47
49
|
Sentry.init({
|
|
48
50
|
dsn: DSN,
|
|
49
51
|
environment: process.env.SENTRY_ENVIRONMENT ?? "production",
|
|
50
|
-
release: "9.90.
|
|
52
|
+
release: "9.90.5",
|
|
51
53
|
sendDefaultPii: false,
|
|
52
54
|
tracesSampleRate: 0,
|
|
53
55
|
shutdownTimeout: 500,
|
|
@@ -66,7 +68,7 @@ if (DSN) {
|
|
|
66
68
|
}
|
|
67
69
|
});
|
|
68
70
|
Sentry.setContext("cli", {
|
|
69
|
-
version: "9.90.
|
|
71
|
+
version: "9.90.5",
|
|
70
72
|
command: process.argv.slice(2).join(" ")
|
|
71
73
|
});
|
|
72
74
|
Sentry.setContext("runtime", {
|
|
@@ -460,10 +462,9 @@ var agentDefinitionSchema = z3.object({
|
|
|
460
462
|
* Path to instructions file (e.g., AGENTS.md).
|
|
461
463
|
* Auto-uploaded as volume and mounted at /home/user/.claude/CLAUDE.md
|
|
462
464
|
*/
|
|
463
|
-
instructions: z3.string().min(1, "Instructions path cannot be empty").refine(
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
).optional(),
|
|
465
|
+
instructions: z3.string().min(1, "Instructions path cannot be empty").refine((val) => {
|
|
466
|
+
return !val.includes("..") && !val.startsWith("/") && !val.startsWith("\\");
|
|
467
|
+
}, "Instructions path must be a relative path without '..' segments").optional(),
|
|
467
468
|
/**
|
|
468
469
|
* Array of GitHub tree URLs for agent skills.
|
|
469
470
|
* Each skill is auto-downloaded and mounted at /home/user/.claude/skills/{skillName}/
|
|
@@ -977,7 +978,9 @@ var orgTierSchema = z7.enum(["free", "pro", "team"]);
|
|
|
977
978
|
var orgSlugSchema = z7.string().min(3, "Org slug must be at least 3 characters").max(64, "Org slug must be at most 64 characters").regex(
|
|
978
979
|
/^[a-z0-9][a-z0-9-]*[a-z0-9]$|^[a-z0-9]{1,2}$/,
|
|
979
980
|
"Org slug must contain only lowercase letters, numbers, and hyphens, and must start and end with an alphanumeric character"
|
|
980
|
-
).transform((s) =>
|
|
981
|
+
).transform((s) => {
|
|
982
|
+
return s.toLowerCase();
|
|
983
|
+
});
|
|
981
984
|
var orgResponseSchema = z7.object({
|
|
982
985
|
id: z7.string(),
|
|
983
986
|
slug: z7.string(),
|
|
@@ -2542,7 +2545,9 @@ var HIDDEN_PROVIDER_TYPES = new Set(
|
|
|
2542
2545
|
);
|
|
2543
2546
|
function getSelectableProviderTypes() {
|
|
2544
2547
|
return Object.keys(MODEL_PROVIDER_TYPES).filter(
|
|
2545
|
-
(type) =>
|
|
2548
|
+
(type) => {
|
|
2549
|
+
return !HIDDEN_PROVIDER_TYPES.has(type);
|
|
2550
|
+
}
|
|
2546
2551
|
);
|
|
2547
2552
|
}
|
|
2548
2553
|
var ANTHROPIC_API_BASE = "https://api.anthropic.com";
|
|
@@ -2734,7 +2739,6 @@ var c10 = initContract();
|
|
|
2734
2739
|
var chatThreadListItemSchema = z17.object({
|
|
2735
2740
|
id: z17.string(),
|
|
2736
2741
|
title: z17.string().nullable(),
|
|
2737
|
-
preview: z17.string().nullable(),
|
|
2738
2742
|
agentId: z17.string(),
|
|
2739
2743
|
createdAt: z17.string(),
|
|
2740
2744
|
updatedAt: z17.string()
|
|
@@ -6613,7 +6617,11 @@ function getConnectorDerivedNames(secretName) {
|
|
|
6613
6617
|
continue;
|
|
6614
6618
|
}
|
|
6615
6619
|
const mapping = getConnectorEnvironmentMapping(type);
|
|
6616
|
-
const envVarNames = Object.entries(mapping).filter(([, valueRef]) =>
|
|
6620
|
+
const envVarNames = Object.entries(mapping).filter(([, valueRef]) => {
|
|
6621
|
+
return valueRef === `$secrets.${secretName}`;
|
|
6622
|
+
}).map(([envVar]) => {
|
|
6623
|
+
return envVar;
|
|
6624
|
+
});
|
|
6617
6625
|
if (envVarNames.length > 0) {
|
|
6618
6626
|
return { connectorLabel: config.label, envVarNames };
|
|
6619
6627
|
}
|
|
@@ -6630,7 +6638,9 @@ function hasRequiredScopes(connectorType, storedScopes) {
|
|
|
6630
6638
|
if (oauthConfig.scopes.length === 0) return true;
|
|
6631
6639
|
if (!storedScopes) return false;
|
|
6632
6640
|
const storedSet = new Set(storedScopes);
|
|
6633
|
-
return oauthConfig.scopes.every((s) =>
|
|
6641
|
+
return oauthConfig.scopes.every((s) => {
|
|
6642
|
+
return storedSet.has(s);
|
|
6643
|
+
});
|
|
6634
6644
|
}
|
|
6635
6645
|
function getScopeDiff(connectorType, storedScopes) {
|
|
6636
6646
|
const oauthConfig = getConnectorOAuthConfig(connectorType);
|
|
@@ -6639,8 +6649,12 @@ function getScopeDiff(connectorType, storedScopes) {
|
|
|
6639
6649
|
const storedSet = new Set(stored);
|
|
6640
6650
|
const currentSet = new Set(currentScopes);
|
|
6641
6651
|
return {
|
|
6642
|
-
addedScopes: currentScopes.filter((s) =>
|
|
6643
|
-
|
|
6652
|
+
addedScopes: currentScopes.filter((s) => {
|
|
6653
|
+
return !storedSet.has(s);
|
|
6654
|
+
}),
|
|
6655
|
+
removedScopes: stored.filter((s) => {
|
|
6656
|
+
return !currentSet.has(s);
|
|
6657
|
+
}),
|
|
6644
6658
|
currentScopes,
|
|
6645
6659
|
storedScopes: stored
|
|
6646
6660
|
};
|
|
@@ -16390,10 +16404,9 @@ function expandPlaceholders(firewall, connectorType) {
|
|
|
16390
16404
|
return { ...firewall, placeholders: expanded };
|
|
16391
16405
|
}
|
|
16392
16406
|
var EXPANDED_CONNECTOR_FIREWALLS = Object.fromEntries(
|
|
16393
|
-
Object.entries(CONNECTOR_FIREWALLS).map(([type, firewall]) =>
|
|
16394
|
-
type,
|
|
16395
|
-
|
|
16396
|
-
])
|
|
16407
|
+
Object.entries(CONNECTOR_FIREWALLS).map(([type, firewall]) => {
|
|
16408
|
+
return [type, expandPlaceholders(firewall, type)];
|
|
16409
|
+
})
|
|
16397
16410
|
);
|
|
16398
16411
|
function isFirewallConnectorType(type) {
|
|
16399
16412
|
return type in CONNECTOR_FIREWALLS;
|
|
@@ -16473,7 +16486,9 @@ var updateUserPreferencesRequestSchema = z22.object({
|
|
|
16473
16486
|
pinnedAgentIds: z22.array(z22.string()).optional(),
|
|
16474
16487
|
sendMode: sendModeSchema.optional()
|
|
16475
16488
|
}).refine(
|
|
16476
|
-
(data) =>
|
|
16489
|
+
(data) => {
|
|
16490
|
+
return data.timezone !== void 0 || data.pinnedAgentIds !== void 0 || data.sendMode !== void 0;
|
|
16491
|
+
},
|
|
16477
16492
|
{
|
|
16478
16493
|
message: "At least one preference must be provided"
|
|
16479
16494
|
}
|
|
@@ -17655,7 +17670,9 @@ var zeroDeployScheduleRequestSchema = z32.object({
|
|
|
17655
17670
|
data.cronExpression,
|
|
17656
17671
|
data.atTime,
|
|
17657
17672
|
data.intervalSeconds
|
|
17658
|
-
].filter((v) =>
|
|
17673
|
+
].filter((v) => {
|
|
17674
|
+
return v !== void 0;
|
|
17675
|
+
});
|
|
17659
17676
|
return triggers.length === 1;
|
|
17660
17677
|
},
|
|
17661
17678
|
{
|
|
@@ -18532,7 +18549,9 @@ async function sha1(input) {
|
|
|
18532
18549
|
const data = new TextEncoder().encode(input);
|
|
18533
18550
|
const hashBuffer = await crypto.subtle.digest("SHA-1", data);
|
|
18534
18551
|
const hashArray = Array.from(new Uint8Array(hashBuffer));
|
|
18535
|
-
const hex = hashArray.map((b) =>
|
|
18552
|
+
const hex = hashArray.map((b) => {
|
|
18553
|
+
return b.toString(16).padStart(2, "0");
|
|
18554
|
+
}).join("");
|
|
18536
18555
|
sha1Cache.set(input, hex);
|
|
18537
18556
|
return hex;
|
|
18538
18557
|
}
|
|
@@ -18753,6 +18772,11 @@ var FEATURE_SWITCHES = {
|
|
|
18753
18772
|
enabled: false,
|
|
18754
18773
|
enabledUserHashes: STAFF_USER_HASHES,
|
|
18755
18774
|
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
18775
|
+
},
|
|
18776
|
+
["activityLogList" /* ActivityLogList */]: {
|
|
18777
|
+
maintainer: "ethan@vm0.ai",
|
|
18778
|
+
enabled: false,
|
|
18779
|
+
enabledOrgIdHashes: STAFF_ORG_ID_HASHES
|
|
18756
18780
|
}
|
|
18757
18781
|
};
|
|
18758
18782
|
async function isFeatureEnabled(key, ctx) {
|
|
@@ -19773,14 +19797,20 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
|
|
|
19773
19797
|
throw new Error(`Agent not found: ${agentIdentifier}`);
|
|
19774
19798
|
}
|
|
19775
19799
|
const { schedules } = await listZeroSchedules();
|
|
19776
|
-
const agentSchedules = schedules.filter((s) =>
|
|
19800
|
+
const agentSchedules = schedules.filter((s) => {
|
|
19801
|
+
return s.agentId === compose.id;
|
|
19802
|
+
});
|
|
19777
19803
|
if (agentSchedules.length === 0) {
|
|
19778
19804
|
throw new Error(`No schedule found for agent "${agentIdentifier}"`);
|
|
19779
19805
|
}
|
|
19780
19806
|
if (scheduleName) {
|
|
19781
|
-
const match = agentSchedules.find((s) =>
|
|
19807
|
+
const match = agentSchedules.find((s) => {
|
|
19808
|
+
return s.name === scheduleName;
|
|
19809
|
+
});
|
|
19782
19810
|
if (!match) {
|
|
19783
|
-
const available2 = agentSchedules.map((s) =>
|
|
19811
|
+
const available2 = agentSchedules.map((s) => {
|
|
19812
|
+
return s.name;
|
|
19813
|
+
}).join(", ");
|
|
19784
19814
|
throw new Error(
|
|
19785
19815
|
`Schedule "${scheduleName}" not found for agent "${agentIdentifier}". Available schedules: ${available2}`
|
|
19786
19816
|
);
|
|
@@ -19790,7 +19820,9 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
|
|
|
19790
19820
|
if (agentSchedules.length === 1) {
|
|
19791
19821
|
return agentSchedules[0];
|
|
19792
19822
|
}
|
|
19793
|
-
const available = agentSchedules.map((s) =>
|
|
19823
|
+
const available = agentSchedules.map((s) => {
|
|
19824
|
+
return s.name;
|
|
19825
|
+
}).join(", ");
|
|
19794
19826
|
throw new Error(
|
|
19795
19827
|
`Agent "${agentIdentifier}" has multiple schedules. Use --name to specify which one: ${available}`
|
|
19796
19828
|
);
|
|
@@ -20052,16 +20084,36 @@ function formatToolHeader(data) {
|
|
|
20052
20084
|
return [headline];
|
|
20053
20085
|
}
|
|
20054
20086
|
var toolHeadlineFormatters = {
|
|
20055
|
-
Read: (input) =>
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20087
|
+
Read: (input) => {
|
|
20088
|
+
return `Read${chalk3.dim(`(${String(input.file_path || "")})`)}`;
|
|
20089
|
+
},
|
|
20090
|
+
Edit: (input) => {
|
|
20091
|
+
return `Edit${chalk3.dim(`(${String(input.file_path || "")})`)}`;
|
|
20092
|
+
},
|
|
20093
|
+
Write: (input) => {
|
|
20094
|
+
return `Write${chalk3.dim(`(${String(input.file_path || "")})`)}`;
|
|
20095
|
+
},
|
|
20096
|
+
Bash: (input) => {
|
|
20097
|
+
return `Bash${chalk3.dim(`(${truncate(String(input.command || ""), 60)})`)}`;
|
|
20098
|
+
},
|
|
20099
|
+
Glob: (input) => {
|
|
20100
|
+
return `Glob${chalk3.dim(`(${String(input.pattern || "")})`)}`;
|
|
20101
|
+
},
|
|
20102
|
+
Grep: (input) => {
|
|
20103
|
+
return `Grep${chalk3.dim(`(${String(input.pattern || "")})`)}`;
|
|
20104
|
+
},
|
|
20105
|
+
Task: (input) => {
|
|
20106
|
+
return `Task${chalk3.dim(`(${truncate(String(input.description || ""), 60)})`)}`;
|
|
20107
|
+
},
|
|
20108
|
+
WebFetch: (input) => {
|
|
20109
|
+
return `WebFetch${chalk3.dim(`(${truncate(String(input.url || ""), 60)})`)}`;
|
|
20110
|
+
},
|
|
20111
|
+
WebSearch: (input) => {
|
|
20112
|
+
return `WebSearch${chalk3.dim(`(${truncate(String(input.query || ""), 60)})`)}`;
|
|
20113
|
+
},
|
|
20114
|
+
TodoWrite: () => {
|
|
20115
|
+
return "TodoWrite";
|
|
20116
|
+
}
|
|
20065
20117
|
};
|
|
20066
20118
|
function getToolHeadline(tool, input) {
|
|
20067
20119
|
const formatter = toolHeadlineFormatters[tool];
|
|
@@ -20132,7 +20184,9 @@ function formatReadContent(resultText, verbose) {
|
|
|
20132
20184
|
contentLines.push(match[1] ?? "");
|
|
20133
20185
|
}
|
|
20134
20186
|
}
|
|
20135
|
-
const displayLines = contentLines.length > 0 ? contentLines : rawLines.filter((line) =>
|
|
20187
|
+
const displayLines = contentLines.length > 0 ? contentLines : rawLines.filter((line) => {
|
|
20188
|
+
return line.trim().length > 0;
|
|
20189
|
+
});
|
|
20136
20190
|
const totalLines = displayLines.length;
|
|
20137
20191
|
if (totalLines === 0) {
|
|
20138
20192
|
lines.push(`\u2514 \u2713 ${chalk3.dim("(empty)")}`);
|
|
@@ -20544,7 +20598,9 @@ Expected format: '{"ref": {"permission": "allow|deny|ask"}}'`
|
|
|
20544
20598
|
const result = firewallPoliciesSchema.safeParse(parsed);
|
|
20545
20599
|
if (!result.success) {
|
|
20546
20600
|
throw new Error(
|
|
20547
|
-
`Invalid --firewall-policies: ${result.error.issues.map((i) =>
|
|
20601
|
+
`Invalid --firewall-policies: ${result.error.issues.map((i) => {
|
|
20602
|
+
return i.message;
|
|
20603
|
+
}).join(", ")}`
|
|
20548
20604
|
);
|
|
20549
20605
|
}
|
|
20550
20606
|
return result.data;
|
|
@@ -20554,15 +20610,21 @@ function isUUID(str) {
|
|
|
20554
20610
|
}
|
|
20555
20611
|
function extractVarNames(composeContent) {
|
|
20556
20612
|
const grouped = extractAndGroupVariables(composeContent);
|
|
20557
|
-
return grouped.vars.map((r) =>
|
|
20613
|
+
return grouped.vars.map((r) => {
|
|
20614
|
+
return r.name;
|
|
20615
|
+
});
|
|
20558
20616
|
}
|
|
20559
20617
|
function extractSecretNames(composeContent) {
|
|
20560
20618
|
const grouped = extractAndGroupVariables(composeContent);
|
|
20561
|
-
return grouped.secrets.map((r) =>
|
|
20619
|
+
return grouped.secrets.map((r) => {
|
|
20620
|
+
return r.name;
|
|
20621
|
+
});
|
|
20562
20622
|
}
|
|
20563
20623
|
function loadValues(cliValues, configNames, envFilePath) {
|
|
20564
20624
|
const result = { ...cliValues };
|
|
20565
|
-
const missingNames = configNames.filter((name) =>
|
|
20625
|
+
const missingNames = configNames.filter((name) => {
|
|
20626
|
+
return !(name in result);
|
|
20627
|
+
});
|
|
20566
20628
|
if (missingNames.length > 0) {
|
|
20567
20629
|
const envValues = {};
|
|
20568
20630
|
for (const name of missingNames) {
|
|
@@ -20579,9 +20641,9 @@ function loadValues(cliValues, configNames, envFilePath) {
|
|
|
20579
20641
|
const dotenvResult = dotenvConfig({ path: envFilePath, quiet: true });
|
|
20580
20642
|
if (dotenvResult.parsed) {
|
|
20581
20643
|
fileValues = Object.fromEntries(
|
|
20582
|
-
Object.entries(dotenvResult.parsed).filter(
|
|
20583
|
-
|
|
20584
|
-
)
|
|
20644
|
+
Object.entries(dotenvResult.parsed).filter(([key]) => {
|
|
20645
|
+
return missingNames.includes(key);
|
|
20646
|
+
})
|
|
20585
20647
|
);
|
|
20586
20648
|
}
|
|
20587
20649
|
}
|
|
@@ -20662,7 +20724,9 @@ async function pollEvents(runId, options) {
|
|
|
20662
20724
|
result = { succeeded: false, runId };
|
|
20663
20725
|
}
|
|
20664
20726
|
if (!complete) {
|
|
20665
|
-
await new Promise((resolve) =>
|
|
20727
|
+
await new Promise((resolve) => {
|
|
20728
|
+
return setTimeout(resolve, pollIntervalMs);
|
|
20729
|
+
});
|
|
20666
20730
|
}
|
|
20667
20731
|
}
|
|
20668
20732
|
return result;
|
|
@@ -20834,4 +20898,4 @@ export {
|
|
|
20834
20898
|
pollEvents,
|
|
20835
20899
|
showNextSteps
|
|
20836
20900
|
};
|
|
20837
|
-
//# sourceMappingURL=chunk-
|
|
20901
|
+
//# sourceMappingURL=chunk-4ZDCMT63.js.map
|