vercel 59.11.7 → 59.12.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 (125) hide show
  1. package/dist/chunks/{add-KSJQYR5C.js → add-OO3JGLZW.js} +3 -3
  2. package/dist/chunks/{add-WU2QYHYL.js → add-RTXDASSS.js} +3 -3
  3. package/dist/chunks/add-XGO6LHMD.js +221 -0
  4. package/dist/chunks/{build-F3J6FLPD.js → build-JINV2UD4.js} +3 -3
  5. package/dist/chunks/chunk-2NIDTSQJ.js +305 -0
  6. package/dist/chunks/{chunk-SHFNEZVI.js → chunk-32XSMM3W.js} +1 -1
  7. package/dist/chunks/{chunk-N4QHMXOO.js → chunk-3BB2HOO2.js} +3 -2
  8. package/dist/chunks/{chunk-DSTNNQVV.js → chunk-3F25W3GA.js} +3 -3
  9. package/dist/chunks/{chunk-OIH6FP5Y.js → chunk-4TUMNBEE.js} +2 -2
  10. package/dist/chunks/{chunk-4IVSM24H.js → chunk-ABSZNJQO.js} +1 -1
  11. package/dist/chunks/{chunk-CNDPIHY5.js → chunk-AV747POV.js} +24 -19
  12. package/dist/chunks/{chunk-QHS645AZ.js → chunk-CZ5QQRXD.js} +3 -3
  13. package/dist/chunks/{chunk-FL4JLNT2.js → chunk-E47NARDE.js} +2 -2
  14. package/dist/chunks/{chunk-XM3LOQIX.js → chunk-EDMW7SBH.js} +76 -92
  15. package/dist/chunks/{chunk-PJXMXMCO.js → chunk-ELZ6WQQA.js} +2 -2
  16. package/dist/chunks/{chunk-FVNJTRCE.js → chunk-EOLGLGXJ.js} +2 -2
  17. package/dist/chunks/chunk-GDOUDU6O.js +74 -0
  18. package/dist/chunks/{chunk-GCVXKRR5.js → chunk-HD4DR3DA.js} +1 -0
  19. package/dist/chunks/{chunk-DWIC7MRV.js → chunk-HKHXKSXQ.js} +1 -1
  20. package/dist/chunks/{chunk-ZBEECGFD.js → chunk-HM24ZWQL.js} +1 -1
  21. package/dist/chunks/chunk-HR2MP4XF.js +324 -0
  22. package/dist/chunks/{chunk-EZQDYIVB.js → chunk-JOXNBQ7W.js} +1 -1
  23. package/dist/chunks/{chunk-DBYHS3CK.js → chunk-KAF4WFF3.js} +2 -2
  24. package/dist/chunks/{chunk-VYC45Q4Z.js → chunk-KNO327AW.js} +1 -1
  25. package/dist/chunks/{chunk-XD4DCYMX.js → chunk-L6B6BRHH.js} +2 -2
  26. package/dist/chunks/{chunk-X7DBBZQD.js → chunk-LDV2R4P4.js} +1 -1
  27. package/dist/chunks/{chunk-2TSBB22D.js → chunk-MADFAH3O.js} +2 -2
  28. package/dist/chunks/{chunk-TGNEG57M.js → chunk-MDGPZHSM.js} +110 -14
  29. package/dist/chunks/{chunk-XIFATBH5.js → chunk-NDY3JDOU.js} +4 -4
  30. package/dist/chunks/{chunk-NSOYO6JQ.js → chunk-OJHDGHOB.js} +6 -6
  31. package/dist/chunks/{chunk-KJBZ5ZST.js → chunk-PIMIVJYK.js} +1 -0
  32. package/dist/chunks/{chunk-C762AAVU.js → chunk-PP5GKSIX.js} +4 -4
  33. package/dist/chunks/{chunk-Z7JWYFOY.js → chunk-QB2UHSUB.js} +1 -1
  34. package/dist/chunks/chunk-QIUK4Z7Q.js +79 -0
  35. package/dist/chunks/{chunk-GHKJAK5V.js → chunk-RNK3LXLR.js} +4 -4
  36. package/dist/chunks/{chunk-CEDN47PH.js → chunk-SWO66HE2.js} +1 -1
  37. package/dist/chunks/{chunk-EPOLDWRA.js → chunk-TDGK45FB.js} +1 -1
  38. package/dist/chunks/{chunk-PFM75KY3.js → chunk-UA55I7M6.js} +3 -3
  39. package/dist/chunks/{chunk-VT3Z7HF6.js → chunk-UJPVHLL5.js} +4 -4
  40. package/dist/chunks/{chunk-UARGTFCT.js → chunk-VJSREJVM.js} +1 -1
  41. package/dist/chunks/{chunk-WL6QYSGD.js → chunk-WPBCUXMZ.js} +506 -22
  42. package/dist/chunks/{chunk-A5JZS6ZN.js → chunk-WSZ5E4WH.js} +1 -1
  43. package/dist/chunks/{chunk-GUU4Z2AQ.js → chunk-WT2Y7FRD.js} +6 -6
  44. package/dist/chunks/{chunk-G3PXSXIB.js → chunk-WT6C2ALC.js} +3 -3
  45. package/dist/chunks/{chunk-7KROIXQM.js → chunk-X6TGUHFD.js} +3 -3
  46. package/dist/chunks/{chunk-QOPTXV4G.js → chunk-YPMFZRTN.js} +1 -1
  47. package/dist/chunks/{chunk-FVT74RZ5.js → chunk-YRESLJCW.js} +11 -11
  48. package/dist/chunks/{clear-XUQO4ZTK.js → clear-GQTDYSKJ.js} +3 -3
  49. package/dist/chunks/{compile-vercel-config-D3ARNHTN.js → compile-vercel-config-URVMKDVW.js} +2 -2
  50. package/dist/chunks/{config-37OAE7QJ.js → config-MSVQR5T6.js} +7 -7
  51. package/dist/chunks/{config-MEDLXUVM.js → config-OAXY4J6P.js} +3 -3
  52. package/dist/chunks/config-validator.mjs +1 -1
  53. package/dist/chunks/{delete-VSWDZ2SW.js → delete-57QO64HD.js} +5 -5
  54. package/dist/chunks/{delete-3N3YZZOF.js → delete-XN6ESD7C.js} +5 -5
  55. package/dist/chunks/{detect-services-TESZCQWG.js → detect-services-UPY4LTBZ.js} +6 -6
  56. package/dist/chunks/{disable-A4FLFMC7.js → disable-BYI46V7B.js} +5 -5
  57. package/dist/chunks/{discard-CHGFULBZ.js → discard-IIQL44ZZ.js} +5 -5
  58. package/dist/chunks/{edit-MHSYAPDR.js → edit-BRNS3OR4.js} +6 -6
  59. package/dist/chunks/{edit-JZ63AJYQ.js → edit-JTW7XZH7.js} +5 -5
  60. package/dist/chunks/{enable-KD46SEC5.js → enable-CH5FSQMR.js} +5 -5
  61. package/dist/chunks/{export-42QZLBSN.js → export-6WHQOWKM.js} +5 -5
  62. package/dist/chunks/{image-GP4H73A2.js → image-ZSLYATWG.js} +3 -3
  63. package/dist/chunks/{import-builders-6TBLMPL2.js → import-builders-FNMYJZGG.js} +4 -4
  64. package/dist/chunks/{inspect-5FMWMY3C.js → inspect-4RDZSYWU.js} +10 -10
  65. package/dist/chunks/{inspect-MUVK6MMT.js → inspect-7WQXZWET.js} +3 -3
  66. package/dist/chunks/{inspect-Q3DWW7MC.js → inspect-CGXTNMMO.js} +9 -9
  67. package/dist/chunks/{inspect-RNTSYM6O.js → inspect-XJ7BYLZ5.js} +3 -3
  68. package/dist/chunks/{inspect-QFXAOUL4.js → inspect-Z2MBTTB7.js} +3 -3
  69. package/dist/chunks/{list-IHHIPXEC.js → list-65LW6OTM.js} +6 -6
  70. package/dist/chunks/{list-XHD5DLEX.js → list-7W3PHRB6.js} +7 -7
  71. package/dist/chunks/{list-JRNWLSO5.js → list-KS22Y57L.js} +2 -2
  72. package/dist/chunks/{login-PCT6KFWY.js → login-NXULVQZ2.js} +3 -3
  73. package/dist/chunks/{ls-TGHCCARZ.js → ls-35EOVEIQ.js} +4 -4
  74. package/dist/chunks/{ls-PQZ2RIDX.js → ls-5GKS5QRW.js} +4 -4
  75. package/dist/chunks/ls-ADYFYYIW.js +204 -0
  76. package/dist/chunks/{ls-SVOHC3XW.js → ls-DZYN3SNS.js} +4 -4
  77. package/dist/chunks/{ls-VRIH5WA3.js → ls-HVQOGBGV.js} +7 -7
  78. package/dist/chunks/{ls-GPEHEFCF.js → ls-I2PWG7YN.js} +4 -4
  79. package/dist/chunks/{open-E7DEKYDU.js → open-H34HXJHP.js} +5 -5
  80. package/dist/chunks/{permissions-JKOONWVL.js → permissions-ZPPEPKVE.js} +4 -4
  81. package/dist/chunks/{publish-EDDELDE5.js → publish-NRMKXHAU.js} +5 -5
  82. package/dist/chunks/{pull-646WEVDE.js → pull-WUT3XTZX.js} +7 -7
  83. package/dist/chunks/{push-LTNW5OVD.js → push-WFNCEA5J.js} +3 -3
  84. package/dist/chunks/{query-LU4N6KPO.js → query-2FQM3F7N.js} +7 -7
  85. package/dist/chunks/{reorder-22PKJMZP.js → reorder-GYCT7L3C.js} +5 -5
  86. package/dist/chunks/{reply-SF2EZMVZ.js → reply-RFEXNYZ7.js} +5 -5
  87. package/dist/chunks/{resolve-ZCZGXTOT.js → resolve-ZFGT7W6Z.js} +5 -5
  88. package/dist/chunks/{restore-VJAWZXB4.js → restore-JAXPMYL5.js} +5 -5
  89. package/dist/chunks/rm-CLKQN5E4.js +162 -0
  90. package/dist/chunks/{rm-WNPGTUBH.js → rm-JPV5V2SH.js} +3 -3
  91. package/dist/chunks/{rm-KN2QFCKO.js → rm-N7SGFQOA.js} +3 -3
  92. package/dist/chunks/{rm-KVEAJPRE.js → rm-UQJ4CZJH.js} +3 -3
  93. package/dist/chunks/{rm-OSZ5FZUM.js → rm-ZUQ4U454.js} +7 -7
  94. package/dist/chunks/rule-inspect-HI3YY7OY.js +123 -0
  95. package/dist/chunks/{rules-65LKAQ35.js → rules-DA3Q64M4.js} +7 -7
  96. package/dist/chunks/{schema-NXCW4M75.js → schema-R3C4CXJ6.js} +6 -6
  97. package/dist/chunks/schema-UYYFV3JB.js +381 -0
  98. package/dist/chunks/{set-FYJVKMPV.js → set-TOJPGW4J.js} +7 -7
  99. package/dist/chunks/{setup-and-link-KXPZE32P.js → setup-and-link-DRYXQOH4.js} +16 -16
  100. package/dist/chunks/{tags-ANIRP5E3.js → tags-TNLVFNVI.js} +2 -2
  101. package/dist/chunks/update-X6JB3NPI.js +224 -0
  102. package/dist/chunks/vlt-builder-importer-USCFHWPL.js +322 -0
  103. package/dist/commands/build/index.js +19 -19
  104. package/dist/commands/deploy/index.js +19 -19
  105. package/dist/commands/dev/index.js +25 -25
  106. package/dist/commands/env/index.js +12 -12
  107. package/dist/commands/link/index.js +12 -12
  108. package/dist/commands/list/index.js +5 -5
  109. package/dist/commands-bulk.js +8273 -3511
  110. package/dist/help.js +1 -1
  111. package/dist/index.js +28 -18
  112. package/dist/runtime-assets/node-preloads/next-dev-websocket.cjs +6 -0
  113. package/dist/version.mjs +1 -1
  114. package/package.json +52 -48
  115. package/dist/chunks/add-PERLOALD.js +0 -233
  116. package/dist/chunks/chunk-5GGUB4EO.js +0 -31
  117. package/dist/chunks/chunk-ARU7VBKR.js +0 -144
  118. package/dist/chunks/chunk-KEKR7OCB.js +0 -140
  119. package/dist/chunks/chunk-MXLA3VQS.js +0 -20
  120. package/dist/chunks/chunk-QKX7WKIN.js +0 -98
  121. package/dist/chunks/ls-PF7F4PP4.js +0 -197
  122. package/dist/chunks/rm-W722Q2AO.js +0 -173
  123. package/dist/chunks/rule-inspect-25Z6SNX3.js +0 -285
  124. package/dist/chunks/schema-7D6IGJEJ.js +0 -429
  125. package/dist/chunks/update-UT6CTKVG.js +0 -246
@@ -7,14 +7,14 @@ const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  getUpdateCommandInfo,
9
9
  isGlobal
10
- } from "./chunk-CEDN47PH.js";
10
+ } from "./chunk-SWO66HE2.js";
11
11
  import {
12
12
  progress,
13
13
  require_ci_info
14
- } from "./chunk-FL4JLNT2.js";
14
+ } from "./chunk-E47NARDE.js";
15
15
  import {
16
16
  writeToConfigFile
17
- } from "./chunk-GUU4Z2AQ.js";
17
+ } from "./chunk-WT2Y7FRD.js";
18
18
  import {
19
19
  getGlobalPathConfig
20
20
  } from "./chunk-AINIBIP4.js";
@@ -24,7 +24,7 @@ import {
24
24
  import {
25
25
  apiCommand,
26
26
  listSubcommand4 as listSubcommand
27
- } from "./chunk-WL6QYSGD.js";
27
+ } from "./chunk-WPBCUXMZ.js";
28
28
  import {
29
29
  require_semver
30
30
  } from "./chunk-IB5L4LKZ.js";
@@ -33,7 +33,7 @@ import {
33
33
  require_mkdirp,
34
34
  require_pump,
35
35
  require_tar_stream
36
- } from "./chunk-G3PXSXIB.js";
36
+ } from "./chunk-WT6C2ALC.js";
37
37
  import {
38
38
  require_ms
39
39
  } from "./chunk-GGP5R3FU.js";
@@ -3138,20 +3138,25 @@ async function fetchPrBuildSha(pr) {
3138
3138
  const res = await fetch2(url);
3139
3139
  if (res.status === 404) {
3140
3140
  throw new Error(
3141
- `No binary found for PR #${pr}. The PR may not have a build yet, or the build may still be running.`
3141
+ `Couldn't find a binary for PR #${pr}. The current-sha pointer is not published yet.`
3142
3142
  );
3143
3143
  }
3144
3144
  if (!res.ok) {
3145
3145
  throw new Error(
3146
- `Failed to fetch current build for PR #${pr} (HTTP ${res.status})`
3146
+ `Failed to fetch the current build for PR #${pr} (HTTP ${res.status}).`
3147
3147
  );
3148
3148
  }
3149
3149
  const sha = (await res.text()).trim().toLowerCase();
3150
3150
  if (!/^[0-9a-f]{40}$/.test(sha)) {
3151
- throw new Error(`Unexpected build SHA format for PR #${pr}`);
3151
+ throw new Error(`Unexpected build SHA format for PR #${pr}.`);
3152
3152
  }
3153
3153
  return sha;
3154
3154
  }
3155
+ function missingPrPlatformMessage(pr, buildSha) {
3156
+ const platform = platformTarget();
3157
+ const shortSha = buildSha.slice(0, 12);
3158
+ return `Couldn't find a ${platform} binary for PR #${pr} (${shortSha}). This SHA exists, but this platform isn't ready yet.`;
3159
+ }
3155
3160
  function getPrBinaryBaseUrl(pr, buildSha) {
3156
3161
  return `${PR_BINARIES_URL}/${pr}/shas/${buildSha}`;
3157
3162
  }
@@ -3159,19 +3164,17 @@ async function fetchPrChecksum(pr, buildSha) {
3159
3164
  const url = `${getPrBinaryBaseUrl(pr, buildSha)}/vercel-${platformTarget()}.sha256`;
3160
3165
  const res = await fetch2(url);
3161
3166
  if (res.status === 404) {
3162
- throw new Error(
3163
- `No binary found for PR #${pr} on ${platformTarget()}. The PR may not have a build yet, or the build may still be running.`
3164
- );
3167
+ throw new Error(missingPrPlatformMessage(pr, buildSha));
3165
3168
  }
3166
3169
  if (!res.ok) {
3167
3170
  throw new Error(
3168
- `Failed to fetch checksum for PR #${pr} (HTTP ${res.status})`
3171
+ `Failed to fetch the checksum for PR #${pr} (HTTP ${res.status}).`
3169
3172
  );
3170
3173
  }
3171
3174
  const text = (await res.text()).trim();
3172
3175
  const sha = text.split(/\s+/)[0]?.toLowerCase();
3173
3176
  if (!/^[0-9a-f]{64}$/.test(sha ?? "")) {
3174
- throw new Error(`Unexpected checksum format for PR #${pr}`);
3177
+ throw new Error(`Unexpected checksum format for PR #${pr}.`);
3175
3178
  }
3176
3179
  return sha;
3177
3180
  }
@@ -3182,9 +3185,7 @@ async function downloadPrBinary(pr, buildSha, expectedSha, destination) {
3182
3185
  const url = `${getPrBinaryBaseUrl(pr, buildSha)}/vercel-${platformTarget()}`;
3183
3186
  const res = await fetch2(url);
3184
3187
  if (res.status === 404) {
3185
- throw new Error(
3186
- `No binary found for PR #${pr} on ${platformTarget()}. The PR may not have a build yet, or the build may still be running.`
3187
- );
3188
+ throw new Error(missingPrPlatformMessage(pr, buildSha));
3188
3189
  }
3189
3190
  if (!res.ok) {
3190
3191
  throw new Error(`Failed to download ${url} (HTTP ${res.status})`);
@@ -3222,11 +3223,15 @@ async function installAndLinkPrBinary(pr) {
3222
3223
  const existing = await stat(binaryPath).catch(() => null);
3223
3224
  const localSha = existing?.isFile() ? (await readFile4(shaPath, "utf8").catch(() => "")).trim().split(/\s+/)[0] : void 0;
3224
3225
  if (existing?.isFile() && localSha === remoteSha) {
3226
+ await writeFile2(join2(versionDir, "build-sha"), `${buildSha}
3227
+ `);
3225
3228
  await linkVersion(prVersionDirName(pr));
3226
3229
  return { updated: false, buildSha };
3227
3230
  }
3228
3231
  output_manager_default.spinner(`Downloading Vercel CLI build for PR #${pr}\u2026`, 0);
3229
3232
  await downloadPrBinary(pr, buildSha, remoteSha, versionDir);
3233
+ await writeFile2(join2(versionDir, "build-sha"), `${buildSha}
3234
+ `);
3230
3235
  await linkVersion(prVersionDirName(pr));
3231
3236
  return { updated: true, buildSha };
3232
3237
  }
@@ -3286,9 +3291,9 @@ async function getPinnedVersion() {
3286
3291
  return pinned === linked ? pinned : void 0;
3287
3292
  }
3288
3293
  async function getPrBuildSha(name) {
3289
- const shaPath = join2(getInstallRoot(), "versions", name, "vercel.sha256");
3290
- const sha = (await readFile4(shaPath, "utf8").catch(() => "")).trim().split(/\s+/)[0];
3291
- return /^[0-9a-f]{64}$/.test(sha) ? sha : void 0;
3294
+ const shaPath = join2(getInstallRoot(), "versions", name, "build-sha");
3295
+ const sha = (await readFile4(shaPath, "utf8").catch(() => "")).trim().toLowerCase();
3296
+ return /^[0-9a-f]{40}$/.test(sha) ? sha : void 0;
3292
3297
  }
3293
3298
  function packageManagerRemovalCommand() {
3294
3299
  const segments = process.execPath.split(sep);
@@ -6,16 +6,16 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  require_dist as require_dist4
9
- } from "./chunk-UARGTFCT.js";
9
+ } from "./chunk-VJSREJVM.js";
10
10
  import {
11
11
  require_dist2 as require_dist3
12
12
  } from "./chunk-332LMJLZ.js";
13
13
  import {
14
14
  require_dist as require_dist2
15
- } from "./chunk-G3PXSXIB.js";
15
+ } from "./chunk-WT6C2ALC.js";
16
16
  import {
17
17
  require_lib
18
- } from "./chunk-2TSBB22D.js";
18
+ } from "./chunk-MADFAH3O.js";
19
19
  import {
20
20
  output_manager_default
21
21
  } from "./chunk-2JIX6UMI.js";
@@ -6,10 +6,10 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  loginCommand
9
- } from "./chunk-WL6QYSGD.js";
9
+ } from "./chunk-WPBCUXMZ.js";
10
10
  import {
11
11
  login
12
- } from "./chunk-DBYHS3CK.js";
12
+ } from "./chunk-KAF4WFF3.js";
13
13
  import {
14
14
  help
15
15
  } from "./chunk-YS76T533.js";
@@ -13,68 +13,76 @@ import {
13
13
  } from "./chunk-Q2DGFCO7.js";
14
14
 
15
15
  // src/commands/alerts/rules/command.ts
16
- var scopeOptions = [
17
- {
18
- ...projectOption,
19
- shorthand: "p",
20
- description: "Project scope (overrides linked project). Requires team context."
21
- },
22
- {
23
- name: "all",
24
- shorthand: "a",
25
- type: Boolean,
26
- deprecated: false,
27
- description: "Team-wide rules only (omit project filter; ignore linked project)."
28
- }
29
- ];
30
- var addScopeOptions = [
31
- {
32
- ...scopeOptions[0],
33
- description: "Target project when the body omits projectId; built-in rules otherwise remain team-wide."
34
- },
35
- scopeOptions[1]
16
+ var projectScopeOption = {
17
+ ...projectOption,
18
+ shorthand: "p",
19
+ description: "Use a project by name or ID"
20
+ };
21
+ var listAllOption = {
22
+ name: "all",
23
+ shorthand: "a",
24
+ type: Boolean,
25
+ deprecated: false,
26
+ description: "List all accessible rules in the selected team"
27
+ };
28
+ var mutationAllOption = {
29
+ ...listAllOption,
30
+ description: "Apply the rule to all projects in the selected team"
31
+ };
32
+ var deprecatedItemScopeOptions = [
33
+ { ...projectScopeOption, deprecated: true },
34
+ { ...listAllOption, deprecated: true }
36
35
  ];
36
+ var bodyOption = {
37
+ name: "body",
38
+ shorthand: null,
39
+ type: String,
40
+ argument: "PATH",
41
+ deprecated: false,
42
+ description: "Read the alert rule body from a JSON file"
43
+ };
37
44
  var rulesLsSubcommand = {
38
45
  name: "ls",
39
46
  aliases: ["list"],
40
- description: "List alert rules for the current scope",
47
+ description: "List alert rules for a project or team",
41
48
  arguments: [],
42
49
  options: [
43
- ...scopeOptions,
50
+ projectScopeOption,
51
+ listAllOption,
44
52
  {
45
53
  name: "type",
46
54
  shorthand: null,
47
55
  type: [String],
48
56
  argument: "TYPE",
49
57
  deprecated: false,
50
- description: "Filter by alert type. Repeatable and comma-separated (for example --type custom_alert)."
58
+ description: "Filter by rule type: built-in or custom"
51
59
  },
52
60
  formatOption,
53
61
  jsonOption
54
62
  ],
55
63
  examples: [
56
64
  {
57
- name: "List rules for the linked project",
65
+ name: "List rules affecting the linked project",
58
66
  value: `${packageName} alerts rules ls`
59
67
  },
60
68
  {
61
- name: "List team-wide rules",
69
+ name: "List all rules in the selected team",
62
70
  value: `${packageName} alerts rules ls --all`
63
71
  },
64
72
  {
65
- name: "List custom alert rules",
66
- value: `${packageName} alerts rules ls --type custom_alert`
73
+ name: "List custom rules for a project",
74
+ value: `${packageName} alerts rules ls --project my-app --type custom`
67
75
  },
68
76
  {
69
- name: "JSON output",
70
- value: `${packageName} alerts rules ls --json`
77
+ name: "Write JSON output",
78
+ value: `${packageName} alerts rules ls --all --json`
71
79
  }
72
80
  ]
73
81
  };
74
82
  var rulesSchemaSubcommand = {
75
83
  name: "schema",
76
84
  aliases: [],
77
- description: "Show alert rule body schema and examples by alert type",
85
+ description: "Show alert rule request fields and examples",
78
86
  arguments: [],
79
87
  options: [
80
88
  {
@@ -83,7 +91,7 @@ var rulesSchemaSubcommand = {
83
91
  type: String,
84
92
  argument: "TYPE",
85
93
  deprecated: false,
86
- description: "Alert rule type to describe: usage_anomaly, error_anomaly, or custom_alert."
94
+ description: "Rule type to describe: built-in or custom"
87
95
  },
88
96
  formatOption
89
97
  ],
@@ -93,62 +101,51 @@ var rulesSchemaSubcommand = {
93
101
  value: `${packageName} alerts rules schema`
94
102
  },
95
103
  {
96
- name: "Show error anomaly rule schema",
97
- value: `${packageName} alerts rules schema --type error_anomaly`
98
- },
99
- {
100
- name: "Show custom alert rule schema",
101
- value: `${packageName} alerts rules schema --type custom_alert`
104
+ name: "Show the built-in rule schema",
105
+ value: `${packageName} alerts rules schema --type built-in`
102
106
  },
103
107
  {
104
- name: "Schema as JSON",
105
- value: `${packageName} alerts rules schema --type custom_alert --format json`
108
+ name: "Show the custom rule schema as JSON",
109
+ value: `${packageName} alerts rules schema --type custom --format json`
106
110
  }
107
111
  ]
108
112
  };
109
113
  var rulesAddSubcommand = {
110
114
  name: "add",
111
115
  aliases: ["create"],
112
- description: "Create an alert rule from a JSON body file",
116
+ description: "Create an alert rule from a JSON body",
113
117
  arguments: [],
114
118
  options: [
115
- ...addScopeOptions,
119
+ projectScopeOption,
120
+ mutationAllOption,
116
121
  formatOption,
117
122
  jsonOption,
118
- {
119
- name: "body",
120
- shorthand: null,
121
- type: String,
122
- argument: "PATH",
123
- deprecated: false,
124
- description: "Path to JSON for the new rule. Do not include id or teamId; the API assigns them."
125
- }
123
+ bodyOption
126
124
  ],
127
125
  examples: [
128
126
  {
129
- name: "Create from file",
130
- value: `${packageName} alerts rules add --body ./rule.json`
127
+ name: "Create a project-scoped rule",
128
+ value: `${packageName} alerts rules add --project my-app --body ./rule.json`
129
+ },
130
+ {
131
+ name: "Create a team-wide built-in rule",
132
+ value: `${packageName} alerts rules add --all --body ./rule.json`
131
133
  }
132
134
  ]
133
135
  };
134
136
  var rulesInspectSubcommand = {
135
137
  name: "inspect",
136
138
  aliases: ["get"],
137
- description: "Show one alert rule by id",
138
- arguments: [
139
- {
140
- name: "ruleId",
141
- required: true
142
- }
143
- ],
144
- options: [...scopeOptions, formatOption, jsonOption],
139
+ description: "Show one alert rule by ID",
140
+ arguments: [{ name: "ruleId", required: true }],
141
+ options: [...deprecatedItemScopeOptions, formatOption, jsonOption],
145
142
  examples: [
146
143
  {
147
144
  name: "Inspect a rule",
148
145
  value: `${packageName} alerts rules inspect ar_abc123`
149
146
  },
150
147
  {
151
- name: "JSON output",
148
+ name: "Write JSON output",
152
149
  value: `${packageName} alerts rules inspect ar_abc123 --json`
153
150
  }
154
151
  ]
@@ -157,20 +154,15 @@ var rulesRmSubcommand = {
157
154
  name: "rm",
158
155
  aliases: ["remove", "delete"],
159
156
  description: "Delete an alert rule",
160
- arguments: [
161
- {
162
- name: "ruleId",
163
- required: true
164
- }
165
- ],
166
- options: [...scopeOptions, formatOption, jsonOption, yesOption],
157
+ arguments: [{ name: "ruleId", required: true }],
158
+ options: [...deprecatedItemScopeOptions, formatOption, jsonOption, yesOption],
167
159
  examples: [
168
160
  {
169
161
  name: "Delete with confirmation",
170
162
  value: `${packageName} alerts rules rm ar_abc123`
171
163
  },
172
164
  {
173
- name: "Delete without prompt",
165
+ name: "Delete without a prompt",
174
166
  value: `${packageName} alerts rules rm ar_abc123 --yes`
175
167
  }
176
168
  ]
@@ -178,37 +170,33 @@ var rulesRmSubcommand = {
178
170
  var rulesUpdateSubcommand = {
179
171
  name: "update",
180
172
  aliases: ["patch"],
181
- description: "Patch an alert rule from a JSON body file",
182
- arguments: [
183
- {
184
- name: "ruleId",
185
- required: true
186
- }
187
- ],
173
+ description: "Patch an alert rule or change its scope",
174
+ arguments: [{ name: "ruleId", required: true }],
188
175
  options: [
189
- ...scopeOptions,
176
+ projectScopeOption,
177
+ mutationAllOption,
190
178
  formatOption,
191
179
  jsonOption,
192
180
  {
193
- name: "body",
194
- shorthand: null,
195
- type: String,
196
- argument: "PATH",
197
- deprecated: false,
198
- description: "Path to partial JSON. Omitted fields remain unchanged; null clears supported optional fields."
181
+ ...bodyOption,
182
+ description: "Read the partial update body from a JSON file"
199
183
  }
200
184
  ],
201
185
  examples: [
202
186
  {
203
- name: "Update from file",
187
+ name: "Update fields from a file",
204
188
  value: `${packageName} alerts rules update ar_abc123 --body ./patch.json`
189
+ },
190
+ {
191
+ name: "Move a rule to a project",
192
+ value: `${packageName} alerts rules update ar_abc123 --project my-app`
205
193
  }
206
194
  ]
207
195
  };
208
196
  var rulesAggregateCommand = {
209
197
  name: "rules",
210
198
  aliases: [],
211
- description: "Create, list, update, or delete alert notification rules (dashboard parity).",
199
+ description: "Create, inspect, list, update, and delete alert rules",
212
200
  arguments: [],
213
201
  subcommands: [
214
202
  rulesLsSubcommand,
@@ -221,20 +209,16 @@ var rulesAggregateCommand = {
221
209
  options: [],
222
210
  examples: [
223
211
  {
224
- name: "List rules",
212
+ name: "List rules for the linked project",
225
213
  value: `${packageName} alerts rules ls`
226
214
  },
227
215
  {
228
- name: "List custom alert rules",
229
- value: `${packageName} alerts rules ls --type custom_alert`
230
- },
231
- {
232
- name: "Show schema for a rule type",
233
- value: `${packageName} alerts rules schema --type custom_alert`
216
+ name: "Show the custom rule schema",
217
+ value: `${packageName} alerts rules schema --type custom`
234
218
  },
235
219
  {
236
220
  name: "Add a rule",
237
- value: `${packageName} alerts rules add --body ./rule.json`
221
+ value: `${packageName} alerts rules add --project my-app --body ./rule.json`
238
222
  },
239
223
  {
240
224
  name: "Inspect a rule",
@@ -10,10 +10,10 @@ import {
10
10
  } from "./chunk-VUS2JQB2.js";
11
11
  import {
12
12
  getScope
13
- } from "./chunk-4IVSM24H.js";
13
+ } from "./chunk-ABSZNJQO.js";
14
14
  import {
15
15
  getOrgById
16
- } from "./chunk-2TSBB22D.js";
16
+ } from "./chunk-MADFAH3O.js";
17
17
  import {
18
18
  buildCommandWithGlobalFlags,
19
19
  outputAgentError,
@@ -24,11 +24,11 @@ import {
24
24
  } from "./chunk-VUS2JQB2.js";
25
25
  import {
26
26
  getScope
27
- } from "./chunk-4IVSM24H.js";
27
+ } from "./chunk-ABSZNJQO.js";
28
28
  import {
29
29
  getLinkedProject,
30
30
  getProjectByNameOrId
31
- } from "./chunk-2TSBB22D.js";
31
+ } from "./chunk-MADFAH3O.js";
32
32
  import {
33
33
  buildCommandWithGlobalFlags,
34
34
  outputAgentError
@@ -0,0 +1,74 @@
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
+ indent_default
9
+ } from "./chunk-A3NYPUKZ.js";
10
+ import {
11
+ humanizeIdentifier
12
+ } from "./chunk-FGDKMNEN.js";
13
+ import {
14
+ table
15
+ } from "./chunk-NW34PW6V.js";
16
+
17
+ // src/commands/alerts/format.ts
18
+ function renderAlertTable(rows, hsep = 3) {
19
+ return indent_default(
20
+ table(rows, { hsep }).split("\n").map((line) => line.trimEnd()).join("\n"),
21
+ 2
22
+ );
23
+ }
24
+ function normalizeTimestamp(value) {
25
+ if (value === void 0 || !Number.isFinite(value)) {
26
+ return void 0;
27
+ }
28
+ return Math.abs(value) < 1e12 ? value * 1e3 : value;
29
+ }
30
+ function getPrimaryAlert(group) {
31
+ return group.alerts?.[0];
32
+ }
33
+ function getGroupTitle(group) {
34
+ return group.ai?.title || group.title || getPrimaryAlert(group)?.title || "Alert group";
35
+ }
36
+ function getGroupType(group) {
37
+ return group.type || getPrimaryAlert(group)?.type || "-";
38
+ }
39
+ function getGroupStartedAt(group) {
40
+ const primaryAlert = getPrimaryAlert(group);
41
+ return normalizeTimestamp(
42
+ group.recordedStartedAt ?? primaryAlert?.recordedStartedAt ?? primaryAlert?.startedAt
43
+ );
44
+ }
45
+ function formatTriggerOperator(value) {
46
+ switch (value) {
47
+ case "gt":
48
+ return ">";
49
+ case "gte":
50
+ return ">=";
51
+ case "lt":
52
+ return "<";
53
+ case "lte":
54
+ return "<=";
55
+ default:
56
+ return void 0;
57
+ }
58
+ }
59
+ function humanizeReference(value, opts = {}) {
60
+ return value.split("/").map((part) => {
61
+ const label = humanizeIdentifier(part);
62
+ return opts.case === "title" ? label : label.toLowerCase();
63
+ }).join(" / ");
64
+ }
65
+
66
+ export {
67
+ renderAlertTable,
68
+ normalizeTimestamp,
69
+ getGroupTitle,
70
+ getGroupType,
71
+ getGroupStartedAt,
72
+ formatTriggerOperator,
73
+ humanizeReference
74
+ };
@@ -813,5 +813,6 @@ export {
813
813
  toGranularityMsFromDuration,
814
814
  isCanonicalAggregation,
815
815
  getDefaultCustomMetricAggregation,
816
+ generateSparkline,
816
817
  formatText
817
818
  };
@@ -6,7 +6,7 @@ const __filename = __fileURLToPath(import.meta.url);
6
6
  const __dirname = __dirname_(__filename);
7
7
  import {
8
8
  rulesAggregateCommand
9
- } from "./chunk-XM3LOQIX.js";
9
+ } from "./chunk-EDMW7SBH.js";
10
10
  import {
11
11
  formatOption,
12
12
  jsonOption,
@@ -57,7 +57,7 @@ async function fetchMetricCatalog(client, accountId, kind, search, activeSince)
57
57
  }
58
58
  const response = await client.fetch(
59
59
  `${OBSERVABILITY_METRICS_PATH}?${searchParams}`,
60
- { accountId }
60
+ { accountId, bailOn429: true }
61
61
  );
62
62
  metrics.push(
63
63
  ...response.metrics.map((metric) => ({