@socketsecurity/lib 6.0.7 → 6.0.9

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 (323) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/dist/ai/agent-context.d.mts +103 -0
  4. package/dist/ai/agent-context.js +157 -0
  5. package/dist/ai/backends.d.mts +83 -0
  6. package/dist/ai/backends.js +173 -0
  7. package/dist/ai/credentials.d.mts +49 -0
  8. package/dist/ai/credentials.js +82 -0
  9. package/dist/ai/discover.d.mts +4 -0
  10. package/dist/ai/discover.js +1 -1
  11. package/dist/ai/exec.d.mts +52 -0
  12. package/dist/ai/exec.js +92 -0
  13. package/dist/ai/http.d.mts +132 -0
  14. package/dist/ai/http.js +130 -0
  15. package/dist/ai/profiles.d.mts +41 -6
  16. package/dist/ai/profiles.js +52 -10
  17. package/dist/ai/route.d.mts +82 -0
  18. package/dist/ai/route.js +171 -0
  19. package/dist/ai/spawn.d.mts +42 -2
  20. package/dist/ai/spawn.js +146 -33
  21. package/dist/ai/subagent-status.d.mts +48 -0
  22. package/dist/ai/subagent-status.js +57 -0
  23. package/dist/ai/tier.d.mts +60 -0
  24. package/dist/ai/tier.js +53 -0
  25. package/dist/ai/types.d.mts +25 -2
  26. package/dist/ai/worktree.js +4 -0
  27. package/dist/archives/tar.js +1 -1
  28. package/dist/archives/zip.js +2 -2
  29. package/dist/argv/parse.d.ts +19 -2
  30. package/dist/argv/parse.js +1 -1
  31. package/dist/arrays/join.js +4 -0
  32. package/dist/bin/find.js +4 -4
  33. package/dist/bin/prim.cjs +23322 -18018
  34. package/dist/bin/resolve.js +2 -2
  35. package/dist/cache/ttl/store.js +2 -2
  36. package/dist/cli/check-primordials.d.ts +8 -3
  37. package/dist/cli/check-primordials.js +4 -4
  38. package/dist/compression/_internal.js +1 -1
  39. package/dist/compression/brotli.d.ts +1 -2
  40. package/dist/compression/brotli.js +5 -1
  41. package/dist/compression/gzip.js +5 -1
  42. package/dist/config/layers.d.ts +53 -0
  43. package/dist/config/layers.js +83 -0
  44. package/dist/constants/packages.d.ts +3 -0
  45. package/dist/constants/packages.js +2 -1
  46. package/dist/constants/socket.d.ts +2 -6
  47. package/dist/constants/socket.js +12 -14
  48. package/dist/cover/code.js +2 -2
  49. package/dist/crypto/hash.d.ts +4 -1
  50. package/dist/crypto/hash.js +4 -1
  51. package/dist/dlx/arborist.js +13 -3
  52. package/dist/dlx/binary-cache.js +1 -1
  53. package/dist/dlx/binary-resolution.js +1 -1
  54. package/dist/dlx/detect.d.ts +8 -0
  55. package/dist/dlx/firewall.d.ts +8 -0
  56. package/dist/dlx/lockfile.js +5 -2
  57. package/dist/dlx/manifest.js +1 -1
  58. package/dist/dlx/package.js +4 -0
  59. package/dist/eco/cargo/parse-lockfile.d.ts +1 -2
  60. package/dist/eco/cargo/parse-lockfile.js +3 -3
  61. package/dist/eco/manifest/detect-format.js +1 -1
  62. package/dist/eco/npm/npm/parse-lockfile.d.ts +3 -4
  63. package/dist/eco/npm/npm/parse-lockfile.js +2 -2
  64. package/dist/eco/npm/parse-package-json.d.ts +11 -0
  65. package/dist/eco/npm/parse-package-json.js +1 -1
  66. package/dist/eco/npm/pnpm/parse-lockfile.d.ts +5 -3
  67. package/dist/eco/npm/pnpm/parse-lockfile.js +3 -3
  68. package/dist/eco/npm/yarnpkg/yarn/exec.js +1 -1
  69. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +1 -2
  70. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +2 -2
  71. package/dist/env/proxy.js +1 -1
  72. package/dist/env/rewire.d.ts +6 -3
  73. package/dist/env/rewire.js +7 -8
  74. package/dist/env/socket.d.ts +7 -0
  75. package/dist/env/socket.js +10 -0
  76. package/dist/env/xdg.d.ts +17 -0
  77. package/dist/env/xdg.js +21 -1
  78. package/dist/errors/predicates.js +1 -1
  79. package/dist/errors/stack.js +1 -2
  80. package/dist/external/@npmcli/package-json.js +3455 -4881
  81. package/dist/external/@npmcli/promise-spawn.js +3 -1
  82. package/dist/external/@yarnpkg/extensions.js +1 -1
  83. package/dist/external/external-pack.js +1 -1
  84. package/dist/external/npm-pack.js +29164 -31799
  85. package/dist/external/pico-pack.js +4 -2
  86. package/dist/external/tar-fs.js +63 -16
  87. package/dist/external/which.js +3 -1
  88. package/dist/external-tools/bazel/asset-names.d.ts +1 -1
  89. package/dist/external-tools/bazel/asset-names.js +5 -2
  90. package/dist/external-tools/bazel/from-download.d.ts +1 -1
  91. package/dist/external-tools/bazel/from-download.js +5 -2
  92. package/dist/external-tools/bazel/resolve-bazel-version.js +4 -0
  93. package/dist/external-tools/bazel/resolve.d.ts +3 -3
  94. package/dist/external-tools/bazel/resolve.js +16 -8
  95. package/dist/external-tools/cdxgen/asset-names.d.ts +1 -1
  96. package/dist/external-tools/cdxgen/asset-names.js +5 -2
  97. package/dist/external-tools/cdxgen/from-download.d.ts +1 -1
  98. package/dist/external-tools/cdxgen/from-download.js +7 -4
  99. package/dist/external-tools/cdxgen/resolve.d.ts +3 -3
  100. package/dist/external-tools/cdxgen/resolve.js +16 -8
  101. package/dist/external-tools/from-download.d.ts +2 -2
  102. package/dist/external-tools/from-download.js +11 -5
  103. package/dist/external-tools/from-pip-venv.d.ts +1 -1
  104. package/dist/external-tools/from-pip-venv.js +12 -5
  105. package/dist/external-tools/janus/asset-names.d.ts +1 -1
  106. package/dist/external-tools/janus/asset-names.js +5 -2
  107. package/dist/external-tools/janus/from-download.d.ts +1 -1
  108. package/dist/external-tools/janus/from-download.js +5 -2
  109. package/dist/external-tools/janus/resolve.d.ts +3 -3
  110. package/dist/external-tools/janus/resolve.js +16 -8
  111. package/dist/external-tools/jre/asset-names.d.ts +1 -1
  112. package/dist/external-tools/jre/asset-names.js +5 -2
  113. package/dist/external-tools/jre/detect-platform-arch.js +1 -1
  114. package/dist/external-tools/jre/from-download.d.ts +1 -1
  115. package/dist/external-tools/jre/from-download.js +7 -4
  116. package/dist/external-tools/jre/from-java-home.js +2 -2
  117. package/dist/external-tools/jre/from-vfs.js +2 -2
  118. package/dist/external-tools/jre/resolve.d.ts +3 -3
  119. package/dist/external-tools/jre/resolve.js +16 -8
  120. package/dist/external-tools/manifest.d.ts +18 -0
  121. package/dist/external-tools/manifest.js +2 -2
  122. package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
  123. package/dist/external-tools/opengrep/asset-names.js +5 -2
  124. package/dist/external-tools/opengrep/from-download.d.ts +1 -1
  125. package/dist/external-tools/opengrep/from-download.js +5 -2
  126. package/dist/external-tools/opengrep/resolve.d.ts +3 -3
  127. package/dist/external-tools/opengrep/resolve.js +16 -8
  128. package/dist/external-tools/python/asset-names.d.ts +1 -1
  129. package/dist/external-tools/python/asset-names.js +11 -4
  130. package/dist/external-tools/python/dlx.d.ts +3 -3
  131. package/dist/external-tools/python/dlx.js +20 -9
  132. package/dist/external-tools/python/from-download.d.ts +1 -1
  133. package/dist/external-tools/python/from-download.js +12 -5
  134. package/dist/external-tools/python/pin.js +6 -3
  135. package/dist/external-tools/python/pip-install.js +6 -3
  136. package/dist/external-tools/python/resolve.d.ts +3 -3
  137. package/dist/external-tools/python/resolve.js +19 -11
  138. package/dist/external-tools/python/uv-install.d.ts +89 -0
  139. package/dist/external-tools/python/uv-install.js +165 -0
  140. package/dist/external-tools/sbt/asset-names.d.ts +1 -1
  141. package/dist/external-tools/sbt/asset-names.js +5 -2
  142. package/dist/external-tools/sbt/from-download.d.ts +1 -1
  143. package/dist/external-tools/sbt/from-download.js +5 -2
  144. package/dist/external-tools/sbt/resolve.d.ts +3 -3
  145. package/dist/external-tools/sbt/resolve.js +16 -8
  146. package/dist/external-tools/skillspector/from-dlx.d.ts +1 -1
  147. package/dist/external-tools/skillspector/from-dlx.js +10 -3
  148. package/dist/external-tools/skillspector/from-uv.d.ts +30 -0
  149. package/dist/external-tools/skillspector/from-uv.js +56 -0
  150. package/dist/external-tools/skillspector/resolve.d.ts +20 -5
  151. package/dist/external-tools/skillspector/resolve.js +27 -6
  152. package/dist/external-tools/skillspector/types.d.ts +3 -1
  153. package/dist/external-tools/synp/asset-names.d.ts +1 -1
  154. package/dist/external-tools/synp/asset-names.js +6 -2
  155. package/dist/external-tools/synp/from-download.d.ts +1 -1
  156. package/dist/external-tools/synp/from-download.js +5 -2
  157. package/dist/external-tools/synp/resolve.d.ts +3 -3
  158. package/dist/external-tools/synp/resolve.js +16 -8
  159. package/dist/external-tools/trivy/asset-names.d.ts +1 -1
  160. package/dist/external-tools/trivy/asset-names.js +5 -2
  161. package/dist/external-tools/trivy/from-download.d.ts +1 -1
  162. package/dist/external-tools/trivy/from-download.js +7 -4
  163. package/dist/external-tools/trivy/resolve.d.ts +3 -3
  164. package/dist/external-tools/trivy/resolve.js +16 -8
  165. package/dist/external-tools/trufflehog/asset-names.d.ts +1 -1
  166. package/dist/external-tools/trufflehog/asset-names.js +5 -2
  167. package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
  168. package/dist/external-tools/trufflehog/from-download.js +7 -4
  169. package/dist/external-tools/trufflehog/resolve.d.ts +3 -3
  170. package/dist/external-tools/trufflehog/resolve.js +16 -8
  171. package/dist/external-tools/uv/asset-names.d.ts +36 -0
  172. package/dist/external-tools/uv/asset-names.js +73 -0
  173. package/dist/external-tools/uv/from-download.d.ts +17 -0
  174. package/dist/external-tools/uv/from-download.js +50 -0
  175. package/dist/external-tools/uv/from-path.d.ts +5 -0
  176. package/dist/external-tools/uv/from-path.js +22 -0
  177. package/dist/external-tools/uv/from-vfs.d.ts +7 -0
  178. package/dist/external-tools/uv/from-vfs.js +26 -0
  179. package/dist/external-tools/uv/resolve.d.ts +25 -0
  180. package/dist/external-tools/uv/resolve.js +61 -0
  181. package/dist/external-tools/uv/types.d.ts +24 -0
  182. package/dist/external-tools/uv/types.js +2 -0
  183. package/dist/fleet/repo-config.d.ts +53 -0
  184. package/dist/fleet/repo-config.js +79 -0
  185. package/dist/fs/allowed-dirs-cache.d.ts +27 -1
  186. package/dist/fs/allowed-dirs-cache.js +39 -6
  187. package/dist/fs/copy.d.ts +88 -0
  188. package/dist/fs/copy.js +89 -0
  189. package/dist/fs/find.js +1 -1
  190. package/dist/fs/read-json-cache.d.ts +7 -0
  191. package/dist/fs/resolve-module.js +6 -2
  192. package/dist/fs/safe.js +1 -1
  193. package/dist/git/_internal.js +3 -3
  194. package/dist/git/repo.js +2 -4
  195. package/dist/git/staged.js +8 -0
  196. package/dist/git/tracked.d.ts +84 -0
  197. package/dist/git/tracked.js +163 -0
  198. package/dist/git/unstaged.js +8 -0
  199. package/dist/github/refs-graphql.js +4 -0
  200. package/dist/github/refs-rest.js +4 -0
  201. package/dist/globs/_internal.js +1 -1
  202. package/dist/globs/match.js +9 -1
  203. package/dist/globs/matcher.js +5 -1
  204. package/dist/http-request/browser.js +7 -3
  205. package/dist/http-request/checksum-file.js +1 -1
  206. package/dist/http-request/{browser-fetch.d.ts → fetch/browser.d.ts} +2 -2
  207. package/dist/http-request/{browser-fetch.js → fetch/browser.js} +4 -4
  208. package/dist/http-request/headers.js +1 -1
  209. package/dist/http-request/request-attempt.js +2 -2
  210. package/dist/http-request/user-agent.js +1 -1
  211. package/dist/integrity.d.ts +124 -71
  212. package/dist/integrity.js +168 -78
  213. package/dist/json/edit.js +38 -30
  214. package/dist/json/format.js +1 -1
  215. package/dist/logger/colors.d.ts +1 -2
  216. package/dist/logger/colors.js +2 -2
  217. package/dist/logger/symbols-builder.js +7 -8
  218. package/dist/logger/symbols.js +8 -8
  219. package/dist/native-messaging/install.d.ts +1 -1
  220. package/dist/native-messaging/install.js +7 -4
  221. package/dist/native-messaging/rate-limit.d.ts +7 -0
  222. package/dist/native-messaging/rate-limit.js +4 -0
  223. package/dist/node/async-hooks.js +1 -1
  224. package/dist/node/child-process.js +1 -1
  225. package/dist/node/crypto.js +1 -1
  226. package/dist/node/events.js +1 -1
  227. package/dist/node/fs-promises.js +1 -1
  228. package/dist/node/fs.d.ts +22 -6
  229. package/dist/node/fs.js +16 -3
  230. package/dist/node/http.js +1 -1
  231. package/dist/node/https.js +1 -1
  232. package/dist/node/module.d.ts +73 -2
  233. package/dist/node/module.js +97 -12
  234. package/dist/node/os.d.ts +10 -2
  235. package/dist/node/os.js +11 -4
  236. package/dist/node/path.d.ts +11 -2
  237. package/dist/node/path.js +17 -4
  238. package/dist/node/timers-promises.js +1 -1
  239. package/dist/node/url.js +1 -1
  240. package/dist/node/util.js +1 -1
  241. package/dist/objects/getters.js +1 -1
  242. package/dist/objects/mutate.js +2 -2
  243. package/dist/packages/edit-class.d.ts +2 -3
  244. package/dist/packages/edit-class.js +41 -35
  245. package/dist/packages/exports.js +4 -4
  246. package/dist/packages/fetch.js +1 -1
  247. package/dist/packages/isolation.js +2 -2
  248. package/dist/packages/licenses.js +2 -2
  249. package/dist/packages/manifest.d.ts +29 -0
  250. package/dist/packages/manifest.js +40 -4
  251. package/dist/packages/normalize.js +2 -2
  252. package/dist/packages/provenance.js +3 -3
  253. package/dist/packages/specs.js +1 -1
  254. package/dist/packages/tarball.js +4 -2
  255. package/dist/packages/types.d.ts +1 -2
  256. package/dist/paths/_internal.d.ts +1 -7
  257. package/dist/paths/_internal.js +9 -15
  258. package/dist/paths/conversion.js +1 -1
  259. package/dist/paths/dirnames.d.ts +1 -0
  260. package/dist/paths/dirnames.js +2 -0
  261. package/dist/paths/normalize.js +1 -1
  262. package/dist/paths/predicates.js +2 -1
  263. package/dist/paths/resolve.js +14 -19
  264. package/dist/paths/rewire.d.ts +5 -0
  265. package/dist/paths/socket.d.ts +137 -123
  266. package/dist/paths/socket.js +172 -131
  267. package/dist/perf/metrics.js +1 -1
  268. package/dist/perf/report.js +1 -1
  269. package/dist/primordials/process.d.ts +88 -0
  270. package/dist/primordials/process.js +132 -0
  271. package/dist/primordials/uncurry.d.ts +1 -2
  272. package/dist/process/spawn/child.js +8 -2
  273. package/dist/process/spawn/errors.js +1 -1
  274. package/dist/releases/github-archives.js +1 -1
  275. package/dist/releases/github-listing.d.ts +1 -2
  276. package/dist/schema/types.d.ts +3 -4
  277. package/dist/schema/validate.js +1 -1
  278. package/dist/secrets/broker.d.ts +35 -0
  279. package/dist/secrets/broker.js +72 -0
  280. package/dist/secrets/find.d.ts +8 -6
  281. package/dist/secrets/find.js +25 -5
  282. package/dist/secrets/keychain.d.ts +1 -1
  283. package/dist/secrets/linux.js +32 -44
  284. package/dist/secrets/macos.d.ts +1 -2
  285. package/dist/secrets/macos.js +20 -29
  286. package/dist/secrets/rc.d.ts +2 -2
  287. package/dist/secrets/rc.js +21 -13
  288. package/dist/secrets/socket-api-token.js +8 -0
  289. package/dist/secrets/windows.js +27 -33
  290. package/dist/shell/parse.d.ts +32 -0
  291. package/dist/shell/parse.js +60 -0
  292. package/dist/smol/detect.js +1 -1
  293. package/dist/smol/http.js +1 -1
  294. package/dist/smol/https.js +1 -1
  295. package/dist/smol/manifest.js +1 -1
  296. package/dist/smol/path.js +1 -1
  297. package/dist/smol/primordial.js +1 -1
  298. package/dist/smol/purl.js +1 -1
  299. package/dist/smol/versions.js +1 -1
  300. package/dist/smol/vfs.js +1 -1
  301. package/dist/sorts/_internal.d.ts +1 -2
  302. package/dist/sorts/_internal.js +2 -6
  303. package/dist/sorts/semver.js +2 -2
  304. package/dist/spinner/create-spinner-class.js +2 -2
  305. package/dist/spinner/spinner-internals.d.ts +1 -1
  306. package/dist/spinner/spinner-internals.js +9 -5
  307. package/dist/spinner/spinner.d.ts +4 -0
  308. package/dist/spinner/spinner.js +1 -1
  309. package/dist/stdio/progress.js +6 -2
  310. package/dist/stdio/prompts.d.ts +2 -10
  311. package/dist/stdio/prompts.js +11 -24
  312. package/dist/strings/format.js +1 -1
  313. package/dist/strings/search.js +1 -1
  314. package/dist/temporal/instant.js +2 -2
  315. package/dist/themes/context.d.ts +5 -3
  316. package/dist/themes/context.js +5 -6
  317. package/dist/url/assert-safe.d.ts +29 -0
  318. package/dist/url/assert-safe.js +54 -0
  319. package/dist/url/predicates.d.ts +31 -1
  320. package/dist/url/predicates.js +42 -1
  321. package/dist/url/types.d.ts +4 -0
  322. package/llms.txt +750 -0
  323. package/package.json +253 -125
@@ -18,30 +18,38 @@ const require_external_tools_synp_from_vfs = require('./from-vfs.js');
18
18
  * per option-shape.
19
19
  */
20
20
  const resolutionCache = new require_primordials_map_set.MapCtor();
21
- function cacheKey(opts) {
22
- if (!opts?.downloadIfMissing) return "local-only";
23
- const { integrity, version } = opts.downloadIfMissing;
21
+ function cacheKey(options) {
22
+ options = {
23
+ __proto__: null,
24
+ ...options
25
+ };
26
+ if (!options?.downloadIfMissing) return "local-only";
27
+ const { integrity, version } = options.downloadIfMissing;
24
28
  return `dl:${version}:${integrity ?? ""}`;
25
29
  }
26
- async function doResolveSynp(opts) {
30
+ async function doResolveSynp(options) {
31
+ options = {
32
+ __proto__: null,
33
+ ...options
34
+ };
27
35
  const fromVfs = await require_external_tools_synp_from_vfs.synpFromVfs();
28
36
  /* c8 ignore start - smol Node binary only. */
29
37
  if (fromVfs) return fromVfs;
30
38
  /* c8 ignore stop */
31
39
  const fromPath = await require_external_tools_synp_from_path.synpFromPath();
32
40
  if (fromPath) return fromPath;
33
- if (opts?.downloadIfMissing) return require_external_tools_synp_from_download.synpFromDownload(opts.downloadIfMissing);
41
+ if (options?.downloadIfMissing) return require_external_tools_synp_from_download.synpFromDownload(options.downloadIfMissing);
34
42
  }
35
43
  /* c8 ignore start - test-only escape hatch. */
36
44
  function resetSynpResolution() {
37
45
  resolutionCache.clear();
38
46
  }
39
47
  /* c8 ignore stop */
40
- function resolveSynp(opts) {
41
- const key = cacheKey(opts);
48
+ function resolveSynp(options) {
49
+ const key = cacheKey(options);
42
50
  let cached = resolutionCache.get(key);
43
51
  if (!cached) {
44
- cached = doResolveSynp(opts);
52
+ cached = doResolveSynp(options);
45
53
  resolutionCache.set(key, cached);
46
54
  }
47
55
  return cached;
@@ -31,4 +31,4 @@ export interface TrivyDownloadOptions {
31
31
  *
32
32
  * Reference: https://github.com/aquasecurity/trivy/releases.
33
33
  */
34
- export declare function getTrivyDownloadUrl(opts: TrivyDownloadOptions): string | undefined;
34
+ export declare function getTrivyDownloadUrl(options: TrivyDownloadOptions): string | undefined;
@@ -44,8 +44,11 @@ function getTrivyAssetEntry(platformArch) {
44
44
  *
45
45
  * Reference: https://github.com/aquasecurity/trivy/releases.
46
46
  */
47
- function getTrivyDownloadUrl(opts) {
48
- const { platformArch, version } = opts;
47
+ function getTrivyDownloadUrl(options) {
48
+ const { platformArch, version } = {
49
+ __proto__: null,
50
+ ...options
51
+ };
49
52
  const entry = TRIVY_ASSET_MAP[platformArch];
50
53
  if (!entry) return;
51
54
  return `https://github.com/aquasecurity/trivy/releases/download/v${version}/trivy_${version}_${entry.suffix}`;
@@ -14,4 +14,4 @@ export interface TrivyFromDownloadOptions {
14
14
  cacheDir?: string | undefined;
15
15
  downloader?: BinaryDownloader | undefined;
16
16
  }
17
- export declare function trivyFromDownload(opts: TrivyFromDownloadOptions): Promise<ResolvedTrivy | undefined>;
17
+ export declare function trivyFromDownload(options: TrivyFromDownloadOptions): Promise<ResolvedTrivy | undefined>;
@@ -5,10 +5,10 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
5
  const require_paths_socket = require('../../paths/socket.js');
6
6
  const require_external_tools_from_download = require('../from-download.js');
7
7
  const require_external_tools_trivy_asset_names = require('./asset-names.js');
8
- let node_path = require("node:path");
9
- node_path = require_runtime.__toESM(node_path);
10
8
  let node_process = require("node:process");
11
9
  node_process = require_runtime.__toESM(node_process);
10
+ let node_path = require("node:path");
11
+ node_path = require_runtime.__toESM(node_path);
12
12
 
13
13
  //#region src/external-tools/trivy/from-download.ts
14
14
  /**
@@ -17,8 +17,11 @@ node_process = require_runtime.__toESM(node_process);
17
17
  * Windows ships zip; `downloadAndExtractTool` auto-detects the format from
18
18
  * the archive name.
19
19
  */
20
- async function trivyFromDownload(opts) {
21
- const { cacheDir, downloader, integrity, platformArch, version } = opts;
20
+ async function trivyFromDownload(options) {
21
+ const { cacheDir, downloader, integrity, platformArch, version } = {
22
+ __proto__: null,
23
+ ...options
24
+ };
22
25
  const url = require_external_tools_trivy_asset_names.getTrivyDownloadUrl({
23
26
  version,
24
27
  platformArch
@@ -20,7 +20,7 @@ export interface ResolveTrivyOptions {
20
20
  downloader?: BinaryDownloader | undefined;
21
21
  } | undefined;
22
22
  }
23
- export declare function cacheKey(opts: ResolveTrivyOptions | undefined): string;
24
- export declare function doResolveTrivy(opts?: ResolveTrivyOptions | undefined): Promise<ResolvedTrivy | undefined>;
23
+ export declare function cacheKey(options: ResolveTrivyOptions | undefined): string;
24
+ export declare function doResolveTrivy(options?: ResolveTrivyOptions | undefined): Promise<ResolvedTrivy | undefined>;
25
25
  export declare function resetTrivyResolution(): void;
26
- export declare function resolveTrivy(opts?: ResolveTrivyOptions | undefined): Promise<ResolvedTrivy | undefined>;
26
+ export declare function resolveTrivy(options?: ResolveTrivyOptions | undefined): Promise<ResolvedTrivy | undefined>;
@@ -18,30 +18,38 @@ const require_external_tools_trivy_from_vfs = require('./from-vfs.js');
18
18
  * Memoized per option-shape.
19
19
  */
20
20
  const resolutionCache = new require_primordials_map_set.MapCtor();
21
- function cacheKey(opts) {
22
- if (!opts?.downloadIfMissing) return "local-only";
23
- const { cacheDir, integrity, platformArch, version } = opts.downloadIfMissing;
21
+ function cacheKey(options) {
22
+ options = {
23
+ __proto__: null,
24
+ ...options
25
+ };
26
+ if (!options?.downloadIfMissing) return "local-only";
27
+ const { cacheDir, integrity, platformArch, version } = options.downloadIfMissing;
24
28
  return `dl:${version}:${platformArch}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
25
29
  }
26
- async function doResolveTrivy(opts) {
30
+ async function doResolveTrivy(options) {
31
+ options = {
32
+ __proto__: null,
33
+ ...options
34
+ };
27
35
  const fromVfs = await require_external_tools_trivy_from_vfs.trivyFromVfs();
28
36
  /* c8 ignore start - smol Node binary only. */
29
37
  if (fromVfs) return fromVfs;
30
38
  /* c8 ignore stop */
31
39
  const fromPath = await require_external_tools_trivy_from_path.trivyFromPath();
32
40
  if (fromPath) return fromPath;
33
- if (opts?.downloadIfMissing) return require_external_tools_trivy_from_download.trivyFromDownload(opts.downloadIfMissing);
41
+ if (options?.downloadIfMissing) return require_external_tools_trivy_from_download.trivyFromDownload(options.downloadIfMissing);
34
42
  }
35
43
  /* c8 ignore start - test-only escape hatch. */
36
44
  function resetTrivyResolution() {
37
45
  resolutionCache.clear();
38
46
  }
39
47
  /* c8 ignore stop */
40
- function resolveTrivy(opts) {
41
- const key = cacheKey(opts);
48
+ function resolveTrivy(options) {
49
+ const key = cacheKey(options);
42
50
  let cached = resolutionCache.get(key);
43
51
  if (!cached) {
44
- cached = doResolveTrivy(opts);
52
+ cached = doResolveTrivy(options);
45
53
  resolutionCache.set(key, cached);
46
54
  }
47
55
  return cached;
@@ -31,4 +31,4 @@ export interface TrufflehogDownloadOptions {
31
31
  *
32
32
  * Reference: https://github.com/trufflesecurity/trufflehog/releases.
33
33
  */
34
- export declare function getTrufflehogDownloadUrl(opts: TrufflehogDownloadOptions): string | undefined;
34
+ export declare function getTrufflehogDownloadUrl(options: TrufflehogDownloadOptions): string | undefined;
@@ -47,8 +47,11 @@ function getTrufflehogAssetEntry(platformArch) {
47
47
  *
48
48
  * Reference: https://github.com/trufflesecurity/trufflehog/releases.
49
49
  */
50
- function getTrufflehogDownloadUrl(opts) {
51
- const { platformArch, version } = opts;
50
+ function getTrufflehogDownloadUrl(options) {
51
+ const { platformArch, version } = {
52
+ __proto__: null,
53
+ ...options
54
+ };
52
55
  const entry = TRUFFLEHOG_ASSET_MAP[platformArch];
53
56
  if (!entry) return;
54
57
  return `https://github.com/trufflesecurity/trufflehog/releases/download/v${version}/trufflehog_${version}_${entry.suffix}`;
@@ -34,4 +34,4 @@ export interface TrufflehogFromDownloadOptions {
34
34
  */
35
35
  downloader?: BinaryDownloader | undefined;
36
36
  }
37
- export declare function trufflehogFromDownload(opts: TrufflehogFromDownloadOptions): Promise<ResolvedTrufflehog | undefined>;
37
+ export declare function trufflehogFromDownload(options: TrufflehogFromDownloadOptions): Promise<ResolvedTrufflehog | undefined>;
@@ -5,10 +5,10 @@ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
5
  const require_paths_socket = require('../../paths/socket.js');
6
6
  const require_external_tools_from_download = require('../from-download.js');
7
7
  const require_external_tools_trufflehog_asset_names = require('./asset-names.js');
8
- let node_path = require("node:path");
9
- node_path = require_runtime.__toESM(node_path);
10
8
  let node_process = require("node:process");
11
9
  node_process = require_runtime.__toESM(node_process);
10
+ let node_path = require("node:path");
11
+ node_path = require_runtime.__toESM(node_path);
12
12
 
13
13
  //#region src/external-tools/trufflehog/from-download.ts
14
14
  /**
@@ -20,8 +20,11 @@ node_process = require_runtime.__toESM(node_process);
20
20
  * check, no network. Trust-on-first-use: pass `integrity` from
21
21
  * `external-tools.json` when available.
22
22
  */
23
- async function trufflehogFromDownload(opts) {
24
- const { cacheDir, downloader, integrity, platformArch, version } = opts;
23
+ async function trufflehogFromDownload(options) {
24
+ const { cacheDir, downloader, integrity, platformArch, version } = {
25
+ __proto__: null,
26
+ ...options
27
+ };
25
28
  const url = require_external_tools_trufflehog_asset_names.getTrufflehogDownloadUrl({
26
29
  version,
27
30
  platformArch
@@ -24,7 +24,7 @@ export interface ResolveTrufflehogOptions {
24
24
  downloader?: BinaryDownloader | undefined;
25
25
  } | undefined;
26
26
  }
27
- export declare function cacheKey(opts: ResolveTrufflehogOptions | undefined): string;
28
- export declare function doResolveTrufflehog(opts?: ResolveTrufflehogOptions | undefined): Promise<ResolvedTrufflehog | undefined>;
27
+ export declare function cacheKey(options: ResolveTrufflehogOptions | undefined): string;
28
+ export declare function doResolveTrufflehog(options?: ResolveTrufflehogOptions | undefined): Promise<ResolvedTrufflehog | undefined>;
29
29
  export declare function resetTrufflehogResolution(): void;
30
- export declare function resolveTrufflehog(opts?: ResolveTrufflehogOptions | undefined): Promise<ResolvedTrufflehog | undefined>;
30
+ export declare function resolveTrufflehog(options?: ResolveTrufflehogOptions | undefined): Promise<ResolvedTrufflehog | undefined>;
@@ -18,30 +18,38 @@ const require_external_tools_trufflehog_from_vfs = require('./from-vfs.js');
18
18
  * per option-shape; same caching semantics as `resolveJre()`.
19
19
  */
20
20
  const resolutionCache = new require_primordials_map_set.MapCtor();
21
- function cacheKey(opts) {
22
- if (!opts?.downloadIfMissing) return "local-only";
23
- const { cacheDir, integrity, platformArch, version } = opts.downloadIfMissing;
21
+ function cacheKey(options) {
22
+ options = {
23
+ __proto__: null,
24
+ ...options
25
+ };
26
+ if (!options?.downloadIfMissing) return "local-only";
27
+ const { cacheDir, integrity, platformArch, version } = options.downloadIfMissing;
24
28
  return `dl:${version}:${platformArch}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
25
29
  }
26
- async function doResolveTrufflehog(opts) {
30
+ async function doResolveTrufflehog(options) {
31
+ options = {
32
+ __proto__: null,
33
+ ...options
34
+ };
27
35
  const fromVfs = await require_external_tools_trufflehog_from_vfs.trufflehogFromVfs();
28
36
  /* c8 ignore start - smol Node binary only. */
29
37
  if (fromVfs) return fromVfs;
30
38
  /* c8 ignore stop */
31
39
  const fromPath = await require_external_tools_trufflehog_from_path.trufflehogFromPath();
32
40
  if (fromPath) return fromPath;
33
- if (opts?.downloadIfMissing) return require_external_tools_trufflehog_from_download.trufflehogFromDownload(opts.downloadIfMissing);
41
+ if (options?.downloadIfMissing) return require_external_tools_trufflehog_from_download.trufflehogFromDownload(options.downloadIfMissing);
34
42
  }
35
43
  /* c8 ignore start - test-only escape hatch. */
36
44
  function resetTrufflehogResolution() {
37
45
  resolutionCache.clear();
38
46
  }
39
47
  /* c8 ignore stop */
40
- function resolveTrufflehog(opts) {
41
- const key = cacheKey(opts);
48
+ function resolveTrufflehog(options) {
49
+ const key = cacheKey(options);
42
50
  let cached = resolutionCache.get(key);
43
51
  if (!cached) {
44
- cached = doResolveTrufflehog(opts);
52
+ cached = doResolveTrufflehog(options);
45
53
  resolutionCache.set(key, cached);
46
54
  }
47
55
  return cached;
@@ -0,0 +1,36 @@
1
+ /**
2
+ * @file Upstream uv release asset-name mapping per `platform-arch`. uv
3
+ * publishes per-platform archives under
4
+ * https://github.com/astral-sh/uv/releases/download/<X.Y.Z>/. The release tag
5
+ * is the bare semver (no `v` prefix), unlike most upstream projects. Each
6
+ * archive wraps the binary one directory deep (`uv-<triple>/uv[.exe]`), so
7
+ * callers should pass `strip: 1` to the extractor — or, equivalently, look up
8
+ * the binary inside the archive's stem directory.
9
+ */
10
+ export interface UvAssetEntry {
11
+ /**
12
+ * Full asset filename (no version interpolation — uv asset names are
13
+ * version-free).
14
+ */
15
+ readonly asset: string;
16
+ }
17
+ export declare const UV_ASSET_MAP: Readonly<Record<string, UvAssetEntry>>;
18
+ export declare function getUvAssetEntry(platformArch: string): UvAssetEntry | undefined;
19
+ export interface UvDownloadOptions {
20
+ /**
21
+ * Uv release version, e.g. `'0.10.11'` (no `v` prefix — astral-sh/uv tags
22
+ * releases as bare semver).
23
+ */
24
+ version: string;
25
+ /**
26
+ * Fleet platform-arch token — looked up in `UV_ASSET_MAP`.
27
+ */
28
+ platformArch: string;
29
+ }
30
+ /**
31
+ * Build the GitHub release-asset download URL for an upstream uv binary.
32
+ * Returns `undefined` when no entry exists for the requested platform-arch.
33
+ *
34
+ * Reference: https://github.com/astral-sh/uv/releases.
35
+ */
36
+ export declare function getUvDownloadUrl(options: UvDownloadOptions): string | undefined;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with rolldown */
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_primordials_object = require('../../primordials/object.js');
5
+
6
+ //#region src/external-tools/uv/asset-names.ts
7
+ /**
8
+ * @file Upstream uv release asset-name mapping per `platform-arch`. uv
9
+ * publishes per-platform archives under
10
+ * https://github.com/astral-sh/uv/releases/download/<X.Y.Z>/. The release tag
11
+ * is the bare semver (no `v` prefix), unlike most upstream projects. Each
12
+ * archive wraps the binary one directory deep (`uv-<triple>/uv[.exe]`), so
13
+ * callers should pass `strip: 1` to the extractor — or, equivalently, look up
14
+ * the binary inside the archive's stem directory.
15
+ */
16
+ const UV_ASSET_MAP = require_primordials_object.ObjectFreeze({
17
+ __proto__: null,
18
+ "darwin-arm64": require_primordials_object.ObjectFreeze({
19
+ __proto__: null,
20
+ asset: "uv-aarch64-apple-darwin.tar.gz"
21
+ }),
22
+ "darwin-x64": require_primordials_object.ObjectFreeze({
23
+ __proto__: null,
24
+ asset: "uv-x86_64-apple-darwin.tar.gz"
25
+ }),
26
+ "linux-arm64": require_primordials_object.ObjectFreeze({
27
+ __proto__: null,
28
+ asset: "uv-aarch64-unknown-linux-gnu.tar.gz"
29
+ }),
30
+ "linux-arm64-musl": require_primordials_object.ObjectFreeze({
31
+ __proto__: null,
32
+ asset: "uv-aarch64-unknown-linux-musl.tar.gz"
33
+ }),
34
+ "linux-x64": require_primordials_object.ObjectFreeze({
35
+ __proto__: null,
36
+ asset: "uv-x86_64-unknown-linux-gnu.tar.gz"
37
+ }),
38
+ "linux-x64-musl": require_primordials_object.ObjectFreeze({
39
+ __proto__: null,
40
+ asset: "uv-x86_64-unknown-linux-musl.tar.gz"
41
+ }),
42
+ "win-arm64": require_primordials_object.ObjectFreeze({
43
+ __proto__: null,
44
+ asset: "uv-aarch64-pc-windows-msvc.zip"
45
+ }),
46
+ "win-x64": require_primordials_object.ObjectFreeze({
47
+ __proto__: null,
48
+ asset: "uv-x86_64-pc-windows-msvc.zip"
49
+ })
50
+ });
51
+ function getUvAssetEntry(platformArch) {
52
+ return UV_ASSET_MAP[platformArch];
53
+ }
54
+ /**
55
+ * Build the GitHub release-asset download URL for an upstream uv binary.
56
+ * Returns `undefined` when no entry exists for the requested platform-arch.
57
+ *
58
+ * Reference: https://github.com/astral-sh/uv/releases.
59
+ */
60
+ function getUvDownloadUrl(options) {
61
+ const { platformArch, version } = {
62
+ __proto__: null,
63
+ ...options
64
+ };
65
+ const entry = UV_ASSET_MAP[platformArch];
66
+ if (!entry) return;
67
+ return `https://github.com/astral-sh/uv/releases/download/${version}/` + entry.asset;
68
+ }
69
+
70
+ //#endregion
71
+ exports.UV_ASSET_MAP = UV_ASSET_MAP;
72
+ exports.getUvAssetEntry = getUvAssetEntry;
73
+ exports.getUvDownloadUrl = getUvDownloadUrl;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @file `uvFromDownload()` — fetches upstream uv and returns a `ResolvedUv`
3
+ * pointing at the extracted binary. uv tarballs wrap the binary in a
4
+ * `<asset-stem>/` directory; the extractor strips that level so the binary
5
+ * sits at the cache-dir root.
6
+ */
7
+ import type { BinaryDownloader } from '../from-download';
8
+ import type { HashSpec } from '../../integrity';
9
+ import type { ResolvedUv } from './types';
10
+ export interface UvFromDownloadOptions {
11
+ version: string;
12
+ platformArch: string;
13
+ integrity?: HashSpec | undefined;
14
+ cacheDir?: string | undefined;
15
+ downloader?: BinaryDownloader | undefined;
16
+ }
17
+ export declare function uvFromDownload(options: UvFromDownloadOptions): Promise<ResolvedUv | undefined>;
@@ -0,0 +1,50 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with rolldown */
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
+ const require_paths_socket = require('../../paths/socket.js');
6
+ const require_external_tools_from_download = require('../from-download.js');
7
+ const require_external_tools_uv_asset_names = require('./asset-names.js');
8
+ let node_process = require("node:process");
9
+ node_process = require_runtime.__toESM(node_process);
10
+ let node_path = require("node:path");
11
+ node_path = require_runtime.__toESM(node_path);
12
+
13
+ //#region src/external-tools/uv/from-download.ts
14
+ /**
15
+ * @file `uvFromDownload()` — fetches upstream uv and returns a `ResolvedUv`
16
+ * pointing at the extracted binary. uv tarballs wrap the binary in a
17
+ * `<asset-stem>/` directory; the extractor strips that level so the binary
18
+ * sits at the cache-dir root.
19
+ */
20
+ async function uvFromDownload(options) {
21
+ const { cacheDir, downloader, integrity, platformArch, version } = {
22
+ __proto__: null,
23
+ ...options
24
+ };
25
+ const url = require_external_tools_uv_asset_names.getUvDownloadUrl({
26
+ version,
27
+ platformArch
28
+ });
29
+ const entry = require_external_tools_uv_asset_names.getUvAssetEntry(platformArch);
30
+ if (!url || !entry) return;
31
+ const archiveExt = entry.asset.endsWith(".zip") ? ".zip" : ".tar.gz";
32
+ const extractedDir = cacheDir ?? node_path.default.join(require_paths_socket.getSocketDlxDir(), "uv", version, platformArch);
33
+ const archive = await require_external_tools_from_download.downloadAndExtractTool({
34
+ url,
35
+ name: `uv-${version}-${platformArch}${archiveExt}`,
36
+ integrity,
37
+ extractedDir,
38
+ extractOptions: { strip: 1 },
39
+ downloader
40
+ });
41
+ const binary = node_process.default.platform === "win32" ? "uv.exe" : "uv";
42
+ return {
43
+ path: node_path.default.join(extractedDir, binary),
44
+ source: "download",
45
+ integrity: archive.integrity
46
+ };
47
+ }
48
+
49
+ //#endregion
50
+ exports.uvFromDownload = uvFromDownload;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * @file `uvFromPath()` — looks for `uv` on the system PATH.
3
+ */
4
+ import type { ResolvedUv } from './types';
5
+ export declare function uvFromPath(): Promise<ResolvedUv | undefined>;
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with rolldown */
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_bin_which = require('../../bin/which.js');
5
+
6
+ //#region src/external-tools/uv/from-path.ts
7
+ /**
8
+ * @file `uvFromPath()` — looks for `uv` on the system PATH.
9
+ */
10
+ async function uvFromPath() {
11
+ const onPath = await require_bin_which.which("uv", { nothrow: true });
12
+ /* c8 ignore start - reached only when uv is NOT on PATH. */
13
+ if (typeof onPath !== "string") return;
14
+ /* c8 ignore stop */
15
+ return {
16
+ path: onPath,
17
+ source: "path"
18
+ };
19
+ }
20
+
21
+ //#endregion
22
+ exports.uvFromPath = uvFromPath;
@@ -0,0 +1,7 @@
1
+ /**
2
+ * @file `uvFromVfs()` — extracts the uv binary from the smol binary's VFS.
3
+ * Returns `undefined` when the binary doesn't have uv bundled.
4
+ */
5
+ import type { ResolvedUv } from './types';
6
+ export declare const UV_VFS_KEY = "uv";
7
+ export declare function uvFromVfs(): Promise<ResolvedUv | undefined>;
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with rolldown */
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_smol_vfs = require('../../smol/vfs.js');
5
+
6
+ //#region src/external-tools/uv/from-vfs.ts
7
+ /**
8
+ * @file `uvFromVfs()` — extracts the uv binary from the smol binary's VFS.
9
+ * Returns `undefined` when the binary doesn't have uv bundled.
10
+ */
11
+ const UV_VFS_KEY = "uv";
12
+ async function uvFromVfs() {
13
+ const vfs = require_smol_vfs.getSmolVfs();
14
+ if (!vfs) return;
15
+ /* c8 ignore start - smol Node binary only. */
16
+ if (!vfs.has("uv")) return;
17
+ return {
18
+ path: await vfs.extract("uv"),
19
+ source: "vfs"
20
+ };
21
+ /* c8 ignore stop */
22
+ }
23
+
24
+ //#endregion
25
+ exports.UV_VFS_KEY = UV_VFS_KEY;
26
+ exports.uvFromVfs = uvFromVfs;
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @file `resolveUv()` — uv resolution entry point. Tries each source in order:
3
+ *
4
+ * 1. VFS — smol binary's embedded uv (if packed)
5
+ * 2. PATH — `uv` on the system PATH
6
+ * 3. download — upstream GitHub release archive (only when `downloadIfMissing`
7
+ * is passed) Returns `undefined` if all of the enabled sources miss.
8
+ * Memoized per option-shape.
9
+ */
10
+ import type { BinaryDownloader } from '../from-download';
11
+ import type { HashSpec } from '../../integrity';
12
+ import type { ResolvedUv } from './types';
13
+ export interface ResolveUvOptions {
14
+ downloadIfMissing?: {
15
+ version: string;
16
+ platformArch: string;
17
+ integrity?: HashSpec | undefined;
18
+ cacheDir?: string | undefined;
19
+ downloader?: BinaryDownloader | undefined;
20
+ } | undefined;
21
+ }
22
+ export declare function cacheKey(options: ResolveUvOptions | undefined): string;
23
+ export declare function doResolveUv(options?: ResolveUvOptions | undefined): Promise<ResolvedUv | undefined>;
24
+ export declare function resetUvResolution(): void;
25
+ export declare function resolveUv(options?: ResolveUvOptions | undefined): Promise<ResolvedUv | undefined>;
@@ -0,0 +1,61 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with rolldown */
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_primordials_map_set = require('../../primordials/map-set.js');
5
+ const require_external_tools_uv_from_download = require('./from-download.js');
6
+ const require_external_tools_uv_from_path = require('./from-path.js');
7
+ const require_external_tools_uv_from_vfs = require('./from-vfs.js');
8
+
9
+ //#region src/external-tools/uv/resolve.ts
10
+ /**
11
+ * @file `resolveUv()` — uv resolution entry point. Tries each source in order:
12
+ *
13
+ * 1. VFS — smol binary's embedded uv (if packed)
14
+ * 2. PATH — `uv` on the system PATH
15
+ * 3. download — upstream GitHub release archive (only when `downloadIfMissing`
16
+ * is passed) Returns `undefined` if all of the enabled sources miss.
17
+ * Memoized per option-shape.
18
+ */
19
+ const resolutionCache = new require_primordials_map_set.MapCtor();
20
+ function cacheKey(options) {
21
+ const opts = {
22
+ __proto__: null,
23
+ ...options
24
+ };
25
+ if (!opts?.downloadIfMissing) return "local-only";
26
+ const { cacheDir, integrity, platformArch, version } = opts.downloadIfMissing;
27
+ return `dl:${version}:${platformArch}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
28
+ }
29
+ async function doResolveUv(options) {
30
+ const opts = {
31
+ __proto__: null,
32
+ ...options
33
+ };
34
+ const fromVfs = await require_external_tools_uv_from_vfs.uvFromVfs();
35
+ /* c8 ignore start - smol Node binary only. */
36
+ if (fromVfs) return fromVfs;
37
+ /* c8 ignore stop */
38
+ const fromPath = await require_external_tools_uv_from_path.uvFromPath();
39
+ if (fromPath) return fromPath;
40
+ if (opts?.downloadIfMissing) return require_external_tools_uv_from_download.uvFromDownload(opts.downloadIfMissing);
41
+ }
42
+ /* c8 ignore start - test-only escape hatch. */
43
+ function resetUvResolution() {
44
+ resolutionCache.clear();
45
+ }
46
+ /* c8 ignore stop */
47
+ function resolveUv(options) {
48
+ const key = cacheKey(options);
49
+ let cached = resolutionCache.get(key);
50
+ if (!cached) {
51
+ cached = doResolveUv(options);
52
+ resolutionCache.set(key, cached);
53
+ }
54
+ return cached;
55
+ }
56
+
57
+ //#endregion
58
+ exports.cacheKey = cacheKey;
59
+ exports.doResolveUv = doResolveUv;
60
+ exports.resetUvResolution = resetUvResolution;
61
+ exports.resolveUv = resolveUv;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * @file Shared types for uv resolution. uv is Astral's Python package manager
3
+ * used by socket-basics for Python project bootstrap. Ships per-platform
4
+ * archives that wrap the `uv` binary one level deep.
5
+ */
6
+ import type { ResolvedToolIntegrity } from '../from-download';
7
+ export type UvSource = 'download' | 'path' | 'vfs';
8
+ /**
9
+ * A resolved uv installation.
10
+ */
11
+ export interface ResolvedUv {
12
+ /**
13
+ * Absolute path to the `uv` executable.
14
+ */
15
+ readonly path: string;
16
+ /**
17
+ * Which resolver tier found this.
18
+ */
19
+ readonly source: UvSource;
20
+ /**
21
+ * See {@link ResolvedToolIntegrity}.
22
+ */
23
+ readonly integrity?: ResolvedToolIntegrity | undefined;
24
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with rolldown */