@socketsecurity/lib 0.0.0 → 1.0.1

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 (555) hide show
  1. package/CHANGELOG.md +276 -0
  2. package/LICENSE +21 -0
  3. package/README.md +80 -2
  4. package/data/extensions.json +28 -0
  5. package/dist/abort.d.ts +11 -0
  6. package/dist/abort.js +62 -0
  7. package/dist/abort.js.map +7 -0
  8. package/dist/agent.d.ts +102 -0
  9. package/dist/agent.js +288 -0
  10. package/dist/agent.js.map +7 -0
  11. package/dist/ansi.d.ts +29 -0
  12. package/dist/ansi.js +62 -0
  13. package/dist/ansi.js.map +7 -0
  14. package/dist/argv/flags.d.ts +199 -0
  15. package/dist/argv/flags.js +284 -0
  16. package/dist/argv/flags.js.map +7 -0
  17. package/dist/argv/parse.d.ts +76 -0
  18. package/dist/argv/parse.js +173 -0
  19. package/dist/argv/parse.js.map +7 -0
  20. package/dist/arrays.d.ts +29 -0
  21. package/dist/arrays.js +87 -0
  22. package/dist/arrays.js.map +7 -0
  23. package/dist/bin.d.ts +50 -0
  24. package/dist/bin.js +405 -0
  25. package/dist/bin.js.map +7 -0
  26. package/dist/cacache.d.ts +86 -0
  27. package/dist/cacache.js +140 -0
  28. package/dist/cacache.js.map +7 -0
  29. package/dist/cache-with-ttl.d.ts +133 -0
  30. package/dist/cache-with-ttl.js +225 -0
  31. package/dist/cache-with-ttl.js.map +7 -0
  32. package/dist/constants/agents.d.ts +37 -0
  33. package/dist/constants/agents.js +128 -0
  34. package/dist/constants/agents.js.map +7 -0
  35. package/dist/constants/core.d.ts +22 -0
  36. package/dist/constants/core.js +59 -0
  37. package/dist/constants/core.js.map +7 -0
  38. package/dist/constants/encoding.d.ts +13 -0
  39. package/dist/constants/encoding.js +50 -0
  40. package/dist/constants/encoding.js.map +7 -0
  41. package/dist/constants/github.d.ts +7 -0
  42. package/dist/constants/github.js +32 -0
  43. package/dist/constants/github.js.map +7 -0
  44. package/dist/constants/licenses.d.ts +8 -0
  45. package/dist/constants/licenses.js +68 -0
  46. package/dist/constants/licenses.js.map +7 -0
  47. package/dist/constants/node.d.ts +29 -0
  48. package/dist/constants/node.js +173 -0
  49. package/dist/constants/node.js.map +7 -0
  50. package/dist/constants/packages.d.ts +19 -0
  51. package/dist/constants/packages.js +130 -0
  52. package/dist/constants/packages.js.map +7 -0
  53. package/dist/constants/paths.d.ts +51 -0
  54. package/dist/constants/paths.js +152 -0
  55. package/dist/constants/paths.js.map +7 -0
  56. package/dist/constants/platform.d.ts +6 -0
  57. package/dist/constants/platform.js +43 -0
  58. package/dist/constants/platform.js.map +7 -0
  59. package/dist/constants/process.d.ts +7 -0
  60. package/dist/constants/process.js +54 -0
  61. package/dist/constants/process.js.map +7 -0
  62. package/dist/constants/socket.d.ts +29 -0
  63. package/dist/constants/socket.js +83 -0
  64. package/dist/constants/socket.js.map +7 -0
  65. package/dist/constants/testing.d.ts +9 -0
  66. package/dist/constants/testing.js +38 -0
  67. package/dist/constants/testing.js.map +7 -0
  68. package/dist/constants/time.d.ts +11 -0
  69. package/dist/constants/time.js +41 -0
  70. package/dist/constants/time.js.map +7 -0
  71. package/dist/constants/typescript.d.ts +6 -0
  72. package/dist/constants/typescript.js +56 -0
  73. package/dist/constants/typescript.js.map +7 -0
  74. package/dist/cover/code.d.ts +8 -0
  75. package/dist/cover/code.js +137 -0
  76. package/dist/cover/code.js.map +7 -0
  77. package/dist/cover/formatters.d.ts +9 -0
  78. package/dist/cover/formatters.js +103 -0
  79. package/dist/cover/formatters.js.map +7 -0
  80. package/dist/cover/type.d.ts +7 -0
  81. package/dist/cover/type.js +65 -0
  82. package/dist/cover/type.js.map +7 -0
  83. package/dist/cover/types.d.ts +70 -0
  84. package/dist/cover/types.js +17 -0
  85. package/dist/cover/types.js.map +7 -0
  86. package/dist/debug.d.ts +99 -0
  87. package/dist/debug.js +345 -0
  88. package/dist/debug.js.map +7 -0
  89. package/dist/dlx-binary.d.ts +49 -0
  90. package/dist/dlx-binary.js +261 -0
  91. package/dist/dlx-binary.js.map +7 -0
  92. package/dist/dlx.d.ts +64 -0
  93. package/dist/dlx.js +168 -0
  94. package/dist/dlx.js.map +7 -0
  95. package/dist/download-lock.d.ts +48 -0
  96. package/dist/download-lock.js +139 -0
  97. package/dist/download-lock.js.map +7 -0
  98. package/dist/effects/pulse-frames.d.ts +23 -0
  99. package/dist/effects/pulse-frames.js +66 -0
  100. package/dist/effects/pulse-frames.js.map +7 -0
  101. package/dist/effects/text-shimmer.d.ts +37 -0
  102. package/dist/effects/text-shimmer.js +175 -0
  103. package/dist/effects/text-shimmer.js.map +7 -0
  104. package/dist/effects/types.d.ts +41 -0
  105. package/dist/effects/types.js +17 -0
  106. package/dist/effects/types.js.map +7 -0
  107. package/dist/effects/ultra.d.ts +16 -0
  108. package/dist/effects/ultra.js +63 -0
  109. package/dist/effects/ultra.js.map +7 -0
  110. package/dist/env/appdata.d.ts +1 -0
  111. package/dist/env/appdata.js +30 -0
  112. package/dist/env/appdata.js.map +7 -0
  113. package/dist/env/ci.d.ts +1 -0
  114. package/dist/env/ci.js +31 -0
  115. package/dist/env/ci.js.map +7 -0
  116. package/dist/env/comspec.d.ts +1 -0
  117. package/dist/env/comspec.js +30 -0
  118. package/dist/env/comspec.js.map +7 -0
  119. package/dist/env/debug.d.ts +1 -0
  120. package/dist/env/debug.js +30 -0
  121. package/dist/env/debug.js.map +7 -0
  122. package/dist/env/getters.d.ts +40 -0
  123. package/dist/env/getters.js +283 -0
  124. package/dist/env/getters.js.map +7 -0
  125. package/dist/env/github-api-url.d.ts +1 -0
  126. package/dist/env/github-api-url.js +30 -0
  127. package/dist/env/github-api-url.js.map +7 -0
  128. package/dist/env/github-base-ref.d.ts +1 -0
  129. package/dist/env/github-base-ref.js +30 -0
  130. package/dist/env/github-base-ref.js.map +7 -0
  131. package/dist/env/github-ref-name.d.ts +1 -0
  132. package/dist/env/github-ref-name.js +30 -0
  133. package/dist/env/github-ref-name.js.map +7 -0
  134. package/dist/env/github-ref-type.d.ts +1 -0
  135. package/dist/env/github-ref-type.js +30 -0
  136. package/dist/env/github-ref-type.js.map +7 -0
  137. package/dist/env/github-repository.d.ts +1 -0
  138. package/dist/env/github-repository.js +30 -0
  139. package/dist/env/github-repository.js.map +7 -0
  140. package/dist/env/github-server-url.d.ts +1 -0
  141. package/dist/env/github-server-url.js +30 -0
  142. package/dist/env/github-server-url.js.map +7 -0
  143. package/dist/env/github-token.d.ts +1 -0
  144. package/dist/env/github-token.js +30 -0
  145. package/dist/env/github-token.js.map +7 -0
  146. package/dist/env/helpers.d.ts +6 -0
  147. package/dist/env/helpers.js +49 -0
  148. package/dist/env/helpers.js.map +7 -0
  149. package/dist/env/home.d.ts +1 -0
  150. package/dist/env/home.js +30 -0
  151. package/dist/env/home.js.map +7 -0
  152. package/dist/env/jest-worker-id.d.ts +1 -0
  153. package/dist/env/jest-worker-id.js +30 -0
  154. package/dist/env/jest-worker-id.js.map +7 -0
  155. package/dist/env/lang.d.ts +1 -0
  156. package/dist/env/lang.js +30 -0
  157. package/dist/env/lang.js.map +7 -0
  158. package/dist/env/lc-all.d.ts +1 -0
  159. package/dist/env/lc-all.js +30 -0
  160. package/dist/env/lc-all.js.map +7 -0
  161. package/dist/env/lc-messages.d.ts +1 -0
  162. package/dist/env/lc-messages.js +30 -0
  163. package/dist/env/lc-messages.js.map +7 -0
  164. package/dist/env/localappdata.d.ts +1 -0
  165. package/dist/env/localappdata.js +30 -0
  166. package/dist/env/localappdata.js.map +7 -0
  167. package/dist/env/node-auth-token.d.ts +1 -0
  168. package/dist/env/node-auth-token.js +30 -0
  169. package/dist/env/node-auth-token.js.map +7 -0
  170. package/dist/env/node-env.d.ts +1 -0
  171. package/dist/env/node-env.js +30 -0
  172. package/dist/env/node-env.js.map +7 -0
  173. package/dist/env/npm-config-registry.d.ts +1 -0
  174. package/dist/env/npm-config-registry.js +30 -0
  175. package/dist/env/npm-config-registry.js.map +7 -0
  176. package/dist/env/npm-config-user-agent.d.ts +1 -0
  177. package/dist/env/npm-config-user-agent.js +30 -0
  178. package/dist/env/npm-config-user-agent.js.map +7 -0
  179. package/dist/env/npm-lifecycle-event.d.ts +1 -0
  180. package/dist/env/npm-lifecycle-event.js +30 -0
  181. package/dist/env/npm-lifecycle-event.js.map +7 -0
  182. package/dist/env/npm-registry.d.ts +1 -0
  183. package/dist/env/npm-registry.js +30 -0
  184. package/dist/env/npm-registry.js.map +7 -0
  185. package/dist/env/npm-token.d.ts +1 -0
  186. package/dist/env/npm-token.js +30 -0
  187. package/dist/env/npm-token.js.map +7 -0
  188. package/dist/env/path.d.ts +1 -0
  189. package/dist/env/path.js +30 -0
  190. package/dist/env/path.js.map +7 -0
  191. package/dist/env/pre-commit.d.ts +1 -0
  192. package/dist/env/pre-commit.js +31 -0
  193. package/dist/env/pre-commit.js.map +7 -0
  194. package/dist/env/shell.d.ts +1 -0
  195. package/dist/env/shell.js +30 -0
  196. package/dist/env/shell.js.map +7 -0
  197. package/dist/env/socket-accept-risks.d.ts +1 -0
  198. package/dist/env/socket-accept-risks.js +31 -0
  199. package/dist/env/socket-accept-risks.js.map +7 -0
  200. package/dist/env/socket-api-base-url.d.ts +1 -0
  201. package/dist/env/socket-api-base-url.js +30 -0
  202. package/dist/env/socket-api-base-url.js.map +7 -0
  203. package/dist/env/socket-api-proxy.d.ts +1 -0
  204. package/dist/env/socket-api-proxy.js +30 -0
  205. package/dist/env/socket-api-proxy.js.map +7 -0
  206. package/dist/env/socket-api-timeout.d.ts +1 -0
  207. package/dist/env/socket-api-timeout.js +31 -0
  208. package/dist/env/socket-api-timeout.js.map +7 -0
  209. package/dist/env/socket-api-token.d.ts +1 -0
  210. package/dist/env/socket-api-token.js +30 -0
  211. package/dist/env/socket-api-token.js.map +7 -0
  212. package/dist/env/socket-cacache-dir.d.ts +1 -0
  213. package/dist/env/socket-cacache-dir.js +30 -0
  214. package/dist/env/socket-cacache-dir.js.map +7 -0
  215. package/dist/env/socket-cli-accept-risks.d.ts +1 -0
  216. package/dist/env/socket-cli-accept-risks.js +33 -0
  217. package/dist/env/socket-cli-accept-risks.js.map +7 -0
  218. package/dist/env/socket-cli-api-base-url.d.ts +1 -0
  219. package/dist/env/socket-cli-api-base-url.js +30 -0
  220. package/dist/env/socket-cli-api-base-url.js.map +7 -0
  221. package/dist/env/socket-cli-api-proxy.d.ts +1 -0
  222. package/dist/env/socket-cli-api-proxy.js +30 -0
  223. package/dist/env/socket-cli-api-proxy.js.map +7 -0
  224. package/dist/env/socket-cli-api-timeout.d.ts +1 -0
  225. package/dist/env/socket-cli-api-timeout.js +31 -0
  226. package/dist/env/socket-cli-api-timeout.js.map +7 -0
  227. package/dist/env/socket-cli-api-token.d.ts +1 -0
  228. package/dist/env/socket-cli-api-token.js +30 -0
  229. package/dist/env/socket-cli-api-token.js.map +7 -0
  230. package/dist/env/socket-cli-config.d.ts +1 -0
  231. package/dist/env/socket-cli-config.js +30 -0
  232. package/dist/env/socket-cli-config.js.map +7 -0
  233. package/dist/env/socket-cli-fix.d.ts +1 -0
  234. package/dist/env/socket-cli-fix.js +30 -0
  235. package/dist/env/socket-cli-fix.js.map +7 -0
  236. package/dist/env/socket-cli-no-api-token.d.ts +1 -0
  237. package/dist/env/socket-cli-no-api-token.js +33 -0
  238. package/dist/env/socket-cli-no-api-token.js.map +7 -0
  239. package/dist/env/socket-cli-optimize.d.ts +1 -0
  240. package/dist/env/socket-cli-optimize.js +31 -0
  241. package/dist/env/socket-cli-optimize.js.map +7 -0
  242. package/dist/env/socket-cli-org-slug.d.ts +1 -0
  243. package/dist/env/socket-cli-org-slug.js +30 -0
  244. package/dist/env/socket-cli-org-slug.js.map +7 -0
  245. package/dist/env/socket-cli-shadow-accept-risks.d.ts +1 -0
  246. package/dist/env/socket-cli-shadow-accept-risks.js +33 -0
  247. package/dist/env/socket-cli-shadow-accept-risks.js.map +7 -0
  248. package/dist/env/socket-cli-shadow-api-token.d.ts +1 -0
  249. package/dist/env/socket-cli-shadow-api-token.js +30 -0
  250. package/dist/env/socket-cli-shadow-api-token.js.map +7 -0
  251. package/dist/env/socket-cli-shadow-bin.d.ts +1 -0
  252. package/dist/env/socket-cli-shadow-bin.js +30 -0
  253. package/dist/env/socket-cli-shadow-bin.js.map +7 -0
  254. package/dist/env/socket-cli-shadow-progress.d.ts +1 -0
  255. package/dist/env/socket-cli-shadow-progress.js +33 -0
  256. package/dist/env/socket-cli-shadow-progress.js.map +7 -0
  257. package/dist/env/socket-cli-shadow-silent.d.ts +1 -0
  258. package/dist/env/socket-cli-shadow-silent.js +33 -0
  259. package/dist/env/socket-cli-shadow-silent.js.map +7 -0
  260. package/dist/env/socket-cli-view-all-risks.d.ts +1 -0
  261. package/dist/env/socket-cli-view-all-risks.js +33 -0
  262. package/dist/env/socket-cli-view-all-risks.js.map +7 -0
  263. package/dist/env/socket-config.d.ts +1 -0
  264. package/dist/env/socket-config.js +30 -0
  265. package/dist/env/socket-config.js.map +7 -0
  266. package/dist/env/socket-debug.d.ts +1 -0
  267. package/dist/env/socket-debug.js +30 -0
  268. package/dist/env/socket-debug.js.map +7 -0
  269. package/dist/env/socket-home.d.ts +1 -0
  270. package/dist/env/socket-home.js +30 -0
  271. package/dist/env/socket-home.js.map +7 -0
  272. package/dist/env/socket-no-api-token.d.ts +1 -0
  273. package/dist/env/socket-no-api-token.js +31 -0
  274. package/dist/env/socket-no-api-token.js.map +7 -0
  275. package/dist/env/socket-npm-registry.d.ts +1 -0
  276. package/dist/env/socket-npm-registry.js +30 -0
  277. package/dist/env/socket-npm-registry.js.map +7 -0
  278. package/dist/env/socket-org-slug.d.ts +1 -0
  279. package/dist/env/socket-org-slug.js +30 -0
  280. package/dist/env/socket-org-slug.js.map +7 -0
  281. package/dist/env/socket-registry-url.d.ts +1 -0
  282. package/dist/env/socket-registry-url.js +30 -0
  283. package/dist/env/socket-registry-url.js.map +7 -0
  284. package/dist/env/socket-view-all-risks.d.ts +1 -0
  285. package/dist/env/socket-view-all-risks.js +31 -0
  286. package/dist/env/socket-view-all-risks.js.map +7 -0
  287. package/dist/env/temp.d.ts +1 -0
  288. package/dist/env/temp.js +30 -0
  289. package/dist/env/temp.js.map +7 -0
  290. package/dist/env/term.d.ts +1 -0
  291. package/dist/env/term.js +30 -0
  292. package/dist/env/term.js.map +7 -0
  293. package/dist/env/tmp.d.ts +1 -0
  294. package/dist/env/tmp.js +30 -0
  295. package/dist/env/tmp.js.map +7 -0
  296. package/dist/env/tmpdir.d.ts +1 -0
  297. package/dist/env/tmpdir.js +30 -0
  298. package/dist/env/tmpdir.js.map +7 -0
  299. package/dist/env/userprofile.d.ts +1 -0
  300. package/dist/env/userprofile.js +30 -0
  301. package/dist/env/userprofile.js.map +7 -0
  302. package/dist/env/vitest.d.ts +1 -0
  303. package/dist/env/vitest.js +31 -0
  304. package/dist/env/vitest.js.map +7 -0
  305. package/dist/env/xdg-cache-home.d.ts +1 -0
  306. package/dist/env/xdg-cache-home.js +30 -0
  307. package/dist/env/xdg-cache-home.js.map +7 -0
  308. package/dist/env/xdg-config-home.d.ts +1 -0
  309. package/dist/env/xdg-config-home.js +30 -0
  310. package/dist/env/xdg-config-home.js.map +7 -0
  311. package/dist/env/xdg-data-home.d.ts +1 -0
  312. package/dist/env/xdg-data-home.js +30 -0
  313. package/dist/env/xdg-data-home.js.map +7 -0
  314. package/dist/env.d.ts +15 -0
  315. package/dist/env.js +63 -0
  316. package/dist/env.js.map +7 -0
  317. package/dist/external/@inquirer/checkbox.js +4 -0
  318. package/dist/external/@inquirer/confirm.js +22 -0
  319. package/dist/external/@inquirer/core.js +4 -0
  320. package/dist/external/@inquirer/input.js +1 -0
  321. package/dist/external/@inquirer/password.js +1 -0
  322. package/dist/external/@inquirer/prompts.js +4 -0
  323. package/dist/external/@inquirer/search.js +1 -0
  324. package/dist/external/@inquirer/select.js +25 -0
  325. package/dist/external/@npmcli/package-json/index.js +1 -0
  326. package/dist/external/@npmcli/package-json/lib/read-package.js +1 -0
  327. package/dist/external/@npmcli/package-json/lib/sort.js +1 -0
  328. package/dist/external/@npmcli/promise-spawn.js +5 -0
  329. package/dist/external/@socketregistry/is-unicode-supported.d.ts +2 -0
  330. package/dist/external/@socketregistry/is-unicode-supported.js +5 -0
  331. package/dist/external/@socketregistry/packageurl-js.js +34 -0
  332. package/dist/external/@socketregistry/yocto-spinner.d.ts +12 -0
  333. package/dist/external/@socketregistry/yocto-spinner.js +8 -0
  334. package/dist/external/@yarnpkg/extensions.d.ts +5 -0
  335. package/dist/external/@yarnpkg/extensions.js +5 -0
  336. package/dist/external/cacache.d.ts +93 -0
  337. package/dist/external/cacache.js +32 -0
  338. package/dist/external/debug.d.ts +25 -0
  339. package/dist/external/debug.js +9 -0
  340. package/dist/external/del.d.ts +1 -0
  341. package/dist/external/del.js +54 -0
  342. package/dist/external/fast-glob.js +54 -0
  343. package/dist/external/fast-sort.d.ts +4 -0
  344. package/dist/external/fast-sort.js +5 -0
  345. package/dist/external/get-east-asian-width.d.ts +5 -0
  346. package/dist/external/get-east-asian-width.js +5 -0
  347. package/dist/external/libnpmpack.d.ts +3 -0
  348. package/dist/external/libnpmpack.js +225 -0
  349. package/dist/external/make-fetch-happen.d.ts +16 -0
  350. package/dist/external/make-fetch-happen.js +69 -0
  351. package/dist/external/normalize-package-data.js +6 -0
  352. package/dist/external/npm-package-arg.js +6 -0
  353. package/dist/external/pacote.d.ts +19 -0
  354. package/dist/external/pacote.js +105 -0
  355. package/dist/external/picomatch.js +5 -0
  356. package/dist/external/semver.d.ts +3 -0
  357. package/dist/external/semver.js +5 -0
  358. package/dist/external/spdx-correct.js +5 -0
  359. package/dist/external/spdx-expression-parse.js +5 -0
  360. package/dist/external/streaming-iterables.js +5 -0
  361. package/dist/external/validate-npm-package-name.js +5 -0
  362. package/dist/external/which.js +5 -0
  363. package/dist/external/yargs-parser.d.ts +3 -0
  364. package/dist/external/yargs-parser.js +26 -0
  365. package/dist/external/yoctocolors-cjs.d.ts +38 -0
  366. package/dist/external/yoctocolors-cjs.js +5 -0
  367. package/dist/external/zod.d.ts +1 -0
  368. package/dist/external/zod.js +27 -0
  369. package/dist/fs.d.ts +184 -0
  370. package/dist/fs.js +610 -0
  371. package/dist/fs.js.map +7 -0
  372. package/dist/functions.d.ts +27 -0
  373. package/dist/functions.js +70 -0
  374. package/dist/functions.js.map +7 -0
  375. package/dist/git.d.ts +93 -0
  376. package/dist/git.js +321 -0
  377. package/dist/git.js.map +7 -0
  378. package/dist/github.d.ts +121 -0
  379. package/dist/github.js +203 -0
  380. package/dist/github.js.map +7 -0
  381. package/dist/globs.d.ts +46 -0
  382. package/dist/globs.js +154 -0
  383. package/dist/globs.js.map +7 -0
  384. package/dist/http-request.d.ts +53 -0
  385. package/dist/http-request.js +315 -0
  386. package/dist/http-request.js.map +7 -0
  387. package/dist/index.d.ts +13 -0
  388. package/dist/index.js +64 -0
  389. package/dist/index.js.map +7 -0
  390. package/dist/ipc.d.ts +366 -0
  391. package/dist/ipc.js +234 -0
  392. package/dist/ipc.js.map +7 -0
  393. package/dist/json.d.ts +23 -0
  394. package/dist/json.js +75 -0
  395. package/dist/json.js.map +7 -0
  396. package/dist/logger.d.ts +183 -0
  397. package/dist/logger.js +653 -0
  398. package/dist/logger.js.map +7 -0
  399. package/dist/maintained-node-versions.d.ts +7 -0
  400. package/dist/maintained-node-versions.js +37 -0
  401. package/dist/maintained-node-versions.js.map +7 -0
  402. package/dist/memoization.d.ts +142 -0
  403. package/dist/memoization.js +212 -0
  404. package/dist/memoization.js.map +7 -0
  405. package/dist/objects.d.ts +146 -0
  406. package/dist/objects.js +321 -0
  407. package/dist/objects.js.map +7 -0
  408. package/dist/packages/editable.d.ts +107 -0
  409. package/dist/packages/editable.js +358 -0
  410. package/dist/packages/editable.js.map +7 -0
  411. package/dist/packages/exports.d.ts +30 -0
  412. package/dist/packages/exports.js +164 -0
  413. package/dist/packages/exports.js.map +7 -0
  414. package/dist/packages/isolation.d.ts +22 -0
  415. package/dist/packages/isolation.js +197 -0
  416. package/dist/packages/isolation.js.map +7 -0
  417. package/dist/packages/licenses.d.ts +68 -0
  418. package/dist/packages/licenses.js +216 -0
  419. package/dist/packages/licenses.js.map +7 -0
  420. package/dist/packages/manifest.d.ts +16 -0
  421. package/dist/packages/manifest.js +192 -0
  422. package/dist/packages/manifest.js.map +7 -0
  423. package/dist/packages/normalize.d.ts +21 -0
  424. package/dist/packages/normalize.js +122 -0
  425. package/dist/packages/normalize.js.map +7 -0
  426. package/dist/packages/operations.d.ts +54 -0
  427. package/dist/packages/operations.js +306 -0
  428. package/dist/packages/operations.js.map +7 -0
  429. package/dist/packages/paths.d.ts +10 -0
  430. package/dist/packages/paths.js +55 -0
  431. package/dist/packages/paths.js.map +7 -0
  432. package/dist/packages/provenance.d.ts +10 -0
  433. package/dist/packages/provenance.js +180 -0
  434. package/dist/packages/provenance.js.map +7 -0
  435. package/dist/packages/registry.d.ts +8 -0
  436. package/dist/packages/registry.js +30 -0
  437. package/dist/packages/registry.js.map +7 -0
  438. package/dist/packages/specs.d.ts +28 -0
  439. package/dist/packages/specs.js +85 -0
  440. package/dist/packages/specs.js.map +7 -0
  441. package/dist/packages/validation.d.ts +15 -0
  442. package/dist/packages/validation.js +53 -0
  443. package/dist/packages/validation.js.map +7 -0
  444. package/dist/packages.d.ts +154 -0
  445. package/dist/packages.js +131 -0
  446. package/dist/packages.js.map +7 -0
  447. package/dist/path.d.ts +74 -0
  448. package/dist/path.js +442 -0
  449. package/dist/path.js.map +7 -0
  450. package/dist/paths.d.ts +42 -0
  451. package/dist/paths.js +145 -0
  452. package/dist/paths.js.map +7 -0
  453. package/dist/performance.d.ts +178 -0
  454. package/dist/performance.js +219 -0
  455. package/dist/performance.js.map +7 -0
  456. package/dist/promise-queue.d.ts +35 -0
  457. package/dist/promise-queue.js +111 -0
  458. package/dist/promise-queue.js.map +7 -0
  459. package/dist/promises.d.ts +67 -0
  460. package/dist/promises.js +268 -0
  461. package/dist/promises.js.map +7 -0
  462. package/dist/prompts.d.ts +27 -0
  463. package/dist/prompts.js +60 -0
  464. package/dist/prompts.js.map +7 -0
  465. package/dist/regexps.d.ts +13 -0
  466. package/dist/regexps.js +32 -0
  467. package/dist/regexps.js.map +7 -0
  468. package/dist/sea.d.ts +10 -0
  469. package/dist/sea.js +46 -0
  470. package/dist/sea.js.map +7 -0
  471. package/dist/shadow.d.ts +17 -0
  472. package/dist/shadow.js +60 -0
  473. package/dist/shadow.js.map +7 -0
  474. package/dist/signal-exit.d.ts +23 -0
  475. package/dist/signal-exit.js +250 -0
  476. package/dist/signal-exit.js.map +7 -0
  477. package/dist/sorts.d.ts +28 -0
  478. package/dist/sorts.js +96 -0
  479. package/dist/sorts.js.map +7 -0
  480. package/dist/spawn.d.ts +207 -0
  481. package/dist/spawn.js +201 -0
  482. package/dist/spawn.js.map +7 -0
  483. package/dist/spinner.d.ts +208 -0
  484. package/dist/spinner.js +729 -0
  485. package/dist/spinner.js.map +7 -0
  486. package/dist/ssri.d.ts +95 -0
  487. package/dist/ssri.js +73 -0
  488. package/dist/ssri.js.map +7 -0
  489. package/dist/stdio/clear.d.ts +40 -0
  490. package/dist/stdio/clear.js +84 -0
  491. package/dist/stdio/clear.js.map +7 -0
  492. package/dist/stdio/divider.d.ts +48 -0
  493. package/dist/stdio/divider.js +81 -0
  494. package/dist/stdio/divider.js.map +7 -0
  495. package/dist/stdio/footer.d.ts +25 -0
  496. package/dist/stdio/footer.js +96 -0
  497. package/dist/stdio/footer.js.map +7 -0
  498. package/dist/stdio/header.d.ts +25 -0
  499. package/dist/stdio/header.js +102 -0
  500. package/dist/stdio/header.js.map +7 -0
  501. package/dist/stdio/mask.d.ts +72 -0
  502. package/dist/stdio/mask.js +187 -0
  503. package/dist/stdio/mask.js.map +7 -0
  504. package/dist/stdio/progress.d.ts +51 -0
  505. package/dist/stdio/progress.js +171 -0
  506. package/dist/stdio/progress.js.map +7 -0
  507. package/dist/stdio/prompts.d.ts +46 -0
  508. package/dist/stdio/prompts.js +90 -0
  509. package/dist/stdio/prompts.js.map +7 -0
  510. package/dist/stdio/stderr.d.ts +48 -0
  511. package/dist/stdio/stderr.js +91 -0
  512. package/dist/stdio/stderr.js.map +7 -0
  513. package/dist/stdio/stdout.d.ts +48 -0
  514. package/dist/stdio/stdout.js +105 -0
  515. package/dist/stdio/stdout.js.map +7 -0
  516. package/dist/streams.d.ts +20 -0
  517. package/dist/streams.js +80 -0
  518. package/dist/streams.js.map +7 -0
  519. package/dist/strings.d.ts +139 -0
  520. package/dist/strings.js +253 -0
  521. package/dist/strings.js.map +7 -0
  522. package/dist/suppress-warnings.d.ts +66 -0
  523. package/dist/suppress-warnings.js +100 -0
  524. package/dist/suppress-warnings.js.map +7 -0
  525. package/dist/tables.d.ts +69 -0
  526. package/dist/tables.js +130 -0
  527. package/dist/tables.js.map +7 -0
  528. package/dist/temporary-executor.d.ts +9 -0
  529. package/dist/temporary-executor.js +54 -0
  530. package/dist/temporary-executor.js.map +7 -0
  531. package/dist/types.d.ts +65 -0
  532. package/dist/types.js +74 -0
  533. package/dist/types.js.map +7 -0
  534. package/dist/url.d.ts +60 -0
  535. package/dist/url.js +144 -0
  536. package/dist/url.js.map +7 -0
  537. package/dist/utils/get-ipc.d.ts +16 -0
  538. package/dist/utils/get-ipc.js +60 -0
  539. package/dist/utils/get-ipc.js.map +7 -0
  540. package/dist/validation/json-parser.d.ts +10 -0
  541. package/dist/validation/json-parser.js +129 -0
  542. package/dist/validation/json-parser.js.map +7 -0
  543. package/dist/validation/types.d.ts +40 -0
  544. package/dist/validation/types.js +17 -0
  545. package/dist/validation/types.js.map +7 -0
  546. package/dist/versions.d.ts +87 -0
  547. package/dist/versions.js +155 -0
  548. package/dist/versions.js.map +7 -0
  549. package/dist/words.d.ts +22 -0
  550. package/dist/words.js +52 -0
  551. package/dist/words.js.map +7 -0
  552. package/dist/zod.d.ts +5 -0
  553. package/dist/zod.js +29 -0
  554. package/dist/zod.js.map +7 -0
  555. package/package.json +856 -7
@@ -0,0 +1,729 @@
1
+ /* Socket Lib - Built with esbuild */
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc2) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc2 = __getOwnPropDesc(from, key)) || desc2.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+ var spinner_exports = {};
30
+ __export(spinner_exports, {
31
+ Spinner: () => Spinner,
32
+ ciSpinner: () => ciSpinner,
33
+ getCliSpinners: () => getCliSpinners,
34
+ getDefaultSpinner: () => getDefaultSpinner,
35
+ spinner: () => spinner,
36
+ withSpinner: () => withSpinner,
37
+ withSpinnerRestore: () => withSpinnerRestore,
38
+ withSpinnerSync: () => withSpinnerSync
39
+ });
40
+ module.exports = __toCommonJS(spinner_exports);
41
+ var import_ci = require("#env/ci");
42
+ var import_pulse_frames = require("./effects/pulse-frames");
43
+ var import_text_shimmer = require("./effects/text-shimmer");
44
+ var import_yocto_spinner = __toESM(require("./external/@socketregistry/yocto-spinner"));
45
+ var import_objects = require("./objects");
46
+ var import_strings = require("./strings");
47
+ const colorToRgb = {
48
+ __proto__: null,
49
+ black: [0, 0, 0],
50
+ blue: [0, 0, 255],
51
+ blueBright: [100, 149, 237],
52
+ cyan: [0, 255, 255],
53
+ cyanBright: [0, 255, 255],
54
+ gray: [128, 128, 128],
55
+ green: [0, 128, 0],
56
+ greenBright: [0, 255, 0],
57
+ magenta: [255, 0, 255],
58
+ magentaBright: [255, 105, 180],
59
+ red: [255, 0, 0],
60
+ redBright: [255, 69, 0],
61
+ white: [255, 255, 255],
62
+ whiteBright: [255, 255, 255],
63
+ yellow: [255, 255, 0],
64
+ yellowBright: [255, 255, 153]
65
+ };
66
+ function isRgbTuple(value) {
67
+ return Array.isArray(value);
68
+ }
69
+ function toRgb(color) {
70
+ if (isRgbTuple(color)) {
71
+ return color;
72
+ }
73
+ return colorToRgb[color];
74
+ }
75
+ const ciSpinner = {
76
+ frames: [""],
77
+ interval: 2147483647
78
+ };
79
+ function desc(value) {
80
+ return {
81
+ __proto__: null,
82
+ configurable: true,
83
+ value,
84
+ writable: true
85
+ };
86
+ }
87
+ function normalizeText(value) {
88
+ return typeof value === "string" ? value.trimStart() : "";
89
+ }
90
+ function formatProgress(progress) {
91
+ const { current, total, unit } = progress;
92
+ const percentage = Math.round(current / total * 100);
93
+ const bar = renderProgressBar(percentage);
94
+ const count = unit ? `${current}/${total} ${unit}` : `${current}/${total}`;
95
+ return `${bar} ${percentage}% (${count})`;
96
+ }
97
+ function renderProgressBar(percentage, width = 20) {
98
+ const filled = Math.round(percentage / 100 * width);
99
+ const empty = width - filled;
100
+ const bar = "\u2588".repeat(filled) + "\u2591".repeat(empty);
101
+ const colors = require("./external/yoctocolors-cjs");
102
+ return colors.cyan(bar);
103
+ }
104
+ let _cliSpinners;
105
+ // @__NO_SIDE_EFFECTS__
106
+ function getCliSpinners(styleName) {
107
+ if (_cliSpinners === void 0) {
108
+ const YoctoCtor = import_yocto_spinner.default;
109
+ const tempInstance = YoctoCtor({});
110
+ const YoctoSpinnerClass = tempInstance.constructor;
111
+ _cliSpinners = {
112
+ __proto__: null,
113
+ ...YoctoSpinnerClass.spinners,
114
+ socket: (0, import_pulse_frames.generateSocketSpinnerFrames)()
115
+ };
116
+ }
117
+ if (typeof styleName === "string" && _cliSpinners) {
118
+ return (0, import_objects.hasOwn)(_cliSpinners, styleName) ? _cliSpinners[styleName] : void 0;
119
+ }
120
+ return _cliSpinners;
121
+ }
122
+ let _Spinner;
123
+ let _defaultSpinner;
124
+ // @__NO_SIDE_EFFECTS__
125
+ function Spinner(options) {
126
+ if (_Spinner === void 0) {
127
+ const YoctoCtor = import_yocto_spinner.default;
128
+ const tempInstance = YoctoCtor({});
129
+ const YoctoSpinnerClass = tempInstance.constructor;
130
+ _Spinner = class SpinnerClass extends YoctoSpinnerClass {
131
+ #baseText = "";
132
+ #indentation = "";
133
+ #progress;
134
+ #shimmer;
135
+ #shimmerSavedConfig;
136
+ constructor(options2) {
137
+ const opts = { __proto__: null, ...options2 };
138
+ const spinnerColor = opts.color ?? [140, 82, 255];
139
+ if (isRgbTuple(spinnerColor) && (spinnerColor.length !== 3 || !spinnerColor.every(
140
+ (n) => typeof n === "number" && n >= 0 && n <= 255
141
+ ))) {
142
+ throw new TypeError(
143
+ "RGB color must be an array of 3 numbers between 0 and 255"
144
+ );
145
+ }
146
+ const spinnerColorRgb = toRgb(spinnerColor);
147
+ let shimmerInfo;
148
+ if (opts.shimmer) {
149
+ let shimmerDir;
150
+ let shimmerColor;
151
+ let shimmerSpeed = 1 / 3;
152
+ if (typeof opts.shimmer === "string") {
153
+ shimmerDir = opts.shimmer;
154
+ } else {
155
+ const shimmerConfig = {
156
+ __proto__: null,
157
+ ...opts.shimmer
158
+ };
159
+ shimmerDir = shimmerConfig.dir ?? import_text_shimmer.DIR_LTR;
160
+ shimmerColor = shimmerConfig.color ?? import_text_shimmer.COLOR_INHERIT;
161
+ shimmerSpeed = shimmerConfig.speed ?? 1 / 3;
162
+ }
163
+ shimmerInfo = {
164
+ __proto__: null,
165
+ color: shimmerColor === void 0 ? import_text_shimmer.COLOR_INHERIT : shimmerColor,
166
+ currentDir: import_text_shimmer.DIR_LTR,
167
+ mode: shimmerDir,
168
+ speed: shimmerSpeed,
169
+ step: 0
170
+ };
171
+ }
172
+ super({
173
+ signal: require("#constants/process").getAbortSignal(),
174
+ ...opts,
175
+ // Pass RGB color directly to yocto-spinner (it now supports RGB).
176
+ color: spinnerColorRgb,
177
+ // onRenderFrame callback provides full control over frame + text layout.
178
+ // Calculates spacing based on frame width to prevent text jumping.
179
+ onRenderFrame: (frame, text, applyColor) => {
180
+ const width = (0, import_strings.stringWidth)(frame);
181
+ const spacing = width === 1 ? " " : " ";
182
+ return frame ? `${applyColor(frame)}${spacing}${text}` : text;
183
+ },
184
+ // onFrameUpdate callback is called by yocto-spinner whenever a frame advances.
185
+ // This ensures shimmer updates are perfectly synchronized with animation beats.
186
+ onFrameUpdate: shimmerInfo ? () => {
187
+ if (this.#baseText) {
188
+ super.text = this.#buildDisplayText();
189
+ }
190
+ } : void 0
191
+ });
192
+ this.#shimmer = shimmerInfo;
193
+ this.#shimmerSavedConfig = shimmerInfo;
194
+ }
195
+ // Override color getter to ensure it's always RGB.
196
+ get color() {
197
+ const value = super.color;
198
+ return isRgbTuple(value) ? value : toRgb(value);
199
+ }
200
+ // Override color setter to always convert to RGB before passing to yocto-spinner.
201
+ set color(value) {
202
+ super.color = isRgbTuple(value) ? value : toRgb(value);
203
+ }
204
+ /**
205
+ * Apply a yocto-spinner method and update logger state.
206
+ * Handles text normalization, extra arguments, and logger tracking.
207
+ * @private
208
+ */
209
+ #apply(methodName, args) {
210
+ let extras;
211
+ let text = args.at(0);
212
+ if (typeof text === "string") {
213
+ extras = args.slice(1);
214
+ } else {
215
+ extras = args;
216
+ text = "";
217
+ }
218
+ const wasSpinning = this.isSpinning;
219
+ const normalized = normalizeText(text);
220
+ super[methodName](normalized);
221
+ const {
222
+ incLogCallCountSymbol,
223
+ lastWasBlankSymbol,
224
+ logger
225
+ } = require("./logger.js");
226
+ if (methodName === "stop") {
227
+ if (wasSpinning && normalized) {
228
+ logger[lastWasBlankSymbol]((0, import_strings.isBlankString)(normalized));
229
+ logger[incLogCallCountSymbol]();
230
+ }
231
+ } else {
232
+ logger[lastWasBlankSymbol](false);
233
+ logger[incLogCallCountSymbol]();
234
+ }
235
+ if (extras.length) {
236
+ logger.log(...extras);
237
+ logger[lastWasBlankSymbol](false);
238
+ }
239
+ return this;
240
+ }
241
+ /**
242
+ * Build the complete display text with progress, shimmer, and indentation.
243
+ * Combines base text, progress bar, shimmer effects, and indentation.
244
+ * @private
245
+ */
246
+ #buildDisplayText() {
247
+ let displayText = this.#baseText;
248
+ if (this.#progress) {
249
+ const progressText = formatProgress(this.#progress);
250
+ displayText = displayText ? `${displayText} ${progressText}` : progressText;
251
+ }
252
+ if (displayText && this.#shimmer) {
253
+ let shimmerColor;
254
+ if (this.#shimmer.color === import_text_shimmer.COLOR_INHERIT) {
255
+ shimmerColor = this.color;
256
+ } else if (Array.isArray(this.#shimmer.color[0])) {
257
+ shimmerColor = this.#shimmer.color;
258
+ } else {
259
+ shimmerColor = toRgb(this.#shimmer.color);
260
+ }
261
+ displayText = (0, import_text_shimmer.applyShimmer)(displayText, this.#shimmer, {
262
+ color: shimmerColor,
263
+ direction: this.#shimmer.mode
264
+ });
265
+ }
266
+ if (this.#indentation && displayText) {
267
+ displayText = this.#indentation + displayText;
268
+ }
269
+ return displayText;
270
+ }
271
+ /**
272
+ * Show a status message without stopping the spinner.
273
+ * Outputs the symbol and message to stderr, then continues spinning.
274
+ */
275
+ #showStatusAndKeepSpinning(symbolType, args) {
276
+ let text = args.at(0);
277
+ let extras;
278
+ if (typeof text === "string") {
279
+ extras = args.slice(1);
280
+ } else {
281
+ extras = args;
282
+ text = "";
283
+ }
284
+ const { LOG_SYMBOLS, logger } = require("./logger.js");
285
+ logger.error(`${LOG_SYMBOLS[symbolType]} ${text}`, ...extras);
286
+ return this;
287
+ }
288
+ /**
289
+ * Update the spinner's displayed text.
290
+ * Rebuilds display text and triggers render.
291
+ * @private
292
+ */
293
+ #updateSpinnerText() {
294
+ super.text = this.#buildDisplayText();
295
+ }
296
+ /**
297
+ * Show a debug message without stopping the spinner (only if debug mode enabled).
298
+ * Outputs to stderr and continues spinning.
299
+ */
300
+ debug(...args) {
301
+ const { isDebug } = require("./debug.js");
302
+ if (isDebug()) {
303
+ return this.#showStatusAndKeepSpinning("info", args);
304
+ }
305
+ return this;
306
+ }
307
+ /**
308
+ * Show a debug message and stop the spinner (only if debug mode enabled).
309
+ * Auto-clears the spinner line before displaying the message.
310
+ */
311
+ debugAndStop(...args) {
312
+ const { isDebug } = require("./debug.js");
313
+ if (isDebug()) {
314
+ return this.#apply("info", args);
315
+ }
316
+ return this;
317
+ }
318
+ /**
319
+ * Decrease indentation level.
320
+ * Pass 0 to reset indentation to zero.
321
+ * @param spaces - Number of spaces to remove (default: 2)
322
+ */
323
+ dedent(spaces) {
324
+ if (spaces === 0) {
325
+ this.#indentation = "";
326
+ } else {
327
+ const amount = spaces ?? 2;
328
+ const newLength = Math.max(0, this.#indentation.length - amount);
329
+ this.#indentation = this.#indentation.slice(0, newLength);
330
+ }
331
+ this.#updateSpinnerText();
332
+ return this;
333
+ }
334
+ /**
335
+ * Alias for success() (shorter name).
336
+ * DESIGN DECISION: Unlike yocto-spinner, our done() does NOT stop the spinner.
337
+ * Use doneAndStop() if you want to stop the spinner.
338
+ */
339
+ done(...args) {
340
+ return this.#showStatusAndKeepSpinning("success", args);
341
+ }
342
+ /**
343
+ * Show a done message and stop the spinner.
344
+ * Auto-clears the spinner line before displaying the success message.
345
+ */
346
+ doneAndStop(...args) {
347
+ return this.#apply("success", args);
348
+ }
349
+ /**
350
+ * Show a failure message without stopping the spinner.
351
+ * DESIGN DECISION: Unlike yocto-spinner, our fail() does NOT stop the spinner.
352
+ * This allows displaying errors while continuing to spin.
353
+ * Use failAndStop() if you want to stop the spinner.
354
+ */
355
+ fail(...args) {
356
+ return this.#showStatusAndKeepSpinning("fail", args);
357
+ }
358
+ /**
359
+ * Show a failure message and stop the spinner.
360
+ * Auto-clears the spinner line before displaying the error message.
361
+ */
362
+ failAndStop(...args) {
363
+ return this.#apply("error", args);
364
+ }
365
+ /**
366
+ * Increase indentation level.
367
+ * Pass 0 to reset indentation to zero.
368
+ * @param spaces - Number of spaces to add (default: 2)
369
+ */
370
+ indent(spaces) {
371
+ if (spaces === 0) {
372
+ this.#indentation = "";
373
+ } else {
374
+ const amount = spaces ?? 2;
375
+ this.#indentation += " ".repeat(amount);
376
+ }
377
+ this.#updateSpinnerText();
378
+ return this;
379
+ }
380
+ /**
381
+ * Show an info message without stopping the spinner.
382
+ * Outputs to stderr and continues spinning.
383
+ */
384
+ info(...args) {
385
+ return this.#showStatusAndKeepSpinning("info", args);
386
+ }
387
+ /**
388
+ * Show an info message and stop the spinner.
389
+ * Auto-clears the spinner line before displaying the message.
390
+ */
391
+ infoAndStop(...args) {
392
+ return this.#apply("info", args);
393
+ }
394
+ /**
395
+ * Log a message to stdout without stopping the spinner.
396
+ * Unlike other methods, this outputs to stdout for data logging.
397
+ */
398
+ log(...args) {
399
+ const { logger } = require("./logger.js");
400
+ logger.log(...args);
401
+ return this;
402
+ }
403
+ /**
404
+ * Log a message and stop the spinner.
405
+ * Auto-clears the spinner line before displaying the message.
406
+ */
407
+ logAndStop(...args) {
408
+ return this.#apply("stop", args);
409
+ }
410
+ /**
411
+ * Update progress information displayed with the spinner.
412
+ * Shows a progress bar with percentage and optional unit label.
413
+ * @param current - Current progress value
414
+ * @param total - Total progress value
415
+ * @param unit - Optional unit label (e.g., 'files', 'items')
416
+ */
417
+ progress = (current, total, unit) => {
418
+ this.#progress = {
419
+ __proto__: null,
420
+ current,
421
+ total,
422
+ ...unit ? { unit } : {}
423
+ };
424
+ this.#updateSpinnerText();
425
+ return this;
426
+ };
427
+ /**
428
+ * Increment progress by a specified amount.
429
+ * Updates the progress bar displayed with the spinner.
430
+ * @param amount - Amount to increment (default: 1)
431
+ */
432
+ progressStep(amount = 1) {
433
+ if (this.#progress) {
434
+ const newCurrent = this.#progress.current + amount;
435
+ this.#progress = {
436
+ __proto__: null,
437
+ current: Math.max(0, Math.min(newCurrent, this.#progress.total)),
438
+ total: this.#progress.total,
439
+ ...this.#progress.unit ? { unit: this.#progress.unit } : {}
440
+ };
441
+ this.#updateSpinnerText();
442
+ }
443
+ return this;
444
+ }
445
+ /**
446
+ * Start the spinner animation with optional text.
447
+ * Begins displaying the animated spinner.
448
+ * @param text - Optional text to display with the spinner
449
+ */
450
+ start(...args) {
451
+ if (args.length) {
452
+ const text = args.at(0);
453
+ const normalized = normalizeText(text);
454
+ if (!normalized) {
455
+ this.#baseText = "";
456
+ super.text = "";
457
+ } else {
458
+ this.#baseText = normalized;
459
+ }
460
+ }
461
+ this.#updateSpinnerText();
462
+ return this.#apply("start", args);
463
+ }
464
+ /**
465
+ * Log a main step message to stderr without stopping the spinner.
466
+ * Adds a blank line before the message for visual separation.
467
+ * Aligns with logger.step() to use stderr for status messages.
468
+ */
469
+ step(...args) {
470
+ const text = args[0];
471
+ const { logger } = require("./logger.js");
472
+ if (typeof text === "string") {
473
+ logger.error("");
474
+ logger.error(text, ...args.slice(1));
475
+ }
476
+ return this;
477
+ }
478
+ /**
479
+ * Log an indented substep message to stderr without stopping the spinner.
480
+ * Adds 2-space indentation to the message.
481
+ * Aligns with logger.substep() to use stderr for status messages.
482
+ */
483
+ substep(...args) {
484
+ const text = args[0];
485
+ if (typeof text === "string") {
486
+ const { logger } = require("./logger.js");
487
+ logger.error(` ${text}`, ...args.slice(1));
488
+ }
489
+ return this;
490
+ }
491
+ /**
492
+ * Stop the spinner animation and clear internal state.
493
+ * Auto-clears the spinner line via yocto-spinner.stop().
494
+ * Resets progress, shimmer, and text state.
495
+ * @param text - Optional final text to display after stopping
496
+ */
497
+ stop(...args) {
498
+ this.#baseText = "";
499
+ this.#progress = void 0;
500
+ if (this.#shimmer) {
501
+ this.#shimmer.currentDir = import_text_shimmer.DIR_LTR;
502
+ this.#shimmer.step = 0;
503
+ }
504
+ const result = this.#apply("stop", args);
505
+ super.text = "";
506
+ return result;
507
+ }
508
+ /**
509
+ * Show a success message without stopping the spinner.
510
+ * DESIGN DECISION: Unlike yocto-spinner, our success() does NOT stop the spinner.
511
+ * This allows displaying success messages while continuing to spin for multi-step operations.
512
+ * Use successAndStop() if you want to stop the spinner.
513
+ */
514
+ success(...args) {
515
+ return this.#showStatusAndKeepSpinning("success", args);
516
+ }
517
+ /**
518
+ * Show a success message and stop the spinner.
519
+ * Auto-clears the spinner line before displaying the success message.
520
+ */
521
+ successAndStop(...args) {
522
+ return this.#apply("success", args);
523
+ }
524
+ text(value) {
525
+ if (arguments.length === 0) {
526
+ return this.#baseText;
527
+ }
528
+ this.#baseText = value ?? "";
529
+ this.#updateSpinnerText();
530
+ return this;
531
+ }
532
+ /**
533
+ * Show a warning message without stopping the spinner.
534
+ * Outputs to stderr and continues spinning.
535
+ */
536
+ warn(...args) {
537
+ return this.#showStatusAndKeepSpinning("warn", args);
538
+ }
539
+ /**
540
+ * Show a warning message and stop the spinner.
541
+ * Auto-clears the spinner line before displaying the warning message.
542
+ */
543
+ warnAndStop(...args) {
544
+ return this.#apply("warning", args);
545
+ }
546
+ /**
547
+ * Toggle shimmer effect or update shimmer configuration.
548
+ * Preserves shimmer config when toggling off, allowing easy re-enable.
549
+ * Supports partial config updates to tweak specific properties.
550
+ *
551
+ * @param enabledOrConfig - Boolean to toggle, partial config to update, or direction string
552
+ * @returns This spinner for chaining
553
+ *
554
+ * @example
555
+ * // Toggle off (preserves config for later re-enable)
556
+ * spinner.shimmer(false)
557
+ *
558
+ * // Toggle on (restores saved config or uses defaults)
559
+ * spinner.shimmer(true)
560
+ *
561
+ * // Update specific properties
562
+ * spinner.shimmer({ speed: 0.5 })
563
+ * spinner.shimmer({ color: [255, 0, 0] })
564
+ *
565
+ * // Set direction
566
+ * spinner.shimmer('rtl')
567
+ */
568
+ shimmer(enabledOrConfig) {
569
+ if (enabledOrConfig === false) {
570
+ this.#shimmer = void 0;
571
+ } else if (enabledOrConfig === true) {
572
+ if (this.#shimmerSavedConfig) {
573
+ this.#shimmer = { ...this.#shimmerSavedConfig };
574
+ } else {
575
+ this.#shimmer = {
576
+ color: import_text_shimmer.COLOR_INHERIT,
577
+ currentDir: import_text_shimmer.DIR_LTR,
578
+ mode: import_text_shimmer.DIR_LTR,
579
+ speed: 1 / 3,
580
+ step: 0
581
+ };
582
+ this.#shimmerSavedConfig = this.#shimmer;
583
+ }
584
+ } else if (typeof enabledOrConfig === "string") {
585
+ if (this.#shimmer) {
586
+ this.#shimmer = {
587
+ ...this.#shimmer,
588
+ mode: enabledOrConfig
589
+ };
590
+ this.#shimmerSavedConfig = this.#shimmer;
591
+ } else if (this.#shimmerSavedConfig) {
592
+ this.#shimmer = {
593
+ ...this.#shimmerSavedConfig,
594
+ mode: enabledOrConfig
595
+ };
596
+ this.#shimmerSavedConfig = this.#shimmer;
597
+ } else {
598
+ this.#shimmer = {
599
+ color: import_text_shimmer.COLOR_INHERIT,
600
+ currentDir: import_text_shimmer.DIR_LTR,
601
+ mode: enabledOrConfig,
602
+ speed: 1 / 3,
603
+ step: 0
604
+ };
605
+ this.#shimmerSavedConfig = this.#shimmer;
606
+ }
607
+ } else if (enabledOrConfig && typeof enabledOrConfig === "object") {
608
+ const partialConfig = {
609
+ __proto__: null,
610
+ ...enabledOrConfig
611
+ };
612
+ if (this.#shimmer) {
613
+ this.#shimmer = {
614
+ ...this.#shimmer,
615
+ ...partialConfig.color !== void 0 ? { color: partialConfig.color } : {},
616
+ ...partialConfig.dir !== void 0 ? { mode: partialConfig.dir } : {},
617
+ ...partialConfig.speed !== void 0 ? { speed: partialConfig.speed } : {}
618
+ };
619
+ this.#shimmerSavedConfig = this.#shimmer;
620
+ } else if (this.#shimmerSavedConfig) {
621
+ this.#shimmer = {
622
+ ...this.#shimmerSavedConfig,
623
+ ...partialConfig.color !== void 0 ? { color: partialConfig.color } : {},
624
+ ...partialConfig.dir !== void 0 ? { mode: partialConfig.dir } : {},
625
+ ...partialConfig.speed !== void 0 ? { speed: partialConfig.speed } : {}
626
+ };
627
+ this.#shimmerSavedConfig = this.#shimmer;
628
+ } else {
629
+ this.#shimmer = {
630
+ color: partialConfig.color ?? import_text_shimmer.COLOR_INHERIT,
631
+ currentDir: import_text_shimmer.DIR_LTR,
632
+ mode: partialConfig.dir ?? import_text_shimmer.DIR_LTR,
633
+ speed: partialConfig.speed ?? 1 / 3,
634
+ step: 0
635
+ };
636
+ this.#shimmerSavedConfig = this.#shimmer;
637
+ }
638
+ }
639
+ this.#updateSpinnerText();
640
+ return this;
641
+ }
642
+ };
643
+ Object.defineProperties(_Spinner.prototype, {
644
+ error: desc(_Spinner.prototype.fail),
645
+ errorAndStop: desc(_Spinner.prototype.failAndStop),
646
+ warning: desc(_Spinner.prototype.warn),
647
+ warningAndStop: desc(_Spinner.prototype.warnAndStop)
648
+ });
649
+ _defaultSpinner = import_ci.CI ? ciSpinner : /* @__PURE__ */ getCliSpinners("socket");
650
+ }
651
+ return new _Spinner({
652
+ spinner: _defaultSpinner,
653
+ ...options
654
+ });
655
+ }
656
+ let _spinner;
657
+ function getDefaultSpinner() {
658
+ if (_spinner === void 0) {
659
+ _spinner = /* @__PURE__ */ Spinner();
660
+ }
661
+ return _spinner;
662
+ }
663
+ const spinner = /* @__PURE__ */ (() => {
664
+ let _lazySpinner;
665
+ return new Proxy({}, {
666
+ get(_target, prop) {
667
+ if (_lazySpinner === void 0) {
668
+ _lazySpinner = /* @__PURE__ */ Spinner();
669
+ }
670
+ const value = _lazySpinner[prop];
671
+ return typeof value === "function" ? value.bind(_lazySpinner) : value;
672
+ }
673
+ });
674
+ })();
675
+ async function withSpinner(options) {
676
+ const { message, operation, spinner: spinner2 } = {
677
+ __proto__: null,
678
+ ...options
679
+ };
680
+ if (!spinner2) {
681
+ return await operation();
682
+ }
683
+ spinner2.start(message);
684
+ try {
685
+ return await operation();
686
+ } finally {
687
+ spinner2.stop();
688
+ }
689
+ }
690
+ async function withSpinnerRestore(options) {
691
+ const { operation, spinner: spinner2, wasSpinning } = {
692
+ __proto__: null,
693
+ ...options
694
+ };
695
+ try {
696
+ return await operation();
697
+ } finally {
698
+ if (spinner2 && wasSpinning) {
699
+ spinner2.start();
700
+ }
701
+ }
702
+ }
703
+ function withSpinnerSync(options) {
704
+ const { message, operation, spinner: spinner2 } = {
705
+ __proto__: null,
706
+ ...options
707
+ };
708
+ if (!spinner2) {
709
+ return operation();
710
+ }
711
+ spinner2.start(message);
712
+ try {
713
+ return operation();
714
+ } finally {
715
+ spinner2.stop();
716
+ }
717
+ }
718
+ // Annotate the CommonJS export names for ESM import in node:
719
+ 0 && (module.exports = {
720
+ Spinner,
721
+ ciSpinner,
722
+ getCliSpinners,
723
+ getDefaultSpinner,
724
+ spinner,
725
+ withSpinner,
726
+ withSpinnerRestore,
727
+ withSpinnerSync
728
+ });
729
+ //# sourceMappingURL=spinner.js.map