@vm0/cli 4.14.0 → 4.14.1

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 +20 -7
  2. package/package.json +1 -1
package/index.js CHANGED
@@ -1011,7 +1011,6 @@ async function directUpload(storageName, storageType, cwd, options) {
1011
1011
  const files = await getAllFiles(cwd);
1012
1012
  onProgress?.("Computing file hashes...");
1013
1013
  const fileEntries = await collectFileMetadata(cwd, files, onProgress);
1014
- const totalSize = fileEntries.reduce((sum, f) => sum + f.size, 0);
1015
1014
  onProgress?.("Preparing upload...");
1016
1015
  const prepareResponse = await apiClient.post("/api/storages/prepare", {
1017
1016
  body: JSON.stringify({
@@ -1027,12 +1026,26 @@ async function directUpload(storageName, storageType, cwd, options) {
1027
1026
  }
1028
1027
  const prepareResult = await prepareResponse.json();
1029
1028
  if (prepareResult.existing) {
1029
+ onProgress?.("Version exists, updating HEAD...");
1030
+ const commitResponse2 = await apiClient.post("/api/storages/commit", {
1031
+ body: JSON.stringify({
1032
+ storageName,
1033
+ storageType,
1034
+ versionId: prepareResult.versionId,
1035
+ files: fileEntries
1036
+ })
1037
+ });
1038
+ if (!commitResponse2.ok) {
1039
+ const error43 = await commitResponse2.json();
1040
+ throw new Error(error43.error?.message || "Commit failed");
1041
+ }
1042
+ const commitResult2 = await commitResponse2.json();
1030
1043
  return {
1031
- versionId: prepareResult.versionId,
1032
- size: totalSize,
1033
- fileCount: fileEntries.length,
1044
+ versionId: commitResult2.versionId,
1045
+ size: commitResult2.size,
1046
+ fileCount: commitResult2.fileCount,
1034
1047
  deduplicated: true,
1035
- empty: fileEntries.length === 0
1048
+ empty: commitResult2.fileCount === 0
1036
1049
  };
1037
1050
  }
1038
1051
  if (files.length > 0) {
@@ -16118,7 +16131,7 @@ async function generateEnvPlaceholders(missingVars, envFilePath) {
16118
16131
  }
16119
16132
  }
16120
16133
  var cookCommand = new Command13().name("cook").description("One-click agent preparation and execution from vm0.yaml").argument("[prompt]", "Prompt for the agent").action(async (prompt) => {
16121
- const shouldExit = await checkAndUpgrade("4.14.0", prompt);
16134
+ const shouldExit = await checkAndUpgrade("4.14.1", prompt);
16122
16135
  if (shouldExit) {
16123
16136
  process.exit(0);
16124
16137
  }
@@ -16755,7 +16768,7 @@ function handleError(error43, runId) {
16755
16768
 
16756
16769
  // src/index.ts
16757
16770
  var program = new Command19();
16758
- program.name("vm0").description("VM0 CLI - A modern build tool").version("4.14.0");
16771
+ program.name("vm0").description("VM0 CLI - A modern build tool").version("4.14.1");
16759
16772
  program.command("info").description("Display environment information").action(async () => {
16760
16773
  console.log(chalk20.cyan("System Information:"));
16761
16774
  console.log(`Node Version: ${process.version}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vm0/cli",
3
- "version": "4.14.0",
3
+ "version": "4.14.1",
4
4
  "description": "CLI application",
5
5
  "repository": {
6
6
  "type": "git",