@socketsecurity/lib 6.0.8 → 6.0.10

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 (396) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/README.md +8 -9
  3. package/dist/abort/signal.d.ts +1 -1
  4. package/dist/abort/signal.js +1 -1
  5. package/dist/ai/agent-context.d.mts +1 -1
  6. package/dist/ai/agent-context.js +3 -2
  7. package/dist/ai/backends.d.mts +3 -3
  8. package/dist/ai/backends.js +2 -2
  9. package/dist/ai/billing-context.d.mts +74 -0
  10. package/dist/ai/billing-context.js +129 -0
  11. package/dist/ai/credentials.d.mts +39 -5
  12. package/dist/ai/credentials.js +61 -6
  13. package/dist/ai/discover.d.mts +4 -0
  14. package/dist/ai/discover.js +4 -0
  15. package/dist/ai/exec.d.mts +1 -1
  16. package/dist/ai/exec.js +1 -1
  17. package/dist/ai/http.d.mts +8 -8
  18. package/dist/ai/http.js +6 -6
  19. package/dist/ai/profiles.d.mts +9 -10
  20. package/dist/ai/profiles.js +0 -5
  21. package/dist/ai/role.d.mts +58 -0
  22. package/dist/ai/role.js +96 -0
  23. package/dist/ai/route-heuristic.d.mts +177 -0
  24. package/dist/ai/route-heuristic.js +194 -0
  25. package/dist/ai/route.d.mts +31 -17
  26. package/dist/ai/route.js +35 -19
  27. package/dist/ai/spawn.d.mts +34 -1
  28. package/dist/ai/spawn.js +115 -3
  29. package/dist/ai/subagent-status.d.mts +2 -0
  30. package/dist/ai/subagent-status.js +2 -0
  31. package/dist/ai/tier.d.mts +1 -1
  32. package/dist/ai/types.d.mts +19 -2
  33. package/dist/ai/worktree.d.mts +1 -1
  34. package/dist/ai/worktree.js +3 -2
  35. package/dist/argv/parse.d.ts +2 -0
  36. package/dist/argv/parse.js +2 -0
  37. package/dist/bin/_internal.d.ts +1 -1
  38. package/dist/bin/_internal.js +1 -1
  39. package/dist/bin/prim.cjs +19253 -13937
  40. package/dist/bin/resolve.js +1 -1
  41. package/dist/bin/shadow.js +2 -1
  42. package/dist/bin/which.d.ts +28 -3
  43. package/dist/bin/which.js +45 -3
  44. package/dist/cacache/_internal.d.ts +10 -2
  45. package/dist/cacache/_internal.js +6 -10
  46. package/dist/cache/ttl/_internal.d.ts +33 -0
  47. package/dist/cache/ttl/_internal.js +68 -0
  48. package/dist/cache/ttl/browser.d.ts +56 -0
  49. package/dist/cache/ttl/browser.js +257 -0
  50. package/dist/cache/ttl/store.js +11 -34
  51. package/dist/cache/ttl/types.d.ts +46 -3
  52. package/dist/checks/primordials-defaults.d.ts +5 -5
  53. package/dist/checks/primordials-defaults.js +5 -5
  54. package/dist/checks/primordials.d.ts +1 -1
  55. package/dist/checks/primordials.js +25 -17
  56. package/dist/cli/check-primordials.d.ts +6 -1
  57. package/dist/cli/check-primordials.js +14 -5
  58. package/dist/cli/check.js +1 -1
  59. package/dist/cli/socket-lib.d.ts +1 -1
  60. package/dist/cli/socket-lib.js +3 -3
  61. package/dist/colors/socket-palette.d.ts +1 -1
  62. package/dist/compression/brotli.d.ts +6 -2
  63. package/dist/compression/brotli.js +5 -1
  64. package/dist/compression/gzip.d.ts +6 -2
  65. package/dist/compression/gzip.js +7 -2
  66. package/dist/config/layers.d.ts +53 -0
  67. package/dist/config/layers.js +83 -0
  68. package/dist/constants/agents.d.ts +3 -0
  69. package/dist/constants/agents.js +3 -0
  70. package/dist/constants/node.d.ts +14 -0
  71. package/dist/constants/node.js +14 -0
  72. package/dist/constants/package-default-node-range.js +1 -5
  73. package/dist/constants/packages.d.ts +5 -0
  74. package/dist/constants/packages.js +5 -0
  75. package/dist/constants/platform.d.ts +1 -1
  76. package/dist/constants/platform.js +1 -1
  77. package/dist/constants/socket.js +1 -1
  78. package/dist/constants/typescript.d.ts +5 -0
  79. package/dist/constants/typescript.js +5 -0
  80. package/dist/debug/_internal.d.ts +22 -7
  81. package/dist/debug/_internal.js +33 -15
  82. package/dist/debug/caller-info.js +1 -1
  83. package/dist/debug/namespace.js +11 -8
  84. package/dist/debug/output.d.ts +12 -1
  85. package/dist/debug/output.js +33 -16
  86. package/dist/dlx/binary-cache.js +1 -1
  87. package/dist/dlx/binary-resolution.js +8 -5
  88. package/dist/dlx/firewall.js +1 -1
  89. package/dist/dlx/lockfile.js +1 -1
  90. package/dist/eco/npm/npm/parse-lockfile.js +3 -2
  91. package/dist/eco/npm/vlt/exec.d.ts +1 -1
  92. package/dist/eco/npm/vlt/exec.js +1 -1
  93. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +1 -1
  94. package/dist/env/agents.d.ts +6 -0
  95. package/dist/env/agents.js +29 -0
  96. package/dist/env/flags.d.ts +12 -0
  97. package/dist/env/flags.js +23 -0
  98. package/dist/env/github-status.js +2 -2
  99. package/dist/env/providers.d.ts +6 -0
  100. package/dist/env/providers.js +23 -0
  101. package/dist/env/proxy.js +1 -1
  102. package/dist/env/rewire.d.ts +37 -3
  103. package/dist/env/rewire.js +60 -29
  104. package/dist/env/runtimes.d.ts +9 -0
  105. package/dist/env/runtimes.js +53 -0
  106. package/dist/env/socket-cli.d.ts +5 -2
  107. package/dist/env/socket-cli.js +6 -3
  108. package/dist/env/xdg.d.ts +17 -0
  109. package/dist/env/xdg.js +21 -1
  110. package/dist/errors/predicates.d.ts +3 -2
  111. package/dist/errors/predicates.js +5 -3
  112. package/dist/events/exit/_internal.d.ts +1 -23
  113. package/dist/external/@npmcli/package-json.js +3570 -4905
  114. package/dist/external/@npmcli/promise-spawn.js +2 -2
  115. package/dist/external/@sinclair/typebox/value.js +5 -4
  116. package/dist/external/@socketregistry/yocto-spinner.js +3 -3
  117. package/dist/external/@yarnpkg/extensions.js +1 -1
  118. package/dist/external/adm-zip.d.ts +82 -0
  119. package/dist/external/adm-zip.js +2 -2
  120. package/dist/external/cacache.d.ts +87 -0
  121. package/dist/external/debug.d.ts +22 -0
  122. package/dist/external/debug.js +11 -4
  123. package/dist/external/del.d.ts +1 -0
  124. package/dist/external/external-pack.d.ts +12 -0
  125. package/dist/external/external-pack.js +42 -35
  126. package/dist/external/fast-glob.d.ts +8 -0
  127. package/dist/external/fast-sort.d.ts +1 -0
  128. package/dist/external/get-east-asian-width.d.ts +5 -0
  129. package/dist/external/get-east-asian-width.js +8 -1
  130. package/dist/external/has-flag.d.ts +1 -0
  131. package/dist/external/inquirer-pack.d.ts +18 -0
  132. package/dist/external/libnpmexec.d.ts +35 -0
  133. package/dist/external/libnpmpack.d.ts +1 -0
  134. package/dist/external/make-fetch-happen.d.ts +13 -0
  135. package/dist/external/normalize-package-data.d.ts +4 -0
  136. package/dist/external/npm-core.d.ts +14 -0
  137. package/dist/external/npm-pack.d.ts +24 -0
  138. package/dist/external/npm-pack.js +28934 -31885
  139. package/dist/external/npm-package-arg.d.ts +4 -0
  140. package/dist/external/p-map.js +8 -1
  141. package/dist/external/pacote.d.ts +15 -0
  142. package/dist/external/pico-pack.d.ts +16 -0
  143. package/dist/external/pico-pack.js +38 -23
  144. package/dist/external/picomatch.d.ts +96 -0
  145. package/dist/external/pony-cause.d.ts +14 -0
  146. package/dist/external/semver.d.ts +60 -0
  147. package/dist/external/semver.js +1459 -4
  148. package/dist/external/shell-quote.d.ts +51 -0
  149. package/dist/external/shell-quote.js +55 -15
  150. package/dist/external/signal-exit.d.ts +1 -0
  151. package/dist/external/spdx-correct.d.ts +4 -0
  152. package/dist/external/spdx-expression-parse.d.ts +4 -0
  153. package/dist/external/spdx-pack.d.ts +10 -0
  154. package/dist/external/std-env.d.ts +284 -0
  155. package/dist/external/std-env.js +323 -0
  156. package/dist/external/streaming-iterables.d.ts +11 -0
  157. package/dist/external/supports-color.d.ts +1 -0
  158. package/dist/external/tar-fs.d.ts +31 -0
  159. package/dist/external/tar-fs.js +63 -16
  160. package/dist/external/validate-npm-package-name.d.ts +4 -0
  161. package/dist/external/which.d.ts +25 -0
  162. package/dist/external/which.js +2 -2
  163. package/dist/external/yargs-parser.d.ts +2 -0
  164. package/dist/external/yargs-parser.js +11 -3
  165. package/dist/external/yoctocolors-cjs.d.ts +51 -0
  166. package/dist/external-tools/bazel/asset-names.d.ts +1 -1
  167. package/dist/external-tools/bazel/from-download.d.ts +1 -1
  168. package/dist/external-tools/bazel/resolve.d.ts +3 -0
  169. package/dist/external-tools/bazel/resolve.js +3 -0
  170. package/dist/external-tools/cdxgen/asset-names.d.ts +5 -5
  171. package/dist/external-tools/cdxgen/asset-names.js +3 -3
  172. package/dist/external-tools/cdxgen/from-download.d.ts +2 -2
  173. package/dist/external-tools/cdxgen/from-download.js +1 -1
  174. package/dist/external-tools/cdxgen/resolve.d.ts +4 -1
  175. package/dist/external-tools/cdxgen/resolve.js +4 -1
  176. package/dist/external-tools/cdxgen/types.d.ts +1 -1
  177. package/dist/external-tools/from-download.d.ts +2 -2
  178. package/dist/external-tools/from-download.js +1 -1
  179. package/dist/external-tools/janus/asset-names.d.ts +4 -1
  180. package/dist/external-tools/janus/asset-names.js +3 -0
  181. package/dist/external-tools/janus/from-download.d.ts +3 -3
  182. package/dist/external-tools/janus/from-download.js +2 -2
  183. package/dist/external-tools/janus/resolve.d.ts +3 -0
  184. package/dist/external-tools/janus/resolve.js +3 -0
  185. package/dist/external-tools/jre/asset-names.d.ts +3 -1
  186. package/dist/external-tools/jre/asset-names.js +2 -0
  187. package/dist/external-tools/jre/detect-platform-arch.js +1 -1
  188. package/dist/external-tools/jre/from-download.d.ts +1 -1
  189. package/dist/external-tools/manifest.d.ts +5 -3
  190. package/dist/external-tools/manifest.js +5 -3
  191. package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
  192. package/dist/external-tools/opengrep/resolve.d.ts +3 -0
  193. package/dist/external-tools/opengrep/resolve.js +3 -0
  194. package/dist/external-tools/python/asset-names.d.ts +3 -1
  195. package/dist/external-tools/python/asset-names.js +8 -4
  196. package/dist/external-tools/python/pin.js +3 -1
  197. package/dist/external-tools/python/resolve.d.ts +3 -0
  198. package/dist/external-tools/python/resolve.js +3 -0
  199. package/dist/external-tools/python/uv-install.d.ts +89 -0
  200. package/dist/external-tools/python/uv-install.js +165 -0
  201. package/dist/external-tools/sbt/resolve.d.ts +3 -0
  202. package/dist/external-tools/sbt/resolve.js +3 -0
  203. package/dist/external-tools/skillspector/from-uv.d.ts +30 -0
  204. package/dist/external-tools/skillspector/from-uv.js +56 -0
  205. package/dist/external-tools/skillspector/resolve.d.ts +18 -3
  206. package/dist/external-tools/skillspector/resolve.js +21 -8
  207. package/dist/external-tools/skillspector/types.d.ts +3 -1
  208. package/dist/external-tools/synp/resolve.d.ts +3 -0
  209. package/dist/external-tools/synp/resolve.js +3 -0
  210. package/dist/external-tools/trivy/asset-names.d.ts +1 -1
  211. package/dist/external-tools/trivy/resolve.d.ts +3 -0
  212. package/dist/external-tools/trivy/resolve.js +3 -0
  213. package/dist/external-tools/trufflehog/asset-names.d.ts +4 -1
  214. package/dist/external-tools/trufflehog/asset-names.js +3 -0
  215. package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
  216. package/dist/external-tools/trufflehog/resolve.d.ts +3 -0
  217. package/dist/external-tools/trufflehog/resolve.js +3 -0
  218. package/dist/external-tools/uv/asset-names.d.ts +36 -0
  219. package/dist/external-tools/uv/asset-names.js +73 -0
  220. package/dist/external-tools/uv/from-download.d.ts +17 -0
  221. package/dist/external-tools/uv/from-download.js +50 -0
  222. package/dist/external-tools/uv/from-path.d.ts +5 -0
  223. package/dist/external-tools/uv/from-path.js +22 -0
  224. package/dist/external-tools/uv/from-vfs.d.ts +7 -0
  225. package/dist/external-tools/uv/from-vfs.js +26 -0
  226. package/dist/external-tools/uv/resolve.d.ts +28 -0
  227. package/dist/external-tools/uv/resolve.js +64 -0
  228. package/dist/external-tools/uv/types.d.ts +24 -0
  229. package/dist/external-tools/uv/types.js +2 -0
  230. package/dist/fleet/repo-config.d.ts +55 -0
  231. package/dist/fleet/repo-config.js +81 -0
  232. package/dist/fs/_internal.d.ts +1 -1
  233. package/dist/fs/_internal.js +1 -1
  234. package/dist/fs/access.d.ts +2 -0
  235. package/dist/fs/access.js +2 -0
  236. package/dist/fs/copy.d.ts +88 -0
  237. package/dist/fs/copy.js +89 -0
  238. package/dist/fs/find.js +1 -2
  239. package/dist/fs/inspect.d.ts +2 -2
  240. package/dist/fs/read-file.js +3 -4
  241. package/dist/fs/safe.js +2 -2
  242. package/dist/git/_internal.js +7 -3
  243. package/dist/github/commit.d.ts +92 -0
  244. package/dist/github/commit.js +113 -0
  245. package/dist/github/ghsa.js +1 -1
  246. package/dist/github/refs-graphql.js +1 -1
  247. package/dist/github/refs.js +10 -15
  248. package/dist/github/request.js +1 -1
  249. package/dist/github/token.d.ts +5 -2
  250. package/dist/github/token.js +6 -4
  251. package/dist/github/workflow-runs.d.ts +107 -0
  252. package/dist/github/workflow-runs.js +98 -0
  253. package/dist/globs/_internal.js +1 -1
  254. package/dist/http-request/_internal.d.ts +1 -1
  255. package/dist/http-request/browser.d.ts +6 -0
  256. package/dist/http-request/browser.js +4 -3
  257. package/dist/http-request/checksum-file.js +1 -1
  258. package/dist/http-request/download.js +2 -0
  259. package/dist/http-request/headers.d.ts +1 -1
  260. package/dist/http-request/headers.js +2 -2
  261. package/dist/http-request/request-attempt.js +6 -3
  262. package/dist/http-request/request-types.d.ts +10 -1
  263. package/dist/http-request/request.js +2 -2
  264. package/dist/http-request/user-agent.d.ts +23 -2
  265. package/dist/http-request/user-agent.js +48 -6
  266. package/dist/integrity.d.ts +127 -78
  267. package/dist/integrity.js +170 -84
  268. package/dist/json/format.js +4 -1
  269. package/dist/logger/_internal.d.ts +13 -15
  270. package/dist/logger/_internal.js +21 -21
  271. package/dist/logger/colors.d.ts +10 -5
  272. package/dist/logger/colors.js +7 -14
  273. package/dist/logger/console-methods.js +2 -2
  274. package/dist/logger/console.d.ts +1 -0
  275. package/dist/logger/console.js +9 -9
  276. package/dist/logger/node.js +2 -1
  277. package/dist/logger/symbols-builder.js +7 -8
  278. package/dist/logger/symbols.js +8 -8
  279. package/dist/native-messaging/install.js +1 -1
  280. package/dist/native-messaging/rate-limit.d.ts +4 -1
  281. package/dist/native-messaging/rate-limit.js +4 -1
  282. package/dist/node/events.d.ts +3 -0
  283. package/dist/node/events.js +3 -0
  284. package/dist/node/fs.d.ts +1 -1
  285. package/dist/node/module.d.ts +73 -2
  286. package/dist/node/module.js +97 -12
  287. package/dist/node/timers-promises.d.ts +3 -0
  288. package/dist/node/timers-promises.js +3 -0
  289. package/dist/node/url.d.ts +3 -0
  290. package/dist/node/url.js +3 -0
  291. package/dist/npm/meta-cache.d.ts +183 -0
  292. package/dist/npm/meta-cache.js +318 -0
  293. package/dist/npm/meta-slice.d.ts +27 -0
  294. package/dist/npm/meta-slice.js +68 -0
  295. package/dist/npm/meta-types.d.ts +282 -0
  296. package/dist/npm/meta-types.js +2 -0
  297. package/dist/npm/meta.d.ts +125 -0
  298. package/dist/npm/meta.js +347 -0
  299. package/dist/npm/registry.d.ts +212 -0
  300. package/dist/npm/registry.js +284 -0
  301. package/dist/objects/getters.d.ts +1 -1
  302. package/dist/objects/getters.js +1 -1
  303. package/dist/objects/predicates.js +1 -1
  304. package/dist/packages/exports.js +2 -2
  305. package/dist/packages/isolation.js +1 -1
  306. package/dist/packages/manifest.d.ts +29 -0
  307. package/dist/packages/manifest.js +44 -9
  308. package/dist/packages/metadata-extensions.js +2 -4
  309. package/dist/packages/normalize.js +1 -1
  310. package/dist/packages/provenance.d.ts +8 -0
  311. package/dist/packages/provenance.js +10 -2
  312. package/dist/packages/specs.js +1 -1
  313. package/dist/packages/tarball.js +1 -2
  314. package/dist/packages/validation.d.ts +0 -10
  315. package/dist/packages/validation.js +0 -14
  316. package/dist/paths/_internal.d.ts +1 -7
  317. package/dist/paths/_internal.js +9 -15
  318. package/dist/paths/conversion.js +1 -1
  319. package/dist/paths/exts.d.ts +30 -0
  320. package/dist/paths/exts.js +30 -0
  321. package/dist/paths/filenames.d.ts +6 -0
  322. package/dist/paths/filenames.js +6 -0
  323. package/dist/paths/globs.d.ts +6 -0
  324. package/dist/paths/globs.js +6 -0
  325. package/dist/paths/normalize.js +1 -1
  326. package/dist/paths/predicates.js +2 -1
  327. package/dist/paths/resolve.js +19 -14
  328. package/dist/paths/socket.d.ts +81 -30
  329. package/dist/paths/socket.js +102 -28
  330. package/dist/perf/metrics.js +1 -1
  331. package/dist/perf/report.js +5 -3
  332. package/dist/pkg-ext/data.js +0 -2
  333. package/dist/primordials/globals.d.ts +1 -1
  334. package/dist/primordials/globals.js +1 -1
  335. package/dist/primordials/headers.d.ts +13 -1
  336. package/dist/primordials/headers.js +13 -1
  337. package/dist/primordials/process.d.ts +1 -1
  338. package/dist/primordials/process.js +1 -1
  339. package/dist/primordials/url.d.ts +18 -0
  340. package/dist/primordials/url.js +18 -0
  341. package/dist/process/spawn/child.js +3 -5
  342. package/dist/promises/_internal.d.ts +1 -1
  343. package/dist/promises/_internal.js +1 -2
  344. package/dist/promises/options.js +3 -3
  345. package/dist/regexps/spec.js +1 -1
  346. package/dist/releases/socket-btm-binary-naming.js +12 -1
  347. package/dist/schema/validate.js +1 -1
  348. package/dist/secrets/_internal.d.ts +1 -1
  349. package/dist/secrets/_internal.js +1 -1
  350. package/dist/secrets/broker.d.ts +35 -0
  351. package/dist/secrets/broker.js +72 -0
  352. package/dist/secrets/find.d.ts +8 -6
  353. package/dist/secrets/find.js +17 -3
  354. package/dist/secrets/keychain.d.ts +10 -1
  355. package/dist/secrets/keychain.js +10 -1
  356. package/dist/secrets/rc.js +1 -1
  357. package/dist/secrets/socket-api-token.d.ts +1 -1
  358. package/dist/secrets/socket-api-token.js +1 -1
  359. package/dist/secrets/types.d.ts +1 -1
  360. package/dist/smol/detect.js +1 -1
  361. package/dist/smol/http.d.ts +2 -0
  362. package/dist/smol/http.js +3 -1
  363. package/dist/smol/https.d.ts +2 -0
  364. package/dist/smol/https.js +3 -1
  365. package/dist/smol/manifest.js +1 -1
  366. package/dist/smol/path.js +1 -1
  367. package/dist/smol/primordial.js +1 -1
  368. package/dist/smol/purl.js +1 -1
  369. package/dist/smol/versions.js +1 -1
  370. package/dist/smol/vfs.js +1 -1
  371. package/dist/sorts/_internal.d.ts +2 -4
  372. package/dist/sorts/_internal.js +1 -7
  373. package/dist/sorts/semver.js +2 -2
  374. package/dist/spinner/create-spinner-class.js +1 -1
  375. package/dist/spinner/format.js +2 -4
  376. package/dist/stdio/footer.js +8 -7
  377. package/dist/stdio/progress.js +1 -1
  378. package/dist/stdio/prompts.d.ts +8 -23
  379. package/dist/stdio/prompts.js +28 -52
  380. package/dist/strings/format.js +1 -1
  381. package/dist/strings/predicates.d.ts +2 -2
  382. package/dist/strings/search.js +2 -2
  383. package/dist/strings/types.d.ts +4 -0
  384. package/dist/strings/width.d.ts +1 -0
  385. package/dist/strings/width.js +17 -8
  386. package/dist/themes/context.d.ts +18 -3
  387. package/dist/themes/context.js +28 -14
  388. package/dist/versions/_internal.d.ts +43 -13
  389. package/dist/versions/_internal.js +27 -15
  390. package/dist/versions/compare.d.ts +16 -10
  391. package/dist/versions/compare.js +36 -16
  392. package/dist/versions/parse.js +1 -1
  393. package/dist/versions/range.js +3 -2
  394. package/dist/words/pluralize.js +4 -1
  395. package/llms.txt +63 -0
  396. package/package.json +271 -40
@@ -20,7 +20,7 @@ export interface BazelFromDownloadOptions {
20
20
  */
21
21
  version: string;
22
22
  /**
23
- * Fleet platform-arch token, e.g. `'darwin-arm64'`.
23
+ * Socket platform-arch token, e.g. `'darwin-arm64'`.
24
24
  */
25
25
  platformArch: string;
26
26
  /**
@@ -31,5 +31,8 @@ export interface ResolveBazelOptions {
31
31
  }
32
32
  export declare function cacheKey(options: ResolveBazelOptions | undefined): string;
33
33
  export declare function doResolveBazel(options?: ResolveBazelOptions | undefined): Promise<ResolvedBazel | undefined>;
34
+ /**
35
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
36
+ */
34
37
  export declare function resetBazelResolution(): void;
35
38
  export declare function resolveBazel(options?: ResolveBazelOptions | undefined): Promise<ResolvedBazel | undefined>;
@@ -42,6 +42,9 @@ async function doResolveBazel(options) {
42
42
  if (options?.downloadIfMissing) return require_external_tools_bazel_from_download.bazelFromDownload(options.downloadIfMissing);
43
43
  }
44
44
  /* c8 ignore start - test-only escape hatch. */
45
+ /**
46
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
47
+ */
45
48
  function resetBazelResolution() {
46
49
  resolutionCache.clear();
47
50
  }
@@ -12,9 +12,9 @@
12
12
  * https://github.com/CycloneDX/cdxgen/releases/download/v<X.Y.Z>/cdxgen-<os>-<arch>[-musl][-slim][.exe]
13
13
  * Reference: https://github.com/CycloneDX/cdxgen/releases. Single source of
14
14
  * truth: the SEA binary IS the install path. The legacy `@cyclonedx/cdxgen`
15
- * npm package is not used as a fallback — every platform-arch the fleet
16
- * supports has a SEA build, and routing through npm for unsupported targets
17
- * would silently use a different distribution (different bundle composition,
15
+ * npm package is not used as a fallback — every platform-arch Socket supports
16
+ * has a SEA build, and routing through npm for unsupported targets would
17
+ * silently use a different distribution (different bundle composition,
18
18
  * different startup cost, different version-pin surface). One install path;
19
19
  * one cached binary.
20
20
  */
@@ -36,8 +36,8 @@ export interface CdxgenDownloadOptions {
36
36
  */
37
37
  version: string;
38
38
  /**
39
- * Fleet platform-arch token — looked up in the asset map. Returns `undefined`
40
- * when no entry exists for the target.
39
+ * Socket platform-arch token — looked up in the asset map. Returns
40
+ * `undefined` when no entry exists for the target.
41
41
  */
42
42
  platformArch: string;
43
43
  /**
@@ -18,9 +18,9 @@ const require_primordials_object = require('../../primordials/object.js');
18
18
  * https://github.com/CycloneDX/cdxgen/releases/download/v<X.Y.Z>/cdxgen-<os>-<arch>[-musl][-slim][.exe]
19
19
  * Reference: https://github.com/CycloneDX/cdxgen/releases. Single source of
20
20
  * truth: the SEA binary IS the install path. The legacy `@cyclonedx/cdxgen`
21
- * npm package is not used as a fallback — every platform-arch the fleet
22
- * supports has a SEA build, and routing through npm for unsupported targets
23
- * would silently use a different distribution (different bundle composition,
21
+ * npm package is not used as a fallback — every platform-arch Socket supports
22
+ * has a SEA build, and routing through npm for unsupported targets would
23
+ * silently use a different distribution (different bundle composition,
24
24
  * different startup cost, different version-pin surface). One install path;
25
25
  * one cached binary.
26
26
  */
@@ -5,7 +5,7 @@
5
5
  * wrapper) with sidecar `.sha256` files; this helper passes the pinned
6
6
  * integrity through `downloadToolArchive`, then copies the downloaded blob to
7
7
  * `cdxgen[.exe]` and chmods it 0o755. Platforms upstream doesn't ship a SEA
8
- * for (none today; the asset map covers all 8 fleet targets) return
8
+ * for (none today; the asset map covers all 8 Socket targets) return
9
9
  * `undefined` — callers should fall back to `cdxgenFromNpm()` for those.
10
10
  */
11
11
  import type { BinaryDownloader } from '../from-download';
@@ -18,7 +18,7 @@ export interface CdxgenFromDownloadOptions {
18
18
  */
19
19
  version: string;
20
20
  /**
21
- * Fleet platform-arch token, e.g. `'darwin-arm64'`.
21
+ * Socket platform-arch token, e.g. `'darwin-arm64'`.
22
22
  */
23
23
  platformArch: string;
24
24
  /**
@@ -20,7 +20,7 @@ node_path = require_runtime.__toESM(node_path);
20
20
  * wrapper) with sidecar `.sha256` files; this helper passes the pinned
21
21
  * integrity through `downloadToolArchive`, then copies the downloaded blob to
22
22
  * `cdxgen[.exe]` and chmods it 0o755. Platforms upstream doesn't ship a SEA
23
- * for (none today; the asset map covers all 8 fleet targets) return
23
+ * for (none today; the asset map covers all 8 Socket targets) return
24
24
  * `undefined` — callers should fall back to `cdxgenFromNpm()` for those.
25
25
  */
26
26
  async function cdxgenFromDownload(options) {
@@ -6,7 +6,7 @@
6
6
  * 2. PATH — `cdxgen` on the system PATH
7
7
  * 3. download — upstream SEA binary from the GitHub release (slim by default;
8
8
  * pass `variant: 'full'` for the bun+deno-bundled flavor) Single source of
9
- * truth: SEA binary only. No npm-package fallback — every fleet
9
+ * truth: SEA binary only. No npm-package fallback — every Socket
10
10
  * platform-arch is covered by the SEA matrix, and routing through npm
11
11
  * would split the install surface in two for no benefit. Returns
12
12
  * `undefined` if all of the enabled sources miss. Memoized per
@@ -28,5 +28,8 @@ export interface ResolveCdxgenOptions {
28
28
  }
29
29
  export declare function cacheKey(options: ResolveCdxgenOptions | undefined): string;
30
30
  export declare function doResolveCdxgen(options?: ResolveCdxgenOptions | undefined): Promise<ResolvedCdxgen | undefined>;
31
+ /**
32
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
33
+ */
31
34
  export declare function resetCdxgenResolution(): void;
32
35
  export declare function resolveCdxgen(options?: ResolveCdxgenOptions | undefined): Promise<ResolvedCdxgen | undefined>;
@@ -15,7 +15,7 @@ const require_external_tools_cdxgen_from_vfs = require('./from-vfs.js');
15
15
  * 2. PATH — `cdxgen` on the system PATH
16
16
  * 3. download — upstream SEA binary from the GitHub release (slim by default;
17
17
  * pass `variant: 'full'` for the bun+deno-bundled flavor) Single source of
18
- * truth: SEA binary only. No npm-package fallback — every fleet
18
+ * truth: SEA binary only. No npm-package fallback — every Socket
19
19
  * platform-arch is covered by the SEA matrix, and routing through npm
20
20
  * would split the install surface in two for no benefit. Returns
21
21
  * `undefined` if all of the enabled sources miss. Memoized per
@@ -46,6 +46,9 @@ async function doResolveCdxgen(options) {
46
46
  if (options?.downloadIfMissing) return require_external_tools_cdxgen_from_download.cdxgenFromDownload(options.downloadIfMissing);
47
47
  }
48
48
  /* c8 ignore start - test-only escape hatch. */
49
+ /**
50
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
51
+ */
49
52
  function resetCdxgenResolution() {
50
53
  resolutionCache.clear();
51
54
  }
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * @file Shared types for cdxgen resolution. cdxgen ships per-platform SEA
3
3
  * binaries starting in v12.0.x — that's the single install path. The legacy
4
- * `@cyclonedx/cdxgen` npm package is NOT used as a fallback: every fleet
4
+ * `@cyclonedx/cdxgen` npm package is NOT used as a fallback: every Socket
5
5
  * platform-arch has a SEA build, and routing through npm for any target would
6
6
  * silently use a different distribution (different bundle composition,
7
7
  * different startup cost). One install path; one cached binary. The future
@@ -20,7 +20,7 @@
20
20
  * `external-tools.json` (or wherever the pin lives).
21
21
  * - Subsequent calls with `integrity` set: downloads, verifies against the pin,
22
22
  * returns the same value. Customization:
23
- * - `downloader?` lets tests inject a fake fetch, and gives fleet consumers an
23
+ * - `downloader?` lets tests inject a fake fetch, and gives Socket consumers an
24
24
  * escape hatch for alternate cache backends, retry logic, or progress
25
25
  * reporters.
26
26
  */
@@ -112,7 +112,7 @@ export interface DownloadedArchive {
112
112
  * Optional downloader injection. Default: `dlx/binary-download.downloadBinary`.
113
113
  * Replace when: - Writing unit tests that need a fake fetch (no network). -
114
114
  * Wiring an alternate cache backend or progress reporter. - Adding
115
- * fleet-specific instrumentation (metrics, retry).
115
+ * tool-specific instrumentation (metrics, retry).
116
116
  */
117
117
  export type BinaryDownloader = typeof downloadBinary;
118
118
  export interface DownloadOptions {
@@ -29,7 +29,7 @@ let node_fs = require("node:fs");
29
29
  * `external-tools.json` (or wherever the pin lives).
30
30
  * - Subsequent calls with `integrity` set: downloads, verifies against the pin,
31
31
  * returns the same value. Customization:
32
- * - `downloader?` lets tests inject a fake fetch, and gives fleet consumers an
32
+ * - `downloader?` lets tests inject a fake fetch, and gives Socket consumers an
33
33
  * escape hatch for alternate cache backends, retry logic, or progress
34
34
  * reporters.
35
35
  */
@@ -21,6 +21,9 @@ export declare const JANUS_ASSET_MAP: Readonly<Record<string, JanusAssetEntry>>;
21
21
  * rather than letting the URL builder silently return undefined.
22
22
  */
23
23
  export declare const JANUS_SUPPORTED_PLATFORM_ARCHES: readonly string[];
24
+ /**
25
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
26
+ */
24
27
  export declare function getJanusAssetEntry(platformArch: string): JanusAssetEntry | undefined;
25
28
  export interface JanusDownloadOptions {
26
29
  /**
@@ -29,7 +32,7 @@ export interface JanusDownloadOptions {
29
32
  */
30
33
  version: string;
31
34
  /**
32
- * Fleet platform-arch token — looked up in `JANUS_ASSET_MAP`. Returns
35
+ * Socket platform-arch token — looked up in `JANUS_ASSET_MAP`. Returns
33
36
  * `undefined` for any platform-arch janus doesn't ship a build for.
34
37
  */
35
38
  platformArch: string;
@@ -27,6 +27,9 @@ const JANUS_ASSET_MAP = require_primordials_object.ObjectFreeze({
27
27
  * rather than letting the URL builder silently return undefined.
28
28
  */
29
29
  const JANUS_SUPPORTED_PLATFORM_ARCHES = require_primordials_object.ObjectFreeze(require_primordials_object.ObjectKeys(JANUS_ASSET_MAP));
30
+ /**
31
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
32
+ */
30
33
  function getJanusAssetEntry(platformArch) {
31
34
  return JANUS_ASSET_MAP[platformArch];
32
35
  }
@@ -4,8 +4,8 @@
4
4
  * archives containing a bare `janus` binary at the archive root (no nested
5
5
  * directory). Defaults install under the shared wheelhouse dir
6
6
  * (`~/.socket/_wheelhouse/janus/<version>/<platform-arch>/`) rather than the
7
- * per-process dlx cache, so multiple fleet consumers reuse the same extracted
8
- * binary.
7
+ * per-process dlx cache, so multiple Socket consumers reuse the same
8
+ * extracted binary.
9
9
  */
10
10
  import type { BinaryDownloader } from '../from-download';
11
11
  import type { HashSpec } from '../../integrity';
@@ -17,7 +17,7 @@ export interface JanusFromDownloadOptions {
17
17
  /**
18
18
  * Override the install directory. By default the binary lands in
19
19
  * `<getSocketWheelhouseDir()>/janus/<version>/<platformArch>/` — a shared
20
- * cross-fleet location so multiple Socket tools resolve the same binary
20
+ * shared location so multiple Socket tools resolve the same binary
21
21
  * without per-process duplication.
22
22
  */
23
23
  cacheDir?: string | undefined;
@@ -16,8 +16,8 @@ node_path = require_runtime.__toESM(node_path);
16
16
  * archives containing a bare `janus` binary at the archive root (no nested
17
17
  * directory). Defaults install under the shared wheelhouse dir
18
18
  * (`~/.socket/_wheelhouse/janus/<version>/<platform-arch>/`) rather than the
19
- * per-process dlx cache, so multiple fleet consumers reuse the same extracted
20
- * binary.
19
+ * per-process dlx cache, so multiple Socket consumers reuse the same
20
+ * extracted binary.
21
21
  */
22
22
  async function janusFromDownload(options) {
23
23
  const { cacheDir, downloader, integrity, platformArch, version } = {
@@ -24,5 +24,8 @@ export interface ResolveJanusOptions {
24
24
  }
25
25
  export declare function cacheKey(options: ResolveJanusOptions | undefined): string;
26
26
  export declare function doResolveJanus(options?: ResolveJanusOptions | undefined): Promise<ResolvedJanus | undefined>;
27
+ /**
28
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
29
+ */
27
30
  export declare function resetJanusResolution(): void;
28
31
  export declare function resolveJanus(options?: ResolveJanusOptions | undefined): Promise<ResolvedJanus | undefined>;
@@ -43,6 +43,9 @@ async function doResolveJanus(options) {
43
43
  if (options?.downloadIfMissing) return require_external_tools_janus_from_download.janusFromDownload(options.downloadIfMissing);
44
44
  }
45
45
  /* c8 ignore start - test-only escape hatch. */
46
+ /**
47
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
48
+ */
46
49
  function resetJanusResolution() {
47
50
  resolutionCache.clear();
48
51
  }
@@ -34,7 +34,7 @@ export interface AdoptiumDownloadOptions {
34
34
  */
35
35
  version: number;
36
36
  /**
37
- * Fleet platform-arch token — same vocabulary as `getPlatformArch` output.
37
+ * Socket platform-arch token — same vocabulary as `getPlatformArch` output.
38
38
  * Looked up in `ADOPTIUM_QUERY_MAP`; returns `undefined` when Adoptium
39
39
  * doesn't publish a build for that target (e.g. `win-arm64` for older
40
40
  * majors).
@@ -87,5 +87,7 @@ export declare function getAdoptiumDownloadUrl(options: AdoptiumDownloadOptions)
87
87
  /**
88
88
  * Returns the Adoptium query parameters for a given platform-arch, or
89
89
  * `undefined` if no Adoptium build exists for that target.
90
+ *
91
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
90
92
  */
91
93
  export declare function getAdoptiumQuery(platformArch: string): AdoptiumAssetQuery | undefined;
@@ -107,6 +107,8 @@ function getAdoptiumDownloadUrl(options) {
107
107
  /**
108
108
  * Returns the Adoptium query parameters for a given platform-arch, or
109
109
  * `undefined` if no Adoptium build exists for that target.
110
+ *
111
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
110
112
  */
111
113
  function getAdoptiumQuery(platformArch) {
112
114
  return ADOPTIUM_QUERY_MAP[platformArch];
@@ -2,8 +2,8 @@
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
- const require_constants_platform = require('../../constants/platform.js');
6
5
  const require_primordials_object = require('../../primordials/object.js');
6
+ const require_constants_platform = require('../../constants/platform.js');
7
7
  let node_process = require("node:process");
8
8
  node_process = require_runtime.__toESM(node_process);
9
9
 
@@ -26,7 +26,7 @@ export interface JreFromDownloadOptions {
26
26
  */
27
27
  version: number;
28
28
  /**
29
- * Fleet platform-arch token, e.g. `'darwin-arm64'`.
29
+ * Socket platform-arch token, e.g. `'darwin-arm64'`.
30
30
  */
31
31
  platformArch: string;
32
32
  /**
@@ -1,8 +1,8 @@
1
1
  /**
2
- * @file Reader for `external-tools.json` — the fleet manifest describing
2
+ * @file Reader for `external-tools.json` — the Socket manifest describing
3
3
  * downloadable external binaries (sfw, zizmor, etc.) with pinned versions,
4
4
  * per-platform asset names, and integrity hashes. The manifest itself is
5
- * hand-maintained in each fleet repo's root (`<repo>/external-tools.json`)
5
+ * hand-maintained in each Socket repo's root (`<repo>/external-tools.json`)
6
6
  * and consumed by the setup-and-install GitHub action. This reader gives
7
7
  * in-process consumers (external- tools resolvers, ad-hoc scripts) the same
8
8
  * typed view without each one re-implementing the JSON-parse + shape check +
@@ -42,7 +42,7 @@ export interface ToolChecksum {
42
42
  integrity: string;
43
43
  }
44
44
  /**
45
- * A downloadable-binary tool entry. `platforms` is keyed by the fleet's
45
+ * A downloadable-binary tool entry. `platforms` is keyed by Socket's
46
46
  * platform-arch token (`darwin-arm64`, `linux-x64-musl`, `win-x64`, etc. — same
47
47
  * vocabulary as `getPlatformArch`).
48
48
  */
@@ -118,6 +118,8 @@ export declare function parseToolEntry(raw: unknown, toolName: string): Manifest
118
118
  * Throws on malformed JSON or invalid integrity strings; unknown-shape entries
119
119
  * (rust components, future variants) come back as `{kind: 'other', raw}` so
120
120
  * callers can handle them out-of-band without blocking the manifest read.
121
+ *
122
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
121
123
  */
122
124
  export declare function readExternalToolsManifest(filepath: string): Promise<Manifest>;
123
125
  export declare function tryParseFlavored(raw: Record<string, unknown>, toolName: string): FlavoredToolEntry | undefined;
@@ -2,18 +2,18 @@
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_primordials_error = require('../primordials/error.js');
5
- const require_integrity = require('../integrity.js');
6
5
  const require_primordials_object = require('../primordials/object.js');
7
6
  const require_primordials_string = require('../primordials/string.js');
7
+ const require_integrity = require('../integrity.js');
8
8
  const require_primordials_array = require('../primordials/array.js');
9
9
  const require_fs_read_json = require('../fs/read-json.js');
10
10
 
11
11
  //#region src/external-tools/manifest.ts
12
12
  /**
13
- * @file Reader for `external-tools.json` — the fleet manifest describing
13
+ * @file Reader for `external-tools.json` — the Socket manifest describing
14
14
  * downloadable external binaries (sfw, zizmor, etc.) with pinned versions,
15
15
  * per-platform asset names, and integrity hashes. The manifest itself is
16
- * hand-maintained in each fleet repo's root (`<repo>/external-tools.json`)
16
+ * hand-maintained in each Socket repo's root (`<repo>/external-tools.json`)
17
17
  * and consumed by the setup-and-install GitHub action. This reader gives
18
18
  * in-process consumers (external- tools resolvers, ad-hoc scripts) the same
19
19
  * typed view without each one re-implementing the JSON-parse + shape check +
@@ -103,6 +103,8 @@ function parseToolEntry(raw, toolName) {
103
103
  * Throws on malformed JSON or invalid integrity strings; unknown-shape entries
104
104
  * (rust components, future variants) come back as `{kind: 'other', raw}` so
105
105
  * callers can handle them out-of-band without blocking the manifest read.
106
+ *
107
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
106
108
  */
107
109
  async function readExternalToolsManifest(filepath) {
108
110
  const raw = await require_fs_read_json.readJson(filepath);
@@ -31,7 +31,7 @@ export interface OpengrepDownloadOptions {
31
31
  */
32
32
  version: string;
33
33
  /**
34
- * Fleet platform-arch token — looked up in `OPENGREP_ASSET_MAP`.
34
+ * Socket platform-arch token — looked up in `OPENGREP_ASSET_MAP`.
35
35
  */
36
36
  platformArch: string;
37
37
  }
@@ -22,5 +22,8 @@ export interface ResolveOpengrepOptions {
22
22
  }
23
23
  export declare function cacheKey(options: ResolveOpengrepOptions | undefined): string;
24
24
  export declare function doResolveOpengrep(options?: ResolveOpengrepOptions | undefined): Promise<ResolvedOpengrep | undefined>;
25
+ /**
26
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
27
+ */
25
28
  export declare function resetOpengrepResolution(): void;
26
29
  export declare function resolveOpengrep(options?: ResolveOpengrepOptions | undefined): Promise<ResolvedOpengrep | undefined>;
@@ -41,6 +41,9 @@ async function doResolveOpengrep(options) {
41
41
  if (options?.downloadIfMissing) return require_external_tools_opengrep_from_download.opengrepFromDownload(options.downloadIfMissing);
42
42
  }
43
43
  /* c8 ignore start - test-only escape hatch. */
44
+ /**
45
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
46
+ */
44
47
  function resetOpengrepResolution() {
45
48
  resolutionCache.clear();
46
49
  }
@@ -7,11 +7,13 @@
7
7
  * extracted one directory deep (`python/bin/python3`).
8
8
  */
9
9
  /**
10
- * Python-build-standalone default pin — the fleet-canonical CPython build,
10
+ * Python-build-standalone default pin — the Socket-canonical CPython build,
11
11
  * matching socket-cli's `bundle-tools.json`. Consumers that don't pass their
12
12
  * own pin resolve against this. Bump it like any dependency (soak-aware), in
13
13
  * lockstep with socket-cli (drift-watch). The `checksums` map is keyed by asset
14
14
  * filename so the download tier verifies the exact tarball per platform.
15
+ *
16
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
15
17
  */
16
18
  export declare const DEFAULT_PYTHON_PIN: Readonly<{
17
19
  __proto__: null;
@@ -2,8 +2,8 @@
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
- const require_constants_platform = require('../../constants/platform.js');
6
5
  const require_primordials_object = require('../../primordials/object.js');
6
+ const require_constants_platform = require('../../constants/platform.js');
7
7
  let node_process = require("node:process");
8
8
  node_process = require_runtime.__toESM(node_process);
9
9
 
@@ -40,11 +40,13 @@ const NODE_ARCH_TO_PY = require_primordials_object.ObjectFreeze({
40
40
  });
41
41
  const RELEASE_BASE = "https://github.com/astral-sh/python-build-standalone/releases/download";
42
42
  /**
43
- * Python-build-standalone default pin — the fleet-canonical CPython build,
43
+ * Python-build-standalone default pin — the Socket-canonical CPython build,
44
44
  * matching socket-cli's `bundle-tools.json`. Consumers that don't pass their
45
45
  * own pin resolve against this. Bump it like any dependency (soak-aware), in
46
46
  * lockstep with socket-cli (drift-watch). The `checksums` map is keyed by asset
47
47
  * filename so the download tier verifies the exact tarball per platform.
48
+ *
49
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
48
50
  */
49
51
  const DEFAULT_PYTHON_PIN = require_primordials_object.ObjectFreeze({
50
52
  __proto__: null,
@@ -99,9 +101,11 @@ function pythonAsset(options) {
99
101
  const arch = options.arch ?? getPythonArch();
100
102
  const triple = arch ? PLATFORM_TRIPLES[arch] : void 0;
101
103
  if (!triple) return;
104
+ const assetName = `cpython-${version}+${tag}-${triple}-install_only.tar.gz`;
105
+ const encodedVersion = `${version}%2B${tag}`;
102
106
  return {
103
- assetName: `cpython-${version}+${tag}-${triple}-install_only.tar.gz`,
104
- url: `${RELEASE_BASE}/${tag}/cpython-${`${version}%2B${tag}`}-${triple}-install_only.tar.gz`
107
+ assetName,
108
+ url: `${RELEASE_BASE}/${tag}/cpython-${encodedVersion}-${triple}-install_only.tar.gz`
105
109
  };
106
110
  }
107
111
 
@@ -118,7 +118,9 @@ async function resolvePipPackagePin(options) {
118
118
  const artifacts = [];
119
119
  const targetName = normalizeDistName(specDistName(spec));
120
120
  let top;
121
- for (const file of files.toSorted()) {
121
+ const sortedFiles = files.toSorted();
122
+ for (let i = 0, { length } = sortedFiles; i < length; i += 1) {
123
+ const file = sortedFiles[i];
122
124
  const hash = require_integrity.computeHashes(await node_fs.promises.readFile(node_path.default.join(scratch, file)));
123
125
  const parsed = parseArtifactFilename(file);
124
126
  if (!parsed) throw new PipPackagePinError(`resolvePipPackagePin: could not parse name/version from artifact ${file}`);
@@ -38,5 +38,8 @@ export interface ResolvePythonOptions {
38
38
  }
39
39
  export declare function cacheKey(options: ResolvePythonOptions | undefined): string;
40
40
  export declare function doResolvePython(options?: ResolvePythonOptions | undefined): Promise<ResolvedPython | undefined>;
41
+ /**
42
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
43
+ */
41
44
  export declare function resetPythonResolution(): void;
42
45
  export declare function resolvePython(options?: ResolvePythonOptions | undefined): Promise<ResolvedPython | undefined>;
@@ -45,6 +45,9 @@ async function doResolvePython(options) {
45
45
  if (dl) return require_external_tools_python_from_download.pythonFromDownload(dl);
46
46
  }
47
47
  /* c8 ignore start - test-only escape hatch. */
48
+ /**
49
+ * @unused No internal or Socket consumers (exercised only by its unit tests).
50
+ */
48
51
  function resetPythonResolution() {
49
52
  resolutionCache.clear();
50
53
  }
@@ -0,0 +1,89 @@
1
+ /**
2
+ * @file Uv project install helpers — the locked-source-of-truth half of the
3
+ * "uv project + dlx materialize" model.
4
+ * uv (Astral's Python package manager) drives a uv PROJECT — a directory with
5
+ * `pyproject.toml` + `uv.lock` (+ optional `[tool.uv] exclude-newer`). The
6
+ * lock manifests every transitive version, so the project is the most
7
+ * locked-down, most-version-pinned form a Python tool install can take.
8
+ * Two entry points, used together:
9
+ *
10
+ * 1. `uvSyncProject` — `uv sync --locked --project <dir>`. Installs the lock's
11
+ * exact closure into the project's own `.venv` and FAILS if `uv.lock` is
12
+ * out of date vs `pyproject.toml` (the `--locked` gate). This is the
13
+ * verification-grade install: it proves the lock resolves.
14
+ * 2. `uvExportMaterialize` — `uv export --locked` → a flat, hash-pinned
15
+ * requirements list, then `uv pip install --target <dir>` into a
16
+ * content-addressed dlx dir (no venv → no symlinks / absolute `home=`, so
17
+ * the result is relocatable + SEA-VFS-embeddable). Mirrors
18
+ * `downloadPipPackage`'s lock-guarded, idempotent shape. Both take an
19
+ * explicit `uvBin` (typically `resolveUv().path`) and never mutate a
20
+ * shared interpreter — the project venv and the dlx target are
21
+ * self-contained.
22
+ */
23
+ /**
24
+ * Export a uv project's locked closure to a flat requirements list, then
25
+ * `uv pip install --target` it into a content-addressed dlx dir. The dlx dir
26
+ * holds plain files (no venv), so it is relocatable and embeddable in a smol
27
+ * binary's VFS — the bundle-safe analog of `uvSyncProject`'s `.venv`.
28
+ *
29
+ * Lock-guarded + idempotent (reuses `pip-install`'s `isAlreadyInstalled` /
30
+ * `isStaleLock`): a non-empty target dir short-circuits, and concurrent callers
31
+ * serialize on a `.installing` sentinel one level up from the target. Throws on
32
+ * a failed uv command or if the lock can't be acquired after MAX_RETRIES.
33
+ */
34
+ export declare function uvExportMaterialize(options: UvExportMaterializeOptions, retryCount?: number): Promise<UvExportMaterializeResult>;
35
+ /**
36
+ * Content-addressed dlx dir for a uv project's materialized closure:
37
+ * `~/.socket/_dlx/<cacheKey(projectDir)>/site-packages`. Keyed on the project
38
+ * dir so each project gets an isolated target; the analog of `pipPackageDir`.
39
+ */
40
+ export declare function uvProjectTargetDir(projectDir: string): string;
41
+ /**
42
+ * Run `uv sync --locked` against a uv project. Installs the lock's exact
43
+ * dependency closure into the project's `.venv`; the `--locked` flag turns a
44
+ * lock-vs-manifest drift into a hard failure (uv exits non-zero) rather than a
45
+ * silent re-resolution — this is what makes it verification-grade. Throws when
46
+ * uv exits non-zero (drift, missing lock, or a resolution failure).
47
+ */
48
+ export declare function uvSyncProject(options: UvSyncProjectOptions): Promise<void>;
49
+ export interface UvSyncProjectOptions {
50
+ /**
51
+ * Absolute path to the `uv` executable (typically `resolveUv().path`).
52
+ */
53
+ readonly uvBin: string;
54
+ /**
55
+ * Absolute path to the uv project dir (holds `pyproject.toml` + `uv.lock`).
56
+ */
57
+ readonly projectDir: string;
58
+ /**
59
+ * Default true — pass `--locked` so a lock-vs-manifest drift fails hard.
60
+ * Set false ONLY to bootstrap/refresh a lock (never in a verify path).
61
+ */
62
+ readonly locked?: boolean | undefined;
63
+ }
64
+ export interface UvExportMaterializeOptions {
65
+ /**
66
+ * Absolute path to the `uv` executable.
67
+ */
68
+ readonly uvBin: string;
69
+ /**
70
+ * Absolute path to the uv project dir to export from.
71
+ */
72
+ readonly projectDir: string;
73
+ /**
74
+ * Override the content-addressed target dir. Defaults to
75
+ * `uvProjectTargetDir(projectDir)`.
76
+ */
77
+ readonly targetDir?: string | undefined;
78
+ }
79
+ export interface UvExportMaterializeResult {
80
+ /**
81
+ * `true` when this call ran uv; `false` when an existing install was reused.
82
+ */
83
+ readonly installed: boolean;
84
+ /**
85
+ * Directory the closure was installed into. Put this on `PYTHONPATH` to run
86
+ * the tool: `python -m <module>`.
87
+ */
88
+ readonly targetDir: string;
89
+ }