vercel 58.0.0 → 58.3.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 (108) hide show
  1. package/dist/chunks/{add-E4KH6P4A.js → add-3RKTVRL7.js} +10 -8
  2. package/dist/chunks/{add-7PPD4ZUJ.js → add-X634O3US.js} +14 -9
  3. package/dist/chunks/add-YTFWON7N.js +187 -0
  4. package/dist/chunks/build-DJIDUWYB.js +243 -0
  5. package/dist/chunks/{chunk-DWMH5M4Q.js → chunk-2SFMOCWR.js} +1 -1
  6. package/dist/chunks/{chunk-3PKFXNJZ.js → chunk-3KNPVXJ3.js} +7 -5
  7. package/dist/chunks/chunk-3ZE5CFVM.js +346 -0
  8. package/dist/chunks/{chunk-FHEMFAHB.js → chunk-4LDQIDRM.js} +15 -9
  9. package/dist/chunks/{chunk-R5FOIIHT.js → chunk-4N7XLXM2.js} +2 -2
  10. package/dist/chunks/{chunk-KCF6S3XF.js → chunk-4UYKSYKQ.js} +10 -6
  11. package/dist/chunks/{chunk-AZTV7WPZ.js → chunk-5YXUTGSY.js} +1 -1
  12. package/dist/chunks/{chunk-MDQJLTGN.js → chunk-752Z4JQP.js} +1 -1
  13. package/dist/chunks/{chunk-OGG6UBXK.js → chunk-7QVJTI5H.js} +1 -1
  14. package/dist/chunks/{chunk-FYQPTH5C.js → chunk-A5KP5HAI.js} +7 -5
  15. package/dist/chunks/{chunk-3VS4DTAU.js → chunk-AW5YINX6.js} +106 -12
  16. package/dist/chunks/{chunk-BYQQLGCT.js → chunk-AZNCOIGT.js} +2 -2
  17. package/dist/chunks/{chunk-GIL3VAUR.js → chunk-B3JTF4CF.js} +5 -3
  18. package/dist/chunks/{chunk-4QVAYRYH.js → chunk-BEQV3X2L.js} +16 -1
  19. package/dist/chunks/{chunk-TPX7RZBM.js → chunk-BM5FP7VW.js} +9 -5
  20. package/dist/chunks/{chunk-WDE2EDYX.js → chunk-C33L5ZKY.js} +4 -4
  21. package/dist/chunks/{chunk-VUESC3YO.js → chunk-C6BDHNNF.js} +207 -4
  22. package/dist/chunks/{chunk-4G6QZSBL.js → chunk-CSJBZKC5.js} +6 -4
  23. package/dist/chunks/{chunk-TEWJ7TIW.js → chunk-D3EEVTWR.js} +2 -2
  24. package/dist/chunks/{chunk-3PGXYIKC.js → chunk-EBLH23AQ.js} +2 -2
  25. package/dist/chunks/{chunk-YA3WQFLY.js → chunk-GFG6QDIE.js} +1 -1
  26. package/dist/chunks/{chunk-FB4UFWEC.js → chunk-IH5JOYGQ.js} +4 -4
  27. package/dist/chunks/chunk-J6LK45HT.js +163 -0
  28. package/dist/chunks/{chunk-FYR7WEUJ.js → chunk-JID5CRQL.js} +3 -3
  29. package/dist/chunks/{chunk-ZVLPUREX.js → chunk-JLWQWYKO.js} +2 -2
  30. package/dist/chunks/{chunk-SZXT3PDQ.js → chunk-KBEX5MYS.js} +1 -136
  31. package/dist/chunks/{chunk-NZRWTCRM.js → chunk-KT4XXKJK.js} +1 -1
  32. package/dist/chunks/{chunk-VZSZBD4V.js → chunk-M22O6CYY.js} +1 -1
  33. package/dist/chunks/{chunk-2MJROFVC.js → chunk-MAHXF73X.js} +8 -5
  34. package/dist/chunks/{chunk-YZMZCQP3.js → chunk-MTW6MVY7.js} +10 -8
  35. package/dist/chunks/{chunk-ZMVFTCQF.js → chunk-NVSQ6KXI.js} +1 -1
  36. package/dist/chunks/{chunk-LHFNIZ2P.js → chunk-O5GNPPTU.js} +4 -2
  37. package/dist/chunks/{chunk-KGVT2RSG.js → chunk-OTQD3MHJ.js} +5 -11
  38. package/dist/chunks/{chunk-RSCSALZH.js → chunk-PNXQB4IO.js} +6 -5
  39. package/dist/chunks/{chunk-L4WYMJB3.js → chunk-QZV24TDR.js} +28 -12
  40. package/dist/chunks/chunk-RBIFXFZX.js +52 -0
  41. package/dist/chunks/{chunk-OF2GNB42.js → chunk-RQ7H43CJ.js} +1 -1
  42. package/dist/chunks/{chunk-EA22NMFU.js → chunk-RUOBMMEA.js} +2 -2
  43. package/dist/chunks/{chunk-KSSNLCL4.js → chunk-SOFC4MLS.js} +2 -2
  44. package/dist/chunks/{chunk-R54DAHCL.js → chunk-UDDCOV62.js} +2 -2
  45. package/dist/chunks/{chunk-OQGN4TEC.js → chunk-UJNNTGJY.js} +3 -3
  46. package/dist/chunks/{chunk-DGFASMSE.js → chunk-UQJMDWCY.js} +7 -5
  47. package/dist/chunks/{chunk-B2MTCHPO.js → chunk-WXJ6E3MY.js} +6 -4
  48. package/dist/chunks/{chunk-QZD5DKUR.js → chunk-XIG4GH62.js} +2 -2
  49. package/dist/chunks/chunk-XLKFJPMT.js +150 -0
  50. package/dist/chunks/{chunk-UDWRZXIT.js → chunk-Z5ZQJ5VJ.js} +15 -14
  51. package/dist/chunks/{chunk-WANVKOVB.js → chunk-ZPH66MB6.js} +808 -538
  52. package/dist/chunks/{chunk-DMSLNAVH.js → chunk-ZX2FSPWV.js} +2 -2
  53. package/dist/chunks/clear-J3OCB2DQ.js +132 -0
  54. package/dist/chunks/{compile-vercel-config-G2IVBXEI.js → compile-vercel-config-G2WILJR4.js} +5 -4
  55. package/dist/chunks/{delete-2EIVGM6P.js → delete-3NQLU7PQ.js} +7 -6
  56. package/dist/chunks/{delete-E6ZQNE5X.js → delete-HKUZTZE7.js} +7 -6
  57. package/dist/chunks/{disable-M3Q6BBB7.js → disable-7AIA4JV3.js} +7 -6
  58. package/dist/chunks/{discard-3R6ETBPS.js → discard-MIGUGPGO.js} +7 -6
  59. package/dist/chunks/{edit-7JUDPVXD.js → edit-3AU746TG.js} +8 -7
  60. package/dist/chunks/{edit-ICVMGRRU.js → edit-MDQW3S4R.js} +7 -6
  61. package/dist/chunks/{enable-HLTA35QL.js → enable-EGNWRQEI.js} +7 -6
  62. package/dist/chunks/{export-E6XZUFW3.js → export-EMBHNUMU.js} +7 -6
  63. package/dist/chunks/{image-SIRPPQZT.js → image-XXZ5DRIW.js} +5 -5
  64. package/dist/chunks/{inspect-6TQWDIBG.js → inspect-7V5ZHBBB.js} +13 -11
  65. package/dist/chunks/{inspect-65YX7L3O.js → inspect-MYUNZMLJ.js} +14 -12
  66. package/dist/chunks/{inspect-NFOURIGN.js → inspect-O7SVDBHM.js} +16 -13
  67. package/dist/chunks/{inspect-OEWWGAHZ.js → inspect-S5WJ47OH.js} +8 -7
  68. package/dist/chunks/{inspect-4FYBOOM5.js → inspect-TXVTHRAZ.js} +14 -12
  69. package/dist/chunks/{list-APFMKZJO.js → list-BQLJJACX.js} +13 -11
  70. package/dist/chunks/{list-27DCGMBI.js → list-LC2ON7OM.js} +8 -6
  71. package/dist/chunks/{list-XQCZVLES.js → list-NZ4ZOO6B.js} +8 -7
  72. package/dist/chunks/{login-FMU4CQOV.js → login-4B7KPSUW.js} +22 -51
  73. package/dist/chunks/ls-4J2WGR7U.js +178 -0
  74. package/dist/chunks/{ls-BFACWH6C.js → ls-7XMM4KCU.js} +17 -14
  75. package/dist/chunks/{ls-24BRCAZR.js → ls-FRSKR6K2.js} +15 -13
  76. package/dist/chunks/{ls-3L6EN4YU.js → ls-TWNQ7KZN.js} +13 -11
  77. package/dist/chunks/{ls-T5RGDBCV.js → ls-WCTLFAPI.js} +15 -13
  78. package/dist/chunks/{open-AG3VYJZM.js → open-J4SAVWUP.js} +7 -6
  79. package/dist/chunks/permissions-67T43WNH.js +95 -0
  80. package/dist/chunks/{publish-5OVCPS4J.js → publish-CSXOTJLD.js} +7 -6
  81. package/dist/chunks/push-7KOVRV5N.js +183 -0
  82. package/dist/chunks/{query-QS4VKBXJ.js → query-CTRPYYXR.js} +12 -10
  83. package/dist/chunks/{reorder-B5V2P7YM.js → reorder-E4PPJNEX.js} +7 -6
  84. package/dist/chunks/{reply-JBLWE6RS.js → reply-Z742BMF3.js} +7 -6
  85. package/dist/chunks/{resolve-2I6XH2G3.js → resolve-KPZJZ6IQ.js} +7 -6
  86. package/dist/chunks/{restore-O63FZXCL.js → restore-ZTH2FY4I.js} +7 -6
  87. package/dist/chunks/{rm-P3NJSCMY.js → rm-C4ODJDWP.js} +12 -8
  88. package/dist/chunks/{rm-N7W3QYWZ.js → rm-DE37CFKU.js} +15 -10
  89. package/dist/chunks/{rm-HUED5R3Q.js → rm-FVGLSIHP.js} +10 -8
  90. package/dist/chunks/rm-VOFJM4XW.js +186 -0
  91. package/dist/chunks/{rule-inspect-M3QUSPU2.js → rule-inspect-6RLS3ZNB.js} +13 -11
  92. package/dist/chunks/{rules-NSSWPJ2B.js → rules-VSXJT2QE.js} +8 -8
  93. package/dist/chunks/{schema-G2PAXPVA.js → schema-3E24G2AG.js} +11 -9
  94. package/dist/chunks/{tags-JFMO63D4.js → tags-AIZLNITP.js} +4 -4
  95. package/dist/chunks/{types-QKLIFDDP.js → types-QTOA2BTQ.js} +7 -5
  96. package/dist/chunks/{update-VJCKD6YG.js → update-QHWT7YG4.js} +10 -8
  97. package/dist/commands/build/index.js +15 -19
  98. package/dist/commands/deploy/index.js +33 -25
  99. package/dist/commands/dev/index.js +85 -17
  100. package/dist/commands/env/index.js +32 -24
  101. package/dist/commands/link/index.js +25 -22
  102. package/dist/commands/list/index.js +16 -9
  103. package/dist/commands-bulk.js +4171 -2411
  104. package/dist/help.js +1 -1
  105. package/dist/index.js +38 -34
  106. package/dist/version.mjs +1 -1
  107. package/package.json +43 -94
  108. package/dist/chunks/chunk-6OMC3HOW.js +0 -73
@@ -9,31 +9,33 @@ import {
9
9
  handleRulesApiError,
10
10
  parseRulesFlagsAndScope,
11
11
  rulesCollectionPath
12
- } from "./chunk-R54DAHCL.js";
13
- import "./chunk-FYR7WEUJ.js";
12
+ } from "./chunk-UDDCOV62.js";
13
+ import "./chunk-JID5CRQL.js";
14
14
  import "./chunk-BUZRVER7.js";
15
15
  import {
16
16
  validateJsonOutput
17
17
  } from "./chunk-XPKWKPWA.js";
18
18
  import {
19
19
  rulesAddSubcommand
20
- } from "./chunk-KCF6S3XF.js";
21
- import "./chunk-TPX7RZBM.js";
20
+ } from "./chunk-4UYKSYKQ.js";
21
+ import "./chunk-BM5FP7VW.js";
22
22
  import "./chunk-ECCWJHC6.js";
23
23
  import {
24
24
  AGENT_REASON,
25
25
  buildCommandWithGlobalFlags,
26
26
  outputAgentError
27
- } from "./chunk-UDWRZXIT.js";
27
+ } from "./chunk-Z5ZQJ5VJ.js";
28
28
  import {
29
- parseArguments,
30
29
  printError
31
- } from "./chunk-SZXT3PDQ.js";
30
+ } from "./chunk-KBEX5MYS.js";
31
+ import {
32
+ parseArguments
33
+ } from "./chunk-XLKFJPMT.js";
32
34
  import {
33
35
  getFlagsSpecification,
34
36
  isAPIError,
35
37
  packageName
36
- } from "./chunk-KSSNLCL4.js";
38
+ } from "./chunk-SOFC4MLS.js";
37
39
  import "./chunk-P4QNYOFB.js";
38
40
  import "./chunk-52QYYTM5.js";
39
41
  import {
@@ -9,32 +9,37 @@ import {
9
9
  handleVcrApiError,
10
10
  resolveVcrScope,
11
11
  validateVcrJsonOutput
12
- } from "./chunk-VUESC3YO.js";
12
+ } from "./chunk-C6BDHNNF.js";
13
+ import "./chunk-G75NFPIT.js";
13
14
  import {
14
15
  outputError
15
16
  } from "./chunk-BUZRVER7.js";
16
17
  import "./chunk-XPKWKPWA.js";
17
18
  import {
18
19
  addSubcommand
19
- } from "./chunk-3VS4DTAU.js";
20
- import "./chunk-GIL3VAUR.js";
21
- import "./chunk-FYQPTH5C.js";
22
- import "./chunk-TPX7RZBM.js";
20
+ } from "./chunk-AW5YINX6.js";
21
+ import "./chunk-A5KP5HAI.js";
22
+ import "./chunk-J6LK45HT.js";
23
+ import "./chunk-B3JTF4CF.js";
24
+ import "./chunk-R6IGDGX3.js";
25
+ import "./chunk-BM5FP7VW.js";
23
26
  import "./chunk-ECCWJHC6.js";
24
27
  import {
25
28
  AGENT_REASON,
26
29
  buildCommandWithGlobalFlags,
27
30
  outputAgentError
28
- } from "./chunk-UDWRZXIT.js";
31
+ } from "./chunk-Z5ZQJ5VJ.js";
29
32
  import {
30
- parseArguments,
31
33
  printError
32
- } from "./chunk-SZXT3PDQ.js";
34
+ } from "./chunk-KBEX5MYS.js";
35
+ import {
36
+ parseArguments
37
+ } from "./chunk-XLKFJPMT.js";
33
38
  import {
34
39
  getFlagsSpecification,
35
40
  isAPIError,
36
41
  packageName
37
- } from "./chunk-KSSNLCL4.js";
42
+ } from "./chunk-SOFC4MLS.js";
38
43
  import "./chunk-P4QNYOFB.js";
39
44
  import "./chunk-52QYYTM5.js";
40
45
  import {
@@ -0,0 +1,187 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import {
8
+ MAX_CONCURRENT_REQUESTS,
9
+ parseTeamRefs,
10
+ require_async_sema,
11
+ teamRefBody
12
+ } from "./chunk-3ZE5CFVM.js";
13
+ import {
14
+ repositoryPermissionsPath
15
+ } from "./chunk-BEQV3X2L.js";
16
+ import {
17
+ emitVcrArgParseError,
18
+ resolveVcrScope,
19
+ validateVcrJsonOutput
20
+ } from "./chunk-C6BDHNNF.js";
21
+ import "./chunk-G75NFPIT.js";
22
+ import {
23
+ outputError
24
+ } from "./chunk-BUZRVER7.js";
25
+ import "./chunk-XPKWKPWA.js";
26
+ import {
27
+ permissionsAddSubcommand
28
+ } from "./chunk-J6LK45HT.js";
29
+ import "./chunk-R6IGDGX3.js";
30
+ import "./chunk-BM5FP7VW.js";
31
+ import "./chunk-ECCWJHC6.js";
32
+ import {
33
+ AGENT_REASON,
34
+ buildCommandWithGlobalFlags,
35
+ outputAgentError
36
+ } from "./chunk-Z5ZQJ5VJ.js";
37
+ import {
38
+ printError
39
+ } from "./chunk-KBEX5MYS.js";
40
+ import {
41
+ parseArguments
42
+ } from "./chunk-XLKFJPMT.js";
43
+ import {
44
+ getFlagsSpecification,
45
+ isAPIError,
46
+ packageName
47
+ } from "./chunk-SOFC4MLS.js";
48
+ import "./chunk-P4QNYOFB.js";
49
+ import "./chunk-52QYYTM5.js";
50
+ import {
51
+ output_manager_default
52
+ } from "./chunk-OX7KI3LF.js";
53
+ import "./chunk-GGP5R3FU.js";
54
+ import "./chunk-S7KYDPEM.js";
55
+ import {
56
+ __toESM
57
+ } from "./chunk-TZ2YI2VH.js";
58
+
59
+ // src/commands/vcr/permissions/add.ts
60
+ var import_async_sema = __toESM(require_async_sema(), 1);
61
+ var USAGE = "vcr permissions <repository> add <team>[,<team>...]";
62
+ async function add(client, argv, telemetry) {
63
+ let parsedArgs;
64
+ try {
65
+ parsedArgs = parseArguments(
66
+ argv,
67
+ getFlagsSpecification(permissionsAddSubcommand.options)
68
+ );
69
+ } catch (err) {
70
+ emitVcrArgParseError(client, err, USAGE);
71
+ printError(err);
72
+ return 1;
73
+ }
74
+ const fr = validateVcrJsonOutput(client, parsedArgs.flags);
75
+ if (typeof fr === "number") {
76
+ return fr;
77
+ }
78
+ const repository = parsedArgs.args[0];
79
+ const teamRefs = parseTeamRefs(parsedArgs.args.slice(2));
80
+ const project = parsedArgs.flags["--project"];
81
+ telemetry.trackCliOptionProject(project);
82
+ telemetry.trackCliOptionFormat(parsedArgs.flags["--format"]);
83
+ if (teamRefs.length === 0) {
84
+ outputAgentError(
85
+ client,
86
+ {
87
+ status: "error",
88
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
89
+ message: `Missing team. Example: ${packageName} vcr permissions ${repository} add team_1a2b3c4d`,
90
+ next: [
91
+ {
92
+ command: buildCommandWithGlobalFlags(client.argv, USAGE),
93
+ when: "Replace <team> with a team id or slug (comma-separate multiple teams)"
94
+ }
95
+ ]
96
+ },
97
+ 1
98
+ );
99
+ return outputError(
100
+ client,
101
+ fr.jsonOutput,
102
+ "MISSING_ARGUMENTS",
103
+ `Usage: \`vercel ${USAGE}\``
104
+ );
105
+ }
106
+ const scope = await resolveVcrScope(client, {
107
+ project,
108
+ jsonOutput: fr.jsonOutput
109
+ });
110
+ if (typeof scope === "number") {
111
+ return scope;
112
+ }
113
+ const path = repositoryPermissionsPath(scope, repository);
114
+ const added = [];
115
+ const failed = [];
116
+ output_manager_default.spinner(
117
+ `Sharing ${repository} with ${teamRefs.length === 1 ? teamRefs[0] : `${teamRefs.length} teams`}...`
118
+ );
119
+ const sema = new import_async_sema.default(MAX_CONCURRENT_REQUESTS);
120
+ let results;
121
+ try {
122
+ results = await Promise.all(
123
+ teamRefs.map(async (team) => {
124
+ await sema.acquire();
125
+ try {
126
+ const result = await client.fetch(path, {
127
+ method: "POST",
128
+ body: teamRefBody(team)
129
+ });
130
+ return { ok: true, team, permission: result.permission };
131
+ } catch (err) {
132
+ if (!isAPIError(err)) {
133
+ throw err;
134
+ }
135
+ const message = err.serverMessage || `API error (${err.status}).`;
136
+ return {
137
+ ok: false,
138
+ team,
139
+ failure: { team, code: err.code || "API_ERROR", message }
140
+ };
141
+ } finally {
142
+ sema.release();
143
+ }
144
+ })
145
+ );
146
+ } finally {
147
+ output_manager_default.stopSpinner();
148
+ }
149
+ for (const result of results) {
150
+ if (result.ok) {
151
+ added.push(result.permission);
152
+ if (!fr.jsonOutput) {
153
+ output_manager_default.success(
154
+ `Shared ${repository} with ${result.permission?.teamSlug ?? result.team}`
155
+ );
156
+ }
157
+ } else {
158
+ failed.push(result.failure);
159
+ if (!fr.jsonOutput) {
160
+ output_manager_default.error(
161
+ `Failed to share ${repository} with ${result.team}: ${result.failure.message}`
162
+ );
163
+ }
164
+ }
165
+ }
166
+ if (failed.length > 0) {
167
+ outputAgentError(
168
+ client,
169
+ {
170
+ status: "error",
171
+ reason: AGENT_REASON.API_ERROR,
172
+ message: `Failed to share ${repository} with ${failed.map((f) => `${f.team} (${f.message})`).join(", ")}`
173
+ },
174
+ 1
175
+ );
176
+ }
177
+ if (fr.jsonOutput) {
178
+ client.stdout.write(
179
+ `${JSON.stringify({ permissions: added, failed }, null, 2)}
180
+ `
181
+ );
182
+ }
183
+ return failed.length > 0 ? 1 : 0;
184
+ }
185
+ export {
186
+ add as default
187
+ };
@@ -0,0 +1,243 @@
1
+ import { createRequire as __createRequire } from 'node:module';
2
+ import { fileURLToPath as __fileURLToPath } from 'node:url';
3
+ import { dirname as __dirname_ } from 'node:path';
4
+ const require = __createRequire(import.meta.url);
5
+ const __filename = __fileURLToPath(import.meta.url);
6
+ const __dirname = __dirname_(__filename);
7
+ import {
8
+ DEFAULT_TAG,
9
+ buildRepositoryReference,
10
+ parseNameArg,
11
+ validateImageParts
12
+ } from "./chunk-RBIFXFZX.js";
13
+ import {
14
+ VCR_ENGINES,
15
+ emitVcrArgParseError,
16
+ isBuildxAvailable,
17
+ isEngineInstalled,
18
+ pushCompressionArgs,
19
+ reportEngineCommandFailure,
20
+ reportEnginePushFailure,
21
+ resolveRegistry,
22
+ resolveVcrScope,
23
+ runEngine,
24
+ splitPassthrough,
25
+ validateVcrChoice
26
+ } from "./chunk-C6BDHNNF.js";
27
+ import "./chunk-G75NFPIT.js";
28
+ import {
29
+ outputError
30
+ } from "./chunk-BUZRVER7.js";
31
+ import "./chunk-XPKWKPWA.js";
32
+ import {
33
+ buildSubcommand
34
+ } from "./chunk-AW5YINX6.js";
35
+ import "./chunk-A5KP5HAI.js";
36
+ import "./chunk-J6LK45HT.js";
37
+ import "./chunk-B3JTF4CF.js";
38
+ import "./chunk-R6IGDGX3.js";
39
+ import "./chunk-BM5FP7VW.js";
40
+ import "./chunk-ECCWJHC6.js";
41
+ import {
42
+ AGENT_REASON,
43
+ buildCommandWithGlobalFlags,
44
+ outputAgentError
45
+ } from "./chunk-Z5ZQJ5VJ.js";
46
+ import {
47
+ printError
48
+ } from "./chunk-KBEX5MYS.js";
49
+ import {
50
+ parseArguments
51
+ } from "./chunk-XLKFJPMT.js";
52
+ import {
53
+ getFlagsSpecification
54
+ } from "./chunk-SOFC4MLS.js";
55
+ import "./chunk-P4QNYOFB.js";
56
+ import "./chunk-52QYYTM5.js";
57
+ import {
58
+ output_manager_default
59
+ } from "./chunk-OX7KI3LF.js";
60
+ import "./chunk-GGP5R3FU.js";
61
+ import "./chunk-S7KYDPEM.js";
62
+ import "./chunk-TZ2YI2VH.js";
63
+
64
+ // src/commands/vcr/build.ts
65
+ var DEFAULT_PLATFORM = "linux/amd64";
66
+ async function build(client, telemetry) {
67
+ const { own, passthrough } = splitPassthrough(client.argv);
68
+ let parsedArgs;
69
+ try {
70
+ parsedArgs = parseArguments(
71
+ own,
72
+ getFlagsSpecification(buildSubcommand.options)
73
+ );
74
+ } catch (err) {
75
+ emitVcrArgParseError(client, err, "vcr build <engine> [path] [name[:tag]]");
76
+ printError(err);
77
+ return 1;
78
+ }
79
+ const [engineArg, pathArg, nameArg] = parsedArgs.args.slice(2);
80
+ const project = parsedArgs.flags["--project"];
81
+ const platform = parsedArgs.flags["--platform"];
82
+ const push = Boolean(parsedArgs.flags["--push"]);
83
+ telemetry.trackCliArgumentEngine(engineArg);
84
+ telemetry.trackCliArgumentPath(pathArg);
85
+ telemetry.trackCliArgumentName(nameArg);
86
+ telemetry.trackCliOptionProject(project);
87
+ telemetry.trackCliOptionPlatform(platform);
88
+ telemetry.trackCliFlagPush(push);
89
+ if (!engineArg) {
90
+ const message = `Missing engine. Choose one of: ${VCR_ENGINES.join(", ")}.`;
91
+ outputAgentError(
92
+ client,
93
+ {
94
+ status: "error",
95
+ reason: AGENT_REASON.MISSING_ARGUMENTS,
96
+ message,
97
+ next: [
98
+ {
99
+ command: buildCommandWithGlobalFlags(
100
+ client.argv,
101
+ "vcr build docker"
102
+ ),
103
+ when: "Replace docker with the container tool you use"
104
+ }
105
+ ]
106
+ },
107
+ 1
108
+ );
109
+ return outputError(client, false, "MISSING_ARGUMENTS", message);
110
+ }
111
+ const choiceError = validateVcrChoice(
112
+ client,
113
+ "engine",
114
+ engineArg,
115
+ VCR_ENGINES,
116
+ false
117
+ );
118
+ if (typeof choiceError === "number") {
119
+ return choiceError;
120
+ }
121
+ const engine = engineArg;
122
+ if (!isEngineInstalled(engine)) {
123
+ const message = `\`${engine}\` is not installed or not on your PATH. Install it and try again.`;
124
+ outputAgentError(
125
+ client,
126
+ {
127
+ status: "error",
128
+ reason: "engine_not_found",
129
+ message
130
+ },
131
+ 1
132
+ );
133
+ return outputError(client, false, "ENGINE_NOT_FOUND", message);
134
+ }
135
+ const scope = await resolveVcrScope(client, { project, jsonOutput: false });
136
+ if (typeof scope === "number") {
137
+ return scope;
138
+ }
139
+ const parsed = parseNameArg(nameArg, scope.projectName);
140
+ if ("error" in parsed) {
141
+ outputAgentError(
142
+ client,
143
+ {
144
+ status: "error",
145
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
146
+ message: parsed.error
147
+ },
148
+ 1
149
+ );
150
+ return outputError(client, false, "INVALID_ARGUMENTS", parsed.error);
151
+ }
152
+ const validationError = validateImageParts(parsed);
153
+ if (validationError) {
154
+ outputAgentError(
155
+ client,
156
+ {
157
+ status: "error",
158
+ reason: AGENT_REASON.INVALID_ARGUMENTS,
159
+ message: validationError
160
+ },
161
+ 1
162
+ );
163
+ return outputError(client, false, "INVALID_ARGUMENTS", validationError);
164
+ }
165
+ const base = buildRepositoryReference({
166
+ registry: resolveRegistry(),
167
+ teamSlug: scope.teamSlug,
168
+ projectName: scope.projectName,
169
+ repository: parsed.repository
170
+ });
171
+ const ref = `${base}:${parsed.tag ?? DEFAULT_TAG}`;
172
+ const contextPath = pathArg ?? ".";
173
+ const buildPlatform = platform ?? DEFAULT_PLATFORM;
174
+ if (push && engine === "docker" && await isBuildxAvailable()) {
175
+ const outputSpec = `type=image,name=${ref},push=true,oci-mediatypes=true,compression=zstd,compression-level=3,force-compression=true`;
176
+ const engineArgs2 = [
177
+ "buildx",
178
+ "build",
179
+ "--platform",
180
+ buildPlatform,
181
+ "--output",
182
+ outputSpec,
183
+ ...passthrough,
184
+ contextPath
185
+ ];
186
+ output_manager_default.log(`Running: ${engine} ${engineArgs2.join(" ")}`);
187
+ const result2 = await runEngine(engine, engineArgs2, {
188
+ cwd: client.cwd,
189
+ captureStderr: true
190
+ });
191
+ if (result2.exitCode !== 0) {
192
+ return reportEnginePushFailure(client, engine, "buildx build", result2);
193
+ }
194
+ output_manager_default.success(`Built and pushed ${ref} (zstd compression)`);
195
+ return 0;
196
+ }
197
+ if (push && engine === "docker") {
198
+ output_manager_default.warn(
199
+ "Docker Buildx is not available; building and pushing without zstd compression. Install Buildx for smaller, faster image pushes."
200
+ );
201
+ }
202
+ const engineArgs = [
203
+ "build",
204
+ "--platform",
205
+ buildPlatform,
206
+ "--tag",
207
+ ref,
208
+ ...passthrough,
209
+ contextPath
210
+ ];
211
+ output_manager_default.log(`Running: ${engine} ${engineArgs.join(" ")}`);
212
+ const result = await runEngine(engine, engineArgs, { cwd: client.cwd });
213
+ if (result.exitCode !== 0) {
214
+ return reportEngineCommandFailure(client, engine, "build", result);
215
+ }
216
+ if (!push) {
217
+ output_manager_default.success(`Built ${ref}`);
218
+ output_manager_default.log(
219
+ `Push it with \`${buildCommandWithGlobalFlags(
220
+ client.argv,
221
+ `vcr push ${engine}${nameArg ? ` ${nameArg}` : ""}`
222
+ )}\`.`
223
+ );
224
+ return 0;
225
+ }
226
+ const pushArgs = ["push", ...pushCompressionArgs(engine), ref];
227
+ output_manager_default.log(`Running: ${engine} ${pushArgs.join(" ")}`);
228
+ const pushResult = await runEngine(engine, pushArgs, {
229
+ cwd: client.cwd,
230
+ captureStderr: true
231
+ });
232
+ if (pushResult.exitCode !== 0) {
233
+ return reportEnginePushFailure(client, engine, "push", pushResult);
234
+ }
235
+ const compressed = engine !== "docker";
236
+ output_manager_default.success(
237
+ `Built and pushed ${ref}${compressed ? " (zstd compression)" : ""}`
238
+ );
239
+ return 0;
240
+ }
241
+ export {
242
+ build as default
243
+ };
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  truncateEnd
9
- } from "./chunk-OF2GNB42.js";
9
+ } from "./chunk-RQ7H43CJ.js";
10
10
  import {
11
11
  require_dist
12
12
  } from "./chunk-OX7KI3LF.js";
@@ -6,11 +6,12 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  formatOption,
9
+ jsonOption,
9
10
  limitOption,
10
11
  nextOption,
11
12
  packageName,
12
13
  projectOption
13
- } from "./chunk-KSSNLCL4.js";
14
+ } from "./chunk-SOFC4MLS.js";
14
15
 
15
16
  // src/commands/activity/command.ts
16
17
  var typesSubcommand = {
@@ -18,7 +19,7 @@ var typesSubcommand = {
18
19
  aliases: [],
19
20
  description: "List available event types with descriptions.",
20
21
  arguments: [],
21
- options: [formatOption],
22
+ options: [formatOption, jsonOption],
22
23
  examples: [
23
24
  {
24
25
  name: "List all event types",
@@ -26,7 +27,7 @@ var typesSubcommand = {
26
27
  },
27
28
  {
28
29
  name: "Output JSON",
29
- value: `${packageName} activity types --format json`
30
+ value: `${packageName} activity types --json`
30
31
  }
31
32
  ]
32
33
  };
@@ -89,7 +90,8 @@ var activityCommand = {
89
90
  },
90
91
  limitOption,
91
92
  nextOption,
92
- formatOption
93
+ formatOption,
94
+ jsonOption
93
95
  ],
94
96
  examples: [
95
97
  {
@@ -110,7 +112,7 @@ var activityCommand = {
110
112
  },
111
113
  {
112
114
  name: "Output JSON",
113
- value: `${packageName} activity --format json | jq '.events[]'`
115
+ value: `${packageName} activity --json | jq '.events[]'`
114
116
  },
115
117
  {
116
118
  name: "List activity event types",