@vm0/cli 8.0.1 → 8.0.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.
Files changed (2) hide show
  1. package/index.js +19 -114
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -432,11 +432,6 @@ var appStringSchema = z4.string().superRefine((val, ctx) => {
432
432
  });
433
433
  var agentDefinitionSchema = z4.object({
434
434
  description: z4.string().optional(),
435
- /**
436
- * @deprecated Use `apps` field instead for pre-installed tools.
437
- * This field will be removed in a future version.
438
- */
439
- image: z4.string().optional(),
440
435
  framework: z4.string().min(1, "Framework is required"),
441
436
  /**
442
437
  * Array of pre-installed apps/tools for the agent environment.
@@ -446,8 +441,6 @@ var agentDefinitionSchema = z4.object({
446
441
  */
447
442
  apps: z4.array(appStringSchema).optional(),
448
443
  volumes: z4.array(z4.string()).optional(),
449
- working_dir: z4.string().optional(),
450
- // Optional when provider supports auto-config
451
444
  environment: z4.record(z4.string(), z4.string()).optional(),
452
445
  /**
453
446
  * Path to instructions file (e.g., AGENTS.md).
@@ -474,7 +467,17 @@ var agentDefinitionSchema = z4.object({
474
467
  * Requires experimental_runner to be configured.
475
468
  * When enabled, filters outbound traffic by domain/IP rules.
476
469
  */
477
- experimental_firewall: experimentalFirewallSchema.optional()
470
+ experimental_firewall: experimentalFirewallSchema.optional(),
471
+ /**
472
+ * @deprecated Server-resolved field. User input is ignored.
473
+ * @internal
474
+ */
475
+ image: z4.string().optional(),
476
+ /**
477
+ * @deprecated Server-resolved field. User input is ignored.
478
+ * @internal
479
+ */
480
+ working_dir: z4.string().optional()
478
481
  });
479
482
  var agentComposeContentSchema = z4.object({
480
483
  version: z4.string().min(1, "Version is required"),
@@ -3421,72 +3424,6 @@ async function getUsage(options) {
3421
3424
 
3422
3425
  // src/lib/domain/yaml-validator.ts
3423
3426
  import { z as z23 } from "zod";
3424
-
3425
- // src/lib/domain/framework-config.ts
3426
- var FRAMEWORK_DEFAULTS = {
3427
- "claude-code": {
3428
- workingDir: "/home/user/workspace",
3429
- image: {
3430
- production: "vm0/claude-code:latest",
3431
- development: "vm0/claude-code:dev"
3432
- }
3433
- },
3434
- codex: {
3435
- workingDir: "/home/user/workspace",
3436
- image: {
3437
- production: "vm0/codex:latest",
3438
- development: "vm0/codex:dev"
3439
- }
3440
- }
3441
- };
3442
- function getFrameworkDefaults(framework) {
3443
- return FRAMEWORK_DEFAULTS[framework];
3444
- }
3445
- function isFrameworkSupported(framework) {
3446
- return framework in FRAMEWORK_DEFAULTS;
3447
- }
3448
- var FRAMEWORK_APPS_IMAGES = {
3449
- "claude-code": {
3450
- github: {
3451
- production: "vm0/claude-code-github:latest",
3452
- development: "vm0/claude-code-github:dev"
3453
- }
3454
- },
3455
- codex: {
3456
- github: {
3457
- production: "vm0/codex-github:latest",
3458
- development: "vm0/codex-github:dev"
3459
- }
3460
- }
3461
- };
3462
- function parseAppString(appString) {
3463
- const [app, tag] = appString.split(":");
3464
- return {
3465
- app: app ?? appString,
3466
- tag: tag === "dev" ? "dev" : "latest"
3467
- };
3468
- }
3469
- function getDefaultImageWithApps(framework, apps) {
3470
- const defaults = FRAMEWORK_DEFAULTS[framework];
3471
- if (!defaults) return void 0;
3472
- if (apps && apps.length > 0) {
3473
- const frameworkApps = FRAMEWORK_APPS_IMAGES[framework];
3474
- if (frameworkApps) {
3475
- const firstApp = apps[0];
3476
- if (firstApp) {
3477
- const { app, tag } = parseAppString(firstApp);
3478
- const appImage = frameworkApps[app];
3479
- if (appImage) {
3480
- return tag === "dev" ? appImage.development : appImage.production;
3481
- }
3482
- }
3483
- }
3484
- }
3485
- const isDevelopment = process.env.NODE_ENV === "development" || process.env.NODE_ENV === "test";
3486
- return isDevelopment ? defaults.image.development : defaults.image.production;
3487
- }
3488
-
3489
- // src/lib/domain/yaml-validator.ts
3490
3427
  var cliAgentNameSchema = z23.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
3491
3428
  /^[a-zA-Z0-9]([a-zA-Z0-9-]{0,62}[a-zA-Z0-9])?$/,
3492
3429
  "Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
@@ -3497,21 +3434,6 @@ function validateGitHubTreeUrl(url) {
3497
3434
  }
3498
3435
  var cliAgentDefinitionSchema = agentDefinitionSchema.superRefine(
3499
3436
  (agent, ctx) => {
3500
- const frameworkSupported = isFrameworkSupported(agent.framework);
3501
- if (!agent.image && !frameworkSupported) {
3502
- ctx.addIssue({
3503
- code: z23.ZodIssueCode.custom,
3504
- message: "Missing agent.image (required when framework is not auto-configured)",
3505
- path: ["image"]
3506
- });
3507
- }
3508
- if (!agent.working_dir && !frameworkSupported) {
3509
- ctx.addIssue({
3510
- code: z23.ZodIssueCode.custom,
3511
- message: "Missing agent.working_dir (required when framework is not auto-configured)",
3512
- path: ["working_dir"]
3513
- });
3514
- }
3515
3437
  if (agent.skills) {
3516
3438
  for (let i = 0; i < agent.skills.length; i++) {
3517
3439
  const skillUrl = agent.skills[i];
@@ -4171,24 +4093,6 @@ var composeCommand = new Command().name("compose").description("Create or update
4171
4093
  const agentName = Object.keys(agents)[0];
4172
4094
  const agent = agents[agentName];
4173
4095
  const basePath = dirname2(configFile);
4174
- if (agent.framework) {
4175
- const defaults = getFrameworkDefaults(agent.framework);
4176
- if (defaults) {
4177
- if (!agent.image) {
4178
- const apps = agent.apps;
4179
- const defaultImage = getDefaultImageWithApps(
4180
- agent.framework,
4181
- apps
4182
- );
4183
- if (defaultImage) {
4184
- agent.image = defaultImage;
4185
- }
4186
- }
4187
- if (!agent.working_dir) {
4188
- agent.working_dir = defaults.workingDir;
4189
- }
4190
- }
4191
- }
4192
4096
  if (agent.instructions) {
4193
4097
  const instructionsPath = agent.instructions;
4194
4098
  const framework = agent.framework;
@@ -7959,7 +7863,7 @@ cookCmd.argument("[prompt]", "Prompt for the agent").option(
7959
7863
  // eslint-disable-next-line complexity -- TODO: refactor complex function
7960
7864
  async (prompt, options) => {
7961
7865
  if (!options.noAutoUpdate) {
7962
- const shouldExit = await checkAndUpgrade("8.0.1", prompt);
7866
+ const shouldExit = await checkAndUpgrade("8.0.2", prompt);
7963
7867
  if (shouldExit) {
7964
7868
  process.exit(0);
7965
7869
  }
@@ -9506,11 +9410,11 @@ async function gatherSecrets(optionSecrets, existingSecretNames) {
9506
9410
  `Keep existing secrets? (${existingSecretNames.join(", ")})`,
9507
9411
  true
9508
9412
  );
9509
- if (!keepSecrets) {
9510
- console.log(
9511
- chalk31.dim(" Note: You'll need to provide new secret values")
9512
- );
9413
+ if (keepSecrets) {
9414
+ return void 0;
9513
9415
  }
9416
+ console.log(chalk31.dim(" Note: You'll need to provide new secret values"));
9417
+ return {};
9514
9418
  }
9515
9419
  return void 0;
9516
9420
  }
@@ -9721,6 +9625,7 @@ var setupCommand = new Command28().name("setup").description("Create or edit a s
9721
9625
  options.secret || [],
9722
9626
  existingSchedule?.secretNames
9723
9627
  );
9628
+ const keepExistingSecrets = initialSecrets === void 0;
9724
9629
  const { secrets, vars } = await gatherMissingConfiguration(
9725
9630
  requiredConfig,
9726
9631
  initialSecrets ?? {},
@@ -9738,7 +9643,7 @@ var setupCommand = new Command28().name("setup").description("Create or edit a s
9738
9643
  timezone,
9739
9644
  prompt: promptText_,
9740
9645
  vars: Object.keys(vars).length > 0 ? vars : void 0,
9741
- secrets: Object.keys(secrets).length > 0 ? secrets : void 0,
9646
+ secrets: keepExistingSecrets ? void 0 : Object.keys(secrets).length > 0 ? secrets : void 0,
9742
9647
  artifactName: options.artifactName
9743
9648
  });
9744
9649
  } catch (error) {
@@ -10621,7 +10526,7 @@ var modelProviderCommand = new Command44().name("model-provider").description("M
10621
10526
 
10622
10527
  // src/index.ts
10623
10528
  var program = new Command45();
10624
- program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("8.0.1");
10529
+ program.name("vm0").description("VM0 CLI - Build and run agents with natural language").version("8.0.2");
10625
10530
  program.command("info").description("Display environment information").action(async () => {
10626
10531
  console.log(chalk45.bold("System Information:"));
10627
10532
  console.log(`Node Version: ${process.version}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "8.0.1",
3
+ "version": "8.0.2",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",