@vm0/cli 4.35.1 → 4.35.3

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 +69 -81
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -12269,6 +12269,13 @@ var apiErrorSchema = external_exports.object({
12269
12269
 
12270
12270
  // ../../packages/core/src/contracts/composes.ts
12271
12271
  var c = initContract();
12272
+ var composeVersionQuerySchema = external_exports.preprocess(
12273
+ (val) => val === void 0 || val === null ? void 0 : String(val),
12274
+ external_exports.string().min(1, "Missing version query parameter").regex(
12275
+ /^[a-f0-9]{8,64}$|^latest$/i,
12276
+ "Version must be 8-64 hex characters or 'latest'"
12277
+ )
12278
+ );
12272
12279
  var agentNameSchema = external_exports.string().min(3, "Agent name must be at least 3 characters").max(64, "Agent name must be 64 characters or less").regex(
12273
12280
  /^[a-zA-Z0-9][a-zA-Z0-9-]{1,62}[a-zA-Z0-9]$/,
12274
12281
  "Agent name must start and end with letter or number, and contain only letters, numbers, and hyphens"
@@ -12405,7 +12412,7 @@ var composesVersionsContract = c.router({
12405
12412
  path: "/api/agent/composes/versions",
12406
12413
  query: external_exports.object({
12407
12414
  composeId: external_exports.string().min(1, "Missing composeId query parameter"),
12408
- version: external_exports.string().min(1, "Missing version query parameter")
12415
+ version: composeVersionQuerySchema
12409
12416
  }),
12410
12417
  responses: {
12411
12418
  200: external_exports.object({
@@ -12714,6 +12721,10 @@ var runNetworkLogsContract = c2.router({
12714
12721
  // ../../packages/core/src/contracts/storages.ts
12715
12722
  var c3 = initContract();
12716
12723
  var storageTypeSchema = external_exports.enum(["volume", "artifact"]);
12724
+ var versionQuerySchema = external_exports.preprocess(
12725
+ (val) => val === void 0 || val === null ? void 0 : String(val),
12726
+ external_exports.string().regex(/^[a-f0-9]{8,64}$/i, "Version must be 8-64 hex characters").optional()
12727
+ );
12717
12728
  var uploadStorageResponseSchema = external_exports.object({
12718
12729
  name: external_exports.string(),
12719
12730
  versionId: external_exports.string(),
@@ -12762,7 +12773,7 @@ var storagesContract = c3.router({
12762
12773
  path: "/api/storages",
12763
12774
  query: external_exports.object({
12764
12775
  name: external_exports.string().min(1, "Storage name is required"),
12765
- version: external_exports.string().optional()
12776
+ version: versionQuerySchema
12766
12777
  }),
12767
12778
  responses: {
12768
12779
  // Binary response - actual handling done at route level
@@ -12862,7 +12873,7 @@ var storagesDownloadContract = c3.router({
12862
12873
  query: external_exports.object({
12863
12874
  name: external_exports.string().min(1, "Storage name is required"),
12864
12875
  type: storageTypeSchema,
12865
- version: external_exports.string().optional()
12876
+ version: versionQuerySchema
12866
12877
  }),
12867
12878
  responses: {
12868
12879
  // Normal response with presigned URL
@@ -13680,7 +13691,6 @@ var executionContextSchema = external_exports.object({
13680
13691
  secretNames: external_exports.array(external_exports.string()).nullable(),
13681
13692
  checkpointId: external_exports.string().uuid().nullable(),
13682
13693
  sandboxToken: external_exports.string(),
13683
- apiUrl: external_exports.string(),
13684
13694
  // New fields for E2B parity:
13685
13695
  workingDir: external_exports.string(),
13686
13696
  storageManifest: storageManifestSchema.nullable(),
@@ -15048,47 +15058,31 @@ var composeCommand = new Command().name("compose").description("Create or update
15048
15058
  const instructionsPath = agent.instructions;
15049
15059
  const provider = agent.provider;
15050
15060
  console.log(`Uploading instructions: ${instructionsPath}`);
15051
- try {
15052
- const result = await uploadInstructions(
15053
- agentName,
15054
- instructionsPath,
15055
- basePath,
15056
- provider
15057
- );
15058
- console.log(
15059
- chalk2.green(
15060
- `\u2713 Instructions ${result.action === "deduplicated" ? "(unchanged)" : "uploaded"}: ${result.versionId.slice(0, 8)}`
15061
- )
15062
- );
15063
- } catch (error43) {
15064
- console.error(chalk2.red(`\u2717 Failed to upload instructions`));
15065
- if (error43 instanceof Error) {
15066
- console.error(chalk2.dim(` ${error43.message}`));
15067
- }
15068
- process.exit(1);
15069
- }
15061
+ const result = await uploadInstructions(
15062
+ agentName,
15063
+ instructionsPath,
15064
+ basePath,
15065
+ provider
15066
+ );
15067
+ console.log(
15068
+ chalk2.green(
15069
+ `\u2713 Instructions ${result.action === "deduplicated" ? "(unchanged)" : "uploaded"}: ${result.versionId.slice(0, 8)}`
15070
+ )
15071
+ );
15070
15072
  }
15071
15073
  const skillResults = [];
15072
15074
  if (agent.skills && Array.isArray(agent.skills)) {
15073
15075
  const skillUrls = agent.skills;
15074
15076
  console.log(`Uploading ${skillUrls.length} skill(s)...`);
15075
15077
  for (const skillUrl of skillUrls) {
15076
- try {
15077
- console.log(chalk2.dim(` Downloading: ${skillUrl}`));
15078
- const result = await uploadSkill(skillUrl);
15079
- skillResults.push(result);
15080
- console.log(
15081
- chalk2.green(
15082
- ` \u2713 Skill ${result.action === "deduplicated" ? "(unchanged)" : "uploaded"}: ${result.skillName} (${result.versionId.slice(0, 8)})`
15083
- )
15084
- );
15085
- } catch (error43) {
15086
- console.error(chalk2.red(`\u2717 Failed to upload skill: ${skillUrl}`));
15087
- if (error43 instanceof Error) {
15088
- console.error(chalk2.dim(` ${error43.message}`));
15089
- }
15090
- process.exit(1);
15091
- }
15078
+ console.log(chalk2.dim(` Downloading: ${skillUrl}`));
15079
+ const result = await uploadSkill(skillUrl);
15080
+ skillResults.push(result);
15081
+ console.log(
15082
+ chalk2.green(
15083
+ ` \u2713 Skill ${result.action === "deduplicated" ? "(unchanged)" : "uploaded"}: ${result.skillName} (${result.versionId.slice(0, 8)})`
15084
+ )
15085
+ );
15092
15086
  }
15093
15087
  }
15094
15088
  const skillSecrets = /* @__PURE__ */ new Map();
@@ -16065,39 +16059,19 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
16065
16059
  if (verbose) {
16066
16060
  console.log(chalk5.dim(` Using compose ID: ${identifier}`));
16067
16061
  }
16068
- try {
16069
- const compose = await apiClient.getComposeById(name);
16070
- composeId = compose.id;
16071
- composeContent = compose.content;
16072
- } catch (error43) {
16073
- if (error43 instanceof Error) {
16074
- console.error(chalk5.red(`\u2717 Compose not found: ${name}`));
16075
- }
16076
- process.exit(1);
16077
- }
16062
+ const compose = await apiClient.getComposeById(name);
16063
+ composeId = compose.id;
16064
+ composeContent = compose.content;
16078
16065
  } else {
16079
16066
  if (verbose) {
16080
16067
  const displayRef = scope ? `${scope}/${name}` : name;
16081
16068
  console.log(chalk5.dim(` Resolving agent: ${displayRef}`));
16082
16069
  }
16083
- try {
16084
- const compose = await apiClient.getComposeByName(name, scope);
16085
- composeId = compose.id;
16086
- composeContent = compose.content;
16087
- if (verbose) {
16088
- console.log(chalk5.dim(` Resolved to compose ID: ${composeId}`));
16089
- }
16090
- } catch (error43) {
16091
- if (error43 instanceof Error) {
16092
- const displayRef = scope ? `${scope}/${name}` : name;
16093
- console.error(chalk5.red(`\u2717 Agent not found: ${displayRef}`));
16094
- console.error(
16095
- chalk5.dim(
16096
- " Make sure you've composed the agent with: vm0 compose"
16097
- )
16098
- );
16099
- }
16100
- process.exit(1);
16070
+ const compose = await apiClient.getComposeByName(name, scope);
16071
+ composeId = compose.id;
16072
+ composeContent = compose.content;
16073
+ if (verbose) {
16074
+ console.log(chalk5.dim(` Resolved to compose ID: ${composeId}`));
16101
16075
  }
16102
16076
  }
16103
16077
  let agentComposeVersionId;
@@ -16118,14 +16092,8 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
16118
16092
  )
16119
16093
  );
16120
16094
  }
16121
- } catch (error43) {
16122
- if (error43 instanceof Error) {
16123
- console.error(chalk5.red(`\u2717 Version not found: ${version2}`));
16124
- console.error(
16125
- chalk5.dim(" Make sure the version hash is correct.")
16126
- );
16127
- }
16128
- process.exit(1);
16095
+ } catch {
16096
+ throw new Error(`Version not found: ${version2}`);
16129
16097
  }
16130
16098
  }
16131
16099
  const varNames = extractVarNames(composeContent);
@@ -16207,6 +16175,11 @@ var runCmd = new Command2().name("run").description("Execute an agent").argument
16207
16175
  console.error(
16208
16176
  chalk5.red("\u2717 Not authenticated. Run: vm0 auth login")
16209
16177
  );
16178
+ } else if (error43.message.startsWith("Version not found:")) {
16179
+ console.error(chalk5.red(`\u2717 ${error43.message}`));
16180
+ console.error(
16181
+ chalk5.dim(" Make sure the version hash is correct.")
16182
+ );
16210
16183
  } else if (error43.message.includes("not found")) {
16211
16184
  console.error(chalk5.red(`\u2717 Agent not found: ${identifier}`));
16212
16185
  console.error(
@@ -16639,7 +16612,11 @@ var pushCommand = new Command4().name("push").description("Push local files to c
16639
16612
  } catch (error43) {
16640
16613
  console.error(chalk7.red("\u2717 Push failed"));
16641
16614
  if (error43 instanceof Error) {
16642
- console.error(chalk7.dim(` ${error43.message}`));
16615
+ if (error43.message.includes("Not authenticated")) {
16616
+ console.error(chalk7.dim(" Run: vm0 auth login"));
16617
+ } else {
16618
+ console.error(chalk7.dim(` ${error43.message}`));
16619
+ }
16643
16620
  }
16644
16621
  process.exit(1);
16645
16622
  }
@@ -16752,7 +16729,11 @@ var pullCommand = new Command5().name("pull").description("Pull cloud files to l
16752
16729
  } catch (error43) {
16753
16730
  console.error(chalk9.red("\u2717 Pull failed"));
16754
16731
  if (error43 instanceof Error) {
16755
- console.error(chalk9.dim(` ${error43.message}`));
16732
+ if (error43.message.includes("Not authenticated")) {
16733
+ console.error(chalk9.dim(" Run: vm0 auth login"));
16734
+ } else {
16735
+ console.error(chalk9.dim(` ${error43.message}`));
16736
+ }
16756
16737
  }
16757
16738
  process.exit(1);
16758
16739
  }
@@ -16813,7 +16794,11 @@ var statusCommand = new Command6().name("status").description("Show status of cl
16813
16794
  } catch (error43) {
16814
16795
  console.error(chalk10.red("\u2717 Status check failed"));
16815
16796
  if (error43 instanceof Error) {
16816
- console.error(chalk10.dim(` ${error43.message}`));
16797
+ if (error43.message.includes("Not authenticated")) {
16798
+ console.error(chalk10.dim(" Run: vm0 auth login"));
16799
+ } else {
16800
+ console.error(chalk10.dim(` ${error43.message}`));
16801
+ }
16817
16802
  }
16818
16803
  process.exit(1);
16819
16804
  }
@@ -17734,7 +17719,7 @@ async function autoPullArtifact(runOutput, artifactDir) {
17734
17719
  }
17735
17720
  var cookCmd = new Command17().name("cook").description("One-click agent preparation and execution from vm0.yaml");
17736
17721
  cookCmd.argument("[prompt]", "Prompt for the agent").option("-y, --yes", "Skip confirmation prompts").action(async (prompt, options) => {
17737
- const shouldExit = await checkAndUpgrade("4.35.1", prompt);
17722
+ const shouldExit = await checkAndUpgrade("4.35.3", prompt);
17738
17723
  if (shouldExit) {
17739
17724
  process.exit(0);
17740
17725
  }
@@ -18707,7 +18692,10 @@ var setCommand = new Command25().name("set").description("Set your scope slug").
18707
18692
  let existingScope;
18708
18693
  try {
18709
18694
  existingScope = await apiClient.getScope();
18710
- } catch {
18695
+ } catch (error43) {
18696
+ if (!(error43 instanceof Error) || !error43.message.includes("No scope configured")) {
18697
+ throw error43;
18698
+ }
18711
18699
  }
18712
18700
  let scope;
18713
18701
  if (existingScope) {
@@ -19362,7 +19350,7 @@ var setupGithubCommand = new Command28().name("setup-github").description("Initi
19362
19350
 
19363
19351
  // src/index.ts
19364
19352
  var program = new Command29();
19365
- program.name("vm0").description("VM0 CLI - A modern build tool").version("4.35.1");
19353
+ program.name("vm0").description("VM0 CLI - A modern build tool").version("4.35.3");
19366
19354
  program.command("info").description("Display environment information").action(async () => {
19367
19355
  console.log(chalk31.bold("System Information:"));
19368
19356
  console.log(`Node Version: ${process.version}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "4.35.1",
3
+ "version": "4.35.3",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",