@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
|
@@ -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_primordials_string = require('../../primordials/string.js');
|
|
5
4
|
const require_primordials_object = require('../../primordials/object.js');
|
|
5
|
+
const require_primordials_string = require('../../primordials/string.js');
|
|
6
6
|
const require_smol_manifest = require('../../smol/manifest.js');
|
|
7
7
|
const require_eco_cargo_lockfile_format = require('../cargo/lockfile-format.js');
|
|
8
8
|
const require_eco_cargo_manifest_format = require('../cargo/manifest-format.js');
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
* shipped fix has a matching fixture directory there.
|
|
42
42
|
*/
|
|
43
43
|
import type { DepType, PackageRef, ParsedLockfile } from '../../manifest/types';
|
|
44
|
-
interface RawPackage {
|
|
44
|
+
export interface RawPackage {
|
|
45
45
|
readonly name?: unknown | undefined;
|
|
46
46
|
readonly version?: unknown | undefined;
|
|
47
47
|
readonly resolved?: unknown | undefined;
|
|
@@ -54,12 +54,12 @@ interface RawPackage {
|
|
|
54
54
|
readonly dependencies?: unknown | undefined;
|
|
55
55
|
readonly requires?: unknown | undefined;
|
|
56
56
|
}
|
|
57
|
-
interface RawLockfile {
|
|
57
|
+
export interface RawLockfile {
|
|
58
58
|
readonly lockfileVersion?: unknown | undefined;
|
|
59
59
|
readonly packages?: Record<string, RawPackage> | undefined;
|
|
60
60
|
readonly dependencies?: Record<string, RawPackage> | undefined;
|
|
61
61
|
}
|
|
62
|
-
type PackageIndex = Record<string, number | number[]>;
|
|
62
|
+
export type PackageIndex = Record<string, number | number[]>;
|
|
63
63
|
export declare function addToIndex(packageIndex: PackageIndex, name: string, idx: number): void;
|
|
64
64
|
export declare function buildPackageRef(name: string, pkg: RawPackage): PackageRef;
|
|
65
65
|
export declare function jsParsePackageLock(content: string): ParsedLockfile;
|
|
@@ -67,4 +67,3 @@ export declare function parseV1(data: RawLockfile, rootDeps: Record<string, RawP
|
|
|
67
67
|
export declare function parseV2V3(data: RawLockfile, rawPackages: Record<string, RawPackage>): ParsedLockfile;
|
|
68
68
|
export declare function resolveDepType(pkg: RawPackage): DepType;
|
|
69
69
|
export declare const parsePackageLock: (content: string) => ParsedLockfile;
|
|
70
|
-
export {};
|
|
@@ -2,11 +2,11 @@
|
|
|
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_object = require('../../../primordials/object.js');
|
|
5
6
|
const require_primordials_string = require('../../../primordials/string.js');
|
|
6
|
-
const require_primordials_array = require('../../../primordials/array.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_smol_manifest = require('../../../smol/manifest.js');
|
|
12
12
|
const require_eco_manifest_manifest_error = require('../../manifest/manifest-error.js');
|
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
* and downstream consumers can re-validate if they care.
|
|
10
10
|
*/
|
|
11
11
|
import type { DepType, ManifestDep, ParsedManifest } from '../manifest/types';
|
|
12
|
+
export interface RawManifest {
|
|
13
|
+
readonly name?: unknown | undefined;
|
|
14
|
+
readonly version?: unknown | undefined;
|
|
15
|
+
readonly description?: unknown | undefined;
|
|
16
|
+
readonly license?: unknown | undefined;
|
|
17
|
+
readonly repository?: unknown | undefined;
|
|
18
|
+
readonly dependencies?: unknown | undefined;
|
|
19
|
+
readonly devDependencies?: unknown | undefined;
|
|
20
|
+
readonly peerDependencies?: unknown | undefined;
|
|
21
|
+
readonly optionalDependencies?: unknown | undefined;
|
|
22
|
+
}
|
|
12
23
|
export declare function addDeps(dependencies: ManifestDep[], obj: unknown, type: DepType): void;
|
|
13
24
|
export declare function asOptionalString(value: unknown): string | undefined;
|
|
14
25
|
export declare function jsParsePackageJson(content: string): ParsedManifest;
|
|
@@ -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_array = require('../../primordials/array.js');
|
|
5
6
|
const require_primordials_json = require('../../primordials/json.js');
|
|
6
|
-
const require_primordials_object = require('../../primordials/object.js');
|
|
7
7
|
const require_errors_message = require('../../errors/message.js');
|
|
8
8
|
const require_smol_manifest = require('../../smol/manifest.js');
|
|
9
9
|
const require_eco_manifest_manifest_error = require('../manifest/manifest-error.js');
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
* fixture directory there.
|
|
43
43
|
*/
|
|
44
44
|
import type { DepType, PackageRef, ParsedLockfile } from '../../manifest/types';
|
|
45
|
-
type PackageIndex = Record<string, number | number[]>;
|
|
46
|
-
interface PnpmEntry {
|
|
45
|
+
export type PackageIndex = Record<string, number | number[]>;
|
|
46
|
+
export interface PnpmEntry {
|
|
47
47
|
name: string;
|
|
48
48
|
version: string;
|
|
49
49
|
resolved: string | undefined;
|
|
@@ -59,6 +59,9 @@ interface PnpmEntry {
|
|
|
59
59
|
dependencies: string[];
|
|
60
60
|
_inDeps: boolean;
|
|
61
61
|
}
|
|
62
|
+
export interface ImporterState {
|
|
63
|
+
section: 'prod' | 'dev' | 'optional' | undefined;
|
|
64
|
+
}
|
|
62
65
|
export declare function addToPnpmIndex(packageIndex: PackageIndex, name: string, idx: number): void;
|
|
63
66
|
export declare function freezeEntry(entry: PnpmEntry): PackageRef;
|
|
64
67
|
export declare function indentOf(line: string): number;
|
|
@@ -66,4 +69,3 @@ export declare function jsParsePnpmLock(content: string): ParsedLockfile;
|
|
|
66
69
|
export declare function newPnpmEntry(name: string, version: string): PnpmEntry;
|
|
67
70
|
export declare function stripPeerSuffix(version: string): string;
|
|
68
71
|
export declare const parsePnpmLock: (content: string) => ParsedLockfile;
|
|
69
|
-
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
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_regexp = require('../../../primordials/regexp.js');
|
|
6
7
|
const require_primordials_array = require('../../../primordials/array.js');
|
|
7
|
-
const require_primordials_object = require('../../../primordials/object.js');
|
|
8
8
|
const require_smol_manifest = require('../../../smol/manifest.js');
|
|
9
9
|
const require_eco_npm_pnpm_detect_pnpm_version = require('./detect-pnpm-version.js');
|
|
10
10
|
const require_eco_npm_pnpm_parse_pnpm_package_id_v5 = require('./parse-pnpm-package-id-v5.js');
|
|
@@ -163,7 +163,7 @@ function jsParsePnpmLock(content) {
|
|
|
163
163
|
if (!inPackages && !inSnapshots) continue;
|
|
164
164
|
const indent = indentOf(line);
|
|
165
165
|
if (indent >= 2 && indent <= 4 && require_primordials_string.StringPrototypeEndsWith(trimmed, ":") && trimmed.length > 1 && (currentPkg === void 0 || indent <= currentIndent)) {
|
|
166
|
-
if (currentPkg
|
|
166
|
+
if (currentPkg?.name) {
|
|
167
167
|
require_primordials_array.ArrayPrototypePush(packages, freezeEntry(currentPkg));
|
|
168
168
|
addToPnpmIndex(packageIndex, currentPkg.name, packages.length - 1);
|
|
169
169
|
}
|
|
@@ -200,7 +200,7 @@ function jsParsePnpmLock(content) {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
|
-
if (currentPkg
|
|
203
|
+
if (currentPkg?.name) {
|
|
204
204
|
require_primordials_array.ArrayPrototypePush(packages, freezeEntry(currentPkg));
|
|
205
205
|
addToPnpmIndex(packageIndex, currentPkg.name, packages.length - 1);
|
|
206
206
|
}
|
|
@@ -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_primordials_array = require('../../../../primordials/array.js');
|
|
5
4
|
const require_primordials_map_set = require('../../../../primordials/map-set.js');
|
|
5
|
+
const require_primordials_array = require('../../../../primordials/array.js');
|
|
6
6
|
const require_debug_namespace = require('../../../../debug/namespace.js');
|
|
7
7
|
const require_bin_exec = require('../../../../bin/exec.js');
|
|
8
8
|
const require_eco_npm_npm_flags = require('../../npm/flags.js');
|
|
@@ -47,7 +47,7 @@ export interface YarnEntryState {
|
|
|
47
47
|
isOptional: boolean;
|
|
48
48
|
linkType: string | undefined;
|
|
49
49
|
}
|
|
50
|
-
type PackageIndex = Record<string, number | number[]>;
|
|
50
|
+
export type PackageIndex = Record<string, number | number[]>;
|
|
51
51
|
export declare function addToYarnIndex(packageIndex: PackageIndex, name: string, idx: number): void;
|
|
52
52
|
export declare function consumeDependenciesMeta(content: string, startPos: number, _entry: YarnEntryState): number;
|
|
53
53
|
export declare function consumeDependencyList(content: string, startPos: number, deps: string[]): number;
|
|
@@ -58,4 +58,3 @@ export declare function skipIndentedBlock(content: string, startPos: number): nu
|
|
|
58
58
|
export declare function stripQuotes(s: string): string;
|
|
59
59
|
export declare function valueAfterKey(line: string, keyLen: number): string;
|
|
60
60
|
export declare const parseYarnLock: (content: string) => ParsedLockfile;
|
|
61
|
-
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const
|
|
4
|
+
const require_primordials_object = require('../../../../primordials/object.js');
|
|
5
5
|
const require_primordials_string = require('../../../../primordials/string.js');
|
|
6
|
+
const require_primordials_math = require('../../../../primordials/math.js');
|
|
6
7
|
const require_primordials_array = require('../../../../primordials/array.js');
|
|
7
|
-
const require_primordials_object = require('../../../../primordials/object.js');
|
|
8
8
|
const require_smol_manifest = require('../../../../smol/manifest.js');
|
|
9
9
|
const require_eco_npm_yarnpkg_yarn_parse_yarn_descriptor = require('./parse-yarn-descriptor.js');
|
|
10
10
|
|
package/dist/env/proxy.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_primordials_map_set = require('../primordials/map-set.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
6
6
|
const require_primordials_globals = require('../primordials/globals.js');
|
|
7
7
|
const require_env_case_insensitive = require('./case-insensitive.js');
|
|
8
8
|
|
package/dist/env/rewire.d.ts
CHANGED
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
* - Compatible with vi.stubEnv() - reads from process.env as final fallback
|
|
9
9
|
* - Thread-safe for concurrent test execution
|
|
10
10
|
*/
|
|
11
|
-
import
|
|
11
|
+
import { getNodeAsyncHooks } from '../node/async-hooks';
|
|
12
|
+
export type EnvOverrides = Map<string, string | undefined>;
|
|
12
13
|
/**
|
|
13
14
|
* Clear a specific environment variable override.
|
|
14
15
|
*
|
|
@@ -24,11 +25,13 @@ import type * as asyncHooksModule from 'node:async_hooks';
|
|
|
24
25
|
*/
|
|
25
26
|
export declare function clearEnv(key: string): void;
|
|
26
27
|
/**
|
|
27
|
-
* Lazily load the async_hooks module
|
|
28
|
+
* Lazily load the async_hooks module. Aliases the canonical `node/async-hooks`
|
|
29
|
+
* accessor (single owner of the bundler-safe require); kept as an export so
|
|
30
|
+
* this module's surface is unchanged.
|
|
28
31
|
*
|
|
29
32
|
* @private
|
|
30
33
|
*/
|
|
31
|
-
export declare
|
|
34
|
+
export declare const getAsyncHooks: typeof getNodeAsyncHooks;
|
|
32
35
|
/**
|
|
33
36
|
* Get an environment variable value, checking overrides first.
|
|
34
37
|
*
|
package/dist/env/rewire.js
CHANGED
|
@@ -2,10 +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_primordials_map_set = require('../primordials/map-set.js');
|
|
6
5
|
const require_primordials_object = require('../primordials/object.js');
|
|
7
6
|
const require_objects_predicates = require('../objects/predicates.js');
|
|
8
7
|
const require_env_boolean = require('./boolean.js');
|
|
8
|
+
const require_node_async_hooks = require('../node/async-hooks.js');
|
|
9
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
9
10
|
let node_process = require("node:process");
|
|
10
11
|
node_process = require_runtime.__toESM(node_process);
|
|
11
12
|
|
|
@@ -20,8 +21,7 @@ node_process = require_runtime.__toESM(node_process);
|
|
|
20
21
|
* - Compatible with vi.stubEnv() - reads from process.env as final fallback
|
|
21
22
|
* - Thread-safe for concurrent test execution
|
|
22
23
|
*/
|
|
23
|
-
|
|
24
|
-
const { AsyncLocalStorage } = getAsyncHooks();
|
|
24
|
+
const { AsyncLocalStorage } = require_node_async_hooks.getNodeAsyncHooks();
|
|
25
25
|
const isolatedOverridesStorage = new AsyncLocalStorage();
|
|
26
26
|
const sharedOverridesSymbol = Symbol.for("@socketsecurity/lib/env/rewire/test-overrides");
|
|
27
27
|
const globalThisRef = globalThis;
|
|
@@ -44,14 +44,13 @@ function clearEnv(key) {
|
|
|
44
44
|
sharedOverrides?.delete(key);
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
|
-
* Lazily load the async_hooks module
|
|
47
|
+
* Lazily load the async_hooks module. Aliases the canonical `node/async-hooks`
|
|
48
|
+
* accessor (single owner of the bundler-safe require); kept as an export so
|
|
49
|
+
* this module's surface is unchanged.
|
|
48
50
|
*
|
|
49
51
|
* @private
|
|
50
52
|
*/
|
|
51
|
-
|
|
52
|
-
if (asyncHooks === void 0) asyncHooks = /*@__PURE__*/ require("node:async_hooks");
|
|
53
|
-
return asyncHooks;
|
|
54
|
-
}
|
|
53
|
+
const getAsyncHooks = require_node_async_hooks.getNodeAsyncHooks;
|
|
55
54
|
/**
|
|
56
55
|
* Get an environment variable value, checking overrides first.
|
|
57
56
|
*
|
package/dist/env/socket.d.ts
CHANGED
|
@@ -321,6 +321,13 @@ export declare function getSocketRegistryUrl(): string | undefined;
|
|
|
321
321
|
* @returns The repository name, or `undefined` if neither is set
|
|
322
322
|
*/
|
|
323
323
|
export declare function getSocketRepositoryName(): string | undefined;
|
|
324
|
+
/**
|
|
325
|
+
* SOCKET_STATE_DIR environment variable getter. Overrides the default Socket
|
|
326
|
+
* state directory (~/.socket/_state) location.
|
|
327
|
+
*
|
|
328
|
+
* @returns The state directory path, or `undefined` if not set
|
|
329
|
+
*/
|
|
330
|
+
export declare function getSocketStateDirEnv(): string | undefined;
|
|
324
331
|
/**
|
|
325
332
|
* SOCKET_VIEW_ALL_RISKS environment variable getter. Whether to view all Socket
|
|
326
333
|
* Security risks.
|
package/dist/env/socket.js
CHANGED
|
@@ -377,6 +377,15 @@ function getSocketRepositoryName() {
|
|
|
377
377
|
return require_env_rewire.getEnvValue("SOCKET_REPOSITORY_NAME") || require_env_rewire.getEnvValue("SOCKET_REPO_NAME");
|
|
378
378
|
}
|
|
379
379
|
/**
|
|
380
|
+
* SOCKET_STATE_DIR environment variable getter. Overrides the default Socket
|
|
381
|
+
* state directory (~/.socket/_state) location.
|
|
382
|
+
*
|
|
383
|
+
* @returns The state directory path, or `undefined` if not set
|
|
384
|
+
*/
|
|
385
|
+
function getSocketStateDirEnv() {
|
|
386
|
+
return require_env_rewire.getEnvValue("SOCKET_STATE_DIR");
|
|
387
|
+
}
|
|
388
|
+
/**
|
|
380
389
|
* SOCKET_VIEW_ALL_RISKS environment variable getter. Whether to view all Socket
|
|
381
390
|
* Security risks.
|
|
382
391
|
*
|
|
@@ -425,5 +434,6 @@ exports.getSocketOauthRequiredScopes = require_env_socket_mcp.getSocketOauthRequ
|
|
|
425
434
|
exports.getSocketOrgSlug = getSocketOrgSlug;
|
|
426
435
|
exports.getSocketRegistryUrl = getSocketRegistryUrl;
|
|
427
436
|
exports.getSocketRepositoryName = getSocketRepositoryName;
|
|
437
|
+
exports.getSocketStateDirEnv = getSocketStateDirEnv;
|
|
428
438
|
exports.getSocketViewAllRisks = getSocketViewAllRisks;
|
|
429
439
|
exports.getTrustProxy = require_env_socket_mcp.getTrustProxy;
|
package/dist/env/xdg.d.ts
CHANGED
|
@@ -47,3 +47,20 @@ export declare function getXdgConfigHome(): string | undefined;
|
|
|
47
47
|
* @returns The XDG data directory path, or `undefined` if not set
|
|
48
48
|
*/
|
|
49
49
|
export declare function getXdgDataHome(): string | undefined;
|
|
50
|
+
/**
|
|
51
|
+
* XDG_RUNTIME_DIR environment variable. XDG Base Directory specification
|
|
52
|
+
* runtime directory — the home for ephemeral, owner-only runtime objects
|
|
53
|
+
* (daemon sockets, locks). Set by systemd to `/run/user/<uid>`; absent on
|
|
54
|
+
* macOS and many non-systemd setups, so callers must provide a fallback.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ;```typescript
|
|
58
|
+
* import { getXdgRuntimeDir } from '@socketsecurity/lib/env/xdg'
|
|
59
|
+
*
|
|
60
|
+
* const runtimeDir = getXdgRuntimeDir()
|
|
61
|
+
* // e.g. '/run/user/1000' or undefined
|
|
62
|
+
* ```
|
|
63
|
+
*
|
|
64
|
+
* @returns The XDG runtime directory path, or `undefined` if not set
|
|
65
|
+
*/
|
|
66
|
+
export declare function getXdgRuntimeDir(): string | undefined;
|
package/dist/env/xdg.js
CHANGED
|
@@ -59,8 +59,28 @@ function getXdgConfigHome() {
|
|
|
59
59
|
function getXdgDataHome() {
|
|
60
60
|
return require_env_rewire.getEnvValue("XDG_DATA_HOME");
|
|
61
61
|
}
|
|
62
|
+
/**
|
|
63
|
+
* XDG_RUNTIME_DIR environment variable. XDG Base Directory specification
|
|
64
|
+
* runtime directory — the home for ephemeral, owner-only runtime objects
|
|
65
|
+
* (daemon sockets, locks). Set by systemd to `/run/user/<uid>`; absent on
|
|
66
|
+
* macOS and many non-systemd setups, so callers must provide a fallback.
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ;```typescript
|
|
70
|
+
* import { getXdgRuntimeDir } from '@socketsecurity/lib/env/xdg'
|
|
71
|
+
*
|
|
72
|
+
* const runtimeDir = getXdgRuntimeDir()
|
|
73
|
+
* // e.g. '/run/user/1000' or undefined
|
|
74
|
+
* ```
|
|
75
|
+
*
|
|
76
|
+
* @returns The XDG runtime directory path, or `undefined` if not set
|
|
77
|
+
*/
|
|
78
|
+
function getXdgRuntimeDir() {
|
|
79
|
+
return require_env_rewire.getEnvValue("XDG_RUNTIME_DIR");
|
|
80
|
+
}
|
|
62
81
|
|
|
63
82
|
//#endregion
|
|
64
83
|
exports.getXdgCacheHome = getXdgCacheHome;
|
|
65
84
|
exports.getXdgConfigHome = getXdgConfigHome;
|
|
66
|
-
exports.getXdgDataHome = getXdgDataHome;
|
|
85
|
+
exports.getXdgDataHome = getXdgDataHome;
|
|
86
|
+
exports.getXdgRuntimeDir = getXdgRuntimeDir;
|
|
@@ -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_primordials_string = require('../primordials/string.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
6
6
|
|
|
7
7
|
//#region src/errors/predicates.ts
|
|
8
8
|
/**
|
package/dist/errors/stack.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_errors_predicates = require('./predicates.js');
|
|
5
4
|
let src_external_pony_cause = require("../external/pony-cause");
|
|
6
5
|
|
|
7
6
|
//#region src/errors/stack.ts
|
|
@@ -19,7 +18,7 @@ let src_external_pony_cause = require("../external/pony-cause");
|
|
|
19
18
|
* errorStack(e) })` safely.
|
|
20
19
|
*/
|
|
21
20
|
function errorStack(value) {
|
|
22
|
-
if (
|
|
21
|
+
if (isError(value)) return (0, src_external_pony_cause.stackWithCauses)(value);
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
//#endregion
|