@socketsecurity/lib 6.0.7 → 6.0.8

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 (263) hide show
  1. package/CHANGELOG.md +20 -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 +69 -0
  18. package/dist/ai/route.js +156 -0
  19. package/dist/ai/spawn.d.mts +10 -2
  20. package/dist/ai/spawn.js +55 -31
  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 +15 -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 +3915 -3781
  34. package/dist/bin/resolve.js +1 -1
  35. package/dist/cache/ttl/store.js +1 -1
  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 +6 -2
  41. package/dist/compression/gzip.js +6 -2
  42. package/dist/constants/packages.d.ts +3 -0
  43. package/dist/constants/packages.js +2 -1
  44. package/dist/constants/socket.d.ts +2 -6
  45. package/dist/constants/socket.js +12 -14
  46. package/dist/cover/code.js +2 -2
  47. package/dist/crypto/hash.d.ts +4 -1
  48. package/dist/crypto/hash.js +4 -1
  49. package/dist/debug/caller-info.js +1 -1
  50. package/dist/dlx/arborist.js +13 -3
  51. package/dist/dlx/binary-cache.js +1 -1
  52. package/dist/dlx/binary-resolution.js +1 -1
  53. package/dist/dlx/detect.d.ts +8 -0
  54. package/dist/dlx/firewall.d.ts +8 -0
  55. package/dist/dlx/firewall.js +1 -1
  56. package/dist/dlx/lockfile.js +4 -1
  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 +1 -1
  71. package/dist/env/proxy.js +1 -1
  72. package/dist/env/rewire.d.ts +1 -0
  73. package/dist/env/rewire.js +1 -1
  74. package/dist/env/socket.d.ts +7 -0
  75. package/dist/env/socket.js +10 -0
  76. package/dist/errors/predicates.js +1 -1
  77. package/dist/external/@npmcli/promise-spawn.js +3 -1
  78. package/dist/external/pico-pack.js +4 -2
  79. package/dist/external/which.js +3 -1
  80. package/dist/external-tools/bazel/asset-names.d.ts +1 -1
  81. package/dist/external-tools/bazel/asset-names.js +5 -2
  82. package/dist/external-tools/bazel/from-download.d.ts +1 -1
  83. package/dist/external-tools/bazel/from-download.js +5 -2
  84. package/dist/external-tools/bazel/resolve-bazel-version.js +4 -0
  85. package/dist/external-tools/bazel/resolve.d.ts +3 -3
  86. package/dist/external-tools/bazel/resolve.js +16 -8
  87. package/dist/external-tools/cdxgen/asset-names.d.ts +1 -1
  88. package/dist/external-tools/cdxgen/asset-names.js +5 -2
  89. package/dist/external-tools/cdxgen/from-download.d.ts +1 -1
  90. package/dist/external-tools/cdxgen/from-download.js +7 -4
  91. package/dist/external-tools/cdxgen/resolve.d.ts +3 -3
  92. package/dist/external-tools/cdxgen/resolve.js +16 -8
  93. package/dist/external-tools/from-download.d.ts +2 -2
  94. package/dist/external-tools/from-download.js +11 -5
  95. package/dist/external-tools/from-pip-venv.d.ts +1 -1
  96. package/dist/external-tools/from-pip-venv.js +12 -5
  97. package/dist/external-tools/janus/asset-names.d.ts +1 -1
  98. package/dist/external-tools/janus/asset-names.js +5 -2
  99. package/dist/external-tools/janus/from-download.d.ts +1 -1
  100. package/dist/external-tools/janus/from-download.js +5 -2
  101. package/dist/external-tools/janus/resolve.d.ts +3 -3
  102. package/dist/external-tools/janus/resolve.js +16 -8
  103. package/dist/external-tools/jre/asset-names.d.ts +1 -1
  104. package/dist/external-tools/jre/asset-names.js +5 -2
  105. package/dist/external-tools/jre/from-download.d.ts +1 -1
  106. package/dist/external-tools/jre/from-download.js +7 -4
  107. package/dist/external-tools/jre/from-java-home.js +2 -2
  108. package/dist/external-tools/jre/from-vfs.js +2 -2
  109. package/dist/external-tools/jre/resolve.d.ts +3 -3
  110. package/dist/external-tools/jre/resolve.js +16 -8
  111. package/dist/external-tools/manifest.d.ts +18 -0
  112. package/dist/external-tools/manifest.js +1 -1
  113. package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
  114. package/dist/external-tools/opengrep/asset-names.js +5 -2
  115. package/dist/external-tools/opengrep/from-download.d.ts +1 -1
  116. package/dist/external-tools/opengrep/from-download.js +5 -2
  117. package/dist/external-tools/opengrep/resolve.d.ts +3 -3
  118. package/dist/external-tools/opengrep/resolve.js +16 -8
  119. package/dist/external-tools/python/asset-names.d.ts +1 -1
  120. package/dist/external-tools/python/asset-names.js +10 -3
  121. package/dist/external-tools/python/dlx.d.ts +3 -3
  122. package/dist/external-tools/python/dlx.js +20 -9
  123. package/dist/external-tools/python/from-download.d.ts +1 -1
  124. package/dist/external-tools/python/from-download.js +12 -5
  125. package/dist/external-tools/python/pin.js +6 -3
  126. package/dist/external-tools/python/pip-install.js +6 -3
  127. package/dist/external-tools/python/resolve.d.ts +3 -3
  128. package/dist/external-tools/python/resolve.js +19 -11
  129. package/dist/external-tools/sbt/asset-names.d.ts +1 -1
  130. package/dist/external-tools/sbt/asset-names.js +5 -2
  131. package/dist/external-tools/sbt/from-download.d.ts +1 -1
  132. package/dist/external-tools/sbt/from-download.js +5 -2
  133. package/dist/external-tools/sbt/resolve.d.ts +3 -3
  134. package/dist/external-tools/sbt/resolve.js +16 -8
  135. package/dist/external-tools/skillspector/from-dlx.d.ts +1 -1
  136. package/dist/external-tools/skillspector/from-dlx.js +10 -3
  137. package/dist/external-tools/skillspector/resolve.d.ts +2 -2
  138. package/dist/external-tools/skillspector/resolve.js +14 -6
  139. package/dist/external-tools/synp/asset-names.d.ts +1 -1
  140. package/dist/external-tools/synp/asset-names.js +6 -2
  141. package/dist/external-tools/synp/from-download.d.ts +1 -1
  142. package/dist/external-tools/synp/from-download.js +5 -2
  143. package/dist/external-tools/synp/resolve.d.ts +3 -3
  144. package/dist/external-tools/synp/resolve.js +16 -8
  145. package/dist/external-tools/trivy/asset-names.d.ts +1 -1
  146. package/dist/external-tools/trivy/asset-names.js +5 -2
  147. package/dist/external-tools/trivy/from-download.d.ts +1 -1
  148. package/dist/external-tools/trivy/from-download.js +7 -4
  149. package/dist/external-tools/trivy/resolve.d.ts +3 -3
  150. package/dist/external-tools/trivy/resolve.js +16 -8
  151. package/dist/external-tools/trufflehog/asset-names.d.ts +1 -1
  152. package/dist/external-tools/trufflehog/asset-names.js +5 -2
  153. package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
  154. package/dist/external-tools/trufflehog/from-download.js +7 -4
  155. package/dist/external-tools/trufflehog/resolve.d.ts +3 -3
  156. package/dist/external-tools/trufflehog/resolve.js +16 -8
  157. package/dist/fs/allowed-dirs-cache.d.ts +27 -1
  158. package/dist/fs/allowed-dirs-cache.js +38 -3
  159. package/dist/fs/find.js +1 -1
  160. package/dist/fs/read-json-cache.d.ts +7 -0
  161. package/dist/fs/resolve-module.js +6 -2
  162. package/dist/fs/safe.js +1 -1
  163. package/dist/git/_internal.js +2 -2
  164. package/dist/git/repo.js +2 -4
  165. package/dist/git/staged.js +8 -0
  166. package/dist/git/tracked.d.ts +84 -0
  167. package/dist/git/tracked.js +163 -0
  168. package/dist/git/unstaged.js +8 -0
  169. package/dist/github/refs-graphql.js +4 -0
  170. package/dist/github/refs-rest.js +4 -0
  171. package/dist/github/refs.js +15 -10
  172. package/dist/globs/_internal.js +1 -1
  173. package/dist/globs/match.js +9 -1
  174. package/dist/globs/matcher.js +5 -1
  175. package/dist/http-request/browser.js +6 -2
  176. package/dist/http-request/{browser-fetch.d.ts → fetch/browser.d.ts} +2 -2
  177. package/dist/http-request/{browser-fetch.js → fetch/browser.js} +4 -4
  178. package/dist/http-request/headers.js +1 -1
  179. package/dist/http-request/request-attempt.js +2 -2
  180. package/dist/http-request/user-agent.js +1 -1
  181. package/dist/integrity.d.ts +10 -4
  182. package/dist/integrity.js +10 -4
  183. package/dist/json/edit.js +38 -30
  184. package/dist/json/format.js +1 -1
  185. package/dist/native-messaging/install.d.ts +1 -1
  186. package/dist/native-messaging/install.js +7 -4
  187. package/dist/native-messaging/rate-limit.d.ts +7 -0
  188. package/dist/native-messaging/rate-limit.js +4 -0
  189. package/dist/node/async-hooks.js +1 -1
  190. package/dist/node/child-process.js +1 -1
  191. package/dist/node/crypto.js +1 -1
  192. package/dist/node/events.js +1 -1
  193. package/dist/node/fs-promises.js +1 -1
  194. package/dist/node/fs.d.ts +22 -6
  195. package/dist/node/fs.js +16 -3
  196. package/dist/node/http.js +1 -1
  197. package/dist/node/https.js +1 -1
  198. package/dist/node/module.js +1 -1
  199. package/dist/node/os.d.ts +10 -2
  200. package/dist/node/os.js +11 -4
  201. package/dist/node/path.d.ts +11 -2
  202. package/dist/node/path.js +17 -4
  203. package/dist/node/timers-promises.js +1 -1
  204. package/dist/node/url.js +1 -1
  205. package/dist/node/util.js +1 -1
  206. package/dist/objects/getters.js +1 -1
  207. package/dist/objects/mutate.js +2 -2
  208. package/dist/objects/predicates.js +1 -1
  209. package/dist/packages/edit-class.d.ts +2 -3
  210. package/dist/packages/edit-class.js +41 -35
  211. package/dist/packages/exports.js +4 -4
  212. package/dist/packages/fetch.js +1 -1
  213. package/dist/packages/isolation.js +1 -1
  214. package/dist/packages/licenses.js +2 -2
  215. package/dist/packages/manifest.js +4 -4
  216. package/dist/packages/normalize.js +1 -1
  217. package/dist/packages/provenance.js +2 -2
  218. package/dist/packages/specs.js +1 -1
  219. package/dist/packages/tarball.js +4 -2
  220. package/dist/packages/types.d.ts +1 -2
  221. package/dist/paths/dirnames.d.ts +1 -0
  222. package/dist/paths/dirnames.js +2 -0
  223. package/dist/paths/resolve.js +14 -19
  224. package/dist/paths/rewire.d.ts +5 -0
  225. package/dist/paths/socket.d.ts +74 -111
  226. package/dist/paths/socket.js +99 -132
  227. package/dist/primordials/process.d.ts +88 -0
  228. package/dist/primordials/process.js +132 -0
  229. package/dist/primordials/uncurry.d.ts +1 -2
  230. package/dist/process/spawn/child.js +8 -2
  231. package/dist/process/spawn/errors.js +1 -1
  232. package/dist/regexps/spec.js +1 -1
  233. package/dist/releases/github-archives.js +1 -1
  234. package/dist/releases/github-listing.d.ts +1 -2
  235. package/dist/schema/types.d.ts +3 -4
  236. package/dist/schema/validate.js +1 -1
  237. package/dist/secrets/find.d.ts +2 -2
  238. package/dist/secrets/find.js +10 -4
  239. package/dist/secrets/keychain.d.ts +1 -1
  240. package/dist/secrets/linux.js +32 -44
  241. package/dist/secrets/macos.d.ts +1 -2
  242. package/dist/secrets/macos.js +20 -29
  243. package/dist/secrets/rc.d.ts +2 -2
  244. package/dist/secrets/rc.js +21 -13
  245. package/dist/secrets/socket-api-token.js +8 -0
  246. package/dist/secrets/windows.js +27 -33
  247. package/dist/shell/parse.d.ts +32 -0
  248. package/dist/shell/parse.js +60 -0
  249. package/dist/spinner/create-spinner-class.js +2 -2
  250. package/dist/spinner/spinner-internals.d.ts +1 -1
  251. package/dist/spinner/spinner-internals.js +9 -5
  252. package/dist/spinner/spinner.d.ts +4 -0
  253. package/dist/spinner/spinner.js +1 -1
  254. package/dist/stdio/progress.js +5 -1
  255. package/dist/stdio/prompts.d.ts +2 -2
  256. package/dist/stdio/prompts.js +1 -1
  257. package/dist/temporal/instant.js +2 -2
  258. package/dist/url/assert-safe.d.ts +29 -0
  259. package/dist/url/assert-safe.js +54 -0
  260. package/dist/url/predicates.d.ts +31 -1
  261. package/dist/url/predicates.js +42 -1
  262. package/dist/url/types.d.ts +4 -0
  263. package/package.json +177 -115
@@ -20,30 +20,38 @@ const require_external_tools_janus_from_vfs = require('./from-vfs.js');
20
20
  * only). Memoized per option-shape.
21
21
  */
22
22
  const resolutionCache = new require_primordials_map_set.MapCtor();
23
- function cacheKey(opts) {
24
- if (!opts?.downloadIfMissing) return "local-only";
25
- const { cacheDir, integrity, platformArch, version } = opts.downloadIfMissing;
23
+ function cacheKey(options) {
24
+ options = {
25
+ __proto__: null,
26
+ ...options
27
+ };
28
+ if (!options?.downloadIfMissing) return "local-only";
29
+ const { cacheDir, integrity, platformArch, version } = options.downloadIfMissing;
26
30
  return `dl:${version}:${platformArch}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
27
31
  }
28
- async function doResolveJanus(opts) {
32
+ async function doResolveJanus(options) {
33
+ options = {
34
+ __proto__: null,
35
+ ...options
36
+ };
29
37
  const fromVfs = await require_external_tools_janus_from_vfs.janusFromVfs();
30
38
  /* c8 ignore start - smol Node binary only. */
31
39
  if (fromVfs) return fromVfs;
32
40
  /* c8 ignore stop */
33
41
  const fromPath = await require_external_tools_janus_from_path.janusFromPath();
34
42
  if (fromPath) return fromPath;
35
- if (opts?.downloadIfMissing) return require_external_tools_janus_from_download.janusFromDownload(opts.downloadIfMissing);
43
+ if (options?.downloadIfMissing) return require_external_tools_janus_from_download.janusFromDownload(options.downloadIfMissing);
36
44
  }
37
45
  /* c8 ignore start - test-only escape hatch. */
38
46
  function resetJanusResolution() {
39
47
  resolutionCache.clear();
40
48
  }
41
49
  /* c8 ignore stop */
42
- function resolveJanus(opts) {
43
- const key = cacheKey(opts);
50
+ function resolveJanus(options) {
51
+ const key = cacheKey(options);
44
52
  let cached = resolutionCache.get(key);
45
53
  if (!cached) {
46
- cached = doResolveJanus(opts);
54
+ cached = doResolveJanus(options);
47
55
  resolutionCache.set(key, cached);
48
56
  }
49
57
  return cached;
@@ -83,7 +83,7 @@ export interface AdoptiumDownloadOptions {
83
83
  * })
84
84
  * ```
85
85
  */
86
- export declare function getAdoptiumDownloadUrl(opts: AdoptiumDownloadOptions): string | undefined;
86
+ export declare function getAdoptiumDownloadUrl(options: AdoptiumDownloadOptions): string | undefined;
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.
@@ -95,8 +95,11 @@ const ADOPTIUM_QUERY_MAP = require_primordials_object.ObjectFreeze({
95
95
  * })
96
96
  * ```
97
97
  */
98
- function getAdoptiumDownloadUrl(opts) {
99
- const { platformArch, releaseType = "ga", type = "jre", version } = opts;
98
+ function getAdoptiumDownloadUrl(options) {
99
+ const { platformArch, releaseType = "ga", type = "jre", version } = {
100
+ __proto__: null,
101
+ ...options
102
+ };
100
103
  const query = ADOPTIUM_QUERY_MAP[platformArch];
101
104
  if (!query) return;
102
105
  return `https://api.adoptium.net/v3/binary/latest/${version}/${releaseType}/${query.os}/${query.architecture}/${type}/hotspot/normal/eclipse`;
@@ -59,4 +59,4 @@ export interface JreFromDownloadOptions {
59
59
  * // → { javaPath: '/.../bin/java', javaHome: '/...', source: 'download' }
60
60
  * ```
61
61
  */
62
- export declare function jreFromDownload(opts: JreFromDownloadOptions): Promise<ResolvedJre | undefined>;
62
+ export declare function jreFromDownload(options: JreFromDownloadOptions): Promise<ResolvedJre | undefined>;
@@ -6,10 +6,10 @@ const require_primordials_string = require('../../primordials/string.js');
6
6
  const require_paths_socket = require('../../paths/socket.js');
7
7
  const require_external_tools_from_download = require('../from-download.js');
8
8
  const require_external_tools_jre_asset_names = require('./asset-names.js');
9
- let node_path = require("node:path");
10
- node_path = require_runtime.__toESM(node_path);
11
9
  let node_process = require("node:process");
12
10
  node_process = require_runtime.__toESM(node_process);
11
+ let node_path = require("node:path");
12
+ node_path = require_runtime.__toESM(node_path);
13
13
 
14
14
  //#region src/external-tools/jre/from-download.ts
15
15
  /**
@@ -44,8 +44,11 @@ node_process = require_runtime.__toESM(node_process);
44
44
  * // → { javaPath: '/.../bin/java', javaHome: '/...', source: 'download' }
45
45
  * ```
46
46
  */
47
- async function jreFromDownload(opts) {
48
- const { cacheDir, downloader, integrity, platformArch, version } = opts;
47
+ async function jreFromDownload(options) {
48
+ const { cacheDir, downloader, integrity, platformArch, version } = {
49
+ __proto__: null,
50
+ ...options
51
+ };
49
52
  const url = require_external_tools_jre_asset_names.getAdoptiumDownloadUrl({
50
53
  version,
51
54
  platformArch
@@ -2,10 +2,10 @@
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
- let node_path = require("node:path");
6
- node_path = require_runtime.__toESM(node_path);
7
5
  let node_process = require("node:process");
8
6
  node_process = require_runtime.__toESM(node_process);
7
+ let node_path = require("node:path");
8
+ node_path = require_runtime.__toESM(node_path);
9
9
 
10
10
  //#region src/external-tools/jre/from-java-home.ts
11
11
  /**
@@ -3,10 +3,10 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_runtime = require('../../_virtual/_rolldown/runtime.js');
5
5
  const require_smol_vfs = require('../../smol/vfs.js');
6
- let node_path = require("node:path");
7
- node_path = require_runtime.__toESM(node_path);
8
6
  let node_process = require("node:process");
9
7
  node_process = require_runtime.__toESM(node_process);
8
+ let node_path = require("node:path");
9
+ node_path = require_runtime.__toESM(node_path);
10
10
 
11
11
  //#region src/external-tools/jre/from-vfs.ts
12
12
  /**
@@ -34,7 +34,7 @@ export interface ResolveJreOptions {
34
34
  downloader?: BinaryDownloader | undefined;
35
35
  } | undefined;
36
36
  }
37
- export declare function cacheKey(opts: ResolveJreOptions | undefined): string;
38
- export declare function doResolveJre(opts?: ResolveJreOptions | undefined): Promise<ResolvedJre | undefined>;
37
+ export declare function cacheKey(options: ResolveJreOptions | undefined): string;
38
+ export declare function doResolveJre(options?: ResolveJreOptions | undefined): Promise<ResolvedJre | undefined>;
39
39
  export declare function resetJreResolution(): void;
40
- export declare function resolveJre(opts?: ResolveJreOptions | undefined): Promise<ResolvedJre | undefined>;
40
+ export declare function resolveJre(options?: ResolveJreOptions | undefined): Promise<ResolvedJre | undefined>;
@@ -28,12 +28,20 @@ const require_external_tools_jre_from_vfs = require('./from-vfs.js');
28
28
  * resolver fresh.
29
29
  */
30
30
  const resolutionCache = new require_primordials_map_set.MapCtor();
31
- function cacheKey(opts) {
32
- if (!opts?.downloadIfMissing) return "local-only";
33
- const { cacheDir, integrity, platformArch, version } = opts.downloadIfMissing;
31
+ function cacheKey(options) {
32
+ options = {
33
+ __proto__: null,
34
+ ...options
35
+ };
36
+ if (!options?.downloadIfMissing) return "local-only";
37
+ const { cacheDir, integrity, platformArch, version } = options.downloadIfMissing;
34
38
  return `dl:${version}:${platformArch}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
35
39
  }
36
- async function doResolveJre(opts) {
40
+ async function doResolveJre(options) {
41
+ options = {
42
+ __proto__: null,
43
+ ...options
44
+ };
37
45
  const fromVfs = await require_external_tools_jre_from_vfs.jreFromVfs();
38
46
  /* c8 ignore start - smol Node binary only. */
39
47
  if (fromVfs) return fromVfs;
@@ -42,18 +50,18 @@ async function doResolveJre(opts) {
42
50
  if (fromJavaHome) return fromJavaHome;
43
51
  const fromPath = await require_external_tools_jre_from_path.jreFromPath();
44
52
  if (fromPath) return fromPath;
45
- if (opts?.downloadIfMissing) return require_external_tools_jre_from_download.jreFromDownload(opts.downloadIfMissing);
53
+ if (options?.downloadIfMissing) return require_external_tools_jre_from_download.jreFromDownload(options.downloadIfMissing);
46
54
  }
47
55
  /* c8 ignore start - test-only escape hatch. */
48
56
  function resetJreResolution() {
49
57
  resolutionCache.clear();
50
58
  }
51
59
  /* c8 ignore stop */
52
- function resolveJre(opts) {
53
- const key = cacheKey(opts);
60
+ function resolveJre(options) {
61
+ const key = cacheKey(options);
54
62
  let cached = resolutionCache.get(key);
55
63
  if (!cached) {
56
- cached = doResolveJre(opts);
64
+ cached = doResolveJre(options);
57
65
  resolutionCache.set(key, cached);
58
66
  }
59
67
  return cached;
@@ -91,6 +91,24 @@ export type ManifestEntry = {
91
91
  kind: 'other';
92
92
  raw: unknown;
93
93
  };
94
+ export interface RawChecksum {
95
+ asset?: unknown | undefined;
96
+ integrity?: unknown | undefined;
97
+ }
98
+ export interface RawFlavor {
99
+ repository?: unknown | undefined;
100
+ binaryName?: unknown | undefined;
101
+ platforms?: unknown | undefined;
102
+ }
103
+ export interface RawToolEntry {
104
+ description?: unknown | undefined;
105
+ version?: unknown | undefined;
106
+ release?: unknown | undefined;
107
+ repository?: unknown | undefined;
108
+ binaryName?: unknown | undefined;
109
+ notes?: unknown | undefined;
110
+ platforms?: unknown | undefined;
111
+ }
94
112
  export declare function isObject(value: unknown): value is Record<string, unknown>;
95
113
  export declare function parseChecksum(raw: unknown, toolName: string, platformKey: string): ToolChecksum;
96
114
  export declare function parsePlatforms(raw: unknown, toolName: string): Record<string, ToolChecksum>;
@@ -3,9 +3,9 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_primordials_error = require('../primordials/error.js');
5
5
  const require_integrity = require('../integrity.js');
6
+ const require_primordials_object = require('../primordials/object.js');
6
7
  const require_primordials_string = require('../primordials/string.js');
7
8
  const require_primordials_array = require('../primordials/array.js');
8
- const require_primordials_object = require('../primordials/object.js');
9
9
  const require_fs_read_json = require('../fs/read-json.js');
10
10
 
11
11
  //#region src/external-tools/manifest.ts
@@ -41,4 +41,4 @@ export interface OpengrepDownloadOptions {
41
41
  *
42
42
  * Reference: https://github.com/opengrep/opengrep/releases.
43
43
  */
44
- export declare function getOpengrepDownloadUrl(opts: OpengrepDownloadOptions): string | undefined;
44
+ export declare function getOpengrepDownloadUrl(options: OpengrepDownloadOptions): string | undefined;
@@ -53,8 +53,11 @@ function getOpengrepAssetEntry(platformArch) {
53
53
  *
54
54
  * Reference: https://github.com/opengrep/opengrep/releases.
55
55
  */
56
- function getOpengrepDownloadUrl(opts) {
57
- const { platformArch, version } = opts;
56
+ function getOpengrepDownloadUrl(options) {
57
+ const { platformArch, version } = {
58
+ __proto__: null,
59
+ ...options
60
+ };
58
61
  const entry = OPENGREP_ASSET_MAP[platformArch];
59
62
  if (!entry) return;
60
63
  return `https://github.com/opengrep/opengrep/releases/download/v${version}/` + entry.asset;
@@ -14,4 +14,4 @@ export interface OpengrepFromDownloadOptions {
14
14
  cacheDir?: string | undefined;
15
15
  downloader?: BinaryDownloader | undefined;
16
16
  }
17
- export declare function opengrepFromDownload(opts: OpengrepFromDownloadOptions): Promise<ResolvedOpengrep | undefined>;
17
+ export declare function opengrepFromDownload(options: OpengrepFromDownloadOptions): Promise<ResolvedOpengrep | undefined>;
@@ -17,8 +17,11 @@ node_path = require_runtime.__toESM(node_path);
17
17
  * bare binaries (no extraction); Windows ships a zip. The asset-map's
18
18
  * `isArchive` flag drives extraction vs. copy.
19
19
  */
20
- async function opengrepFromDownload(opts) {
21
- const { cacheDir, downloader, integrity, platformArch, version } = opts;
20
+ async function opengrepFromDownload(options) {
21
+ const { cacheDir, downloader, integrity, platformArch, version } = {
22
+ __proto__: null,
23
+ ...options
24
+ };
22
25
  const url = require_external_tools_opengrep_asset_names.getOpengrepDownloadUrl({
23
26
  version,
24
27
  platformArch
@@ -20,7 +20,7 @@ export interface ResolveOpengrepOptions {
20
20
  downloader?: BinaryDownloader | undefined;
21
21
  } | undefined;
22
22
  }
23
- export declare function cacheKey(opts: ResolveOpengrepOptions | undefined): string;
24
- export declare function doResolveOpengrep(opts?: ResolveOpengrepOptions | undefined): Promise<ResolvedOpengrep | undefined>;
23
+ export declare function cacheKey(options: ResolveOpengrepOptions | undefined): string;
24
+ export declare function doResolveOpengrep(options?: ResolveOpengrepOptions | undefined): Promise<ResolvedOpengrep | undefined>;
25
25
  export declare function resetOpengrepResolution(): void;
26
- export declare function resolveOpengrep(opts?: ResolveOpengrepOptions | undefined): Promise<ResolvedOpengrep | undefined>;
26
+ export declare function resolveOpengrep(options?: ResolveOpengrepOptions | undefined): Promise<ResolvedOpengrep | undefined>;
@@ -18,30 +18,38 @@ const require_external_tools_opengrep_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 { 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 doResolveOpengrep(opts) {
30
+ async function doResolveOpengrep(options) {
31
+ options = {
32
+ __proto__: null,
33
+ ...options
34
+ };
27
35
  const fromVfs = await require_external_tools_opengrep_from_vfs.opengrepFromVfs();
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_opengrep_from_path.opengrepFromPath();
32
40
  if (fromPath) return fromPath;
33
- if (opts?.downloadIfMissing) return require_external_tools_opengrep_from_download.opengrepFromDownload(opts.downloadIfMissing);
41
+ if (options?.downloadIfMissing) return require_external_tools_opengrep_from_download.opengrepFromDownload(options.downloadIfMissing);
34
42
  }
35
43
  /* c8 ignore start - test-only escape hatch. */
36
44
  function resetOpengrepResolution() {
37
45
  resolutionCache.clear();
38
46
  }
39
47
  /* c8 ignore stop */
40
- function resolveOpengrep(opts) {
41
- const key = cacheKey(opts);
48
+ function resolveOpengrep(options) {
49
+ const key = cacheKey(options);
42
50
  let cached = resolutionCache.get(key);
43
51
  if (!cached) {
44
- cached = doResolveOpengrep(opts);
52
+ cached = doResolveOpengrep(options);
45
53
  resolutionCache.set(key, cached);
46
54
  }
47
55
  return cached;
@@ -73,4 +73,4 @@ export interface PythonAsset {
73
73
  * Returns the asset filename and URL, or `undefined` when the platform-arch has
74
74
  * no upstream prebuilt.
75
75
  */
76
- export declare function pythonAsset(opts: PythonAssetOptions): PythonAsset | undefined;
76
+ export declare function pythonAsset(options: PythonAssetOptions): PythonAsset | undefined;
@@ -87,9 +87,16 @@ function getPythonArch() {
87
87
  * Returns the asset filename and URL, or `undefined` when the platform-arch has
88
88
  * no upstream prebuilt.
89
89
  */
90
- function pythonAsset(opts) {
91
- const { tag, version } = opts;
92
- const arch = opts.arch ?? getPythonArch();
90
+ function pythonAsset(options) {
91
+ options = {
92
+ __proto__: null,
93
+ ...options
94
+ };
95
+ const { tag, version } = {
96
+ __proto__: null,
97
+ ...options
98
+ };
99
+ const arch = options.arch ?? getPythonArch();
93
100
  const triple = arch ? PLATFORM_TRIPLES[arch] : void 0;
94
101
  if (!triple) return;
95
102
  return {
@@ -66,7 +66,7 @@ export declare class DlxPythonUnavailableError extends Error {
66
66
  * so callers can run the tool: `spawn(pythonBin, ['-m', '<module>'], { env: {
67
67
  * PYTHONPATH: packageDir } })`.
68
68
  */
69
- export declare function dlxPipInstall(opts: DlxPipInstallOptions): Promise<DownloadPipPackageResult & {
69
+ export declare function dlxPipInstall(options: DlxPipInstallOptions): Promise<DownloadPipPackageResult & {
70
70
  pythonBin: string;
71
71
  }>;
72
72
  /**
@@ -74,7 +74,7 @@ export declare function dlxPipInstall(opts: DlxPipInstallOptions): Promise<Downl
74
74
  * hash-pinned closure for `spec`. One-call form of `resolvePython` +
75
75
  * `resolvePipPackagePin`.
76
76
  */
77
- export declare function dlxPipPin(opts: DlxPipPinOptions): Promise<PipPackagePin & {
77
+ export declare function dlxPipPin(options: DlxPipPinOptions): Promise<PipPackagePin & {
78
78
  pythonBin: string;
79
79
  }>;
80
- export declare function resolveOrThrow(opts: DlxPipOptions): Promise<string>;
80
+ export declare function resolveOrThrow(options: DlxPipOptions): Promise<string>;
@@ -39,13 +39,17 @@ var DlxPythonUnavailableError = class extends Error {
39
39
  * so callers can run the tool: `spawn(pythonBin, ['-m', '<module>'], { env: {
40
40
  * PYTHONPATH: packageDir } })`.
41
41
  */
42
- async function dlxPipInstall(opts) {
43
- const pythonBin = await resolveOrThrow(opts);
42
+ async function dlxPipInstall(options) {
43
+ options = {
44
+ __proto__: null,
45
+ ...options
46
+ };
47
+ const pythonBin = await resolveOrThrow(options);
44
48
  return {
45
49
  ...await require_external_tools_python_pip_install.downloadPipPackage({
46
- hash: opts.hash,
50
+ hash: options.hash,
47
51
  pythonBin,
48
- spec: opts.spec
52
+ spec: options.spec
49
53
  }),
50
54
  pythonBin
51
55
  };
@@ -55,18 +59,25 @@ async function dlxPipInstall(opts) {
55
59
  * hash-pinned closure for `spec`. One-call form of `resolvePython` +
56
60
  * `resolvePipPackagePin`.
57
61
  */
58
- async function dlxPipPin(opts) {
59
- const pythonBin = await resolveOrThrow(opts);
62
+ async function dlxPipPin(options) {
63
+ options = {
64
+ __proto__: null,
65
+ ...options
66
+ };
67
+ const pythonBin = await resolveOrThrow(options);
60
68
  return {
61
69
  ...await require_external_tools_python_pin.resolvePipPackagePin({
62
70
  pythonBin,
63
- spec: opts.spec
71
+ spec: options.spec
64
72
  }),
65
73
  pythonBin
66
74
  };
67
75
  }
68
- async function resolveOrThrow(opts) {
69
- const { preferDownload, python } = opts;
76
+ async function resolveOrThrow(options) {
77
+ const { preferDownload, python } = {
78
+ __proto__: null,
79
+ ...options
80
+ };
70
81
  const resolved = await require_external_tools_python_resolve.resolvePython({
71
82
  preferDownload,
72
83
  downloadIfMissing: {
@@ -50,4 +50,4 @@ export declare function pythonBinPath(extractedDir: string, arch?: string | unde
50
50
  * Default DLX cache directory for a python build pin.
51
51
  */
52
52
  export declare function pythonCacheDir(version: string, tag: string, arch: string): string;
53
- export declare function pythonFromDownload(opts: PythonFromDownloadOptions): Promise<ResolvedPython | undefined>;
53
+ export declare function pythonFromDownload(options: PythonFromDownloadOptions): Promise<ResolvedPython | 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_python_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/python/from-download.ts
14
14
  /**
@@ -37,9 +37,16 @@ function pythonBinPath(extractedDir, arch) {
37
37
  function pythonCacheDir(version, tag, arch) {
38
38
  return node_path.default.join(require_paths_socket.getSocketDlxDir(), "python", `${version}-${tag}-${arch}`);
39
39
  }
40
- async function pythonFromDownload(opts) {
41
- const { cacheDir, downloader, integrity, tag, version } = opts;
42
- const arch = opts.arch ?? require_external_tools_python_asset_names.getPythonArch();
40
+ async function pythonFromDownload(options) {
41
+ options = {
42
+ __proto__: null,
43
+ ...options
44
+ };
45
+ const { cacheDir, downloader, integrity, tag, version } = {
46
+ __proto__: null,
47
+ ...options
48
+ };
49
+ const arch = options.arch ?? require_external_tools_python_asset_names.getPythonArch();
43
50
  if (!arch) return;
44
51
  const asset = require_external_tools_python_asset_names.pythonAsset({
45
52
  version,
@@ -7,12 +7,12 @@ const require_constants_platform = require('../../constants/platform.js');
7
7
  const require_process_spawn_child = require('../../process/spawn/child.js');
8
8
  const require_fs_safe = require('../../fs/safe.js');
9
9
  let node_fs = require("node:fs");
10
+ let node_process = require("node:process");
11
+ node_process = require_runtime.__toESM(node_process);
10
12
  let node_path = require("node:path");
11
13
  node_path = require_runtime.__toESM(node_path);
12
14
  let node_os = require("node:os");
13
15
  node_os = require_runtime.__toESM(node_os);
14
- let node_process = require("node:process");
15
- node_process = require_runtime.__toESM(node_process);
16
16
 
17
17
  //#region src/external-tools/python/pin.ts
18
18
  /**
@@ -92,7 +92,10 @@ function parseArtifactFilename(file) {
92
92
  * download or an unparseable artifact filename.
93
93
  */
94
94
  async function resolvePipPackagePin(options) {
95
- const { pythonBin, spec } = options;
95
+ const { pythonBin, spec } = {
96
+ __proto__: null,
97
+ ...options
98
+ };
96
99
  if (typeof spec !== "string" || spec.length === 0) throw new PipPackagePinError("resolvePipPackagePin requires a package spec");
97
100
  const scratch = options.scratchDir ?? node_path.default.join(node_os.default.tmpdir(), `socket-lib-pip-pin-${node_process.default.pid}-${Date.now()}`);
98
101
  await require_fs_safe.safeMkdir(scratch, { recursive: true });
@@ -8,10 +8,10 @@ const require_paths_socket = require('../../paths/socket.js');
8
8
  const require_fs_safe = require('../../fs/safe.js');
9
9
  const require_dlx_cache = require('../../dlx/cache.js');
10
10
  let node_fs = require("node:fs");
11
- let node_path = require("node:path");
12
- node_path = require_runtime.__toESM(node_path);
13
11
  let node_process = require("node:process");
14
12
  node_process = require_runtime.__toESM(node_process);
13
+ let node_path = require("node:path");
14
+ node_path = require_runtime.__toESM(node_path);
15
15
 
16
16
  //#region src/external-tools/python/pip-install.ts
17
17
  /**
@@ -46,7 +46,10 @@ const WAIT_TICKS = 30;
46
46
  * can't be acquired after MAX_RETRIES. Mirrors `downloadNpmPackage`.
47
47
  */
48
48
  async function downloadPipPackage(options, retryCount = 0) {
49
- const { hash, pythonBin, spec } = options;
49
+ const { hash, pythonBin, spec } = {
50
+ __proto__: null,
51
+ ...options
52
+ };
50
53
  const packageDir = pipPackageDir(spec);
51
54
  if (retryCount >= MAX_RETRIES) throw new Error(`downloadPipPackage: could not acquire install lock after ${MAX_RETRIES} retries for ${packageDir}; a peer may be stuck or the lock is stale — remove it and retry`);
52
55
  if (await isAlreadyInstalled(packageDir)) return {
@@ -36,7 +36,7 @@ export interface ResolvePythonOptions {
36
36
  downloader?: BinaryDownloader | undefined;
37
37
  } | undefined;
38
38
  }
39
- export declare function cacheKey(opts: ResolvePythonOptions | undefined): string;
40
- export declare function doResolvePython(opts?: ResolvePythonOptions | undefined): Promise<ResolvedPython | undefined>;
39
+ export declare function cacheKey(options: ResolvePythonOptions | undefined): string;
40
+ export declare function doResolvePython(options?: ResolvePythonOptions | undefined): Promise<ResolvedPython | undefined>;
41
41
  export declare function resetPythonResolution(): void;
42
- export declare function resolvePython(opts?: ResolvePythonOptions | undefined): Promise<ResolvedPython | undefined>;
42
+ export declare function resolvePython(options?: ResolvePythonOptions | undefined): Promise<ResolvedPython | undefined>;
@@ -20,15 +20,23 @@ const require_external_tools_python_from_path = require('./from-path.js');
20
20
  * in the smol Node binary. Add a `from-vfs` tier here if that changes.
21
21
  */
22
22
  const resolutionCache = new require_primordials_map_set.MapCtor();
23
- function cacheKey(opts) {
24
- const prefer = opts?.preferDownload ? "prefer:" : "";
25
- if (!opts?.downloadIfMissing) return `${prefer}local-only`;
26
- const { cacheDir, integrity, tag, version } = opts.downloadIfMissing;
27
- return `${prefer}dl:${version}:${tag}:${opts.downloadIfMissing.arch ?? require_external_tools_python_asset_names.getPythonArch() ?? "unknown"}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
23
+ function cacheKey(options) {
24
+ options = {
25
+ __proto__: null,
26
+ ...options
27
+ };
28
+ const prefer = options?.preferDownload ? "prefer:" : "";
29
+ if (!options?.downloadIfMissing) return `${prefer}local-only`;
30
+ const { cacheDir, integrity, tag, version } = options.downloadIfMissing;
31
+ return `${prefer}dl:${version}:${tag}:${options.downloadIfMissing.arch ?? require_external_tools_python_asset_names.getPythonArch() ?? "unknown"}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
28
32
  }
29
- async function doResolvePython(opts) {
30
- const dl = opts?.downloadIfMissing;
31
- if (opts?.preferDownload && dl) {
33
+ async function doResolvePython(options) {
34
+ options = {
35
+ __proto__: null,
36
+ ...options
37
+ };
38
+ const dl = options?.downloadIfMissing;
39
+ if (options?.preferDownload && dl) {
32
40
  const fromDownload = await require_external_tools_python_from_download.pythonFromDownload(dl);
33
41
  if (fromDownload) return fromDownload;
34
42
  }
@@ -41,11 +49,11 @@ function resetPythonResolution() {
41
49
  resolutionCache.clear();
42
50
  }
43
51
  /* c8 ignore stop */
44
- function resolvePython(opts) {
45
- const key = cacheKey(opts);
52
+ function resolvePython(options) {
53
+ const key = cacheKey(options);
46
54
  let cached = resolutionCache.get(key);
47
55
  if (!cached) {
48
- cached = doResolvePython(opts);
56
+ cached = doResolvePython(options);
49
57
  resolutionCache.set(key, cached);
50
58
  }
51
59
  return cached;
@@ -28,4 +28,4 @@ export interface SbtDownloadOptions {
28
28
  * // → 'https://github.com/sbt/sbt/releases/download/v1.10.7/sbt-1.10.7.tgz'
29
29
  * ```
30
30
  */
31
- export declare function getSbtDownloadUrl(opts: SbtDownloadOptions): string;
31
+ export declare function getSbtDownloadUrl(options: SbtDownloadOptions): string;
@@ -15,8 +15,11 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
15
15
  * // → 'https://github.com/sbt/sbt/releases/download/v1.10.7/sbt-1.10.7.tgz'
16
16
  * ```
17
17
  */
18
- function getSbtDownloadUrl(opts) {
19
- const { version } = opts;
18
+ function getSbtDownloadUrl(options) {
19
+ const { version } = {
20
+ __proto__: null,
21
+ ...options
22
+ };
20
23
  return `https://github.com/sbt/sbt/releases/download/v${version}/sbt-${version}.tgz`;
21
24
  }
22
25
 
@@ -41,4 +41,4 @@ export interface SbtFromDownloadOptions {
41
41
  * // → { path: '/.../bin/sbt', isJar: false, source: 'download' }
42
42
  * ```
43
43
  */
44
- export declare function sbtFromDownload(opts: SbtFromDownloadOptions): Promise<ResolvedSbt | undefined>;
44
+ export declare function sbtFromDownload(options: SbtFromDownloadOptions): Promise<ResolvedSbt | undefined>;
@@ -29,8 +29,11 @@ node_path = require_runtime.__toESM(node_path);
29
29
  * // → { path: '/.../bin/sbt', isJar: false, source: 'download' }
30
30
  * ```
31
31
  */
32
- async function sbtFromDownload(opts) {
33
- const { cacheDir, downloader, integrity, version } = opts;
32
+ async function sbtFromDownload(options) {
33
+ const { cacheDir, downloader, integrity, version } = {
34
+ __proto__: null,
35
+ ...options
36
+ };
34
37
  const url = require_external_tools_sbt_asset_names.getSbtDownloadUrl({ version });
35
38
  const extractedDir = cacheDir ?? node_path.default.join(require_paths_socket.getSocketDlxDir(), "sbt", version);
36
39
  const archive = await require_external_tools_from_download.downloadAndExtractTool({