@socketsecurity/lib 6.0.5 → 6.0.7
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 +43 -0
- package/dist/ai/discover.d.mts +2 -2
- package/dist/ai/discover.js +6 -4
- package/dist/ai/spawn.js +10 -6
- package/dist/ai/types.d.mts +18 -6
- package/dist/ai/worktree.d.mts +6 -6
- package/dist/ai/worktree.js +12 -7
- package/dist/ansi/strip.d.ts +1 -1
- package/dist/ansi/strip.js +0 -2
- package/dist/archives/_internal.js +7 -9
- package/dist/archives/extract.js +1 -1
- package/dist/archives/tar.js +6 -6
- package/dist/archives/zip.js +4 -6
- package/dist/argv/flag-predicates.d.ts +12 -12
- package/dist/argv/flag-predicates.js +17 -17
- package/dist/argv/flag-types.d.ts +18 -18
- package/dist/argv/flag-types.js +4 -4
- package/dist/argv/parse.d.ts +1 -1
- package/dist/arrays/_internal.js +11 -12
- package/dist/arrays/chunk.js +0 -1
- package/dist/arrays/join.d.ts +37 -3
- package/dist/arrays/join.js +43 -7
- package/dist/arrays/unique.js +0 -1
- package/dist/bin/_internal.d.ts +1 -1
- package/dist/bin/_internal.js +1 -1
- package/dist/bin/acorn-bindgen.cjs +769 -0
- package/dist/bin/acorn.wasm +0 -0
- package/dist/bin/exec.js +2 -3
- package/dist/bin/find.js +13 -13
- package/dist/bin/prim.cjs +39244 -0
- package/dist/bin/resolve.js +12 -13
- package/dist/bin/which.js +8 -8
- package/dist/cache/ttl/store.js +5 -5
- package/dist/checks/primordials-defaults.d.ts +3 -3
- package/dist/checks/primordials-defaults.js +3 -3
- package/dist/checks/primordials.js +4 -3
- package/dist/{bin → cli}/check-primordials.d.ts +11 -11
- package/dist/{bin → cli}/check-primordials.js +56 -52
- package/dist/{bin → cli}/check.js +6 -5
- package/dist/{bin → cli}/socket-lib.d.ts +1 -1
- package/dist/{bin → cli}/socket-lib.js +4 -4
- package/dist/colors/socket-palette.js +7 -9
- package/dist/compression/_internal.d.ts +12 -12
- package/dist/compression/_internal.js +20 -19
- package/dist/compression/brotli.d.ts +25 -25
- package/dist/compression/brotli.js +37 -44
- package/dist/compression/gzip.d.ts +23 -23
- package/dist/compression/gzip.js +44 -52
- package/dist/constants/agents.d.ts +3 -1
- package/dist/constants/agents.js +15 -11
- package/dist/constants/licenses.js +3 -3
- package/dist/constants/node.d.ts +23 -0
- package/dist/constants/node.js +47 -15
- package/dist/constants/packages.js +22 -28
- package/dist/constants/platform.d.ts +30 -3
- package/dist/constants/platform.js +72 -12
- package/dist/constants/runtime.d.ts +22 -0
- package/dist/constants/runtime.js +32 -0
- package/dist/constants/socket.js +1 -1
- package/dist/cover/code.js +8 -8
- package/dist/cover/formatters.js +5 -5
- package/dist/crypto/hash.d.ts +26 -1
- package/dist/crypto/hash.js +43 -12
- package/dist/debug/_internal.js +4 -6
- package/dist/debug/caller-info.js +2 -3
- package/dist/debug/namespace.d.ts +7 -0
- package/dist/debug/namespace.js +21 -12
- package/dist/debug/output.js +21 -24
- package/dist/debug/types.d.ts +4 -4
- package/dist/dlx/arborist.js +6 -6
- package/dist/dlx/binary-cache.js +14 -14
- package/dist/dlx/binary-download.d.ts +1 -1
- package/dist/dlx/binary-download.js +14 -13
- package/dist/dlx/binary-resolution.js +16 -14
- package/dist/dlx/binary-types.d.ts +5 -5
- package/dist/dlx/binary.js +5 -5
- package/dist/dlx/cache.js +1 -1
- package/dist/dlx/detect.d.ts +34 -25
- package/dist/dlx/detect.js +86 -77
- package/dist/dlx/dir.js +2 -2
- package/dist/dlx/firewall.d.ts +1 -1
- package/dist/dlx/lockfile.d.ts +19 -18
- package/dist/dlx/lockfile.js +16 -16
- package/dist/dlx/manifest.d.ts +6 -6
- package/dist/dlx/manifest.js +5 -5
- package/dist/dlx/package.d.ts +10 -10
- package/dist/dlx/package.js +16 -16
- package/dist/dlx/packages.js +4 -4
- package/dist/dlx/paths.js +7 -7
- package/dist/dlx/spec.js +1 -1
- package/dist/dlx/types.d.ts +28 -27
- package/dist/eco/cargo/parse-lockfile.d.ts +1 -1
- package/dist/eco/cargo/parse-lockfile.js +2 -2
- package/dist/eco/manifest/analyze-lockfile.js +2 -2
- package/dist/eco/manifest/detect-format.js +4 -4
- package/dist/eco/manifest/find-packages.js +2 -2
- package/dist/eco/manifest/get-package-versions.js +2 -2
- package/dist/eco/manifest/get-package.js +2 -2
- package/dist/eco/manifest/parse-lockfile.js +2 -2
- package/dist/eco/manifest/parse-manifest.js +2 -2
- package/dist/eco/manifest/parse.js +2 -2
- package/dist/eco/npm/npm/exec.js +2 -2
- package/dist/eco/npm/npm/flags.js +7 -12
- package/dist/eco/npm/npm/parse-lockfile.d.ts +14 -14
- package/dist/eco/npm/npm/parse-lockfile.js +3 -3
- package/dist/eco/npm/parse-package-json.js +3 -3
- package/dist/eco/npm/pnpm/exec.d.ts +1 -1
- package/dist/eco/npm/pnpm/exec.js +5 -5
- package/dist/eco/npm/pnpm/flags.js +0 -3
- package/dist/eco/npm/pnpm/parse-lockfile.d.ts +1 -1
- package/dist/eco/npm/pnpm/parse-lockfile.js +4 -4
- package/dist/eco/npm/script.js +9 -6
- package/dist/eco/npm/yarnpkg/yarn/exec.js +3 -3
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +2 -2
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +8 -8
- package/dist/effects/pulse-frames.d.ts +3 -1
- package/dist/effects/shimmer-keyframes.d.ts +1 -1
- package/dist/effects/shimmer-terminal.d.ts +1 -1
- package/dist/env/boolean.js +0 -1
- package/dist/env/ci.js +0 -1
- package/dist/env/debug.js +0 -1
- package/dist/env/github-status.d.ts +51 -0
- package/dist/env/github-status.js +90 -0
- package/dist/env/github.js +0 -8
- package/dist/env/home.js +0 -1
- package/dist/env/locale.js +0 -3
- package/dist/env/node-auth-token.js +0 -1
- package/dist/env/node-env.js +0 -1
- package/dist/env/node-version-managers.d.ts +53 -0
- package/dist/env/node-version-managers.js +90 -0
- package/dist/env/npm.js +0 -5
- package/dist/env/number.js +0 -1
- package/dist/env/package-manager.js +3 -6
- package/dist/env/path.js +0 -1
- package/dist/env/pre-commit.js +1 -2
- package/dist/env/rewire.d.ts +7 -6
- package/dist/env/rewire.js +15 -16
- package/dist/env/shell.js +0 -1
- package/dist/env/socket-cli.js +5 -18
- package/dist/env/socket-mcp.d.ts +114 -0
- package/dist/env/socket-mcp.js +146 -0
- package/dist/env/socket.d.ts +1 -109
- package/dist/env/socket.js +12 -166
- package/dist/env/string.js +0 -1
- package/dist/env/temp-dir.js +0 -3
- package/dist/env/term.js +0 -1
- package/dist/env/test.js +3 -6
- package/dist/env/windows.js +0 -4
- package/dist/env/xdg.js +0 -3
- package/dist/events/exit/_internal.d.ts +11 -9
- package/dist/events/exit/_internal.js +31 -35
- package/dist/events/exit/handler.js +3 -4
- package/dist/events/exit/intercept.js +4 -6
- package/dist/events/exit/lifecycle.js +16 -18
- package/dist/events/exit/signals.js +1 -2
- package/dist/events/exit/types.d.ts +6 -5
- package/dist/external/@npmcli/package-json.js +2 -2
- package/dist/external/@sinclair/typebox/value.js +5 -1
- package/dist/external/@sinclair/typebox.js +5 -1
- package/dist/external/@socketregistry/packageurl-js.js +27 -0
- package/dist/external/npm-pack.js +2 -2
- package/dist/external-tools/bazel/read-bazel-version-file.js +1 -1
- package/dist/external-tools/bazel/resolve.js +2 -1
- package/dist/external-tools/bazel/types.d.ts +1 -1
- package/dist/external-tools/cdxgen/from-vfs.js +1 -1
- package/dist/external-tools/cdxgen/resolve.js +2 -1
- package/dist/external-tools/cdxgen/types.d.ts +1 -1
- package/dist/external-tools/from-download.d.ts +1 -1
- package/dist/external-tools/from-download.js +1 -1
- package/dist/external-tools/from-pip-venv.d.ts +73 -0
- package/dist/external-tools/from-pip-venv.js +98 -0
- package/dist/external-tools/janus/asset-names.js +1 -1
- package/dist/external-tools/janus/from-download.js +3 -5
- package/dist/external-tools/janus/from-vfs.js +1 -1
- package/dist/external-tools/janus/resolve.js +2 -1
- package/dist/external-tools/janus/types.d.ts +1 -1
- package/dist/external-tools/jre/detect-platform-arch.d.ts +10 -6
- package/dist/external-tools/jre/detect-platform-arch.js +29 -14
- package/dist/external-tools/jre/from-download.js +2 -1
- package/dist/external-tools/jre/from-vfs.js +1 -1
- package/dist/external-tools/jre/resolve.js +2 -1
- package/dist/external-tools/jre/types.d.ts +1 -1
- package/dist/external-tools/manifest.d.ts +7 -7
- package/dist/external-tools/manifest.js +18 -16
- package/dist/external-tools/opengrep/from-vfs.js +1 -1
- package/dist/external-tools/opengrep/resolve.js +2 -1
- package/dist/external-tools/opengrep/types.d.ts +1 -1
- package/dist/external-tools/python/asset-names.d.ts +76 -0
- package/dist/external-tools/python/asset-names.js +104 -0
- package/dist/external-tools/python/dlx.d.ts +80 -0
- package/dist/external-tools/python/dlx.js +87 -0
- package/dist/external-tools/python/from-download.d.ts +53 -0
- package/dist/external-tools/python/from-download.js +68 -0
- package/dist/external-tools/python/from-path.d.ts +7 -0
- package/dist/external-tools/python/from-path.js +23 -0
- package/dist/external-tools/python/pin.d.ts +121 -0
- package/dist/external-tools/python/pin.js +173 -0
- package/dist/external-tools/python/pip-install.d.ts +75 -0
- package/dist/external-tools/python/pip-install.js +139 -0
- package/dist/external-tools/python/resolve.d.ts +42 -0
- package/dist/external-tools/python/resolve.js +58 -0
- package/dist/external-tools/python/types.d.ts +49 -0
- package/dist/external-tools/sbt/from-vfs.js +1 -1
- package/dist/external-tools/sbt/resolve.js +2 -1
- package/dist/external-tools/sbt/types.d.ts +1 -1
- package/dist/external-tools/skillspector/from-dlx.d.ts +24 -0
- package/dist/external-tools/skillspector/from-dlx.js +41 -0
- package/dist/external-tools/skillspector/from-path.d.ts +8 -0
- package/dist/external-tools/skillspector/from-path.js +30 -0
- package/dist/external-tools/skillspector/from-vfs.d.ts +8 -0
- package/dist/external-tools/skillspector/from-vfs.js +27 -0
- package/dist/external-tools/skillspector/resolve.d.ts +34 -0
- package/dist/external-tools/skillspector/resolve.js +53 -0
- package/dist/external-tools/skillspector/types.d.ts +24 -0
- package/dist/external-tools/skillspector/types.js +2 -0
- package/dist/external-tools/synp/from-download.js +2 -2
- package/dist/external-tools/synp/from-vfs.js +1 -1
- package/dist/external-tools/synp/resolve.js +2 -1
- package/dist/external-tools/trivy/from-vfs.js +1 -1
- package/dist/external-tools/trivy/resolve.js +2 -1
- package/dist/external-tools/trivy/types.d.ts +1 -1
- package/dist/external-tools/trufflehog/from-vfs.js +1 -1
- package/dist/external-tools/trufflehog/resolve.js +2 -1
- package/dist/external-tools/trufflehog/types.d.ts +1 -1
- package/dist/fs/_internal.d.ts +1 -1
- package/dist/fs/_internal.js +7 -7
- package/dist/fs/access.js +5 -9
- package/dist/fs/{path-cache.js → allowed-dirs-cache.js} +1 -1
- package/dist/fs/encoding.js +5 -7
- package/dist/fs/{find-up.js → find.js} +11 -13
- package/dist/fs/inspect.js +7 -13
- package/dist/fs/read-dir.js +7 -10
- package/dist/fs/read-file.js +8 -14
- package/dist/fs/read-json-cache.d.ts +6 -4
- package/dist/fs/read-json-cache.js +9 -6
- package/dist/fs/read-json.js +4 -6
- package/dist/fs/resolve-module.js +1 -1
- package/dist/fs/safe.d.ts +1 -1
- package/dist/fs/safe.js +12 -13
- package/dist/fs/unique.js +4 -5
- package/dist/fs/validate.js +1 -2
- package/dist/fs/write-json.js +4 -5
- package/dist/git/_internal.js +12 -11
- package/dist/git/changed.js +4 -4
- package/dist/git/repo.js +3 -3
- package/dist/git/staged.js +4 -4
- package/dist/git/unstaged.js +4 -4
- package/dist/github/ghsa.js +2 -2
- package/dist/github/refs-cache.d.ts +1 -1
- package/dist/github/refs-cache.js +5 -5
- package/dist/github/refs-rest.js +5 -5
- package/dist/github/{fetch.js → request.js} +13 -2
- package/dist/github/token.js +1 -1
- package/dist/github/types.d.ts +1 -1
- package/dist/globs/_internal.js +7 -9
- package/dist/globs/match.js +6 -7
- package/dist/globs/matcher.d.ts +3 -3
- package/dist/globs/matcher.js +12 -14
- package/dist/globs/stream.js +1 -2
- package/dist/globs/types.d.ts +24 -24
- package/dist/http-request/_internal.d.ts +1 -1
- package/dist/http-request/browser.js +21 -13
- package/dist/http-request/checksum-file.d.ts +55 -0
- package/dist/http-request/checksum-file.js +95 -0
- package/dist/http-request/download-types.d.ts +15 -23
- package/dist/http-request/download.js +4 -4
- package/dist/http-request/headers.d.ts +32 -3
- package/dist/http-request/headers.js +41 -13
- package/dist/http-request/request-attempt.js +38 -33
- package/dist/http-request/request-types.d.ts +7 -2
- package/dist/http-request/request.js +33 -16
- package/dist/http-request/response-reader.d.ts +12 -1
- package/dist/http-request/response-reader.js +22 -2
- package/dist/http-request/user-agent.js +3 -4
- package/dist/integrity.d.ts +86 -18
- package/dist/integrity.js +119 -30
- package/dist/ipc/directory.js +2 -2
- package/dist/ipc/paths.js +1 -1
- package/dist/ipc/write.js +1 -1
- package/dist/ipc-cli/get.js +12 -12
- package/dist/json/edit.js +13 -14
- package/dist/json/format.js +2 -2
- package/dist/json/parse.d.ts +1 -1
- package/dist/json/parse.js +3 -7
- package/dist/logger/_internal.d.ts +4 -4
- package/dist/logger/_internal.js +3 -3
- package/dist/logger/colors.js +4 -3
- package/dist/logger/console-methods.d.ts +132 -0
- package/dist/logger/console-methods.js +169 -0
- package/dist/logger/console.d.ts +12 -0
- package/dist/logger/console.js +42 -11
- package/dist/logger/indentation-methods.d.ts +81 -0
- package/dist/logger/indentation-methods.js +121 -0
- package/dist/logger/node.d.ts +16 -338
- package/dist/logger/node.js +75 -608
- package/dist/logger/options.d.ts +39 -0
- package/dist/logger/options.js +47 -0
- package/dist/logger/semantic-methods.d.ts +63 -0
- package/dist/logger/semantic-methods.js +108 -0
- package/dist/logger/stream-methods.d.ts +63 -0
- package/dist/logger/stream-methods.js +101 -0
- package/dist/logger/stream.d.ts +37 -0
- package/dist/logger/stream.js +42 -0
- package/dist/logger/symbols-builder.js +9 -9
- package/dist/logger/symbols.d.ts +2 -25
- package/dist/logger/symbols.js +53 -74
- package/dist/logger/types.d.ts +1 -1
- package/dist/memo/types.d.ts +6 -6
- package/dist/native-messaging/host.d.ts +20 -0
- package/dist/native-messaging/host.js +120 -0
- package/dist/native-messaging/index.d.ts +5 -0
- package/dist/native-messaging/index.js +22 -0
- package/dist/native-messaging/install.d.ts +60 -0
- package/dist/native-messaging/install.js +141 -0
- package/dist/native-messaging/rate-limit.d.ts +62 -0
- package/dist/native-messaging/rate-limit.js +115 -0
- package/dist/native-messaging/run.d.ts +10 -0
- package/dist/native-messaging/run.js +17 -0
- package/dist/node/async-hooks.js +4 -3
- package/dist/node/child-process.js +4 -3
- package/dist/node/crypto.js +4 -3
- package/dist/node/events.js +4 -3
- package/dist/node/fs-promises.js +4 -3
- package/dist/node/fs.js +4 -3
- package/dist/node/http.js +4 -3
- package/dist/node/https.js +4 -3
- package/dist/node/module.js +10 -6
- package/dist/node/os.js +4 -3
- package/dist/node/path.js +4 -3
- package/dist/node/timers-promises.js +4 -3
- package/dist/node/url.js +4 -3
- package/dist/node/util.js +4 -3
- package/dist/objects/getters.js +5 -7
- package/dist/objects/inspect.js +1 -4
- package/dist/objects/mutate.js +2 -3
- package/dist/objects/predicates.js +0 -4
- package/dist/objects/sort.js +3 -7
- package/dist/packages/edit-class.js +15 -16
- package/dist/packages/edit.js +12 -14
- package/dist/packages/exports.js +11 -17
- package/dist/packages/fetch.d.ts +16 -0
- package/dist/packages/fetch.js +81 -0
- package/dist/packages/find.d.ts +55 -0
- package/dist/packages/find.js +65 -0
- package/dist/packages/isolation.js +14 -14
- package/dist/packages/licenses.js +16 -16
- package/dist/packages/manifest.js +12 -15
- package/dist/packages/metadata-extensions.d.ts +14 -0
- package/dist/packages/metadata-extensions.js +43 -0
- package/dist/packages/normalize.js +5 -9
- package/dist/packages/provenance.d.ts +6 -0
- package/dist/packages/provenance.js +25 -18
- package/dist/packages/read.d.ts +29 -0
- package/dist/packages/read.js +66 -0
- package/dist/packages/specs.d.ts +48 -1
- package/dist/packages/specs.js +74 -11
- package/dist/packages/tarball.d.ts +24 -0
- package/dist/packages/tarball.js +79 -0
- package/dist/packages/types.d.ts +21 -20
- package/dist/packages/validation.js +0 -3
- package/dist/paths/_internal.d.ts +2 -1
- package/dist/paths/_internal.js +7 -19
- package/dist/paths/conversion.js +5 -9
- package/dist/paths/filenames.d.ts +0 -1
- package/dist/paths/filenames.js +0 -2
- package/dist/paths/normalize.js +6 -5
- package/dist/paths/packages.js +4 -7
- package/dist/paths/predicates.js +9 -16
- package/dist/paths/resolve.js +11 -14
- package/dist/paths/rewire.js +3 -3
- package/dist/paths/socket.js +16 -16
- package/dist/paths/walk.d.ts +1 -1
- package/dist/paths/walk.js +4 -4
- package/dist/perf/report.js +2 -2
- package/dist/perf/types.d.ts +1 -1
- package/dist/pkg-ext/data.js +1 -1
- package/dist/primordials/array.js +9 -9
- package/dist/primordials/date.js +2 -2
- package/dist/primordials/error.js +3 -3
- package/dist/primordials/headers.d.ts +10 -0
- package/dist/primordials/headers.js +23 -0
- package/dist/primordials/intl.d.ts +13 -0
- package/dist/primordials/intl.js +26 -0
- package/dist/primordials/math.js +33 -33
- package/dist/primordials/number.js +9 -9
- package/dist/primordials/object.js +5 -5
- package/dist/primordials/string.d.ts +2 -2
- package/dist/primordials/string.js +6 -6
- package/dist/primordials/symbol.js +3 -3
- package/dist/primordials/uncurry.js +9 -9
- package/dist/process/abort.js +3 -3
- package/dist/process/lock-manager.js +8 -8
- package/dist/process/spawn/_internal.js +6 -8
- package/dist/process/spawn/child.js +14 -14
- package/dist/process/spawn/errors.js +2 -4
- package/dist/process/spawn/kill-tree.d.ts +53 -0
- package/dist/process/spawn/kill-tree.js +85 -0
- package/dist/process/spawn/stdio.js +0 -1
- package/dist/process/spawn/types.d.ts +5 -5
- package/dist/process/transient.js +2 -2
- package/dist/promises/_internal.d.ts +2 -1
- package/dist/promises/_internal.js +2 -6
- package/dist/promises/iterate.js +12 -16
- package/dist/promises/options.js +3 -6
- package/dist/promises/retry.js +4 -5
- package/dist/promises/timers.d.ts +30 -0
- package/dist/promises/timers.js +48 -0
- package/dist/releases/github-archives.d.ts +6 -6
- package/dist/releases/github-archives.js +2 -2
- package/dist/releases/github-asset-url.d.ts +1 -1
- package/dist/releases/github-asset-url.js +5 -5
- package/dist/releases/github-downloads.d.ts +1 -1
- package/dist/releases/github-downloads.js +3 -3
- package/dist/releases/github-listing.d.ts +11 -2
- package/dist/releases/github-listing.js +20 -7
- package/dist/releases/github-retry-config.js +1 -1
- package/dist/releases/github-types.d.ts +6 -6
- package/dist/releases/socket-btm-binary-naming.d.ts +107 -0
- package/dist/releases/socket-btm-binary-naming.js +155 -0
- package/dist/releases/socket-btm.d.ts +8 -115
- package/dist/releases/socket-btm.js +16 -159
- package/dist/schema/types.d.ts +1 -1
- package/dist/sea/detect.js +6 -6
- package/dist/secrets/_internal.d.ts +2 -2
- package/dist/secrets/_internal.js +5 -4
- package/dist/secrets/compare.d.ts +45 -0
- package/dist/secrets/compare.js +61 -0
- package/dist/secrets/keychain.js +9 -6
- package/dist/secrets/linux.js +25 -23
- package/dist/secrets/macos.d.ts +1 -1
- package/dist/secrets/macos.js +18 -16
- package/dist/secrets/rc.d.ts +2 -2
- package/dist/secrets/rc.js +15 -10
- package/dist/secrets/socket-api-token.d.ts +4 -4
- package/dist/secrets/socket-api-token.js +18 -9
- package/dist/secrets/windows.js +21 -17
- package/dist/shadow/skip.js +2 -2
- package/dist/shell/parse.d.ts +108 -1
- package/dist/shell/parse.js +168 -2
- package/dist/smol/detect.js +9 -10
- package/dist/smol/http.js +6 -7
- package/dist/smol/https.js +6 -7
- package/dist/smol/manifest.d.ts +1 -1
- package/dist/smol/manifest.js +6 -7
- package/dist/smol/path.d.ts +1 -1
- package/dist/smol/path.js +7 -8
- package/dist/smol/primordial.d.ts +4 -0
- package/dist/smol/primordial.js +6 -7
- package/dist/smol/purl.d.ts +1 -1
- package/dist/smol/purl.js +7 -8
- package/dist/smol/versions.js +6 -7
- package/dist/smol/vfs.js +6 -7
- package/dist/sorts/_internal.js +6 -8
- package/dist/sorts/natural.js +10 -12
- package/dist/sorts/semver.js +1 -2
- package/dist/sorts/strings.js +0 -1
- package/dist/sorts/types.d.ts +1 -1
- package/dist/spinner/create-spinner-class.d.ts +38 -0
- package/dist/spinner/create-spinner-class.js +302 -0
- package/dist/spinner/default.js +8 -9
- package/dist/spinner/spinner-internals.d.ts +36 -0
- package/dist/spinner/spinner-internals.js +101 -0
- package/dist/spinner/spinner-shimmer-methods.d.ts +54 -0
- package/dist/spinner/spinner-shimmer-methods.js +143 -0
- package/dist/spinner/spinner-status-methods.d.ts +40 -0
- package/dist/spinner/spinner-status-methods.js +133 -0
- package/dist/spinner/spinner.d.ts +4 -5
- package/dist/spinner/spinner.js +18 -705
- package/dist/spinner/types.d.ts +3 -1
- package/dist/spinner/with.d.ts +10 -0
- package/dist/spinner/with.js +16 -2
- package/dist/stdio/divider.js +1 -1
- package/dist/stdio/footer.js +3 -3
- package/dist/stdio/header.js +4 -4
- package/dist/stdio/progress.js +5 -5
- package/dist/stdio/prompts.d.ts +5 -3
- package/dist/stdio/prompts.js +6 -7
- package/dist/stdio/stdout.js +3 -3
- package/dist/streams/parallel.js +3 -5
- package/dist/streams/transform.js +2 -3
- package/dist/strings/format.js +2 -6
- package/dist/strings/predicates.js +0 -2
- package/dist/strings/search.js +1 -2
- package/dist/strings/transform.js +0 -3
- package/dist/strings/width.js +9 -10
- package/dist/tables/bordered.js +4 -3
- package/dist/tables/padding.js +1 -1
- package/dist/tables/simple.js +8 -5
- package/dist/temporal/instant.js +4 -2
- package/dist/temporal/slots.js +7 -6
- package/dist/temporal/system.js +9 -9
- package/dist/themes/context.d.ts +3 -2
- package/dist/themes/context.js +4 -5
- package/dist/themes/themes.js +15 -15
- package/dist/themes/types.d.ts +3 -3
- package/dist/url/parse.js +0 -2
- package/dist/url/predicates.js +1 -2
- package/dist/url/search-params.js +3 -9
- package/dist/url/types.d.ts +5 -5
- package/dist/versions/_internal.js +3 -3
- package/dist/words/article.js +0 -1
- package/dist/words/capitalize.js +0 -1
- package/dist/words/pluralize.d.ts +24 -2
- package/dist/words/pluralize.js +47 -2
- package/dist/words/types.d.ts +25 -2
- package/package.json +289 -108
- package/dist/external-tools/uv/asset-names.d.ts +0 -36
- package/dist/external-tools/uv/asset-names.js +0 -70
- package/dist/external-tools/uv/from-download.d.ts +0 -17
- package/dist/external-tools/uv/from-download.js +0 -47
- package/dist/external-tools/uv/from-path.d.ts +0 -5
- package/dist/external-tools/uv/from-path.js +0 -22
- package/dist/external-tools/uv/from-vfs.d.ts +0 -7
- package/dist/external-tools/uv/from-vfs.js +0 -26
- package/dist/external-tools/uv/resolve.d.ts +0 -25
- package/dist/external-tools/uv/resolve.js +0 -52
- package/dist/external-tools/uv/types.d.ts +0 -24
- package/dist/http-request/checksums.d.ts +0 -69
- package/dist/http-request/checksums.js +0 -108
- package/dist/http-request/http-request.d.ts +0 -12
- package/dist/http-request/http-request.js +0 -11
- package/dist/packages/operations.d.ts +0 -113
- package/dist/packages/operations.js +0 -304
- package/dist/ssri/convert.d.ts +0 -48
- package/dist/ssri/convert.js +0 -69
- package/dist/ssri/parse.d.ts +0 -27
- package/dist/ssri/parse.js +0 -41
- package/dist/ssri/validate.d.ts +0 -41
- package/dist/ssri/validate.js +0 -56
- /package/dist/{bin → cli}/check.d.ts +0 -0
- /package/dist/external-tools/{uv → python}/types.js +0 -0
- /package/dist/fs/{path-cache.d.ts → allowed-dirs-cache.d.ts} +0 -0
- /package/dist/fs/{find-up.d.ts → find.d.ts} +0 -0
- /package/dist/github/{fetch.d.ts → request.d.ts} +0 -0
package/dist/paths/predicates.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_string = require('../primordials/string.js');
|
|
5
4
|
const require_constants_platform = require('../constants/platform.js');
|
|
5
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
6
6
|
const require_paths__internal = require('./_internal.js');
|
|
7
7
|
const require_primordials_regexp = require('../primordials/regexp.js');
|
|
8
8
|
|
|
@@ -34,9 +34,8 @@ const require_primordials_regexp = require('../primordials/regexp.js');
|
|
|
34
34
|
*
|
|
35
35
|
* @returns {boolean} `true` if absolute, `false` otherwise
|
|
36
36
|
*/
|
|
37
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
38
37
|
function isAbsolute(pathLike) {
|
|
39
|
-
const filepath =
|
|
38
|
+
const filepath = require_paths__internal.pathLikeToString(pathLike);
|
|
40
39
|
const { length } = filepath;
|
|
41
40
|
if (length === 0) return false;
|
|
42
41
|
const code = require_primordials_string.StringPrototypeCharCodeAt(filepath, 0);
|
|
@@ -44,7 +43,7 @@ function isAbsolute(pathLike) {
|
|
|
44
43
|
if (code === 92) return true;
|
|
45
44
|
/* c8 ignore start - Windows drive-letter detection. */
|
|
46
45
|
if (require_constants_platform.WIN32 && length > 2) {
|
|
47
|
-
if (
|
|
46
|
+
if (isWindowsDeviceRoot(code) && require_primordials_string.StringPrototypeCharCodeAt(filepath, 1) === 58 && isPathSeparator(require_primordials_string.StringPrototypeCharCodeAt(filepath, 2))) return true;
|
|
48
47
|
}
|
|
49
48
|
/* c8 ignore stop */
|
|
50
49
|
return false;
|
|
@@ -64,9 +63,8 @@ function isAbsolute(pathLike) {
|
|
|
64
63
|
*
|
|
65
64
|
* @returns {boolean} `true` if the path contains `node_modules`
|
|
66
65
|
*/
|
|
67
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
68
66
|
function isNodeModules(pathLike) {
|
|
69
|
-
return require_primordials_regexp.RegExpPrototypeTest(require_paths__internal.nodeModulesPathRegExp,
|
|
67
|
+
return require_primordials_regexp.RegExpPrototypeTest(require_paths__internal.nodeModulesPathRegExp, require_paths__internal.pathLikeToString(pathLike));
|
|
70
68
|
}
|
|
71
69
|
/**
|
|
72
70
|
* Check if a value is a valid file path (absolute or relative).
|
|
@@ -87,13 +85,12 @@ function isNodeModules(pathLike) {
|
|
|
87
85
|
*
|
|
88
86
|
* @returns {boolean} `true` if the value is a valid file path
|
|
89
87
|
*/
|
|
90
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
91
88
|
function isPath(pathLike) {
|
|
92
|
-
const filepath =
|
|
89
|
+
const filepath = require_paths__internal.pathLikeToString(pathLike);
|
|
93
90
|
if (typeof filepath !== "string" || filepath.length === 0) return false;
|
|
94
91
|
if (/^[a-z][a-z0-9+.-]+:/i.test(filepath)) return false;
|
|
95
92
|
if (filepath === "." || filepath === "..") return true;
|
|
96
|
-
if (
|
|
93
|
+
if (isAbsolute(filepath)) return true;
|
|
97
94
|
if (filepath.includes("/") || filepath.includes("\\")) {
|
|
98
95
|
if (require_primordials_string.StringPrototypeStartsWith(filepath, "@") && !require_primordials_string.StringPrototypeStartsWith(filepath, "@/")) {
|
|
99
96
|
const parts = filepath.split("/");
|
|
@@ -117,7 +114,6 @@ function isPath(pathLike) {
|
|
|
117
114
|
*
|
|
118
115
|
* @returns {boolean} `true` if separator
|
|
119
116
|
*/
|
|
120
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
121
117
|
function isPathSeparator(code) {
|
|
122
118
|
return code === 47 || code === 92;
|
|
123
119
|
}
|
|
@@ -137,14 +133,13 @@ function isPathSeparator(code) {
|
|
|
137
133
|
*
|
|
138
134
|
* @returns {boolean} `true` if the path is relative
|
|
139
135
|
*/
|
|
140
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
141
136
|
function isRelative(pathLike) {
|
|
142
|
-
const filepath =
|
|
137
|
+
const filepath = require_paths__internal.pathLikeToString(pathLike);
|
|
143
138
|
/* c8 ignore start */
|
|
144
139
|
if (typeof filepath !== "string") return false;
|
|
145
140
|
/* c8 ignore stop */
|
|
146
141
|
if (filepath.length === 0) return true;
|
|
147
|
-
return
|
|
142
|
+
return !isAbsolute(filepath);
|
|
148
143
|
}
|
|
149
144
|
/**
|
|
150
145
|
* Check if a path uses MSYS/Git Bash Unix-style drive letter notation.
|
|
@@ -163,9 +158,8 @@ function isRelative(pathLike) {
|
|
|
163
158
|
*
|
|
164
159
|
* @returns {boolean} `true` if the path uses MSYS drive letter notation
|
|
165
160
|
*/
|
|
166
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
167
161
|
function isUnixPath(pathLike) {
|
|
168
|
-
const filepath =
|
|
162
|
+
const filepath = require_paths__internal.pathLikeToString(pathLike);
|
|
169
163
|
return typeof filepath === "string" && require_primordials_regexp.RegExpPrototypeTest(require_paths__internal.msysDriveRegExp, filepath);
|
|
170
164
|
}
|
|
171
165
|
/**
|
|
@@ -183,7 +177,6 @@ function isUnixPath(pathLike) {
|
|
|
183
177
|
* @returns {boolean} `true` if valid drive-letter code
|
|
184
178
|
*/
|
|
185
179
|
/* c8 ignore start - Only called from Windows-only branches. */
|
|
186
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
187
180
|
function isWindowsDeviceRoot(code) {
|
|
188
181
|
return code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
189
182
|
}
|
package/dist/paths/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_primordials_string = require('../primordials/string.js');
|
|
5
4
|
const require_constants_platform = require('../constants/platform.js');
|
|
5
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
6
6
|
const require_paths__internal = require('./_internal.js');
|
|
7
7
|
const require_paths_predicates = require('./predicates.js');
|
|
8
8
|
const require_paths_normalize = require('./normalize.js');
|
|
@@ -38,11 +38,10 @@ const require_paths_normalize = require('./normalize.js');
|
|
|
38
38
|
*
|
|
39
39
|
* @returns {string} Relative path from `from` to `to`, or empty string if equal
|
|
40
40
|
*/
|
|
41
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
42
41
|
function relative(from, to) {
|
|
43
42
|
if (from === to) return "";
|
|
44
|
-
const actualFrom =
|
|
45
|
-
const actualTo =
|
|
43
|
+
const actualFrom = resolve(from);
|
|
44
|
+
const actualTo = resolve(to);
|
|
46
45
|
if (actualFrom === actualTo) return "";
|
|
47
46
|
/* c8 ignore start - Windows-only case-insensitive comparison. */
|
|
48
47
|
if (require_constants_platform.WIN32) {
|
|
@@ -67,15 +66,15 @@ function relative(from, to) {
|
|
|
67
66
|
}
|
|
68
67
|
/* c8 ignore stop */
|
|
69
68
|
if (fromCode !== toCode) break;
|
|
70
|
-
if (
|
|
69
|
+
if (require_paths_predicates.isPathSeparator(require_primordials_string.StringPrototypeCharCodeAt(actualFrom, fromStart + i))) lastCommonSep = i;
|
|
71
70
|
}
|
|
72
71
|
/* c8 ignore start */
|
|
73
72
|
if (i === length) {
|
|
74
73
|
if (toLen > length) {
|
|
75
|
-
if (
|
|
74
|
+
if (require_paths_predicates.isPathSeparator(require_primordials_string.StringPrototypeCharCodeAt(actualTo, toStart + i))) return actualTo.slice(toStart + i + 1);
|
|
76
75
|
if (i === 0) return actualTo.slice(toStart + i);
|
|
77
76
|
} else if (fromLen > length) {
|
|
78
|
-
if (
|
|
77
|
+
if (require_paths_predicates.isPathSeparator(require_primordials_string.StringPrototypeCharCodeAt(actualFrom, fromStart + i))) lastCommonSep = i;
|
|
79
78
|
else if (i === 0) lastCommonSep = 0;
|
|
80
79
|
}
|
|
81
80
|
}
|
|
@@ -83,7 +82,7 @@ function relative(from, to) {
|
|
|
83
82
|
let out = "";
|
|
84
83
|
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; i += 1) {
|
|
85
84
|
const code = require_primordials_string.StringPrototypeCharCodeAt(actualFrom, i);
|
|
86
|
-
if (i === fromEnd ||
|
|
85
|
+
if (i === fromEnd || require_paths_predicates.isPathSeparator(code)) out += out.length === 0 ? ".." : "/..";
|
|
87
86
|
}
|
|
88
87
|
return out + actualTo.slice(toStart + lastCommonSep);
|
|
89
88
|
}
|
|
@@ -106,11 +105,10 @@ function relative(from, to) {
|
|
|
106
105
|
*
|
|
107
106
|
* @returns {string} Normalized relative path, or empty string if equal
|
|
108
107
|
*/
|
|
109
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
110
108
|
function relativeResolve(from, to) {
|
|
111
|
-
const rel =
|
|
109
|
+
const rel = relative(from, to);
|
|
112
110
|
if (rel === "") return "";
|
|
113
|
-
return
|
|
111
|
+
return require_paths_normalize.normalizePath(rel);
|
|
114
112
|
}
|
|
115
113
|
/**
|
|
116
114
|
* Resolve an absolute path from path segments.
|
|
@@ -131,7 +129,6 @@ function relativeResolve(from, to) {
|
|
|
131
129
|
*
|
|
132
130
|
* @returns {string} The resolved absolute path
|
|
133
131
|
*/
|
|
134
|
-
/* @__NO_SIDE_EFFECTS__ */
|
|
135
132
|
function resolve(...segments) {
|
|
136
133
|
let resolvedPath = "";
|
|
137
134
|
let resolvedAbsolute = false;
|
|
@@ -140,11 +137,11 @@ function resolve(...segments) {
|
|
|
140
137
|
/* c8 ignore start */
|
|
141
138
|
if (typeof segment !== "string" || segment.length === 0) continue;
|
|
142
139
|
resolvedPath = segment + (resolvedPath.length === 0 ? "" : `/${resolvedPath}`);
|
|
143
|
-
resolvedAbsolute =
|
|
140
|
+
resolvedAbsolute = require_paths_predicates.isAbsolute(segment);
|
|
144
141
|
}
|
|
145
142
|
if (!resolvedAbsolute) resolvedPath = /* @__PURE__ */ require("node:process").cwd() + (resolvedPath.length === 0 ? "" : `/${resolvedPath}`);
|
|
146
143
|
/* c8 ignore stop */
|
|
147
|
-
return
|
|
144
|
+
return require_paths_normalize.normalizePath(resolvedPath);
|
|
148
145
|
}
|
|
149
146
|
|
|
150
147
|
//#endregion
|
package/dist/paths/rewire.js
CHANGED
|
@@ -14,13 +14,13 @@ const require_primordials_map_set = require('../primordials/map-set.js');
|
|
|
14
14
|
* - Thread-safe for concurrent test execution
|
|
15
15
|
*/
|
|
16
16
|
const stateSymbol = Symbol.for("@socketsecurity/lib/paths/rewire/state");
|
|
17
|
-
const
|
|
18
|
-
if (!
|
|
17
|
+
const globalState = globalThis;
|
|
18
|
+
if (!globalState[stateSymbol]) globalState[stateSymbol] = {
|
|
19
19
|
testOverrides: new require_primordials_map_set.MapCtor(),
|
|
20
20
|
valueCache: new require_primordials_map_set.MapCtor(),
|
|
21
21
|
cacheInvalidationCallbacks: []
|
|
22
22
|
};
|
|
23
|
-
const sharedState =
|
|
23
|
+
const sharedState = globalState[stateSymbol];
|
|
24
24
|
const testOverrides = sharedState.testOverrides;
|
|
25
25
|
const valueCache = sharedState.valueCache;
|
|
26
26
|
const cacheInvalidationCallbacks = sharedState.cacheInvalidationCallbacks;
|
package/dist/paths/socket.js
CHANGED
|
@@ -28,7 +28,7 @@ const require_paths_rewire = require('./rewire.js');
|
|
|
28
28
|
* setPath('homedir', ...) from paths/rewire.
|
|
29
29
|
*/
|
|
30
30
|
function getOsHomeDir() {
|
|
31
|
-
return require_paths_rewire.getPathValue("homedir", () =>
|
|
31
|
+
return require_paths_rewire.getPathValue("homedir", () => require_node_os.getNodeOs().homedir());
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
34
|
* Get the OS temporary directory. Can be overridden in tests using
|
|
@@ -39,7 +39,7 @@ function getOsHomeDir() {
|
|
|
39
39
|
* setPath('tmpdir', ...) from paths/rewire.
|
|
40
40
|
*/
|
|
41
41
|
function getOsTmpDir() {
|
|
42
|
-
return require_paths_rewire.getPathValue("tmpdir", () =>
|
|
42
|
+
return require_paths_rewire.getPathValue("tmpdir", () => require_node_os.getNodeOs().tmpdir());
|
|
43
43
|
}
|
|
44
44
|
/**
|
|
45
45
|
* Get a Socket app cache directory (~/.socket/_<appName>/cache).
|
|
@@ -48,7 +48,7 @@ function getOsTmpDir() {
|
|
|
48
48
|
* Get a Socket app cache directory (~/.socket/_<appName>/cache).
|
|
49
49
|
*/
|
|
50
50
|
function getSocketAppCacheDir(appName) {
|
|
51
|
-
return
|
|
51
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketAppDir(appName), require_paths_dirnames.CACHE_DIR));
|
|
52
52
|
}
|
|
53
53
|
/**
|
|
54
54
|
* Get a Socket app TTL cache directory (~/.socket/_<appName>/cache/ttl).
|
|
@@ -57,7 +57,7 @@ function getSocketAppCacheDir(appName) {
|
|
|
57
57
|
* Get a Socket app TTL cache directory (~/.socket/_<appName>/cache/ttl).
|
|
58
58
|
*/
|
|
59
59
|
function getSocketAppCacheTtlDir(appName) {
|
|
60
|
-
return
|
|
60
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketAppCacheDir(appName), "ttl"));
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
63
|
* Get a Socket app directory (~/.socket/_<appName>).
|
|
@@ -66,7 +66,7 @@ function getSocketAppCacheTtlDir(appName) {
|
|
|
66
66
|
* Get a Socket app directory (~/.socket/_<appName>).
|
|
67
67
|
*/
|
|
68
68
|
function getSocketAppDir(appName) {
|
|
69
|
-
return
|
|
69
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}${appName}`));
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Get the Socket cacache directory (~/.socket/_cacache). Can be overridden with
|
|
@@ -92,8 +92,8 @@ function getSocketAppDir(appName) {
|
|
|
92
92
|
*/
|
|
93
93
|
function getSocketCacacheDir() {
|
|
94
94
|
return require_paths_rewire.getPathValue("socket-cacache-dir", () => {
|
|
95
|
-
if (
|
|
96
|
-
return
|
|
95
|
+
if (require_env_socket.getSocketCacacheDirEnv()) return require_paths_normalize.normalizePath(require_env_socket.getSocketCacacheDirEnv());
|
|
96
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}cacache`));
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
/**
|
|
@@ -133,8 +133,8 @@ function getSocketCliDir() {
|
|
|
133
133
|
*/
|
|
134
134
|
function getSocketDlxDir() {
|
|
135
135
|
return require_paths_rewire.getPathValue("socket-dlx-dir", () => {
|
|
136
|
-
if (
|
|
137
|
-
return
|
|
136
|
+
if (require_env_socket.getSocketDlxDirEnv()) return require_paths_normalize.normalizePath(require_env_socket.getSocketDlxDirEnv());
|
|
137
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}${"dlx"}`));
|
|
138
138
|
});
|
|
139
139
|
}
|
|
140
140
|
/**
|
|
@@ -166,7 +166,7 @@ function getSocketRegistryDir() {
|
|
|
166
166
|
* (~/.socket/_registry/cache/ttl/github).
|
|
167
167
|
*/
|
|
168
168
|
function getSocketRegistryGithubCacheDir() {
|
|
169
|
-
return
|
|
169
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketAppCacheTtlDir(require_constants_socket.SOCKET_REGISTRY_APP_NAME), require_constants_github.CACHE_GITHUB_DIR));
|
|
170
170
|
}
|
|
171
171
|
/**
|
|
172
172
|
* Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared
|
|
@@ -197,9 +197,9 @@ function getSocketRegistryGithubCacheDir() {
|
|
|
197
197
|
*/
|
|
198
198
|
function getSocketUserDir() {
|
|
199
199
|
return require_paths_rewire.getPathValue("socket-user-dir", () => {
|
|
200
|
-
const socketHome =
|
|
201
|
-
if (socketHome) return
|
|
202
|
-
return
|
|
200
|
+
const socketHome = require_env_socket.getSocketHome();
|
|
201
|
+
if (socketHome) return require_paths_normalize.normalizePath(socketHome);
|
|
202
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getUserHomeDir(), require_paths_dirnames.DOT_SOCKET_DIR));
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
205
|
/**
|
|
@@ -227,7 +227,7 @@ function getSocketUserDir() {
|
|
|
227
227
|
*/
|
|
228
228
|
function getSocketWheelhouseDir() {
|
|
229
229
|
return require_paths_rewire.getPathValue("socket-wheelhouse-dir", () => {
|
|
230
|
-
return
|
|
230
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}${require_constants_socket.SOCKET_WHEELHOUSE_APP_NAME}`));
|
|
231
231
|
});
|
|
232
232
|
}
|
|
233
233
|
/**
|
|
@@ -251,9 +251,9 @@ function getSocketWheelhouseDir() {
|
|
|
251
251
|
* getNodeOs().tmpdir() (rarely used, for restricted environments)
|
|
252
252
|
*/
|
|
253
253
|
function getUserHomeDir() {
|
|
254
|
-
const home =
|
|
254
|
+
const home = require_env_home.getHome();
|
|
255
255
|
if (home) return home;
|
|
256
|
-
const userProfile =
|
|
256
|
+
const userProfile = require_env_windows.getUserprofile();
|
|
257
257
|
if (userProfile) return userProfile;
|
|
258
258
|
try {
|
|
259
259
|
const osHome = getOsHomeDir();
|
package/dist/paths/walk.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Walk parent directories. `walkUp` is the lazy ancestor generator that
|
|
3
|
-
* `fs/find
|
|
3
|
+
* `fs/find` and package-root lookups build on: given a starting path it
|
|
4
4
|
* yields that path, then each parent, up to and INCLUDING the filesystem root
|
|
5
5
|
* (or a caller-supplied `stopAt` boundary). Lazy so a caller can stop early
|
|
6
6
|
* without computing the whole chain.
|
package/dist/paths/walk.js
CHANGED
|
@@ -11,7 +11,7 @@ node_process = require_runtime.__toESM(node_process);
|
|
|
11
11
|
//#region src/paths/walk.ts
|
|
12
12
|
/**
|
|
13
13
|
* @file Walk parent directories. `walkUp` is the lazy ancestor generator that
|
|
14
|
-
* `fs/find
|
|
14
|
+
* `fs/find` and package-root lookups build on: given a starting path it
|
|
15
15
|
* yields that path, then each parent, up to and INCLUDING the filesystem root
|
|
16
16
|
* (or a caller-supplied `stopAt` boundary). Lazy so a caller can stop early
|
|
17
17
|
* without computing the whole chain.
|
|
@@ -41,13 +41,13 @@ function* walkUp(from, options) {
|
|
|
41
41
|
__proto__: null,
|
|
42
42
|
...options
|
|
43
43
|
};
|
|
44
|
-
const path =
|
|
45
|
-
const dirname =
|
|
44
|
+
const path = require_node_path.getNodePath();
|
|
45
|
+
const dirname = require_smol_path.getSmolPath()?.dirname ?? path.dirname;
|
|
46
46
|
let dir = path.resolve(cwd, from);
|
|
47
47
|
const stopDir = stopAt ? path.resolve(cwd, stopAt) : void 0;
|
|
48
48
|
let prev;
|
|
49
49
|
while (dir !== prev) {
|
|
50
|
-
yield
|
|
50
|
+
yield require_paths_normalize.normalizePath(dir);
|
|
51
51
|
if (stopDir !== void 0 && dir === stopDir) return;
|
|
52
52
|
prev = dir;
|
|
53
53
|
dir = dirname(dir);
|
package/dist/perf/report.js
CHANGED
|
@@ -39,7 +39,7 @@ const require_perf_metrics = require('./metrics.js');
|
|
|
39
39
|
function generatePerformanceReport() {
|
|
40
40
|
if (!require_perf_enabled.isPerfEnabled() || require_perf__internal.performanceMetrics.length === 0) return "(no performance data collected - enable with DEBUG=perf)";
|
|
41
41
|
const summary = require_perf_metrics.getPerformanceSummary();
|
|
42
|
-
const operations = require_primordials_object.ObjectKeys(summary).
|
|
42
|
+
const operations = require_primordials_object.ObjectKeys(summary).toSorted();
|
|
43
43
|
let report = "\n╔═══════════════════════════════════════════════╗\n";
|
|
44
44
|
report += "║ Performance Report ║\n";
|
|
45
45
|
report += "╚═══════════════════════════════════════════════╝\n\n";
|
|
@@ -70,7 +70,7 @@ function generatePerformanceReport() {
|
|
|
70
70
|
function printPerformanceSummary() {
|
|
71
71
|
if (!require_perf_enabled.isPerfEnabled() || require_perf__internal.performanceMetrics.length === 0) return;
|
|
72
72
|
const summary = require_perf_metrics.getPerformanceSummary();
|
|
73
|
-
const operations = require_primordials_object.ObjectKeys(summary).
|
|
73
|
+
const operations = require_primordials_object.ObjectKeys(summary).toSorted();
|
|
74
74
|
require_debug_output.debugLog("[perf]\n=== Performance Summary ===");
|
|
75
75
|
for (const operation of operations) {
|
|
76
76
|
const stats = summary[operation];
|
package/dist/perf/types.d.ts
CHANGED
package/dist/pkg-ext/data.js
CHANGED
|
@@ -17,7 +17,7 @@ const packageExtensions = ObjectFreeze([
|
|
|
17
17
|
["@yarnpkg/extensions@>=1.1.0", { peerDependencies: void 0 }],
|
|
18
18
|
["abab@>=2.0.0", { devDependencies: { webpack: "^3.12.0" } }],
|
|
19
19
|
["is-generator-function@>=1.0.7", { scripts: { "test:uglified": "" } }]
|
|
20
|
-
].
|
|
20
|
+
].toSorted((a_, b_) => {
|
|
21
21
|
const aIndex = a_[0].lastIndexOf("@");
|
|
22
22
|
const bIndex = b_[0].lastIndexOf("@");
|
|
23
23
|
const a = aIndex === -1 ? a_[0] : a_[0].slice(0, aIndex);
|
|
@@ -11,7 +11,7 @@ const require_smol_primordial = require('../smol/primordial.js');
|
|
|
11
11
|
* `Array.prototype.with` are ES2024 / ES2023; the primordial captures the
|
|
12
12
|
* live reference at module load so consumers never see a tampered global.
|
|
13
13
|
*/
|
|
14
|
-
const
|
|
14
|
+
const smolPrimordial = require_smol_primordial.getSmolPrimordial();
|
|
15
15
|
const ArrayCtor = Array;
|
|
16
16
|
const ArrayBufferCtor = ArrayBuffer;
|
|
17
17
|
const DataViewCtor = DataView;
|
|
@@ -26,7 +26,7 @@ const Uint16ArrayCtor = Uint16Array;
|
|
|
26
26
|
const Uint32ArrayCtor = Uint32Array;
|
|
27
27
|
const ArrayFrom = Array.from;
|
|
28
28
|
const ArrayFromAsync = Array.fromAsync;
|
|
29
|
-
const ArrayIsArray =
|
|
29
|
+
const ArrayIsArray = smolPrimordial?.arrayIsArray ?? Array.isArray;
|
|
30
30
|
const ArrayOf = Array.of;
|
|
31
31
|
const ArrayBufferIsView = ArrayBuffer.isView;
|
|
32
32
|
const AtomicsWait = Atomics.wait;
|
|
@@ -68,17 +68,17 @@ const ArrayPrototypeToString = require_primordials_uncurry.uncurryThis(Array.pro
|
|
|
68
68
|
const ArrayPrototypeUnshift = require_primordials_uncurry.uncurryThis(Array.prototype.unshift);
|
|
69
69
|
const ArrayPrototypeValues = require_primordials_uncurry.uncurryThis(Array.prototype.values);
|
|
70
70
|
const ArrayPrototypeWith = require_primordials_uncurry.uncurryThis(Array.prototype.with);
|
|
71
|
-
const
|
|
72
|
-
let
|
|
73
|
-
while (
|
|
71
|
+
const anyIterator = (/* @__PURE__ */ new Map()).keys();
|
|
72
|
+
let iteratorLookup = Object.getPrototypeOf(anyIterator);
|
|
73
|
+
while (iteratorLookup && typeof iteratorLookup.next !== "function")
|
|
74
74
|
/* c8 ignore next - Modern V8 puts Iterator.prototype one hop up the chain
|
|
75
75
|
so the first check already finds .next; the walk-further branch fires
|
|
76
76
|
only on hypothetical engines where the prototype layout differs. */
|
|
77
|
-
|
|
78
|
-
const
|
|
79
|
-
const IteratorPrototypeNext = require_primordials_uncurry.uncurryThis(
|
|
77
|
+
iteratorLookup = Object.getPrototypeOf(iteratorLookup);
|
|
78
|
+
const iteratorProto = iteratorLookup;
|
|
79
|
+
const IteratorPrototypeNext = require_primordials_uncurry.uncurryThis(iteratorProto.next);
|
|
80
80
|
/* c8 ignore start */
|
|
81
|
-
const IteratorPrototypeReturn = typeof
|
|
81
|
+
const IteratorPrototypeReturn = typeof iteratorProto.return === "function" ? require_primordials_uncurry.uncurryThis(iteratorProto.return) : void 0;
|
|
82
82
|
/* c8 ignore stop */
|
|
83
83
|
|
|
84
84
|
//#endregion
|
package/dist/primordials/date.js
CHANGED
|
@@ -10,9 +10,9 @@ const require_smol_primordial = require('../smol/primordial.js');
|
|
|
10
10
|
* (single-byte wallclock read inlined into JIT'd callers) when available;
|
|
11
11
|
* stock Node falls back to `Date.now`.
|
|
12
12
|
*/
|
|
13
|
-
const
|
|
13
|
+
const smolPrimordial = require_smol_primordial.getSmolPrimordial();
|
|
14
14
|
const DateCtor = Date;
|
|
15
|
-
const DateNow =
|
|
15
|
+
const DateNow = smolPrimordial?.dateNow ?? Date.now;
|
|
16
16
|
const DateParse = Date.parse;
|
|
17
17
|
const DateUTC = Date.UTC;
|
|
18
18
|
const DatePrototypeGetTime = require_primordials_uncurry.uncurryThis(Date.prototype.getTime);
|
|
@@ -21,15 +21,15 @@ const URIErrorCtor = URIError;
|
|
|
21
21
|
const ErrorIsError = Error.isError;
|
|
22
22
|
const ErrorCaptureStackTrace = Error.captureStackTrace;
|
|
23
23
|
const ErrorPrepareStackTrace = Error.prepareStackTrace;
|
|
24
|
-
const
|
|
24
|
+
const stackTraceLimitGetter = (() => {
|
|
25
25
|
const getter = Error.__lookupGetter__?.("stackTraceLimit");
|
|
26
26
|
/* c8 ignore start */
|
|
27
27
|
if (typeof getter === "function") return () => getter.call(Error);
|
|
28
28
|
/* c8 ignore stop */
|
|
29
29
|
})();
|
|
30
30
|
function ErrorStackTraceLimit() {
|
|
31
|
-
/* c8 ignore start */
|
|
32
|
-
if (
|
|
31
|
+
/* c8 ignore start - non-V8 fallback path unreachable under test */
|
|
32
|
+
if (stackTraceLimitGetter) return stackTraceLimitGetter();
|
|
33
33
|
return Error.stackTraceLimit;
|
|
34
34
|
/* c8 ignore stop */
|
|
35
35
|
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Safe references to the Fetch `Headers` constructor and its
|
|
3
|
+
* `Headers.prototype` methods. `Headers` is a global on Node 22+ (the fleet
|
|
4
|
+
* floor), captured unguarded like `URL` / `URLSearchParams`.
|
|
5
|
+
*/
|
|
6
|
+
export declare const HeadersCtor: typeof Headers;
|
|
7
|
+
export declare const HeadersPrototypeForEach: (self: unknown, callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
8
|
+
export declare const HeadersPrototypeGet: (self: unknown, name: string) => string | null;
|
|
9
|
+
export declare const HeadersPrototypeHas: (self: unknown, name: string) => boolean;
|
|
10
|
+
export declare const HeadersPrototypeSet: (self: unknown, name: string, value: string) => void;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_uncurry = require('./uncurry.js');
|
|
5
|
+
|
|
6
|
+
//#region src/primordials/headers.ts
|
|
7
|
+
/**
|
|
8
|
+
* @file Safe references to the Fetch `Headers` constructor and its
|
|
9
|
+
* `Headers.prototype` methods. `Headers` is a global on Node 22+ (the fleet
|
|
10
|
+
* floor), captured unguarded like `URL` / `URLSearchParams`.
|
|
11
|
+
*/
|
|
12
|
+
const HeadersCtor = Headers;
|
|
13
|
+
const HeadersPrototypeForEach = require_primordials_uncurry.uncurryThis(Headers.prototype.forEach);
|
|
14
|
+
const HeadersPrototypeGet = require_primordials_uncurry.uncurryThis(Headers.prototype.get);
|
|
15
|
+
const HeadersPrototypeHas = require_primordials_uncurry.uncurryThis(Headers.prototype.has);
|
|
16
|
+
const HeadersPrototypeSet = require_primordials_uncurry.uncurryThis(Headers.prototype.set);
|
|
17
|
+
|
|
18
|
+
//#endregion
|
|
19
|
+
exports.HeadersCtor = HeadersCtor;
|
|
20
|
+
exports.HeadersPrototypeForEach = HeadersPrototypeForEach;
|
|
21
|
+
exports.HeadersPrototypeGet = HeadersPrototypeGet;
|
|
22
|
+
exports.HeadersPrototypeHas = HeadersPrototypeHas;
|
|
23
|
+
exports.HeadersPrototypeSet = HeadersPrototypeSet;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Safe references to `Intl` constructors. Captured once at module load so
|
|
3
|
+
* consumers reading adversarial input never see a tampered global. `new
|
|
4
|
+
* Intl.X(...)` is expensive (10-14ms for Collator in Node); callers are
|
|
5
|
+
* responsible for caching instances — these exports are the constructors
|
|
6
|
+
* only. On the smol Node binary the captures come from `node:smol-primordial`
|
|
7
|
+
* (which hoists them from within the sealed module context); on stock Node
|
|
8
|
+
* they fall back to the global `Intl` object.
|
|
9
|
+
*/
|
|
10
|
+
export declare const IntlCollator: typeof Intl.Collator;
|
|
11
|
+
export declare const IntlListFormat: typeof Intl.ListFormat;
|
|
12
|
+
export declare const IntlPluralRules: typeof Intl.PluralRules;
|
|
13
|
+
export declare const IntlSegmenter: typeof Intl.Segmenter;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_smol_primordial = require('../smol/primordial.js');
|
|
5
|
+
|
|
6
|
+
//#region src/primordials/intl.ts
|
|
7
|
+
/**
|
|
8
|
+
* @file Safe references to `Intl` constructors. Captured once at module load so
|
|
9
|
+
* consumers reading adversarial input never see a tampered global. `new
|
|
10
|
+
* Intl.X(...)` is expensive (10-14ms for Collator in Node); callers are
|
|
11
|
+
* responsible for caching instances — these exports are the constructors
|
|
12
|
+
* only. On the smol Node binary the captures come from `node:smol-primordial`
|
|
13
|
+
* (which hoists them from within the sealed module context); on stock Node
|
|
14
|
+
* they fall back to the global `Intl` object.
|
|
15
|
+
*/
|
|
16
|
+
const smolPrimordial = require_smol_primordial.getSmolPrimordial();
|
|
17
|
+
const IntlCollator = smolPrimordial?.IntlCollator ?? Intl.Collator;
|
|
18
|
+
const IntlListFormat = smolPrimordial?.IntlListFormat ?? Intl.ListFormat;
|
|
19
|
+
const IntlPluralRules = smolPrimordial?.IntlPluralRules ?? Intl.PluralRules;
|
|
20
|
+
const IntlSegmenter = smolPrimordial?.IntlSegmenter ?? Intl.Segmenter;
|
|
21
|
+
|
|
22
|
+
//#endregion
|
|
23
|
+
exports.IntlCollator = IntlCollator;
|
|
24
|
+
exports.IntlListFormat = IntlListFormat;
|
|
25
|
+
exports.IntlPluralRules = IntlPluralRules;
|
|
26
|
+
exports.IntlSegmenter = IntlSegmenter;
|
package/dist/primordials/math.js
CHANGED
|
@@ -11,7 +11,7 @@ const require_smol_primordial = require('../smol/primordial.js');
|
|
|
11
11
|
* stock `Math.X` since they are pre-computed scalar values with no fast-path
|
|
12
12
|
* benefit.
|
|
13
13
|
*/
|
|
14
|
-
const
|
|
14
|
+
const smolPrimordial = require_smol_primordial.getSmolPrimordial();
|
|
15
15
|
const MathE = Math.E;
|
|
16
16
|
const MathLN2 = Math.LN2;
|
|
17
17
|
const MathLN10 = Math.LN10;
|
|
@@ -20,42 +20,42 @@ const MathLOG10E = Math.LOG10E;
|
|
|
20
20
|
const MathPI = Math.PI;
|
|
21
21
|
const MathSQRT1_2 = Math.SQRT1_2;
|
|
22
22
|
const MathSQRT2 = Math.SQRT2;
|
|
23
|
-
const MathAbs =
|
|
24
|
-
const MathAcos =
|
|
25
|
-
const MathAcosh =
|
|
26
|
-
const MathAsin =
|
|
27
|
-
const MathAsinh =
|
|
28
|
-
const MathAtan =
|
|
29
|
-
const MathAtan2 =
|
|
30
|
-
const MathAtanh =
|
|
31
|
-
const MathCbrt =
|
|
32
|
-
const MathCeil =
|
|
33
|
-
const MathClz32 =
|
|
34
|
-
const MathCos =
|
|
35
|
-
const MathCosh =
|
|
36
|
-
const MathExp =
|
|
37
|
-
const MathExpm1 =
|
|
23
|
+
const MathAbs = smolPrimordial?.mathAbs ?? Math.abs;
|
|
24
|
+
const MathAcos = smolPrimordial?.mathAcos ?? Math.acos;
|
|
25
|
+
const MathAcosh = smolPrimordial?.mathAcosh ?? Math.acosh;
|
|
26
|
+
const MathAsin = smolPrimordial?.mathAsin ?? Math.asin;
|
|
27
|
+
const MathAsinh = smolPrimordial?.mathAsinh ?? Math.asinh;
|
|
28
|
+
const MathAtan = smolPrimordial?.mathAtan ?? Math.atan;
|
|
29
|
+
const MathAtan2 = smolPrimordial?.mathAtan2 ?? Math.atan2;
|
|
30
|
+
const MathAtanh = smolPrimordial?.mathAtanh ?? Math.atanh;
|
|
31
|
+
const MathCbrt = smolPrimordial?.mathCbrt ?? Math.cbrt;
|
|
32
|
+
const MathCeil = smolPrimordial?.mathCeil ?? Math.ceil;
|
|
33
|
+
const MathClz32 = smolPrimordial?.mathClz32 ?? Math.clz32;
|
|
34
|
+
const MathCos = smolPrimordial?.mathCos ?? Math.cos;
|
|
35
|
+
const MathCosh = smolPrimordial?.mathCosh ?? Math.cosh;
|
|
36
|
+
const MathExp = smolPrimordial?.mathExp ?? Math.exp;
|
|
37
|
+
const MathExpm1 = smolPrimordial?.mathExpm1 ?? Math.expm1;
|
|
38
38
|
const MathF16round = Math.f16round;
|
|
39
|
-
const MathFloor =
|
|
40
|
-
const MathFround =
|
|
41
|
-
const MathHypot =
|
|
42
|
-
const MathImul =
|
|
43
|
-
const MathLog =
|
|
44
|
-
const MathLog1p =
|
|
45
|
-
const MathLog2 =
|
|
46
|
-
const MathLog10 =
|
|
39
|
+
const MathFloor = smolPrimordial?.mathFloor ?? Math.floor;
|
|
40
|
+
const MathFround = smolPrimordial?.mathFround ?? Math.fround;
|
|
41
|
+
const MathHypot = smolPrimordial?.mathHypot ?? Math.hypot;
|
|
42
|
+
const MathImul = smolPrimordial?.mathImul ?? Math.imul;
|
|
43
|
+
const MathLog = smolPrimordial?.mathLog ?? Math.log;
|
|
44
|
+
const MathLog1p = smolPrimordial?.mathLog1p ?? Math.log1p;
|
|
45
|
+
const MathLog2 = smolPrimordial?.mathLog2 ?? Math.log2;
|
|
46
|
+
const MathLog10 = smolPrimordial?.mathLog10 ?? Math.log10;
|
|
47
47
|
const MathMax = Math.max;
|
|
48
48
|
const MathMin = Math.min;
|
|
49
|
-
const MathPow =
|
|
49
|
+
const MathPow = smolPrimordial?.mathPow ?? Math.pow;
|
|
50
50
|
const MathRandom = Math.random;
|
|
51
|
-
const MathRound =
|
|
52
|
-
const MathSign =
|
|
53
|
-
const MathSin =
|
|
54
|
-
const MathSinh =
|
|
55
|
-
const MathSqrt =
|
|
56
|
-
const MathTan =
|
|
57
|
-
const MathTanh =
|
|
58
|
-
const MathTrunc =
|
|
51
|
+
const MathRound = smolPrimordial?.mathRound ?? Math.round;
|
|
52
|
+
const MathSign = smolPrimordial?.mathSign ?? Math.sign;
|
|
53
|
+
const MathSin = smolPrimordial?.mathSin ?? Math.sin;
|
|
54
|
+
const MathSinh = smolPrimordial?.mathSinh ?? Math.sinh;
|
|
55
|
+
const MathSqrt = smolPrimordial?.mathSqrt ?? Math.sqrt;
|
|
56
|
+
const MathTan = smolPrimordial?.mathTan ?? Math.tan;
|
|
57
|
+
const MathTanh = smolPrimordial?.mathTanh ?? Math.tanh;
|
|
58
|
+
const MathTrunc = smolPrimordial?.mathTrunc ?? Math.trunc;
|
|
59
59
|
|
|
60
60
|
//#endregion
|
|
61
61
|
exports.MathAbs = MathAbs;
|