@socketsecurity/lib 6.0.6 → 6.0.7

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 (499) hide show
  1. package/CHANGELOG.md +26 -1
  2. package/dist/ai/discover.d.mts +2 -2
  3. package/dist/ai/discover.js +3 -2
  4. package/dist/ai/spawn.js +2 -1
  5. package/dist/ai/types.d.mts +18 -6
  6. package/dist/ai/worktree.d.mts +6 -6
  7. package/dist/ai/worktree.js +1 -1
  8. package/dist/ansi/strip.d.ts +1 -1
  9. package/dist/ansi/strip.js +0 -2
  10. package/dist/archives/_internal.js +7 -9
  11. package/dist/archives/extract.js +1 -1
  12. package/dist/archives/tar.js +6 -6
  13. package/dist/archives/zip.js +3 -5
  14. package/dist/argv/flag-predicates.d.ts +12 -12
  15. package/dist/argv/flag-predicates.js +17 -17
  16. package/dist/argv/flag-types.d.ts +18 -18
  17. package/dist/argv/flag-types.js +4 -4
  18. package/dist/argv/parse.d.ts +1 -1
  19. package/dist/arrays/_internal.js +11 -12
  20. package/dist/arrays/chunk.js +0 -1
  21. package/dist/arrays/join.d.ts +37 -3
  22. package/dist/arrays/join.js +43 -7
  23. package/dist/arrays/unique.js +0 -1
  24. package/dist/bin/_internal.d.ts +1 -1
  25. package/dist/bin/_internal.js +1 -1
  26. package/dist/bin/exec.js +2 -3
  27. package/dist/bin/find.js +13 -13
  28. package/dist/bin/prim.cjs +22736 -22556
  29. package/dist/bin/resolve.js +12 -13
  30. package/dist/bin/which.js +8 -8
  31. package/dist/cache/ttl/store.js +5 -5
  32. package/dist/checks/primordials-defaults.d.ts +3 -3
  33. package/dist/checks/primordials-defaults.js +3 -3
  34. package/dist/checks/primordials.js +4 -3
  35. package/dist/{bin → cli}/check-primordials.d.ts +11 -11
  36. package/dist/{bin → cli}/check-primordials.js +55 -52
  37. package/dist/{bin → cli}/check.js +3 -3
  38. package/dist/{bin → cli}/socket-lib.d.ts +1 -1
  39. package/dist/{bin → cli}/socket-lib.js +4 -4
  40. package/dist/colors/socket-palette.js +7 -9
  41. package/dist/compression/_internal.d.ts +12 -12
  42. package/dist/compression/_internal.js +17 -17
  43. package/dist/compression/brotli.d.ts +25 -25
  44. package/dist/compression/brotli.js +33 -33
  45. package/dist/compression/gzip.d.ts +23 -23
  46. package/dist/compression/gzip.js +40 -40
  47. package/dist/constants/agents.d.ts +3 -1
  48. package/dist/constants/agents.js +15 -11
  49. package/dist/constants/licenses.js +3 -3
  50. package/dist/constants/node.d.ts +23 -0
  51. package/dist/constants/node.js +47 -15
  52. package/dist/constants/packages.js +22 -28
  53. package/dist/constants/platform.d.ts +30 -3
  54. package/dist/constants/platform.js +72 -12
  55. package/dist/constants/runtime.d.ts +22 -0
  56. package/dist/constants/runtime.js +32 -0
  57. package/dist/constants/socket.js +1 -1
  58. package/dist/cover/code.js +8 -8
  59. package/dist/cover/formatters.js +5 -5
  60. package/dist/crypto/hash.d.ts +26 -1
  61. package/dist/crypto/hash.js +43 -12
  62. package/dist/debug/_internal.js +4 -6
  63. package/dist/debug/caller-info.js +2 -3
  64. package/dist/debug/namespace.d.ts +7 -0
  65. package/dist/debug/namespace.js +21 -12
  66. package/dist/debug/output.js +21 -24
  67. package/dist/debug/types.d.ts +4 -4
  68. package/dist/dlx/arborist.js +6 -6
  69. package/dist/dlx/binary-cache.js +14 -14
  70. package/dist/dlx/binary-download.d.ts +1 -1
  71. package/dist/dlx/binary-download.js +11 -11
  72. package/dist/dlx/binary-resolution.js +16 -14
  73. package/dist/dlx/binary-types.d.ts +5 -5
  74. package/dist/dlx/binary.js +5 -5
  75. package/dist/dlx/cache.js +1 -1
  76. package/dist/dlx/detect.d.ts +34 -25
  77. package/dist/dlx/detect.js +86 -77
  78. package/dist/dlx/dir.js +2 -2
  79. package/dist/dlx/firewall.d.ts +1 -1
  80. package/dist/dlx/lockfile.d.ts +19 -18
  81. package/dist/dlx/lockfile.js +16 -16
  82. package/dist/dlx/manifest.d.ts +6 -6
  83. package/dist/dlx/manifest.js +5 -5
  84. package/dist/dlx/package.d.ts +10 -10
  85. package/dist/dlx/package.js +16 -16
  86. package/dist/dlx/packages.js +4 -4
  87. package/dist/dlx/paths.js +7 -7
  88. package/dist/dlx/spec.js +1 -1
  89. package/dist/dlx/types.d.ts +28 -27
  90. package/dist/eco/cargo/parse-lockfile.d.ts +1 -1
  91. package/dist/eco/cargo/parse-lockfile.js +2 -2
  92. package/dist/eco/manifest/analyze-lockfile.js +2 -2
  93. package/dist/eco/manifest/detect-format.js +4 -4
  94. package/dist/eco/manifest/find-packages.js +2 -2
  95. package/dist/eco/manifest/get-package-versions.js +2 -2
  96. package/dist/eco/manifest/get-package.js +2 -2
  97. package/dist/eco/manifest/parse-lockfile.js +2 -2
  98. package/dist/eco/manifest/parse-manifest.js +2 -2
  99. package/dist/eco/manifest/parse.js +2 -2
  100. package/dist/eco/npm/npm/exec.js +2 -2
  101. package/dist/eco/npm/npm/flags.js +7 -12
  102. package/dist/eco/npm/npm/parse-lockfile.d.ts +14 -14
  103. package/dist/eco/npm/npm/parse-lockfile.js +3 -3
  104. package/dist/eco/npm/parse-package-json.js +3 -3
  105. package/dist/eco/npm/pnpm/exec.d.ts +1 -1
  106. package/dist/eco/npm/pnpm/exec.js +5 -5
  107. package/dist/eco/npm/pnpm/flags.js +0 -3
  108. package/dist/eco/npm/pnpm/parse-lockfile.d.ts +1 -1
  109. package/dist/eco/npm/pnpm/parse-lockfile.js +4 -4
  110. package/dist/eco/npm/script.js +9 -6
  111. package/dist/eco/npm/yarnpkg/yarn/exec.js +3 -3
  112. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +2 -2
  113. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +8 -8
  114. package/dist/effects/pulse-frames.d.ts +3 -1
  115. package/dist/effects/shimmer-keyframes.d.ts +1 -1
  116. package/dist/effects/shimmer-terminal.d.ts +1 -1
  117. package/dist/env/boolean.js +0 -1
  118. package/dist/env/ci.js +0 -1
  119. package/dist/env/debug.js +0 -1
  120. package/dist/env/github-status.d.ts +51 -0
  121. package/dist/env/github-status.js +90 -0
  122. package/dist/env/github.js +0 -8
  123. package/dist/env/home.js +0 -1
  124. package/dist/env/locale.js +0 -3
  125. package/dist/env/node-auth-token.js +0 -1
  126. package/dist/env/node-env.js +0 -1
  127. package/dist/env/node-version-managers.d.ts +53 -0
  128. package/dist/env/node-version-managers.js +90 -0
  129. package/dist/env/npm.js +0 -5
  130. package/dist/env/number.js +0 -1
  131. package/dist/env/package-manager.js +3 -6
  132. package/dist/env/path.js +0 -1
  133. package/dist/env/pre-commit.js +1 -2
  134. package/dist/env/rewire.d.ts +7 -6
  135. package/dist/env/rewire.js +15 -16
  136. package/dist/env/shell.js +0 -1
  137. package/dist/env/socket-cli.js +5 -18
  138. package/dist/env/socket-mcp.d.ts +114 -0
  139. package/dist/env/socket-mcp.js +146 -0
  140. package/dist/env/socket.d.ts +1 -109
  141. package/dist/env/socket.js +12 -167
  142. package/dist/env/string.js +0 -1
  143. package/dist/env/temp-dir.js +0 -3
  144. package/dist/env/term.js +0 -1
  145. package/dist/env/test.js +3 -6
  146. package/dist/env/windows.js +0 -4
  147. package/dist/env/xdg.js +0 -3
  148. package/dist/events/exit/_internal.d.ts +11 -9
  149. package/dist/events/exit/_internal.js +31 -35
  150. package/dist/events/exit/handler.js +3 -4
  151. package/dist/events/exit/intercept.js +4 -6
  152. package/dist/events/exit/lifecycle.js +16 -18
  153. package/dist/events/exit/signals.js +1 -2
  154. package/dist/events/exit/types.d.ts +6 -5
  155. package/dist/external/@npmcli/package-json.js +2 -2
  156. package/dist/external/npm-pack.js +2 -2
  157. package/dist/external-tools/bazel/read-bazel-version-file.js +1 -1
  158. package/dist/external-tools/bazel/types.d.ts +1 -1
  159. package/dist/external-tools/cdxgen/from-vfs.js +1 -1
  160. package/dist/external-tools/cdxgen/types.d.ts +1 -1
  161. package/dist/external-tools/from-download.d.ts +1 -1
  162. package/dist/external-tools/from-download.js +1 -1
  163. package/dist/external-tools/janus/from-vfs.js +1 -1
  164. package/dist/external-tools/janus/types.d.ts +1 -1
  165. package/dist/external-tools/jre/detect-platform-arch.d.ts +10 -6
  166. package/dist/external-tools/jre/detect-platform-arch.js +29 -14
  167. package/dist/external-tools/jre/from-vfs.js +1 -1
  168. package/dist/external-tools/jre/types.d.ts +1 -1
  169. package/dist/external-tools/manifest.d.ts +7 -7
  170. package/dist/external-tools/manifest.js +12 -12
  171. package/dist/external-tools/opengrep/from-vfs.js +1 -1
  172. package/dist/external-tools/opengrep/types.d.ts +1 -1
  173. package/dist/external-tools/python/asset-names.d.ts +76 -0
  174. package/dist/external-tools/python/asset-names.js +104 -0
  175. package/dist/external-tools/python/dlx.d.ts +80 -0
  176. package/dist/external-tools/python/dlx.js +87 -0
  177. package/dist/external-tools/python/from-download.d.ts +53 -0
  178. package/dist/external-tools/python/from-download.js +68 -0
  179. package/dist/external-tools/python/from-path.d.ts +7 -0
  180. package/dist/external-tools/python/from-path.js +23 -0
  181. package/dist/external-tools/python/pin.d.ts +121 -0
  182. package/dist/external-tools/python/pin.js +173 -0
  183. package/dist/external-tools/python/pip-install.d.ts +75 -0
  184. package/dist/external-tools/python/pip-install.js +139 -0
  185. package/dist/external-tools/python/resolve.d.ts +42 -0
  186. package/dist/external-tools/python/resolve.js +58 -0
  187. package/dist/external-tools/python/types.d.ts +49 -0
  188. package/dist/external-tools/sbt/from-vfs.js +1 -1
  189. package/dist/external-tools/sbt/types.d.ts +1 -1
  190. package/dist/external-tools/skillspector/from-path.js +3 -5
  191. package/dist/external-tools/skillspector/from-vfs.js +1 -1
  192. package/dist/external-tools/synp/from-download.js +2 -2
  193. package/dist/external-tools/synp/from-vfs.js +1 -1
  194. package/dist/external-tools/trivy/from-vfs.js +1 -1
  195. package/dist/external-tools/trivy/types.d.ts +1 -1
  196. package/dist/external-tools/trufflehog/from-vfs.js +1 -1
  197. package/dist/external-tools/trufflehog/types.d.ts +1 -1
  198. package/dist/fs/_internal.d.ts +1 -1
  199. package/dist/fs/_internal.js +7 -7
  200. package/dist/fs/access.js +5 -9
  201. package/dist/fs/{path-cache.js → allowed-dirs-cache.js} +1 -1
  202. package/dist/fs/encoding.js +5 -7
  203. package/dist/fs/{find-up.js → find.js} +11 -13
  204. package/dist/fs/inspect.js +7 -13
  205. package/dist/fs/read-dir.js +7 -10
  206. package/dist/fs/read-file.js +8 -14
  207. package/dist/fs/read-json-cache.d.ts +6 -4
  208. package/dist/fs/read-json-cache.js +9 -6
  209. package/dist/fs/read-json.js +4 -6
  210. package/dist/fs/resolve-module.js +1 -1
  211. package/dist/fs/safe.d.ts +1 -1
  212. package/dist/fs/safe.js +12 -13
  213. package/dist/fs/unique.js +4 -5
  214. package/dist/fs/validate.js +1 -2
  215. package/dist/fs/write-json.js +4 -5
  216. package/dist/git/_internal.js +10 -10
  217. package/dist/git/changed.js +4 -4
  218. package/dist/git/repo.js +3 -3
  219. package/dist/git/staged.js +4 -4
  220. package/dist/git/unstaged.js +4 -4
  221. package/dist/github/ghsa.js +2 -2
  222. package/dist/github/refs-cache.d.ts +1 -1
  223. package/dist/github/refs-cache.js +5 -5
  224. package/dist/github/refs-rest.js +5 -5
  225. package/dist/github/{fetch.js → request.js} +13 -2
  226. package/dist/github/token.js +1 -1
  227. package/dist/github/types.d.ts +1 -1
  228. package/dist/globs/_internal.js +7 -9
  229. package/dist/globs/match.js +4 -6
  230. package/dist/globs/matcher.d.ts +3 -3
  231. package/dist/globs/matcher.js +12 -14
  232. package/dist/globs/stream.js +1 -2
  233. package/dist/globs/types.d.ts +24 -24
  234. package/dist/http-request/_internal.d.ts +1 -1
  235. package/dist/http-request/browser.js +4 -2
  236. package/dist/http-request/checksum-file.d.ts +55 -0
  237. package/dist/http-request/checksum-file.js +95 -0
  238. package/dist/http-request/download-types.d.ts +15 -23
  239. package/dist/http-request/download.js +3 -3
  240. package/dist/http-request/headers.js +0 -1
  241. package/dist/http-request/request-attempt.js +37 -33
  242. package/dist/http-request/request-types.d.ts +2 -2
  243. package/dist/http-request/request.js +1 -1
  244. package/dist/http-request/user-agent.js +3 -4
  245. package/dist/integrity.d.ts +86 -18
  246. package/dist/integrity.js +119 -30
  247. package/dist/ipc/directory.js +2 -2
  248. package/dist/ipc/paths.js +1 -1
  249. package/dist/ipc/write.js +1 -1
  250. package/dist/ipc-cli/get.js +12 -12
  251. package/dist/json/edit.js +13 -14
  252. package/dist/json/format.js +2 -2
  253. package/dist/json/parse.d.ts +1 -1
  254. package/dist/json/parse.js +3 -7
  255. package/dist/logger/_internal.d.ts +4 -4
  256. package/dist/logger/_internal.js +3 -3
  257. package/dist/logger/colors.js +4 -3
  258. package/dist/logger/console-methods.d.ts +132 -0
  259. package/dist/logger/console-methods.js +169 -0
  260. package/dist/logger/console.d.ts +12 -0
  261. package/dist/logger/console.js +42 -11
  262. package/dist/logger/indentation-methods.d.ts +81 -0
  263. package/dist/logger/indentation-methods.js +121 -0
  264. package/dist/logger/node.d.ts +16 -338
  265. package/dist/logger/node.js +75 -608
  266. package/dist/logger/options.d.ts +39 -0
  267. package/dist/logger/options.js +47 -0
  268. package/dist/logger/semantic-methods.d.ts +63 -0
  269. package/dist/logger/semantic-methods.js +108 -0
  270. package/dist/logger/stream-methods.d.ts +63 -0
  271. package/dist/logger/stream-methods.js +101 -0
  272. package/dist/logger/stream.d.ts +37 -0
  273. package/dist/logger/stream.js +42 -0
  274. package/dist/logger/symbols-builder.js +9 -9
  275. package/dist/logger/symbols.d.ts +2 -25
  276. package/dist/logger/symbols.js +53 -74
  277. package/dist/logger/types.d.ts +1 -1
  278. package/dist/memo/types.d.ts +6 -6
  279. package/dist/native-messaging/host.d.ts +20 -0
  280. package/dist/native-messaging/host.js +120 -0
  281. package/dist/native-messaging/index.d.ts +5 -0
  282. package/dist/native-messaging/index.js +22 -0
  283. package/dist/native-messaging/install.d.ts +60 -0
  284. package/dist/native-messaging/install.js +141 -0
  285. package/dist/native-messaging/rate-limit.d.ts +62 -0
  286. package/dist/native-messaging/rate-limit.js +115 -0
  287. package/dist/native-messaging/run.d.ts +10 -0
  288. package/dist/native-messaging/run.js +17 -0
  289. package/dist/node/async-hooks.js +4 -3
  290. package/dist/node/child-process.js +4 -3
  291. package/dist/node/crypto.js +4 -3
  292. package/dist/node/events.js +4 -3
  293. package/dist/node/fs-promises.js +4 -3
  294. package/dist/node/fs.js +4 -3
  295. package/dist/node/http.js +4 -3
  296. package/dist/node/https.js +4 -3
  297. package/dist/node/module.js +10 -6
  298. package/dist/node/os.js +4 -3
  299. package/dist/node/path.js +4 -3
  300. package/dist/node/timers-promises.js +4 -3
  301. package/dist/node/url.js +4 -3
  302. package/dist/node/util.js +4 -3
  303. package/dist/objects/getters.js +5 -7
  304. package/dist/objects/inspect.js +1 -4
  305. package/dist/objects/mutate.js +2 -3
  306. package/dist/objects/predicates.js +0 -4
  307. package/dist/objects/sort.js +3 -7
  308. package/dist/packages/edit-class.js +15 -16
  309. package/dist/packages/edit.js +12 -14
  310. package/dist/packages/exports.js +11 -17
  311. package/dist/packages/fetch.d.ts +16 -0
  312. package/dist/packages/fetch.js +81 -0
  313. package/dist/packages/find.d.ts +55 -0
  314. package/dist/packages/find.js +65 -0
  315. package/dist/packages/isolation.js +14 -14
  316. package/dist/packages/licenses.js +16 -16
  317. package/dist/packages/manifest.js +12 -15
  318. package/dist/packages/metadata-extensions.d.ts +14 -0
  319. package/dist/packages/metadata-extensions.js +43 -0
  320. package/dist/packages/normalize.js +5 -9
  321. package/dist/packages/provenance.js +16 -18
  322. package/dist/packages/read.d.ts +29 -0
  323. package/dist/packages/read.js +66 -0
  324. package/dist/packages/specs.d.ts +48 -1
  325. package/dist/packages/specs.js +74 -11
  326. package/dist/packages/tarball.d.ts +24 -0
  327. package/dist/packages/tarball.js +79 -0
  328. package/dist/packages/types.d.ts +21 -20
  329. package/dist/packages/validation.js +0 -3
  330. package/dist/paths/_internal.d.ts +2 -1
  331. package/dist/paths/_internal.js +7 -19
  332. package/dist/paths/conversion.js +5 -9
  333. package/dist/paths/filenames.d.ts +0 -1
  334. package/dist/paths/filenames.js +0 -2
  335. package/dist/paths/normalize.js +4 -5
  336. package/dist/paths/packages.js +4 -7
  337. package/dist/paths/predicates.js +9 -16
  338. package/dist/paths/resolve.js +11 -14
  339. package/dist/paths/rewire.js +3 -3
  340. package/dist/paths/socket.js +16 -16
  341. package/dist/paths/walk.d.ts +1 -1
  342. package/dist/paths/walk.js +4 -4
  343. package/dist/perf/report.js +2 -2
  344. package/dist/perf/types.d.ts +1 -1
  345. package/dist/pkg-ext/data.js +1 -1
  346. package/dist/primordials/array.js +9 -9
  347. package/dist/primordials/date.js +2 -2
  348. package/dist/primordials/error.js +3 -3
  349. package/dist/primordials/headers.d.ts +10 -0
  350. package/dist/primordials/headers.js +23 -0
  351. package/dist/primordials/intl.d.ts +13 -0
  352. package/dist/primordials/intl.js +26 -0
  353. package/dist/primordials/math.js +33 -33
  354. package/dist/primordials/number.js +9 -9
  355. package/dist/primordials/object.js +5 -5
  356. package/dist/primordials/string.d.ts +2 -2
  357. package/dist/primordials/string.js +6 -6
  358. package/dist/primordials/symbol.js +3 -3
  359. package/dist/primordials/uncurry.js +9 -9
  360. package/dist/process/abort.js +3 -3
  361. package/dist/process/lock-manager.js +8 -8
  362. package/dist/process/spawn/_internal.js +6 -8
  363. package/dist/process/spawn/child.js +14 -14
  364. package/dist/process/spawn/errors.js +2 -4
  365. package/dist/process/spawn/kill-tree.d.ts +53 -0
  366. package/dist/process/spawn/kill-tree.js +85 -0
  367. package/dist/process/spawn/stdio.js +0 -1
  368. package/dist/process/spawn/types.d.ts +5 -5
  369. package/dist/process/transient.js +2 -2
  370. package/dist/promises/_internal.d.ts +2 -1
  371. package/dist/promises/_internal.js +2 -6
  372. package/dist/promises/iterate.js +11 -15
  373. package/dist/promises/options.js +3 -6
  374. package/dist/promises/retry.js +4 -5
  375. package/dist/promises/timers.d.ts +30 -0
  376. package/dist/promises/timers.js +48 -0
  377. package/dist/releases/github-archives.d.ts +6 -6
  378. package/dist/releases/github-archives.js +2 -2
  379. package/dist/releases/github-asset-url.d.ts +1 -1
  380. package/dist/releases/github-asset-url.js +5 -5
  381. package/dist/releases/github-downloads.d.ts +1 -1
  382. package/dist/releases/github-downloads.js +3 -3
  383. package/dist/releases/github-listing.d.ts +11 -2
  384. package/dist/releases/github-listing.js +20 -7
  385. package/dist/releases/github-retry-config.js +1 -1
  386. package/dist/releases/github-types.d.ts +6 -6
  387. package/dist/releases/socket-btm-binary-naming.d.ts +107 -0
  388. package/dist/releases/socket-btm-binary-naming.js +155 -0
  389. package/dist/releases/socket-btm.d.ts +8 -115
  390. package/dist/releases/socket-btm.js +16 -159
  391. package/dist/schema/types.d.ts +1 -1
  392. package/dist/sea/detect.js +6 -6
  393. package/dist/secrets/_internal.d.ts +2 -2
  394. package/dist/secrets/_internal.js +2 -2
  395. package/dist/secrets/compare.d.ts +45 -0
  396. package/dist/secrets/compare.js +61 -0
  397. package/dist/secrets/keychain.js +6 -4
  398. package/dist/secrets/linux.js +19 -19
  399. package/dist/secrets/macos.d.ts +1 -1
  400. package/dist/secrets/macos.js +13 -13
  401. package/dist/secrets/rc.d.ts +2 -2
  402. package/dist/secrets/rc.js +6 -4
  403. package/dist/secrets/socket-api-token.d.ts +4 -4
  404. package/dist/secrets/socket-api-token.js +18 -9
  405. package/dist/secrets/windows.js +14 -13
  406. package/dist/shadow/skip.js +2 -2
  407. package/dist/smol/detect.js +9 -10
  408. package/dist/smol/http.js +6 -7
  409. package/dist/smol/https.js +6 -7
  410. package/dist/smol/manifest.d.ts +1 -1
  411. package/dist/smol/manifest.js +6 -7
  412. package/dist/smol/path.d.ts +1 -1
  413. package/dist/smol/path.js +7 -8
  414. package/dist/smol/primordial.d.ts +4 -0
  415. package/dist/smol/primordial.js +6 -7
  416. package/dist/smol/purl.d.ts +1 -1
  417. package/dist/smol/purl.js +7 -8
  418. package/dist/smol/versions.js +6 -7
  419. package/dist/smol/vfs.js +6 -7
  420. package/dist/sorts/_internal.js +6 -8
  421. package/dist/sorts/natural.js +10 -12
  422. package/dist/sorts/semver.js +1 -2
  423. package/dist/sorts/strings.js +0 -1
  424. package/dist/sorts/types.d.ts +1 -1
  425. package/dist/spinner/create-spinner-class.d.ts +38 -0
  426. package/dist/spinner/create-spinner-class.js +302 -0
  427. package/dist/spinner/default.js +8 -9
  428. package/dist/spinner/spinner-internals.d.ts +36 -0
  429. package/dist/spinner/spinner-internals.js +101 -0
  430. package/dist/spinner/spinner-shimmer-methods.d.ts +54 -0
  431. package/dist/spinner/spinner-shimmer-methods.js +143 -0
  432. package/dist/spinner/spinner-status-methods.d.ts +40 -0
  433. package/dist/spinner/spinner-status-methods.js +133 -0
  434. package/dist/spinner/spinner.d.ts +4 -5
  435. package/dist/spinner/spinner.js +18 -705
  436. package/dist/spinner/types.d.ts +3 -1
  437. package/dist/spinner/with.d.ts +10 -0
  438. package/dist/spinner/with.js +16 -2
  439. package/dist/stdio/divider.js +1 -1
  440. package/dist/stdio/footer.js +3 -3
  441. package/dist/stdio/header.js +4 -4
  442. package/dist/stdio/progress.js +5 -5
  443. package/dist/stdio/prompts.d.ts +5 -3
  444. package/dist/stdio/prompts.js +6 -7
  445. package/dist/stdio/stdout.js +3 -3
  446. package/dist/streams/parallel.js +3 -5
  447. package/dist/streams/transform.js +2 -3
  448. package/dist/strings/format.js +2 -6
  449. package/dist/strings/predicates.js +0 -2
  450. package/dist/strings/search.js +1 -2
  451. package/dist/strings/transform.js +0 -3
  452. package/dist/strings/width.js +9 -10
  453. package/dist/tables/bordered.js +4 -3
  454. package/dist/tables/padding.js +1 -1
  455. package/dist/tables/simple.js +8 -5
  456. package/dist/temporal/instant.js +1 -1
  457. package/dist/temporal/slots.js +6 -6
  458. package/dist/temporal/system.js +9 -9
  459. package/dist/themes/context.d.ts +3 -2
  460. package/dist/themes/context.js +4 -5
  461. package/dist/themes/themes.js +15 -15
  462. package/dist/themes/types.d.ts +3 -3
  463. package/dist/url/parse.js +0 -2
  464. package/dist/url/predicates.js +1 -2
  465. package/dist/url/search-params.js +3 -9
  466. package/dist/url/types.d.ts +5 -5
  467. package/dist/versions/_internal.js +3 -3
  468. package/dist/words/article.js +0 -1
  469. package/dist/words/capitalize.js +0 -1
  470. package/dist/words/pluralize.js +15 -5
  471. package/package.json +247 -106
  472. package/dist/external-tools/uv/asset-names.d.ts +0 -36
  473. package/dist/external-tools/uv/asset-names.js +0 -70
  474. package/dist/external-tools/uv/from-download.d.ts +0 -17
  475. package/dist/external-tools/uv/from-download.js +0 -47
  476. package/dist/external-tools/uv/from-path.d.ts +0 -5
  477. package/dist/external-tools/uv/from-path.js +0 -22
  478. package/dist/external-tools/uv/from-vfs.d.ts +0 -7
  479. package/dist/external-tools/uv/from-vfs.js +0 -26
  480. package/dist/external-tools/uv/resolve.d.ts +0 -25
  481. package/dist/external-tools/uv/resolve.js +0 -53
  482. package/dist/external-tools/uv/types.d.ts +0 -24
  483. package/dist/http-request/checksums.d.ts +0 -69
  484. package/dist/http-request/checksums.js +0 -108
  485. package/dist/http-request/http-request.d.ts +0 -12
  486. package/dist/http-request/http-request.js +0 -11
  487. package/dist/packages/operations.d.ts +0 -113
  488. package/dist/packages/operations.js +0 -304
  489. package/dist/ssri/convert.d.ts +0 -48
  490. package/dist/ssri/convert.js +0 -69
  491. package/dist/ssri/parse.d.ts +0 -27
  492. package/dist/ssri/parse.js +0 -41
  493. package/dist/ssri/validate.d.ts +0 -41
  494. package/dist/ssri/validate.js +0 -56
  495. /package/dist/{bin → cli}/check.d.ts +0 -0
  496. /package/dist/external-tools/{uv → python}/types.js +0 -0
  497. /package/dist/fs/{path-cache.d.ts → allowed-dirs-cache.d.ts} +0 -0
  498. /package/dist/fs/{find-up.d.ts → find.d.ts} +0 -0
  499. /package/dist/github/{fetch.d.ts → request.d.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -5,11 +5,36 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [6.0.7](https://github.com/SocketDev/socket-lib/releases/tag/v6.0.7) - 2026-06-03
9
+
10
+ ### Added
11
+
12
+ - **`external-tools/python` — zero-host-dependency Python.** `resolvePython` (PATH → python-build-standalone download), `downloadPipPackage` (bundle-safe `pip install --target`), `resolvePipPackagePin` (hash-pinned closure), and the `dlxPipInstall` / `dlxPipPin` one-call wrappers. Removes the unused `external-tools/uv`.
13
+ - **`constants/platform` — `getOs`, `getLibc`, `getTarget`.** OS, libc (`glibc`/`musl`/`undefined`), and the pnpm `pack-app` host token `<os>-<arch>[-<libc>]`.
14
+ - **`http-request` decompresses `gzip` / `br` response bodies.** Buffered requests advertise `Accept-Encoding: gzip, br` and now decode the body by its `Content-Encoding` before resolving. 6.0.6 sent the header but never decompressed, so a compressed response reached callers as raw deflated bytes. Streamed requests (`stream: true`, e.g. `httpDownload`) skip the header so piped-to-disk payloads stay raw and checksum cleanly. Callers can override with `'identity'`.
15
+ - **`crypto/hash` blob content-address helpers.** `blobHashOf(bytes)` returns Socket's content-addressed blob hash (`Q` + base64url(sha256)), and `verifyBlobHash(hash, bytes)` throws when bytes don't hash to the expected address. Both build on the fast one-shot `hash()`; the `S` file-stream discriminator verifies against the same digest body. Lets blob consumers (the SDK, MCP server) verify integrity against one canonical implementation instead of re-deriving the scheme.
16
+ - **`integrity` — unified checksum/integrity surface.** `checksumToIntegrity(hex, algorithm?)` and `integrityToChecksum(sri)` convert between the two named hash flavors and are idempotent on the destination format (pass an SRI to `checksumToIntegrity`, get it back unchanged). `isIntegrity(s)` and `isChecksum(s)` are the predicates. `parseIntegrity(s)` returns `{ algorithm, body }` for the SRI structure. Replaces the `src/ssri/` directory (`hexToSsri`, `ssriToHex`, `isValidHex`, `isValidSsri`, `parseSsri`) — SSRI is just another name for Subresource Integrity, so the duplication confused readers. `isIntegrity` now accepts the full W3C SRI set (`sha256` / `sha384` / `sha512`) — the previous predicate hardcoded `sha512` only, which mismatched the contract `external-tools/manifest.ts` already promised and rejected the fleet's `sha256-<base64>` integrity strings.
17
+ - **`process/spawn/kill-tree` — cross-platform process-tree termination.** `killProcessTree(target, { detached?, signal? })` walks and signals the whole descendant tree of a `pid` or `ChildProcess`: POSIX uses `process.kill(-pid, signal)` against the detached child's process group; Windows shells out to `taskkill /T /F /pid <pid>`. `isProcessAlive(pid)` probes liveness with `process.kill(pid, 0)`. Both helpers are best-effort and never throw — `ESRCH` (process gone) or `EPERM` (not ours) returns `false` so cleanup kills can't mask the caller's control flow.
18
+
19
+ ### Changed
20
+
21
+ - **dlx + pin API renamed (breaking).** `downloadPackage` → `downloadNpmPackage`, `generatePackagePin` → `resolveNpmPackagePin`, the `package` option → `spec`. `downloadNpmPackage` gains an optional `hash` for tarball integrity.
22
+ - **`packages/operations` split by concern (breaking).** The grab-bag `@socketsecurity/lib/packages/operations` export is gone; its members move to focused subpaths: `readPackageJson`/`readPackageJsonSync` → `packages/read`, the fetcher + GitHub tarball resolver → `packages/fetch`, `extractPackage`/`packPackage` → `packages/tarball`, the dependency-metadata override lookup → `packages/metadata-extensions`, and the name/spec helpers → `packages/specs`. `findUpPackageJson` now lives at `packages/find` (the `packages/find-up` subpath is removed). The `fs/find-up` subpath is renamed `fs/find`, and `fs/path-cache` is renamed `fs/allowed-dirs-cache` (it caches the safe-delete allowed-directories set, not arbitrary paths).
23
+
24
+ ### Fixed
25
+
26
+ - **Python downloads now work on Windows and Alpine.** python-build-standalone resolution previously returned no asset on `win32` and musl hosts; both now resolve.
27
+ - **`debug` — namespace `SOCKET_DEBUG` values enable debug output.** `envAsBoolean(getSocketDebug())` returned false for `SOCKET_DEBUG=*` or `SOCKET_DEBUG=socket:foo` — those aren't boolean literals, so debug output was silently suppressed for the common namespace-selection shape. The new `isSocketDebugEnabled()` helper treats any non-empty value other than `0`/`false`/`no` (case-insensitive) as enabled.
28
+ - **`external-tools/skillspector` pipx detection on Windows.** The PATH-tier resolver normalizes the resolved binary path with `normalizePath` and matches a forward-slash-only `pipx/venvs/` pattern, instead of `path.normalize` plus a dual-separator regex. On Windows the old form left backslashes in the path and missed pipx-installed binaries, tagging them `source: 'path'` rather than `source: 'pipx'`.
29
+
30
+ ### Removed
31
+
32
+ - **`@socketsecurity/lib/ssri/{convert,parse,validate}` package exports.** Folded into `@socketsecurity/lib/integrity` (see Added). No fleet consumers were using the `ssri` subpath imports — verified by grep across socket-\* fleet repos.
33
+
8
34
  ## [6.0.6](https://github.com/SocketDev/socket-lib/releases/tag/v6.0.6) - 2026-06-01
9
35
 
10
36
  ### Added
11
37
 
12
- - **`http-request` now negotiates and decompresses `gzip` / `br` response bodies.** Buffered requests advertise `Accept-Encoding: gzip, br` and transparently decompress responses by `Content-Encoding`. Node's HTTP client does neither, so a compressed Socket API response previously reached callers as raw deflated bytes. Streamed requests (`stream: true`, e.g. `httpDownload`) intentionally skip the `Accept-Encoding` header so piped-to-disk payloads stay raw and checksum cleanly. Callers can override (e.g. `'identity'`).
13
38
  - **`http-request/headers` — `basicAuthHeader(token)`.** Builds the Socket API Basic-auth shape (token-as-username, empty password) so call sites stop hand-rolling `Basic ${base64(token + ':')}`.
14
39
  - **`http-request` retry instrumentation.** Adds `Retry-Attempt`, `Retry-Max`, and `Retry-After` request headers on retried attempts so server-side logs can correlate a retry chain.
15
40
  - **`prim` CLI bin.** `prim` is now published as a `bin` entry (`dist/bin/prim.cjs`); installs from `@socketsecurity/lib` make `npx prim` work. Also new in this release: `prim --diff` for unified line-diffs in dry-run mode, multi-hop cycle detection in `validateRewrites`, and a two-phase apply with cross-batch validation.
@@ -28,8 +28,8 @@ export declare function cachePathFor(repoRoot: string): string;
28
28
  * `'claude' in agents` for the existence check.
29
29
  */
30
30
  export declare function discoverAiAgents(options?: {
31
- readonly refresh?: boolean;
32
- readonly repoRoot?: string;
31
+ readonly refresh?: boolean | undefined;
32
+ readonly repoRoot?: string | undefined;
33
33
  }): Promise<DiscoveredAgents>;
34
34
  export declare function discoverFresh(): DiscoveredAgents;
35
35
  /**
@@ -41,7 +41,7 @@ const KNOWN_AGENTS = [
41
41
  const CACHE_TTL_MS = 3600 * 1e3;
42
42
  let inProcessCache;
43
43
  function cachePathFor(repoRoot) {
44
- return node_path.default.join(repoRoot, ".cache", "agent-discovery.json");
44
+ return node_path.default.join(repoRoot, "node_modules", ".cache", "agent-discovery.json");
45
45
  }
46
46
  /**
47
47
  * Discover which AI agent CLIs are installed.
@@ -73,7 +73,8 @@ async function discoverAiAgents(options = {}) {
73
73
  }
74
74
  function discoverFresh() {
75
75
  const out = {};
76
- for (const name of KNOWN_AGENTS) {
76
+ for (let i = 0, { length } = KNOWN_AGENTS; i < length; i += 1) {
77
+ const name = KNOWN_AGENTS[i];
77
78
  const found = require_bin_which.whichSync(name);
78
79
  if (typeof found === "string" && found) out[name] = found;
79
80
  }
package/dist/ai/spawn.js CHANGED
@@ -52,6 +52,7 @@ function buildArgs(agent, opts) {
52
52
  ];
53
53
  for (const dir of opts.addDirs ?? []) args.push("--add-dir", dir);
54
54
  if (opts.model) args.push("--model", opts.model);
55
+ if (opts.effort) args.push("--effort", opts.effort);
55
56
  if (allAllowed.length > 0) args.push("--allowedTools", ...allAllowed);
56
57
  if (opts.disallow.length > 0) args.push("--disallowedTools", ...opts.disallow);
57
58
  if (opts.extraArgs) args.push(...opts.extraArgs);
@@ -159,7 +160,7 @@ async function spawnAiAgent(opts) {
159
160
  stderr = String(result.stderr ?? "");
160
161
  exitCode = result.code ?? 0;
161
162
  } catch (e) {
162
- if (/* @__PURE__ */ require_process_spawn_errors.isSpawnError(e)) {
163
+ if (require_process_spawn_errors.isSpawnError(e)) {
163
164
  stdout = String(e.stdout ?? "");
164
165
  stderr = String(e.stderr ?? "");
165
166
  exitCode = e.code ?? 1;
@@ -25,6 +25,13 @@ export type AiAgentName = 'claude' | 'codex' | 'gemini' | 'opencode';
25
25
  * tools that mutate state.
26
26
  */
27
27
  export type PermissionMode = 'acceptEdits' | 'dontAsk' | 'plan';
28
+ /**
29
+ * Reasoning-effort level for the agent session. Maps to the claude CLI
30
+ * `--effort <level>` flag (claude-specific; other agents ignore it). Pair a
31
+ * cheap model with low effort for mechanical work and reserve high/max for
32
+ * tasks that genuinely need deeper reasoning.
33
+ */
34
+ export type AiEffort = 'high' | 'low' | 'max' | 'medium' | 'xhigh';
28
35
  /**
29
36
  * Result of an agent spawn. Consumers should inspect `exitCode` before using
30
37
  * `stdout` — non-zero usually means the agent's CLI itself rejected, not just
@@ -55,27 +62,32 @@ export interface SpawnAiAgentOptions {
55
62
  /**
56
63
  * Optional explicit agent. Defaults to claude when discovered.
57
64
  */
58
- readonly agent?: AiAgentName;
65
+ readonly agent?: AiAgentName | undefined;
59
66
  /**
60
67
  * Allow-list extras (Bash glob patterns, MCP tools, etc.).
61
68
  */
62
- readonly allow?: readonly string[];
69
+ readonly allow?: readonly string[] | undefined;
63
70
  /**
64
71
  * Extra dirs the agent can read (e.g. parent of cwd for monorepo).
65
72
  */
66
- readonly addDirs?: readonly string[];
73
+ readonly addDirs?: readonly string[] | undefined;
67
74
  /**
68
75
  * Tool denylist — required to enforce the lockdown.
69
76
  */
70
77
  readonly disallow: readonly string[];
78
+ /**
79
+ * Reasoning-effort level (claude `--effort`); agent default if absent.
80
+ * claude-specific — other agents ignore it.
81
+ */
82
+ readonly effort?: AiEffort | undefined;
71
83
  /**
72
84
  * Override the agent's flag list (rare; for one-off advanced cases).
73
85
  */
74
- readonly extraArgs?: readonly string[];
86
+ readonly extraArgs?: readonly string[] | undefined;
75
87
  /**
76
88
  * Model name override; agent default if absent.
77
89
  */
78
- readonly model?: string;
90
+ readonly model?: string | undefined;
79
91
  /**
80
92
  * Permission mode — see PermissionMode docstring.
81
93
  */
@@ -91,7 +103,7 @@ export interface SpawnAiAgentOptions {
91
103
  /**
92
104
  * Per-call timeout (ms). Caller should set for predictable bounds.
93
105
  */
94
- readonly timeoutMs?: number;
106
+ readonly timeoutMs?: number | undefined;
95
107
  /**
96
108
  * Tool allowlist. Required to enforce the lockdown.
97
109
  */
@@ -22,23 +22,23 @@ export interface WorktreeRunOptions {
22
22
  /**
23
23
  * Branch to merge results into. Default: current branch of baseRepo.
24
24
  */
25
- readonly branch?: string;
25
+ readonly branch?: string | undefined;
26
26
  /**
27
27
  * Cleanup policy. Default 'always'.
28
28
  */
29
- readonly cleanup?: WorktreeCleanup;
29
+ readonly cleanup?: WorktreeCleanup | undefined;
30
30
  /**
31
31
  * Parallel cap. Default 4, max 8.
32
32
  */
33
- readonly concurrency?: number;
33
+ readonly concurrency?: number | undefined;
34
34
  /**
35
35
  * Prefix for worktree branch + dir names. Default 'agent-task'.
36
36
  */
37
- readonly namePrefix?: string;
37
+ readonly namePrefix?: string | undefined;
38
38
  /**
39
39
  * Where worktrees live on disk. Default: `${tmpdir}/${prefix}-<n>`.
40
40
  */
41
- readonly worktreeRoot?: string;
41
+ readonly worktreeRoot?: string | undefined;
42
42
  }
43
43
  export interface WorktreeRunContext {
44
44
  /**
@@ -56,7 +56,7 @@ export interface WorktreeRunContext {
56
56
  }
57
57
  export interface WorktreeRunSettled<T> {
58
58
  readonly cleanup: 'removed' | 'kept';
59
- readonly error?: unknown;
59
+ readonly error?: unknown | undefined;
60
60
  readonly merged: boolean;
61
61
  readonly status: 'fulfilled' | 'rejected';
62
62
  readonly value?: T | undefined;
@@ -161,7 +161,7 @@ function tryGit(cwd, ...args) {
161
161
  output: git(cwd, ...args)
162
162
  };
163
163
  } catch (e) {
164
- if (/* @__PURE__ */ require_process_spawn_errors.isSpawnError(e)) return {
164
+ if (require_process_spawn_errors.isSpawnError(e)) return {
165
165
  ok: false,
166
166
  output: String(e.stderr ?? e.stdout ?? "")
167
167
  };
@@ -19,7 +19,7 @@
19
19
  * ```
20
20
  */
21
21
  export declare function ansiRegex(options?: {
22
- onlyFirst?: boolean;
22
+ onlyFirst?: boolean | undefined;
23
23
  }): RegExp;
24
24
  /**
25
25
  * Strip ANSI escape codes from text. Uses the inlined ansi-regex for matching.
@@ -26,7 +26,6 @@ const ANSI_REGEX = /\x1b\[[0-9;]*m/g;
26
26
  * ansiRegex({ onlyFirst: true }) // matches only the first code
27
27
  * ```
28
28
  */
29
- /*@__NO_SIDE_EFFECTS__*/
30
29
  function ansiRegex(options) {
31
30
  const { onlyFirst } = options ?? {};
32
31
  return new require_primordials_regexp.RegExpCtor(`(?:\\u001B\\][\\s\\S]*?(?:\\u0007|\\u001B\\u005C|\\u009C))|[\\u001B\\u009B][[\\]()#;?]*(?:\\d{1,4}(?:[;:]\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]`, onlyFirst ? void 0 : "g");
@@ -40,7 +39,6 @@ function ansiRegex(options) {
40
39
  * stripAnsi('\u001b[1mBold\u001b[0m') // 'Bold'
41
40
  * ```
42
41
  */
43
- /*@__NO_SIDE_EFFECTS__*/
44
42
  function stripAnsi(text) {
45
43
  return require_primordials_string.StringPrototypeReplace(text, ANSI_REGEX, "");
46
44
  }
@@ -15,8 +15,8 @@ let node_fs = require("node:fs");
15
15
  const DEFAULT_MAX_FILE_SIZE = 100 * 1024 * 1024;
16
16
  const DEFAULT_MAX_TOTAL_SIZE = 1024 * 1024 * 1024;
17
17
  const DEFAULT_MAX_ENTRIES = 1e5;
18
- let _AdmZip;
19
- let _tarFs;
18
+ let admZip;
19
+ let tarFs;
20
20
  /**
21
21
  * Assert that an archive file exists on disk before handing it to the
22
22
  * underlying extractor. Normalizes the "missing archive" surface across all
@@ -38,15 +38,13 @@ function assertArchiveExists(archivePath) {
38
38
  throw err;
39
39
  }
40
40
  }
41
- /*@__NO_SIDE_EFFECTS__*/
42
41
  function getAdmZip() {
43
- if (_AdmZip === void 0) _AdmZip = /*@__PURE__*/ require("../external/adm-zip.js");
44
- return _AdmZip;
42
+ if (admZip === void 0) admZip = /*@__PURE__*/ require("../external/adm-zip.js");
43
+ return admZip;
45
44
  }
46
- /*@__NO_SIDE_EFFECTS__*/
47
45
  function getTarFs() {
48
- if (_tarFs === void 0) _tarFs = /*@__PURE__*/ require("../external/tar-fs.js");
49
- return _tarFs;
46
+ if (tarFs === void 0) tarFs = /*@__PURE__*/ require("../external/tar-fs.js");
47
+ return tarFs;
50
48
  }
51
49
  /**
52
50
  * Validate that a resolved path is within the target directory. Prevents path
@@ -61,7 +59,7 @@ function getTarFs() {
61
59
  * @throws Error if path is outside the base directory
62
60
  */
63
61
  function validatePathWithinBase(targetPath, baseDir, entryName) {
64
- const path = /* @__PURE__ */ require_node_path.getNodePath();
62
+ const path = require_node_path.getNodePath();
65
63
  const resolvedTarget = path.resolve(targetPath);
66
64
  const resolvedBase = path.resolve(baseDir);
67
65
  if (!require_primordials_string.StringPrototypeStartsWith(resolvedTarget, resolvedBase + path.sep) && resolvedTarget !== resolvedBase) throw new require_primordials_error.ErrorCtor(`Path traversal attempt detected: entry "${entryName}" would extract to "${resolvedTarget}" outside target directory "${resolvedBase}"`);
@@ -31,7 +31,7 @@ const require_archives_zip = require('./zip.js');
31
31
  async function extractArchive(archivePath, outputDir, options = {}) {
32
32
  const format = require_archives_detect.detectArchiveFormat(archivePath);
33
33
  if (!format) {
34
- const ext = (/* @__PURE__ */ require_node_path.getNodePath()).extname(archivePath).toLowerCase();
34
+ const ext = require_node_path.getNodePath().extname(archivePath).toLowerCase();
35
35
  throw new require_primordials_error.ErrorCtor(`Unsupported archive format${ext ? ` (extension: ${ext})` : ""}: ${archivePath}. Supported formats: .zip, .tar, .tar.gz, .tgz`);
36
36
  }
37
37
  switch (format) {
@@ -42,12 +42,12 @@ let node_zlib = require("node:zlib");
42
42
  async function extractTar(archivePath, outputDir, options = {}) {
43
43
  require_archives__internal.assertArchiveExists(archivePath);
44
44
  const { maxEntries = require_archives__internal.DEFAULT_MAX_ENTRIES, maxFileSize = require_archives__internal.DEFAULT_MAX_FILE_SIZE, maxTotalSize = require_archives__internal.DEFAULT_MAX_TOTAL_SIZE, strip = 0 } = options;
45
- const normalizedOutputDir = /* @__PURE__ */ require_paths_normalize.normalizePath(outputDir);
45
+ const normalizedOutputDir = require_paths_normalize.normalizePath(outputDir);
46
46
  await require_fs_safe.safeMkdir(normalizedOutputDir);
47
47
  let totalExtractedSize = 0;
48
48
  let entryCount = 0;
49
49
  let destroyScheduled = false;
50
- const extractStream = (/* @__PURE__ */ require_archives__internal.getTarFs()).extract(normalizedOutputDir, {
50
+ const extractStream = require_archives__internal.getTarFs().extract(normalizedOutputDir, {
51
51
  map: (header) => {
52
52
  /* c8 ignore start - destroyScheduled is set by the same map() when a
53
53
  security limit trips; only fires after the schedule. */
@@ -73,7 +73,7 @@ async function extractTar(archivePath, outputDir, options = {}) {
73
73
  });
74
74
  return header;
75
75
  }
76
- if (header.type === "symlink" || header.type === "link") {
76
+ if (header.type === "link" || header.type === "symlink") {
77
77
  destroyScheduled = true;
78
78
  node_process.default.nextTick(() => {
79
79
  extractStream.destroy(new require_primordials_error.ErrorCtor(`Symlink detected in archive: ${header.name}. Symlinks are not supported for security reasons.`));
@@ -127,12 +127,12 @@ async function extractTar(archivePath, outputDir, options = {}) {
127
127
  async function extractTarGz(archivePath, outputDir, options = {}) {
128
128
  require_archives__internal.assertArchiveExists(archivePath);
129
129
  const { maxEntries = require_archives__internal.DEFAULT_MAX_ENTRIES, maxFileSize = require_archives__internal.DEFAULT_MAX_FILE_SIZE, maxTotalSize = require_archives__internal.DEFAULT_MAX_TOTAL_SIZE, strip = 0 } = options;
130
- const normalizedOutputDir = /* @__PURE__ */ require_paths_normalize.normalizePath(outputDir);
130
+ const normalizedOutputDir = require_paths_normalize.normalizePath(outputDir);
131
131
  await require_fs_safe.safeMkdir(normalizedOutputDir);
132
132
  let totalExtractedSize = 0;
133
133
  let entryCount = 0;
134
134
  let destroyScheduled = false;
135
- const extractStream = (/* @__PURE__ */ require_archives__internal.getTarFs()).extract(normalizedOutputDir, {
135
+ const extractStream = require_archives__internal.getTarFs().extract(normalizedOutputDir, {
136
136
  map: (header) => {
137
137
  /* c8 ignore start - destroyScheduled is set by the same map() when a
138
138
  security limit trips; only fires after the schedule. */
@@ -158,7 +158,7 @@ async function extractTarGz(archivePath, outputDir, options = {}) {
158
158
  });
159
159
  return header;
160
160
  }
161
- if (header.type === "symlink" || header.type === "link") {
161
+ if (header.type === "link" || header.type === "symlink") {
162
162
  destroyScheduled = true;
163
163
  node_process.default.nextTick(() => {
164
164
  extractStream.destroy(new require_primordials_error.ErrorCtor(`Symlink detected in archive: ${header.name}. Symlinks are not supported for security reasons.`));
@@ -32,10 +32,10 @@ const require_fs_safe = require('../fs/safe.js');
32
32
  async function extractZip(archivePath, outputDir, options = {}) {
33
33
  require_archives__internal.assertArchiveExists(archivePath);
34
34
  const { maxEntries = require_archives__internal.DEFAULT_MAX_ENTRIES, maxFileSize = require_archives__internal.DEFAULT_MAX_FILE_SIZE, maxTotalSize = require_archives__internal.DEFAULT_MAX_TOTAL_SIZE, strip = 0 } = options;
35
- const normalizedOutputDir = /* @__PURE__ */ require_paths_normalize.normalizePath(outputDir);
35
+ const normalizedOutputDir = require_paths_normalize.normalizePath(outputDir);
36
36
  await require_fs_safe.safeMkdir(normalizedOutputDir);
37
- const zip = new (/* @__PURE__ */ require_archives__internal.getAdmZip())(archivePath);
38
- const path = /* @__PURE__ */ require_node_path.getNodePath();
37
+ const zip = new (require_archives__internal.getAdmZip())(archivePath);
38
+ const path = require_node_path.getNodePath();
39
39
  const entries = zip.getEntries();
40
40
  /* c8 ignore start */
41
41
  if (entries.length > maxEntries) throw new require_primordials_error.ErrorCtor(`Archive has too many entries: ${entries.length} (limit: ${maxEntries})`);
@@ -60,8 +60,6 @@ async function extractZip(archivePath, outputDir, options = {}) {
60
60
  for (const entry of entries) if (!entry.isDirectory) require_archives__internal.validatePathWithinBase(path.join(normalizedOutputDir, entry.entryName), normalizedOutputDir, entry.entryName);
61
61
  zip.extractAllTo(normalizedOutputDir, true);
62
62
  } else {
63
- const path = /* @__PURE__ */ require_node_path.getNodePath();
64
- const entries = zip.getEntries();
65
63
  const dirsToCreate = new require_primordials_map_set.SetCtor();
66
64
  for (const entry of entries) {
67
65
  if (entry.isDirectory) continue;
@@ -11,6 +11,18 @@
11
11
  * accepts both `--quiet` and `--silent`).
12
12
  */
13
13
  import type { FlagInput } from './flag-types';
14
+ /**
15
+ * Get the appropriate log level based on flags. Returns 'silent', 'error',
16
+ * 'warn', 'info', 'verbose', or 'debug'.
17
+ *
18
+ * @example
19
+ * ;```typescript
20
+ * getLogLevel() // 'info' (default)
21
+ * getLogLevel({ quiet: true }) // 'silent'
22
+ * getLogLevel(['--debug']) // 'debug'
23
+ * ```
24
+ */
25
+ export declare function getLogLevel(input?: FlagInput): string;
14
26
  /**
15
27
  * Build a flag predicate that accepts `FlagValues`, `string[]`, or `undefined`
16
28
  * (in which case it consults the frozen `processArg`).
@@ -165,15 +177,3 @@ export declare const isVerbose: (input?: FlagInput) => boolean;
165
177
  * ```
166
178
  */
167
179
  export declare const isWatch: (input?: FlagInput) => boolean;
168
- /**
169
- * Get the appropriate log level based on flags. Returns 'silent', 'error',
170
- * 'warn', 'info', 'verbose', or 'debug'.
171
- *
172
- * @example
173
- * ;```typescript
174
- * getLogLevel() // 'info' (default)
175
- * getLogLevel({ quiet: true }) // 'silent'
176
- * getLogLevel(['--debug']) // 'debug'
177
- * ```
178
- */
179
- export declare function getLogLevel(input?: FlagInput): string;
@@ -21,6 +21,23 @@ node_process = require_runtime.__toESM(node_process);
21
21
  */
22
22
  const processArg = [...node_process.default.argv];
23
23
  /**
24
+ * Get the appropriate log level based on flags. Returns 'silent', 'error',
25
+ * 'warn', 'info', 'verbose', or 'debug'.
26
+ *
27
+ * @example
28
+ * ;```typescript
29
+ * getLogLevel() // 'info' (default)
30
+ * getLogLevel({ quiet: true }) // 'silent'
31
+ * getLogLevel(['--debug']) // 'debug'
32
+ * ```
33
+ */
34
+ function getLogLevel(input) {
35
+ if (isQuiet(input)) return "silent";
36
+ if (isDebug(input)) return "debug";
37
+ if (isVerbose(input)) return "verbose";
38
+ return "info";
39
+ }
40
+ /**
24
41
  * Build a flag predicate that accepts `FlagValues`, `string[]`, or `undefined`
25
42
  * (in which case it consults the frozen `processArg`).
26
43
  *
@@ -183,23 +200,6 @@ const isVerbose = makeFlagPredicate(["--verbose"]);
183
200
  * ```
184
201
  */
185
202
  const isWatch = makeFlagPredicate(["--watch"], ["-w"]);
186
- /**
187
- * Get the appropriate log level based on flags. Returns 'silent', 'error',
188
- * 'warn', 'info', 'verbose', or 'debug'.
189
- *
190
- * @example
191
- * ;```typescript
192
- * getLogLevel() // 'info' (default)
193
- * getLogLevel({ quiet: true }) // 'silent'
194
- * getLogLevel(['--debug']) // 'debug'
195
- * ```
196
- */
197
- function getLogLevel(input) {
198
- if (isQuiet(input)) return "silent";
199
- if (isDebug(input)) return "debug";
200
- if (isVerbose(input)) return "verbose";
201
- return "info";
202
- }
203
203
 
204
204
  //#endregion
205
205
  exports.getLogLevel = getLogLevel;
@@ -8,22 +8,22 @@
8
8
  */
9
9
  export interface FlagValues {
10
10
  [key: string]: unknown;
11
- quiet?: boolean;
12
- silent?: boolean;
13
- verbose?: boolean;
14
- help?: boolean;
15
- all?: boolean;
16
- fix?: boolean;
17
- force?: boolean;
18
- 'dry-run'?: boolean;
19
- json?: boolean;
20
- debug?: boolean;
21
- watch?: boolean;
22
- coverage?: boolean;
23
- cover?: boolean;
24
- update?: boolean;
25
- staged?: boolean;
26
- changed?: boolean;
11
+ quiet?: boolean | undefined;
12
+ silent?: boolean | undefined;
13
+ verbose?: boolean | undefined;
14
+ help?: boolean | undefined;
15
+ all?: boolean | undefined;
16
+ fix?: boolean | undefined;
17
+ force?: boolean | undefined;
18
+ 'dry-run'?: boolean | undefined;
19
+ json?: boolean | undefined;
20
+ debug?: boolean | undefined;
21
+ watch?: boolean | undefined;
22
+ coverage?: boolean | undefined;
23
+ cover?: boolean | undefined;
24
+ update?: boolean | undefined;
25
+ staged?: boolean | undefined;
26
+ changed?: boolean | undefined;
27
27
  }
28
28
  /**
29
29
  * Accepted input types for flag checking functions. Can be parsed flag values,
@@ -45,12 +45,12 @@ export declare const COMMON_FLAGS: {
45
45
  default: boolean;
46
46
  description: string;
47
47
  };
48
- coverage: {
48
+ cover: {
49
49
  type: 'boolean';
50
50
  default: boolean;
51
51
  description: string;
52
52
  };
53
- cover: {
53
+ coverage: {
54
54
  type: 'boolean';
55
55
  default: boolean;
56
56
  description: string;
@@ -18,15 +18,15 @@ const COMMON_FLAGS = {
18
18
  default: false,
19
19
  description: "Target changed files"
20
20
  },
21
- coverage: {
21
+ cover: {
22
22
  type: "boolean",
23
23
  default: false,
24
- description: "Run with coverage"
24
+ description: "Run with coverage (alias)"
25
25
  },
26
- cover: {
26
+ coverage: {
27
27
  type: "boolean",
28
28
  default: false,
29
- description: "Run with coverage (alias)"
29
+ description: "Run with coverage"
30
30
  },
31
31
  debug: {
32
32
  type: "boolean",
@@ -8,7 +8,7 @@
8
8
  */
9
9
  interface YargsArguments extends Record<string, unknown> {
10
10
  _: string[];
11
- $0?: string;
11
+ $0?: string | undefined;
12
12
  }
13
13
  /**
14
14
  * Options for configuring argument parsing, similar to Node.js util.parseArgs.
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_primordials_intl = require('../primordials/intl.js');
4
5
 
5
6
  //#region src/arrays/_internal.ts
6
7
  /**
@@ -8,8 +9,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
8
9
  * instances for conjunction (and) and disjunction (or) joins. Constructed
9
10
  * lazily because `new Intl.ListFormat(...)` is a measurable startup cost.
10
11
  */
11
- let _conjunctionFormatter;
12
- let _disjunctionFormatter;
12
+ let conjunctionFormatter;
13
+ let disjunctionFormatter;
13
14
  /**
14
15
  * Get a cached Intl.ListFormat instance for conjunction (and) formatting.
15
16
  *
@@ -28,15 +29,14 @@ let _disjunctionFormatter;
28
29
  * @returns Cached Intl.ListFormat instance configured for conjunction
29
30
  * formatting.
30
31
  */
31
- /*@__NO_SIDE_EFFECTS__*/
32
32
  function getConjunctionFormatter() {
33
- if (_conjunctionFormatter === void 0)
34
- /* c8 ignore start */
35
- _conjunctionFormatter = new Intl.ListFormat("en", {
33
+ if (conjunctionFormatter === void 0)
34
+ /* c8 ignore start - lazy singleton init runs once; not worth a dedicated test */
35
+ conjunctionFormatter = new require_primordials_intl.IntlListFormat("en", {
36
36
  style: "long",
37
37
  type: "conjunction"
38
38
  });
39
- return _conjunctionFormatter;
39
+ return conjunctionFormatter;
40
40
  }
41
41
  /**
42
42
  * Get a cached Intl.ListFormat instance for disjunction (or) formatting.
@@ -56,15 +56,14 @@ function getConjunctionFormatter() {
56
56
  * @returns Cached Intl.ListFormat instance configured for disjunction
57
57
  * formatting.
58
58
  */
59
- /*@__NO_SIDE_EFFECTS__*/
60
59
  function getDisjunctionFormatter() {
61
- if (_disjunctionFormatter === void 0)
62
- /* c8 ignore start */
63
- _disjunctionFormatter = new Intl.ListFormat("en", {
60
+ if (disjunctionFormatter === void 0)
61
+ /* c8 ignore start - lazy singleton init runs once; not worth a dedicated test */
62
+ disjunctionFormatter = new require_primordials_intl.IntlListFormat("en", {
64
63
  style: "long",
65
64
  type: "disjunction"
66
65
  });
67
- return _disjunctionFormatter;
66
+ return disjunctionFormatter;
68
67
  }
69
68
 
70
69
  //#endregion
@@ -40,7 +40,6 @@ const require_primordials_error = require('../primordials/error.js');
40
40
  *
41
41
  * @throws {Error} If chunk size is less than or equal to 0
42
42
  */
43
- /*@__NO_SIDE_EFFECTS__*/
44
43
  function arrayChunk(arr, size) {
45
44
  const chunkSize = size ?? 2;
46
45
  if (chunkSize <= 0) throw new require_primordials_error.ErrorCtor("Chunk size must be greater than 0");
@@ -1,13 +1,17 @@
1
1
  /**
2
2
  * @file Grammatical list joiners via `Intl.ListFormat` — Oxford-comma aware and
3
- * locale-correct. `joinAnd` ("a, b, and c"), `joinOr` ("a, b, or c").
3
+ * locale-correct. `joinList` (generalized), `joinAnd` ("a, b, and c"),
4
+ * `joinOr` ("a, b, or c").
4
5
  */
6
+ export interface JoinListOptions {
7
+ with?: string | undefined;
8
+ }
5
9
  /**
6
10
  * Join array elements with proper "and" conjunction formatting.
7
11
  *
8
12
  * Formats an array of strings into a grammatically correct list using "and" as
9
13
  * the conjunction. Uses `Intl.ListFormat` for proper English formatting with
10
- * Oxford comma support.
14
+ * Oxford comma support. Delegates to `joinList`.
11
15
  *
12
16
  * @example
13
17
  * ```ts
@@ -38,12 +42,42 @@
38
42
  * @returns Formatted string with proper "and" conjunction
39
43
  */
40
44
  export declare function joinAnd(arr: string[] | readonly string[]): string;
45
+ /**
46
+ * Generalized list joiner covering bare join, comma-list, and
47
+ * conjunction/disjunction via `Intl.ListFormat`.
48
+ *
49
+ * - No options: bare concatenation (`'abc'`)
50
+ * - `{ with: 'and' }`: Oxford-comma "and" list via `Intl.ListFormat` (`'a, b, and
51
+ * c'`)
52
+ * - `{ with: 'or' }`: Oxford-comma "or" list via `Intl.ListFormat` (`'a, b, or
53
+ * c'`)
54
+ * - `{ with: <any other string> }`: `items.join(sep)` — e.g. `','` → `'a,b,c'`,
55
+ * `', '` → `'a, b, c'`, `' '` → `'a b c'`
56
+ *
57
+ * Each item is coerced via `String()` before formatting.
58
+ *
59
+ * @example
60
+ * ;```ts
61
+ * joinList(['a', 'b', 'c']) // 'abc'
62
+ * joinList(['a', 'b', 'c'], { with: ', ' }) // 'a, b, c'
63
+ * joinList(['a', 'b', 'c'], { with: ' ' }) // 'a b c'
64
+ * joinList(['a', 'b', 'c'], { with: 'and' }) // 'a, b, and c'
65
+ * joinList(['a', 'b', 'c'], { with: 'or' }) // 'a, b, or c'
66
+ * joinList([1, 2, 3], { with: 'and' }) // '1, 2, and 3'
67
+ * ```
68
+ *
69
+ * @param items - Items to join (can be readonly, any type)
70
+ * @param options - Formatting options (optional)
71
+ *
72
+ * @returns Formatted string
73
+ */
74
+ export declare function joinList(items: readonly unknown[], options?: JoinListOptions): string;
41
75
  /**
42
76
  * Join array elements with proper "or" disjunction formatting.
43
77
  *
44
78
  * Formats an array of strings into a grammatically correct list using "or" as
45
79
  * the disjunction. Uses `Intl.ListFormat` for proper English formatting with
46
- * Oxford comma support.
80
+ * Oxford comma support. Delegates to `joinList`.
47
81
  *
48
82
  * @example
49
83
  * ```ts