@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.
- package/CHANGELOG.md +20 -0
- package/README.md +1 -1
- package/dist/ai/agent-context.d.mts +103 -0
- package/dist/ai/agent-context.js +157 -0
- package/dist/ai/backends.d.mts +83 -0
- package/dist/ai/backends.js +173 -0
- package/dist/ai/credentials.d.mts +49 -0
- package/dist/ai/credentials.js +82 -0
- package/dist/ai/discover.d.mts +4 -0
- package/dist/ai/discover.js +1 -1
- package/dist/ai/exec.d.mts +52 -0
- package/dist/ai/exec.js +92 -0
- package/dist/ai/http.d.mts +132 -0
- package/dist/ai/http.js +130 -0
- package/dist/ai/profiles.d.mts +41 -6
- package/dist/ai/profiles.js +52 -10
- package/dist/ai/route.d.mts +69 -0
- package/dist/ai/route.js +156 -0
- package/dist/ai/spawn.d.mts +10 -2
- package/dist/ai/spawn.js +55 -31
- package/dist/ai/subagent-status.d.mts +48 -0
- package/dist/ai/subagent-status.js +57 -0
- package/dist/ai/tier.d.mts +60 -0
- package/dist/ai/tier.js +53 -0
- package/dist/ai/types.d.mts +15 -2
- package/dist/ai/worktree.js +4 -0
- package/dist/archives/tar.js +1 -1
- package/dist/archives/zip.js +2 -2
- package/dist/argv/parse.d.ts +19 -2
- package/dist/argv/parse.js +1 -1
- package/dist/arrays/join.js +4 -0
- package/dist/bin/find.js +4 -4
- package/dist/bin/prim.cjs +3915 -3781
- package/dist/bin/resolve.js +1 -1
- package/dist/cache/ttl/store.js +1 -1
- package/dist/cli/check-primordials.d.ts +8 -3
- package/dist/cli/check-primordials.js +4 -4
- package/dist/compression/_internal.js +1 -1
- package/dist/compression/brotli.d.ts +1 -2
- package/dist/compression/brotli.js +6 -2
- package/dist/compression/gzip.js +6 -2
- package/dist/constants/packages.d.ts +3 -0
- package/dist/constants/packages.js +2 -1
- package/dist/constants/socket.d.ts +2 -6
- package/dist/constants/socket.js +12 -14
- package/dist/cover/code.js +2 -2
- package/dist/crypto/hash.d.ts +4 -1
- package/dist/crypto/hash.js +4 -1
- package/dist/debug/caller-info.js +1 -1
- package/dist/dlx/arborist.js +13 -3
- package/dist/dlx/binary-cache.js +1 -1
- package/dist/dlx/binary-resolution.js +1 -1
- package/dist/dlx/detect.d.ts +8 -0
- package/dist/dlx/firewall.d.ts +8 -0
- package/dist/dlx/firewall.js +1 -1
- package/dist/dlx/lockfile.js +4 -1
- package/dist/dlx/manifest.js +1 -1
- package/dist/dlx/package.js +4 -0
- package/dist/eco/cargo/parse-lockfile.d.ts +1 -2
- package/dist/eco/cargo/parse-lockfile.js +3 -3
- package/dist/eco/manifest/detect-format.js +1 -1
- package/dist/eco/npm/npm/parse-lockfile.d.ts +3 -4
- package/dist/eco/npm/npm/parse-lockfile.js +2 -2
- package/dist/eco/npm/parse-package-json.d.ts +11 -0
- package/dist/eco/npm/parse-package-json.js +1 -1
- package/dist/eco/npm/pnpm/parse-lockfile.d.ts +5 -3
- package/dist/eco/npm/pnpm/parse-lockfile.js +3 -3
- package/dist/eco/npm/yarnpkg/yarn/exec.js +1 -1
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +1 -2
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +1 -1
- package/dist/env/proxy.js +1 -1
- package/dist/env/rewire.d.ts +1 -0
- package/dist/env/rewire.js +1 -1
- package/dist/env/socket.d.ts +7 -0
- package/dist/env/socket.js +10 -0
- package/dist/errors/predicates.js +1 -1
- package/dist/external/@npmcli/promise-spawn.js +3 -1
- package/dist/external/pico-pack.js +4 -2
- package/dist/external/which.js +3 -1
- package/dist/external-tools/bazel/asset-names.d.ts +1 -1
- package/dist/external-tools/bazel/asset-names.js +5 -2
- package/dist/external-tools/bazel/from-download.d.ts +1 -1
- package/dist/external-tools/bazel/from-download.js +5 -2
- package/dist/external-tools/bazel/resolve-bazel-version.js +4 -0
- package/dist/external-tools/bazel/resolve.d.ts +3 -3
- package/dist/external-tools/bazel/resolve.js +16 -8
- package/dist/external-tools/cdxgen/asset-names.d.ts +1 -1
- package/dist/external-tools/cdxgen/asset-names.js +5 -2
- package/dist/external-tools/cdxgen/from-download.d.ts +1 -1
- package/dist/external-tools/cdxgen/from-download.js +7 -4
- package/dist/external-tools/cdxgen/resolve.d.ts +3 -3
- package/dist/external-tools/cdxgen/resolve.js +16 -8
- package/dist/external-tools/from-download.d.ts +2 -2
- package/dist/external-tools/from-download.js +11 -5
- package/dist/external-tools/from-pip-venv.d.ts +1 -1
- package/dist/external-tools/from-pip-venv.js +12 -5
- package/dist/external-tools/janus/asset-names.d.ts +1 -1
- package/dist/external-tools/janus/asset-names.js +5 -2
- package/dist/external-tools/janus/from-download.d.ts +1 -1
- package/dist/external-tools/janus/from-download.js +5 -2
- package/dist/external-tools/janus/resolve.d.ts +3 -3
- package/dist/external-tools/janus/resolve.js +16 -8
- package/dist/external-tools/jre/asset-names.d.ts +1 -1
- package/dist/external-tools/jre/asset-names.js +5 -2
- package/dist/external-tools/jre/from-download.d.ts +1 -1
- package/dist/external-tools/jre/from-download.js +7 -4
- package/dist/external-tools/jre/from-java-home.js +2 -2
- package/dist/external-tools/jre/from-vfs.js +2 -2
- package/dist/external-tools/jre/resolve.d.ts +3 -3
- package/dist/external-tools/jre/resolve.js +16 -8
- package/dist/external-tools/manifest.d.ts +18 -0
- package/dist/external-tools/manifest.js +1 -1
- package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
- package/dist/external-tools/opengrep/asset-names.js +5 -2
- package/dist/external-tools/opengrep/from-download.d.ts +1 -1
- package/dist/external-tools/opengrep/from-download.js +5 -2
- package/dist/external-tools/opengrep/resolve.d.ts +3 -3
- package/dist/external-tools/opengrep/resolve.js +16 -8
- package/dist/external-tools/python/asset-names.d.ts +1 -1
- package/dist/external-tools/python/asset-names.js +10 -3
- package/dist/external-tools/python/dlx.d.ts +3 -3
- package/dist/external-tools/python/dlx.js +20 -9
- package/dist/external-tools/python/from-download.d.ts +1 -1
- package/dist/external-tools/python/from-download.js +12 -5
- package/dist/external-tools/python/pin.js +6 -3
- package/dist/external-tools/python/pip-install.js +6 -3
- package/dist/external-tools/python/resolve.d.ts +3 -3
- package/dist/external-tools/python/resolve.js +19 -11
- package/dist/external-tools/sbt/asset-names.d.ts +1 -1
- package/dist/external-tools/sbt/asset-names.js +5 -2
- package/dist/external-tools/sbt/from-download.d.ts +1 -1
- package/dist/external-tools/sbt/from-download.js +5 -2
- package/dist/external-tools/sbt/resolve.d.ts +3 -3
- package/dist/external-tools/sbt/resolve.js +16 -8
- package/dist/external-tools/skillspector/from-dlx.d.ts +1 -1
- package/dist/external-tools/skillspector/from-dlx.js +10 -3
- package/dist/external-tools/skillspector/resolve.d.ts +2 -2
- package/dist/external-tools/skillspector/resolve.js +14 -6
- package/dist/external-tools/synp/asset-names.d.ts +1 -1
- package/dist/external-tools/synp/asset-names.js +6 -2
- package/dist/external-tools/synp/from-download.d.ts +1 -1
- package/dist/external-tools/synp/from-download.js +5 -2
- package/dist/external-tools/synp/resolve.d.ts +3 -3
- package/dist/external-tools/synp/resolve.js +16 -8
- package/dist/external-tools/trivy/asset-names.d.ts +1 -1
- package/dist/external-tools/trivy/asset-names.js +5 -2
- package/dist/external-tools/trivy/from-download.d.ts +1 -1
- package/dist/external-tools/trivy/from-download.js +7 -4
- package/dist/external-tools/trivy/resolve.d.ts +3 -3
- package/dist/external-tools/trivy/resolve.js +16 -8
- package/dist/external-tools/trufflehog/asset-names.d.ts +1 -1
- package/dist/external-tools/trufflehog/asset-names.js +5 -2
- package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
- package/dist/external-tools/trufflehog/from-download.js +7 -4
- package/dist/external-tools/trufflehog/resolve.d.ts +3 -3
- package/dist/external-tools/trufflehog/resolve.js +16 -8
- package/dist/fs/allowed-dirs-cache.d.ts +27 -1
- package/dist/fs/allowed-dirs-cache.js +38 -3
- package/dist/fs/find.js +1 -1
- package/dist/fs/read-json-cache.d.ts +7 -0
- package/dist/fs/resolve-module.js +6 -2
- package/dist/fs/safe.js +1 -1
- package/dist/git/_internal.js +2 -2
- package/dist/git/repo.js +2 -4
- package/dist/git/staged.js +8 -0
- package/dist/git/tracked.d.ts +84 -0
- package/dist/git/tracked.js +163 -0
- package/dist/git/unstaged.js +8 -0
- package/dist/github/refs-graphql.js +4 -0
- package/dist/github/refs-rest.js +4 -0
- package/dist/github/refs.js +15 -10
- package/dist/globs/_internal.js +1 -1
- package/dist/globs/match.js +9 -1
- package/dist/globs/matcher.js +5 -1
- package/dist/http-request/browser.js +6 -2
- package/dist/http-request/{browser-fetch.d.ts → fetch/browser.d.ts} +2 -2
- package/dist/http-request/{browser-fetch.js → fetch/browser.js} +4 -4
- package/dist/http-request/headers.js +1 -1
- package/dist/http-request/request-attempt.js +2 -2
- package/dist/http-request/user-agent.js +1 -1
- package/dist/integrity.d.ts +10 -4
- package/dist/integrity.js +10 -4
- package/dist/json/edit.js +38 -30
- package/dist/json/format.js +1 -1
- package/dist/native-messaging/install.d.ts +1 -1
- package/dist/native-messaging/install.js +7 -4
- package/dist/native-messaging/rate-limit.d.ts +7 -0
- package/dist/native-messaging/rate-limit.js +4 -0
- package/dist/node/async-hooks.js +1 -1
- package/dist/node/child-process.js +1 -1
- package/dist/node/crypto.js +1 -1
- package/dist/node/events.js +1 -1
- package/dist/node/fs-promises.js +1 -1
- package/dist/node/fs.d.ts +22 -6
- package/dist/node/fs.js +16 -3
- package/dist/node/http.js +1 -1
- package/dist/node/https.js +1 -1
- package/dist/node/module.js +1 -1
- package/dist/node/os.d.ts +10 -2
- package/dist/node/os.js +11 -4
- package/dist/node/path.d.ts +11 -2
- package/dist/node/path.js +17 -4
- package/dist/node/timers-promises.js +1 -1
- package/dist/node/url.js +1 -1
- package/dist/node/util.js +1 -1
- package/dist/objects/getters.js +1 -1
- package/dist/objects/mutate.js +2 -2
- package/dist/objects/predicates.js +1 -1
- package/dist/packages/edit-class.d.ts +2 -3
- package/dist/packages/edit-class.js +41 -35
- package/dist/packages/exports.js +4 -4
- package/dist/packages/fetch.js +1 -1
- package/dist/packages/isolation.js +1 -1
- package/dist/packages/licenses.js +2 -2
- package/dist/packages/manifest.js +4 -4
- package/dist/packages/normalize.js +1 -1
- package/dist/packages/provenance.js +2 -2
- package/dist/packages/specs.js +1 -1
- package/dist/packages/tarball.js +4 -2
- package/dist/packages/types.d.ts +1 -2
- package/dist/paths/dirnames.d.ts +1 -0
- package/dist/paths/dirnames.js +2 -0
- package/dist/paths/resolve.js +14 -19
- package/dist/paths/rewire.d.ts +5 -0
- package/dist/paths/socket.d.ts +74 -111
- package/dist/paths/socket.js +99 -132
- package/dist/primordials/process.d.ts +88 -0
- package/dist/primordials/process.js +132 -0
- package/dist/primordials/uncurry.d.ts +1 -2
- package/dist/process/spawn/child.js +8 -2
- package/dist/process/spawn/errors.js +1 -1
- package/dist/regexps/spec.js +1 -1
- package/dist/releases/github-archives.js +1 -1
- package/dist/releases/github-listing.d.ts +1 -2
- package/dist/schema/types.d.ts +3 -4
- package/dist/schema/validate.js +1 -1
- package/dist/secrets/find.d.ts +2 -2
- package/dist/secrets/find.js +10 -4
- package/dist/secrets/keychain.d.ts +1 -1
- package/dist/secrets/linux.js +32 -44
- package/dist/secrets/macos.d.ts +1 -2
- package/dist/secrets/macos.js +20 -29
- package/dist/secrets/rc.d.ts +2 -2
- package/dist/secrets/rc.js +21 -13
- package/dist/secrets/socket-api-token.js +8 -0
- package/dist/secrets/windows.js +27 -33
- package/dist/shell/parse.d.ts +32 -0
- package/dist/shell/parse.js +60 -0
- package/dist/spinner/create-spinner-class.js +2 -2
- package/dist/spinner/spinner-internals.d.ts +1 -1
- package/dist/spinner/spinner-internals.js +9 -5
- package/dist/spinner/spinner.d.ts +4 -0
- package/dist/spinner/spinner.js +1 -1
- package/dist/stdio/progress.js +5 -1
- package/dist/stdio/prompts.d.ts +2 -2
- package/dist/stdio/prompts.js +1 -1
- package/dist/temporal/instant.js +2 -2
- package/dist/url/assert-safe.d.ts +29 -0
- package/dist/url/assert-safe.js +54 -0
- package/dist/url/predicates.d.ts +31 -1
- package/dist/url/predicates.js +42 -1
- package/dist/url/types.d.ts +4 -0
- 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(
|
|
24
|
-
|
|
25
|
-
|
|
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(
|
|
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 (
|
|
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(
|
|
43
|
-
const key = cacheKey(
|
|
50
|
+
function resolveJanus(options) {
|
|
51
|
+
const key = cacheKey(options);
|
|
44
52
|
let cached = resolutionCache.get(key);
|
|
45
53
|
if (!cached) {
|
|
46
|
-
cached = doResolveJanus(
|
|
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(
|
|
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(
|
|
99
|
-
const { platformArch, releaseType = "ga", type = "jre", version } =
|
|
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(
|
|
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(
|
|
48
|
-
const { cacheDir, downloader, integrity, platformArch, version } =
|
|
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(
|
|
38
|
-
export declare function doResolveJre(
|
|
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(
|
|
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(
|
|
32
|
-
|
|
33
|
-
|
|
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(
|
|
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 (
|
|
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(
|
|
53
|
-
const key = cacheKey(
|
|
60
|
+
function resolveJre(options) {
|
|
61
|
+
const key = cacheKey(options);
|
|
54
62
|
let cached = resolutionCache.get(key);
|
|
55
63
|
if (!cached) {
|
|
56
|
-
cached = doResolveJre(
|
|
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(
|
|
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(
|
|
57
|
-
const { platformArch, version } =
|
|
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(
|
|
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(
|
|
21
|
-
const { cacheDir, downloader, integrity, platformArch, version } =
|
|
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(
|
|
24
|
-
export declare function doResolveOpengrep(
|
|
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(
|
|
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(
|
|
22
|
-
|
|
23
|
-
|
|
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(
|
|
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 (
|
|
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(
|
|
41
|
-
const key = cacheKey(
|
|
48
|
+
function resolveOpengrep(options) {
|
|
49
|
+
const key = cacheKey(options);
|
|
42
50
|
let cached = resolutionCache.get(key);
|
|
43
51
|
if (!cached) {
|
|
44
|
-
cached = doResolveOpengrep(
|
|
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(
|
|
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(
|
|
91
|
-
|
|
92
|
-
|
|
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(
|
|
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(
|
|
77
|
+
export declare function dlxPipPin(options: DlxPipPinOptions): Promise<PipPackagePin & {
|
|
78
78
|
pythonBin: string;
|
|
79
79
|
}>;
|
|
80
|
-
export declare function resolveOrThrow(
|
|
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(
|
|
43
|
-
|
|
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:
|
|
50
|
+
hash: options.hash,
|
|
47
51
|
pythonBin,
|
|
48
|
-
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(
|
|
59
|
-
|
|
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:
|
|
71
|
+
spec: options.spec
|
|
64
72
|
}),
|
|
65
73
|
pythonBin
|
|
66
74
|
};
|
|
67
75
|
}
|
|
68
|
-
async function resolveOrThrow(
|
|
69
|
-
const { preferDownload, python } =
|
|
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(
|
|
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(
|
|
41
|
-
|
|
42
|
-
|
|
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 } =
|
|
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 } =
|
|
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(
|
|
40
|
-
export declare function doResolvePython(
|
|
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(
|
|
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(
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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(
|
|
30
|
-
|
|
31
|
-
|
|
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(
|
|
45
|
-
const key = cacheKey(
|
|
52
|
+
function resolvePython(options) {
|
|
53
|
+
const key = cacheKey(options);
|
|
46
54
|
let cached = resolutionCache.get(key);
|
|
47
55
|
if (!cached) {
|
|
48
|
-
cached = doResolvePython(
|
|
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(
|
|
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(
|
|
19
|
-
const { version } =
|
|
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(
|
|
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(
|
|
33
|
-
const { cacheDir, downloader, integrity, version } =
|
|
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({
|