@cargo-ai/cli 1.0.27 → 1.0.28

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.
@@ -1 +1 @@
1
- {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/deployment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CA6JN"}
1
+ {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../../src/commands/hosting/deployment.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEzC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGxC,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,MAAM,GAAG,GAChB,IAAI,CAoMN"}
@@ -89,6 +89,28 @@ export function registerDeploymentCommands(parent, getApi) {
89
89
  stats: { fileCount: files.length },
90
90
  });
91
91
  });
92
+ deployment
93
+ .command("export <uuid>")
94
+ .description("Download a deployment's uploaded source (the pre-build project tree, not the compiled bundle) as a tar.gz")
95
+ .option("--output <file>", "Path of the tar.gz to write (default: ./deployment-<uuid>-source.tar.gz)")
96
+ .action(async (uuid, opts) => {
97
+ const api = getApi();
98
+ const { url } = await handleApiCall(() => api.hosting.deployment.getSourceArchiveUrl({ uuid }));
99
+ // Pre-signed S3 URL: plain fetch, no Cargo auth headers.
100
+ const response = await fetch(url);
101
+ if (response.ok === false) {
102
+ console.error(JSON.stringify({
103
+ error: `Failed to download source archive: HTTP ${response.status}`,
104
+ }));
105
+ process.exit(1);
106
+ }
107
+ const outputFile = path.resolve(opts.output !== undefined
108
+ ? opts.output
109
+ : `deployment-${uuid}-source.tar.gz`);
110
+ await fs.mkdir(path.dirname(outputFile), { recursive: true });
111
+ await fs.writeFile(outputFile, Buffer.from(await response.arrayBuffer()));
112
+ outputJson({ outputFile });
113
+ });
92
114
  deployment
93
115
  .command("promote")
94
116
  .description("Promote a deployment to the live URL")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cargo-ai/cli",
3
- "version": "1.0.27",
3
+ "version": "1.0.28",
4
4
  "private": false,
5
5
  "license": "UNLICENSED",
6
6
  "description": "Command-line interface for the Cargo API",
@@ -29,7 +29,7 @@
29
29
  "format:check": "prettier --check ."
30
30
  },
31
31
  "dependencies": {
32
- "@cargo-ai/api": "^1.0.37",
32
+ "@cargo-ai/api": "^1.0.39",
33
33
  "@cargo-ai/app-sdk": "^1.0.3",
34
34
  "@cargo-ai/cdk": "*",
35
35
  "@cargo-ai/worker-sdk": "^1.0.6",