@vm0/cli 4.35.0 → 4.35.2
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/index.js +175 -88
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2760,7 +2760,7 @@ var $ZodBase64 = /* @__PURE__ */ $constructor("$ZodBase64", (inst, def) => {
|
|
|
2760
2760
|
function isValidBase64URL(data) {
|
|
2761
2761
|
if (!base64url.test(data))
|
|
2762
2762
|
return false;
|
|
2763
|
-
const base643 = data.replace(/[-_]/g, (
|
|
2763
|
+
const base643 = data.replace(/[-_]/g, (c12) => c12 === "-" ? "+" : "/");
|
|
2764
2764
|
const padded = base643.padEnd(Math.ceil(base643.length / 4) * 4, "=");
|
|
2765
2765
|
return isValidBase64(padded);
|
|
2766
2766
|
}
|
|
@@ -11672,9 +11672,9 @@ var ZodDate = /* @__PURE__ */ $constructor("ZodDate", (inst, def) => {
|
|
|
11672
11672
|
ZodType.init(inst, def);
|
|
11673
11673
|
inst.min = (value, params) => inst.check(_gte(value, params));
|
|
11674
11674
|
inst.max = (value, params) => inst.check(_lte(value, params));
|
|
11675
|
-
const
|
|
11676
|
-
inst.minDate =
|
|
11677
|
-
inst.maxDate =
|
|
11675
|
+
const c12 = inst._zod.bag;
|
|
11676
|
+
inst.minDate = c12.minimum ? new Date(c12.minimum) : null;
|
|
11677
|
+
inst.maxDate = c12.maximum ? new Date(c12.maximum) : null;
|
|
11678
11678
|
});
|
|
11679
11679
|
function date3(params) {
|
|
11680
11680
|
return _date(ZodDate, params);
|
|
@@ -12302,7 +12302,17 @@ var agentDefinitionSchema = external_exports.object({
|
|
|
12302
12302
|
* Array of GitHub tree URLs for agent skills.
|
|
12303
12303
|
* Each skill is auto-downloaded and mounted at /home/user/.claude/skills/{skillName}/
|
|
12304
12304
|
*/
|
|
12305
|
-
skills: external_exports.array(external_exports.string()).optional()
|
|
12305
|
+
skills: external_exports.array(external_exports.string()).optional(),
|
|
12306
|
+
/**
|
|
12307
|
+
* Route this agent to a self-hosted runner instead of E2B.
|
|
12308
|
+
* When specified, runs will be queued for the specified runner group.
|
|
12309
|
+
*/
|
|
12310
|
+
experimental_runner: external_exports.object({
|
|
12311
|
+
group: external_exports.string().regex(
|
|
12312
|
+
/^[a-z0-9-]+\/[a-z0-9-]+$/,
|
|
12313
|
+
"Runner group must be in scope/name format (e.g., acme/production)"
|
|
12314
|
+
)
|
|
12315
|
+
}).optional()
|
|
12306
12316
|
});
|
|
12307
12317
|
var agentComposeContentSchema = external_exports.object({
|
|
12308
12318
|
version: external_exports.string().min(1, "Version is required"),
|
|
@@ -13602,6 +13612,105 @@ var checkpointsByIdContract = c10.router({
|
|
|
13602
13612
|
}
|
|
13603
13613
|
});
|
|
13604
13614
|
|
|
13615
|
+
// ../../packages/core/src/contracts/runners.ts
|
|
13616
|
+
var c11 = initContract();
|
|
13617
|
+
var runnerGroupSchema = external_exports.string().regex(
|
|
13618
|
+
/^[a-z0-9-]+\/[a-z0-9-]+$/,
|
|
13619
|
+
"Runner group must be in scope/name format (e.g., acme/production)"
|
|
13620
|
+
);
|
|
13621
|
+
var jobSchema = external_exports.object({
|
|
13622
|
+
runId: external_exports.string().uuid(),
|
|
13623
|
+
prompt: external_exports.string(),
|
|
13624
|
+
agentComposeVersionId: external_exports.string(),
|
|
13625
|
+
vars: external_exports.record(external_exports.string(), external_exports.string()).nullable(),
|
|
13626
|
+
secretNames: external_exports.array(external_exports.string()).nullable(),
|
|
13627
|
+
checkpointId: external_exports.string().uuid().nullable()
|
|
13628
|
+
});
|
|
13629
|
+
var runnersPollContract = c11.router({
|
|
13630
|
+
poll: {
|
|
13631
|
+
method: "POST",
|
|
13632
|
+
path: "/api/runners/poll",
|
|
13633
|
+
body: external_exports.object({
|
|
13634
|
+
group: runnerGroupSchema
|
|
13635
|
+
}),
|
|
13636
|
+
responses: {
|
|
13637
|
+
200: external_exports.object({
|
|
13638
|
+
job: jobSchema.nullable()
|
|
13639
|
+
}),
|
|
13640
|
+
400: apiErrorSchema,
|
|
13641
|
+
401: apiErrorSchema,
|
|
13642
|
+
500: apiErrorSchema
|
|
13643
|
+
},
|
|
13644
|
+
summary: "Poll for pending jobs (long-polling with 30s timeout)"
|
|
13645
|
+
}
|
|
13646
|
+
});
|
|
13647
|
+
var storageEntrySchema = external_exports.object({
|
|
13648
|
+
mountPath: external_exports.string(),
|
|
13649
|
+
archiveUrl: external_exports.string().nullable()
|
|
13650
|
+
});
|
|
13651
|
+
var artifactEntrySchema = external_exports.object({
|
|
13652
|
+
mountPath: external_exports.string(),
|
|
13653
|
+
archiveUrl: external_exports.string().nullable(),
|
|
13654
|
+
vasStorageName: external_exports.string(),
|
|
13655
|
+
vasVersionId: external_exports.string()
|
|
13656
|
+
});
|
|
13657
|
+
var storageManifestSchema = external_exports.object({
|
|
13658
|
+
storages: external_exports.array(storageEntrySchema),
|
|
13659
|
+
artifact: artifactEntrySchema.nullable()
|
|
13660
|
+
});
|
|
13661
|
+
var resumeSessionSchema = external_exports.object({
|
|
13662
|
+
sessionId: external_exports.string(),
|
|
13663
|
+
sessionHistory: external_exports.string()
|
|
13664
|
+
});
|
|
13665
|
+
var storedExecutionContextSchema = external_exports.object({
|
|
13666
|
+
workingDir: external_exports.string(),
|
|
13667
|
+
storageManifest: storageManifestSchema.nullable(),
|
|
13668
|
+
environment: external_exports.record(external_exports.string(), external_exports.string()).nullable(),
|
|
13669
|
+
resumeSession: resumeSessionSchema.nullable(),
|
|
13670
|
+
encryptedSecrets: external_exports.string().nullable(),
|
|
13671
|
+
// AES-256-GCM encrypted secrets
|
|
13672
|
+
cliAgentType: external_exports.string(),
|
|
13673
|
+
experimentalNetworkSecurity: external_exports.boolean().optional()
|
|
13674
|
+
});
|
|
13675
|
+
var executionContextSchema = external_exports.object({
|
|
13676
|
+
runId: external_exports.string().uuid(),
|
|
13677
|
+
prompt: external_exports.string(),
|
|
13678
|
+
agentComposeVersionId: external_exports.string(),
|
|
13679
|
+
vars: external_exports.record(external_exports.string(), external_exports.string()).nullable(),
|
|
13680
|
+
secretNames: external_exports.array(external_exports.string()).nullable(),
|
|
13681
|
+
checkpointId: external_exports.string().uuid().nullable(),
|
|
13682
|
+
sandboxToken: external_exports.string(),
|
|
13683
|
+
// New fields for E2B parity:
|
|
13684
|
+
workingDir: external_exports.string(),
|
|
13685
|
+
storageManifest: storageManifestSchema.nullable(),
|
|
13686
|
+
environment: external_exports.record(external_exports.string(), external_exports.string()).nullable(),
|
|
13687
|
+
resumeSession: resumeSessionSchema.nullable(),
|
|
13688
|
+
secretValues: external_exports.array(external_exports.string()).nullable(),
|
|
13689
|
+
cliAgentType: external_exports.string()
|
|
13690
|
+
});
|
|
13691
|
+
var runnersJobClaimContract = c11.router({
|
|
13692
|
+
claim: {
|
|
13693
|
+
method: "POST",
|
|
13694
|
+
path: "/api/runners/jobs/:id/claim",
|
|
13695
|
+
pathParams: external_exports.object({
|
|
13696
|
+
id: external_exports.string().uuid()
|
|
13697
|
+
}),
|
|
13698
|
+
body: external_exports.object({}),
|
|
13699
|
+
responses: {
|
|
13700
|
+
200: executionContextSchema,
|
|
13701
|
+
400: apiErrorSchema,
|
|
13702
|
+
401: apiErrorSchema,
|
|
13703
|
+
403: apiErrorSchema,
|
|
13704
|
+
// Job does not belong to user
|
|
13705
|
+
404: apiErrorSchema,
|
|
13706
|
+
409: apiErrorSchema,
|
|
13707
|
+
// Already claimed
|
|
13708
|
+
500: apiErrorSchema
|
|
13709
|
+
},
|
|
13710
|
+
summary: "Claim a pending job for execution"
|
|
13711
|
+
}
|
|
13712
|
+
});
|
|
13713
|
+
|
|
13605
13714
|
// ../../packages/core/src/scope-reference.ts
|
|
13606
13715
|
function getLegacySystemTemplateWarning(legacyFormat) {
|
|
13607
13716
|
if (!isLegacySystemTemplate(legacyFormat)) {
|
|
@@ -14938,47 +15047,31 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
14938
15047
|
const instructionsPath = agent.instructions;
|
|
14939
15048
|
const provider = agent.provider;
|
|
14940
15049
|
console.log(`Uploading instructions: ${instructionsPath}`);
|
|
14941
|
-
|
|
14942
|
-
|
|
14943
|
-
|
|
14944
|
-
|
|
14945
|
-
|
|
14946
|
-
|
|
14947
|
-
|
|
14948
|
-
|
|
14949
|
-
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
);
|
|
14953
|
-
} catch (error43) {
|
|
14954
|
-
console.error(chalk2.red(`\u2717 Failed to upload instructions`));
|
|
14955
|
-
if (error43 instanceof Error) {
|
|
14956
|
-
console.error(chalk2.dim(` ${error43.message}`));
|
|
14957
|
-
}
|
|
14958
|
-
process.exit(1);
|
|
14959
|
-
}
|
|
15050
|
+
const result = await uploadInstructions(
|
|
15051
|
+
agentName,
|
|
15052
|
+
instructionsPath,
|
|
15053
|
+
basePath,
|
|
15054
|
+
provider
|
|
15055
|
+
);
|
|
15056
|
+
console.log(
|
|
15057
|
+
chalk2.green(
|
|
15058
|
+
`\u2713 Instructions ${result.action === "deduplicated" ? "(unchanged)" : "uploaded"}: ${result.versionId.slice(0, 8)}`
|
|
15059
|
+
)
|
|
15060
|
+
);
|
|
14960
15061
|
}
|
|
14961
15062
|
const skillResults = [];
|
|
14962
15063
|
if (agent.skills && Array.isArray(agent.skills)) {
|
|
14963
15064
|
const skillUrls = agent.skills;
|
|
14964
15065
|
console.log(`Uploading ${skillUrls.length} skill(s)...`);
|
|
14965
15066
|
for (const skillUrl of skillUrls) {
|
|
14966
|
-
|
|
14967
|
-
|
|
14968
|
-
|
|
14969
|
-
|
|
14970
|
-
|
|
14971
|
-
|
|
14972
|
-
|
|
14973
|
-
|
|
14974
|
-
);
|
|
14975
|
-
} catch (error43) {
|
|
14976
|
-
console.error(chalk2.red(`\u2717 Failed to upload skill: ${skillUrl}`));
|
|
14977
|
-
if (error43 instanceof Error) {
|
|
14978
|
-
console.error(chalk2.dim(` ${error43.message}`));
|
|
14979
|
-
}
|
|
14980
|
-
process.exit(1);
|
|
14981
|
-
}
|
|
15067
|
+
console.log(chalk2.dim(` Downloading: ${skillUrl}`));
|
|
15068
|
+
const result = await uploadSkill(skillUrl);
|
|
15069
|
+
skillResults.push(result);
|
|
15070
|
+
console.log(
|
|
15071
|
+
chalk2.green(
|
|
15072
|
+
` \u2713 Skill ${result.action === "deduplicated" ? "(unchanged)" : "uploaded"}: ${result.skillName} (${result.versionId.slice(0, 8)})`
|
|
15073
|
+
)
|
|
15074
|
+
);
|
|
14982
15075
|
}
|
|
14983
15076
|
}
|
|
14984
15077
|
const skillSecrets = /* @__PURE__ */ new Map();
|
|
@@ -15381,9 +15474,9 @@ var CodexEventParser = class {
|
|
|
15381
15474
|
}
|
|
15382
15475
|
}
|
|
15383
15476
|
if (itemType === "file_change" && item.changes && item.changes.length > 0) {
|
|
15384
|
-
const changes = item.changes.map((
|
|
15385
|
-
const action =
|
|
15386
|
-
return `${action}: ${
|
|
15477
|
+
const changes = item.changes.map((c12) => {
|
|
15478
|
+
const action = c12.kind === "add" ? "Created" : c12.kind === "modify" ? "Modified" : "Deleted";
|
|
15479
|
+
return `${action}: ${c12.path}`;
|
|
15387
15480
|
}).join("\n");
|
|
15388
15481
|
return {
|
|
15389
15482
|
type: "text",
|
|
@@ -15724,9 +15817,9 @@ var CodexEventRenderer = class {
|
|
|
15724
15817
|
return;
|
|
15725
15818
|
}
|
|
15726
15819
|
if (itemType === "file_change" && item.changes && item.changes.length > 0) {
|
|
15727
|
-
const summary = item.changes.map((
|
|
15728
|
-
const icon =
|
|
15729
|
-
return `${icon}${
|
|
15820
|
+
const summary = item.changes.map((c12) => {
|
|
15821
|
+
const icon = c12.kind === "add" ? "+" : c12.kind === "delete" ? "-" : "~";
|
|
15822
|
+
return `${icon}${c12.path}`;
|
|
15730
15823
|
}).join(", ");
|
|
15731
15824
|
console.log(chalk4.green("[files]") + ` ${summary}`);
|
|
15732
15825
|
return;
|
|
@@ -15955,39 +16048,19 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
|
|
|
15955
16048
|
if (verbose) {
|
|
15956
16049
|
console.log(chalk5.dim(` Using compose ID: ${identifier}`));
|
|
15957
16050
|
}
|
|
15958
|
-
|
|
15959
|
-
|
|
15960
|
-
|
|
15961
|
-
composeContent = compose.content;
|
|
15962
|
-
} catch (error43) {
|
|
15963
|
-
if (error43 instanceof Error) {
|
|
15964
|
-
console.error(chalk5.red(`\u2717 Compose not found: ${name}`));
|
|
15965
|
-
}
|
|
15966
|
-
process.exit(1);
|
|
15967
|
-
}
|
|
16051
|
+
const compose = await apiClient.getComposeById(name);
|
|
16052
|
+
composeId = compose.id;
|
|
16053
|
+
composeContent = compose.content;
|
|
15968
16054
|
} else {
|
|
15969
16055
|
if (verbose) {
|
|
15970
16056
|
const displayRef = scope ? `${scope}/${name}` : name;
|
|
15971
16057
|
console.log(chalk5.dim(` Resolving agent: ${displayRef}`));
|
|
15972
16058
|
}
|
|
15973
|
-
|
|
15974
|
-
|
|
15975
|
-
|
|
15976
|
-
|
|
15977
|
-
|
|
15978
|
-
console.log(chalk5.dim(` Resolved to compose ID: ${composeId}`));
|
|
15979
|
-
}
|
|
15980
|
-
} catch (error43) {
|
|
15981
|
-
if (error43 instanceof Error) {
|
|
15982
|
-
const displayRef = scope ? `${scope}/${name}` : name;
|
|
15983
|
-
console.error(chalk5.red(`\u2717 Agent not found: ${displayRef}`));
|
|
15984
|
-
console.error(
|
|
15985
|
-
chalk5.dim(
|
|
15986
|
-
" Make sure you've composed the agent with: vm0 compose"
|
|
15987
|
-
)
|
|
15988
|
-
);
|
|
15989
|
-
}
|
|
15990
|
-
process.exit(1);
|
|
16059
|
+
const compose = await apiClient.getComposeByName(name, scope);
|
|
16060
|
+
composeId = compose.id;
|
|
16061
|
+
composeContent = compose.content;
|
|
16062
|
+
if (verbose) {
|
|
16063
|
+
console.log(chalk5.dim(` Resolved to compose ID: ${composeId}`));
|
|
15991
16064
|
}
|
|
15992
16065
|
}
|
|
15993
16066
|
let agentComposeVersionId;
|
|
@@ -16008,14 +16081,8 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
|
|
|
16008
16081
|
)
|
|
16009
16082
|
);
|
|
16010
16083
|
}
|
|
16011
|
-
} catch
|
|
16012
|
-
|
|
16013
|
-
console.error(chalk5.red(`\u2717 Version not found: ${version2}`));
|
|
16014
|
-
console.error(
|
|
16015
|
-
chalk5.dim(" Make sure the version hash is correct.")
|
|
16016
|
-
);
|
|
16017
|
-
}
|
|
16018
|
-
process.exit(1);
|
|
16084
|
+
} catch {
|
|
16085
|
+
throw new Error(`Version not found: ${version2}`);
|
|
16019
16086
|
}
|
|
16020
16087
|
}
|
|
16021
16088
|
const varNames = extractVarNames(composeContent);
|
|
@@ -16097,6 +16164,11 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
|
|
|
16097
16164
|
console.error(
|
|
16098
16165
|
chalk5.red("\u2717 Not authenticated. Run: vm0 auth login")
|
|
16099
16166
|
);
|
|
16167
|
+
} else if (error43.message.startsWith("Version not found:")) {
|
|
16168
|
+
console.error(chalk5.red(`\u2717 ${error43.message}`));
|
|
16169
|
+
console.error(
|
|
16170
|
+
chalk5.dim(" Make sure the version hash is correct.")
|
|
16171
|
+
);
|
|
16100
16172
|
} else if (error43.message.includes("not found")) {
|
|
16101
16173
|
console.error(chalk5.red(`\u2717 Agent not found: ${identifier}`));
|
|
16102
16174
|
console.error(
|
|
@@ -16529,7 +16601,11 @@ var pushCommand = new Command4().name("push").description("Push local files to c
|
|
|
16529
16601
|
} catch (error43) {
|
|
16530
16602
|
console.error(chalk7.red("\u2717 Push failed"));
|
|
16531
16603
|
if (error43 instanceof Error) {
|
|
16532
|
-
|
|
16604
|
+
if (error43.message.includes("Not authenticated")) {
|
|
16605
|
+
console.error(chalk7.dim(" Run: vm0 auth login"));
|
|
16606
|
+
} else {
|
|
16607
|
+
console.error(chalk7.dim(` ${error43.message}`));
|
|
16608
|
+
}
|
|
16533
16609
|
}
|
|
16534
16610
|
process.exit(1);
|
|
16535
16611
|
}
|
|
@@ -16642,7 +16718,11 @@ var pullCommand = new Command5().name("pull").description("Pull cloud files to l
|
|
|
16642
16718
|
} catch (error43) {
|
|
16643
16719
|
console.error(chalk9.red("\u2717 Pull failed"));
|
|
16644
16720
|
if (error43 instanceof Error) {
|
|
16645
|
-
|
|
16721
|
+
if (error43.message.includes("Not authenticated")) {
|
|
16722
|
+
console.error(chalk9.dim(" Run: vm0 auth login"));
|
|
16723
|
+
} else {
|
|
16724
|
+
console.error(chalk9.dim(` ${error43.message}`));
|
|
16725
|
+
}
|
|
16646
16726
|
}
|
|
16647
16727
|
process.exit(1);
|
|
16648
16728
|
}
|
|
@@ -16703,7 +16783,11 @@ var statusCommand = new Command6().name("status").description("Show status of cl
|
|
|
16703
16783
|
} catch (error43) {
|
|
16704
16784
|
console.error(chalk10.red("\u2717 Status check failed"));
|
|
16705
16785
|
if (error43 instanceof Error) {
|
|
16706
|
-
|
|
16786
|
+
if (error43.message.includes("Not authenticated")) {
|
|
16787
|
+
console.error(chalk10.dim(" Run: vm0 auth login"));
|
|
16788
|
+
} else {
|
|
16789
|
+
console.error(chalk10.dim(` ${error43.message}`));
|
|
16790
|
+
}
|
|
16707
16791
|
}
|
|
16708
16792
|
process.exit(1);
|
|
16709
16793
|
}
|
|
@@ -17624,7 +17708,7 @@ async function autoPullArtifact(runOutput, artifactDir) {
|
|
|
17624
17708
|
}
|
|
17625
17709
|
var cookCmd = new Command17().name("cook").description("One-click agent preparation and execution from vm0.yaml");
|
|
17626
17710
|
cookCmd.argument("[prompt]", "Prompt for the agent").option("-y, --yes", "Skip confirmation prompts").action(async (prompt, options) => {
|
|
17627
|
-
const shouldExit = await checkAndUpgrade("4.35.
|
|
17711
|
+
const shouldExit = await checkAndUpgrade("4.35.2", prompt);
|
|
17628
17712
|
if (shouldExit) {
|
|
17629
17713
|
process.exit(0);
|
|
17630
17714
|
}
|
|
@@ -18597,7 +18681,10 @@ var setCommand = new Command25().name("set").description("Set your scope slug").
|
|
|
18597
18681
|
let existingScope;
|
|
18598
18682
|
try {
|
|
18599
18683
|
existingScope = await apiClient.getScope();
|
|
18600
|
-
} catch {
|
|
18684
|
+
} catch (error43) {
|
|
18685
|
+
if (!(error43 instanceof Error) || !error43.message.includes("No scope configured")) {
|
|
18686
|
+
throw error43;
|
|
18687
|
+
}
|
|
18601
18688
|
}
|
|
18602
18689
|
let scope;
|
|
18603
18690
|
if (existingScope) {
|
|
@@ -19252,7 +19339,7 @@ var setupGithubCommand = new Command28().name("setup-github").description("Initi
|
|
|
19252
19339
|
|
|
19253
19340
|
// src/index.ts
|
|
19254
19341
|
var program = new Command29();
|
|
19255
|
-
program.name("vm0").description("VM0 CLI - A modern build tool").version("4.35.
|
|
19342
|
+
program.name("vm0").description("VM0 CLI - A modern build tool").version("4.35.2");
|
|
19256
19343
|
program.command("info").description("Display environment information").action(async () => {
|
|
19257
19344
|
console.log(chalk31.bold("System Information:"));
|
|
19258
19345
|
console.log(`Node Version: ${process.version}`);
|