@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
|
@@ -25,7 +25,7 @@ export interface ResolveSbtOptions {
|
|
|
25
25
|
downloader?: BinaryDownloader | undefined;
|
|
26
26
|
} | undefined;
|
|
27
27
|
}
|
|
28
|
-
export declare function cacheKey(
|
|
29
|
-
export declare function doResolveSbt(
|
|
28
|
+
export declare function cacheKey(options: ResolveSbtOptions | undefined): string;
|
|
29
|
+
export declare function doResolveSbt(options?: ResolveSbtOptions | undefined): Promise<ResolvedSbt | undefined>;
|
|
30
30
|
export declare function resetSbtResolution(): void;
|
|
31
|
-
export declare function resolveSbt(
|
|
31
|
+
export declare function resolveSbt(options?: ResolveSbtOptions | undefined): Promise<ResolvedSbt | undefined>;
|
|
@@ -20,30 +20,38 @@ const require_external_tools_sbt_from_vfs = require('./from-vfs.js');
|
|
|
20
20
|
* 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, version } = options.downloadIfMissing;
|
|
26
30
|
return `dl:${version}:${typeof integrity === "string" ? integrity : integrity ? `${integrity.type}:${integrity.value}` : ""}:${cacheDir ?? ""}`;
|
|
27
31
|
}
|
|
28
|
-
async function doResolveSbt(
|
|
32
|
+
async function doResolveSbt(options) {
|
|
33
|
+
options = {
|
|
34
|
+
__proto__: null,
|
|
35
|
+
...options
|
|
36
|
+
};
|
|
29
37
|
const fromVfs = await require_external_tools_sbt_from_vfs.sbtFromVfs();
|
|
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_sbt_from_path.sbtFromPath();
|
|
34
42
|
if (fromPath) return fromPath;
|
|
35
|
-
if (
|
|
43
|
+
if (options?.downloadIfMissing) return require_external_tools_sbt_from_download.sbtFromDownload(options.downloadIfMissing);
|
|
36
44
|
}
|
|
37
45
|
/* c8 ignore start - test-only escape hatch. */
|
|
38
46
|
function resetSbtResolution() {
|
|
39
47
|
resolutionCache.clear();
|
|
40
48
|
}
|
|
41
49
|
/* c8 ignore stop */
|
|
42
|
-
function resolveSbt(
|
|
43
|
-
const key = cacheKey(
|
|
50
|
+
function resolveSbt(options) {
|
|
51
|
+
const key = cacheKey(options);
|
|
44
52
|
let cached = resolutionCache.get(key);
|
|
45
53
|
if (!cached) {
|
|
46
|
-
cached = doResolveSbt(
|
|
54
|
+
cached = doResolveSbt(options);
|
|
47
55
|
resolutionCache.set(key, cached);
|
|
48
56
|
}
|
|
49
57
|
return cached;
|
|
@@ -21,4 +21,4 @@ export interface SkillSpectorFromDlxOptions {
|
|
|
21
21
|
*/
|
|
22
22
|
readonly cacheDir?: string | undefined;
|
|
23
23
|
}
|
|
24
|
-
export declare function skillspectorFromDlx(
|
|
24
|
+
export declare function skillspectorFromDlx(options: SkillSpectorFromDlxOptions): Promise<ResolvedSkillSpector | undefined>;
|
|
@@ -18,10 +18,17 @@ node_path = require_runtime.__toESM(node_path);
|
|
|
18
18
|
* venv when its `skillspector` entry-point already exists.
|
|
19
19
|
*/
|
|
20
20
|
const UPSTREAM_REPO = "https://github.com/NVIDIA/skillspector.git";
|
|
21
|
-
async function skillspectorFromDlx(
|
|
22
|
-
|
|
21
|
+
async function skillspectorFromDlx(options) {
|
|
22
|
+
options = {
|
|
23
|
+
__proto__: null,
|
|
24
|
+
...options
|
|
25
|
+
};
|
|
26
|
+
const { sha } = {
|
|
27
|
+
__proto__: null,
|
|
28
|
+
...options
|
|
29
|
+
};
|
|
23
30
|
if (!sha) return;
|
|
24
|
-
const cacheDir =
|
|
31
|
+
const cacheDir = options.cacheDir ?? node_path.default.join(require_paths_socket.getSocketDlxDir(), "skillspector", sha);
|
|
25
32
|
const installSpec = `git+${UPSTREAM_REPO}@${sha}`;
|
|
26
33
|
try {
|
|
27
34
|
return {
|
|
@@ -26,8 +26,8 @@ export interface ResolveSkillSpectorOptions {
|
|
|
26
26
|
*/
|
|
27
27
|
readonly localOnly?: boolean | undefined;
|
|
28
28
|
}
|
|
29
|
-
export declare function cacheKey(
|
|
30
|
-
export declare function doResolveSkillSpector(
|
|
29
|
+
export declare function cacheKey(options: ResolveSkillSpectorOptions): string;
|
|
30
|
+
export declare function doResolveSkillSpector(options: ResolveSkillSpectorOptions): Promise<ResolvedSkillSpector | undefined>;
|
|
31
31
|
/**
|
|
32
32
|
* Memoizing wrapper around {@link doResolveSkillSpector}.
|
|
33
33
|
*/
|
|
@@ -19,20 +19,28 @@ const require_external_tools_skillspector_from_vfs = require('./from-vfs.js');
|
|
|
19
19
|
* sha+cacheDir+localOnly tuple.
|
|
20
20
|
*/
|
|
21
21
|
const resolutionCache = new require_primordials_map_set.MapCtor();
|
|
22
|
-
function cacheKey(
|
|
23
|
-
|
|
22
|
+
function cacheKey(options) {
|
|
23
|
+
options = {
|
|
24
|
+
__proto__: null,
|
|
25
|
+
...options
|
|
26
|
+
};
|
|
27
|
+
return `${options.sha ?? ""}|${options.cacheDir ?? ""}|${options.localOnly ? "local" : "full"}`;
|
|
24
28
|
}
|
|
25
|
-
async function doResolveSkillSpector(
|
|
29
|
+
async function doResolveSkillSpector(options) {
|
|
30
|
+
options = {
|
|
31
|
+
__proto__: null,
|
|
32
|
+
...options
|
|
33
|
+
};
|
|
26
34
|
const fromVfs = await require_external_tools_skillspector_from_vfs.skillspectorFromVfs();
|
|
27
35
|
/* c8 ignore start - smol Node binary only. */
|
|
28
36
|
if (fromVfs) return fromVfs;
|
|
29
37
|
/* c8 ignore stop */
|
|
30
38
|
const fromPath = await require_external_tools_skillspector_from_path.skillspectorFromPath();
|
|
31
39
|
if (fromPath) return fromPath;
|
|
32
|
-
if (
|
|
40
|
+
if (options.localOnly || !options.sha) return;
|
|
33
41
|
return require_external_tools_skillspector_from_dlx.skillspectorFromDlx({
|
|
34
|
-
sha:
|
|
35
|
-
cacheDir:
|
|
42
|
+
sha: options.sha,
|
|
43
|
+
cacheDir: options.cacheDir
|
|
36
44
|
});
|
|
37
45
|
}
|
|
38
46
|
/**
|
|
@@ -11,4 +11,4 @@ export interface SynpPackageOptions {
|
|
|
11
11
|
/**
|
|
12
12
|
* Build the npm package spec string for the requested synp version.
|
|
13
13
|
*/
|
|
14
|
-
export declare function getSynpPackageSpec(
|
|
14
|
+
export declare function getSynpPackageSpec(options: SynpPackageOptions): string;
|
|
@@ -6,8 +6,12 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
6
6
|
/**
|
|
7
7
|
* Build the npm package spec string for the requested synp version.
|
|
8
8
|
*/
|
|
9
|
-
function getSynpPackageSpec(
|
|
10
|
-
|
|
9
|
+
function getSynpPackageSpec(options) {
|
|
10
|
+
options = {
|
|
11
|
+
__proto__: null,
|
|
12
|
+
...options
|
|
13
|
+
};
|
|
14
|
+
return `synp@${options.version}`;
|
|
11
15
|
}
|
|
12
16
|
|
|
13
17
|
//#endregion
|
|
@@ -15,4 +15,4 @@ export interface SynpFromDownloadOptions {
|
|
|
15
15
|
*/
|
|
16
16
|
integrity?: string | undefined;
|
|
17
17
|
}
|
|
18
|
-
export declare function synpFromDownload(
|
|
18
|
+
export declare function synpFromDownload(options: SynpFromDownloadOptions): Promise<ResolvedSynp>;
|
|
@@ -10,8 +10,11 @@ const require_external_tools_synp_asset_names = require('./asset-names.js');
|
|
|
10
10
|
* `dlx/package` and returns a `ResolvedSynp` pointing at the resolved bin
|
|
11
11
|
* shim.
|
|
12
12
|
*/
|
|
13
|
-
async function synpFromDownload(
|
|
14
|
-
const { integrity, version } =
|
|
13
|
+
async function synpFromDownload(options) {
|
|
14
|
+
const { integrity, version } = {
|
|
15
|
+
__proto__: null,
|
|
16
|
+
...options
|
|
17
|
+
};
|
|
15
18
|
const { binaryPath } = await require_dlx_package.downloadNpmPackage({
|
|
16
19
|
spec: require_external_tools_synp_asset_names.getSynpPackageSpec({ version }),
|
|
17
20
|
binaryName: "synp",
|
|
@@ -15,7 +15,7 @@ export interface ResolveSynpOptions {
|
|
|
15
15
|
integrity?: string | undefined;
|
|
16
16
|
} | undefined;
|
|
17
17
|
}
|
|
18
|
-
export declare function cacheKey(
|
|
19
|
-
export declare function doResolveSynp(
|
|
18
|
+
export declare function cacheKey(options: ResolveSynpOptions | undefined): string;
|
|
19
|
+
export declare function doResolveSynp(options?: ResolveSynpOptions | undefined): Promise<ResolvedSynp | undefined>;
|
|
20
20
|
export declare function resetSynpResolution(): void;
|
|
21
|
-
export declare function resolveSynp(
|
|
21
|
+
export declare function resolveSynp(options?: ResolveSynpOptions | undefined): Promise<ResolvedSynp | undefined>;
|
|
@@ -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(
|
|
22
|
-
|
|
23
|
-
|
|
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(
|
|
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 (
|
|
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(
|
|
41
|
-
const key = cacheKey(
|
|
48
|
+
function resolveSynp(options) {
|
|
49
|
+
const key = cacheKey(options);
|
|
42
50
|
let cached = resolutionCache.get(key);
|
|
43
51
|
if (!cached) {
|
|
44
|
-
cached = doResolveSynp(
|
|
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(
|
|
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(
|
|
48
|
-
const { platformArch, version } =
|
|
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(
|
|
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(
|
|
21
|
-
const { cacheDir, downloader, integrity, platformArch, version } =
|
|
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(
|
|
24
|
-
export declare function doResolveTrivy(
|
|
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(
|
|
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(
|
|
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 doResolveTrivy(
|
|
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 (
|
|
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(
|
|
41
|
-
const key = cacheKey(
|
|
48
|
+
function resolveTrivy(options) {
|
|
49
|
+
const key = cacheKey(options);
|
|
42
50
|
let cached = resolutionCache.get(key);
|
|
43
51
|
if (!cached) {
|
|
44
|
-
cached = doResolveTrivy(
|
|
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(
|
|
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(
|
|
51
|
-
const { platformArch, version } =
|
|
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(
|
|
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(
|
|
24
|
-
const { cacheDir, downloader, integrity, platformArch, version } =
|
|
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(
|
|
28
|
-
export declare function doResolveTrufflehog(
|
|
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(
|
|
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(
|
|
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 doResolveTrufflehog(
|
|
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 (
|
|
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(
|
|
41
|
-
const key = cacheKey(
|
|
48
|
+
function resolveTrufflehog(options) {
|
|
49
|
+
const key = cacheKey(options);
|
|
42
50
|
let cached = resolutionCache.get(key);
|
|
43
51
|
if (!cached) {
|
|
44
|
-
cached = doResolveTrufflehog(
|
|
52
|
+
cached = doResolveTrufflehog(options);
|
|
45
53
|
resolutionCache.set(key, cached);
|
|
46
54
|
}
|
|
47
55
|
return cached;
|
|
@@ -4,7 +4,17 @@
|
|
|
4
4
|
* `invalidatePathCache` with `paths/rewire.ts` so test-time path overrides
|
|
5
5
|
* flush the cache; the registration is the module's only side effect, so
|
|
6
6
|
* callers that just need to flush the cache imperatively can call
|
|
7
|
-
* `invalidatePathCache()` directly without that side effect repeating.
|
|
7
|
+
* `invalidatePathCache()` directly without that side effect repeating. The
|
|
8
|
+
* registration is deferred to a microtask (`registerInvalidationCallback`)
|
|
9
|
+
* rather than run at top-level module load. This module sits in a require
|
|
10
|
+
* cycle (`allowed-dirs-cache → _internal → paths/socket → …`); in the bundled
|
|
11
|
+
* CJS the `registerCacheInvalidation` import binding from `paths/rewire` is
|
|
12
|
+
* not yet initialized when this module first evaluates, so a synchronous
|
|
13
|
+
* top-level call threw `registerCacheInvalidation is not defined` at require
|
|
14
|
+
* time. Deferring to a microtask runs the call after the module graph has
|
|
15
|
+
* settled, breaking the init-order hazard while keeping the load-time
|
|
16
|
+
* registration contract (the callback is in place before any test hook
|
|
17
|
+
* fires).
|
|
8
18
|
*/
|
|
9
19
|
/**
|
|
10
20
|
* Invalidate the cached allowed directories. Called automatically by the
|
|
@@ -19,3 +29,19 @@
|
|
|
19
29
|
* @internal Used for test rewiring
|
|
20
30
|
*/
|
|
21
31
|
export declare function invalidatePathCache(): void;
|
|
32
|
+
/**
|
|
33
|
+
* Register `invalidatePathCache` with the rewire module after the current
|
|
34
|
+
* module-init turn, so the circular import is fully wired before the call.
|
|
35
|
+
* Guarded + self-rescheduling: in the require cycle (`allowed-dirs-cache →
|
|
36
|
+
* _internal → paths/socket → … → rewire`) the `registerCacheInvalidation` live
|
|
37
|
+
* binding can still be in its temporal dead zone when the first microtask fires
|
|
38
|
+
* under some import orders (vitest loads many modules concurrently), throwing
|
|
39
|
+
* `registerCacheInvalidation is not defined`. So check the binding is callable;
|
|
40
|
+
* if not, re-defer to the next microtask. The registration is a test-seam
|
|
41
|
+
* best-effort (it lets path-rewire flush this cache), so a bounded retry that
|
|
42
|
+
* lands on a later turn is correct — and a never-resolving binding (production,
|
|
43
|
+
* where rewire is unused) simply stops retrying without throwing.
|
|
44
|
+
*
|
|
45
|
+
* @internal
|
|
46
|
+
*/
|
|
47
|
+
export declare function registerInvalidationCallback(attempt?: number): void;
|
|
@@ -11,7 +11,17 @@ const require_fs__internal = require('./_internal.js');
|
|
|
11
11
|
* `invalidatePathCache` with `paths/rewire.ts` so test-time path overrides
|
|
12
12
|
* flush the cache; the registration is the module's only side effect, so
|
|
13
13
|
* callers that just need to flush the cache imperatively can call
|
|
14
|
-
* `invalidatePathCache()` directly without that side effect repeating.
|
|
14
|
+
* `invalidatePathCache()` directly without that side effect repeating. The
|
|
15
|
+
* registration is deferred to a microtask (`registerInvalidationCallback`)
|
|
16
|
+
* rather than run at top-level module load. This module sits in a require
|
|
17
|
+
* cycle (`allowed-dirs-cache → _internal → paths/socket → …`); in the bundled
|
|
18
|
+
* CJS the `registerCacheInvalidation` import binding from `paths/rewire` is
|
|
19
|
+
* not yet initialized when this module first evaluates, so a synchronous
|
|
20
|
+
* top-level call threw `registerCacheInvalidation is not defined` at require
|
|
21
|
+
* time. Deferring to a microtask runs the call after the module graph has
|
|
22
|
+
* settled, breaking the init-order hazard while keeping the load-time
|
|
23
|
+
* registration contract (the callback is in place before any test hook
|
|
24
|
+
* fires).
|
|
15
25
|
*/
|
|
16
26
|
/**
|
|
17
27
|
* Invalidate the cached allowed directories. Called automatically by the
|
|
@@ -28,7 +38,32 @@ const require_fs__internal = require('./_internal.js');
|
|
|
28
38
|
function invalidatePathCache() {
|
|
29
39
|
require_fs__internal.clearAllowedDirectories();
|
|
30
40
|
}
|
|
31
|
-
|
|
41
|
+
/**
|
|
42
|
+
* Register `invalidatePathCache` with the rewire module after the current
|
|
43
|
+
* module-init turn, so the circular import is fully wired before the call.
|
|
44
|
+
* Guarded + self-rescheduling: in the require cycle (`allowed-dirs-cache →
|
|
45
|
+
* _internal → paths/socket → … → rewire`) the `registerCacheInvalidation` live
|
|
46
|
+
* binding can still be in its temporal dead zone when the first microtask fires
|
|
47
|
+
* under some import orders (vitest loads many modules concurrently), throwing
|
|
48
|
+
* `registerCacheInvalidation is not defined`. So check the binding is callable;
|
|
49
|
+
* if not, re-defer to the next microtask. The registration is a test-seam
|
|
50
|
+
* best-effort (it lets path-rewire flush this cache), so a bounded retry that
|
|
51
|
+
* lands on a later turn is correct — and a never-resolving binding (production,
|
|
52
|
+
* where rewire is unused) simply stops retrying without throwing.
|
|
53
|
+
*
|
|
54
|
+
* @internal
|
|
55
|
+
*/
|
|
56
|
+
function registerInvalidationCallback(attempt = 0) {
|
|
57
|
+
try {
|
|
58
|
+
if (typeof require_paths_rewire.registerCacheInvalidation === "function") {
|
|
59
|
+
require_paths_rewire.registerCacheInvalidation(invalidatePathCache);
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
} catch {}
|
|
63
|
+
if (attempt < 10) queueMicrotask(() => registerInvalidationCallback(attempt + 1));
|
|
64
|
+
}
|
|
65
|
+
queueMicrotask(() => registerInvalidationCallback());
|
|
32
66
|
|
|
33
67
|
//#endregion
|
|
34
|
-
exports.invalidatePathCache = invalidatePathCache;
|
|
68
|
+
exports.invalidatePathCache = invalidatePathCache;
|
|
69
|
+
exports.registerInvalidationCallback = registerInvalidationCallback;
|
package/dist/fs/find.js
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
5
6
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
6
7
|
const require_node_fs = require('../node/fs.js');
|
|
7
8
|
const require_node_path = require('../node/path.js');
|
|
8
9
|
const require_process_abort = require('../process/abort.js');
|
|
9
|
-
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
10
10
|
const require_smol_path = require('../smol/path.js');
|
|
11
11
|
const require_paths_walk = require('../paths/walk.js');
|
|
12
12
|
let node_process = require("node:process");
|
|
@@ -30,6 +30,13 @@
|
|
|
30
30
|
* CWDs would get separate cache entries — correct but pessimistic.
|
|
31
31
|
*/
|
|
32
32
|
import type { JsonValue } from '../json/types';
|
|
33
|
+
export interface CacheEntry {
|
|
34
|
+
ino: number;
|
|
35
|
+
size: number;
|
|
36
|
+
mtimeMs: number;
|
|
37
|
+
parsed: JsonValue;
|
|
38
|
+
insertedAt: number;
|
|
39
|
+
}
|
|
33
40
|
/**
|
|
34
41
|
* Drop all cached entries. Tests call this between cases that depend on a fresh
|
|
35
42
|
* read; long-running daemons can call it on file-watcher invalidation events
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_node_path = require('../node/path.js');
|
|
6
|
-
let node_module = require("node:module");
|
|
7
6
|
let node_process = require("node:process");
|
|
8
7
|
node_process = require_runtime.__toESM(node_process);
|
|
8
|
+
let node_module = require("node:module");
|
|
9
9
|
|
|
10
10
|
//#region src/fs/resolve-module.ts
|
|
11
11
|
/**
|
|
@@ -32,7 +32,11 @@ function requireResolveFrom(fromDir, specifier, options) {
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
function requireResolveFromCwd(specifier, options) {
|
|
35
|
-
|
|
35
|
+
options = {
|
|
36
|
+
__proto__: null,
|
|
37
|
+
...options
|
|
38
|
+
};
|
|
39
|
+
return options?.nothrow ? requireResolveFrom(node_process.default.cwd(), specifier, { nothrow: true }) : requireResolveFrom(node_process.default.cwd(), specifier);
|
|
36
40
|
}
|
|
37
41
|
|
|
38
42
|
//#endregion
|
package/dist/fs/safe.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
4
5
|
const require_primordials_string = require('../primordials/string.js');
|
|
5
6
|
const require_paths__internal = require('../paths/_internal.js');
|
|
6
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
@@ -8,7 +9,6 @@ const require_node_fs = require('../node/fs.js');
|
|
|
8
9
|
const require_node_path = require('../node/path.js');
|
|
9
10
|
const require_errors_predicates = require('../errors/predicates.js');
|
|
10
11
|
const require_primordials_globals = require('../primordials/globals.js');
|
|
11
|
-
const require_arrays_predicates = require('../arrays/predicates.js');
|
|
12
12
|
const require_objects_mutate = require('../objects/mutate.js');
|
|
13
13
|
const require_promises_retry = require('../promises/retry.js');
|
|
14
14
|
const require_fs__internal = require('./_internal.js');
|