@socketsecurity/lib 6.0.7 → 6.0.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -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 +82 -0
- package/dist/ai/route.js +171 -0
- package/dist/ai/spawn.d.mts +42 -2
- package/dist/ai/spawn.js +146 -33
- 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 +25 -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 +23322 -18018
- package/dist/bin/resolve.js +2 -2
- package/dist/cache/ttl/store.js +2 -2
- 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 +5 -1
- package/dist/compression/gzip.js +5 -1
- package/dist/config/layers.d.ts +53 -0
- package/dist/config/layers.js +83 -0
- 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/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/lockfile.js +5 -2
- 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 +2 -2
- package/dist/env/proxy.js +1 -1
- package/dist/env/rewire.d.ts +6 -3
- package/dist/env/rewire.js +7 -8
- package/dist/env/socket.d.ts +7 -0
- package/dist/env/socket.js +10 -0
- package/dist/env/xdg.d.ts +17 -0
- package/dist/env/xdg.js +21 -1
- package/dist/errors/predicates.js +1 -1
- package/dist/errors/stack.js +1 -2
- package/dist/external/@npmcli/package-json.js +3455 -4881
- package/dist/external/@npmcli/promise-spawn.js +3 -1
- package/dist/external/@yarnpkg/extensions.js +1 -1
- package/dist/external/external-pack.js +1 -1
- package/dist/external/npm-pack.js +29164 -31799
- package/dist/external/pico-pack.js +4 -2
- package/dist/external/tar-fs.js +63 -16
- 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/detect-platform-arch.js +1 -1
- 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 +2 -2
- 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 +11 -4
- 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/python/uv-install.d.ts +89 -0
- package/dist/external-tools/python/uv-install.js +165 -0
- 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/from-uv.d.ts +30 -0
- package/dist/external-tools/skillspector/from-uv.js +56 -0
- package/dist/external-tools/skillspector/resolve.d.ts +20 -5
- package/dist/external-tools/skillspector/resolve.js +27 -6
- package/dist/external-tools/skillspector/types.d.ts +3 -1
- 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/external-tools/uv/asset-names.d.ts +36 -0
- package/dist/external-tools/uv/asset-names.js +73 -0
- package/dist/external-tools/uv/from-download.d.ts +17 -0
- package/dist/external-tools/uv/from-download.js +50 -0
- package/dist/external-tools/uv/from-path.d.ts +5 -0
- package/dist/external-tools/uv/from-path.js +22 -0
- package/dist/external-tools/uv/from-vfs.d.ts +7 -0
- package/dist/external-tools/uv/from-vfs.js +26 -0
- package/dist/external-tools/uv/resolve.d.ts +25 -0
- package/dist/external-tools/uv/resolve.js +61 -0
- package/dist/external-tools/uv/types.d.ts +24 -0
- package/dist/external-tools/uv/types.js +2 -0
- package/dist/fleet/repo-config.d.ts +53 -0
- package/dist/fleet/repo-config.js +79 -0
- package/dist/fs/allowed-dirs-cache.d.ts +27 -1
- package/dist/fs/allowed-dirs-cache.js +39 -6
- package/dist/fs/copy.d.ts +88 -0
- package/dist/fs/copy.js +89 -0
- 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 +3 -3
- 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/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 +7 -3
- package/dist/http-request/checksum-file.js +1 -1
- 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 +124 -71
- package/dist/integrity.js +168 -78
- package/dist/json/edit.js +38 -30
- package/dist/json/format.js +1 -1
- package/dist/logger/colors.d.ts +1 -2
- package/dist/logger/colors.js +2 -2
- package/dist/logger/symbols-builder.js +7 -8
- package/dist/logger/symbols.js +8 -8
- 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.d.ts +73 -2
- package/dist/node/module.js +97 -12
- 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/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 +2 -2
- package/dist/packages/licenses.js +2 -2
- package/dist/packages/manifest.d.ts +29 -0
- package/dist/packages/manifest.js +40 -4
- package/dist/packages/normalize.js +2 -2
- package/dist/packages/provenance.js +3 -3
- 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/_internal.d.ts +1 -7
- package/dist/paths/_internal.js +9 -15
- package/dist/paths/conversion.js +1 -1
- package/dist/paths/dirnames.d.ts +1 -0
- package/dist/paths/dirnames.js +2 -0
- package/dist/paths/normalize.js +1 -1
- package/dist/paths/predicates.js +2 -1
- package/dist/paths/resolve.js +14 -19
- package/dist/paths/rewire.d.ts +5 -0
- package/dist/paths/socket.d.ts +137 -123
- package/dist/paths/socket.js +172 -131
- package/dist/perf/metrics.js +1 -1
- package/dist/perf/report.js +1 -1
- 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/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/broker.d.ts +35 -0
- package/dist/secrets/broker.js +72 -0
- package/dist/secrets/find.d.ts +8 -6
- package/dist/secrets/find.js +25 -5
- 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/smol/detect.js +1 -1
- package/dist/smol/http.js +1 -1
- package/dist/smol/https.js +1 -1
- package/dist/smol/manifest.js +1 -1
- package/dist/smol/path.js +1 -1
- package/dist/smol/primordial.js +1 -1
- package/dist/smol/purl.js +1 -1
- package/dist/smol/versions.js +1 -1
- package/dist/smol/vfs.js +1 -1
- package/dist/sorts/_internal.d.ts +1 -2
- package/dist/sorts/_internal.js +2 -6
- package/dist/sorts/semver.js +2 -2
- 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 +6 -2
- package/dist/stdio/prompts.d.ts +2 -10
- package/dist/stdio/prompts.js +11 -24
- package/dist/strings/format.js +1 -1
- package/dist/strings/search.js +1 -1
- package/dist/temporal/instant.js +2 -2
- package/dist/themes/context.d.ts +5 -3
- package/dist/themes/context.js +5 -6
- 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/llms.txt +750 -0
- package/package.json +253 -125
package/dist/bin/resolve.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_constants_platform = require('../constants/platform.js');
|
|
5
4
|
const require_primordials_string = require('../primordials/string.js');
|
|
5
|
+
const require_constants_platform = require('../constants/platform.js');
|
|
6
6
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
7
7
|
const require_node_fs = require('../node/fs.js');
|
|
8
8
|
const require_node_path = require('../node/path.js');
|
|
@@ -102,7 +102,7 @@ function resolveRealBinSync(binPath) {
|
|
|
102
102
|
}
|
|
103
103
|
}
|
|
104
104
|
/* c8 ignore start - Windows-only wrapper-script resolution; tested
|
|
105
|
-
on Windows runners. The whole `if (WIN32)` block parses npm/npx/ // socket-
|
|
105
|
+
on Windows runners. The whole `if (WIN32)` block parses npm/npx/ // socket-lint: allow npx
|
|
106
106
|
pnpm/yarn .cmd/.bat/.ps1 shims to extract the underlying CLI JS
|
|
107
107
|
path. Unreachable on macOS/Linux. */
|
|
108
108
|
if (require_constants_platform.WIN32) {
|
package/dist/cache/ttl/store.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_error = require('../../primordials/error.js');
|
|
5
|
-
const require_primordials_math = require('../../primordials/math.js');
|
|
6
5
|
const require_primordials_string = require('../../primordials/string.js');
|
|
7
|
-
const
|
|
6
|
+
const require_primordials_math = require('../../primordials/math.js');
|
|
8
7
|
const require_primordials_map_set = require('../../primordials/map-set.js');
|
|
8
|
+
const require_primordials_regexp = require('../../primordials/regexp.js');
|
|
9
9
|
const require_primordials_date = require('../../primordials/date.js');
|
|
10
10
|
const require_primordials_json = require('../../primordials/json.js');
|
|
11
11
|
const require_cacache_clear = require('../../cacache/clear.js');
|
|
@@ -10,14 +10,20 @@
|
|
|
10
10
|
* error)
|
|
11
11
|
*/
|
|
12
12
|
import type { PrimordialsCheckConfig, PrimordialsCheckResult, PrimordialsFinding } from '../checks/primordials';
|
|
13
|
-
interface ParsedArgs {
|
|
13
|
+
export interface ParsedArgs {
|
|
14
14
|
readonly config: string | undefined;
|
|
15
15
|
readonly json: boolean;
|
|
16
16
|
readonly explain: boolean;
|
|
17
17
|
readonly silent: boolean;
|
|
18
18
|
readonly help: boolean;
|
|
19
19
|
}
|
|
20
|
-
interface
|
|
20
|
+
export interface RawConfig {
|
|
21
|
+
scanDirs?: unknown | undefined;
|
|
22
|
+
aliasMap?: unknown | undefined;
|
|
23
|
+
nodeInternalOnly?: unknown | undefined;
|
|
24
|
+
socketLibPrimordialsPath?: unknown | undefined;
|
|
25
|
+
}
|
|
26
|
+
export interface SerializedFinding {
|
|
21
27
|
kind: PrimordialsFinding['kind'];
|
|
22
28
|
name: string;
|
|
23
29
|
files: readonly string[];
|
|
@@ -41,4 +47,3 @@ export declare function serialize(result: PrimordialsCheckResult): {
|
|
|
41
47
|
used: number;
|
|
42
48
|
findings: SerializedFinding[];
|
|
43
49
|
};
|
|
44
|
-
export {};
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
-
const
|
|
6
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
7
7
|
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
8
|
+
const require_primordials_array = require('../primordials/array.js');
|
|
8
9
|
const require_primordials_json = require('../primordials/json.js');
|
|
9
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
10
10
|
const require_errors_message = require('../errors/message.js');
|
|
11
11
|
const require_logger_default = require('../logger/default.js');
|
|
12
12
|
const require_argv_parse = require('../argv/parse.js');
|
|
13
13
|
const require_checks_primordials_defaults = require('../checks/primordials-defaults.js');
|
|
14
14
|
const require_checks_primordials = require('../checks/primordials.js');
|
|
15
15
|
let node_fs = require("node:fs");
|
|
16
|
-
let node_path = require("node:path");
|
|
17
|
-
node_path = require_runtime.__toESM(node_path);
|
|
18
16
|
let node_process = require("node:process");
|
|
19
17
|
node_process = require_runtime.__toESM(node_process);
|
|
18
|
+
let node_path = require("node:path");
|
|
19
|
+
node_path = require_runtime.__toESM(node_path);
|
|
20
20
|
|
|
21
21
|
//#region src/cli/check-primordials.ts
|
|
22
22
|
/**
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
-
const require_primordials_string = require('../primordials/string.js');
|
|
7
6
|
const require_primordials_object = require('../primordials/object.js');
|
|
7
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
8
8
|
let node_path = require("node:path");
|
|
9
9
|
node_path = require_runtime.__toESM(node_path);
|
|
10
10
|
|
|
@@ -10,7 +10,7 @@ import type { Buffer } from 'node:buffer';
|
|
|
10
10
|
import type { BrotliOptions } from 'node:zlib';
|
|
11
11
|
import type { CompressFileOptions, CompressOptions } from './types';
|
|
12
12
|
export declare const BROTLI_EXTS: ReadonlySet<string>;
|
|
13
|
-
interface ResolvedBrotliOptions extends BrotliOptions {
|
|
13
|
+
export interface ResolvedBrotliOptions extends BrotliOptions {
|
|
14
14
|
params: NonNullable<BrotliOptions['params']>;
|
|
15
15
|
}
|
|
16
16
|
/**
|
|
@@ -79,4 +79,3 @@ export declare function isBrotliCompressed(input: Buffer): boolean;
|
|
|
79
79
|
* coverage.
|
|
80
80
|
*/
|
|
81
81
|
export declare function resolveBrotliOptions(options: CompressOptions | undefined): ResolvedBrotliOptions;
|
|
82
|
-
export {};
|
|
@@ -11,8 +11,8 @@ const require_compression__internal = require('./_internal.js');
|
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
12
|
let node_path = require("node:path");
|
|
13
13
|
node_path = require_runtime.__toESM(node_path);
|
|
14
|
-
let node_util = require("node:util");
|
|
15
14
|
let node_stream_promises = require("node:stream/promises");
|
|
15
|
+
let node_util = require("node:util");
|
|
16
16
|
let node_zlib = require("node:zlib");
|
|
17
17
|
|
|
18
18
|
//#region src/compression/brotli.ts
|
|
@@ -88,6 +88,10 @@ function isBrotliCompressed(input) {
|
|
|
88
88
|
* coverage.
|
|
89
89
|
*/
|
|
90
90
|
function resolveBrotliOptions(options) {
|
|
91
|
+
options = {
|
|
92
|
+
__proto__: null,
|
|
93
|
+
...options
|
|
94
|
+
};
|
|
91
95
|
const level = options?.level ?? 11;
|
|
92
96
|
const params = { [node_zlib.constants.BROTLI_PARAM_QUALITY]: level };
|
|
93
97
|
if (options?.size !== void 0 && options.size > 0) params[node_zlib.constants.BROTLI_PARAM_SIZE_HINT] = options.size;
|
package/dist/compression/gzip.js
CHANGED
|
@@ -11,8 +11,8 @@ const require_compression__internal = require('./_internal.js');
|
|
|
11
11
|
let node_fs = require("node:fs");
|
|
12
12
|
let node_path = require("node:path");
|
|
13
13
|
node_path = require_runtime.__toESM(node_path);
|
|
14
|
-
let node_util = require("node:util");
|
|
15
14
|
let node_stream_promises = require("node:stream/promises");
|
|
15
|
+
let node_util = require("node:util");
|
|
16
16
|
let node_zlib = require("node:zlib");
|
|
17
17
|
|
|
18
18
|
//#region src/compression/gzip.ts
|
|
@@ -87,6 +87,10 @@ function isGzipCompressed(input) {
|
|
|
87
87
|
* coverage.
|
|
88
88
|
*/
|
|
89
89
|
function resolveGzipOptions(options) {
|
|
90
|
+
options = {
|
|
91
|
+
__proto__: null,
|
|
92
|
+
...options
|
|
93
|
+
};
|
|
90
94
|
const level = options?.level;
|
|
91
95
|
if (level === void 0) return { __proto__: null };
|
|
92
96
|
return {
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Read a layered config — a base config that higher layers may override
|
|
3
|
+
* or extend. Generic over the layer directories, the base name, and the file
|
|
4
|
+
* extension: `readConfigLayers('vitest', { dirs: ['.config/base',
|
|
5
|
+
* '.config/local'] })` reads each `<dir>/vitest.json` in precedence order and
|
|
6
|
+
* returns the layers that exist. Callers apply their own merge, because merge
|
|
7
|
+
* policy varies (a denylist unions all layers; an allowlist takes the highest
|
|
8
|
+
* layer that declares one; an array key concatenates). `mergeConfigArray`
|
|
9
|
+
* covers the concat case across any number of layers. No fleet knowledge
|
|
10
|
+
* lives here — the fleet-convention `.config/fleet` + `.config/repo` wrapper
|
|
11
|
+
* is `fleet/repo-config`'s `resolveRepoConfig`, a thin layer over this
|
|
12
|
+
* reader.
|
|
13
|
+
*/
|
|
14
|
+
export interface ReadConfigLayersOptions {
|
|
15
|
+
dirs: readonly string[];
|
|
16
|
+
rootDir?: string | undefined;
|
|
17
|
+
cwd?: string | undefined;
|
|
18
|
+
ext?: string | undefined;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Concatenate one array-valued key across all layers — the common merge for a
|
|
22
|
+
* list that higher layers EXTEND rather than replace (e.g. extra exclude
|
|
23
|
+
* globs). Layers contribute in precedence order; a non-array value for the key
|
|
24
|
+
* (or a missing key, or an `undefined` layer) contributes nothing.
|
|
25
|
+
*
|
|
26
|
+
* @param layers - The layers from `readConfigLayers` (or any object array).
|
|
27
|
+
* @param key - The array-valued property to concatenate.
|
|
28
|
+
*
|
|
29
|
+
* @returns Each layer's entries in order; `[]` when no layer has the array.
|
|
30
|
+
*/
|
|
31
|
+
export declare function mergeConfigArray<T extends Record<string, unknown>, K extends keyof T>(layers: ReadonlyArray<T | undefined>, key: K): Array<T[K] extends Array<infer E> ? E : never>;
|
|
32
|
+
/**
|
|
33
|
+
* Read a named config from an ordered list of layer directories.
|
|
34
|
+
*
|
|
35
|
+
* For each dir in `dirs`, reads `<rootDir>/<dir>/<name><ext>`; layers that are
|
|
36
|
+
* absent or unparseable are skipped (never throws — config reads are
|
|
37
|
+
* best-effort). The returned array preserves `dirs` order (lowest precedence
|
|
38
|
+
* first), so the last element is the highest-precedence layer present.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ;```typescript
|
|
42
|
+
* const layers = readConfigLayers<VitestConfig>('vitest', {
|
|
43
|
+
* dirs: ['.config/base', '.config/team', '.config/local'],
|
|
44
|
+
* })
|
|
45
|
+
* // layers === every one of those that existed, in that order
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @param name - Base name of the config file (no directory, no extension).
|
|
49
|
+
* @param options - Layer dirs + resolution options.
|
|
50
|
+
*
|
|
51
|
+
* @returns Parsed layers in precedence order; empty when none exist.
|
|
52
|
+
*/
|
|
53
|
+
export declare function readConfigLayers<T = unknown>(name: string, options: ReadConfigLayersOptions): T[];
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_node_path = require('../node/path.js');
|
|
5
|
+
const require_fs_read_json = require('../fs/read-json.js');
|
|
6
|
+
const require_primordials_process = require('../primordials/process.js');
|
|
7
|
+
const require_git_repo = require('../git/repo.js');
|
|
8
|
+
|
|
9
|
+
//#region src/config/layers.ts
|
|
10
|
+
/**
|
|
11
|
+
* @file Read a layered config — a base config that higher layers may override
|
|
12
|
+
* or extend. Generic over the layer directories, the base name, and the file
|
|
13
|
+
* extension: `readConfigLayers('vitest', { dirs: ['.config/base',
|
|
14
|
+
* '.config/local'] })` reads each `<dir>/vitest.json` in precedence order and
|
|
15
|
+
* returns the layers that exist. Callers apply their own merge, because merge
|
|
16
|
+
* policy varies (a denylist unions all layers; an allowlist takes the highest
|
|
17
|
+
* layer that declares one; an array key concatenates). `mergeConfigArray`
|
|
18
|
+
* covers the concat case across any number of layers. No fleet knowledge
|
|
19
|
+
* lives here — the fleet-convention `.config/fleet` + `.config/repo` wrapper
|
|
20
|
+
* is `fleet/repo-config`'s `resolveRepoConfig`, a thin layer over this
|
|
21
|
+
* reader.
|
|
22
|
+
*/
|
|
23
|
+
/**
|
|
24
|
+
* Concatenate one array-valued key across all layers — the common merge for a
|
|
25
|
+
* list that higher layers EXTEND rather than replace (e.g. extra exclude
|
|
26
|
+
* globs). Layers contribute in precedence order; a non-array value for the key
|
|
27
|
+
* (or a missing key, or an `undefined` layer) contributes nothing.
|
|
28
|
+
*
|
|
29
|
+
* @param layers - The layers from `readConfigLayers` (or any object array).
|
|
30
|
+
* @param key - The array-valued property to concatenate.
|
|
31
|
+
*
|
|
32
|
+
* @returns Each layer's entries in order; `[]` when no layer has the array.
|
|
33
|
+
*/
|
|
34
|
+
function mergeConfigArray(layers, key) {
|
|
35
|
+
const out = [];
|
|
36
|
+
for (let i = 0, { length } = layers; i < length; i += 1) {
|
|
37
|
+
const value = layers[i]?.[key];
|
|
38
|
+
if (Array.isArray(value)) out.push(...value);
|
|
39
|
+
}
|
|
40
|
+
return out;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Read a named config from an ordered list of layer directories.
|
|
44
|
+
*
|
|
45
|
+
* For each dir in `dirs`, reads `<rootDir>/<dir>/<name><ext>`; layers that are
|
|
46
|
+
* absent or unparseable are skipped (never throws — config reads are
|
|
47
|
+
* best-effort). The returned array preserves `dirs` order (lowest precedence
|
|
48
|
+
* first), so the last element is the highest-precedence layer present.
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ;```typescript
|
|
52
|
+
* const layers = readConfigLayers<VitestConfig>('vitest', {
|
|
53
|
+
* dirs: ['.config/base', '.config/team', '.config/local'],
|
|
54
|
+
* })
|
|
55
|
+
* // layers === every one of those that existed, in that order
|
|
56
|
+
* ```
|
|
57
|
+
*
|
|
58
|
+
* @param name - Base name of the config file (no directory, no extension).
|
|
59
|
+
* @param options - Layer dirs + resolution options.
|
|
60
|
+
*
|
|
61
|
+
* @returns Parsed layers in precedence order; empty when none exist.
|
|
62
|
+
*/
|
|
63
|
+
function readConfigLayers(name, options) {
|
|
64
|
+
const opts = {
|
|
65
|
+
__proto__: null,
|
|
66
|
+
...options
|
|
67
|
+
};
|
|
68
|
+
const path = require_node_path.getNodePath();
|
|
69
|
+
const cwd = opts.cwd ?? require_primordials_process.processCwd();
|
|
70
|
+
const rootDir = opts.rootDir ?? require_git_repo.findGitRoot(cwd);
|
|
71
|
+
const file = `${name}${opts.ext ?? ".json"}`;
|
|
72
|
+
const layers = [];
|
|
73
|
+
const { dirs } = opts;
|
|
74
|
+
for (let i = 0, { length } = dirs; i < length; i += 1) {
|
|
75
|
+
const value = require_fs_read_json.readJsonSync(path.join(rootDir, dirs[i], file), { throws: false });
|
|
76
|
+
if (value !== void 0) layers.push(value);
|
|
77
|
+
}
|
|
78
|
+
return layers;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
//#endregion
|
|
82
|
+
exports.mergeConfigArray = mergeConfigArray;
|
|
83
|
+
exports.readConfigLayers = readConfigLayers;
|
|
@@ -17,5 +17,8 @@ export declare function getLifecycleScriptNames(): string[];
|
|
|
17
17
|
export declare function getPackageDefaultNodeRange(): string | undefined;
|
|
18
18
|
export declare function getPackageDefaultSocketCategories(): readonly string[];
|
|
19
19
|
export declare function getPackageExtensions(): Iterable<[string, unknown]>;
|
|
20
|
+
export declare class BoundedPackumentCache extends Map<string, unknown> {
|
|
21
|
+
set(key: string, value: unknown): this;
|
|
22
|
+
}
|
|
20
23
|
export declare function getPackumentCache(): Map<string, unknown>;
|
|
21
24
|
export declare function getPacoteCachePath(): string;
|
|
@@ -2,9 +2,9 @@
|
|
|
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_primordials_object = require('../primordials/object.js');
|
|
5
6
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
6
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
8
8
|
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
9
9
|
const require_constants_lifecycle_script_names = require('./lifecycle-script-names.js');
|
|
10
10
|
const require_constants_package_default_node_range = require('./package-default-node-range.js');
|
|
@@ -85,6 +85,7 @@ function getPacoteCachePath() {
|
|
|
85
85
|
|
|
86
86
|
//#endregion
|
|
87
87
|
exports.AT_LATEST = AT_LATEST;
|
|
88
|
+
exports.BoundedPackumentCache = BoundedPackumentCache;
|
|
88
89
|
exports.LATEST = LATEST;
|
|
89
90
|
exports.PACKAGE = PACKAGE;
|
|
90
91
|
exports.PACKAGE_DEFAULT_VERSION = PACKAGE_DEFAULT_VERSION;
|
|
@@ -21,12 +21,8 @@ export declare const SOCKET_GITHUB_ORG = "SocketDev";
|
|
|
21
21
|
export declare const SOCKET_REGISTRY_REPO_NAME = "socket-registry";
|
|
22
22
|
export declare const SOCKET_REGISTRY_PACKAGE_NAME = "@socketsecurity/registry";
|
|
23
23
|
export declare const SOCKET_REGISTRY_NPM_ORG = "socketregistry";
|
|
24
|
-
export declare const
|
|
25
|
-
export declare const
|
|
26
|
-
export declare const SOCKET_FIREWALL_APP_NAME = "sfw";
|
|
27
|
-
export declare const SOCKET_REGISTRY_APP_NAME = "registry";
|
|
28
|
-
export declare const SOCKET_WHEELHOUSE_APP_NAME = "wheelhouse";
|
|
29
|
-
export declare const SOCKET_APP_PREFIX = "_";
|
|
24
|
+
export declare const SOCKET_DIR_PREFIX = "_";
|
|
25
|
+
export declare const SOCKET_DIR: Readonly<Record<'cacache' | 'dlx' | 'state' | 'wheelhouse', string>>;
|
|
30
26
|
export declare const SOCKET_LIB_NAME = "@socketsecurity/lib";
|
|
31
27
|
export declare const SOCKET_LIB_VERSION: string;
|
|
32
28
|
export declare const SOCKET_IPC_HANDSHAKE = "SOCKET_IPC_HANDSHAKE";
|
package/dist/constants/socket.js
CHANGED
|
@@ -26,14 +26,16 @@ const SOCKET_GITHUB_ORG = "SocketDev";
|
|
|
26
26
|
const SOCKET_REGISTRY_REPO_NAME = "socket-registry";
|
|
27
27
|
const SOCKET_REGISTRY_PACKAGE_NAME = "@socketsecurity/registry";
|
|
28
28
|
const SOCKET_REGISTRY_NPM_ORG = "socketregistry";
|
|
29
|
-
const
|
|
30
|
-
const
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
29
|
+
const SOCKET_DIR_PREFIX = "_";
|
|
30
|
+
const SOCKET_DIR = {
|
|
31
|
+
__proto__: null,
|
|
32
|
+
cacache: `${"_"}cacache`,
|
|
33
|
+
dlx: `${"_"}dlx`,
|
|
34
|
+
state: `${"_"}state`,
|
|
35
|
+
wheelhouse: `${"_"}wheelhouse`
|
|
36
|
+
};
|
|
35
37
|
const SOCKET_LIB_NAME = "@socketsecurity/lib";
|
|
36
|
-
const SOCKET_LIB_VERSION = "6.0.
|
|
38
|
+
const SOCKET_LIB_VERSION = "6.0.9";
|
|
37
39
|
const SOCKET_IPC_HANDSHAKE = "SOCKET_IPC_HANDSHAKE";
|
|
38
40
|
const CACHE_SOCKET_API_DIR = "socket-api";
|
|
39
41
|
const REGISTRY = "registry";
|
|
@@ -45,14 +47,12 @@ exports.REGISTRY = REGISTRY;
|
|
|
45
47
|
exports.REGISTRY_SCOPE_DELIMITER = REGISTRY_SCOPE_DELIMITER;
|
|
46
48
|
exports.SOCKET_API_BASE_URL = SOCKET_API_BASE_URL;
|
|
47
49
|
exports.SOCKET_API_TOKENS_URL = SOCKET_API_TOKENS_URL;
|
|
48
|
-
exports.SOCKET_APP_PREFIX = SOCKET_APP_PREFIX;
|
|
49
|
-
exports.SOCKET_CLI_APP_NAME = SOCKET_CLI_APP_NAME;
|
|
50
50
|
exports.SOCKET_CONTACT_URL = SOCKET_CONTACT_URL;
|
|
51
51
|
exports.SOCKET_DASHBOARD_URL = SOCKET_DASHBOARD_URL;
|
|
52
|
-
exports.
|
|
52
|
+
exports.SOCKET_DIR = SOCKET_DIR;
|
|
53
|
+
exports.SOCKET_DIR_PREFIX = SOCKET_DIR_PREFIX;
|
|
53
54
|
exports.SOCKET_DOCS_CONTACT_URL = SOCKET_DOCS_CONTACT_URL;
|
|
54
55
|
exports.SOCKET_DOCS_URL = SOCKET_DOCS_URL;
|
|
55
|
-
exports.SOCKET_FIREWALL_APP_NAME = SOCKET_FIREWALL_APP_NAME;
|
|
56
56
|
exports.SOCKET_GITHUB_ORG = SOCKET_GITHUB_ORG;
|
|
57
57
|
exports.SOCKET_IPC_HANDSHAKE = SOCKET_IPC_HANDSHAKE;
|
|
58
58
|
exports.SOCKET_LIB_NAME = SOCKET_LIB_NAME;
|
|
@@ -61,12 +61,10 @@ exports.SOCKET_OVERRIDE_SCOPE = SOCKET_OVERRIDE_SCOPE;
|
|
|
61
61
|
exports.SOCKET_PRICING_URL = SOCKET_PRICING_URL;
|
|
62
62
|
exports.SOCKET_PUBLIC_API_KEY = SOCKET_PUBLIC_API_KEY;
|
|
63
63
|
exports.SOCKET_PUBLIC_API_TOKEN = SOCKET_PUBLIC_API_TOKEN;
|
|
64
|
-
exports.SOCKET_REGISTRY_APP_NAME = SOCKET_REGISTRY_APP_NAME;
|
|
65
64
|
exports.SOCKET_REGISTRY_NPM_ORG = SOCKET_REGISTRY_NPM_ORG;
|
|
66
65
|
exports.SOCKET_REGISTRY_PACKAGE_NAME = SOCKET_REGISTRY_PACKAGE_NAME;
|
|
67
66
|
exports.SOCKET_REGISTRY_REPO_NAME = SOCKET_REGISTRY_REPO_NAME;
|
|
68
67
|
exports.SOCKET_REGISTRY_SCOPE = SOCKET_REGISTRY_SCOPE;
|
|
69
68
|
exports.SOCKET_SECURITY_SCOPE = SOCKET_SECURITY_SCOPE;
|
|
70
69
|
exports.SOCKET_STATUS_URL = SOCKET_STATUS_URL;
|
|
71
|
-
exports.SOCKET_WEBSITE_URL = SOCKET_WEBSITE_URL;
|
|
72
|
-
exports.SOCKET_WHEELHOUSE_APP_NAME = SOCKET_WHEELHOUSE_APP_NAME;
|
|
70
|
+
exports.SOCKET_WEBSITE_URL = SOCKET_WEBSITE_URL;
|
package/dist/cover/code.js
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
7
|
+
const require_objects_predicates = require('../objects/predicates.js');
|
|
6
8
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
9
|
const require_node_fs = require('../node/fs.js');
|
|
8
10
|
const require_node_path = require('../node/path.js');
|
|
9
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
10
11
|
const require_fs_read_json = require('../fs/read-json.js');
|
|
11
|
-
const require_objects_predicates = require('../objects/predicates.js');
|
|
12
12
|
const require_process_spawn_child = require('../process/spawn/child.js');
|
|
13
13
|
let node_process = require("node:process");
|
|
14
14
|
node_process = require_runtime.__toESM(node_process);
|
package/dist/crypto/hash.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Crypto hash helpers that prefer Node builtins where available. Probes
|
|
3
3
|
* `node:crypto.hash()` (added v21.7.0 / v20.12.0) and falls back to the
|
|
4
|
-
* streaming `createHash().update().digest()` chain on older runtimes.
|
|
4
|
+
* streaming `createHash().update().digest()` chain on older runtimes. Which
|
|
5
|
+
* digest goes where (integrity = sha512 trust boundary; checksum = sha256
|
|
6
|
+
* interop shape; cache keys = truncated, never trust): see
|
|
7
|
+
* `docs/hash-algorithms.md`.
|
|
5
8
|
*/
|
|
6
9
|
import type { hash as NodeHash } from 'node:crypto';
|
|
7
10
|
/**
|
package/dist/crypto/hash.js
CHANGED
|
@@ -7,7 +7,10 @@ const require_node_crypto = require('../node/crypto.js');
|
|
|
7
7
|
/**
|
|
8
8
|
* @file Crypto hash helpers that prefer Node builtins where available. Probes
|
|
9
9
|
* `node:crypto.hash()` (added v21.7.0 / v20.12.0) and falls back to the
|
|
10
|
-
* streaming `createHash().update().digest()` chain on older runtimes.
|
|
10
|
+
* streaming `createHash().update().digest()` chain on older runtimes. Which
|
|
11
|
+
* digest goes where (integrity = sha512 trust boundary; checksum = sha256
|
|
12
|
+
* interop shape; cache keys = truncated, never trust): see
|
|
13
|
+
* `docs/hash-algorithms.md`.
|
|
11
14
|
*/
|
|
12
15
|
let cachedNativeHash;
|
|
13
16
|
let nativeHashProbed = false;
|
package/dist/dlx/arborist.js
CHANGED
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
6
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
8
|
const require_node_fs = require('../node/fs.js');
|
|
8
9
|
const require_node_path = require('../node/path.js');
|
|
9
10
|
const require_primordials_json = require('../primordials/json.js');
|
|
10
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
11
11
|
const require_paths_socket = require('../paths/socket.js');
|
|
12
12
|
let src_external__npmcli_arborist = require("../external/@npmcli/arborist");
|
|
13
13
|
src_external__npmcli_arborist = require_runtime.__toESM(src_external__npmcli_arborist);
|
|
@@ -37,6 +37,10 @@ src_external__npmcli_arborist = require_runtime.__toESM(src_external__npmcli_arb
|
|
|
37
37
|
* false.
|
|
38
38
|
*/
|
|
39
39
|
function getBaseArboristOptions(installPath, options) {
|
|
40
|
+
options = {
|
|
41
|
+
__proto__: null,
|
|
42
|
+
...options
|
|
43
|
+
};
|
|
40
44
|
return {
|
|
41
45
|
__proto__: null,
|
|
42
46
|
path: installPath,
|
|
@@ -97,7 +101,10 @@ function readTopLevelFromIdealTree(tree, targetName) {
|
|
|
97
101
|
async function safeIdealTree(options) {
|
|
98
102
|
const fs = require_node_fs.getNodeFs();
|
|
99
103
|
const path = require_node_path.getNodePath();
|
|
100
|
-
const { before, path: installPath, quiet = true } =
|
|
104
|
+
const { before, path: installPath, quiet = true } = {
|
|
105
|
+
__proto__: null,
|
|
106
|
+
...options
|
|
107
|
+
};
|
|
101
108
|
const targetName = readSingleDependency(path.join(installPath, "package.json"));
|
|
102
109
|
const arb = new src_external__npmcli_arborist.default({
|
|
103
110
|
...getBaseArboristOptions(installPath, { quiet }),
|
|
@@ -125,7 +132,10 @@ async function safeIdealTree(options) {
|
|
|
125
132
|
* This is the strongest form of pinning pnpm/npm offer.
|
|
126
133
|
*/
|
|
127
134
|
async function safeReify(options) {
|
|
128
|
-
const { packageLock = true, path: installPath, quiet = true } =
|
|
135
|
+
const { packageLock = true, path: installPath, quiet = true } = {
|
|
136
|
+
__proto__: null,
|
|
137
|
+
...options
|
|
138
|
+
};
|
|
129
139
|
/* c8 ignore next - External Arborist call */
|
|
130
140
|
await new src_external__npmcli_arborist.default({
|
|
131
141
|
...getBaseArboristOptions(installPath, { quiet }),
|
package/dist/dlx/binary-cache.js
CHANGED
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_string = require('../primordials/string.js');
|
|
6
|
+
const require_objects_predicates = require('../objects/predicates.js');
|
|
6
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
7
8
|
const require_node_fs = require('../node/fs.js');
|
|
8
9
|
const require_node_path = require('../node/path.js');
|
|
9
10
|
const require_primordials_date = require('../primordials/date.js');
|
|
10
11
|
const require_primordials_json = require('../primordials/json.js');
|
|
11
12
|
const require_fs_read_json = require('../fs/read-json.js');
|
|
12
|
-
const require_objects_predicates = require('../objects/predicates.js');
|
|
13
13
|
const require_paths_socket = require('../paths/socket.js');
|
|
14
14
|
const require_fs_safe = require('../fs/safe.js');
|
|
15
15
|
const require_constants_time = require('../constants/time.js');
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_error = require('../primordials/error.js');
|
|
6
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
6
7
|
const require_constants_platform = require('../constants/platform.js');
|
|
7
8
|
const require_paths_normalize = require('../paths/normalize.js');
|
|
8
9
|
const require_node_fs = require('../node/fs.js');
|
|
9
10
|
const require_node_path = require('../node/path.js');
|
|
10
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
11
11
|
const require_fs_read_json = require('../fs/read-json.js');
|
|
12
12
|
const require_dlx__internal = require('./_internal.js');
|
|
13
13
|
let src_external_libnpmexec = require("../external/libnpmexec");
|
package/dist/dlx/detect.d.ts
CHANGED
|
@@ -11,6 +11,14 @@
|
|
|
11
11
|
* - DLX cache: Check for node_modules/ directory
|
|
12
12
|
* - Local paths: Check for package.json with bin field, then file extension
|
|
13
13
|
*/
|
|
14
|
+
export type PackageJsonPathEntry = {
|
|
15
|
+
path: string | undefined;
|
|
16
|
+
at: number;
|
|
17
|
+
};
|
|
18
|
+
export type PackageJsonCacheEntry = {
|
|
19
|
+
mtimeMs: number;
|
|
20
|
+
content: object | undefined;
|
|
21
|
+
};
|
|
14
22
|
export type ExecutableType = 'package' | 'binary' | 'unknown';
|
|
15
23
|
export interface ExecutableDetectionResult {
|
|
16
24
|
type: ExecutableType;
|
package/dist/dlx/firewall.d.ts
CHANGED
|
@@ -8,6 +8,14 @@
|
|
|
8
8
|
* other dlx flows without dragging in the install orchestrator.
|
|
9
9
|
*/
|
|
10
10
|
import type Arborist from '../external/@npmcli/arborist';
|
|
11
|
+
export interface FirewallAlert {
|
|
12
|
+
severity?: string | undefined;
|
|
13
|
+
type?: string | undefined;
|
|
14
|
+
key?: string | undefined;
|
|
15
|
+
}
|
|
16
|
+
export interface FirewallResponse {
|
|
17
|
+
alerts?: FirewallAlert[] | undefined;
|
|
18
|
+
}
|
|
11
19
|
/**
|
|
12
20
|
* Check all resolved packages in an Arborist ideal tree against the Socket
|
|
13
21
|
* Firewall API (public, no auth required). Throws if any dependency has
|
package/dist/dlx/lockfile.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
-
const require_integrity = require('../integrity.js');
|
|
6
5
|
const require_primordials_string = require('../primordials/string.js');
|
|
6
|
+
const require_integrity = require('../integrity.js');
|
|
7
7
|
const require_node_fs = require('../node/fs.js');
|
|
8
8
|
const require_node_path = require('../node/path.js');
|
|
9
9
|
const require_primordials_date = require('../primordials/date.js');
|
|
@@ -66,7 +66,10 @@ var DlxLockfileError = class extends Error {
|
|
|
66
66
|
async function resolveNpmPackagePin(options) {
|
|
67
67
|
const fs = require_node_fs.getNodeFs();
|
|
68
68
|
const path = require_node_path.getNodePath();
|
|
69
|
-
const { minReleaseDays, minReleaseMins, spec } =
|
|
69
|
+
const { minReleaseDays, minReleaseMins, spec } = {
|
|
70
|
+
__proto__: null,
|
|
71
|
+
...options
|
|
72
|
+
};
|
|
70
73
|
if (typeof spec !== "string" || spec.length === 0) throw new DlxLockfileError("resolveNpmPackagePin requires a package spec");
|
|
71
74
|
if (minReleaseDays !== void 0 && minReleaseMins !== void 0) throw new DlxLockfileError("resolveNpmPackagePin: minReleaseDays and minReleaseMins are mutually exclusive");
|
|
72
75
|
const effectiveDays = minReleaseDays !== void 0 ? minReleaseDays : minReleaseMins !== void 0 ? void 0 : 7;
|
package/dist/dlx/manifest.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_object = require('../primordials/object.js');
|
|
4
5
|
const require_node_fs = require('../node/fs.js');
|
|
5
6
|
const require_node_path = require('../node/path.js');
|
|
6
7
|
const require_primordials_date = require('../primordials/date.js');
|
|
7
8
|
const require_primordials_json = require('../primordials/json.js');
|
|
8
|
-
const require_primordials_object = require('../primordials/object.js');
|
|
9
9
|
const require_errors_message = require('../errors/message.js');
|
|
10
10
|
const require_logger_default = require('../logger/default.js');
|
|
11
11
|
const require_paths_socket = require('../paths/socket.js');
|
package/dist/dlx/package.js
CHANGED
|
@@ -79,6 +79,10 @@ const rangeOperatorsRegExp = /[~^><=xX* ]|\|\|/;
|
|
|
79
79
|
* ```
|
|
80
80
|
*/
|
|
81
81
|
async function dlxPackage(args, options, spawnExtra) {
|
|
82
|
+
options = {
|
|
83
|
+
__proto__: null,
|
|
84
|
+
...options
|
|
85
|
+
};
|
|
82
86
|
const downloadResult = await downloadNpmPackage(options);
|
|
83
87
|
const spawnPromise = executePackage(downloadResult.binaryPath, args, options.spawnOptions, spawnExtra);
|
|
84
88
|
return {
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
* test/fixtures/sdxgen-bug-regressions/ cargo-patch-unused-no-leak/.
|
|
41
41
|
*/
|
|
42
42
|
import type { PackageRef, ParsedLockfile } from '../manifest/types';
|
|
43
|
-
type PackageIndex = Record<string, number | number[]>;
|
|
43
|
+
export type PackageIndex = Record<string, number | number[]>;
|
|
44
44
|
export interface CargoEntryState {
|
|
45
45
|
name: string;
|
|
46
46
|
version: string;
|
|
@@ -81,4 +81,3 @@ export declare function stripTomlString(value: string): string;
|
|
|
81
81
|
*/
|
|
82
82
|
export declare function valueAfterEquals(line: string): string;
|
|
83
83
|
export declare const parseCargoLock: (content: string) => ParsedLockfile;
|
|
84
|
-
export {};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_object = require('../../primordials/object.js');
|
|
4
5
|
const require_primordials_string = require('../../primordials/string.js');
|
|
5
6
|
const require_primordials_array = require('../../primordials/array.js');
|
|
6
|
-
const require_primordials_object = require('../../primordials/object.js');
|
|
7
7
|
|
|
8
8
|
//#region src/eco/cargo/parse-lockfile.ts
|
|
9
9
|
/**
|
|
@@ -100,7 +100,7 @@ function jsParseCargoLock(content) {
|
|
|
100
100
|
const trimmed = require_primordials_string.StringPrototypeTrim(line);
|
|
101
101
|
if (trimmed.length === 0 || trimmed[0] === "#") continue;
|
|
102
102
|
if (trimmed[0] === "[") {
|
|
103
|
-
if (currentEntry
|
|
103
|
+
if (currentEntry?.name) {
|
|
104
104
|
require_primordials_array.ArrayPrototypePush(packages, freezeCargoEntry(currentEntry));
|
|
105
105
|
addToCargoIndex(packageIndex, currentEntry.name, packages.length - 1);
|
|
106
106
|
}
|
|
@@ -131,7 +131,7 @@ function jsParseCargoLock(content) {
|
|
|
131
131
|
}
|
|
132
132
|
} else if (require_primordials_string.StringPrototypeIndexOf(trimmed, "version") === 0) lockVersion = stripTomlString(valueAfterEquals(trimmed));
|
|
133
133
|
}
|
|
134
|
-
if (currentEntry
|
|
134
|
+
if (currentEntry?.name) {
|
|
135
135
|
require_primordials_array.ArrayPrototypePush(packages, freezeCargoEntry(currentEntry));
|
|
136
136
|
addToCargoIndex(packageIndex, currentEntry.name, packages.length - 1);
|
|
137
137
|
}
|