@vm0/cli 9.129.1 → 9.130.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/{chunk-TO65SA2M.js → chunk-V5JAHNBR.js} +109 -24
- package/{chunk-TO65SA2M.js.map → chunk-V5JAHNBR.js.map} +1 -1
- package/index.js +56 -37
- package/index.js.map +1 -1
- package/package.json +1 -1
- package/zero.js +164 -5
- package/zero.js.map +1 -1
package/index.js
CHANGED
|
@@ -11,9 +11,10 @@ import {
|
|
|
11
11
|
agentDefinitionSchema,
|
|
12
12
|
cancelRun,
|
|
13
13
|
clearConfig,
|
|
14
|
+
collectArtifacts,
|
|
14
15
|
collectKeyValue,
|
|
16
|
+
collectMounts,
|
|
15
17
|
collectVolumeVersions,
|
|
16
|
-
collectVolumes,
|
|
17
18
|
commitStorage,
|
|
18
19
|
configureGlobalProxyFromEnv,
|
|
19
20
|
createOrUpdateCompose,
|
|
@@ -48,7 +49,6 @@ import {
|
|
|
48
49
|
loadConfig,
|
|
49
50
|
loadValues,
|
|
50
51
|
paginate,
|
|
51
|
-
parseArtifact,
|
|
52
52
|
parseGitHubUrl,
|
|
53
53
|
parseIdentifier,
|
|
54
54
|
parsePermissionPolicies,
|
|
@@ -65,7 +65,7 @@ import {
|
|
|
65
65
|
source_default,
|
|
66
66
|
volumeConfigSchema,
|
|
67
67
|
withErrorHandler
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-V5JAHNBR.js";
|
|
69
69
|
import {
|
|
70
70
|
__toESM,
|
|
71
71
|
init_esm_shims
|
|
@@ -398,7 +398,7 @@ function getConfigPath() {
|
|
|
398
398
|
return join(homedir(), ".vm0", "config.json");
|
|
399
399
|
}
|
|
400
400
|
var infoCommand = new Command().name("info").description("Display environment and debug information").action(async () => {
|
|
401
|
-
console.log(source_default.bold(`VM0 CLI v${"9.
|
|
401
|
+
console.log(source_default.bold(`VM0 CLI v${"9.130.0"}`));
|
|
402
402
|
console.log();
|
|
403
403
|
const config = await loadConfig();
|
|
404
404
|
const hasEnvToken = !!process.env.VM0_TOKEN;
|
|
@@ -4291,7 +4291,7 @@ var composeCommand = new Command().name("compose").description("Create or update
|
|
|
4291
4291
|
options.autoUpdate = false;
|
|
4292
4292
|
}
|
|
4293
4293
|
if (options.autoUpdate !== false) {
|
|
4294
|
-
await startSilentUpgrade("9.
|
|
4294
|
+
await startSilentUpgrade("9.130.0");
|
|
4295
4295
|
}
|
|
4296
4296
|
try {
|
|
4297
4297
|
let result;
|
|
@@ -4344,8 +4344,10 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4344
4344
|
collectKeyValue,
|
|
4345
4345
|
{}
|
|
4346
4346
|
).option(
|
|
4347
|
-
"--artifact <
|
|
4348
|
-
"
|
|
4347
|
+
"--artifact <artifact>",
|
|
4348
|
+
"Mount an artifact (repeatable, format: name:/path or name:version:/path)",
|
|
4349
|
+
collectArtifacts,
|
|
4350
|
+
[]
|
|
4349
4351
|
).option(
|
|
4350
4352
|
"--volume-version <name=version>",
|
|
4351
4353
|
"Volume version override (repeatable, format: volumeName=version)",
|
|
@@ -4354,7 +4356,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4354
4356
|
).option(
|
|
4355
4357
|
"--volume <volume>",
|
|
4356
4358
|
"Mount a volume (repeatable, format: name:/path or name:version:/path)",
|
|
4357
|
-
|
|
4359
|
+
collectMounts,
|
|
4358
4360
|
[]
|
|
4359
4361
|
).option("--memory <name>", "Memory storage name").option(
|
|
4360
4362
|
"--conversation <id>",
|
|
@@ -4381,7 +4383,7 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4381
4383
|
withErrorHandler(
|
|
4382
4384
|
async (identifier, prompt, options) => {
|
|
4383
4385
|
if (options.autoUpdate !== false) {
|
|
4384
|
-
await startSilentUpgrade("9.
|
|
4386
|
+
await startSilentUpgrade("9.130.0");
|
|
4385
4387
|
}
|
|
4386
4388
|
const { name, version } = parseIdentifier(identifier);
|
|
4387
4389
|
let composeId;
|
|
@@ -4421,17 +4423,16 @@ var mainRunCommand = new Command().name("run").description("Run an agent").argum
|
|
|
4421
4423
|
secretNames,
|
|
4422
4424
|
options.envFile
|
|
4423
4425
|
);
|
|
4424
|
-
const parsedArtifact = parseArtifact(options.artifact);
|
|
4425
4426
|
const volumeVersions = Object.keys(options.volumeVersion).length > 0 ? options.volumeVersion : void 0;
|
|
4426
4427
|
const additionalVolumes = options.volume.length > 0 ? options.volume : void 0;
|
|
4428
|
+
const artifacts = options.artifact.length > 0 ? options.artifact : void 0;
|
|
4427
4429
|
const response = await createRun({
|
|
4428
4430
|
// Use agentComposeVersionId if resolved, otherwise use agentComposeId (resolves to HEAD)
|
|
4429
4431
|
...agentComposeVersionId ? { agentComposeVersionId } : { agentComposeId: composeId },
|
|
4430
4432
|
prompt,
|
|
4431
4433
|
vars,
|
|
4432
4434
|
secrets,
|
|
4433
|
-
|
|
4434
|
-
artifactVersion: parsedArtifact?.artifactVersion,
|
|
4435
|
+
artifacts,
|
|
4435
4436
|
memoryName: options.memory,
|
|
4436
4437
|
volumeVersions,
|
|
4437
4438
|
additionalVolumes,
|
|
@@ -4488,12 +4489,14 @@ var resumeCommand = new Command().name("resume").description("Resume an agent ru
|
|
|
4488
4489
|
collectVolumeVersions,
|
|
4489
4490
|
{}
|
|
4490
4491
|
).option(
|
|
4491
|
-
"--artifact <
|
|
4492
|
-
"
|
|
4492
|
+
"--artifact <artifact>",
|
|
4493
|
+
"Mount an artifact (repeatable, format: name:/path or name:version:/path)",
|
|
4494
|
+
collectArtifacts,
|
|
4495
|
+
[]
|
|
4493
4496
|
).option(
|
|
4494
4497
|
"--volume <volume>",
|
|
4495
4498
|
"Mount a volume (repeatable, format: name:/path or name:version:/path)",
|
|
4496
|
-
|
|
4499
|
+
collectMounts,
|
|
4497
4500
|
[]
|
|
4498
4501
|
).option(
|
|
4499
4502
|
"--append-system-prompt <text>",
|
|
@@ -4525,9 +4528,8 @@ var resumeCommand = new Command().name("resume").description("Resume an agent ru
|
|
|
4525
4528
|
const requiredSecretNames = checkpointInfo.agentComposeSnapshot.secretNames || [];
|
|
4526
4529
|
const envFile = options.envFile || allOpts.envFile;
|
|
4527
4530
|
const loadedSecrets = loadValues(secrets, requiredSecretNames, envFile);
|
|
4528
|
-
const
|
|
4529
|
-
|
|
4530
|
-
);
|
|
4531
|
+
const artifactsInput = options.artifact.length > 0 ? options.artifact : allOpts.artifact;
|
|
4532
|
+
const artifacts = artifactsInput.length > 0 ? artifactsInput : void 0;
|
|
4531
4533
|
const resolvedVars = Object.keys(vars).length > 0 ? vars : void 0;
|
|
4532
4534
|
const volumeVersions = Object.keys(allOpts.volumeVersion).length > 0 ? allOpts.volumeVersion : void 0;
|
|
4533
4535
|
const additionalVolumes = allOpts.volume.length > 0 ? allOpts.volume : void 0;
|
|
@@ -4536,8 +4538,7 @@ var resumeCommand = new Command().name("resume").description("Resume an agent ru
|
|
|
4536
4538
|
prompt,
|
|
4537
4539
|
vars: resolvedVars,
|
|
4538
4540
|
secrets: loadedSecrets,
|
|
4539
|
-
|
|
4540
|
-
artifactVersion: artifactParsed?.artifactVersion,
|
|
4541
|
+
artifacts,
|
|
4541
4542
|
volumeVersions,
|
|
4542
4543
|
additionalVolumes,
|
|
4543
4544
|
appendSystemPrompt: options.appendSystemPrompt || allOpts.appendSystemPrompt,
|
|
@@ -4584,12 +4585,14 @@ var continueCommand = new Command().name("continue").description(
|
|
|
4584
4585
|
collectKeyValue,
|
|
4585
4586
|
{}
|
|
4586
4587
|
).option(
|
|
4587
|
-
"--artifact <
|
|
4588
|
-
"
|
|
4588
|
+
"--artifact <artifact>",
|
|
4589
|
+
"Mount an artifact (repeatable, format: name:/path or name:version:/path)",
|
|
4590
|
+
collectArtifacts,
|
|
4591
|
+
[]
|
|
4589
4592
|
).option(
|
|
4590
4593
|
"--volume <volume>",
|
|
4591
4594
|
"Mount a volume (repeatable, format: name:/path or name:version:/path)",
|
|
4592
|
-
|
|
4595
|
+
collectMounts,
|
|
4593
4596
|
[]
|
|
4594
4597
|
).option(
|
|
4595
4598
|
"--append-system-prompt <text>",
|
|
@@ -4622,16 +4625,14 @@ var continueCommand = new Command().name("continue").description(
|
|
|
4622
4625
|
const requiredSecretNames = sessionInfo.secretNames || [];
|
|
4623
4626
|
const envFile = options.envFile || allOpts.envFile;
|
|
4624
4627
|
const loadedSecrets = loadValues(secrets, requiredSecretNames, envFile);
|
|
4625
|
-
const
|
|
4626
|
-
|
|
4627
|
-
);
|
|
4628
|
+
const artifactsInput = options.artifact.length > 0 ? options.artifact : allOpts.artifact;
|
|
4629
|
+
const artifacts = artifactsInput.length > 0 ? artifactsInput : void 0;
|
|
4628
4630
|
const response = await createRun({
|
|
4629
4631
|
sessionId: agentSessionId,
|
|
4630
4632
|
prompt,
|
|
4631
4633
|
vars: Object.keys(vars).length > 0 ? vars : void 0,
|
|
4632
4634
|
secrets: loadedSecrets,
|
|
4633
|
-
|
|
4634
|
-
artifactVersion: artifactParsed?.artifactVersion,
|
|
4635
|
+
artifacts,
|
|
4635
4636
|
additionalVolumes: allOpts.volume.length > 0 ? allOpts.volume : void 0,
|
|
4636
4637
|
appendSystemPrompt: options.appendSystemPrompt || allOpts.appendSystemPrompt,
|
|
4637
4638
|
disallowedTools: options.disallowedTools || allOpts.disallowedTools,
|
|
@@ -4871,6 +4872,7 @@ import { existsSync as existsSync5 } from "fs";
|
|
|
4871
4872
|
import path5 from "path";
|
|
4872
4873
|
var CONFIG_DIR = ".vm0";
|
|
4873
4874
|
var CONFIG_FILE = "storage.yaml";
|
|
4875
|
+
var memoryTypeWarnedPaths = /* @__PURE__ */ new Set();
|
|
4874
4876
|
function isValidStorageName(name) {
|
|
4875
4877
|
if (name.length < 3 || name.length > 64) {
|
|
4876
4878
|
return false;
|
|
@@ -4878,7 +4880,8 @@ function isValidStorageName(name) {
|
|
|
4878
4880
|
const pattern = /^[a-z0-9][a-z0-9-]{1,62}[a-z0-9]$/;
|
|
4879
4881
|
return pattern.test(name) && !name.includes("--");
|
|
4880
4882
|
}
|
|
4881
|
-
async function readStorageConfig(basePath = process.cwd()) {
|
|
4883
|
+
async function readStorageConfig(basePath = process.cwd(), options = {}) {
|
|
4884
|
+
const { normalizeMemoryToArtifact = true } = options;
|
|
4882
4885
|
const configPath = path5.join(basePath, CONFIG_DIR, CONFIG_FILE);
|
|
4883
4886
|
const legacyConfigPath = path5.join(basePath, CONFIG_DIR, "volume.yaml");
|
|
4884
4887
|
let actualPath = null;
|
|
@@ -4895,6 +4898,16 @@ async function readStorageConfig(basePath = process.cwd()) {
|
|
|
4895
4898
|
if (!config.type) {
|
|
4896
4899
|
config.type = "volume";
|
|
4897
4900
|
}
|
|
4901
|
+
if (config.type === "memory" && normalizeMemoryToArtifact) {
|
|
4902
|
+
if (!memoryTypeWarnedPaths.has(actualPath)) {
|
|
4903
|
+
memoryTypeWarnedPaths.add(actualPath);
|
|
4904
|
+
process.stderr.write(
|
|
4905
|
+
`warning: type: "memory" in ${actualPath} is deprecated; rewrite as type: "artifact" (removed in next major)
|
|
4906
|
+
`
|
|
4907
|
+
);
|
|
4908
|
+
}
|
|
4909
|
+
config.type = "artifact";
|
|
4910
|
+
}
|
|
4898
4911
|
return config;
|
|
4899
4912
|
}
|
|
4900
4913
|
async function writeStorageConfig(storageName, basePath = process.cwd(), type2 = "volume") {
|
|
@@ -5582,7 +5595,9 @@ var initCommand3 = new Command().name("init").description("Initialize a memory i
|
|
|
5582
5595
|
withErrorHandler(async (options) => {
|
|
5583
5596
|
const cwd = process.cwd();
|
|
5584
5597
|
const dirName = path11.basename(cwd);
|
|
5585
|
-
const existingConfig = await readStorageConfig(cwd
|
|
5598
|
+
const existingConfig = await readStorageConfig(cwd, {
|
|
5599
|
+
normalizeMemoryToArtifact: false
|
|
5600
|
+
});
|
|
5586
5601
|
if (existingConfig) {
|
|
5587
5602
|
if (existingConfig.type === "memory") {
|
|
5588
5603
|
console.log(
|
|
@@ -5655,7 +5670,9 @@ var pushCommand3 = new Command().name("push").description("Push local files to c
|
|
|
5655
5670
|
).action(
|
|
5656
5671
|
withErrorHandler(async (options) => {
|
|
5657
5672
|
const cwd = process.cwd();
|
|
5658
|
-
const config = await readStorageConfig(cwd
|
|
5673
|
+
const config = await readStorageConfig(cwd, {
|
|
5674
|
+
normalizeMemoryToArtifact: false
|
|
5675
|
+
});
|
|
5659
5676
|
if (!config) {
|
|
5660
5677
|
throw new Error("No memory initialized in this directory", {
|
|
5661
5678
|
cause: new Error("Run: vm0 memory init")
|
|
@@ -5707,7 +5724,9 @@ init_esm_shims();
|
|
|
5707
5724
|
var statusCommand4 = new Command().name("status").description("Show status of cloud memory").action(
|
|
5708
5725
|
withErrorHandler(async () => {
|
|
5709
5726
|
const cwd = process.cwd();
|
|
5710
|
-
const config = await readStorageConfig(cwd
|
|
5727
|
+
const config = await readStorageConfig(cwd, {
|
|
5728
|
+
normalizeMemoryToArtifact: false
|
|
5729
|
+
});
|
|
5711
5730
|
if (!config) {
|
|
5712
5731
|
throw new Error("No memory initialized in this directory", {
|
|
5713
5732
|
cause: new Error("Run: vm0 memory init")
|
|
@@ -6396,13 +6415,13 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6396
6415
|
if (latestVersion === null) {
|
|
6397
6416
|
throw new Error("Could not check for updates. Please try again later.");
|
|
6398
6417
|
}
|
|
6399
|
-
if (latestVersion === "9.
|
|
6400
|
-
console.log(source_default.green(`\u2713 Already up to date (${"9.
|
|
6418
|
+
if (latestVersion === "9.130.0") {
|
|
6419
|
+
console.log(source_default.green(`\u2713 Already up to date (${"9.130.0"})`));
|
|
6401
6420
|
return;
|
|
6402
6421
|
}
|
|
6403
6422
|
console.log(
|
|
6404
6423
|
source_default.yellow(
|
|
6405
|
-
`Current version: ${"9.
|
|
6424
|
+
`Current version: ${"9.130.0"} -> Latest version: ${latestVersion}`
|
|
6406
6425
|
)
|
|
6407
6426
|
);
|
|
6408
6427
|
console.log();
|
|
@@ -6429,7 +6448,7 @@ var upgradeCommand = new Command().name("upgrade").description("Upgrade vm0 CLI
|
|
|
6429
6448
|
const success = await performUpgrade(packageManager);
|
|
6430
6449
|
if (success) {
|
|
6431
6450
|
console.log(
|
|
6432
|
-
source_default.green(`\u2713 Upgraded from ${"9.
|
|
6451
|
+
source_default.green(`\u2713 Upgraded from ${"9.130.0"} to ${latestVersion}`)
|
|
6433
6452
|
);
|
|
6434
6453
|
return;
|
|
6435
6454
|
}
|
|
@@ -6496,7 +6515,7 @@ var whoamiCommand = new Command().name("whoami").description("Show current ident
|
|
|
6496
6515
|
|
|
6497
6516
|
// src/index.ts
|
|
6498
6517
|
var program = new Command();
|
|
6499
|
-
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.
|
|
6518
|
+
program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.130.0");
|
|
6500
6519
|
program.addCommand(authCommand);
|
|
6501
6520
|
program.addCommand(infoCommand);
|
|
6502
6521
|
program.addCommand(composeCommand);
|