@cimplify/cli 0.15.2 → 0.16.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 (120) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +2 -2
  3. package/dist/add-SXC6RUPQ.mjs +140 -0
  4. package/dist/{add-KRIIKAS4.mjs → add-XQVQLD3F.mjs} +4 -4
  5. package/dist/ai-NQH5L4I6.mjs +17 -0
  6. package/dist/{assets-CWB72PZG.mjs → assets-FZGVOQXH.mjs} +12 -7
  7. package/dist/{auth-step-up-Z6KOTTV7.mjs → auth-step-up-67LCPDNL.mjs} +5 -5
  8. package/dist/build-J4ZUIOPX.mjs +625 -0
  9. package/dist/{cancel-ZHVVILOU.mjs → cancel-VGJHZJ4J.mjs} +4 -4
  10. package/dist/capture-RAJ2B3BH.mjs +69 -0
  11. package/dist/chunk-25ZPFHLF.mjs +51 -0
  12. package/dist/chunk-47ZXSY47.mjs +52 -0
  13. package/dist/{chunk-NK6VC264.mjs → chunk-54J3XR4T.mjs} +2 -2
  14. package/dist/chunk-5HP2INMY.mjs +10631 -0
  15. package/dist/chunk-7JR6JCFF.mjs +32 -0
  16. package/dist/chunk-7PQL7E7K.mjs +68 -0
  17. package/dist/chunk-AKACUJ3W.mjs +81 -0
  18. package/dist/chunk-BYNE553A.mjs +2945 -0
  19. package/dist/{chunk-NYXA6X56.mjs → chunk-CLQYPTJ2.mjs} +31 -11
  20. package/dist/chunk-CNZAOVSK.mjs +104 -0
  21. package/dist/chunk-CPBESPWK.mjs +5576 -0
  22. package/dist/{chunk-GRR5U2M5.mjs → chunk-DYWUPHV3.mjs} +11 -7
  23. package/dist/chunk-EAV2P4N3.mjs +1941 -0
  24. package/dist/{chunk-KN2YSKXZ.mjs → chunk-EDZSOL5O.mjs} +14 -6
  25. package/dist/chunk-EGQIPYUN.mjs +696 -0
  26. package/dist/{chunk-DMLQBAGC.mjs → chunk-EOO4UOQD.mjs} +1 -1
  27. package/dist/chunk-EYEMPIMP.mjs +74 -0
  28. package/dist/chunk-G2ZEFSQJ.mjs +46 -0
  29. package/dist/{chunk-TH4XENKH.mjs → chunk-I4HNHPEM.mjs} +1 -1
  30. package/dist/chunk-JEVSFNPT.mjs +363 -0
  31. package/dist/chunk-JKECUAAV.mjs +2169 -0
  32. package/dist/chunk-KMHORI4Y.mjs +638 -0
  33. package/dist/chunk-KNPYBZ6B.mjs +502 -0
  34. package/dist/{chunk-3QUK5BPY.mjs → chunk-KOD4GBQ5.mjs} +8 -1
  35. package/dist/chunk-KQNZKV6E.mjs +535 -0
  36. package/dist/{chunk-MXYUAJEW.mjs → chunk-LLRUOIMU.mjs} +5 -2
  37. package/dist/{chunk-F2UI225N.mjs → chunk-LNMITJ4Z.mjs} +6 -6
  38. package/dist/chunk-MEM3MDV4.mjs +6463 -0
  39. package/dist/chunk-NY4YT7O6.mjs +84 -0
  40. package/dist/{chunk-A6WHBSXZ.mjs → chunk-Q6CF4C3E.mjs} +15 -13
  41. package/dist/chunk-RP66A52P.mjs +86 -0
  42. package/dist/{chunk-I2UP7YTG.mjs → chunk-SAXGWS2K.mjs} +1 -1
  43. package/dist/chunk-SCKQ4XSD.mjs +41 -0
  44. package/dist/chunk-SF44L2OD.mjs +1152 -0
  45. package/dist/chunk-SGT5IJVW.mjs +28 -0
  46. package/dist/{chunk-WEAB6HHQ.mjs → chunk-SS4JTMIV.mjs} +8 -8
  47. package/dist/chunk-T4MW3PD4.mjs +1456 -0
  48. package/dist/chunk-THATLMEX.mjs +1227 -0
  49. package/dist/{chunk-MLE4MVYC.mjs → chunk-TT4YI33G.mjs} +2 -2
  50. package/dist/chunk-TYV2SVFN.mjs +101 -0
  51. package/dist/chunk-VHK7WBO3.mjs +189 -0
  52. package/dist/chunk-VSA44UKR.mjs +391 -0
  53. package/dist/chunk-XL54SQJ3.mjs +42 -0
  54. package/dist/{chunk-5KYR6WJB.mjs → chunk-XQAHREKO.mjs} +17 -1
  55. package/dist/chunk-ZUCDXRFI.mjs +2011 -0
  56. package/dist/create-4S2EAUR3.mjs +10 -0
  57. package/dist/credits-NJOAOPPW.mjs +33 -0
  58. package/dist/{deploy-JE6TUYCL.mjs → deploy-26Y4UGZZ.mjs} +14 -14
  59. package/dist/dev-MOYURRWQ.mjs +401 -0
  60. package/dist/dev-WL43Q7VD.mjs +8 -0
  61. package/dist/dispatcher.mjs +131 -30
  62. package/dist/{doctor-HFB4IBYK.mjs → doctor-E6ETD2GJ.mjs} +12 -19
  63. package/dist/{domains-BZKGIDF4.mjs → domains-LOTQMVOR.mjs} +6 -6
  64. package/dist/engine-runtime-fetch-CIE7S7PB.mjs +10 -0
  65. package/dist/{env-FZNXKLGL.mjs → env-3PDFC5XF.mjs} +7 -7
  66. package/dist/env-MOTYOPM5.mjs +19 -0
  67. package/dist/explain-K5QEVWCD.mjs +251 -0
  68. package/dist/{inspect-X3M7WSTL.mjs → inspect-Q3E2DHYY.mjs} +3 -3
  69. package/dist/inspect-SJ4WBAXO.mjs +86 -0
  70. package/dist/introspect-7F34YN5V.mjs +9 -0
  71. package/dist/kernel-DEGWMHFL.mjs +662 -0
  72. package/dist/kernel-plugin.js +6862 -0
  73. package/dist/keys-W5SN3DPK.mjs +71 -0
  74. package/dist/lines-XGJYTQ7P.mjs +56 -0
  75. package/dist/{link-4NM2QMI5.mjs → link-NKUAVNM2.mjs} +6 -5
  76. package/dist/{lint-DDZ7HUQN.mjs → lint-G4YPQSSO.mjs} +2 -2
  77. package/dist/{list-2MFOQKKQ.mjs → list-TDR7K2JB.mjs} +3 -3
  78. package/dist/lock-EJPW2LM3.mjs +57 -0
  79. package/dist/{login-RLMDEWAL.mjs → login-AYLU7JU7.mjs} +10 -8
  80. package/dist/{logout-Z57X6HPE.mjs → logout-3M6VMHLH.mjs} +2 -2
  81. package/dist/{logs-36BLYJHJ.mjs → logs-4EL5SOXN.mjs} +5 -5
  82. package/dist/logs-4QQGG2XY.mjs +44 -0
  83. package/dist/mcp-4R2R6E5M.mjs +1077 -0
  84. package/dist/{mock-EVER34IX.mjs → mock-AK24GSP2.mjs} +2 -2
  85. package/dist/outdated-JEKCVLTG.mjs +58 -0
  86. package/dist/port-SBZ7X3EH.mjs +2408 -0
  87. package/dist/{projects-4XRNHJAH.mjs → projects-7JKTC5WJ.mjs} +9 -7
  88. package/dist/publish-QQCX47HK.mjs +20 -0
  89. package/dist/remix-NLLYD3BI.mjs +125 -0
  90. package/dist/repo-Z4G4EW3N.mjs +9 -0
  91. package/dist/report-M7F4ZYP7.mjs +2 -0
  92. package/dist/rollback-2WQ2CW7T.mjs +43 -0
  93. package/dist/{rollback-WCRWXSE3.mjs → rollback-ZGU32HGT.mjs} +6 -6
  94. package/dist/scene-HXARHUM7.mjs +324 -0
  95. package/dist/{status-VA326DWD.mjs → status-C3ZSLZ7Q.mjs} +5 -5
  96. package/dist/status-WEQOC25K.mjs +18 -0
  97. package/dist/test-ZPBWV4VX.mjs +233 -0
  98. package/dist/testers-A3LMXOJJ.mjs +49 -0
  99. package/dist/{unlink-H3BO3DOQ.mjs → unlink-4G4FE4RJ.mjs} +2 -2
  100. package/dist/{update-YYOTN7MG.mjs → update-GHKKM5FS.mjs} +4 -4
  101. package/dist/{whoami-CQPPARRS.mjs → whoami-3QQN6G2A.mjs} +3 -3
  102. package/dist/workshop-CD74D2LK.mjs +1703 -0
  103. package/package.json +11 -7
  104. package/templates/storefront-auto/app/products/[slug]/page.tsx +1 -1
  105. package/templates/storefront-auto/package.json +1 -1
  106. package/templates/storefront-bakery/package.json +1 -1
  107. package/templates/storefront-fashion/app/products/[slug]/page.tsx +1 -1
  108. package/templates/storefront-fashion/package.json +1 -1
  109. package/templates/storefront-grocery/package.json +1 -1
  110. package/templates/storefront-pharmacy/app/products/[slug]/page.tsx +1 -1
  111. package/templates/storefront-pharmacy/package.json +1 -1
  112. package/templates/storefront-restaurant/package.json +1 -1
  113. package/templates/storefront-retail/app/products/[slug]/page.tsx +1 -1
  114. package/templates/storefront-retail/package.json +1 -1
  115. package/templates/storefront-services/package.json +1 -1
  116. package/dist/chunk-ARIDYKLO.mjs +0 -6463
  117. package/dist/dev-V7JSUVOI.mjs +0 -8
  118. package/dist/explain-O5AC73EE.mjs +0 -251
  119. package/dist/introspect-2NGESQZE.mjs +0 -8
  120. package/dist/repo-X3KZ5R64.mjs +0 -9
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Cimplify Technologies LLC
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -17,7 +17,7 @@ Override the destination with `--prefix`, pin a version with `--version cli-v0.1
17
17
  ```bash
18
18
  cimplify init my-store --template restaurant # scaffold a working storefront
19
19
  cimplify login # browser PKCE flow (or --api-key for CI)
20
- cimplify projects create my-store # create a Cimplify project + Freestyle repo
20
+ cimplify projects create my-store # create a Cimplify project + managed repo
21
21
  cimplify link <project-id> # bind the current directory to a project
22
22
  cimplify deploy [--prod] # push HEAD + build + deploy
23
23
  cimplify logs --follow # stream build logs
@@ -43,7 +43,7 @@ cimplify lint --fix --format json # safe fixes + stable machine-re
43
43
 
44
44
  Every cloud command is a thin HTTP client over `https://api.cimplify.io` (override with `CIMPLIFY_CLI_API_URL` — not `CIMPLIFY_API_URL`, which is the SDK's storefront-API variable). The deploy flow specifically:
45
45
 
46
- 1. `git push` to the project's git remote (uses a short-TTL token minted by Cimplify when the remote is Freestyle-hosted; falls back to your existing git auth otherwise).
46
+ 1. `git push` to the project's git remote (uses a short-TTL token minted by Cimplify when the remote is the managed code.storage host; falls back to your existing git auth otherwise).
47
47
  2. `POST /v1/businesses/<bid>/projects/<pid>/deploy` with the local SHA.
48
48
  3. Poll `/deployments/<id>/progress` every 1 second, printing log chunks as they arrive.
49
49
  4. Exit 0 on `active`, 2 on `superseded`, 1 on `failed` / `cancelled`.
@@ -0,0 +1,140 @@
1
+ #!/usr/bin/env node
2
+ import { contentRemoteFromEnv } from './chunk-RP66A52P.mjs';
3
+ import { contentDirectory, parseLibraryVersion, variantFor, richerVariants, requireInteractiveProject } from './chunk-CPBESPWK.mjs';
4
+ import './chunk-VHK7WBO3.mjs';
5
+ import './chunk-5HP2INMY.mjs';
6
+ import './chunk-JKECUAAV.mjs';
7
+ import { isItemReference, MANIFEST_FILE, parseManifest, LOCKFILE, parseLockfile, currentLockfile, serializeLockfile, withContent } from './chunk-T4MW3PD4.mjs';
8
+ import './chunk-KQNZKV6E.mjs';
9
+ import './chunk-ZUCDXRFI.mjs';
10
+ import './chunk-EYEMPIMP.mjs';
11
+ import './chunk-AKACUJ3W.mjs';
12
+ import { sha256 } from './chunk-25ZPFHLF.mjs';
13
+ import './chunk-SGT5IJVW.mjs';
14
+ import { parseArgs, flagString } from './chunk-XQAHREKO.mjs';
15
+ import './chunk-CLQYPTJ2.mjs';
16
+ import './chunk-TT4YI33G.mjs';
17
+ import { CliError, CLI_ERROR_CODE, info, dim, success, result } from './chunk-KOD4GBQ5.mjs';
18
+ import { promises, existsSync } from 'fs';
19
+ import path from 'path';
20
+
21
+ var USAGE = "usage: cimplify add <owner>/<item>[@<range>] [more items] [--licence free|free_attribution] [--group <asset group>]";
22
+ var RANGE_SEPARATOR = "@";
23
+ var ANY_RANGE = "*";
24
+ var FREE_LICENCES = ["free", "free_attribution"];
25
+ function parseAddRequests(positional) {
26
+ if (positional.length === 0) throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, USAGE);
27
+ return positional.map((raw) => {
28
+ const at = raw.indexOf(RANGE_SEPARATOR);
29
+ const item = at < 0 ? raw : raw.slice(0, at);
30
+ const range = at < 0 ? ANY_RANGE : raw.slice(at + 1);
31
+ if (!isItemReference(item) || range.length === 0) {
32
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `'${raw}' is not a Workshop reference; ${USAGE}`);
33
+ }
34
+ return { item, range };
35
+ });
36
+ }
37
+ function chooseOffer(version, wanted) {
38
+ if (wanted !== null) {
39
+ const offer = version.offers.find((o) => o.kind === wanted);
40
+ if (offer === void 0) {
41
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${version.item} is not offered under the ${wanted} licence; it offers ${version.offers.map((o) => o.kind).join(", ")}`);
42
+ }
43
+ if (!FREE_LICENCES.includes(offer.kind)) {
44
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${version.item} under ${offer.kind} is bought on Workshop; buying from the CLI is not open yet`);
45
+ }
46
+ return offer;
47
+ }
48
+ for (const kind of FREE_LICENCES) {
49
+ const offer = version.offers.find((o) => o.kind === kind);
50
+ if (offer !== void 0) return offer;
51
+ }
52
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${version.item} has no free licence; get it on Workshop first`);
53
+ }
54
+ function contentBlock(request, version, group) {
55
+ const pinned = request.range === ANY_RANGE ? `^${version}` : request.range;
56
+ const groupLine = group === null ? "" : `group = ${JSON.stringify(group)}
57
+ `;
58
+ return `
59
+ [[content]]
60
+ item = ${JSON.stringify(request.item)}
61
+ version = ${JSON.stringify(pinned)}
62
+ ${groupLine}`;
63
+ }
64
+ async function download(remote, dir, digest) {
65
+ const target = path.join(dir, digest);
66
+ if (existsSync(target)) {
67
+ const cached = await promises.readFile(target);
68
+ if (sha256(cached) === digest) return cached;
69
+ }
70
+ const bytes = await remote.blob(digest);
71
+ await promises.writeFile(target, bytes);
72
+ return bytes;
73
+ }
74
+ async function addContent(root, remote, requests, options) {
75
+ const manifestPath = path.join(root, MANIFEST_FILE);
76
+ const manifestText = await promises.readFile(manifestPath, "utf8");
77
+ const parsed = parseManifest(manifestText, MANIFEST_FILE);
78
+ if (parsed.manifest === null) {
79
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${MANIFEST_FILE} has errors; run cimplify build to see them`);
80
+ }
81
+ const manifest = parsed.manifest;
82
+ if (options.group !== null && !manifest.delivery.groups.some((g) => g.name === options.group)) {
83
+ throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `--group ${options.group} is not one of the [[delivery.groups]]`);
84
+ }
85
+ const lockPath = path.join(root, LOCKFILE);
86
+ const lock = existsSync(lockPath) ? parseLockfile(await promises.readFile(lockPath, "utf8")).lockfile : currentLockfile();
87
+ if (lock === null) throw new CliError(CLI_ERROR_CODE.INVALID_INPUT, `${LOCKFILE} has errors; fix it before adding content`);
88
+ const resolved = await remote.resolve(requests.map((r) => ({ item: r.item, range: r.range })));
89
+ const dir = contentDirectory(root);
90
+ await promises.mkdir(dir, { recursive: true });
91
+ const added = [];
92
+ let downloaded = 0;
93
+ for (const version of resolved) {
94
+ const offer = chooseOffer(version, version.requested ? options.licence : null);
95
+ const manifestBytes = await download(remote, dir, version.version_digest);
96
+ const library = parseLibraryVersion(manifestBytes);
97
+ if (library === null || library.item !== version.item) {
98
+ throw new CliError(CLI_ERROR_CODE.NETWORK_ERROR, `Workshop returned a damaged version manifest for ${version.item}`);
99
+ }
100
+ const variant = variantFor(library, manifest.delivery.minDeviceTier);
101
+ const wanted = [...variant?.files ?? []];
102
+ if (manifest.delivery.tierGroups === true) {
103
+ for (const [, richer] of richerVariants(library, manifest.delivery.minDeviceTier)) wanted.push(...richer.files);
104
+ }
105
+ const fetched = /* @__PURE__ */ new Set();
106
+ for (const file of wanted) {
107
+ if (fetched.has(file.chunk)) continue;
108
+ fetched.add(file.chunk);
109
+ await download(remote, dir, file.chunk);
110
+ downloaded += 1;
111
+ }
112
+ added.push({ item: version.item, version: version.version, versionDigest: version.version_digest, licence: offer.kind, terms: offer.terms });
113
+ }
114
+ await promises.writeFile(lockPath, serializeLockfile(withContent(lock, added)));
115
+ const listed = new Set((manifest.content ?? []).map((c) => c.item));
116
+ let appended = manifestText.endsWith("\n") ? manifestText : `${manifestText}
117
+ `;
118
+ for (const request of requests) {
119
+ if (listed.has(request.item)) continue;
120
+ const version = resolved.find((v) => v.item === request.item);
121
+ appended += contentBlock(request, version?.version ?? "0.0.0", options.group);
122
+ }
123
+ if (appended !== manifestText) await promises.writeFile(manifestPath, appended);
124
+ return { added, downloaded };
125
+ }
126
+ async function run(argv) {
127
+ const args = parseArgs(argv);
128
+ const requests = parseAddRequests(args.positional);
129
+ const root = process.cwd();
130
+ requireInteractiveProject(root, "add");
131
+ const outcome = await addContent(root, await contentRemoteFromEnv(), requests, {
132
+ licence: flagString(args, "licence") ?? null,
133
+ group: flagString(args, "group") ?? null
134
+ });
135
+ for (const entry of outcome.added) info(`${entry.item} ${entry.version} ${dim(`(${entry.licence})`)}`);
136
+ success(`Added ${outcome.added.length} Workshop item${outcome.added.length === 1 ? "" : "s"}; ${outcome.downloaded} chunk${outcome.downloaded === 1 ? "" : "s"} cached in .cimplify/content`);
137
+ result(outcome);
138
+ }
139
+
140
+ export { addContent, run as default, parseAddRequests };
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { promptYesNo } from './chunk-TH4XENKH.mjs';
3
- import { REGISTRY_INDEX, REGISTRY } from './chunk-ARIDYKLO.mjs';
4
- import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
5
- import { CliError, CLI_ERROR_CODE, info, bold, dim, success, result, yellow } from './chunk-3QUK5BPY.mjs';
2
+ import { promptYesNo } from './chunk-I4HNHPEM.mjs';
3
+ import { REGISTRY_INDEX, REGISTRY } from './chunk-MEM3MDV4.mjs';
4
+ import { parseArgs, flagString, flagBool } from './chunk-XQAHREKO.mjs';
5
+ import { CliError, CLI_ERROR_CODE, info, bold, dim, success, result, yellow } from './chunk-KOD4GBQ5.mjs';
6
6
  import { mkdirSync, existsSync, writeFileSync } from 'fs';
7
7
  import { resolve, join, dirname } from 'path';
8
8
 
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env node
2
+ export { run as default, describeEvent, describeTurnLines, reportOutcome } from './chunk-7PQL7E7K.mjs';
3
+ import './chunk-NY4YT7O6.mjs';
4
+ import './chunk-CPBESPWK.mjs';
5
+ import './chunk-VHK7WBO3.mjs';
6
+ import './chunk-5HP2INMY.mjs';
7
+ import './chunk-JKECUAAV.mjs';
8
+ import './chunk-T4MW3PD4.mjs';
9
+ import './chunk-KQNZKV6E.mjs';
10
+ import './chunk-ZUCDXRFI.mjs';
11
+ import './chunk-EYEMPIMP.mjs';
12
+ import './chunk-AKACUJ3W.mjs';
13
+ import './chunk-25ZPFHLF.mjs';
14
+ import './chunk-SGT5IJVW.mjs';
15
+ import './chunk-XQAHREKO.mjs';
16
+ import './chunk-TT4YI33G.mjs';
17
+ import './chunk-KOD4GBQ5.mjs';
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env node
2
- import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
3
- import { ApiClient } from './chunk-NYXA6X56.mjs';
4
- import { readAuth } from './chunk-MLE4MVYC.mjs';
5
- import { CliError, CLI_ERROR_CODE, step, yellow, dim, success, info, result, bold, green } from './chunk-3QUK5BPY.mjs';
2
+ import { parseArgs, flagString, flagBool } from './chunk-XQAHREKO.mjs';
3
+ import { ApiClient } from './chunk-CLQYPTJ2.mjs';
4
+ import { readAuth } from './chunk-TT4YI33G.mjs';
5
+ import { CliError, CLI_ERROR_CODE, step, yellow, dim, success, info, result, bold, green } from './chunk-KOD4GBQ5.mjs';
6
6
  import { createHash } from 'crypto';
7
7
  import { promises } from 'fs';
8
8
  import path from 'path';
@@ -60,6 +60,7 @@ function mimeOf(filename) {
60
60
  const ext = path.extname(filename).toLowerCase();
61
61
  return MIME_BY_EXT[ext] ?? CONTENT_TYPE_FALLBACK;
62
62
  }
63
+ var CONTENT_SHA256_HEADER = "x-amz-checksum-sha256";
63
64
  function sha256Hex(buf) {
64
65
  return createHash("sha256").update(buf).digest("hex");
65
66
  }
@@ -138,12 +139,16 @@ async function runUpload(args) {
138
139
  folder: subfolder,
139
140
  filename,
140
141
  content_type: contentType,
141
- size_bytes: buf.byteLength
142
+ size_bytes: buf.byteLength,
143
+ content_sha256: hash
142
144
  });
143
145
  step(`${dim("\u2192")} ${keyForManifest} ${dim(`(${buf.byteLength} bytes)`)}`);
144
146
  const putRes = await fetch(init.upload_url, {
145
147
  method: "PUT",
146
- headers: { "content-type": contentType },
148
+ headers: {
149
+ "content-type": contentType,
150
+ [CONTENT_SHA256_HEADER]: Buffer.from(hash, "hex").toString("base64")
151
+ },
147
152
  body: buf
148
153
  });
149
154
  if (!putRes.ok) {
@@ -254,4 +259,4 @@ async function runRm(args) {
254
259
  result({ removed_upload_id: uploadId, removed_key: resolvedKey });
255
260
  }
256
261
 
257
- export { run as default, endpointAsset, endpointConfirm, endpointInit, endpointList, mimeOf, readManifest, sha256Hex, walkFiles, writeManifest };
262
+ export { CONTENT_SHA256_HEADER, run as default, endpointAsset, endpointConfirm, endpointInit, endpointList, mimeOf, readManifest, sha256Hex, walkFiles, writeManifest };
@@ -1,9 +1,9 @@
1
1
  #!/usr/bin/env node
2
- import { startLoopbackServer, generateState, generatePkcePair, openBrowser } from './chunk-DMLQBAGC.mjs';
3
- import { parseArgs, flagString, flagBool } from './chunk-5KYR6WJB.mjs';
4
- import { resolveBaseUrl, ApiClient } from './chunk-NYXA6X56.mjs';
5
- import { readAuth, writeStepUp } from './chunk-MLE4MVYC.mjs';
6
- import { isJsonMode, CliError, CLI_ERROR_CODE, step, info, dim, success, result } from './chunk-3QUK5BPY.mjs';
2
+ import { startLoopbackServer, generateState, generatePkcePair, openBrowser } from './chunk-EOO4UOQD.mjs';
3
+ import { parseArgs, flagString, flagBool } from './chunk-XQAHREKO.mjs';
4
+ import { resolveBaseUrl, ApiClient } from './chunk-CLQYPTJ2.mjs';
5
+ import { readAuth, writeStepUp } from './chunk-TT4YI33G.mjs';
6
+ import { isJsonMode, CliError, CLI_ERROR_CODE, step, info, dim, success, result } from './chunk-KOD4GBQ5.mjs';
7
7
 
8
8
  // src/commands/auth-step-up.ts
9
9
  var FLAG_NO_BROWSER = "no-browser";