@vm0/cli 9.90.3 → 9.90.4
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-XQKSWAGW.js} +104 -45
- package/chunk-XQKSWAGW.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.4",
|
|
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.4",
|
|
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
|
}
|
|
@@ -19773,14 +19792,20 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
|
|
|
19773
19792
|
throw new Error(`Agent not found: ${agentIdentifier}`);
|
|
19774
19793
|
}
|
|
19775
19794
|
const { schedules } = await listZeroSchedules();
|
|
19776
|
-
const agentSchedules = schedules.filter((s) =>
|
|
19795
|
+
const agentSchedules = schedules.filter((s) => {
|
|
19796
|
+
return s.agentId === compose.id;
|
|
19797
|
+
});
|
|
19777
19798
|
if (agentSchedules.length === 0) {
|
|
19778
19799
|
throw new Error(`No schedule found for agent "${agentIdentifier}"`);
|
|
19779
19800
|
}
|
|
19780
19801
|
if (scheduleName) {
|
|
19781
|
-
const match = agentSchedules.find((s) =>
|
|
19802
|
+
const match = agentSchedules.find((s) => {
|
|
19803
|
+
return s.name === scheduleName;
|
|
19804
|
+
});
|
|
19782
19805
|
if (!match) {
|
|
19783
|
-
const available2 = agentSchedules.map((s) =>
|
|
19806
|
+
const available2 = agentSchedules.map((s) => {
|
|
19807
|
+
return s.name;
|
|
19808
|
+
}).join(", ");
|
|
19784
19809
|
throw new Error(
|
|
19785
19810
|
`Schedule "${scheduleName}" not found for agent "${agentIdentifier}". Available schedules: ${available2}`
|
|
19786
19811
|
);
|
|
@@ -19790,7 +19815,9 @@ async function resolveZeroScheduleByAgent(agentIdentifier, scheduleName) {
|
|
|
19790
19815
|
if (agentSchedules.length === 1) {
|
|
19791
19816
|
return agentSchedules[0];
|
|
19792
19817
|
}
|
|
19793
|
-
const available = agentSchedules.map((s) =>
|
|
19818
|
+
const available = agentSchedules.map((s) => {
|
|
19819
|
+
return s.name;
|
|
19820
|
+
}).join(", ");
|
|
19794
19821
|
throw new Error(
|
|
19795
19822
|
`Agent "${agentIdentifier}" has multiple schedules. Use --name to specify which one: ${available}`
|
|
19796
19823
|
);
|
|
@@ -20052,16 +20079,36 @@ function formatToolHeader(data) {
|
|
|
20052
20079
|
return [headline];
|
|
20053
20080
|
}
|
|
20054
20081
|
var toolHeadlineFormatters = {
|
|
20055
|
-
Read: (input) =>
|
|
20056
|
-
|
|
20057
|
-
|
|
20058
|
-
|
|
20059
|
-
|
|
20060
|
-
|
|
20061
|
-
|
|
20062
|
-
|
|
20063
|
-
|
|
20064
|
-
|
|
20082
|
+
Read: (input) => {
|
|
20083
|
+
return `Read${chalk3.dim(`(${String(input.file_path || "")})`)}`;
|
|
20084
|
+
},
|
|
20085
|
+
Edit: (input) => {
|
|
20086
|
+
return `Edit${chalk3.dim(`(${String(input.file_path || "")})`)}`;
|
|
20087
|
+
},
|
|
20088
|
+
Write: (input) => {
|
|
20089
|
+
return `Write${chalk3.dim(`(${String(input.file_path || "")})`)}`;
|
|
20090
|
+
},
|
|
20091
|
+
Bash: (input) => {
|
|
20092
|
+
return `Bash${chalk3.dim(`(${truncate(String(input.command || ""), 60)})`)}`;
|
|
20093
|
+
},
|
|
20094
|
+
Glob: (input) => {
|
|
20095
|
+
return `Glob${chalk3.dim(`(${String(input.pattern || "")})`)}`;
|
|
20096
|
+
},
|
|
20097
|
+
Grep: (input) => {
|
|
20098
|
+
return `Grep${chalk3.dim(`(${String(input.pattern || "")})`)}`;
|
|
20099
|
+
},
|
|
20100
|
+
Task: (input) => {
|
|
20101
|
+
return `Task${chalk3.dim(`(${truncate(String(input.description || ""), 60)})`)}`;
|
|
20102
|
+
},
|
|
20103
|
+
WebFetch: (input) => {
|
|
20104
|
+
return `WebFetch${chalk3.dim(`(${truncate(String(input.url || ""), 60)})`)}`;
|
|
20105
|
+
},
|
|
20106
|
+
WebSearch: (input) => {
|
|
20107
|
+
return `WebSearch${chalk3.dim(`(${truncate(String(input.query || ""), 60)})`)}`;
|
|
20108
|
+
},
|
|
20109
|
+
TodoWrite: () => {
|
|
20110
|
+
return "TodoWrite";
|
|
20111
|
+
}
|
|
20065
20112
|
};
|
|
20066
20113
|
function getToolHeadline(tool, input) {
|
|
20067
20114
|
const formatter = toolHeadlineFormatters[tool];
|
|
@@ -20132,7 +20179,9 @@ function formatReadContent(resultText, verbose) {
|
|
|
20132
20179
|
contentLines.push(match[1] ?? "");
|
|
20133
20180
|
}
|
|
20134
20181
|
}
|
|
20135
|
-
const displayLines = contentLines.length > 0 ? contentLines : rawLines.filter((line) =>
|
|
20182
|
+
const displayLines = contentLines.length > 0 ? contentLines : rawLines.filter((line) => {
|
|
20183
|
+
return line.trim().length > 0;
|
|
20184
|
+
});
|
|
20136
20185
|
const totalLines = displayLines.length;
|
|
20137
20186
|
if (totalLines === 0) {
|
|
20138
20187
|
lines.push(`\u2514 \u2713 ${chalk3.dim("(empty)")}`);
|
|
@@ -20544,7 +20593,9 @@ Expected format: '{"ref": {"permission": "allow|deny|ask"}}'`
|
|
|
20544
20593
|
const result = firewallPoliciesSchema.safeParse(parsed);
|
|
20545
20594
|
if (!result.success) {
|
|
20546
20595
|
throw new Error(
|
|
20547
|
-
`Invalid --firewall-policies: ${result.error.issues.map((i) =>
|
|
20596
|
+
`Invalid --firewall-policies: ${result.error.issues.map((i) => {
|
|
20597
|
+
return i.message;
|
|
20598
|
+
}).join(", ")}`
|
|
20548
20599
|
);
|
|
20549
20600
|
}
|
|
20550
20601
|
return result.data;
|
|
@@ -20554,15 +20605,21 @@ function isUUID(str) {
|
|
|
20554
20605
|
}
|
|
20555
20606
|
function extractVarNames(composeContent) {
|
|
20556
20607
|
const grouped = extractAndGroupVariables(composeContent);
|
|
20557
|
-
return grouped.vars.map((r) =>
|
|
20608
|
+
return grouped.vars.map((r) => {
|
|
20609
|
+
return r.name;
|
|
20610
|
+
});
|
|
20558
20611
|
}
|
|
20559
20612
|
function extractSecretNames(composeContent) {
|
|
20560
20613
|
const grouped = extractAndGroupVariables(composeContent);
|
|
20561
|
-
return grouped.secrets.map((r) =>
|
|
20614
|
+
return grouped.secrets.map((r) => {
|
|
20615
|
+
return r.name;
|
|
20616
|
+
});
|
|
20562
20617
|
}
|
|
20563
20618
|
function loadValues(cliValues, configNames, envFilePath) {
|
|
20564
20619
|
const result = { ...cliValues };
|
|
20565
|
-
const missingNames = configNames.filter((name) =>
|
|
20620
|
+
const missingNames = configNames.filter((name) => {
|
|
20621
|
+
return !(name in result);
|
|
20622
|
+
});
|
|
20566
20623
|
if (missingNames.length > 0) {
|
|
20567
20624
|
const envValues = {};
|
|
20568
20625
|
for (const name of missingNames) {
|
|
@@ -20579,9 +20636,9 @@ function loadValues(cliValues, configNames, envFilePath) {
|
|
|
20579
20636
|
const dotenvResult = dotenvConfig({ path: envFilePath, quiet: true });
|
|
20580
20637
|
if (dotenvResult.parsed) {
|
|
20581
20638
|
fileValues = Object.fromEntries(
|
|
20582
|
-
Object.entries(dotenvResult.parsed).filter(
|
|
20583
|
-
|
|
20584
|
-
)
|
|
20639
|
+
Object.entries(dotenvResult.parsed).filter(([key]) => {
|
|
20640
|
+
return missingNames.includes(key);
|
|
20641
|
+
})
|
|
20585
20642
|
);
|
|
20586
20643
|
}
|
|
20587
20644
|
}
|
|
@@ -20662,7 +20719,9 @@ async function pollEvents(runId, options) {
|
|
|
20662
20719
|
result = { succeeded: false, runId };
|
|
20663
20720
|
}
|
|
20664
20721
|
if (!complete) {
|
|
20665
|
-
await new Promise((resolve) =>
|
|
20722
|
+
await new Promise((resolve) => {
|
|
20723
|
+
return setTimeout(resolve, pollIntervalMs);
|
|
20724
|
+
});
|
|
20666
20725
|
}
|
|
20667
20726
|
}
|
|
20668
20727
|
return result;
|
|
@@ -20834,4 +20893,4 @@ export {
|
|
|
20834
20893
|
pollEvents,
|
|
20835
20894
|
showNextSteps
|
|
20836
20895
|
};
|
|
20837
|
-
//# sourceMappingURL=chunk-
|
|
20896
|
+
//# sourceMappingURL=chunk-XQKSWAGW.js.map
|