@vm0/cli 4.7.0 → 4.8.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/index.js +32 -40
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -501,7 +501,6 @@ var apiClient = new ApiClient();
|
|
|
501
501
|
// src/lib/provider-config.ts
|
|
502
502
|
var PROVIDER_DEFAULTS = {
|
|
503
503
|
"claude-code": {
|
|
504
|
-
image: "vm0-claude-code-dev",
|
|
505
504
|
workingDir: "/home/user/workspace"
|
|
506
505
|
}
|
|
507
506
|
};
|
|
@@ -583,16 +582,10 @@ function validateAgentCompose(config2) {
|
|
|
583
582
|
};
|
|
584
583
|
}
|
|
585
584
|
const providerIsSupported = isProviderSupported(agent.provider);
|
|
586
|
-
if (agent.image
|
|
585
|
+
if (!agent.image || typeof agent.image !== "string") {
|
|
587
586
|
return {
|
|
588
587
|
valid: false,
|
|
589
|
-
error: "agent.image must be a string
|
|
590
|
-
};
|
|
591
|
-
}
|
|
592
|
-
if (!agent.image && !providerIsSupported) {
|
|
593
|
-
return {
|
|
594
|
-
valid: false,
|
|
595
|
-
error: "Missing agent.image (required when provider is not auto-configured)"
|
|
588
|
+
error: "Missing or invalid agent.image (must be a string)"
|
|
596
589
|
};
|
|
597
590
|
}
|
|
598
591
|
if (agent.working_dir !== void 0 && typeof agent.working_dir !== "string") {
|
|
@@ -607,38 +600,38 @@ function validateAgentCompose(config2) {
|
|
|
607
600
|
error: "Missing agent.working_dir (required when provider is not auto-configured)"
|
|
608
601
|
};
|
|
609
602
|
}
|
|
610
|
-
if (agent.
|
|
611
|
-
if (typeof agent.
|
|
603
|
+
if (agent.beta_system_prompt !== void 0) {
|
|
604
|
+
if (typeof agent.beta_system_prompt !== "string") {
|
|
612
605
|
return {
|
|
613
606
|
valid: false,
|
|
614
|
-
error: "agent.
|
|
607
|
+
error: "agent.beta_system_prompt must be a string (path to AGENTS.md file)"
|
|
615
608
|
};
|
|
616
609
|
}
|
|
617
|
-
if (agent.
|
|
610
|
+
if (agent.beta_system_prompt.length === 0) {
|
|
618
611
|
return {
|
|
619
612
|
valid: false,
|
|
620
|
-
error: "agent.
|
|
613
|
+
error: "agent.beta_system_prompt cannot be empty"
|
|
621
614
|
};
|
|
622
615
|
}
|
|
623
616
|
}
|
|
624
|
-
if (agent.
|
|
625
|
-
if (!Array.isArray(agent.
|
|
617
|
+
if (agent.beta_system_skills !== void 0) {
|
|
618
|
+
if (!Array.isArray(agent.beta_system_skills)) {
|
|
626
619
|
return {
|
|
627
620
|
valid: false,
|
|
628
|
-
error: "agent.
|
|
621
|
+
error: "agent.beta_system_skills must be an array of GitHub tree URLs"
|
|
629
622
|
};
|
|
630
623
|
}
|
|
631
|
-
for (const skillUrl of agent.
|
|
624
|
+
for (const skillUrl of agent.beta_system_skills) {
|
|
632
625
|
if (typeof skillUrl !== "string") {
|
|
633
626
|
return {
|
|
634
627
|
valid: false,
|
|
635
|
-
error: "Each
|
|
628
|
+
error: "Each beta_system_skill must be a string URL"
|
|
636
629
|
};
|
|
637
630
|
}
|
|
638
631
|
if (!validateGitHubTreeUrl(skillUrl)) {
|
|
639
632
|
return {
|
|
640
633
|
valid: false,
|
|
641
|
-
error: `Invalid
|
|
634
|
+
error: `Invalid beta_system_skill URL: ${skillUrl}. Expected format: https://github.com/{owner}/{repo}/tree/{branch}/{path}`
|
|
642
635
|
};
|
|
643
636
|
}
|
|
644
637
|
}
|
|
@@ -804,7 +797,7 @@ async function uploadSystemPrompt(agentName, promptFilePath, basePath) {
|
|
|
804
797
|
formData.append("type", "volume");
|
|
805
798
|
formData.append(
|
|
806
799
|
"file",
|
|
807
|
-
new Blob([tarBuffer], { type: "application/gzip" }),
|
|
800
|
+
new Blob([new Uint8Array(tarBuffer)], { type: "application/gzip" }),
|
|
808
801
|
"volume.tar.gz"
|
|
809
802
|
);
|
|
810
803
|
const response = await apiClient.post("/api/storages", {
|
|
@@ -847,7 +840,7 @@ async function uploadSystemSkill(skillUrl) {
|
|
|
847
840
|
formData.append("type", "volume");
|
|
848
841
|
formData.append(
|
|
849
842
|
"file",
|
|
850
|
-
new Blob([tarBuffer], { type: "application/gzip" }),
|
|
843
|
+
new Blob([new Uint8Array(tarBuffer)], { type: "application/gzip" }),
|
|
851
844
|
"volume.tar.gz"
|
|
852
845
|
);
|
|
853
846
|
const response = await apiClient.post("/api/storages", {
|
|
@@ -900,12 +893,6 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
900
893
|
if (agent.provider) {
|
|
901
894
|
const defaults = getProviderDefaults(agent.provider);
|
|
902
895
|
if (defaults) {
|
|
903
|
-
if (!agent.image) {
|
|
904
|
-
agent.image = defaults.image;
|
|
905
|
-
console.log(
|
|
906
|
-
chalk2.gray(` Auto-configured image: ${defaults.image}`)
|
|
907
|
-
);
|
|
908
|
-
}
|
|
909
896
|
if (!agent.working_dir) {
|
|
910
897
|
agent.working_dir = defaults.workingDir;
|
|
911
898
|
console.log(
|
|
@@ -916,8 +903,8 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
916
903
|
}
|
|
917
904
|
}
|
|
918
905
|
}
|
|
919
|
-
if (agent.
|
|
920
|
-
const promptPath = agent.
|
|
906
|
+
if (agent.beta_system_prompt) {
|
|
907
|
+
const promptPath = agent.beta_system_prompt;
|
|
921
908
|
console.log(chalk2.blue(`Uploading system prompt: ${promptPath}`));
|
|
922
909
|
try {
|
|
923
910
|
const result = await uploadSystemPrompt(
|
|
@@ -938,8 +925,8 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
938
925
|
process.exit(1);
|
|
939
926
|
}
|
|
940
927
|
}
|
|
941
|
-
if (agent.
|
|
942
|
-
const skillUrls = agent.
|
|
928
|
+
if (agent.beta_system_skills && Array.isArray(agent.beta_system_skills)) {
|
|
929
|
+
const skillUrls = agent.beta_system_skills;
|
|
943
930
|
console.log(
|
|
944
931
|
chalk2.blue(`Uploading ${skillUrls.length} system skill(s)...`)
|
|
945
932
|
);
|
|
@@ -13457,12 +13444,11 @@ var volumeConfigSchema = external_exports.object({
|
|
|
13457
13444
|
});
|
|
13458
13445
|
var agentDefinitionSchema = external_exports.object({
|
|
13459
13446
|
description: external_exports.string().optional(),
|
|
13460
|
-
image: external_exports.string().
|
|
13461
|
-
// Optional when provider is specified (auto-resolved)
|
|
13447
|
+
image: external_exports.string().min(1, "Image is required"),
|
|
13462
13448
|
provider: external_exports.string().min(1, "Provider is required"),
|
|
13463
13449
|
volumes: external_exports.array(external_exports.string()).optional(),
|
|
13464
13450
|
working_dir: external_exports.string().optional(),
|
|
13465
|
-
// Optional when provider
|
|
13451
|
+
// Optional when provider supports auto-config
|
|
13466
13452
|
environment: external_exports.record(external_exports.string(), external_exports.string()).optional(),
|
|
13467
13453
|
/**
|
|
13468
13454
|
* Enable network security mode for secrets.
|
|
@@ -13471,10 +13457,16 @@ var agentDefinitionSchema = external_exports.object({
|
|
|
13471
13457
|
* Default: false (plaintext secrets in env vars)
|
|
13472
13458
|
*/
|
|
13473
13459
|
beta_network_security: external_exports.boolean().optional().default(false),
|
|
13474
|
-
|
|
13475
|
-
|
|
13476
|
-
|
|
13477
|
-
|
|
13460
|
+
/**
|
|
13461
|
+
* Path to system prompt file (e.g., AGENTS.md).
|
|
13462
|
+
* Auto-uploaded as volume and mounted at /home/user/.config/claude/CLAUDE.md
|
|
13463
|
+
*/
|
|
13464
|
+
beta_system_prompt: external_exports.string().optional(),
|
|
13465
|
+
/**
|
|
13466
|
+
* Array of GitHub tree URLs for system skills.
|
|
13467
|
+
* Each skill is auto-downloaded and mounted at /home/user/.config/claude/skills/{skillName}/
|
|
13468
|
+
*/
|
|
13469
|
+
beta_system_skills: external_exports.array(external_exports.string()).optional()
|
|
13478
13470
|
});
|
|
13479
13471
|
var agentComposeContentSchema = external_exports.object({
|
|
13480
13472
|
version: external_exports.string().min(1, "Version is required"),
|
|
@@ -16404,7 +16396,7 @@ function handleError(error43, runId) {
|
|
|
16404
16396
|
|
|
16405
16397
|
// src/index.ts
|
|
16406
16398
|
var program = new Command17();
|
|
16407
|
-
program.name("vm0").description("VM0 CLI - A modern build tool").version("4.
|
|
16399
|
+
program.name("vm0").description("VM0 CLI - A modern build tool").version("4.8.0");
|
|
16408
16400
|
program.command("info").description("Display environment information").action(async () => {
|
|
16409
16401
|
console.log(chalk16.cyan("System Information:"));
|
|
16410
16402
|
console.log(`Node Version: ${process.version}`);
|