@vm0/cli 9.67.0 → 9.69.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.
Files changed (2) hide show
  1. package/index.js +91 -128
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -45,7 +45,7 @@ if (DSN) {
45
45
  Sentry.init({
46
46
  dsn: DSN,
47
47
  environment: process.env.SENTRY_ENVIRONMENT ?? "production",
48
- release: "9.67.0",
48
+ release: "9.69.0",
49
49
  sendDefaultPii: false,
50
50
  tracesSampleRate: 0,
51
51
  shutdownTimeout: 500,
@@ -64,7 +64,7 @@ if (DSN) {
64
64
  }
65
65
  });
66
66
  Sentry.setContext("cli", {
67
- version: "9.67.0",
67
+ version: "9.69.0",
68
68
  command: process.argv.slice(2).join(" ")
69
69
  });
70
70
  Sentry.setContext("runtime", {
@@ -83,7 +83,7 @@ process.stdout.on("error", handleEpipe);
83
83
  process.stderr.on("error", handleEpipe);
84
84
 
85
85
  // src/index.ts
86
- import { Command as Command95 } from "commander";
86
+ import { Command as Command96 } from "commander";
87
87
 
88
88
  // src/lib/network/proxy.ts
89
89
  import { EnvHttpProxyAgent, setGlobalDispatcher } from "undici";
@@ -675,7 +675,7 @@ function getConfigPath() {
675
675
  return join2(homedir2(), ".vm0", "config.json");
676
676
  }
677
677
  var infoCommand = new Command6().name("info").description("Display environment and debug information").action(async () => {
678
- console.log(chalk4.bold(`VM0 CLI v${"9.67.0"}`));
678
+ console.log(chalk4.bold(`VM0 CLI v${"9.69.0"}`));
679
679
  console.log();
680
680
  const config = await loadConfig();
681
681
  const hasEnvToken = !!process.env.VM0_TOKEN;
@@ -1069,6 +1069,7 @@ var composeListItemSchema = z4.object({
1069
1069
  name: z4.string(),
1070
1070
  displayName: z4.string().nullable().optional(),
1071
1071
  description: z4.string().nullable().optional(),
1072
+ sound: z4.string().nullable().optional(),
1072
1073
  headVersionId: z4.string().nullable(),
1073
1074
  updatedAt: z4.string()
1074
1075
  });
@@ -1321,7 +1322,9 @@ var unifiedRunRequestSchema = z7.object({
1321
1322
  // Environment validation flag - when true, validates secrets/vars before running
1322
1323
  checkEnv: z7.boolean().optional(),
1323
1324
  // Required
1324
- prompt: z7.string().min(1, "Missing prompt")
1325
+ prompt: z7.string().min(1, "Missing prompt"),
1326
+ // Optional system prompt to append to the agent's system prompt
1327
+ appendSystemPrompt: z7.string().optional()
1325
1328
  });
1326
1329
  var createRunResponseSchema = z7.object({
1327
1330
  runId: z7.string(),
@@ -1337,6 +1340,7 @@ var getRunResponseSchema = z7.object({
1337
1340
  agentComposeVersionId: z7.string().nullable(),
1338
1341
  status: runStatusSchema,
1339
1342
  prompt: z7.string(),
1343
+ appendSystemPrompt: z7.string().nullable(),
1340
1344
  vars: z7.record(z7.string(), z7.string()).optional(),
1341
1345
  sandboxId: z7.string().optional(),
1342
1346
  result: z7.object({
@@ -1383,6 +1387,7 @@ var runListItemSchema = z7.object({
1383
1387
  agentName: z7.string(),
1384
1388
  status: runStatusSchema,
1385
1389
  prompt: z7.string(),
1390
+ appendSystemPrompt: z7.string().nullable(),
1386
1391
  createdAt: z7.string(),
1387
1392
  startedAt: z7.string().nullable()
1388
1393
  });
@@ -3206,6 +3211,7 @@ var runnerGroupSchema = z18.string().regex(
3206
3211
  var jobSchema = z18.object({
3207
3212
  runId: z18.uuid(),
3208
3213
  prompt: z18.string(),
3214
+ appendSystemPrompt: z18.string().nullable(),
3209
3215
  agentComposeVersionId: z18.string().nullable(),
3210
3216
  vars: z18.record(z18.string(), z18.string()).nullable(),
3211
3217
  checkpointId: z18.uuid().nullable(),
@@ -3266,8 +3272,9 @@ var storedExecutionContextSchema = z18.object({
3266
3272
  apiStartTime: z18.number().optional(),
3267
3273
  // User's timezone preference (IANA format, e.g., "Asia/Shanghai")
3268
3274
  userTimezone: z18.string().optional(),
3269
- // Agent metadata for VM0_AGENT_NAME and VM0_AGENT_ORG env vars
3275
+ // Agent metadata for VM0_AGENT_NAME, VM0_AGENT_COMPOSE_ID, and VM0_AGENT_ORG env vars
3270
3276
  agentName: z18.string().optional(),
3277
+ agentComposeId: z18.string().optional(),
3271
3278
  agentOrgSlug: z18.string().optional(),
3272
3279
  // Memory storage name (for first-run when manifest.memory is null)
3273
3280
  memoryName: z18.string().optional(),
@@ -3281,8 +3288,7 @@ var storedExecutionContextSchema = z18.object({
3281
3288
  var executionContextSchema = z18.object({
3282
3289
  runId: z18.uuid(),
3283
3290
  prompt: z18.string(),
3284
- // System prompt appended to agent instructions (passed as --append-system-prompt to Claude CLI)
3285
- appendSystemPrompt: z18.string().optional(),
3291
+ appendSystemPrompt: z18.string().nullable(),
3286
3292
  agentComposeVersionId: z18.string().nullable(),
3287
3293
  vars: z18.record(z18.string(), z18.string()).nullable(),
3288
3294
  checkpointId: z18.uuid().nullable(),
@@ -3306,6 +3312,7 @@ var executionContextSchema = z18.object({
3306
3312
  userTimezone: z18.string().optional(),
3307
3313
  // Agent metadata
3308
3314
  agentName: z18.string().optional(),
3315
+ agentComposeId: z18.string().optional(),
3309
3316
  agentOrgSlug: z18.string().optional(),
3310
3317
  // Memory storage name (for first-run when manifest.memory is null)
3311
3318
  memoryName: z18.string().optional(),
@@ -3360,6 +3367,7 @@ var scheduleTriggerSchema = z19.object({
3360
3367
  var scheduleRunConfigSchema = z19.object({
3361
3368
  agent: z19.string().min(1, "Agent reference required"),
3362
3369
  prompt: z19.string().min(1, "Prompt required"),
3370
+ appendSystemPrompt: z19.string().optional(),
3363
3371
  vars: z19.record(z19.string(), z19.string()).optional(),
3364
3372
  secrets: z19.record(z19.string(), z19.string()).optional(),
3365
3373
  artifactName: z19.string().optional(),
@@ -3381,6 +3389,7 @@ var deployScheduleRequestSchema = z19.object({
3381
3389
  intervalSeconds: z19.number().int().min(0).optional(),
3382
3390
  timezone: z19.string().default("UTC"),
3383
3391
  prompt: z19.string().min(1, "Prompt required"),
3392
+ appendSystemPrompt: z19.string().optional(),
3384
3393
  // vars and secrets removed - now managed via server-side tables
3385
3394
  artifactName: z19.string().optional(),
3386
3395
  artifactVersion: z19.string().optional(),
@@ -3418,6 +3427,7 @@ var scheduleResponseSchema = z19.object({
3418
3427
  intervalSeconds: z19.number().nullable(),
3419
3428
  timezone: z19.string(),
3420
3429
  prompt: z19.string(),
3430
+ appendSystemPrompt: z19.string().nullable(),
3421
3431
  vars: z19.record(z19.string(), z19.string()).nullable(),
3422
3432
  // Secret names only (values are never returned)
3423
3433
  secretNames: z19.array(z19.string()).nullable(),
@@ -7662,112 +7672,6 @@ function parseSkillFrontmatter(content) {
7662
7672
  };
7663
7673
  }
7664
7674
 
7665
- // ../../packages/core/src/instructions-frontmatter.ts
7666
- var LEGACY_PROFILE_START = "<!-- ZERO_PROFILE";
7667
- var LEGACY_PROFILE_END = "ZERO_PROFILE -->";
7668
- var PROFILE_START = "[AGENT_PROFILE]";
7669
- var PROFILE_END = "[/AGENT_PROFILE]";
7670
- function stripMarkerBlocks(content, startMarker, endMarker) {
7671
- let result = "";
7672
- let searchFrom = 0;
7673
- while (searchFrom < content.length) {
7674
- const startIdx = content.indexOf(startMarker + "\n", searchFrom);
7675
- if (startIdx === -1) {
7676
- result += content.slice(searchFrom);
7677
- break;
7678
- }
7679
- result += content.slice(searchFrom, startIdx);
7680
- const endIdx = content.indexOf(
7681
- endMarker,
7682
- startIdx + startMarker.length + 1
7683
- );
7684
- if (endIdx === -1) {
7685
- result += content.slice(startIdx);
7686
- break;
7687
- }
7688
- let afterEnd = endIdx + endMarker.length;
7689
- if (content[afterEnd] === "\n") {
7690
- afterEnd++;
7691
- }
7692
- searchFrom = afterEnd;
7693
- }
7694
- return result;
7695
- }
7696
- function stripProfileBlocks(content) {
7697
- const withoutLegacy = stripMarkerBlocks(
7698
- content,
7699
- LEGACY_PROFILE_START,
7700
- LEGACY_PROFILE_END
7701
- );
7702
- return stripMarkerBlocks(withoutLegacy, PROFILE_START, PROFILE_END);
7703
- }
7704
- var LEGACY_METADATA_KEYS = /* @__PURE__ */ new Set(["name", "tone"]);
7705
- function stripLegacyFrontmatter(content) {
7706
- const match = content.match(/^---\r?\n([\s\S]*?)\r?\n---(\r?\n|$)/);
7707
- if (!match) {
7708
- return content;
7709
- }
7710
- const rawYaml = match[1] ?? "";
7711
- const body = content.slice(match[0].length);
7712
- const remaining = rawYaml.split("\n").filter((line) => {
7713
- const key = line.split(":")[0]?.trim();
7714
- return !key || !LEGACY_METADATA_KEYS.has(key);
7715
- }).join("\n").trim();
7716
- if (!remaining) {
7717
- return body.replace(/^\n/, "");
7718
- }
7719
- return `---
7720
- ${remaining}
7721
- ---${body}`;
7722
- }
7723
- var TONE_DESCRIPTIONS = {
7724
- professional: "clear, polished, and business-appropriate",
7725
- friendly: "warm, approachable, and conversational",
7726
- direct: "concise, to the point, and no-nonsense",
7727
- supportive: "encouraging, empathetic, and reassuring"
7728
- };
7729
- function buildProfileParagraph(metadata) {
7730
- const parts = [];
7731
- if (metadata.displayName) {
7732
- parts.push(`Your name is ${metadata.displayName}.`);
7733
- }
7734
- if (metadata.description) {
7735
- parts.push(metadata.description);
7736
- }
7737
- if (metadata.sound) {
7738
- const desc = TONE_DESCRIPTIONS[metadata.sound] ?? metadata.sound;
7739
- parts.push(
7740
- `Communicate in a ${desc} tone. This should be reflected in all your responses.`
7741
- );
7742
- }
7743
- if (parts.length === 0) {
7744
- return null;
7745
- }
7746
- return parts.join(" ");
7747
- }
7748
- function injectMetadataFrontmatter(content, metadata) {
7749
- if (!metadata) {
7750
- return content;
7751
- }
7752
- const paragraph = buildProfileParagraph(metadata);
7753
- if (!paragraph) {
7754
- return content;
7755
- }
7756
- const block = `${PROFILE_START}
7757
- ${paragraph}
7758
- ${PROFILE_END}`;
7759
- const stripped = stripProfileBlocks(
7760
- stripLegacyFrontmatter(content)
7761
- ).trimStart();
7762
- if (!stripped) {
7763
- return `${block}
7764
- `;
7765
- }
7766
- return `${block}
7767
-
7768
- ${stripped}`;
7769
- }
7770
-
7771
7675
  // src/lib/api/core/http.ts
7772
7676
  async function appendOrgParam(path18) {
7773
7677
  const activeOrg = await getActiveOrg();
@@ -9275,11 +9179,10 @@ async function directUpload(storageName, storageType, cwd, options) {
9275
9179
  }
9276
9180
 
9277
9181
  // src/lib/storage/system-storage.ts
9278
- async function uploadInstructions(agentName, instructionsFilePath, basePath, framework, metadata) {
9182
+ async function uploadInstructions(agentName, instructionsFilePath, basePath, framework) {
9279
9183
  const storageName = getInstructionsStorageName(agentName.toLowerCase());
9280
9184
  const absolutePath = path5.isAbsolute(instructionsFilePath) ? instructionsFilePath : path5.join(basePath, instructionsFilePath);
9281
- const rawContent = await fs5.readFile(absolutePath, "utf8");
9282
- const content = injectMetadataFrontmatter(rawContent, metadata);
9185
+ const content = await fs5.readFile(absolutePath, "utf8");
9283
9186
  const tmpDir = await fs5.mkdtemp(path5.join(os4.tmpdir(), "vm0-instructions-"));
9284
9187
  const instructionsDir = path5.join(tmpDir, "instructions");
9285
9188
  await fs5.mkdir(instructionsDir);
@@ -9453,8 +9356,7 @@ async function uploadAssets(agentName, agent, basePath, jsonMode) {
9453
9356
  agentName,
9454
9357
  agent.instructions,
9455
9358
  basePath,
9456
- agent.framework,
9457
- agent.metadata
9359
+ agent.framework
9458
9360
  );
9459
9361
  if (!jsonMode) {
9460
9362
  console.log(
@@ -9793,7 +9695,7 @@ var composeCommand = new Command7().name("compose").description("Create or updat
9793
9695
  options.autoUpdate = false;
9794
9696
  }
9795
9697
  if (options.autoUpdate !== false) {
9796
- await startSilentUpgrade("9.67.0");
9698
+ await startSilentUpgrade("9.69.0");
9797
9699
  }
9798
9700
  try {
9799
9701
  let result;
@@ -10615,7 +10517,7 @@ var mainRunCommand = new Command8().name("run").description("Run an agent").argu
10615
10517
  withErrorHandler(
10616
10518
  async (identifier, prompt, options) => {
10617
10519
  if (options.autoUpdate !== false) {
10618
- await startSilentUpgrade("9.67.0");
10520
+ await startSilentUpgrade("9.69.0");
10619
10521
  }
10620
10522
  const { org, name, version } = parseIdentifier(identifier);
10621
10523
  let composeId;
@@ -12344,7 +12246,7 @@ var cookAction = new Command35().name("cook").description("Quick start: prepare,
12344
12246
  withErrorHandler(
12345
12247
  async (prompt, options) => {
12346
12248
  if (options.autoUpdate !== false) {
12347
- const shouldExit = await checkAndUpgrade("9.67.0", prompt);
12249
+ const shouldExit = await checkAndUpgrade("9.69.0", prompt);
12348
12250
  if (shouldExit) {
12349
12251
  process.exit(0);
12350
12252
  }
@@ -17689,13 +17591,13 @@ var upgradeCommand = new Command94().name("upgrade").description("Upgrade vm0 CL
17689
17591
  if (latestVersion === null) {
17690
17592
  throw new Error("Could not check for updates. Please try again later.");
17691
17593
  }
17692
- if (latestVersion === "9.67.0") {
17693
- console.log(chalk86.green(`\u2713 Already up to date (${"9.67.0"})`));
17594
+ if (latestVersion === "9.69.0") {
17595
+ console.log(chalk86.green(`\u2713 Already up to date (${"9.69.0"})`));
17694
17596
  return;
17695
17597
  }
17696
17598
  console.log(
17697
17599
  chalk86.yellow(
17698
- `Current version: ${"9.67.0"} -> Latest version: ${latestVersion}`
17600
+ `Current version: ${"9.69.0"} -> Latest version: ${latestVersion}`
17699
17601
  )
17700
17602
  );
17701
17603
  console.log();
@@ -17722,7 +17624,7 @@ var upgradeCommand = new Command94().name("upgrade").description("Upgrade vm0 CL
17722
17624
  const success = await performUpgrade(packageManager);
17723
17625
  if (success) {
17724
17626
  console.log(
17725
- chalk86.green(`\u2713 Upgraded from ${"9.67.0"} to ${latestVersion}`)
17627
+ chalk86.green(`\u2713 Upgraded from ${"9.69.0"} to ${latestVersion}`)
17726
17628
  );
17727
17629
  return;
17728
17630
  }
@@ -17734,9 +17636,69 @@ var upgradeCommand = new Command94().name("upgrade").description("Upgrade vm0 CL
17734
17636
  })
17735
17637
  );
17736
17638
 
17639
+ // src/commands/whoami.ts
17640
+ import { Command as Command95 } from "commander";
17641
+ import chalk87 from "chalk";
17642
+ function isInsideSandbox() {
17643
+ return !!process.env.VM0_RUN_ID;
17644
+ }
17645
+ async function showSandboxInfo() {
17646
+ const agentName = process.env.VM0_AGENT_NAME;
17647
+ const agentVersion = process.env.VM0_AGENT_VERSION;
17648
+ const agentComposeId = process.env.VM0_AGENT_COMPOSE_ID;
17649
+ const agentOrgSlug = process.env.VM0_AGENT_ORG_SLUG;
17650
+ const cliAgentType = process.env.CLI_AGENT_TYPE;
17651
+ const runId = process.env.VM0_RUN_ID;
17652
+ const activeOrg = process.env.VM0_ACTIVE_ORG;
17653
+ const apiUrl = process.env.VM0_API_URL;
17654
+ const hasAgentInfo = agentName || agentVersion || agentComposeId || agentOrgSlug || cliAgentType;
17655
+ if (hasAgentInfo) {
17656
+ console.log(chalk87.bold("Agent:"));
17657
+ if (agentName) console.log(` Name: ${agentName}`);
17658
+ if (agentVersion) console.log(` Version: ${agentVersion}`);
17659
+ if (agentComposeId) console.log(` Compose ID: ${agentComposeId}`);
17660
+ if (agentOrgSlug) console.log(` Org: ${agentOrgSlug}`);
17661
+ if (cliAgentType) console.log(` Framework: ${cliAgentType}`);
17662
+ console.log();
17663
+ }
17664
+ console.log(chalk87.bold("Run:"));
17665
+ if (runId) console.log(` ID: ${runId}`);
17666
+ if (activeOrg) console.log(` Org: ${activeOrg}`);
17667
+ if (apiUrl) console.log(` API: ${apiUrl}`);
17668
+ }
17669
+ async function showLocalInfo() {
17670
+ const token = await getToken();
17671
+ const apiUrl = await getApiUrl();
17672
+ const activeOrg = await getActiveOrg();
17673
+ console.log(chalk87.bold("Auth:"));
17674
+ if (token) {
17675
+ const tokenSource = process.env.VM0_TOKEN ? "VM0_TOKEN env var" : "config file";
17676
+ console.log(
17677
+ ` Status: ${chalk87.green("Authenticated")} (via ${tokenSource})`
17678
+ );
17679
+ } else {
17680
+ console.log(` Status: ${chalk87.dim("Not authenticated")}`);
17681
+ }
17682
+ console.log(` API: ${apiUrl}`);
17683
+ console.log();
17684
+ if (activeOrg) {
17685
+ console.log(chalk87.bold("Org:"));
17686
+ console.log(` Active: ${activeOrg}`);
17687
+ }
17688
+ }
17689
+ var whoamiCommand = new Command95().name("whoami").description("Show current identity and environment information").action(
17690
+ withErrorHandler(async () => {
17691
+ if (isInsideSandbox()) {
17692
+ await showSandboxInfo();
17693
+ } else {
17694
+ await showLocalInfo();
17695
+ }
17696
+ })
17697
+ );
17698
+
17737
17699
  // src/index.ts
17738
- var program = new Command95();
17739
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.67.0");
17700
+ var program = new Command96();
17701
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("9.69.0");
17740
17702
  program.addCommand(authCommand);
17741
17703
  program.addCommand(infoCommand);
17742
17704
  program.addCommand(composeCommand);
@@ -17759,6 +17721,7 @@ program.addCommand(setupClaudeCommand);
17759
17721
  program.addCommand(dashboardCommand);
17760
17722
  program.addCommand(preferenceCommand);
17761
17723
  program.addCommand(upgradeCommand);
17724
+ program.addCommand(whoamiCommand);
17762
17725
  if (process.argv[1]?.endsWith("index.js") || process.argv[1]?.endsWith("index.ts") || process.argv[1]?.endsWith("vm0")) {
17763
17726
  process.stdout.on("error", (err) => {
17764
17727
  if (err.code === "EPIPE") process.exit(0);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "9.67.0",
3
+ "version": "9.69.0",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",