checkly 0.0.0-canary.0e426f8

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 (1387) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +127 -0
  3. package/assets/runtimes/snapshots/20260130/runtimes.json +349 -0
  4. package/bin/check-node-version.cjs +21 -0
  5. package/bin/launch.cjs +28 -0
  6. package/bin/run.cjs +32 -0
  7. package/constructs.d.ts +1 -0
  8. package/constructs.js +2 -0
  9. package/dist/ai-context/context.d.ts +168 -0
  10. package/dist/ai-context/context.js +363 -0
  11. package/dist/ai-context/context.js.map +1 -0
  12. package/dist/ai-context/onboarding-boilerplate/__checks__/api.check.ts +22 -0
  13. package/dist/ai-context/onboarding-boilerplate/__checks__/heartbeat.check.ts +16 -0
  14. package/dist/ai-context/onboarding-boilerplate/__checks__/homepage.spec.ts +12 -0
  15. package/dist/ai-context/onboarding-boilerplate/__checks__/url.check.ts +18 -0
  16. package/dist/ai-context/onboarding-boilerplate/checkly-config-template.ts +50 -0
  17. package/dist/ai-context/onboarding-prompts/base.md +1 -0
  18. package/dist/ai-context/onboarding-prompts/playwright.md +1 -0
  19. package/dist/ai-context/public-skills/checkly/README.md +43 -0
  20. package/dist/ai-context/public-skills/checkly/SKILL.md +163 -0
  21. package/dist/ai-context/skills-command/references/communicate-incidents.md +79 -0
  22. package/dist/ai-context/skills-command/references/communicate.md +42 -0
  23. package/dist/ai-context/skills-command/references/configure-alert-channels.md +102 -0
  24. package/dist/ai-context/skills-command/references/configure-api-checks.md +65 -0
  25. package/dist/ai-context/skills-command/references/configure-browser-checks.md +29 -0
  26. package/dist/ai-context/skills-command/references/configure-check-groups.md +17 -0
  27. package/dist/ai-context/skills-command/references/configure-dns-monitors.md +31 -0
  28. package/dist/ai-context/skills-command/references/configure-environment.md +92 -0
  29. package/dist/ai-context/skills-command/references/configure-grpc-monitors.md +61 -0
  30. package/dist/ai-context/skills-command/references/configure-heartbeat-monitors.md +20 -0
  31. package/dist/ai-context/skills-command/references/configure-icmp-monitors.md +34 -0
  32. package/dist/ai-context/skills-command/references/configure-multistep-checks.md +26 -0
  33. package/dist/ai-context/skills-command/references/configure-playwright-checks.md +81 -0
  34. package/dist/ai-context/skills-command/references/configure-ssl-monitors.md +39 -0
  35. package/dist/ai-context/skills-command/references/configure-supporting-constructs.md +176 -0
  36. package/dist/ai-context/skills-command/references/configure-tcp-monitors.md +32 -0
  37. package/dist/ai-context/skills-command/references/configure-traceroute-monitors.md +36 -0
  38. package/dist/ai-context/skills-command/references/configure-url-monitors.md +31 -0
  39. package/dist/ai-context/skills-command/references/configure.md +193 -0
  40. package/dist/ai-context/skills-command/references/initialize.md +133 -0
  41. package/dist/ai-context/skills-command/references/investigate-alerting.md +212 -0
  42. package/dist/ai-context/skills-command/references/investigate-checks.md +172 -0
  43. package/dist/ai-context/skills-command/references/investigate-test-sessions.md +165 -0
  44. package/dist/ai-context/skills-command/references/investigate.md +18 -0
  45. package/dist/ai-context/skills-command/references/manage-account-members.md +82 -0
  46. package/dist/ai-context/skills-command/references/manage-plan.md +49 -0
  47. package/dist/ai-context/skills-command/references/manage.md +53 -0
  48. package/dist/auth/api-key.d.ts +24 -0
  49. package/dist/auth/api-key.js +104 -0
  50. package/dist/auth/api-key.js.map +1 -0
  51. package/dist/auth/device-flow.d.ts +58 -0
  52. package/dist/auth/device-flow.js +228 -0
  53. package/dist/auth/device-flow.js.map +1 -0
  54. package/dist/auth/index.d.ts +15 -0
  55. package/dist/auth/index.js +226 -0
  56. package/dist/auth/index.js.map +1 -0
  57. package/dist/commands/account/plan.d.ts +31 -0
  58. package/dist/commands/account/plan.js +114 -0
  59. package/dist/commands/account/plan.js.map +1 -0
  60. package/dist/commands/account/usage/projections.d.ts +16 -0
  61. package/dist/commands/account/usage/projections.js +40 -0
  62. package/dist/commands/account/usage/projections.js.map +1 -0
  63. package/dist/commands/account/usage/series.d.ts +23 -0
  64. package/dist/commands/account/usage/series.js +55 -0
  65. package/dist/commands/account/usage/series.js.map +1 -0
  66. package/dist/commands/account/usage/summary.d.ts +18 -0
  67. package/dist/commands/account/usage/summary.js +43 -0
  68. package/dist/commands/account/usage/summary.js.map +1 -0
  69. package/dist/commands/account/usage/term.d.ts +15 -0
  70. package/dist/commands/account/usage/term.js +32 -0
  71. package/dist/commands/account/usage/term.js.map +1 -0
  72. package/dist/commands/account/usage/terms.d.ts +16 -0
  73. package/dist/commands/account/usage/terms.js +43 -0
  74. package/dist/commands/account/usage/terms.js.map +1 -0
  75. package/dist/commands/alert-channels/get.d.ts +14 -0
  76. package/dist/commands/alert-channels/get.js +51 -0
  77. package/dist/commands/alert-channels/get.js.map +1 -0
  78. package/dist/commands/alert-channels/list.d.ts +13 -0
  79. package/dist/commands/alert-channels/list.js +65 -0
  80. package/dist/commands/alert-channels/list.js.map +1 -0
  81. package/dist/commands/alert-channels/logs.d.ts +19 -0
  82. package/dist/commands/alert-channels/logs.js +92 -0
  83. package/dist/commands/alert-channels/logs.js.map +1 -0
  84. package/dist/commands/api.d.ts +23 -0
  85. package/dist/commands/api.js +248 -0
  86. package/dist/commands/api.js.map +1 -0
  87. package/dist/commands/assets/download.d.ts +19 -0
  88. package/dist/commands/assets/download.js +174 -0
  89. package/dist/commands/assets/download.js.map +1 -0
  90. package/dist/commands/assets/list.d.ts +17 -0
  91. package/dist/commands/assets/list.js +106 -0
  92. package/dist/commands/assets/list.js.map +1 -0
  93. package/dist/commands/authCommand.d.ts +39 -0
  94. package/dist/commands/authCommand.js +176 -0
  95. package/dist/commands/authCommand.js.map +1 -0
  96. package/dist/commands/baseCommand.d.ts +46 -0
  97. package/dist/commands/baseCommand.js +162 -0
  98. package/dist/commands/baseCommand.js.map +1 -0
  99. package/dist/commands/checks/delete.d.ts +15 -0
  100. package/dist/commands/checks/delete.js +65 -0
  101. package/dist/commands/checks/delete.js.map +1 -0
  102. package/dist/commands/checks/get.d.ts +30 -0
  103. package/dist/commands/checks/get.js +380 -0
  104. package/dist/commands/checks/get.js.map +1 -0
  105. package/dist/commands/checks/list.d.ts +18 -0
  106. package/dist/commands/checks/list.js +124 -0
  107. package/dist/commands/checks/list.js.map +1 -0
  108. package/dist/commands/checks/run.d.ts +18 -0
  109. package/dist/commands/checks/run.js +141 -0
  110. package/dist/commands/checks/run.js.map +1 -0
  111. package/dist/commands/checks/stats.d.ts +22 -0
  112. package/dist/commands/checks/stats.js +182 -0
  113. package/dist/commands/checks/stats.js.map +1 -0
  114. package/dist/commands/debug/parse-file.d.ts +13 -0
  115. package/dist/commands/debug/parse-file.js +74 -0
  116. package/dist/commands/debug/parse-file.js.map +1 -0
  117. package/dist/commands/debug/parse-playwright-config.d.ts +9 -0
  118. package/dist/commands/debug/parse-playwright-config.js +27 -0
  119. package/dist/commands/debug/parse-playwright-config.js.map +1 -0
  120. package/dist/commands/debug/parse-project.d.ts +44 -0
  121. package/dist/commands/debug/parse-project.js +223 -0
  122. package/dist/commands/debug/parse-project.js.map +1 -0
  123. package/dist/commands/deploy.d.ts +29 -0
  124. package/dist/commands/deploy.js +915 -0
  125. package/dist/commands/deploy.js.map +1 -0
  126. package/dist/commands/destroy.d.ts +13 -0
  127. package/dist/commands/destroy.js +105 -0
  128. package/dist/commands/destroy.js.map +1 -0
  129. package/dist/commands/env/add.d.ts +14 -0
  130. package/dist/commands/env/add.js +54 -0
  131. package/dist/commands/env/add.js.map +1 -0
  132. package/dist/commands/env/ls.d.ts +8 -0
  133. package/dist/commands/env/ls.js +21 -0
  134. package/dist/commands/env/ls.js.map +1 -0
  135. package/dist/commands/env/pull.d.ts +14 -0
  136. package/dist/commands/env/pull.js +72 -0
  137. package/dist/commands/env/pull.js.map +1 -0
  138. package/dist/commands/env/rm.d.ts +13 -0
  139. package/dist/commands/env/rm.js +46 -0
  140. package/dist/commands/env/rm.js.map +1 -0
  141. package/dist/commands/env/update.d.ts +15 -0
  142. package/dist/commands/env/update.js +55 -0
  143. package/dist/commands/env/update.js.map +1 -0
  144. package/dist/commands/help.d.ts +6 -0
  145. package/dist/commands/help.js +11 -0
  146. package/dist/commands/help.js.map +1 -0
  147. package/dist/commands/import/apply.d.ts +16 -0
  148. package/dist/commands/import/apply.js +152 -0
  149. package/dist/commands/import/apply.js.map +1 -0
  150. package/dist/commands/import/cancel.d.ts +16 -0
  151. package/dist/commands/import/cancel.js +123 -0
  152. package/dist/commands/import/cancel.js.map +1 -0
  153. package/dist/commands/import/commit.d.ts +18 -0
  154. package/dist/commands/import/commit.js +147 -0
  155. package/dist/commands/import/commit.js.map +1 -0
  156. package/dist/commands/import/plan.d.ts +23 -0
  157. package/dist/commands/import/plan.js +1288 -0
  158. package/dist/commands/import/plan.js.map +1 -0
  159. package/dist/commands/incidents/create.d.ts +17 -0
  160. package/dist/commands/incidents/create.js +103 -0
  161. package/dist/commands/incidents/create.js.map +1 -0
  162. package/dist/commands/incidents/list.d.ts +14 -0
  163. package/dist/commands/incidents/list.js +80 -0
  164. package/dist/commands/incidents/list.js.map +1 -0
  165. package/dist/commands/incidents/resolve.d.ts +16 -0
  166. package/dist/commands/incidents/resolve.js +79 -0
  167. package/dist/commands/incidents/resolve.js.map +1 -0
  168. package/dist/commands/incidents/update.d.ts +18 -0
  169. package/dist/commands/incidents/update.js +106 -0
  170. package/dist/commands/incidents/update.js.map +1 -0
  171. package/dist/commands/init.d.ts +25 -0
  172. package/dist/commands/init.js +296 -0
  173. package/dist/commands/init.js.map +1 -0
  174. package/dist/commands/login.d.ts +50 -0
  175. package/dist/commands/login.js +892 -0
  176. package/dist/commands/login.js.map +1 -0
  177. package/dist/commands/logout.d.ts +10 -0
  178. package/dist/commands/logout.js +47 -0
  179. package/dist/commands/logout.js.map +1 -0
  180. package/dist/commands/members/delete.d.ts +18 -0
  181. package/dist/commands/members/delete.js +73 -0
  182. package/dist/commands/members/delete.js.map +1 -0
  183. package/dist/commands/members/update.d.ts +21 -0
  184. package/dist/commands/members/update.js +104 -0
  185. package/dist/commands/members/update.js.map +1 -0
  186. package/dist/commands/members.d.ts +23 -0
  187. package/dist/commands/members.js +136 -0
  188. package/dist/commands/members.js.map +1 -0
  189. package/dist/commands/pw-test.d.ts +34 -0
  190. package/dist/commands/pw-test.js +365 -0
  191. package/dist/commands/pw-test.js.map +1 -0
  192. package/dist/commands/rca/get.d.ts +15 -0
  193. package/dist/commands/rca/get.js +69 -0
  194. package/dist/commands/rca/get.js.map +1 -0
  195. package/dist/commands/rca/run.d.ts +16 -0
  196. package/dist/commands/rca/run.js +113 -0
  197. package/dist/commands/rca/run.js.map +1 -0
  198. package/dist/commands/runtimes.d.ts +8 -0
  199. package/dist/commands/runtimes.js +25 -0
  200. package/dist/commands/runtimes.js.map +1 -0
  201. package/dist/commands/skills/index.d.ts +16 -0
  202. package/dist/commands/skills/index.js +143 -0
  203. package/dist/commands/skills/index.js.map +1 -0
  204. package/dist/commands/skills/install.d.ts +17 -0
  205. package/dist/commands/skills/install.js +124 -0
  206. package/dist/commands/skills/install.js.map +1 -0
  207. package/dist/commands/status-pages/get.d.ts +14 -0
  208. package/dist/commands/status-pages/get.js +48 -0
  209. package/dist/commands/status-pages/get.js.map +1 -0
  210. package/dist/commands/status-pages/list.d.ts +14 -0
  211. package/dist/commands/status-pages/list.js +82 -0
  212. package/dist/commands/status-pages/list.js.map +1 -0
  213. package/dist/commands/switch.d.ts +19 -0
  214. package/dist/commands/switch.js +110 -0
  215. package/dist/commands/switch.js.map +1 -0
  216. package/dist/commands/sync-playwright.d.ts +8 -0
  217. package/dist/commands/sync-playwright.js +48 -0
  218. package/dist/commands/sync-playwright.js.map +1 -0
  219. package/dist/commands/test-sessions/get.d.ts +21 -0
  220. package/dist/commands/test-sessions/get.js +121 -0
  221. package/dist/commands/test-sessions/get.js.map +1 -0
  222. package/dist/commands/test-sessions/list.d.ts +22 -0
  223. package/dist/commands/test-sessions/list.js +190 -0
  224. package/dist/commands/test-sessions/list.js.map +1 -0
  225. package/dist/commands/test.d.ts +39 -0
  226. package/dist/commands/test.js +403 -0
  227. package/dist/commands/test.js.map +1 -0
  228. package/dist/commands/trigger.d.ts +39 -0
  229. package/dist/commands/trigger.js +251 -0
  230. package/dist/commands/trigger.js.map +1 -0
  231. package/dist/commands/validate.d.ts +13 -0
  232. package/dist/commands/validate.js +66 -0
  233. package/dist/commands/validate.js.map +1 -0
  234. package/dist/commands/whoami.d.ts +16 -0
  235. package/dist/commands/whoami.js +79 -0
  236. package/dist/commands/whoami.js.map +1 -0
  237. package/dist/config.d.ts +31 -0
  238. package/dist/config.js +4 -0
  239. package/dist/config.js.map +1 -0
  240. package/dist/constants.d.ts +20 -0
  241. package/dist/constants.js +35 -0
  242. package/dist/constants.js.map +1 -0
  243. package/dist/constructs/alert-channel-codegen.d.ts +42 -0
  244. package/dist/constructs/alert-channel-codegen.js +102 -0
  245. package/dist/constructs/alert-channel-codegen.js.map +1 -0
  246. package/dist/constructs/alert-channel-subscription-codegen.d.ts +11 -0
  247. package/dist/constructs/alert-channel-subscription-codegen.js +20 -0
  248. package/dist/constructs/alert-channel-subscription-codegen.js.map +1 -0
  249. package/dist/constructs/alert-channel-subscription.d.ts +47 -0
  250. package/dist/constructs/alert-channel-subscription.js +49 -0
  251. package/dist/constructs/alert-channel-subscription.js.map +1 -0
  252. package/dist/constructs/alert-channel.d.ts +130 -0
  253. package/dist/constructs/alert-channel.js +106 -0
  254. package/dist/constructs/alert-channel.js.map +1 -0
  255. package/dist/constructs/alert-escalation-policy-codegen.d.ts +11 -0
  256. package/dist/constructs/alert-escalation-policy-codegen.js +72 -0
  257. package/dist/constructs/alert-escalation-policy-codegen.js.map +1 -0
  258. package/dist/constructs/alert-escalation-policy.d.ts +114 -0
  259. package/dist/constructs/alert-escalation-policy.js +62 -0
  260. package/dist/constructs/alert-escalation-policy.js.map +1 -0
  261. package/dist/constructs/api-assertion-codegen.d.ts +3 -0
  262. package/dist/constructs/api-assertion-codegen.js +19 -0
  263. package/dist/constructs/api-assertion-codegen.js.map +1 -0
  264. package/dist/constructs/api-assertion.d.ts +72 -0
  265. package/dist/constructs/api-assertion.js +77 -0
  266. package/dist/constructs/api-assertion.js.map +1 -0
  267. package/dist/constructs/api-check-bundle.d.ts +66 -0
  268. package/dist/constructs/api-check-bundle.js +30 -0
  269. package/dist/constructs/api-check-bundle.js.map +1 -0
  270. package/dist/constructs/api-check-codegen.d.ts +19 -0
  271. package/dist/constructs/api-check-codegen.js +83 -0
  272. package/dist/constructs/api-check-codegen.js.map +1 -0
  273. package/dist/constructs/api-check.d.ts +189 -0
  274. package/dist/constructs/api-check.js +215 -0
  275. package/dist/constructs/api-check.js.map +1 -0
  276. package/dist/constructs/api-request-codegen.d.ts +4 -0
  277. package/dist/constructs/api-request-codegen.js +66 -0
  278. package/dist/constructs/api-request-codegen.js.map +1 -0
  279. package/dist/constructs/api-request.d.ts +67 -0
  280. package/dist/constructs/api-request.js +2 -0
  281. package/dist/constructs/api-request.js.map +1 -0
  282. package/dist/constructs/browser-check-bundle.d.ts +64 -0
  283. package/dist/constructs/browser-check-bundle.js +31 -0
  284. package/dist/constructs/browser-check-bundle.js.map +1 -0
  285. package/dist/constructs/browser-check-codegen.d.ts +14 -0
  286. package/dist/constructs/browser-check-codegen.js +46 -0
  287. package/dist/constructs/browser-check-codegen.js.map +1 -0
  288. package/dist/constructs/browser-check.d.ts +134 -0
  289. package/dist/constructs/browser-check.js +169 -0
  290. package/dist/constructs/browser-check.js.map +1 -0
  291. package/dist/constructs/check-codegen.d.ts +140 -0
  292. package/dist/constructs/check-codegen.js +387 -0
  293. package/dist/constructs/check-codegen.js.map +1 -0
  294. package/dist/constructs/check-config.d.ts +2 -0
  295. package/dist/constructs/check-config.js +17 -0
  296. package/dist/constructs/check-config.js.map +1 -0
  297. package/dist/constructs/check-group-codegen.d.ts +46 -0
  298. package/dist/constructs/check-group-codegen.js +282 -0
  299. package/dist/constructs/check-group-codegen.js.map +1 -0
  300. package/dist/constructs/check-group-ref.d.ts +20 -0
  301. package/dist/constructs/check-group-ref.js +46 -0
  302. package/dist/constructs/check-group-ref.js.map +1 -0
  303. package/dist/constructs/check-group-v1.d.ts +316 -0
  304. package/dist/constructs/check-group-v1.js +285 -0
  305. package/dist/constructs/check-group-v1.js.map +1 -0
  306. package/dist/constructs/check-group-v2.d.ts +101 -0
  307. package/dist/constructs/check-group-v2.js +68 -0
  308. package/dist/constructs/check-group-v2.js.map +1 -0
  309. package/dist/constructs/check-group.d.ts +4 -0
  310. package/dist/constructs/check-group.js +5 -0
  311. package/dist/constructs/check-group.js.map +1 -0
  312. package/dist/constructs/check.d.ts +483 -0
  313. package/dist/constructs/check.js +444 -0
  314. package/dist/constructs/check.js.map +1 -0
  315. package/dist/constructs/construct-codegen.d.ts +42 -0
  316. package/dist/constructs/construct-codegen.js +106 -0
  317. package/dist/constructs/construct-codegen.js.map +1 -0
  318. package/dist/constructs/construct-diagnostics.d.ts +56 -0
  319. package/dist/constructs/construct-diagnostics.js +167 -0
  320. package/dist/constructs/construct-diagnostics.js.map +1 -0
  321. package/dist/constructs/construct.d.ts +175 -0
  322. package/dist/constructs/construct.js +179 -0
  323. package/dist/constructs/construct.js.map +1 -0
  324. package/dist/constructs/dashboard-bundle.d.ts +11 -0
  325. package/dist/constructs/dashboard-bundle.js +15 -0
  326. package/dist/constructs/dashboard-bundle.js.map +1 -0
  327. package/dist/constructs/dashboard-codegen.d.ts +29 -0
  328. package/dist/constructs/dashboard-codegen.js +104 -0
  329. package/dist/constructs/dashboard-codegen.js.map +1 -0
  330. package/dist/constructs/dashboard.d.ts +226 -0
  331. package/dist/constructs/dashboard.js +144 -0
  332. package/dist/constructs/dashboard.js.map +1 -0
  333. package/dist/constructs/diagnostics.d.ts +59 -0
  334. package/dist/constructs/diagnostics.js +71 -0
  335. package/dist/constructs/diagnostics.js.map +1 -0
  336. package/dist/constructs/dns-assertion-codegen.d.ts +3 -0
  337. package/dist/constructs/dns-assertion-codegen.js +26 -0
  338. package/dist/constructs/dns-assertion-codegen.js.map +1 -0
  339. package/dist/constructs/dns-assertion.d.ts +49 -0
  340. package/dist/constructs/dns-assertion.js +55 -0
  341. package/dist/constructs/dns-assertion.js.map +1 -0
  342. package/dist/constructs/dns-monitor-codegen.d.ts +13 -0
  343. package/dist/constructs/dns-monitor-codegen.js +34 -0
  344. package/dist/constructs/dns-monitor-codegen.js.map +1 -0
  345. package/dist/constructs/dns-monitor.d.ts +98 -0
  346. package/dist/constructs/dns-monitor.js +62 -0
  347. package/dist/constructs/dns-monitor.js.map +1 -0
  348. package/dist/constructs/dns-request-codegen.d.ts +4 -0
  349. package/dist/constructs/dns-request-codegen.js +28 -0
  350. package/dist/constructs/dns-request-codegen.js.map +1 -0
  351. package/dist/constructs/dns-request.d.ts +54 -0
  352. package/dist/constructs/dns-request.js +2 -0
  353. package/dist/constructs/dns-request.js.map +1 -0
  354. package/dist/constructs/email-alert-channel-codegen.d.ts +13 -0
  355. package/dist/constructs/email-alert-channel-codegen.js +34 -0
  356. package/dist/constructs/email-alert-channel-codegen.js.map +1 -0
  357. package/dist/constructs/email-alert-channel.d.ts +27 -0
  358. package/dist/constructs/email-alert-channel.js +37 -0
  359. package/dist/constructs/email-alert-channel.js.map +1 -0
  360. package/dist/constructs/engine.d.ts +42 -0
  361. package/dist/constructs/engine.js +25 -0
  362. package/dist/constructs/engine.js.map +1 -0
  363. package/dist/constructs/environment-variable.d.ts +21 -0
  364. package/dist/constructs/environment-variable.js +2 -0
  365. package/dist/constructs/environment-variable.js.map +1 -0
  366. package/dist/constructs/frequency-codegen.d.ts +8 -0
  367. package/dist/constructs/frequency-codegen.js +59 -0
  368. package/dist/constructs/frequency-codegen.js.map +1 -0
  369. package/dist/constructs/frequency.d.ts +67 -0
  370. package/dist/constructs/frequency.js +71 -0
  371. package/dist/constructs/frequency.js.map +1 -0
  372. package/dist/constructs/grpc-assertion-codegen.d.ts +3 -0
  373. package/dist/constructs/grpc-assertion-codegen.js +89 -0
  374. package/dist/constructs/grpc-assertion-codegen.js.map +1 -0
  375. package/dist/constructs/grpc-assertion-validation.d.ts +13 -0
  376. package/dist/constructs/grpc-assertion-validation.js +69 -0
  377. package/dist/constructs/grpc-assertion-validation.js.map +1 -0
  378. package/dist/constructs/grpc-assertion.d.ts +96 -0
  379. package/dist/constructs/grpc-assertion.js +110 -0
  380. package/dist/constructs/grpc-assertion.js.map +1 -0
  381. package/dist/constructs/grpc-monitor-codegen.d.ts +13 -0
  382. package/dist/constructs/grpc-monitor-codegen.js +34 -0
  383. package/dist/constructs/grpc-monitor-codegen.js.map +1 -0
  384. package/dist/constructs/grpc-monitor.d.ts +94 -0
  385. package/dist/constructs/grpc-monitor.js +82 -0
  386. package/dist/constructs/grpc-monitor.js.map +1 -0
  387. package/dist/constructs/grpc-request-codegen.d.ts +4 -0
  388. package/dist/constructs/grpc-request-codegen.js +74 -0
  389. package/dist/constructs/grpc-request-codegen.js.map +1 -0
  390. package/dist/constructs/grpc-request.d.ts +154 -0
  391. package/dist/constructs/grpc-request.js +2 -0
  392. package/dist/constructs/grpc-request.js.map +1 -0
  393. package/dist/constructs/heartbeat-monitor-codegen.d.ts +11 -0
  394. package/dist/constructs/heartbeat-monitor-codegen.js +31 -0
  395. package/dist/constructs/heartbeat-monitor-codegen.js.map +1 -0
  396. package/dist/constructs/heartbeat-monitor.d.ts +41 -0
  397. package/dist/constructs/heartbeat-monitor.js +56 -0
  398. package/dist/constructs/heartbeat-monitor.js.map +1 -0
  399. package/dist/constructs/http-header.d.ts +18 -0
  400. package/dist/constructs/http-header.js +2 -0
  401. package/dist/constructs/http-header.js.map +1 -0
  402. package/dist/constructs/http-request.d.ts +2 -0
  403. package/dist/constructs/http-request.js +2 -0
  404. package/dist/constructs/http-request.js.map +1 -0
  405. package/dist/constructs/icmp-assertion-codegen.d.ts +3 -0
  406. package/dist/constructs/icmp-assertion-codegen.js +18 -0
  407. package/dist/constructs/icmp-assertion-codegen.js.map +1 -0
  408. package/dist/constructs/icmp-assertion.d.ts +56 -0
  409. package/dist/constructs/icmp-assertion.js +57 -0
  410. package/dist/constructs/icmp-assertion.js.map +1 -0
  411. package/dist/constructs/icmp-monitor-codegen.d.ts +13 -0
  412. package/dist/constructs/icmp-monitor-codegen.js +34 -0
  413. package/dist/constructs/icmp-monitor-codegen.js.map +1 -0
  414. package/dist/constructs/icmp-monitor.d.ts +94 -0
  415. package/dist/constructs/icmp-monitor.js +50 -0
  416. package/dist/constructs/icmp-monitor.js.map +1 -0
  417. package/dist/constructs/icmp-request-codegen.d.ts +4 -0
  418. package/dist/constructs/icmp-request-codegen.js +24 -0
  419. package/dist/constructs/icmp-request-codegen.js.map +1 -0
  420. package/dist/constructs/icmp-request.d.ts +37 -0
  421. package/dist/constructs/icmp-request.js +2 -0
  422. package/dist/constructs/icmp-request.js.map +1 -0
  423. package/dist/constructs/incident.d.ts +15 -0
  424. package/dist/constructs/incident.js +2 -0
  425. package/dist/constructs/incident.js.map +1 -0
  426. package/dist/constructs/incidentio-alert-channel-codegen.d.ts +13 -0
  427. package/dist/constructs/incidentio-alert-channel-codegen.js +91 -0
  428. package/dist/constructs/incidentio-alert-channel-codegen.js.map +1 -0
  429. package/dist/constructs/incidentio-alert-channel.d.ts +44 -0
  430. package/dist/constructs/incidentio-alert-channel.js +67 -0
  431. package/dist/constructs/incidentio-alert-channel.js.map +1 -0
  432. package/dist/constructs/index.d.ts +66 -0
  433. package/dist/constructs/index.js +67 -0
  434. package/dist/constructs/index.js.map +1 -0
  435. package/dist/constructs/internal/account-features.d.ts +13 -0
  436. package/dist/constructs/internal/account-features.js +24 -0
  437. package/dist/constructs/internal/account-features.js.map +1 -0
  438. package/dist/constructs/internal/assertion-codegen.d.ts +31 -0
  439. package/dist/constructs/internal/assertion-codegen.js +180 -0
  440. package/dist/constructs/internal/assertion-codegen.js.map +1 -0
  441. package/dist/constructs/internal/assertion-grammar.d.ts +35 -0
  442. package/dist/constructs/internal/assertion-grammar.js +75 -0
  443. package/dist/constructs/internal/assertion-grammar.js.map +1 -0
  444. package/dist/constructs/internal/assertion-validation.d.ts +3 -0
  445. package/dist/constructs/internal/assertion-validation.js +16 -0
  446. package/dist/constructs/internal/assertion-validation.js.map +1 -0
  447. package/dist/constructs/internal/assertion.d.ts +46 -0
  448. package/dist/constructs/internal/assertion.js +94 -0
  449. package/dist/constructs/internal/assertion.js.map +1 -0
  450. package/dist/constructs/internal/codegen/codegen.d.ts +9 -0
  451. package/dist/constructs/internal/codegen/codegen.js +16 -0
  452. package/dist/constructs/internal/codegen/codegen.js.map +1 -0
  453. package/dist/constructs/internal/codegen/context.d.ts +137 -0
  454. package/dist/constructs/internal/codegen/context.js +543 -0
  455. package/dist/constructs/internal/codegen/context.js.map +1 -0
  456. package/dist/constructs/internal/codegen/index.d.ts +6 -0
  457. package/dist/constructs/internal/codegen/index.js +6 -0
  458. package/dist/constructs/internal/codegen/index.js.map +1 -0
  459. package/dist/constructs/internal/codegen/render.d.ts +68 -0
  460. package/dist/constructs/internal/codegen/render.js +75 -0
  461. package/dist/constructs/internal/codegen/render.js.map +1 -0
  462. package/dist/constructs/internal/codegen/safety.d.ts +2 -0
  463. package/dist/constructs/internal/codegen/safety.js +3 -0
  464. package/dist/constructs/internal/codegen/safety.js.map +1 -0
  465. package/dist/constructs/internal/codegen/snippet.d.ts +12 -0
  466. package/dist/constructs/internal/codegen/snippet.js +39 -0
  467. package/dist/constructs/internal/codegen/snippet.js.map +1 -0
  468. package/dist/constructs/internal/common-diagnostics.d.ts +21 -0
  469. package/dist/constructs/internal/common-diagnostics.js +88 -0
  470. package/dist/constructs/internal/common-diagnostics.js.map +1 -0
  471. package/dist/constructs/internal/declaring-file.d.ts +39 -0
  472. package/dist/constructs/internal/declaring-file.js +139 -0
  473. package/dist/constructs/internal/declaring-file.js.map +1 -0
  474. package/dist/constructs/internal/default-retry-strategy.d.ts +9 -0
  475. package/dist/constructs/internal/default-retry-strategy.js +13 -0
  476. package/dist/constructs/internal/default-retry-strategy.js.map +1 -0
  477. package/dist/constructs/internal/retry-strategy-defaults.d.ts +13 -0
  478. package/dist/constructs/internal/retry-strategy-defaults.js +14 -0
  479. package/dist/constructs/internal/retry-strategy-defaults.js.map +1 -0
  480. package/dist/constructs/internal/sanitize.d.ts +15 -0
  481. package/dist/constructs/internal/sanitize.js +36 -0
  482. package/dist/constructs/internal/sanitize.js.map +1 -0
  483. package/dist/constructs/internal/status-page-v3-component-configuration.d.ts +10 -0
  484. package/dist/constructs/internal/status-page-v3-component-configuration.js +13 -0
  485. package/dist/constructs/internal/status-page-v3-component-configuration.js.map +1 -0
  486. package/dist/constructs/internal/status-page-v3-theme-colors.d.ts +4 -0
  487. package/dist/constructs/internal/status-page-v3-theme-colors.js +21 -0
  488. package/dist/constructs/internal/status-page-v3-theme-colors.js.map +1 -0
  489. package/dist/constructs/ip.d.ts +2 -0
  490. package/dist/constructs/ip.js +2 -0
  491. package/dist/constructs/ip.js.map +1 -0
  492. package/dist/constructs/key-value-pair-codegen.d.ts +9 -0
  493. package/dist/constructs/key-value-pair-codegen.js +56 -0
  494. package/dist/constructs/key-value-pair-codegen.js.map +1 -0
  495. package/dist/constructs/key-value-pair.d.ts +41 -0
  496. package/dist/constructs/key-value-pair.js +2 -0
  497. package/dist/constructs/key-value-pair.js.map +1 -0
  498. package/dist/constructs/maintenance-window-codegen.d.ts +21 -0
  499. package/dist/constructs/maintenance-window-codegen.js +70 -0
  500. package/dist/constructs/maintenance-window-codegen.js.map +1 -0
  501. package/dist/constructs/maintenance-window.d.ts +96 -0
  502. package/dist/constructs/maintenance-window.js +86 -0
  503. package/dist/constructs/maintenance-window.js.map +1 -0
  504. package/dist/constructs/monitor-codegen.d.ts +1 -0
  505. package/dist/constructs/monitor-codegen.js +2 -0
  506. package/dist/constructs/monitor-codegen.js.map +1 -0
  507. package/dist/constructs/monitor.d.ts +106 -0
  508. package/dist/constructs/monitor.js +15 -0
  509. package/dist/constructs/monitor.js.map +1 -0
  510. package/dist/constructs/msteams-alert-channel-codegen.d.ts +13 -0
  511. package/dist/constructs/msteams-alert-channel-codegen.js +61 -0
  512. package/dist/constructs/msteams-alert-channel-codegen.js.map +1 -0
  513. package/dist/constructs/msteams-alert-channel.d.ts +39 -0
  514. package/dist/constructs/msteams-alert-channel.js +162 -0
  515. package/dist/constructs/msteams-alert-channel.js.map +1 -0
  516. package/dist/constructs/multi-step-check-bundle.d.ts +55 -0
  517. package/dist/constructs/multi-step-check-bundle.js +21 -0
  518. package/dist/constructs/multi-step-check-bundle.js.map +1 -0
  519. package/dist/constructs/multi-step-check-codegen.d.ts +13 -0
  520. package/dist/constructs/multi-step-check-codegen.js +37 -0
  521. package/dist/constructs/multi-step-check-codegen.js.map +1 -0
  522. package/dist/constructs/multi-step-check.d.ts +83 -0
  523. package/dist/constructs/multi-step-check.js +121 -0
  524. package/dist/constructs/multi-step-check.js.map +1 -0
  525. package/dist/constructs/opsgenie-alert-channel-codegen.d.ts +16 -0
  526. package/dist/constructs/opsgenie-alert-channel-codegen.js +37 -0
  527. package/dist/constructs/opsgenie-alert-channel-codegen.js.map +1 -0
  528. package/dist/constructs/opsgenie-alert-channel.d.ts +46 -0
  529. package/dist/constructs/opsgenie-alert-channel.js +47 -0
  530. package/dist/constructs/opsgenie-alert-channel.js.map +1 -0
  531. package/dist/constructs/pagerduty-alert-channel-codegen.d.ts +15 -0
  532. package/dist/constructs/pagerduty-alert-channel-codegen.js +49 -0
  533. package/dist/constructs/pagerduty-alert-channel-codegen.js.map +1 -0
  534. package/dist/constructs/pagerduty-alert-channel.d.ts +40 -0
  535. package/dist/constructs/pagerduty-alert-channel.js +44 -0
  536. package/dist/constructs/pagerduty-alert-channel.js.map +1 -0
  537. package/dist/constructs/phone-call-alert-channel-codegen.d.ts +14 -0
  538. package/dist/constructs/phone-call-alert-channel-codegen.js +42 -0
  539. package/dist/constructs/phone-call-alert-channel-codegen.js.map +1 -0
  540. package/dist/constructs/phone-call-alert-channel.d.ts +34 -0
  541. package/dist/constructs/phone-call-alert-channel.js +42 -0
  542. package/dist/constructs/phone-call-alert-channel.js.map +1 -0
  543. package/dist/constructs/playwright-check-bundle.d.ts +71 -0
  544. package/dist/constructs/playwright-check-bundle.js +36 -0
  545. package/dist/constructs/playwright-check-bundle.js.map +1 -0
  546. package/dist/constructs/playwright-check-codegen.d.ts +85 -0
  547. package/dist/constructs/playwright-check-codegen.js +212 -0
  548. package/dist/constructs/playwright-check-codegen.js.map +1 -0
  549. package/dist/constructs/playwright-check.d.ts +176 -0
  550. package/dist/constructs/playwright-check.js +293 -0
  551. package/dist/constructs/playwright-check.js.map +1 -0
  552. package/dist/constructs/playwright-config-codegen.d.ts +4 -0
  553. package/dist/constructs/playwright-config-codegen.js +5 -0
  554. package/dist/constructs/playwright-config-codegen.js.map +1 -0
  555. package/dist/constructs/playwright-config.d.ts +52 -0
  556. package/dist/constructs/playwright-config.js +2 -0
  557. package/dist/constructs/playwright-config.js.map +1 -0
  558. package/dist/constructs/private-location-check-assignment-codegen.d.ts +10 -0
  559. package/dist/constructs/private-location-check-assignment-codegen.js +15 -0
  560. package/dist/constructs/private-location-check-assignment-codegen.js.map +1 -0
  561. package/dist/constructs/private-location-check-assignment.d.ts +31 -0
  562. package/dist/constructs/private-location-check-assignment.js +40 -0
  563. package/dist/constructs/private-location-check-assignment.js.map +1 -0
  564. package/dist/constructs/private-location-codegen.d.ts +15 -0
  565. package/dist/constructs/private-location-codegen.js +46 -0
  566. package/dist/constructs/private-location-codegen.js.map +1 -0
  567. package/dist/constructs/private-location-group-assignment-codegen.d.ts +10 -0
  568. package/dist/constructs/private-location-group-assignment-codegen.js +15 -0
  569. package/dist/constructs/private-location-group-assignment-codegen.js.map +1 -0
  570. package/dist/constructs/private-location-group-assignment.d.ts +32 -0
  571. package/dist/constructs/private-location-group-assignment.js +43 -0
  572. package/dist/constructs/private-location-group-assignment.js.map +1 -0
  573. package/dist/constructs/private-location.d.ts +66 -0
  574. package/dist/constructs/private-location.js +90 -0
  575. package/dist/constructs/private-location.js.map +1 -0
  576. package/dist/constructs/project-bundle.d.ts +49 -0
  577. package/dist/constructs/project-bundle.js +74 -0
  578. package/dist/constructs/project-bundle.js.map +1 -0
  579. package/dist/constructs/project.d.ts +64 -0
  580. package/dist/constructs/project.js +237 -0
  581. package/dist/constructs/project.js.map +1 -0
  582. package/dist/constructs/query-param.d.ts +18 -0
  583. package/dist/constructs/query-param.js +2 -0
  584. package/dist/constructs/query-param.js.map +1 -0
  585. package/dist/constructs/ref-codegen.d.ts +3 -0
  586. package/dist/constructs/ref-codegen.js +11 -0
  587. package/dist/constructs/ref-codegen.js.map +1 -0
  588. package/dist/constructs/ref.d.ts +49 -0
  589. package/dist/constructs/ref.js +54 -0
  590. package/dist/constructs/ref.js.map +1 -0
  591. package/dist/constructs/retry-strategy-codegen.d.ts +10 -0
  592. package/dist/constructs/retry-strategy-codegen.js +113 -0
  593. package/dist/constructs/retry-strategy-codegen.js.map +1 -0
  594. package/dist/constructs/retry-strategy.d.ts +192 -0
  595. package/dist/constructs/retry-strategy.js +107 -0
  596. package/dist/constructs/retry-strategy.js.map +1 -0
  597. package/dist/constructs/session.d.ts +115 -0
  598. package/dist/constructs/session.js +291 -0
  599. package/dist/constructs/session.js.map +1 -0
  600. package/dist/constructs/slack-alert-channel-codegen.d.ts +14 -0
  601. package/dist/constructs/slack-alert-channel-codegen.js +42 -0
  602. package/dist/constructs/slack-alert-channel-codegen.js.map +1 -0
  603. package/dist/constructs/slack-alert-channel.d.ts +27 -0
  604. package/dist/constructs/slack-alert-channel.js +41 -0
  605. package/dist/constructs/slack-alert-channel.js.map +1 -0
  606. package/dist/constructs/slack-app-alert-channel-codegen.d.ts +13 -0
  607. package/dist/constructs/slack-app-alert-channel-codegen.js +39 -0
  608. package/dist/constructs/slack-app-alert-channel-codegen.js.map +1 -0
  609. package/dist/constructs/slack-app-alert-channel.d.ts +31 -0
  610. package/dist/constructs/slack-app-alert-channel.js +38 -0
  611. package/dist/constructs/slack-app-alert-channel.js.map +1 -0
  612. package/dist/constructs/sms-alert-channel-codegen.d.ts +14 -0
  613. package/dist/constructs/sms-alert-channel-codegen.js +42 -0
  614. package/dist/constructs/sms-alert-channel-codegen.js.map +1 -0
  615. package/dist/constructs/sms-alert-channel.d.ts +33 -0
  616. package/dist/constructs/sms-alert-channel.js +41 -0
  617. package/dist/constructs/sms-alert-channel.js.map +1 -0
  618. package/dist/constructs/ssl-assertion-codegen.d.ts +5 -0
  619. package/dist/constructs/ssl-assertion-codegen.js +74 -0
  620. package/dist/constructs/ssl-assertion-codegen.js.map +1 -0
  621. package/dist/constructs/ssl-assertion-grammar.d.ts +123 -0
  622. package/dist/constructs/ssl-assertion-grammar.js +90 -0
  623. package/dist/constructs/ssl-assertion-grammar.js.map +1 -0
  624. package/dist/constructs/ssl-assertion-validation.d.ts +13 -0
  625. package/dist/constructs/ssl-assertion-validation.js +118 -0
  626. package/dist/constructs/ssl-assertion-validation.js.map +1 -0
  627. package/dist/constructs/ssl-assertion.d.ts +142 -0
  628. package/dist/constructs/ssl-assertion.js +150 -0
  629. package/dist/constructs/ssl-assertion.js.map +1 -0
  630. package/dist/constructs/ssl-monitor-codegen.d.ts +36 -0
  631. package/dist/constructs/ssl-monitor-codegen.js +53 -0
  632. package/dist/constructs/ssl-monitor-codegen.js.map +1 -0
  633. package/dist/constructs/ssl-monitor.d.ts +97 -0
  634. package/dist/constructs/ssl-monitor.js +73 -0
  635. package/dist/constructs/ssl-monitor.js.map +1 -0
  636. package/dist/constructs/ssl-request-codegen.d.ts +4 -0
  637. package/dist/constructs/ssl-request-codegen.js +49 -0
  638. package/dist/constructs/ssl-request-codegen.js.map +1 -0
  639. package/dist/constructs/ssl-request.d.ts +143 -0
  640. package/dist/constructs/ssl-request.js +2 -0
  641. package/dist/constructs/ssl-request.js.map +1 -0
  642. package/dist/constructs/status-page-codegen.d.ts +30 -0
  643. package/dist/constructs/status-page-codegen.js +88 -0
  644. package/dist/constructs/status-page-codegen.js.map +1 -0
  645. package/dist/constructs/status-page-service-codegen.d.ts +12 -0
  646. package/dist/constructs/status-page-service-codegen.js +39 -0
  647. package/dist/constructs/status-page-service-codegen.js.map +1 -0
  648. package/dist/constructs/status-page-service.d.ts +51 -0
  649. package/dist/constructs/status-page-service.js +69 -0
  650. package/dist/constructs/status-page-service.js.map +1 -0
  651. package/dist/constructs/status-page-v3-automation-rule-codegen.d.ts +22 -0
  652. package/dist/constructs/status-page-v3-automation-rule-codegen.js +52 -0
  653. package/dist/constructs/status-page-v3-automation-rule-codegen.js.map +1 -0
  654. package/dist/constructs/status-page-v3-automation-rule.d.ts +90 -0
  655. package/dist/constructs/status-page-v3-automation-rule.js +87 -0
  656. package/dist/constructs/status-page-v3-automation-rule.js.map +1 -0
  657. package/dist/constructs/status-page-v3-codegen.d.ts +39 -0
  658. package/dist/constructs/status-page-v3-codegen.js +139 -0
  659. package/dist/constructs/status-page-v3-codegen.js.map +1 -0
  660. package/dist/constructs/status-page-v3-component-codegen.d.ts +25 -0
  661. package/dist/constructs/status-page-v3-component-codegen.js +87 -0
  662. package/dist/constructs/status-page-v3-component-codegen.js.map +1 -0
  663. package/dist/constructs/status-page-v3-component.d.ts +115 -0
  664. package/dist/constructs/status-page-v3-component.js +143 -0
  665. package/dist/constructs/status-page-v3-component.js.map +1 -0
  666. package/dist/constructs/status-page-v3.d.ts +201 -0
  667. package/dist/constructs/status-page-v3.js +158 -0
  668. package/dist/constructs/status-page-v3.js.map +1 -0
  669. package/dist/constructs/status-page.d.ts +83 -0
  670. package/dist/constructs/status-page.js +75 -0
  671. package/dist/constructs/status-page.js.map +1 -0
  672. package/dist/constructs/tcp-monitor-codegen.d.ts +15 -0
  673. package/dist/constructs/tcp-monitor-codegen.js +65 -0
  674. package/dist/constructs/tcp-monitor-codegen.js.map +1 -0
  675. package/dist/constructs/tcp-monitor.d.ts +167 -0
  676. package/dist/constructs/tcp-monitor.js +89 -0
  677. package/dist/constructs/tcp-monitor.js.map +1 -0
  678. package/dist/constructs/telegram-alert-channel-codegen.d.ts +13 -0
  679. package/dist/constructs/telegram-alert-channel-codegen.js +108 -0
  680. package/dist/constructs/telegram-alert-channel-codegen.js.map +1 -0
  681. package/dist/constructs/telegram-alert-channel.d.ts +49 -0
  682. package/dist/constructs/telegram-alert-channel.js +63 -0
  683. package/dist/constructs/telegram-alert-channel.js.map +1 -0
  684. package/dist/constructs/time-zone.d.ts +24 -0
  685. package/dist/constructs/time-zone.js +455 -0
  686. package/dist/constructs/time-zone.js.map +1 -0
  687. package/dist/constructs/traceroute-assertion-codegen.d.ts +3 -0
  688. package/dist/constructs/traceroute-assertion-codegen.js +17 -0
  689. package/dist/constructs/traceroute-assertion-codegen.js.map +1 -0
  690. package/dist/constructs/traceroute-assertion-grammar.d.ts +33 -0
  691. package/dist/constructs/traceroute-assertion-grammar.js +33 -0
  692. package/dist/constructs/traceroute-assertion-grammar.js.map +1 -0
  693. package/dist/constructs/traceroute-assertion-validation.d.ts +11 -0
  694. package/dist/constructs/traceroute-assertion-validation.js +71 -0
  695. package/dist/constructs/traceroute-assertion-validation.js.map +1 -0
  696. package/dist/constructs/traceroute-assertion.d.ts +48 -0
  697. package/dist/constructs/traceroute-assertion.js +50 -0
  698. package/dist/constructs/traceroute-assertion.js.map +1 -0
  699. package/dist/constructs/traceroute-monitor-codegen.d.ts +13 -0
  700. package/dist/constructs/traceroute-monitor-codegen.js +36 -0
  701. package/dist/constructs/traceroute-monitor-codegen.js.map +1 -0
  702. package/dist/constructs/traceroute-monitor.d.ts +91 -0
  703. package/dist/constructs/traceroute-monitor.js +54 -0
  704. package/dist/constructs/traceroute-monitor.js.map +1 -0
  705. package/dist/constructs/traceroute-request-codegen.d.ts +4 -0
  706. package/dist/constructs/traceroute-request-codegen.js +41 -0
  707. package/dist/constructs/traceroute-request-codegen.js.map +1 -0
  708. package/dist/constructs/traceroute-request.d.ts +84 -0
  709. package/dist/constructs/traceroute-request.js +2 -0
  710. package/dist/constructs/traceroute-request.js.map +1 -0
  711. package/dist/constructs/url-assertion-codegen.d.ts +3 -0
  712. package/dist/constructs/url-assertion-codegen.js +11 -0
  713. package/dist/constructs/url-assertion-codegen.js.map +1 -0
  714. package/dist/constructs/url-assertion.d.ts +60 -0
  715. package/dist/constructs/url-assertion.js +52 -0
  716. package/dist/constructs/url-assertion.js.map +1 -0
  717. package/dist/constructs/url-monitor-codegen.d.ts +13 -0
  718. package/dist/constructs/url-monitor-codegen.js +34 -0
  719. package/dist/constructs/url-monitor-codegen.js.map +1 -0
  720. package/dist/constructs/url-monitor.d.ts +162 -0
  721. package/dist/constructs/url-monitor.js +114 -0
  722. package/dist/constructs/url-monitor.js.map +1 -0
  723. package/dist/constructs/url-request-codegen.d.ts +4 -0
  724. package/dist/constructs/url-request-codegen.js +28 -0
  725. package/dist/constructs/url-request-codegen.js.map +1 -0
  726. package/dist/constructs/url-request.d.ts +65 -0
  727. package/dist/constructs/url-request.js +2 -0
  728. package/dist/constructs/url-request.js.map +1 -0
  729. package/dist/constructs/webhook-alert-channel-codegen.d.ts +34 -0
  730. package/dist/constructs/webhook-alert-channel-codegen.js +147 -0
  731. package/dist/constructs/webhook-alert-channel-codegen.js.map +1 -0
  732. package/dist/constructs/webhook-alert-channel.d.ts +68 -0
  733. package/dist/constructs/webhook-alert-channel.js +59 -0
  734. package/dist/constructs/webhook-alert-channel.js.map +1 -0
  735. package/dist/formatters/account-members.d.ts +8 -0
  736. package/dist/formatters/account-members.js +115 -0
  737. package/dist/formatters/account-members.js.map +1 -0
  738. package/dist/formatters/account-plan.d.ts +16 -0
  739. package/dist/formatters/account-plan.js +320 -0
  740. package/dist/formatters/account-plan.js.map +1 -0
  741. package/dist/formatters/alert-channels.d.ts +15 -0
  742. package/dist/formatters/alert-channels.js +257 -0
  743. package/dist/formatters/alert-channels.js.map +1 -0
  744. package/dist/formatters/analytics.d.ts +8 -0
  745. package/dist/formatters/analytics.js +223 -0
  746. package/dist/formatters/analytics.js.map +1 -0
  747. package/dist/formatters/assertion-line.d.ts +27 -0
  748. package/dist/formatters/assertion-line.js +126 -0
  749. package/dist/formatters/assertion-line.js.map +1 -0
  750. package/dist/formatters/assets.d.ts +22 -0
  751. package/dist/formatters/assets.js +280 -0
  752. package/dist/formatters/assets.js.map +1 -0
  753. package/dist/formatters/batch-stats.d.ts +8 -0
  754. package/dist/formatters/batch-stats.js +203 -0
  755. package/dist/formatters/batch-stats.js.map +1 -0
  756. package/dist/formatters/check-result-detail.d.ts +12 -0
  757. package/dist/formatters/check-result-detail.js +1099 -0
  758. package/dist/formatters/check-result-detail.js.map +1 -0
  759. package/dist/formatters/check-sessions.d.ts +5 -0
  760. package/dist/formatters/check-sessions.js +113 -0
  761. package/dist/formatters/check-sessions.js.map +1 -0
  762. package/dist/formatters/checks.d.ts +29 -0
  763. package/dist/formatters/checks.js +336 -0
  764. package/dist/formatters/checks.js.map +1 -0
  765. package/dist/formatters/incidents.d.ts +7 -0
  766. package/dist/formatters/incidents.js +172 -0
  767. package/dist/formatters/incidents.js.map +1 -0
  768. package/dist/formatters/rca.d.ts +42 -0
  769. package/dist/formatters/rca.js +156 -0
  770. package/dist/formatters/rca.js.map +1 -0
  771. package/dist/formatters/render.d.ts +48 -0
  772. package/dist/formatters/render.js +263 -0
  773. package/dist/formatters/render.js.map +1 -0
  774. package/dist/formatters/status-pages.d.ts +7 -0
  775. package/dist/formatters/status-pages.js +236 -0
  776. package/dist/formatters/status-pages.js.map +1 -0
  777. package/dist/formatters/test-sessions.d.ts +18 -0
  778. package/dist/formatters/test-sessions.js +341 -0
  779. package/dist/formatters/test-sessions.js.map +1 -0
  780. package/dist/formatters/usage.d.ts +21 -0
  781. package/dist/formatters/usage.js +313 -0
  782. package/dist/formatters/usage.js.map +1 -0
  783. package/dist/help/examples.d.ts +6 -0
  784. package/dist/help/examples.js +20 -0
  785. package/dist/help/examples.js.map +1 -0
  786. package/dist/help/help-extension.d.ts +6 -0
  787. package/dist/help/help-extension.js +93 -0
  788. package/dist/help/help-extension.js.map +1 -0
  789. package/dist/help/skills.d.ts +7 -0
  790. package/dist/help/skills.js +20 -0
  791. package/dist/help/skills.js.map +1 -0
  792. package/dist/helpers/account-member-target.d.ts +14 -0
  793. package/dist/helpers/account-member-target.js +37 -0
  794. package/dist/helpers/account-member-target.js.map +1 -0
  795. package/dist/helpers/accounts.d.ts +28 -0
  796. package/dist/helpers/accounts.js +50 -0
  797. package/dist/helpers/accounts.js.map +1 -0
  798. package/dist/helpers/activate-account.d.ts +13 -0
  799. package/dist/helpers/activate-account.js +24 -0
  800. package/dist/helpers/activate-account.js.map +1 -0
  801. package/dist/helpers/api-fields.d.ts +4 -0
  802. package/dist/helpers/api-fields.js +25 -0
  803. package/dist/helpers/api-fields.js.map +1 -0
  804. package/dist/helpers/cli-mode.d.ts +28 -0
  805. package/dist/helpers/cli-mode.js +210 -0
  806. package/dist/helpers/cli-mode.js.map +1 -0
  807. package/dist/helpers/command-preview.d.ts +76 -0
  808. package/dist/helpers/command-preview.js +74 -0
  809. package/dist/helpers/command-preview.js.map +1 -0
  810. package/dist/helpers/command-style.d.ts +24 -0
  811. package/dist/helpers/command-style.js +135 -0
  812. package/dist/helpers/command-style.js.map +1 -0
  813. package/dist/helpers/constants.d.ts +1 -0
  814. package/dist/helpers/constants.js +2 -0
  815. package/dist/helpers/constants.js.map +1 -0
  816. package/dist/helpers/content-range.d.ts +1 -0
  817. package/dist/helpers/content-range.js +7 -0
  818. package/dist/helpers/content-range.js.map +1 -0
  819. package/dist/helpers/flags.d.ts +22 -0
  820. package/dist/helpers/flags.js +68 -0
  821. package/dist/helpers/flags.js.map +1 -0
  822. package/dist/helpers/import-plan-selection.d.ts +70 -0
  823. package/dist/helpers/import-plan-selection.js +134 -0
  824. package/dist/helpers/import-plan-selection.js.map +1 -0
  825. package/dist/helpers/incidents.d.ts +15 -0
  826. package/dist/helpers/incidents.js +50 -0
  827. package/dist/helpers/incidents.js.map +1 -0
  828. package/dist/helpers/invalid-input-error.d.ts +15 -0
  829. package/dist/helpers/invalid-input-error.js +17 -0
  830. package/dist/helpers/invalid-input-error.js.map +1 -0
  831. package/dist/helpers/number.d.ts +3 -0
  832. package/dist/helpers/number.js +21 -0
  833. package/dist/helpers/number.js.map +1 -0
  834. package/dist/helpers/onboarding/boilerplate.d.ts +15 -0
  835. package/dist/helpers/onboarding/boilerplate.js +178 -0
  836. package/dist/helpers/onboarding/boilerplate.js.map +1 -0
  837. package/dist/helpers/onboarding/clipboard.d.ts +1 -0
  838. package/dist/helpers/onboarding/clipboard.js +28 -0
  839. package/dist/helpers/onboarding/clipboard.js.map +1 -0
  840. package/dist/helpers/onboarding/detect-project.d.ts +10 -0
  841. package/dist/helpers/onboarding/detect-project.js +22 -0
  842. package/dist/helpers/onboarding/detect-project.js.map +1 -0
  843. package/dist/helpers/onboarding/index.d.ts +7 -0
  844. package/dist/helpers/onboarding/index.js +8 -0
  845. package/dist/helpers/onboarding/index.js.map +1 -0
  846. package/dist/helpers/onboarding/messages.d.ts +12 -0
  847. package/dist/helpers/onboarding/messages.js +155 -0
  848. package/dist/helpers/onboarding/messages.js.map +1 -0
  849. package/dist/helpers/onboarding/prompt-display.d.ts +1 -0
  850. package/dist/helpers/onboarding/prompt-display.js +76 -0
  851. package/dist/helpers/onboarding/prompt-display.js.map +1 -0
  852. package/dist/helpers/onboarding/prompts-helpers.d.ts +2 -0
  853. package/dist/helpers/onboarding/prompts-helpers.js +13 -0
  854. package/dist/helpers/onboarding/prompts-helpers.js.map +1 -0
  855. package/dist/helpers/onboarding/skill-install.d.ts +10 -0
  856. package/dist/helpers/onboarding/skill-install.js +85 -0
  857. package/dist/helpers/onboarding/skill-install.js.map +1 -0
  858. package/dist/helpers/onboarding/template-prompt.d.ts +2 -0
  859. package/dist/helpers/onboarding/template-prompt.js +14 -0
  860. package/dist/helpers/onboarding/template-prompt.js.map +1 -0
  861. package/dist/helpers/prompts.d.ts +7 -0
  862. package/dist/helpers/prompts.js +10 -0
  863. package/dist/helpers/prompts.js.map +1 -0
  864. package/dist/helpers/recast-acorn-parser.d.ts +2 -0
  865. package/dist/helpers/recast-acorn-parser.js +22 -0
  866. package/dist/helpers/recast-acorn-parser.js.map +1 -0
  867. package/dist/helpers/result-assets.d.ts +54 -0
  868. package/dist/helpers/result-assets.js +319 -0
  869. package/dist/helpers/result-assets.js.map +1 -0
  870. package/dist/helpers/test-helper.d.ts +31 -0
  871. package/dist/helpers/test-helper.js +105 -0
  872. package/dist/helpers/test-helper.js.map +1 -0
  873. package/dist/helpers/usage.d.ts +64 -0
  874. package/dist/helpers/usage.js +242 -0
  875. package/dist/helpers/usage.js.map +1 -0
  876. package/dist/helpers/wrap.d.ts +6 -0
  877. package/dist/helpers/wrap.js +49 -0
  878. package/dist/helpers/wrap.js.map +1 -0
  879. package/dist/helpers/write-config-helpers.d.ts +5 -0
  880. package/dist/helpers/write-config-helpers.js +55 -0
  881. package/dist/helpers/write-config-helpers.js.map +1 -0
  882. package/dist/hooks/command-not-found.d.ts +3 -0
  883. package/dist/hooks/command-not-found.js +22 -0
  884. package/dist/hooks/command-not-found.js.map +1 -0
  885. package/dist/hooks/parse-error.d.ts +3 -0
  886. package/dist/hooks/parse-error.js +15 -0
  887. package/dist/hooks/parse-error.js.map +1 -0
  888. package/dist/index.d.ts +5 -0
  889. package/dist/index.js +3 -0
  890. package/dist/index.js.map +1 -0
  891. package/dist/loader/config.d.ts +3 -0
  892. package/dist/loader/config.js +8 -0
  893. package/dist/loader/config.js.map +1 -0
  894. package/dist/loader/index.d.ts +5 -0
  895. package/dist/loader/index.js +6 -0
  896. package/dist/loader/index.js.map +1 -0
  897. package/dist/loader/jiti.d.ts +28 -0
  898. package/dist/loader/jiti.js +76 -0
  899. package/dist/loader/jiti.js.map +1 -0
  900. package/dist/loader/loader.d.ts +43 -0
  901. package/dist/loader/loader.js +37 -0
  902. package/dist/loader/loader.js.map +1 -0
  903. package/dist/loader/match.d.ts +15 -0
  904. package/dist/loader/match.js +43 -0
  905. package/dist/loader/match.js.map +1 -0
  906. package/dist/loader/mixed.d.ts +7 -0
  907. package/dist/loader/mixed.js +36 -0
  908. package/dist/loader/mixed.js.map +1 -0
  909. package/dist/loader/native.d.ts +10 -0
  910. package/dist/loader/native.js +30 -0
  911. package/dist/loader/native.js.map +1 -0
  912. package/dist/messages/common-messages.d.ts +7 -0
  913. package/dist/messages/common-messages.js +11 -0
  914. package/dist/messages/common-messages.js.map +1 -0
  915. package/dist/playwright/playwright-config-loader.d.ts +1 -0
  916. package/dist/playwright/playwright-config-loader.js +26 -0
  917. package/dist/playwright/playwright-config-loader.js.map +1 -0
  918. package/dist/playwright/playwright-config-template.d.ts +8 -0
  919. package/dist/playwright/playwright-config-template.js +53 -0
  920. package/dist/playwright/playwright-config-template.js.map +1 -0
  921. package/dist/reporters/abstract-list.d.ts +67 -0
  922. package/dist/reporters/abstract-list.js +387 -0
  923. package/dist/reporters/abstract-list.js.map +1 -0
  924. package/dist/reporters/ci.d.ts +12 -0
  925. package/dist/reporters/ci.js +31 -0
  926. package/dist/reporters/ci.js.map +1 -0
  927. package/dist/reporters/dot.d.ts +11 -0
  928. package/dist/reporters/dot.js +39 -0
  929. package/dist/reporters/dot.js.map +1 -0
  930. package/dist/reporters/github.d.ts +35 -0
  931. package/dist/reporters/github.js +130 -0
  932. package/dist/reporters/github.js.map +1 -0
  933. package/dist/reporters/json.d.ts +29 -0
  934. package/dist/reporters/json.js +155 -0
  935. package/dist/reporters/json.js.map +1 -0
  936. package/dist/reporters/list.d.ts +15 -0
  937. package/dist/reporters/list.js +83 -0
  938. package/dist/reporters/list.js.map +1 -0
  939. package/dist/reporters/reporter.d.ts +26 -0
  940. package/dist/reporters/reporter.js +22 -0
  941. package/dist/reporters/reporter.js.map +1 -0
  942. package/dist/reporters/util.d.ts +24 -0
  943. package/dist/reporters/util.js +663 -0
  944. package/dist/reporters/util.js.map +1 -0
  945. package/dist/rest/account-members.d.ts +56 -0
  946. package/dist/rest/account-members.js +18 -0
  947. package/dist/rest/account-members.js.map +1 -0
  948. package/dist/rest/accounts.d.ts +25 -0
  949. package/dist/rest/accounts.js +14 -0
  950. package/dist/rest/accounts.js.map +1 -0
  951. package/dist/rest/alert-channels.d.ts +52 -0
  952. package/dist/rest/alert-channels.js +23 -0
  953. package/dist/rest/alert-channels.js.map +1 -0
  954. package/dist/rest/alert-notifications.d.ts +39 -0
  955. package/dist/rest/alert-notifications.js +19 -0
  956. package/dist/rest/alert-notifications.js.map +1 -0
  957. package/dist/rest/analytics.d.ts +41 -0
  958. package/dist/rest/analytics.js +62 -0
  959. package/dist/rest/analytics.js.map +1 -0
  960. package/dist/rest/api.d.ts +80 -0
  961. package/dist/rest/api.js +165 -0
  962. package/dist/rest/api.js.map +1 -0
  963. package/dist/rest/asset-manifests.d.ts +30 -0
  964. package/dist/rest/asset-manifests.js +29 -0
  965. package/dist/rest/asset-manifests.js.map +1 -0
  966. package/dist/rest/assets.d.ts +64 -0
  967. package/dist/rest/assets.js +91 -0
  968. package/dist/rest/assets.js.map +1 -0
  969. package/dist/rest/batch-analytics.d.ts +26 -0
  970. package/dist/rest/batch-analytics.js +14 -0
  971. package/dist/rest/batch-analytics.js.map +1 -0
  972. package/dist/rest/cancel.d.ts +18 -0
  973. package/dist/rest/cancel.js +28 -0
  974. package/dist/rest/cancel.js.map +1 -0
  975. package/dist/rest/check-groups.d.ts +16 -0
  976. package/dist/rest/check-groups.js +11 -0
  977. package/dist/rest/check-groups.js.map +1 -0
  978. package/dist/rest/check-results.d.ts +210 -0
  979. package/dist/rest/check-results.js +19 -0
  980. package/dist/rest/check-results.js.map +1 -0
  981. package/dist/rest/check-sessions.d.ts +63 -0
  982. package/dist/rest/check-sessions.js +66 -0
  983. package/dist/rest/check-sessions.js.map +1 -0
  984. package/dist/rest/check-statuses.d.ts +23 -0
  985. package/dist/rest/check-statuses.js +20 -0
  986. package/dist/rest/check-statuses.js.map +1 -0
  987. package/dist/rest/checkly-storage.d.ts +21 -0
  988. package/dist/rest/checkly-storage.js +28 -0
  989. package/dist/rest/checkly-storage.js.map +1 -0
  990. package/dist/rest/checks.d.ts +48 -0
  991. package/dist/rest/checks.js +43 -0
  992. package/dist/rest/checks.js.map +1 -0
  993. package/dist/rest/entitlements.d.ts +47 -0
  994. package/dist/rest/entitlements.js +11 -0
  995. package/dist/rest/entitlements.js.map +1 -0
  996. package/dist/rest/environment-variables.d.ts +52 -0
  997. package/dist/rest/environment-variables.js +91 -0
  998. package/dist/rest/environment-variables.js.map +1 -0
  999. package/dist/rest/error-groups.d.ts +49 -0
  1000. package/dist/rest/error-groups.js +14 -0
  1001. package/dist/rest/error-groups.js.map +1 -0
  1002. package/dist/rest/errors.d.ts +121 -0
  1003. package/dist/rest/errors.js +328 -0
  1004. package/dist/rest/errors.js.map +1 -0
  1005. package/dist/rest/heartbeat-checks.d.ts +11 -0
  1006. package/dist/rest/heartbeat-checks.js +16 -0
  1007. package/dist/rest/heartbeat-checks.js.map +1 -0
  1008. package/dist/rest/incidents.d.ts +60 -0
  1009. package/dist/rest/incidents.js +28 -0
  1010. package/dist/rest/incidents.js.map +1 -0
  1011. package/dist/rest/locations.d.ts +11 -0
  1012. package/dist/rest/locations.js +11 -0
  1013. package/dist/rest/locations.js.map +1 -0
  1014. package/dist/rest/private-locations.d.ts +10 -0
  1015. package/dist/rest/private-locations.js +10 -0
  1016. package/dist/rest/private-locations.js.map +1 -0
  1017. package/dist/rest/projects.d.ts +545 -0
  1018. package/dist/rest/projects.js +696 -0
  1019. package/dist/rest/projects.js.map +1 -0
  1020. package/dist/rest/rca.d.ts +14 -0
  1021. package/dist/rest/rca.js +28 -0
  1022. package/dist/rest/rca.js.map +1 -0
  1023. package/dist/rest/retry.d.ts +55 -0
  1024. package/dist/rest/retry.js +169 -0
  1025. package/dist/rest/retry.js.map +1 -0
  1026. package/dist/rest/runtimes.d.ts +9 -0
  1027. package/dist/rest/runtimes.js +16 -0
  1028. package/dist/rest/runtimes.js.map +1 -0
  1029. package/dist/rest/status-pages.d.ts +40 -0
  1030. package/dist/rest/status-pages.js +16 -0
  1031. package/dist/rest/status-pages.js.map +1 -0
  1032. package/dist/rest/test-session-error-groups.d.ts +18 -0
  1033. package/dist/rest/test-session-error-groups.js +11 -0
  1034. package/dist/rest/test-session-error-groups.js.map +1 -0
  1035. package/dist/rest/test-sessions.d.ts +217 -0
  1036. package/dist/rest/test-sessions.js +118 -0
  1037. package/dist/rest/test-sessions.js.map +1 -0
  1038. package/dist/rest/usage.d.ts +221 -0
  1039. package/dist/rest/usage.js +49 -0
  1040. package/dist/rest/usage.js.map +1 -0
  1041. package/dist/rest/users.d.ts +12 -0
  1042. package/dist/rest/users.js +11 -0
  1043. package/dist/rest/users.js.map +1 -0
  1044. package/dist/rest/util.d.ts +3 -0
  1045. package/dist/rest/util.js +10 -0
  1046. package/dist/rest/util.js.map +1 -0
  1047. package/dist/runtimes/index.d.ts +2 -0
  1048. package/dist/runtimes/index.js +2 -0
  1049. package/dist/runtimes/index.js.map +1 -0
  1050. package/dist/runtimes/runtime.d.ts +8 -0
  1051. package/dist/runtimes/runtime.js +2 -0
  1052. package/dist/runtimes/runtime.js.map +1 -0
  1053. package/dist/runtimes/snapshot.d.ts +2 -0
  1054. package/dist/runtimes/snapshot.js +11 -0
  1055. package/dist/runtimes/snapshot.js.map +1 -0
  1056. package/dist/services/abstract-check-runner.d.ts +111 -0
  1057. package/dist/services/abstract-check-runner.js +483 -0
  1058. package/dist/services/abstract-check-runner.js.map +1 -0
  1059. package/dist/services/check-parser/bundler.d.ts +191 -0
  1060. package/dist/services/check-parser/bundler.js +1087 -0
  1061. package/dist/services/check-parser/bundler.js.map +1 -0
  1062. package/dist/services/check-parser/cache-hash.d.ts +286 -0
  1063. package/dist/services/check-parser/cache-hash.js +329 -0
  1064. package/dist/services/check-parser/cache-hash.js.map +1 -0
  1065. package/dist/services/check-parser/collector.d.ts +33 -0
  1066. package/dist/services/check-parser/collector.js +46 -0
  1067. package/dist/services/check-parser/collector.js.map +1 -0
  1068. package/dist/services/check-parser/errors.d.ts +8 -0
  1069. package/dist/services/check-parser/errors.js +46 -0
  1070. package/dist/services/check-parser/errors.js.map +1 -0
  1071. package/dist/services/check-parser/faux-package.d.ts +9 -0
  1072. package/dist/services/check-parser/faux-package.js +24 -0
  1073. package/dist/services/check-parser/faux-package.js.map +1 -0
  1074. package/dist/services/check-parser/lockfile-pruner.d.ts +115 -0
  1075. package/dist/services/check-parser/lockfile-pruner.js +1330 -0
  1076. package/dist/services/check-parser/lockfile-pruner.js.map +1 -0
  1077. package/dist/services/check-parser/package-files/extension.d.ts +38 -0
  1078. package/dist/services/check-parser/package-files/extension.js +66 -0
  1079. package/dist/services/check-parser/package-files/extension.js.map +1 -0
  1080. package/dist/services/check-parser/package-files/jsconfig-json-file.d.ts +17 -0
  1081. package/dist/services/check-parser/package-files/jsconfig-json-file.js +23 -0
  1082. package/dist/services/check-parser/package-files/jsconfig-json-file.js.map +1 -0
  1083. package/dist/services/check-parser/package-files/json-source-file.d.ts +11 -0
  1084. package/dist/services/check-parser/package-files/json-source-file.js +32 -0
  1085. package/dist/services/check-parser/package-files/json-source-file.js.map +1 -0
  1086. package/dist/services/check-parser/package-files/json-text-source-file.d.ts +5 -0
  1087. package/dist/services/check-parser/package-files/json-text-source-file.js +18 -0
  1088. package/dist/services/check-parser/package-files/json-text-source-file.js.map +1 -0
  1089. package/dist/services/check-parser/package-files/loader.d.ts +7 -0
  1090. package/dist/services/check-parser/package-files/loader.js +24 -0
  1091. package/dist/services/check-parser/package-files/loader.js.map +1 -0
  1092. package/dist/services/check-parser/package-files/lockfile-package-version.d.ts +88 -0
  1093. package/dist/services/check-parser/package-files/lockfile-package-version.js +321 -0
  1094. package/dist/services/check-parser/package-files/lockfile-package-version.js.map +1 -0
  1095. package/dist/services/check-parser/package-files/lookup.d.ts +12 -0
  1096. package/dist/services/check-parser/package-files/lookup.js +52 -0
  1097. package/dist/services/check-parser/package-files/lookup.js.map +1 -0
  1098. package/dist/services/check-parser/package-files/package-json-file.d.ts +72 -0
  1099. package/dist/services/check-parser/package-files/package-json-file.js +271 -0
  1100. package/dist/services/check-parser/package-files/package-json-file.js.map +1 -0
  1101. package/dist/services/check-parser/package-files/package-manager.d.ts +288 -0
  1102. package/dist/services/check-parser/package-files/package-manager.js +998 -0
  1103. package/dist/services/check-parser/package-files/package-manager.js.map +1 -0
  1104. package/dist/services/check-parser/package-files/paths.d.ts +98 -0
  1105. package/dist/services/check-parser/package-files/paths.js +247 -0
  1106. package/dist/services/check-parser/package-files/paths.js.map +1 -0
  1107. package/dist/services/check-parser/package-files/pnpmfile.d.ts +40 -0
  1108. package/dist/services/check-parser/package-files/pnpmfile.js +322 -0
  1109. package/dist/services/check-parser/package-files/pnpmfile.js.map +1 -0
  1110. package/dist/services/check-parser/package-files/resolver.d.ts +146 -0
  1111. package/dist/services/check-parser/package-files/resolver.js +664 -0
  1112. package/dist/services/check-parser/package-files/resolver.js.map +1 -0
  1113. package/dist/services/check-parser/package-files/result.d.ts +38 -0
  1114. package/dist/services/check-parser/package-files/result.js +53 -0
  1115. package/dist/services/check-parser/package-files/result.js.map +1 -0
  1116. package/dist/services/check-parser/package-files/source-file.d.ts +15 -0
  1117. package/dist/services/check-parser/package-files/source-file.js +38 -0
  1118. package/dist/services/check-parser/package-files/source-file.js.map +1 -0
  1119. package/dist/services/check-parser/package-files/tsconfig-json-file.d.ts +116 -0
  1120. package/dist/services/check-parser/package-files/tsconfig-json-file.js +156 -0
  1121. package/dist/services/check-parser/package-files/tsconfig-json-file.js.map +1 -0
  1122. package/dist/services/check-parser/package-files/walk.d.ts +8 -0
  1123. package/dist/services/check-parser/package-files/walk.js +35 -0
  1124. package/dist/services/check-parser/package-files/walk.js.map +1 -0
  1125. package/dist/services/check-parser/package-files/workspace.d.ts +75 -0
  1126. package/dist/services/check-parser/package-files/workspace.js +118 -0
  1127. package/dist/services/check-parser/package-files/workspace.js.map +1 -0
  1128. package/dist/services/check-parser/package-prune.d.ts +235 -0
  1129. package/dist/services/check-parser/package-prune.js +760 -0
  1130. package/dist/services/check-parser/package-prune.js.map +1 -0
  1131. package/dist/services/check-parser/parser.d.ts +86 -0
  1132. package/dist/services/check-parser/parser.js +498 -0
  1133. package/dist/services/check-parser/parser.js.map +1 -0
  1134. package/dist/services/check-parser/patched-dependencies.d.ts +147 -0
  1135. package/dist/services/check-parser/patched-dependencies.js +453 -0
  1136. package/dist/services/check-parser/patched-dependencies.js.map +1 -0
  1137. package/dist/services/check-parser/playwright-config-expander.d.ts +16 -0
  1138. package/dist/services/check-parser/playwright-config-expander.js +175 -0
  1139. package/dist/services/check-parser/playwright-config-expander.js.map +1 -0
  1140. package/dist/services/checkly-config-codegen.d.ts +4 -0
  1141. package/dist/services/checkly-config-codegen.js +189 -0
  1142. package/dist/services/checkly-config-codegen.js.map +1 -0
  1143. package/dist/services/checkly-config-loader.d.ts +378 -0
  1144. package/dist/services/checkly-config-loader.js +302 -0
  1145. package/dist/services/checkly-config-loader.js.map +1 -0
  1146. package/dist/services/config-diagnostics.d.ts +31 -0
  1147. package/dist/services/config-diagnostics.js +57 -0
  1148. package/dist/services/config-diagnostics.js.map +1 -0
  1149. package/dist/services/config.d.ts +69 -0
  1150. package/dist/services/config.js +179 -0
  1151. package/dist/services/config.js.map +1 -0
  1152. package/dist/services/content-hash.d.ts +14 -0
  1153. package/dist/services/content-hash.js +22 -0
  1154. package/dist/services/content-hash.js.map +1 -0
  1155. package/dist/services/deploy-diff/diff-lines.d.ts +52 -0
  1156. package/dist/services/deploy-diff/diff-lines.js +327 -0
  1157. package/dist/services/deploy-diff/diff-lines.js.map +1 -0
  1158. package/dist/services/deploy-diff/double-check.d.ts +9 -0
  1159. package/dist/services/deploy-diff/double-check.js +21 -0
  1160. package/dist/services/deploy-diff/double-check.js.map +1 -0
  1161. package/dist/services/deploy-diff/import-shape.d.ts +171 -0
  1162. package/dist/services/deploy-diff/import-shape.js +633 -0
  1163. package/dist/services/deploy-diff/import-shape.js.map +1 -0
  1164. package/dist/services/deploy-diff/legacy-payload.d.ts +22 -0
  1165. package/dist/services/deploy-diff/legacy-payload.js +51 -0
  1166. package/dist/services/deploy-diff/legacy-payload.js.map +1 -0
  1167. package/dist/services/deploy-diff/plan-summary.d.ts +81 -0
  1168. package/dist/services/deploy-diff/plan-summary.js +262 -0
  1169. package/dist/services/deploy-diff/plan-summary.js.map +1 -0
  1170. package/dist/services/deploy-diff/preview-output.d.ts +63 -0
  1171. package/dist/services/deploy-diff/preview-output.js +403 -0
  1172. package/dist/services/deploy-diff/preview-output.js.map +1 -0
  1173. package/dist/services/deploy-diff/render.d.ts +59 -0
  1174. package/dist/services/deploy-diff/render.js +326 -0
  1175. package/dist/services/deploy-diff/render.js.map +1 -0
  1176. package/dist/services/deploy-diff/shape-changes.d.ts +2 -0
  1177. package/dist/services/deploy-diff/shape-changes.js +48 -0
  1178. package/dist/services/deploy-diff/shape-changes.js.map +1 -0
  1179. package/dist/services/deploy-diff/source-index.d.ts +18 -0
  1180. package/dist/services/deploy-diff/source-index.js +48 -0
  1181. package/dist/services/deploy-diff/source-index.js.map +1 -0
  1182. package/dist/services/deploy-diff/variable-names.d.ts +30 -0
  1183. package/dist/services/deploy-diff/variable-names.js +64 -0
  1184. package/dist/services/deploy-diff/variable-names.js.map +1 -0
  1185. package/dist/services/embedded-packages/cache.d.ts +52 -0
  1186. package/dist/services/embedded-packages/cache.js +192 -0
  1187. package/dist/services/embedded-packages/cache.js.map +1 -0
  1188. package/dist/services/embedded-packages/diagnostics.d.ts +129 -0
  1189. package/dist/services/embedded-packages/diagnostics.js +212 -0
  1190. package/dist/services/embedded-packages/diagnostics.js.map +1 -0
  1191. package/dist/services/embedded-packages/integrity.d.ts +28 -0
  1192. package/dist/services/embedded-packages/integrity.js +58 -0
  1193. package/dist/services/embedded-packages/integrity.js.map +1 -0
  1194. package/dist/services/embedded-packages/lockfile-filter.d.ts +20 -0
  1195. package/dist/services/embedded-packages/lockfile-filter.js +40 -0
  1196. package/dist/services/embedded-packages/lockfile-filter.js.map +1 -0
  1197. package/dist/services/embedded-packages/lockfile-packages.d.ts +77 -0
  1198. package/dist/services/embedded-packages/lockfile-packages.js +439 -0
  1199. package/dist/services/embedded-packages/lockfile-packages.js.map +1 -0
  1200. package/dist/services/embedded-packages/materializer.d.ts +102 -0
  1201. package/dist/services/embedded-packages/materializer.js +668 -0
  1202. package/dist/services/embedded-packages/materializer.js.map +1 -0
  1203. package/dist/services/embedded-packages/npmrc.d.ts +198 -0
  1204. package/dist/services/embedded-packages/npmrc.js +539 -0
  1205. package/dist/services/embedded-packages/npmrc.js.map +1 -0
  1206. package/dist/services/embedded-packages/spec.d.ts +119 -0
  1207. package/dist/services/embedded-packages/spec.js +248 -0
  1208. package/dist/services/embedded-packages/spec.js.map +1 -0
  1209. package/dist/services/embedded-packages/url.d.ts +39 -0
  1210. package/dist/services/embedded-packages/url.js +60 -0
  1211. package/dist/services/embedded-packages/url.js.map +1 -0
  1212. package/dist/services/engine-detector.d.ts +16 -0
  1213. package/dist/services/engine-detector.js +213 -0
  1214. package/dist/services/engine-detector.js.map +1 -0
  1215. package/dist/services/engine-resolver.d.ts +6 -0
  1216. package/dist/services/engine-resolver.js +50 -0
  1217. package/dist/services/engine-resolver.js.map +1 -0
  1218. package/dist/services/engine-rules-loader.d.ts +27 -0
  1219. package/dist/services/engine-rules-loader.js +53 -0
  1220. package/dist/services/engine-rules-loader.js.map +1 -0
  1221. package/dist/services/load-dotenv.d.ts +1 -0
  1222. package/dist/services/load-dotenv.js +44 -0
  1223. package/dist/services/load-dotenv.js.map +1 -0
  1224. package/dist/services/oxc-parser.d.ts +26 -0
  1225. package/dist/services/oxc-parser.js +70 -0
  1226. package/dist/services/oxc-parser.js.map +1 -0
  1227. package/dist/services/playwright-config.d.ts +41 -0
  1228. package/dist/services/playwright-config.js +192 -0
  1229. package/dist/services/playwright-config.js.map +1 -0
  1230. package/dist/services/playwright-project-bundler.d.ts +28 -0
  1231. package/dist/services/playwright-project-bundler.js +301 -0
  1232. package/dist/services/playwright-project-bundler.js.map +1 -0
  1233. package/dist/services/pnpm-lockfile-documents.d.ts +50 -0
  1234. package/dist/services/pnpm-lockfile-documents.js +42 -0
  1235. package/dist/services/pnpm-lockfile-documents.js.map +1 -0
  1236. package/dist/services/project-cli.d.ts +75 -0
  1237. package/dist/services/project-cli.js +302 -0
  1238. package/dist/services/project-cli.js.map +1 -0
  1239. package/dist/services/project-parser.d.ts +36 -0
  1240. package/dist/services/project-parser.js +307 -0
  1241. package/dist/services/project-parser.js.map +1 -0
  1242. package/dist/services/proxy.d.ts +32 -0
  1243. package/dist/services/proxy.js +69 -0
  1244. package/dist/services/proxy.js.map +1 -0
  1245. package/dist/services/runner/registries.d.ts +156 -0
  1246. package/dist/services/runner/registries.js +300 -0
  1247. package/dist/services/runner/registries.js.map +1 -0
  1248. package/dist/services/shell.d.ts +2 -0
  1249. package/dist/services/shell.js +15 -0
  1250. package/dist/services/shell.js.map +1 -0
  1251. package/dist/services/skills.d.ts +12 -0
  1252. package/dist/services/skills.js +127 -0
  1253. package/dist/services/skills.js.map +1 -0
  1254. package/dist/services/snapshot-service.d.ts +30 -0
  1255. package/dist/services/snapshot-service.js +98 -0
  1256. package/dist/services/snapshot-service.js.map +1 -0
  1257. package/dist/services/socket-client.d.ts +4 -0
  1258. package/dist/services/socket-client.js +37 -0
  1259. package/dist/services/socket-client.js.map +1 -0
  1260. package/dist/services/symlink-resolver.d.ts +56 -0
  1261. package/dist/services/symlink-resolver.js +860 -0
  1262. package/dist/services/symlink-resolver.js.map +1 -0
  1263. package/dist/services/test-filters.d.ts +21 -0
  1264. package/dist/services/test-filters.js +31 -0
  1265. package/dist/services/test-filters.js.map +1 -0
  1266. package/dist/services/test-runner.d.ts +29 -0
  1267. package/dist/services/test-runner.js +81 -0
  1268. package/dist/services/test-runner.js.map +1 -0
  1269. package/dist/services/test-session-cancel.d.ts +17 -0
  1270. package/dist/services/test-session-cancel.js +40 -0
  1271. package/dist/services/test-session-cancel.js.map +1 -0
  1272. package/dist/services/trigger-runner.d.ts +29 -0
  1273. package/dist/services/trigger-runner.js +49 -0
  1274. package/dist/services/trigger-runner.js.map +1 -0
  1275. package/dist/services/two-installs.d.ts +39 -0
  1276. package/dist/services/two-installs.js +155 -0
  1277. package/dist/services/two-installs.js.map +1 -0
  1278. package/dist/services/util.d.ts +83 -0
  1279. package/dist/services/util.js +343 -0
  1280. package/dist/services/util.js.map +1 -0
  1281. package/dist/services/write-back/apply-edits.d.ts +29 -0
  1282. package/dist/services/write-back/apply-edits.js +255 -0
  1283. package/dist/services/write-back/apply-edits.js.map +1 -0
  1284. package/dist/services/write-back/helper-edit.d.ts +135 -0
  1285. package/dist/services/write-back/helper-edit.js +343 -0
  1286. package/dist/services/write-back/helper-edit.js.map +1 -0
  1287. package/dist/services/write-back/imports.d.ts +30 -0
  1288. package/dist/services/write-back/imports.js +88 -0
  1289. package/dist/services/write-back/imports.js.map +1 -0
  1290. package/dist/services/write-back/literal-edit.d.ts +183 -0
  1291. package/dist/services/write-back/literal-edit.js +359 -0
  1292. package/dist/services/write-back/literal-edit.js.map +1 -0
  1293. package/dist/services/write-back/output.d.ts +26 -0
  1294. package/dist/services/write-back/output.js +110 -0
  1295. package/dist/services/write-back/output.js.map +1 -0
  1296. package/dist/services/write-back/plan.d.ts +180 -0
  1297. package/dist/services/write-back/plan.js +1046 -0
  1298. package/dist/services/write-back/plan.js.map +1 -0
  1299. package/dist/services/write-back/source-file.d.ts +133 -0
  1300. package/dist/services/write-back/source-file.js +460 -0
  1301. package/dist/services/write-back/source-file.js.map +1 -0
  1302. package/dist/sourcegen/args.d.ts +7 -0
  1303. package/dist/sourcegen/args.js +22 -0
  1304. package/dist/sourcegen/args.js.map +1 -0
  1305. package/dist/sourcegen/argsbuilder.d.ts +22 -0
  1306. package/dist/sourcegen/argsbuilder.js +106 -0
  1307. package/dist/sourcegen/argsbuilder.js.map +1 -0
  1308. package/dist/sourcegen/array.d.ts +8 -0
  1309. package/dist/sourcegen/array.js +28 -0
  1310. package/dist/sourcegen/array.js.map +1 -0
  1311. package/dist/sourcegen/arraybuilder.d.ts +21 -0
  1312. package/dist/sourcegen/arraybuilder.js +104 -0
  1313. package/dist/sourcegen/arraybuilder.js.map +1 -0
  1314. package/dist/sourcegen/boolean.d.ts +7 -0
  1315. package/dist/sourcegen/boolean.js +18 -0
  1316. package/dist/sourcegen/boolean.js.map +1 -0
  1317. package/dist/sourcegen/case.d.ts +9 -0
  1318. package/dist/sourcegen/case.js +96 -0
  1319. package/dist/sourcegen/case.js.map +1 -0
  1320. package/dist/sourcegen/comment.d.ts +32 -0
  1321. package/dist/sourcegen/comment.js +113 -0
  1322. package/dist/sourcegen/comment.js.map +1 -0
  1323. package/dist/sourcegen/decl.d.ts +43 -0
  1324. package/dist/sourcegen/decl.js +86 -0
  1325. package/dist/sourcegen/decl.js.map +1 -0
  1326. package/dist/sourcegen/declbuilder.d.ts +14 -0
  1327. package/dist/sourcegen/declbuilder.js +34 -0
  1328. package/dist/sourcegen/declbuilder.js.map +1 -0
  1329. package/dist/sourcegen/expr.d.ts +39 -0
  1330. package/dist/sourcegen/expr.js +77 -0
  1331. package/dist/sourcegen/expr.js.map +1 -0
  1332. package/dist/sourcegen/exprbuilder.d.ts +13 -0
  1333. package/dist/sourcegen/exprbuilder.js +49 -0
  1334. package/dist/sourcegen/exprbuilder.js.map +1 -0
  1335. package/dist/sourcegen/identifier.d.ts +12 -0
  1336. package/dist/sourcegen/identifier.js +22 -0
  1337. package/dist/sourcegen/identifier.js.map +1 -0
  1338. package/dist/sourcegen/index.d.ts +22 -0
  1339. package/dist/sourcegen/index.js +23 -0
  1340. package/dist/sourcegen/index.js.map +1 -0
  1341. package/dist/sourcegen/null.d.ts +5 -0
  1342. package/dist/sourcegen/null.js +7 -0
  1343. package/dist/sourcegen/null.js.map +1 -0
  1344. package/dist/sourcegen/number.d.ts +7 -0
  1345. package/dist/sourcegen/number.js +18 -0
  1346. package/dist/sourcegen/number.js.map +1 -0
  1347. package/dist/sourcegen/object.d.ts +28 -0
  1348. package/dist/sourcegen/object.js +80 -0
  1349. package/dist/sourcegen/object.js.map +1 -0
  1350. package/dist/sourcegen/objectbuilder.d.ts +25 -0
  1351. package/dist/sourcegen/objectbuilder.js +122 -0
  1352. package/dist/sourcegen/objectbuilder.js.map +1 -0
  1353. package/dist/sourcegen/output.d.ts +14 -0
  1354. package/dist/sourcegen/output.js +81 -0
  1355. package/dist/sourcegen/output.js.map +1 -0
  1356. package/dist/sourcegen/program.d.ts +71 -0
  1357. package/dist/sourcegen/program.js +279 -0
  1358. package/dist/sourcegen/program.js.map +1 -0
  1359. package/dist/sourcegen/string.d.ts +8 -0
  1360. package/dist/sourcegen/string.js +23 -0
  1361. package/dist/sourcegen/string.js.map +1 -0
  1362. package/dist/sourcegen/undefined.d.ts +5 -0
  1363. package/dist/sourcegen/undefined.js +7 -0
  1364. package/dist/sourcegen/undefined.js.map +1 -0
  1365. package/dist/sourcegen/unknown.d.ts +2 -0
  1366. package/dist/sourcegen/unknown.js +36 -0
  1367. package/dist/sourcegen/unknown.js.map +1 -0
  1368. package/dist/sourcegen/value.d.ts +4 -0
  1369. package/dist/sourcegen/value.js +3 -0
  1370. package/dist/sourcegen/value.js.map +1 -0
  1371. package/dist/testing/capture-stderr.d.ts +6 -0
  1372. package/dist/testing/capture-stderr.js +21 -0
  1373. package/dist/testing/capture-stderr.js.map +1 -0
  1374. package/dist/testing/clear-git-env.d.ts +1 -0
  1375. package/dist/testing/clear-git-env.js +25 -0
  1376. package/dist/testing/clear-git-env.js.map +1 -0
  1377. package/dist/testing/fixture-sandbox.d.ts +41 -0
  1378. package/dist/testing/fixture-sandbox.js +122 -0
  1379. package/dist/testing/fixture-sandbox.js.map +1 -0
  1380. package/dist/testing/global-setup.d.ts +3 -0
  1381. package/dist/testing/global-setup.js +17 -0
  1382. package/dist/testing/global-setup.js.map +1 -0
  1383. package/dist/util/index.d.ts +9 -0
  1384. package/dist/util/index.js +23 -0
  1385. package/dist/util/index.js.map +1 -0
  1386. package/oclif.manifest.json +4365 -0
  1387. package/package.json +173 -0
@@ -0,0 +1,1330 @@
1
+ import { randomUUID } from 'node:crypto';
2
+ import fs from 'node:fs/promises';
3
+ import { tmpdir } from 'node:os';
4
+ import path from 'node:path';
5
+ import Debug from 'debug';
6
+ import { execa } from 'execa';
7
+ import JSON5 from 'json5';
8
+ import { parse as parseYaml } from 'yaml';
9
+ import { createFauxPackageFiles } from './faux-package.js';
10
+ import { isPnpmfilePath } from './package-files/pnpmfile.js';
11
+ import { lineage } from './package-files/walk.js';
12
+ import { PathLookup, Runnable } from './package-files/package-manager.js';
13
+ import { capList, redactUrl } from '../embedded-packages/diagnostics.js';
14
+ import { splitPnpmLockfileDocuments } from '../pnpm-lockfile-documents.js';
15
+ import { pathToPosix } from '../util.js';
16
+ const debug = Debug('checkly:cli:services:check-parser:lockfile-pruner');
17
+ // A legitimate prune reuses resolutions from the lockfile and takes seconds
18
+ // (measured 1-4s even against multi-thousand-package lockfiles); only a
19
+ // stale lockfile behind an unreachable registry runs long, and that path
20
+ // ends in a fallback anyway because the subset check rejects fresh
21
+ // resolutions — so waiting minutes buys nothing.
22
+ const DEFAULT_TIMEOUT_MS = 30_000;
23
+ // A pre-install probe (yarn's version check, pnpm's store lookup) shares
24
+ // the install's budget, see PruneBudget; if it leaves the install less than
25
+ // this, the prune is abandoned with a message naming the probe rather than
26
+ // spawning an install doomed to time out.
27
+ const PROBE_MIN_INSTALL_BUDGET_MS = 1_000;
28
+ /**
29
+ * The prune's time budget, shared between the pre-install probes (yarn's
30
+ * version check, pnpm's store lookup) and the install itself, so the prune
31
+ * cannot block for longer than the documented timeout in total — a stalled
32
+ * first-use corepack download would otherwise be paid once per spawn. A
33
+ * total of 0 means "no timeout" (execa's own semantics), so nothing is
34
+ * ever exhausted then.
35
+ */
36
+ class PruneBudget {
37
+ totalMs;
38
+ #spentMs = 0;
39
+ constructor(totalMs) {
40
+ this.totalMs = totalMs;
41
+ }
42
+ /**
43
+ * execa timeout for the next spawn. Never 0 for a bounded budget: execa
44
+ * would read that as "no timeout".
45
+ */
46
+ get remainingMs() {
47
+ if (this.totalMs === 0) {
48
+ return 0;
49
+ }
50
+ return Math.max(this.totalMs - this.#spentMs, 1);
51
+ }
52
+ /**
53
+ * Whether a bounded budget has less than the install floor left, in
54
+ * which case spawning the install would only produce a misleading
55
+ * ~zero-length timeout.
56
+ */
57
+ get belowFloor() {
58
+ return this.totalMs > 0 && this.totalMs - this.#spentMs < PROBE_MIN_INSTALL_BUDGET_MS;
59
+ }
60
+ /**
61
+ * Spawns a child within the remaining budget and charges its wall-clock
62
+ * time. The timeout is read before the clock starts, so the first spawn
63
+ * reports exactly the configured budget when it times out. Returned
64
+ * alongside the result for that message.
65
+ */
66
+ async spawn(runnable, options) {
67
+ const timeoutMs = this.remainingMs;
68
+ const startedAt = Date.now();
69
+ const result = await execa(runnable.executable, runnable.args, {
70
+ cwd: options.cwd,
71
+ env: options.env,
72
+ extendEnv: false,
73
+ timeout: timeoutMs,
74
+ reject: false,
75
+ });
76
+ this.#spentMs += Date.now() - startedAt;
77
+ return { result, timeoutMs };
78
+ }
79
+ }
80
+ const MAX_FAILURE_DETAIL_LENGTH = 400;
81
+ // Cap for the child's partial output logged at debug level when a prune
82
+ // times out. Generous enough to reach the stalled request past pnpm's
83
+ // progress lines, bounded so a chatty child cannot flood the log.
84
+ const MAX_DEBUG_OUTPUT_LENGTH = 8_192;
85
+ const TIMEOUT_HINT = 'set CHECKLY_LOCKFILE_PRUNE_TIMEOUT=<seconds> to raise it';
86
+ // Node's timers cannot represent a delay beyond 2^31-1 ms and would clamp a
87
+ // larger one to 1 ms, turning a "raise the budget" request into an instant
88
+ // timeout, so anything past that is rejected as unusable.
89
+ const MAX_TIMEOUT_SECONDS = Math.floor(2_147_483_647 / 1000);
90
+ /**
91
+ * Reads the prune time budget from CHECKLY_LOCKFILE_PRUNE_TIMEOUT, given in
92
+ * whole seconds; `0` disables the timeout (execa's own semantics). Anything
93
+ * else (unset, empty, negative, fractional, non-numeric, too large) yields
94
+ * undefined so the caller falls back to the default; an unusable value is
95
+ * only noted on the debug channel, since it cannot make a prune fail.
96
+ */
97
+ function timeoutFromEnv(env) {
98
+ const raw = env.CHECKLY_LOCKFILE_PRUNE_TIMEOUT;
99
+ if (raw === undefined || raw === '') {
100
+ return undefined;
101
+ }
102
+ if (!/^\d+$/.test(raw) || Number(raw) > MAX_TIMEOUT_SECONDS) {
103
+ debug(`Ignoring CHECKLY_LOCKFILE_PRUNE_TIMEOUT=${JSON.stringify(raw)}: not a whole number of seconds`
104
+ + ` up to ${MAX_TIMEOUT_SECONDS}`);
105
+ return undefined;
106
+ }
107
+ return Number(raw) * 1000;
108
+ }
109
+ /** Whole seconds where possible, so the reason matches the env var's unit. */
110
+ function formatBudget(timeoutMs) {
111
+ return timeoutMs % 1000 === 0 ? `${timeoutMs / 1000}s` : `${timeoutMs}ms`;
112
+ }
113
+ /**
114
+ * Environment keys that alter the very behavior the prune command pins with
115
+ * explicit flags. Everything else (registry and auth configuration in
116
+ * particular) is passed through.
117
+ */
118
+ const STRIPPED_ENV_KEYS = new Set([
119
+ 'npm_config_frozen_lockfile',
120
+ 'npm_config_lockfile',
121
+ 'npm_config_package_lock',
122
+ 'npm_config_dry_run',
123
+ 'npm_config_ignore_workspace',
124
+ // Redirects the lockfile write outside the temp dir. The explicit
125
+ // --lockfile-dir flag on the pnpm command outranks this anyway; stripped
126
+ // as defense in depth.
127
+ 'npm_config_lockfile_dir',
128
+ ]);
129
+ /**
130
+ * A workspace package's manifest path in the archive, posix-relative to
131
+ * the workspace root — the keying the bundler's file map uses. Exported so
132
+ * the bundler's manifest pruning derives identical keys; the
133
+ * `rewrittenManifests` set is matched against these.
134
+ */
135
+ export function manifestArchivePath(workspace, pkg) {
136
+ return pathToPosix(path.relative(workspace.root.path, pkg.packageJsonPath));
137
+ }
138
+ function unknownVersionReason(pkg) {
139
+ return `the version of workspace package '${pkg.name}' could not be determined`;
140
+ }
141
+ /** The workspace lockfile's archive path, when the workspace has one. */
142
+ export function lockfileArchivePath(workspace) {
143
+ if (!workspace.lockfile.isOk()) {
144
+ return undefined;
145
+ }
146
+ return pathToPosix(path.relative(workspace.root.path, workspace.lockfile.unwrap()));
147
+ }
148
+ /**
149
+ * Decides whether the bundle's lockfile needs pruning at all. Pruning only
150
+ * matters when the bundle differs from the full workspace — when every
151
+ * workspace member's real manifest is in the bundle, the original lockfile
152
+ * already describes the bundle exactly.
153
+ */
154
+ export function shouldPruneLockfile(workspace, files, env = process.env, rewrittenManifests = new Set()) {
155
+ // '0' is the documented spelling; 'false' is a tolerated alias for the
156
+ // common boolean-env habit and must keep working.
157
+ if (env.CHECKLY_LOCKFILE_PRUNE === '0' || env.CHECKLY_LOCKFILE_PRUNE === 'false') {
158
+ return { prune: false, reason: `disabled via CHECKLY_LOCKFILE_PRUNE=${env.CHECKLY_LOCKFILE_PRUNE}` };
159
+ }
160
+ const archivePath = lockfileArchivePath(workspace);
161
+ if (archivePath === undefined) {
162
+ return { prune: false, reason: 'the workspace has no lockfile' };
163
+ }
164
+ const lockfileEntry = files.get(archivePath);
165
+ if (lockfileEntry === undefined) {
166
+ return { prune: false, reason: 'the bundle does not contain the lockfile' };
167
+ }
168
+ let bundleMatchesWorkspace = true;
169
+ for (const pkg of [workspace.root, ...workspace.packages]) {
170
+ const archivePath = manifestArchivePath(workspace, pkg);
171
+ const manifest = files.get(archivePath);
172
+ if (manifest === undefined || !manifest.physical) {
173
+ bundleMatchesWorkspace = false;
174
+ }
175
+ // A faux manifest for a member with an unknown version carries the
176
+ // 0.0.0 fallback, which could make specifiers resolve differently than
177
+ // they did for the user; do not feed it into resolution. A manifest
178
+ // the bundler rewrote from its on-disk original is exempt: it carries
179
+ // the member's real content, version field included (or legitimately
180
+ // absent, as on most workspace roots).
181
+ if (manifest !== undefined
182
+ && !manifest.physical
183
+ && pkg.version === undefined
184
+ && !rewrittenManifests.has(archivePath)) {
185
+ return { prune: false, reason: unknownVersionReason(pkg), notable: true };
186
+ }
187
+ }
188
+ if (bundleMatchesWorkspace) {
189
+ return { prune: false, reason: 'the bundle contains the full workspace' };
190
+ }
191
+ return { prune: true, lockfileArchivePath: archivePath };
192
+ }
193
+ // Deliberately NOT materialized: .yarnrc.yml (and bunfig.toml). Both can
194
+ // hold registry auth secrets and neither is part of the bundle today. For
195
+ // yarn the omission is verified safe for --mode=update-lockfile: Berry
196
+ // lockfiles are registry-agnostic (npm: protocol, content checksums — no
197
+ // URLs to rewrite), locked git entries reuse without approvedGitRepositories,
198
+ // packageExtensions does not change entry serialization, and any resolution
199
+ // that WOULD need registry config is blocked by the child env's network
200
+ // guard and fails closed.
201
+ const MATERIALIZED_BASENAMES = new Set(['package.json', '.npmrc', 'pnpm-workspace.yaml']);
202
+ /**
203
+ * Selects the bundle entries that affect dependency resolution: manifests,
204
+ * package manager configuration, patches and the lockfile itself. This
205
+ * deliberately mirrors what the remote install will see, so the pruned
206
+ * lockfile matches the remote install's inputs.
207
+ */
208
+ export function selectMaterializationEntries(files, lockfileArchivePath) {
209
+ const selected = [];
210
+ for (const [archivePath, file] of files) {
211
+ // The lockfile is always selected — without it the "regeneration" would
212
+ // be a from-scratch registry resolution. (Even for a symlink entry, the
213
+ // materialization copies the file the entry's own path points at.)
214
+ if (archivePath === lockfileArchivePath) {
215
+ selected.push([archivePath, file]);
216
+ continue;
217
+ }
218
+ if (file.physical && file.symlinkTarget !== undefined) {
219
+ continue;
220
+ }
221
+ const segments = archivePath.split('/');
222
+ // Entries can resolve outside the workspace root (a '..' archive path) —
223
+ // never write those into the temp dir. node_modules content and embedded
224
+ // package tarballs play no part in lockfile resolution.
225
+ if (segments.includes('..') || segments.includes('node_modules')) {
226
+ continue;
227
+ }
228
+ if (segments[0] === '.checkly') {
229
+ continue;
230
+ }
231
+ const basename = segments[segments.length - 1];
232
+ if (MATERIALIZED_BASENAMES.has(basename)
233
+ || isPnpmfilePath(basename)
234
+ || basename.endsWith('.patch')) {
235
+ selected.push([archivePath, file]);
236
+ }
237
+ }
238
+ return selected;
239
+ }
240
+ class UnsupportedLockfileFormatError extends Error {
241
+ }
242
+ // Yarn Berry lockfile metadata versions this parser handles, mapped to the
243
+ // yarn major that writes them — the parser allowlist and the
244
+ // generation-mismatch check both derive from this one table so adding a
245
+ // version cannot leave them out of sync. Version 6 is yarn 3; 8 (early
246
+ // yarn 4) and 10 (current) are yarn 4. 6 records dependency specs without
247
+ // the npm: protocol prefix; 8+ record it.
248
+ const YARN_METADATA_VERSION_TO_MAJOR = { 6: 3, 8: 4, 10: 4 };
249
+ const PNPM_DEPENDENCY_GROUPS = ['dependencies', 'devDependencies', 'optionalDependencies'];
250
+ // Manifests can also reference a workspace member through peerDependencies
251
+ // (plugin-style monorepos), even though lockfile importer sections do not
252
+ // have a peer group of their own.
253
+ const MANIFEST_DEPENDENCY_GROUPS = [...PNPM_DEPENDENCY_GROUPS, 'peerDependencies'];
254
+ function parseLockfileSnapshot(content, lockfileName) {
255
+ const snapshot = {
256
+ excludeLinksFromLockfile: false,
257
+ edges: new Map(),
258
+ resolutions: new Map(),
259
+ importers: new Set(),
260
+ };
261
+ if (lockfileName === 'pnpm-lock.yaml') {
262
+ // pnpm 12 may prepend an environment document that pins pnpm itself. Both
263
+ // the original and the regenerated lockfile go through here, and only the
264
+ // application document is compared: the environment document's entries
265
+ // are pnpm's own binaries, not resolutions the bundle depends on. The
266
+ // regenerated bytes are still shipped whole, environment document included.
267
+ const doc = parseYaml(splitPnpmLockfileDocuments(content).main);
268
+ if (doc === null || typeof doc !== 'object') {
269
+ throw new UnsupportedLockfileFormatError(`could not parse ${lockfileName}`);
270
+ }
271
+ snapshot.lockfileVersion = doc.lockfileVersion !== undefined ? String(doc.lockfileVersion) : undefined;
272
+ // Fail closed on unknown formats: a future pnpm schema could rename the
273
+ // sections this parser reads, silently emptying every check.
274
+ const pnpmMajor = snapshot.lockfileVersion?.split('.')[0];
275
+ if (pnpmMajor === undefined || !['6', '9'].includes(pnpmMajor)) {
276
+ throw new UnsupportedLockfileFormatError(`unsupported ${lockfileName} version ${snapshot.lockfileVersion}`);
277
+ }
278
+ snapshot.pnpmfileChecksum = typeof doc.pnpmfileChecksum === 'string' ? doc.pnpmfileChecksum : undefined;
279
+ snapshot.excludeLinksFromLockfile = doc.settings?.excludeLinksFromLockfile === true;
280
+ for (const [importer, groups] of Object.entries(doc.importers ?? {})) {
281
+ snapshot.importers.add(importer);
282
+ if (groups === null || typeof groups !== 'object') {
283
+ continue;
284
+ }
285
+ for (const group of PNPM_DEPENDENCY_GROUPS) {
286
+ const entries = groups[group];
287
+ if (entries === null || typeof entries !== 'object') {
288
+ continue;
289
+ }
290
+ for (const [name, entry] of Object.entries(entries)) {
291
+ // v9 entries are `{ specifier, version }` objects; older formats
292
+ // use a plain version string.
293
+ const version = typeof entry === 'string' ? entry : entry?.version;
294
+ if (typeof version !== 'string') {
295
+ continue;
296
+ }
297
+ snapshot.edges.set(`${importer}\0${group}\0${name}`, {
298
+ name,
299
+ isLink: version.startsWith('link:'),
300
+ });
301
+ }
302
+ }
303
+ }
304
+ // Package keys pin exact versions (and peer suffixes), so presence alone
305
+ // is what the subset check needs.
306
+ for (const section of ['packages', 'snapshots']) {
307
+ for (const key of Object.keys(doc[section] ?? {})) {
308
+ // The display name drops the peer suffix (`foo@1.0.0(bar@2.0.0)`)
309
+ // that the `snapshots` key carries and the `packages` key does not,
310
+ // so a re-resolved package is named once across the two sections.
311
+ snapshot.resolutions.set(`${section}\0${key}`, key.replace(/\(.*$/, ''));
312
+ }
313
+ }
314
+ return snapshot;
315
+ }
316
+ if (lockfileName === 'package-lock.json') {
317
+ let doc;
318
+ try {
319
+ doc = JSON.parse(content);
320
+ }
321
+ catch {
322
+ throw new UnsupportedLockfileFormatError(`could not parse ${lockfileName}`);
323
+ }
324
+ snapshot.lockfileVersion = doc?.lockfileVersion !== undefined ? String(doc.lockfileVersion) : undefined;
325
+ const packages = doc?.packages;
326
+ // lockfileVersion 1 has no `packages` section; without it neither the
327
+ // link check nor the subset check can see anything. Unknown future
328
+ // versions fail closed for the same reason.
329
+ if (!['2', '3'].includes(snapshot.lockfileVersion ?? '')
330
+ || packages === null || typeof packages !== 'object') {
331
+ throw new UnsupportedLockfileFormatError(`unsupported ${lockfileName} version ${snapshot.lockfileVersion}`);
332
+ }
333
+ for (const [key, entry] of Object.entries(packages)) {
334
+ if (entry === null || typeof entry !== 'object') {
335
+ continue;
336
+ }
337
+ const nodeModulesIndex = key.lastIndexOf('node_modules/');
338
+ if (nodeModulesIndex === -1) {
339
+ // The root project's entry is keyed '' in package-lock.json;
340
+ // normalize to '.' so the importer-preservation check treats it
341
+ // like pnpm's root importer.
342
+ snapshot.importers.add(key === '' ? '.' : key);
343
+ continue;
344
+ }
345
+ // Covers nested installs too (`packages/a/node_modules/foo`), which
346
+ // npm emits when a member's version conflicts with a hoisted one.
347
+ const name = key.slice(nodeModulesIndex + 'node_modules/'.length);
348
+ snapshot.edges.set(key, {
349
+ name,
350
+ isLink: entry.link === true,
351
+ });
352
+ if (entry.link !== true) {
353
+ // Paths are unique per lockfile, so the version can ride along in
354
+ // the key to make a changed version an unknown entry.
355
+ const version = String(entry.version ?? entry.resolved ?? '');
356
+ const pinned = version === '' ? key : `${key}@${version}`;
357
+ snapshot.resolutions.set(pinned, pinned);
358
+ }
359
+ }
360
+ return snapshot;
361
+ }
362
+ if (lockfileName === 'bun.lock') {
363
+ // bun.lock is JSONC (bun writes trailing commas), hence JSON5.
364
+ let doc;
365
+ try {
366
+ doc = JSON5.parse(content);
367
+ }
368
+ catch {
369
+ throw new UnsupportedLockfileFormatError(`could not parse ${lockfileName}`);
370
+ }
371
+ const version = doc?.lockfileVersion !== undefined ? String(doc.lockfileVersion) : undefined;
372
+ const workspaces = doc?.workspaces;
373
+ const packages = doc?.packages;
374
+ // Fail closed on unknown formats, like the parsers above.
375
+ if (version !== '1'
376
+ || workspaces === null || typeof workspaces !== 'object'
377
+ || packages === null || typeof packages !== 'object') {
378
+ throw new UnsupportedLockfileFormatError(`unsupported ${lockfileName} version ${version}`);
379
+ }
380
+ // configVersion is folded into the version so the verification step also
381
+ // catches a regeneration that changed it. Bun preserves an existing value
382
+ // and treats an absent one as 0 rather than upgrading it, so the fold is
383
+ // stable for lockfiles written by older bun versions too. The format is
384
+ // self-describing because the value surfaces verbatim in the "lockfile
385
+ // version changed" failure reason.
386
+ snapshot.lockfileVersion = `${version} (configVersion ${doc.configVersion ?? 0})`;
387
+ // A dependency edge resolves to a workspace link if either its spec says
388
+ // so or the package entry it resolves to is a workspace tuple; the latter
389
+ // covers bare semver specs that bun resolved to a workspace member. The
390
+ // entry must be resolved per edge — member-scoped key first, hoisted key
391
+ // second, as in parseBunLockfileVersion — because a workspace member's
392
+ // name may also be consumed from the registry by a different importer,
393
+ // and a name-global answer would misclassify one of the two edges.
394
+ const resolvesToWorkspace = (memberName, depName) => {
395
+ const keys = typeof memberName === 'string' && memberName !== ''
396
+ ? [`${memberName}/${depName}`, depName]
397
+ : [depName];
398
+ for (const key of keys) {
399
+ const tuple = packages[key];
400
+ if (Array.isArray(tuple) && typeof tuple[0] === 'string') {
401
+ return tuple[0].includes('@workspace:');
402
+ }
403
+ }
404
+ return false;
405
+ };
406
+ for (const [dir, entry] of Object.entries(workspaces)) {
407
+ // The root importer is keyed '' in bun.lock; normalize to '.' so the
408
+ // importer-preservation check treats it like pnpm's root importer.
409
+ const importer = dir === '' ? '.' : dir;
410
+ snapshot.importers.add(importer);
411
+ if (entry === null || typeof entry !== 'object') {
412
+ continue;
413
+ }
414
+ // Unlike pnpm importers, bun workspace entries mirror all four manifest
415
+ // dependency groups, peerDependencies included.
416
+ for (const group of MANIFEST_DEPENDENCY_GROUPS) {
417
+ const entries = entry[group];
418
+ if (entries === null || typeof entries !== 'object') {
419
+ continue;
420
+ }
421
+ for (const [name, spec] of Object.entries(entries)) {
422
+ if (typeof spec !== 'string') {
423
+ continue;
424
+ }
425
+ snapshot.edges.set(`${importer}\0${group}\0${name}`, {
426
+ name,
427
+ isLink: spec.startsWith('workspace:')
428
+ || spec.startsWith('link:')
429
+ || resolvesToWorkspace(entry.name, name),
430
+ });
431
+ }
432
+ }
433
+ }
434
+ // Package values are resolution tuples (name@version, then registry URL,
435
+ // dependencies and integrity in a kind-dependent arity). Key the subset
436
+ // check by the whole serialized tuple rather than by the lockfile key:
437
+ // pruning the member that owns a hoisted key re-keys the surviving
438
+ // member-scoped entry (e.g. `b/ms` becomes `ms`) with an unchanged tuple,
439
+ // which a key-based check would falsely reject — while any change WITHIN
440
+ // a tuple (a registry rewrite of the tarball URL, a version bump) must
441
+ // still fail the check. Serialization is stable because both sides are
442
+ // parsed from bun's own deterministic output by this same function.
443
+ for (const tuple of Object.values(packages)) {
444
+ const name = Array.isArray(tuple) && typeof tuple[0] === 'string' ? tuple[0] : JSON.stringify(tuple);
445
+ snapshot.resolutions.set(JSON.stringify(tuple), name);
446
+ }
447
+ return snapshot;
448
+ }
449
+ if (lockfileName === 'yarn.lock') {
450
+ // Yarn Classic (v1) files must be recognized BEFORE the YAML parse:
451
+ // realistic Classic lockfiles do not parse as YAML at all (an entry
452
+ // with a nested `dependencies:` block mixes plain scalars and a
453
+ // mapping, which the parser rejects), so without the header check a
454
+ // Classic user would get a "could not parse" message implying a broken
455
+ // lockfile. Every yarn-1-generated lockfile carries this header.
456
+ if (/^# yarn lockfile v1$/m.test(content)) {
457
+ throw new UnsupportedLockfileFormatError(`${lockfileName} is a Yarn Classic (v1) lockfile, which is not supported`);
458
+ }
459
+ let doc;
460
+ try {
461
+ // The failsafe schema keeps every scalar a string: yarn 3 writes
462
+ // bare numeric ranges unquoted (`two: 2`), which the default schema
463
+ // would coerce to numbers — dropping those edges (and losing `1.0`
464
+ // as written, so String() could not undo it).
465
+ doc = parseYaml(content, { schema: 'failsafe' });
466
+ }
467
+ catch {
468
+ throw new UnsupportedLockfileFormatError(`could not parse ${lockfileName}`);
469
+ }
470
+ if (doc === null || typeof doc !== 'object') {
471
+ throw new UnsupportedLockfileFormatError(`could not parse ${lockfileName}`);
472
+ }
473
+ const metadata = doc.__metadata;
474
+ if (metadata === null || typeof metadata !== 'object' || metadata.version === undefined) {
475
+ throw new UnsupportedLockfileFormatError(`${lockfileName} is not a Yarn Berry lockfile (Yarn Classic lockfiles are not supported)`);
476
+ }
477
+ // Fail closed on unknown metadata versions, like the parsers above
478
+ // (see YARN_METADATA_VERSION_TO_MAJOR).
479
+ const version = String(metadata.version);
480
+ // hasOwnProperty, not `in`: a corrupted lockfile whose version equals an
481
+ // Object.prototype key ('toString', '__proto__') must still fail closed.
482
+ if (!Object.prototype.hasOwnProperty.call(YARN_METADATA_VERSION_TO_MAJOR, version)) {
483
+ throw new UnsupportedLockfileFormatError(`unsupported ${lockfileName} metadata version ${version}`);
484
+ }
485
+ snapshot.lockfileVersion = version;
486
+ // The cacheKey names the checksum scheme; a regeneration under a
487
+ // different scheme must fail verification. Compared as its own field —
488
+ // not folded into the version — because yarn 3 omits cacheKey entirely
489
+ // when a lockfile resolves no registry packages, so a prune that
490
+ // removes the last registry entry legitimately goes from "cacheKey: 8"
491
+ // to no cacheKey at all.
492
+ snapshot.cacheKey = metadata.cacheKey !== undefined ? String(metadata.cacheKey) : undefined;
493
+ // First pass: validate the entry shape and collect the descriptors (the
494
+ // comma-joined parts of each entry key) that name workspace entries, so
495
+ // edges can be classified per descriptor below. Splitting on ', ' is
496
+ // safe: npm semver ranges cannot contain a comma, and yarn itself joins
497
+ // descriptor lists with this exact separator.
498
+ const workspaceDescriptors = new Set();
499
+ const entries = [];
500
+ for (const [key, entry] of Object.entries(doc)) {
501
+ if (key === '__metadata') {
502
+ continue;
503
+ }
504
+ if (entry === null || typeof entry !== 'object' || typeof entry.resolution !== 'string') {
505
+ throw new UnsupportedLockfileFormatError(`unsupported ${lockfileName} entry shape for '${key}'`);
506
+ }
507
+ entries.push([key, entry]);
508
+ if (entry.resolution.includes('@workspace:')) {
509
+ for (const descriptor of key.split(', ')) {
510
+ workspaceDescriptors.add(descriptor);
511
+ }
512
+ }
513
+ }
514
+ // A regular dependency edge resolves to a workspace link if either its
515
+ // spec says so or its descriptor is one the lockfile keys a workspace
516
+ // entry under; the latter covers bare semver specs that yarn resolved
517
+ // to a workspace member (the member's entry is then keyed under both
518
+ // the range descriptor and the workspace descriptor). Classified per
519
+ // descriptor, because a member's name may also be consumed from the
520
+ // registry by a different importer. The spec is probed as written —
521
+ // metadata version 6 records `^1.0.0` where 8+ record `npm:^1.0.0`,
522
+ // and the keys follow the same convention, so no prefix juggling is
523
+ // needed. Peer edges are deliberately NEVER probed: a peer only shares
524
+ // a descriptor with some other importer's real dependency, and pruning
525
+ // that importer away legitimately removes the descriptor — probing
526
+ // would then classify the surviving peer edge as a link that
527
+ // "degraded", failing a correct prune. Peers are never resolved on
528
+ // their own (the consumer's ancestors provide them), so there is no
529
+ // silent-substitution channel to catch either; a `workspace:` peer
530
+ // spec still counts as a link via its prefix.
531
+ const resolvesToWorkspace = (name, spec) => {
532
+ return workspaceDescriptors.has(`${name}@${spec}`);
533
+ };
534
+ for (const [, entry] of entries) {
535
+ const resolution = entry.resolution;
536
+ // lastIndexOf, not a simple split: scoped names contain '@'.
537
+ const workspaceMarker = resolution.lastIndexOf('@workspace:');
538
+ if (workspaceMarker === -1) {
539
+ // Non-workspace entries (registry, git, patch, portal, ...) feed the
540
+ // subset check. Key it by the whole serialized entry rather than the
541
+ // lockfile key: pruning a consumer shrinks a multi-descriptor key
542
+ // (e.g. "b@npm:^1.0.0, b@workspace:packages/b" loses its npm range)
543
+ // with an unchanged value, which a key-based check would falsely
544
+ // reject — while any change WITHIN an entry (version, checksum,
545
+ // dependencies) must still fail the check. Serialization is stable
546
+ // because both sides are parsed from yarn's own deterministic
547
+ // output by this same function.
548
+ snapshot.resolutions.set(JSON.stringify(entry), resolution);
549
+ continue;
550
+ }
551
+ // Workspace entries are the importers: their resolution carries the
552
+ // member directory ('.' for the root), and their dependencies maps
553
+ // carry the importer's edges — devDependencies and
554
+ // optionalDependencies are merged into `dependencies` by yarn, and
555
+ // peerDependencies stays its own group. Their content changes when a
556
+ // member is shimmed, which is exactly what pruning does, so they must
557
+ // NOT feed the subset check above.
558
+ const importer = resolution.slice(workspaceMarker + '@workspace:'.length);
559
+ snapshot.importers.add(importer);
560
+ for (const group of ['dependencies', 'peerDependencies']) {
561
+ const dependencies = entry[group];
562
+ if (dependencies === null || typeof dependencies !== 'object') {
563
+ continue;
564
+ }
565
+ for (const [name, spec] of Object.entries(dependencies)) {
566
+ if (typeof spec !== 'string') {
567
+ continue;
568
+ }
569
+ snapshot.edges.set(`${importer}\0${group}\0${name}`, {
570
+ name,
571
+ isLink: spec.startsWith('workspace:')
572
+ || spec.startsWith('link:')
573
+ || spec.startsWith('portal:')
574
+ // Descriptor probing is for regular dependencies only — see
575
+ // resolvesToWorkspace above for why peers must not probe.
576
+ || (group === 'dependencies' && resolvesToWorkspace(name, spec)),
577
+ });
578
+ }
579
+ }
580
+ }
581
+ return snapshot;
582
+ }
583
+ if (lockfileName === 'bun.lockb') {
584
+ throw new UnsupportedLockfileFormatError('the binary bun.lockb format is not supported;'
585
+ + ' regenerate a text lockfile with `bun install --save-text-lockfile`');
586
+ }
587
+ throw new UnsupportedLockfileFormatError(`unsupported lockfile ${lockfileName}`);
588
+ }
589
+ /**
590
+ * Verifies that the regenerated lockfile is a pruned copy of the original
591
+ * rather than a (partial) re-resolution. Returns a failure reason, or
592
+ * undefined when everything checks out.
593
+ */
594
+ function verifyPrunedLockfile(original, regenerated, files) {
595
+ // A changed lockfile format version means the package manager rewrote the
596
+ // file wholesale (e.g. a newer pnpm "upgrading" an old lockfile), which is
597
+ // a full re-resolution.
598
+ if (original.lockfileVersion !== regenerated.lockfileVersion) {
599
+ return `the lockfile version changed from ${original.lockfileVersion} to ${regenerated.lockfileVersion}`;
600
+ }
601
+ // A changed yarn checksum scheme means every checksum was rewritten —
602
+ // a wholesale regeneration, not a prune. Only compared when both sides
603
+ // record one: yarn 3 omits the cacheKey when a lockfile resolves no
604
+ // registry packages, which a prune can legitimately arrive at.
605
+ if (original.cacheKey !== undefined && regenerated.cacheKey !== undefined
606
+ && original.cacheKey !== regenerated.cacheKey) {
607
+ return `the lockfile cacheKey changed from ${original.cacheKey} to ${regenerated.cacheKey}`;
608
+ }
609
+ // Any change to the recorded pnpmfile checksum means the resolve ran with
610
+ // different pnpm hooks than the user's own install.
611
+ if (original.pnpmfileChecksum !== regenerated.pnpmfileChecksum) {
612
+ return 'the regenerated lockfile records a different pnpmfile checksum than the original';
613
+ }
614
+ // Pruning only removes: every resolution in the regenerated lockfile must
615
+ // already exist in the original. A new or changed resolution means the
616
+ // lockfile was out of date with the bundled manifests and the package
617
+ // manager resolved something fresh from the registry — versions the user
618
+ // never installed or tested with.
619
+ // Collected by display name: pnpm records a re-resolved package under
620
+ // both `packages` and `snapshots`, which would otherwise list it twice.
621
+ const unexpected = new Set();
622
+ for (const [key, name] of regenerated.resolutions) {
623
+ if (!original.resolutions.has(key)) {
624
+ unexpected.add(name);
625
+ }
626
+ }
627
+ if (unexpected.size > 0) {
628
+ // Names can be URLs (tarball and git dependencies), so each is
629
+ // redacted on its own, after deduplication (two entries can redact to
630
+ // the same text) and before joining (a URL's redaction would swallow
631
+ // the separator after it). Only the length cap applies to the joined
632
+ // sample; the complete list goes to the debug channel.
633
+ const listed = [...unexpected].map(name => redactDetail(name));
634
+ if (debug.enabled) {
635
+ debug('%d unexpected resolution(s) in the regenerated lockfile: %s', listed.length, listed.join(', '));
636
+ }
637
+ return `the regenerated lockfile resolves entries not present in the original: `
638
+ + capDetail(capList(listed, ', ', ' and '))
639
+ + ` (is the lockfile out of date with package.json?)`;
640
+ }
641
+ // Every dependency edge that was a workspace link and that still exists
642
+ // must still be a link. Catches npm's silent registry substitution (a
643
+ // member whose version does not satisfy a range is fetched from the
644
+ // registry with exit code 0).
645
+ for (const [key, edge] of original.edges) {
646
+ if (!edge.isLink) {
647
+ continue;
648
+ }
649
+ const after = regenerated.edges.get(key);
650
+ if (after !== undefined && !after.isLink) {
651
+ return `'${edge.name}' is no longer a workspace link`;
652
+ }
653
+ }
654
+ // Importers may only disappear for members absent from the bundle. Losing
655
+ // an importer whose manifest IS bundled would make the remote (frozen)
656
+ // install see an importer the lockfile lacks.
657
+ for (const importer of original.importers) {
658
+ if (regenerated.importers.has(importer)) {
659
+ continue;
660
+ }
661
+ const manifestPath = importer === '.' ? 'package.json' : `${importer}/package.json`;
662
+ if (files.has(manifestPath)) {
663
+ return `the regenerated lockfile lost the importer '${importer}' whose manifest is bundled`;
664
+ }
665
+ }
666
+ }
667
+ /**
668
+ * Synthesizes faux manifests for workspace members that selected manifests
669
+ * reference as links (via the `workspace:` protocol, or resolved as links in
670
+ * the original lockfile) but that have no manifest among the selected
671
+ * entries. Without these the temp-dir resolve would fail (pnpm) or silently
672
+ * resolve the member from the registry (npm) — and, crucially, the same
673
+ * would happen during the remote install, so the caller must also register
674
+ * the returned manifests into the bundle.
675
+ */
676
+ async function collectBackfilledManifests(workspace, selected, original) {
677
+ const linkedNames = new Set();
678
+ for (const edge of original.edges.values()) {
679
+ if (edge.isLink) {
680
+ linkedNames.add(edge.name);
681
+ }
682
+ }
683
+ const manifestEntries = selected.filter(([archivePath]) => path.posix.basename(archivePath) === 'package.json');
684
+ const presentManifestPaths = new Set(manifestEntries.map(([archivePath]) => archivePath));
685
+ const backfilled = new Map();
686
+ for (const [, file] of manifestEntries) {
687
+ let manifest;
688
+ try {
689
+ const content = file.physical
690
+ ? await fs.readFile(file.filePath, 'utf8')
691
+ : file.content;
692
+ manifest = JSON.parse(content);
693
+ }
694
+ catch {
695
+ continue;
696
+ }
697
+ for (const group of MANIFEST_DEPENDENCY_GROUPS) {
698
+ const entries = manifest?.[group];
699
+ if (entries === null || typeof entries !== 'object') {
700
+ continue;
701
+ }
702
+ for (const [name, spec] of Object.entries(entries)) {
703
+ const member = workspace.memberByName(name);
704
+ if (member === undefined || member === workspace.root) {
705
+ continue;
706
+ }
707
+ // Optional peers (peerDependenciesMeta.optional) are deliberately NOT
708
+ // exempted: pnpm resolves a `workspace:` peer spec regardless of the
709
+ // optional flag when auto-install-peers is on (the default), so a
710
+ // missing manifest fails the install outright.
711
+ const isLink = (typeof spec === 'string' && spec.startsWith('workspace:'))
712
+ || linkedNames.has(name);
713
+ if (!isLink) {
714
+ continue;
715
+ }
716
+ const memberManifestPath = manifestArchivePath(workspace, member);
717
+ if (presentManifestPaths.has(memberManifestPath) || backfilled.has(memberManifestPath)) {
718
+ continue;
719
+ }
720
+ // Same rule as in shouldPruneLockfile: never feed the 0.0.0 fallback
721
+ // version into resolution.
722
+ if (member.version === undefined) {
723
+ return { skipReason: unknownVersionReason(member) };
724
+ }
725
+ for (const fauxFile of createFauxPackageFiles(member)) {
726
+ backfilled.set(pathToPosix(path.relative(workspace.root.path, fauxFile.filePath)), fauxFile);
727
+ }
728
+ }
729
+ }
730
+ }
731
+ return { manifests: backfilled };
732
+ }
733
+ function buildChildEnv(baseEnv) {
734
+ const env = {};
735
+ for (const [key, value] of Object.entries(baseEnv)) {
736
+ if (STRIPPED_ENV_KEYS.has(key.toLowerCase())) {
737
+ continue;
738
+ }
739
+ env[key] = value;
740
+ }
741
+ // The temp project's root package.json may pin a different package manager
742
+ // than the one being invoked; relax corepack's mismatch error (this does
743
+ // not affect corepack's pinned-version resolution).
744
+ env.COREPACK_ENABLE_STRICT = '0';
745
+ // A legitimate yarn prune needs no network at all (verified even with a
746
+ // cold cache: the fetch step only touches entries that are NEW, which a
747
+ // prune never introduces) — but a lockfile that is out of date with a
748
+ // manifest would make yarn resolve the missing descriptor against its
749
+ // configured registry, and since the project's .yarnrc.yml is not
750
+ // materialized (see MATERIALIZED_BASENAMES) that is the PUBLIC registry:
751
+ // the request would disclose the (possibly private) package name before
752
+ // the subset verification could reject the result. Disabling the network
753
+ // makes that case fail fast with yarn's own blocked-request error
754
+ // instead. Only Yarn Berry reads this variable, and every Berry
755
+ // generation accepts it (unlike YARN_ENABLE_HARDENED_MODE, which is set
756
+ // per-run once the yarn generation is known).
757
+ env.YARN_ENABLE_NETWORK = '0';
758
+ // Yarn honors a .yarnrc.yml (Berry) or .yarnrc (Classic) found in ANY
759
+ // ancestor of its working directory — for the prune temp dir that means
760
+ // the system temp root and everything above it, none of which this
761
+ // process controls (on shared hosts /tmp is world-writable). An ancestor
762
+ // rc can redirect the lockfile write (lockfileFilename), re-enable what
763
+ // the variables above disable, or worst of all execute an arbitrary
764
+ // script via yarnPath/yarn-path — during the version probe already. Two
765
+ // independent guards, because one alone is insufficient:
766
+ // - YARN_IGNORE_PATH neutralizes yarnPath/yarn-path specifically, and
767
+ // is the ONLY mechanism that covers Yarn Classic (which ignores
768
+ // YARN_RC_FILENAME and has no env-settable rc path). Verified to
769
+ // disable the exploit on 1.22.22, 3.8.7 and 4.18.0.
770
+ // - YARN_RC_FILENAME points Berry's rc lookup at a per-invocation
771
+ // random name so no ancestor rc is read at all (blocking
772
+ // lockfileFilename etc., not just yarnPath). It must be random: a
773
+ // fixed name is a compile-time constant an attacker can pre-create
774
+ // to re-open the channel.
775
+ env.YARN_IGNORE_PATH = '1';
776
+ env.YARN_RC_FILENAME = `.checkly-lockfile-prune-no-rc-${randomUUID()}.yml`;
777
+ // The link step (where lifecycle scripts run) is already skipped by
778
+ // --mode=update-lockfile; disabling scripts outright is defense in
779
+ // depth, and enableScripts exists in every Berry generation.
780
+ env.YARN_ENABLE_SCRIPTS = '0';
781
+ return env;
782
+ }
783
+ /**
784
+ * Scrubs credentials from package manager output before it is surfaced
785
+ * anywhere. Every http(s) URL is collapsed to scheme and host by
786
+ * `redactUrl`: registries carry tokens in userinfo, in the query string and
787
+ * in path segments (Gemfury-style `https://host/<token>/npm/`), and the host
788
+ * is all a stalled-request diagnosis needs. A scheme-less `//user:pw@host`
789
+ * (pnpm prints registry keys in that form) loses its userinfo. Redaction is
790
+ * by removal only; nothing is reconstructed from the credential-bearing
791
+ * parts.
792
+ */
793
+ export function redactDetail(detail) {
794
+ return detail
795
+ .replace(/https?:\/\/\S+/gi, url => redactUrl(url))
796
+ // Greedy up to the last '@' before the path, so an unencoded '@' inside
797
+ // the password does not leave its tail behind.
798
+ .replace(/\/\/[^/\s]+@/g, '//')
799
+ .trim();
800
+ }
801
+ function sanitizeDetail(detail) {
802
+ return capDetail(redactDetail(detail));
803
+ }
804
+ /** The length cap alone, for text that is already redacted. */
805
+ function capDetail(detail) {
806
+ if (detail.length <= MAX_FAILURE_DETAIL_LENGTH) {
807
+ return detail;
808
+ }
809
+ return `${detail.slice(0, MAX_FAILURE_DETAIL_LENGTH)}…`;
810
+ }
811
+ /**
812
+ * Logs a child's stdout/stderr at debug level, redacted. Only the tail is
813
+ * kept: for a timed-out child the most recent output is where a stalled
814
+ * request shows, and a probe's answer is its last line. The user-facing
815
+ * reason stays a one-liner, so this is the only place the output survives.
816
+ */
817
+ function debugChildOutput(label, output, { timedOut }) {
818
+ if (!debug.enabled) {
819
+ return;
820
+ }
821
+ for (const [stream, text] of [['stdout', output.stdout], ['stderr', output.stderr]]) {
822
+ const redacted = redactDetail(text ?? '');
823
+ if (redacted.length === 0) {
824
+ continue;
825
+ }
826
+ const tail = redacted.length <= MAX_DEBUG_OUTPUT_LENGTH
827
+ ? redacted
828
+ : `…${redacted.slice(-MAX_DEBUG_OUTPUT_LENGTH)}`;
829
+ // The output goes in as an argument, not the format string, so `%o`
830
+ // and `%%` sequences in it are printed verbatim.
831
+ debug(timedOut ? '%s timed out; partial %s:\n%s' : '%s %s:\n%s', label, stream, tail);
832
+ }
833
+ }
834
+ /**
835
+ * The first non-empty stream of a failed child, for the failure reason:
836
+ * stderr carries the error for most package managers, stdout for some,
837
+ * and execa's own message covers a child that never wrote at all.
838
+ */
839
+ function firstChildOutput(result) {
840
+ return [result.stderr, result.stdout, result.shortMessage]
841
+ .find(value => typeof value === 'string' && value.trim() !== '') ?? 'unknown error';
842
+ }
843
+ // Larger files are not plausible manifests; the cap also keeps a scan of a
844
+ // shared temp root from slurping an arbitrarily large unrelated file.
845
+ const MAX_ANCESTOR_MANIFEST_BYTES = 4 * 1024 * 1024;
846
+ async function directoryExists(dir) {
847
+ try {
848
+ await fs.access(dir);
849
+ return true;
850
+ }
851
+ catch {
852
+ return false;
853
+ }
854
+ }
855
+ // Shared between the spawn-ENOENT and lockfile-read-ENOENT branches: both
856
+ // must rule out a reaped temp dir before attributing the ENOENT to anything
857
+ // more specific.
858
+ const TEMP_DIR_VANISHED = {
859
+ status: 'failed',
860
+ reason: 'the temp directory disappeared while the command ran',
861
+ };
862
+ // A missing package manager binary is a real situation for bun, whose
863
+ // detection needs only a committed bun.lock. Pruning was never attempted,
864
+ // so it is a notable skip, not a failure whose message would suggest the
865
+ // lockfile is broken — and installing the package manager, not disabling
866
+ // pruning, is the fix.
867
+ function executableMissing(executable) {
868
+ return {
869
+ status: 'skipped',
870
+ reason: `${executable} is not installed or not on PATH; install it so the lockfile can be pruned`,
871
+ notable: true,
872
+ };
873
+ }
874
+ /**
875
+ * Classifies a failed spawn whose executable may simply be absent. On
876
+ * Windows a missing executable never surfaces as a spawn ENOENT: execa
877
+ * resolves the command itself (via which-command) and wraps an
878
+ * unresolvable command in cmd.exe, so the child "runs" and exits non-zero
879
+ * with cmd.exe's not-recognized message. Classify after the fact with a
880
+ * PATH probe — safe against probe/spawn resolution differences, because
881
+ * the command has already failed either way and only the reporting is at
882
+ * stake. Executables given as a path are left to the spawn's own error
883
+ * detail. Returns undefined when the executable exists, i.e. the failure
884
+ * is the command's own.
885
+ */
886
+ async function missingFromPath(executable) {
887
+ if (path.basename(executable) !== executable) {
888
+ return undefined;
889
+ }
890
+ const executablePath = await new PathLookup().lookupPath(executable);
891
+ return executablePath === undefined ? executableMissing(executable) : undefined;
892
+ }
893
+ /**
894
+ * Walks from `startDir` to the filesystem root looking for a package.json
895
+ * that declares npm workspaces. The caller treats any hit as "this location
896
+ * is not a safe sandbox", so the scan errs toward matching: manifests are
897
+ * parsed with the same leniency bun's own package.json parser has (JSONC —
898
+ * comments and trailing commas, which strict JSON.parse rejects), and a
899
+ * manifest that exists but cannot be parsed even then counts as a hit
900
+ * (`parseable: false`), since bun's parser might still accept it.
901
+ */
902
+ async function findWorkspaceAncestor(startDir) {
903
+ for (const dir of lineage(startDir)) {
904
+ const manifestPath = path.join(dir, 'package.json');
905
+ let raw;
906
+ try {
907
+ // Shared temp roots can hold arbitrary files under this name; stat
908
+ // first so a FIFO can't hang the read and an oversized file isn't
909
+ // slurped.
910
+ const stats = await fs.stat(manifestPath);
911
+ if (!stats.isFile() || stats.size > MAX_ANCESTOR_MANIFEST_BYTES) {
912
+ continue;
913
+ }
914
+ raw = await fs.readFile(manifestPath, 'utf8');
915
+ }
916
+ catch {
917
+ // No manifest here — keep walking.
918
+ continue;
919
+ }
920
+ try {
921
+ const manifest = JSON5.parse(raw);
922
+ if (manifest !== null && typeof manifest === 'object' && 'workspaces' in manifest) {
923
+ return { dir, parseable: true };
924
+ }
925
+ }
926
+ catch {
927
+ return { dir, parseable: false };
928
+ }
929
+ }
930
+ return undefined;
931
+ }
932
+ /**
933
+ * Regenerates the bundle's lockfile so it matches the bundle's actual set of
934
+ * manifests, by materializing the resolution-relevant bundle entries into a
935
+ * temp directory and running the package manager's lockfile-only install.
936
+ *
937
+ * Returns `skipped` when pruning is unnecessary or unsupported, and `failed`
938
+ * when the caller should fall back to the original lockfile.
939
+ */
940
+ export async function pruneBundledLockfile(options) {
941
+ const { workspace, packageManager, files, rewrittenManifests = new Set(), env = process.env, } = options;
942
+ // An explicit option (tests) outranks the environment; the destructuring
943
+ // carries no default so that an omitted option is distinguishable.
944
+ const timeoutMs = options.timeoutMs ?? timeoutFromEnv(env) ?? DEFAULT_TIMEOUT_MS;
945
+ const decision = shouldPruneLockfile(workspace, files, env, rewrittenManifests);
946
+ if (!decision.prune) {
947
+ return { status: 'skipped', reason: decision.reason, notable: decision.notable };
948
+ }
949
+ // Every pre-run skip below this point is notable: shouldPruneLockfile has
950
+ // already established that the bundle is a partial workspace, so the
951
+ // lockfile over-describes the bundle and this setup cannot be helped.
952
+ // (The one post-run skip — a byte-identical regeneration — is the
953
+ // opposite: pruning ran and proved there was nothing to change.)
954
+ // This capability check must stay ahead of the lockfile read below: an
955
+ // unsupported package manager should always skip notably, never surface
956
+ // a lockfile read error as a 'failed' warning that implies pruning was
957
+ // attempted.
958
+ // Reassigned once the store directory is known (see below), so every
959
+ // message past that point names the command that actually ran.
960
+ let runnable = packageManager.lockfileOnlyInstallCommand();
961
+ if (runnable === undefined) {
962
+ return {
963
+ status: 'skipped',
964
+ reason: `${packageManager.name} has no supported lockfile-only install`,
965
+ notable: true,
966
+ };
967
+ }
968
+ const lockfileName = path.posix.basename(decision.lockfileArchivePath);
969
+ let originalContent;
970
+ try {
971
+ originalContent = await fs.readFile(workspace.lockfile.unwrap(), 'utf8');
972
+ }
973
+ catch (err) {
974
+ return { status: 'failed', reason: `could not read the lockfile: ${err.message}` };
975
+ }
976
+ let original;
977
+ try {
978
+ original = parseLockfileSnapshot(originalContent, lockfileName);
979
+ }
980
+ catch (err) {
981
+ return { status: 'skipped', reason: err.message, notable: true };
982
+ }
983
+ if (original.excludeLinksFromLockfile) {
984
+ // Without link entries in the lockfile, neither the backfill nor the
985
+ // link-preservation check can see workspace links.
986
+ return {
987
+ status: 'skipped',
988
+ reason: 'the lockfile is written with excludeLinksFromLockfile',
989
+ notable: true,
990
+ };
991
+ }
992
+ const selected = selectMaterializationEntries(files, decision.lockfileArchivePath);
993
+ if (original.pnpmfileChecksum !== undefined) {
994
+ const hasPnpmfile = selected.some(([archivePath]) => isPnpmfilePath(archivePath));
995
+ if (!hasPnpmfile) {
996
+ return {
997
+ status: 'skipped',
998
+ reason: 'the lockfile records a pnpmfile checksum but no pnpmfile is bundled',
999
+ notable: true,
1000
+ };
1001
+ }
1002
+ }
1003
+ const backfill = await collectBackfilledManifests(workspace, selected, original);
1004
+ if ('skipReason' in backfill) {
1005
+ return { status: 'skipped', reason: backfill.skipReason, notable: true };
1006
+ }
1007
+ let tempDir;
1008
+ try {
1009
+ // Assign before the realpath call so a realpath failure cannot leak the
1010
+ // freshly created directory.
1011
+ tempDir = await fs.mkdtemp(path.join(tmpdir(), 'checkly-lockfile-prune-'));
1012
+ tempDir = await fs.realpath(tempDir);
1013
+ // Bun re-roots at an ancestor directory whose package.json declares
1014
+ // workspaces with a glob matching the working directory — and then
1015
+ // resolves against THAT root and writes the regenerated lockfile there,
1016
+ // outside this sandbox, over a real file. This can only happen when the
1017
+ // system temp dir itself sits inside a workspace (e.g. TMPDIR pointing
1018
+ // into a repo), so refuse to run rather than risk it. pnpm pins the
1019
+ // write with --lockfile-dir and anchors at the materialized
1020
+ // pnpm-workspace.yaml, and npm does not re-root, so only bun needs the
1021
+ // guard.
1022
+ if (packageManager.name === 'bun') {
1023
+ const ancestor = await findWorkspaceAncestor(path.dirname(tempDir));
1024
+ if (ancestor !== undefined) {
1025
+ return {
1026
+ status: 'skipped',
1027
+ reason: (ancestor.parseable
1028
+ ? `the temp directory is inside the npm workspace at '${ancestor.dir}'`
1029
+ : `an unparseable package.json at '${ancestor.dir}' could not be ruled out as a workspace root`)
1030
+ + '; point TMPDIR (TEMP/TMP on Windows) outside any workspace to enable pruning',
1031
+ notable: true,
1032
+ };
1033
+ }
1034
+ }
1035
+ const entries = [
1036
+ ...selected,
1037
+ ...backfill.manifests,
1038
+ ];
1039
+ for (const [archiveRelativePath, file] of entries) {
1040
+ const target = path.join(tempDir, ...archiveRelativePath.split('/'));
1041
+ // Defense in depth alongside the '..' filter in
1042
+ // selectMaterializationEntries: never write outside the temp dir.
1043
+ // (A plain startsWith('..') would also reject a directory that merely
1044
+ // begins with two dots, e.g. '..artifacts'.)
1045
+ const relative = path.relative(tempDir, target);
1046
+ if (relative === '..' || relative.startsWith(`..${path.sep}`) || path.isAbsolute(relative)) {
1047
+ continue;
1048
+ }
1049
+ await fs.mkdir(path.dirname(target), { recursive: true });
1050
+ if (file.physical) {
1051
+ await fs.copyFile(file.filePath, target);
1052
+ }
1053
+ else {
1054
+ await fs.writeFile(target, file.content);
1055
+ }
1056
+ }
1057
+ // Guard against the selection or the write guards having dropped the
1058
+ // lockfile — running without one would be a from-scratch registry
1059
+ // resolution, not a prune.
1060
+ try {
1061
+ await fs.access(path.join(tempDir, lockfileName));
1062
+ }
1063
+ catch {
1064
+ return { status: 'failed', reason: 'the lockfile could not be materialized' };
1065
+ }
1066
+ // Yarn Classic must be stopped BEFORE the install is spawned: verified
1067
+ // on yarn 1.22.22 that it silently ignores --mode=update-lockfile and
1068
+ // performs a FULL install — fresh registry resolution, node_modules in
1069
+ // the temp dir, dependency lifecycle scripts — with exit 0, then writes
1070
+ // a v1 lockfile that fails verification with misleading advice. Classic
1071
+ // is what a plain `yarn` resolves to when a Berry project pins its
1072
+ // version via yarnPath (which lives in the unbundled .yarnrc.yml)
1073
+ // rather than the packageManager field. Only a positive 1.x match
1074
+ // skips: a failing or unparseable probe falls through to the install,
1075
+ // whose own error carries the real detail — so a probe hiccup can
1076
+ // never block a working prune, mirroring the post-hoc PATH probe
1077
+ // below. Probe and install share the executable, cwd and env, so their
1078
+ // version resolution cannot diverge.
1079
+ const childEnv = buildChildEnv(env);
1080
+ const budget = new PruneBudget(timeoutMs);
1081
+ const storeDirCommand = packageManager.storeDirCommand();
1082
+ // A whole budget below the install floor can never succeed when a probe
1083
+ // precedes the install (the yarn version check, the store lookup), so
1084
+ // reject it up front — before the probe, whose own outcome under such
1085
+ // a budget would be a misleading "timed out" rather than this
1086
+ // caller-misconfiguration.
1087
+ if ((packageManager.name === 'yarn' || storeDirCommand !== undefined) && budget.belowFloor) {
1088
+ return {
1089
+ status: 'failed',
1090
+ reason: `the prune timeout (${timeoutMs}ms) is below the minimum needed to run ${packageManager.name}`,
1091
+ };
1092
+ }
1093
+ if (packageManager.name === 'yarn') {
1094
+ const { result: probe, timeoutMs: probeTimeoutMs } = await budget.spawn(new Runnable(runnable.executable, ['--version']), { cwd: tempDir, env: childEnv });
1095
+ if (probe.timedOut) {
1096
+ // The probe consumed the whole budget; spawning the install with
1097
+ // the ~zero remainder would only produce a confusing second kill.
1098
+ debugChildOutput(`${runnable.executable} --version`, probe, { timedOut: true });
1099
+ return { status: 'failed', reason: `${runnable.executable} timed out after ${formatBudget(probeTimeoutMs)}; ${TIMEOUT_HINT}` };
1100
+ }
1101
+ if (budget.belowFloor) {
1102
+ // The probe (typically a slow first-use corepack toolchain
1103
+ // download) left too little for the install; a 1 ms install would
1104
+ // be a misleading second timeout, so say what actually happened.
1105
+ return {
1106
+ status: 'failed',
1107
+ reason: 'provisioning the yarn toolchain used up the prune time budget before the'
1108
+ + ` lockfile could be regenerated; pre-install yarn or ${TIMEOUT_HINT}`,
1109
+ };
1110
+ }
1111
+ const probeVersion = probe.failed ? '' : probe.stdout?.trim() ?? '';
1112
+ const major = Number.parseInt(probeVersion, 10);
1113
+ if (major === 1) {
1114
+ return {
1115
+ status: 'skipped',
1116
+ reason: 'yarn resolves to Yarn Classic (1.x) here, which cannot regenerate'
1117
+ + ' a Yarn Berry lockfile; set the packageManager field in package.json'
1118
+ + ' and enable Corepack so a Yarn 2+ binary runs instead',
1119
+ notable: true,
1120
+ };
1121
+ }
1122
+ // Yarn only REUSES a lockfile written by its own generation — handed
1123
+ // an older one it re-resolves everything, which the network guard
1124
+ // blocks (verified: yarn 4.18 re-resolves both v6 and v8 lockfiles).
1125
+ // A cross-generation mismatch would therefore fail with a message
1126
+ // about blocked registry requests; skip with the actual remedies
1127
+ // instead. The parser only accepts versions in the table, so the
1128
+ // lookup is always defined here.
1129
+ const requiredMajor = YARN_METADATA_VERSION_TO_MAJOR[original.lockfileVersion ?? ''];
1130
+ if (major >= 2 && major !== requiredMajor) {
1131
+ return {
1132
+ status: 'skipped',
1133
+ reason: `the lockfile was written by yarn ${requiredMajor} (metadata version`
1134
+ + ` ${original.lockfileVersion}) but yarn resolves to ${sanitizeDetail(probeVersion)} here;`
1135
+ + ' run your own install to migrate the lockfile, or pin the matching yarn'
1136
+ + ' version via the packageManager field in package.json so Corepack provisions it',
1137
+ notable: true,
1138
+ };
1139
+ }
1140
+ if (major >= 4) {
1141
+ // Hardened mode revalidates locked entries against the registry —
1142
+ // yarn 4 enables it automatically on pull-request CI, and with the
1143
+ // network guard above that would fail every prune there. Only set
1144
+ // for a CONFIRMED yarn 4+: the setting does not exist before yarn
1145
+ // 4, which rejects unknown environment settings with a usage error
1146
+ // (verified on 3.8.7). An unidentified yarn proceeds without it —
1147
+ // worst case a hardened-mode prune fails closed with a warning.
1148
+ childEnv.YARN_ENABLE_HARDENED_MODE = '0';
1149
+ }
1150
+ }
1151
+ // Pins the store the install resolves from to the workspace's own,
1152
+ // which pnpm would not pick for a temp dir on another filesystem (the
1153
+ // rationale is with PNpmDetector.lockfileOnlyInstallCommand). The
1154
+ // lookup runs in the WORKSPACE ROOT so it reads the workspace's own
1155
+ // config and applies pnpm's same-mount rule to the real project dir.
1156
+ // An unusable answer is a notable skip, not a failure: running against
1157
+ // an empty store is the very thing being avoided, and the remedy is
1158
+ // the package manager's installation or configuration, not the
1159
+ // lockfile.
1160
+ if (storeDirCommand !== undefined) {
1161
+ const display = storeDirCommand.unsafeDisplayCommand;
1162
+ const { result: probe, timeoutMs: probeTimeoutMs } = await budget.spawn(storeDirCommand, { cwd: workspace.root.path, env: childEnv });
1163
+ if (probe.timedOut) {
1164
+ debugChildOutput(display, probe, { timedOut: true });
1165
+ return { status: 'failed', reason: `${display} timed out after ${formatBudget(probeTimeoutMs)}; ${TIMEOUT_HINT}` };
1166
+ }
1167
+ debugChildOutput(display, probe, { timedOut: false });
1168
+ if (probe.code === 'ENOENT') {
1169
+ // execa also reports ENOENT for an invalid working directory, so
1170
+ // rule out a vanished workspace root before blaming the executable.
1171
+ if (!await directoryExists(workspace.root.path)) {
1172
+ return { status: 'failed', reason: `the workspace directory '${workspace.root.path}' disappeared` };
1173
+ }
1174
+ return executableMissing(storeDirCommand.executable);
1175
+ }
1176
+ if (budget.belowFloor) {
1177
+ return {
1178
+ status: 'failed',
1179
+ reason: `determining the ${packageManager.name} store directory used up the prune time budget before the`
1180
+ + ` lockfile could be regenerated; pre-install ${packageManager.name} or ${TIMEOUT_HINT}`,
1181
+ };
1182
+ }
1183
+ if (probe.failed || probe.exitCode !== 0) {
1184
+ const missing = await missingFromPath(storeDirCommand.executable);
1185
+ if (missing !== undefined) {
1186
+ return missing;
1187
+ }
1188
+ return {
1189
+ status: 'skipped',
1190
+ reason: `the ${packageManager.name} store directory could not be determined`
1191
+ + ` (${display} failed: ${sanitizeDetail(firstChildOutput(probe))})`,
1192
+ notable: true,
1193
+ };
1194
+ }
1195
+ // The path is the last non-empty line: pnpm 10's default reporter
1196
+ // can print warnings to stdout ahead of it. It must be absolute and
1197
+ // versioned (`<storeDir>/v10`) — anything else means the command's
1198
+ // output changed shape, and guessing would risk an empty store. The
1199
+ // PARENT is what gets pinned: pnpm appends its own version segment,
1200
+ // and the install's pnpm may be of another major than the lookup's.
1201
+ const printed = (probe.stdout ?? '').split(/\r?\n/).map(line => line.trim()).filter(line => line !== '').at(-1);
1202
+ if (printed === undefined || !path.isAbsolute(printed) || !/^v\d+$/.test(path.basename(printed))) {
1203
+ return {
1204
+ status: 'skipped',
1205
+ reason: `the ${packageManager.name} store directory could not be determined (${display} printed`
1206
+ + ` ${printed === undefined ? 'nothing' : `'${sanitizeDetail(printed)}'`} instead of a versioned store path)`,
1207
+ notable: true,
1208
+ };
1209
+ }
1210
+ runnable = packageManager.lockfileOnlyInstallCommand({ storeDir: path.dirname(printed) }) ?? runnable;
1211
+ }
1212
+ debug(`Running ${runnable.unsafeDisplayCommand} in ${tempDir}`);
1213
+ const { result, timeoutMs: installTimeoutMs } = await budget.spawn(runnable, { cwd: tempDir, env: childEnv });
1214
+ if (result.timedOut) {
1215
+ debugChildOutput(runnable.executable, result, { timedOut: true });
1216
+ return { status: 'failed', reason: `${runnable.executable} timed out after ${formatBudget(installTimeoutMs)}; ${TIMEOUT_HINT}` };
1217
+ }
1218
+ if (result.code === 'ENOENT') {
1219
+ // A spawn ENOENT can also mean the working directory vanished (a temp
1220
+ // reaper); only report a missing executable when the temp dir is
1221
+ // still there.
1222
+ if (!await directoryExists(tempDir)) {
1223
+ return TEMP_DIR_VANISHED;
1224
+ }
1225
+ return executableMissing(runnable.executable);
1226
+ }
1227
+ if (result.failed || result.exitCode !== 0) {
1228
+ const missing = await missingFromPath(runnable.executable);
1229
+ if (missing !== undefined) {
1230
+ return missing;
1231
+ }
1232
+ const detail = firstChildOutput(result);
1233
+ // Yarn's blocked-request error is the network guard doing its job;
1234
+ // surfaced verbatim it reads like the user's own configuration is
1235
+ // broken. Name the two real causes instead — a stale lockfile, or a
1236
+ // same-generation yarn that still declines to reuse it (e.g. a v8
1237
+ // lockfile under a yarn that writes v10). Scan BOTH streams: real
1238
+ // yarn prints YN0080 on stdout, but the single-stream `detail` above
1239
+ // prefers a non-empty stderr, so the marker can hide in either one.
1240
+ const yarnOutput = [result.stdout, result.stderr]
1241
+ .filter((value) => typeof value === 'string' && value.trim() !== '')
1242
+ .join('\n');
1243
+ if (packageManager.name === 'yarn' && /has been blocked/.test(yarnOutput)) {
1244
+ return {
1245
+ status: 'failed',
1246
+ reason: 'yarn needed the network to reuse the lockfile, which pruning forbids'
1247
+ + ' — the lockfile may be out of date with a package.json, or written by a'
1248
+ + ' different yarn version than the one that ran (pin it via the'
1249
+ + ' packageManager field); the request was blocked before any package name'
1250
+ // Yarn's own output stays attached so the affected descriptor
1251
+ // is identifiable; echoing it is no new disclosure, the
1252
+ // request never left the machine.
1253
+ + ` left the machine: ${sanitizeDetail(yarnOutput)}`,
1254
+ };
1255
+ }
1256
+ return {
1257
+ status: 'failed',
1258
+ reason: `${runnable.unsafeDisplayCommand} failed: ${sanitizeDetail(detail)}`,
1259
+ };
1260
+ }
1261
+ let regeneratedContent;
1262
+ try {
1263
+ regeneratedContent = await fs.readFile(path.join(tempDir, lockfileName), 'utf8');
1264
+ }
1265
+ catch (err) {
1266
+ if (err.code === 'ENOENT') {
1267
+ // As in the spawn ENOENT branch: distinguish a reaped temp dir from
1268
+ // a deliberately removed lockfile.
1269
+ if (!await directoryExists(tempDir)) {
1270
+ return TEMP_DIR_VANISHED;
1271
+ }
1272
+ // Some package managers remove rather than write a lockfile in edge
1273
+ // cases (bun deletes one that would describe no packages at all:
1274
+ // "No packages! Deleted empty lockfile") — deliberate behavior, not
1275
+ // a broken lockfile, so don't surface it as a failure whose advice
1276
+ // says to refresh the lockfile.
1277
+ return {
1278
+ status: 'skipped',
1279
+ reason: 'the regenerated lockfile was not found after the command completed'
1280
+ + ' (some package managers delete a lockfile that would describe no packages)',
1281
+ notable: true,
1282
+ };
1283
+ }
1284
+ return {
1285
+ status: 'failed',
1286
+ reason: `could not read the regenerated lockfile: ${err.message}`,
1287
+ };
1288
+ }
1289
+ // A byte-identical regeneration with backfilled manifests still counts
1290
+ // as a prune: the manifests must reach the bundle (a lockfile importer
1291
+ // without a manifest breaks the remote install), and the verification
1292
+ // below passes trivially for identical content.
1293
+ if (regeneratedContent === originalContent && backfill.manifests.size === 0) {
1294
+ return {
1295
+ status: 'skipped',
1296
+ reason: 'the regenerated lockfile is identical to the original',
1297
+ consistent: true,
1298
+ };
1299
+ }
1300
+ let regenerated;
1301
+ try {
1302
+ regenerated = parseLockfileSnapshot(regeneratedContent, lockfileName);
1303
+ }
1304
+ catch (err) {
1305
+ return { status: 'failed', reason: err.message };
1306
+ }
1307
+ const problem = verifyPrunedLockfile(original, regenerated, files);
1308
+ if (problem !== undefined) {
1309
+ return { status: 'failed', reason: problem };
1310
+ }
1311
+ return {
1312
+ status: 'pruned',
1313
+ archivePath: decision.lockfileArchivePath,
1314
+ content: regeneratedContent,
1315
+ originalContent,
1316
+ backfilledManifests: Array.from(backfill.manifests.values()),
1317
+ };
1318
+ }
1319
+ catch (err) {
1320
+ return { status: 'failed', reason: err.message };
1321
+ }
1322
+ finally {
1323
+ if (tempDir !== undefined) {
1324
+ // Cleanup failures must never override the computed result.
1325
+ await fs.rm(tempDir, { recursive: true, force: true, maxRetries: 3 })
1326
+ .catch(err => debug(`Could not remove temp dir ${tempDir}: ${err}`));
1327
+ }
1328
+ }
1329
+ }
1330
+ //# sourceMappingURL=lockfile-pruner.js.map