@socketsecurity/lib 6.0.8 → 6.0.10
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 +28 -0
- package/README.md +8 -9
- package/dist/abort/signal.d.ts +1 -1
- package/dist/abort/signal.js +1 -1
- package/dist/ai/agent-context.d.mts +1 -1
- package/dist/ai/agent-context.js +3 -2
- package/dist/ai/backends.d.mts +3 -3
- package/dist/ai/backends.js +2 -2
- package/dist/ai/billing-context.d.mts +74 -0
- package/dist/ai/billing-context.js +129 -0
- package/dist/ai/credentials.d.mts +39 -5
- package/dist/ai/credentials.js +61 -6
- package/dist/ai/discover.d.mts +4 -0
- package/dist/ai/discover.js +4 -0
- package/dist/ai/exec.d.mts +1 -1
- package/dist/ai/exec.js +1 -1
- package/dist/ai/http.d.mts +8 -8
- package/dist/ai/http.js +6 -6
- package/dist/ai/profiles.d.mts +9 -10
- package/dist/ai/profiles.js +0 -5
- package/dist/ai/role.d.mts +58 -0
- package/dist/ai/role.js +96 -0
- package/dist/ai/route-heuristic.d.mts +177 -0
- package/dist/ai/route-heuristic.js +194 -0
- package/dist/ai/route.d.mts +31 -17
- package/dist/ai/route.js +35 -19
- package/dist/ai/spawn.d.mts +34 -1
- package/dist/ai/spawn.js +115 -3
- package/dist/ai/subagent-status.d.mts +2 -0
- package/dist/ai/subagent-status.js +2 -0
- package/dist/ai/tier.d.mts +1 -1
- package/dist/ai/types.d.mts +19 -2
- package/dist/ai/worktree.d.mts +1 -1
- package/dist/ai/worktree.js +3 -2
- package/dist/argv/parse.d.ts +2 -0
- package/dist/argv/parse.js +2 -0
- package/dist/bin/_internal.d.ts +1 -1
- package/dist/bin/_internal.js +1 -1
- package/dist/bin/prim.cjs +19253 -13937
- package/dist/bin/resolve.js +1 -1
- package/dist/bin/shadow.js +2 -1
- package/dist/bin/which.d.ts +28 -3
- package/dist/bin/which.js +45 -3
- package/dist/cacache/_internal.d.ts +10 -2
- package/dist/cacache/_internal.js +6 -10
- package/dist/cache/ttl/_internal.d.ts +33 -0
- package/dist/cache/ttl/_internal.js +68 -0
- package/dist/cache/ttl/browser.d.ts +56 -0
- package/dist/cache/ttl/browser.js +257 -0
- package/dist/cache/ttl/store.js +11 -34
- package/dist/cache/ttl/types.d.ts +46 -3
- package/dist/checks/primordials-defaults.d.ts +5 -5
- package/dist/checks/primordials-defaults.js +5 -5
- package/dist/checks/primordials.d.ts +1 -1
- package/dist/checks/primordials.js +25 -17
- package/dist/cli/check-primordials.d.ts +6 -1
- package/dist/cli/check-primordials.js +14 -5
- package/dist/cli/check.js +1 -1
- package/dist/cli/socket-lib.d.ts +1 -1
- package/dist/cli/socket-lib.js +3 -3
- package/dist/colors/socket-palette.d.ts +1 -1
- package/dist/compression/brotli.d.ts +6 -2
- package/dist/compression/brotli.js +5 -1
- package/dist/compression/gzip.d.ts +6 -2
- package/dist/compression/gzip.js +7 -2
- package/dist/config/layers.d.ts +53 -0
- package/dist/config/layers.js +83 -0
- package/dist/constants/agents.d.ts +3 -0
- package/dist/constants/agents.js +3 -0
- package/dist/constants/node.d.ts +14 -0
- package/dist/constants/node.js +14 -0
- package/dist/constants/package-default-node-range.js +1 -5
- package/dist/constants/packages.d.ts +5 -0
- package/dist/constants/packages.js +5 -0
- package/dist/constants/platform.d.ts +1 -1
- package/dist/constants/platform.js +1 -1
- package/dist/constants/socket.js +1 -1
- package/dist/constants/typescript.d.ts +5 -0
- package/dist/constants/typescript.js +5 -0
- package/dist/debug/_internal.d.ts +22 -7
- package/dist/debug/_internal.js +33 -15
- package/dist/debug/caller-info.js +1 -1
- package/dist/debug/namespace.js +11 -8
- package/dist/debug/output.d.ts +12 -1
- package/dist/debug/output.js +33 -16
- package/dist/dlx/binary-cache.js +1 -1
- package/dist/dlx/binary-resolution.js +8 -5
- package/dist/dlx/firewall.js +1 -1
- package/dist/dlx/lockfile.js +1 -1
- package/dist/eco/npm/npm/parse-lockfile.js +3 -2
- package/dist/eco/npm/vlt/exec.d.ts +1 -1
- package/dist/eco/npm/vlt/exec.js +1 -1
- package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +1 -1
- package/dist/env/agents.d.ts +6 -0
- package/dist/env/agents.js +29 -0
- package/dist/env/flags.d.ts +12 -0
- package/dist/env/flags.js +23 -0
- package/dist/env/github-status.js +2 -2
- package/dist/env/providers.d.ts +6 -0
- package/dist/env/providers.js +23 -0
- package/dist/env/proxy.js +1 -1
- package/dist/env/rewire.d.ts +37 -3
- package/dist/env/rewire.js +60 -29
- package/dist/env/runtimes.d.ts +9 -0
- package/dist/env/runtimes.js +53 -0
- package/dist/env/socket-cli.d.ts +5 -2
- package/dist/env/socket-cli.js +6 -3
- package/dist/env/xdg.d.ts +17 -0
- package/dist/env/xdg.js +21 -1
- package/dist/errors/predicates.d.ts +3 -2
- package/dist/errors/predicates.js +5 -3
- package/dist/events/exit/_internal.d.ts +1 -23
- package/dist/external/@npmcli/package-json.js +3570 -4905
- package/dist/external/@npmcli/promise-spawn.js +2 -2
- package/dist/external/@sinclair/typebox/value.js +5 -4
- package/dist/external/@socketregistry/yocto-spinner.js +3 -3
- package/dist/external/@yarnpkg/extensions.js +1 -1
- package/dist/external/adm-zip.d.ts +82 -0
- package/dist/external/adm-zip.js +2 -2
- package/dist/external/cacache.d.ts +87 -0
- package/dist/external/debug.d.ts +22 -0
- package/dist/external/debug.js +11 -4
- package/dist/external/del.d.ts +1 -0
- package/dist/external/external-pack.d.ts +12 -0
- package/dist/external/external-pack.js +42 -35
- package/dist/external/fast-glob.d.ts +8 -0
- package/dist/external/fast-sort.d.ts +1 -0
- package/dist/external/get-east-asian-width.d.ts +5 -0
- package/dist/external/get-east-asian-width.js +8 -1
- package/dist/external/has-flag.d.ts +1 -0
- package/dist/external/inquirer-pack.d.ts +18 -0
- package/dist/external/libnpmexec.d.ts +35 -0
- package/dist/external/libnpmpack.d.ts +1 -0
- package/dist/external/make-fetch-happen.d.ts +13 -0
- package/dist/external/normalize-package-data.d.ts +4 -0
- package/dist/external/npm-core.d.ts +14 -0
- package/dist/external/npm-pack.d.ts +24 -0
- package/dist/external/npm-pack.js +28934 -31885
- package/dist/external/npm-package-arg.d.ts +4 -0
- package/dist/external/p-map.js +8 -1
- package/dist/external/pacote.d.ts +15 -0
- package/dist/external/pico-pack.d.ts +16 -0
- package/dist/external/pico-pack.js +38 -23
- package/dist/external/picomatch.d.ts +96 -0
- package/dist/external/pony-cause.d.ts +14 -0
- package/dist/external/semver.d.ts +60 -0
- package/dist/external/semver.js +1459 -4
- package/dist/external/shell-quote.d.ts +51 -0
- package/dist/external/shell-quote.js +55 -15
- package/dist/external/signal-exit.d.ts +1 -0
- package/dist/external/spdx-correct.d.ts +4 -0
- package/dist/external/spdx-expression-parse.d.ts +4 -0
- package/dist/external/spdx-pack.d.ts +10 -0
- package/dist/external/std-env.d.ts +284 -0
- package/dist/external/std-env.js +323 -0
- package/dist/external/streaming-iterables.d.ts +11 -0
- package/dist/external/supports-color.d.ts +1 -0
- package/dist/external/tar-fs.d.ts +31 -0
- package/dist/external/tar-fs.js +63 -16
- package/dist/external/validate-npm-package-name.d.ts +4 -0
- package/dist/external/which.d.ts +25 -0
- package/dist/external/which.js +2 -2
- package/dist/external/yargs-parser.d.ts +2 -0
- package/dist/external/yargs-parser.js +11 -3
- package/dist/external/yoctocolors-cjs.d.ts +51 -0
- package/dist/external-tools/bazel/asset-names.d.ts +1 -1
- package/dist/external-tools/bazel/from-download.d.ts +1 -1
- package/dist/external-tools/bazel/resolve.d.ts +3 -0
- package/dist/external-tools/bazel/resolve.js +3 -0
- package/dist/external-tools/cdxgen/asset-names.d.ts +5 -5
- package/dist/external-tools/cdxgen/asset-names.js +3 -3
- package/dist/external-tools/cdxgen/from-download.d.ts +2 -2
- package/dist/external-tools/cdxgen/from-download.js +1 -1
- package/dist/external-tools/cdxgen/resolve.d.ts +4 -1
- package/dist/external-tools/cdxgen/resolve.js +4 -1
- package/dist/external-tools/cdxgen/types.d.ts +1 -1
- package/dist/external-tools/from-download.d.ts +2 -2
- package/dist/external-tools/from-download.js +1 -1
- package/dist/external-tools/janus/asset-names.d.ts +4 -1
- package/dist/external-tools/janus/asset-names.js +3 -0
- package/dist/external-tools/janus/from-download.d.ts +3 -3
- package/dist/external-tools/janus/from-download.js +2 -2
- package/dist/external-tools/janus/resolve.d.ts +3 -0
- package/dist/external-tools/janus/resolve.js +3 -0
- package/dist/external-tools/jre/asset-names.d.ts +3 -1
- package/dist/external-tools/jre/asset-names.js +2 -0
- 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/manifest.d.ts +5 -3
- package/dist/external-tools/manifest.js +5 -3
- package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
- package/dist/external-tools/opengrep/resolve.d.ts +3 -0
- package/dist/external-tools/opengrep/resolve.js +3 -0
- package/dist/external-tools/python/asset-names.d.ts +3 -1
- package/dist/external-tools/python/asset-names.js +8 -4
- package/dist/external-tools/python/pin.js +3 -1
- package/dist/external-tools/python/resolve.d.ts +3 -0
- package/dist/external-tools/python/resolve.js +3 -0
- 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/resolve.d.ts +3 -0
- package/dist/external-tools/sbt/resolve.js +3 -0
- 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 +18 -3
- package/dist/external-tools/skillspector/resolve.js +21 -8
- package/dist/external-tools/skillspector/types.d.ts +3 -1
- package/dist/external-tools/synp/resolve.d.ts +3 -0
- package/dist/external-tools/synp/resolve.js +3 -0
- package/dist/external-tools/trivy/asset-names.d.ts +1 -1
- package/dist/external-tools/trivy/resolve.d.ts +3 -0
- package/dist/external-tools/trivy/resolve.js +3 -0
- package/dist/external-tools/trufflehog/asset-names.d.ts +4 -1
- package/dist/external-tools/trufflehog/asset-names.js +3 -0
- package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
- package/dist/external-tools/trufflehog/resolve.d.ts +3 -0
- package/dist/external-tools/trufflehog/resolve.js +3 -0
- 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 +28 -0
- package/dist/external-tools/uv/resolve.js +64 -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 +55 -0
- package/dist/fleet/repo-config.js +81 -0
- package/dist/fs/_internal.d.ts +1 -1
- package/dist/fs/_internal.js +1 -1
- package/dist/fs/access.d.ts +2 -0
- package/dist/fs/access.js +2 -0
- package/dist/fs/copy.d.ts +88 -0
- package/dist/fs/copy.js +89 -0
- package/dist/fs/find.js +1 -2
- package/dist/fs/inspect.d.ts +2 -2
- package/dist/fs/read-file.js +3 -4
- package/dist/fs/safe.js +2 -2
- package/dist/git/_internal.js +7 -3
- package/dist/github/commit.d.ts +92 -0
- package/dist/github/commit.js +113 -0
- package/dist/github/ghsa.js +1 -1
- package/dist/github/refs-graphql.js +1 -1
- package/dist/github/refs.js +10 -15
- package/dist/github/request.js +1 -1
- package/dist/github/token.d.ts +5 -2
- package/dist/github/token.js +6 -4
- package/dist/github/workflow-runs.d.ts +107 -0
- package/dist/github/workflow-runs.js +98 -0
- package/dist/globs/_internal.js +1 -1
- package/dist/http-request/_internal.d.ts +1 -1
- package/dist/http-request/browser.d.ts +6 -0
- package/dist/http-request/browser.js +4 -3
- package/dist/http-request/checksum-file.js +1 -1
- package/dist/http-request/download.js +2 -0
- package/dist/http-request/headers.d.ts +1 -1
- package/dist/http-request/headers.js +2 -2
- package/dist/http-request/request-attempt.js +6 -3
- package/dist/http-request/request-types.d.ts +10 -1
- package/dist/http-request/request.js +2 -2
- package/dist/http-request/user-agent.d.ts +23 -2
- package/dist/http-request/user-agent.js +48 -6
- package/dist/integrity.d.ts +127 -78
- package/dist/integrity.js +170 -84
- package/dist/json/format.js +4 -1
- package/dist/logger/_internal.d.ts +13 -15
- package/dist/logger/_internal.js +21 -21
- package/dist/logger/colors.d.ts +10 -5
- package/dist/logger/colors.js +7 -14
- package/dist/logger/console-methods.js +2 -2
- package/dist/logger/console.d.ts +1 -0
- package/dist/logger/console.js +9 -9
- package/dist/logger/node.js +2 -1
- package/dist/logger/symbols-builder.js +7 -8
- package/dist/logger/symbols.js +8 -8
- package/dist/native-messaging/install.js +1 -1
- package/dist/native-messaging/rate-limit.d.ts +4 -1
- package/dist/native-messaging/rate-limit.js +4 -1
- package/dist/node/events.d.ts +3 -0
- package/dist/node/events.js +3 -0
- package/dist/node/fs.d.ts +1 -1
- package/dist/node/module.d.ts +73 -2
- package/dist/node/module.js +97 -12
- package/dist/node/timers-promises.d.ts +3 -0
- package/dist/node/timers-promises.js +3 -0
- package/dist/node/url.d.ts +3 -0
- package/dist/node/url.js +3 -0
- package/dist/npm/meta-cache.d.ts +183 -0
- package/dist/npm/meta-cache.js +318 -0
- package/dist/npm/meta-slice.d.ts +27 -0
- package/dist/npm/meta-slice.js +68 -0
- package/dist/npm/meta-types.d.ts +282 -0
- package/dist/npm/meta-types.js +2 -0
- package/dist/npm/meta.d.ts +125 -0
- package/dist/npm/meta.js +347 -0
- package/dist/npm/registry.d.ts +212 -0
- package/dist/npm/registry.js +284 -0
- package/dist/objects/getters.d.ts +1 -1
- package/dist/objects/getters.js +1 -1
- package/dist/objects/predicates.js +1 -1
- package/dist/packages/exports.js +2 -2
- package/dist/packages/isolation.js +1 -1
- package/dist/packages/manifest.d.ts +29 -0
- package/dist/packages/manifest.js +44 -9
- package/dist/packages/metadata-extensions.js +2 -4
- package/dist/packages/normalize.js +1 -1
- package/dist/packages/provenance.d.ts +8 -0
- package/dist/packages/provenance.js +10 -2
- package/dist/packages/specs.js +1 -1
- package/dist/packages/tarball.js +1 -2
- package/dist/packages/validation.d.ts +0 -10
- package/dist/packages/validation.js +0 -14
- 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/exts.d.ts +30 -0
- package/dist/paths/exts.js +30 -0
- package/dist/paths/filenames.d.ts +6 -0
- package/dist/paths/filenames.js +6 -0
- package/dist/paths/globs.d.ts +6 -0
- package/dist/paths/globs.js +6 -0
- package/dist/paths/normalize.js +1 -1
- package/dist/paths/predicates.js +2 -1
- package/dist/paths/resolve.js +19 -14
- package/dist/paths/socket.d.ts +81 -30
- package/dist/paths/socket.js +102 -28
- package/dist/perf/metrics.js +1 -1
- package/dist/perf/report.js +5 -3
- package/dist/pkg-ext/data.js +0 -2
- package/dist/primordials/globals.d.ts +1 -1
- package/dist/primordials/globals.js +1 -1
- package/dist/primordials/headers.d.ts +13 -1
- package/dist/primordials/headers.js +13 -1
- package/dist/primordials/process.d.ts +1 -1
- package/dist/primordials/process.js +1 -1
- package/dist/primordials/url.d.ts +18 -0
- package/dist/primordials/url.js +18 -0
- package/dist/process/spawn/child.js +3 -5
- package/dist/promises/_internal.d.ts +1 -1
- package/dist/promises/_internal.js +1 -2
- package/dist/promises/options.js +3 -3
- package/dist/regexps/spec.js +1 -1
- package/dist/releases/socket-btm-binary-naming.js +12 -1
- package/dist/schema/validate.js +1 -1
- package/dist/secrets/_internal.d.ts +1 -1
- package/dist/secrets/_internal.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 +17 -3
- package/dist/secrets/keychain.d.ts +10 -1
- package/dist/secrets/keychain.js +10 -1
- package/dist/secrets/rc.js +1 -1
- package/dist/secrets/socket-api-token.d.ts +1 -1
- package/dist/secrets/socket-api-token.js +1 -1
- package/dist/secrets/types.d.ts +1 -1
- package/dist/smol/detect.js +1 -1
- package/dist/smol/http.d.ts +2 -0
- package/dist/smol/http.js +3 -1
- package/dist/smol/https.d.ts +2 -0
- package/dist/smol/https.js +3 -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 +2 -4
- package/dist/sorts/_internal.js +1 -7
- package/dist/sorts/semver.js +2 -2
- package/dist/spinner/create-spinner-class.js +1 -1
- package/dist/spinner/format.js +2 -4
- package/dist/stdio/footer.js +8 -7
- package/dist/stdio/progress.js +1 -1
- package/dist/stdio/prompts.d.ts +8 -23
- package/dist/stdio/prompts.js +28 -52
- package/dist/strings/format.js +1 -1
- package/dist/strings/predicates.d.ts +2 -2
- package/dist/strings/search.js +2 -2
- package/dist/strings/types.d.ts +4 -0
- package/dist/strings/width.d.ts +1 -0
- package/dist/strings/width.js +17 -8
- package/dist/themes/context.d.ts +18 -3
- package/dist/themes/context.js +28 -14
- package/dist/versions/_internal.d.ts +43 -13
- package/dist/versions/_internal.js +27 -15
- package/dist/versions/compare.d.ts +16 -10
- package/dist/versions/compare.js +36 -16
- package/dist/versions/parse.js +1 -1
- package/dist/versions/range.js +3 -2
- package/dist/words/pluralize.js +4 -1
- package/llms.txt +63 -0
- package/package.json +271 -40
package/dist/paths/socket.js
CHANGED
|
@@ -2,7 +2,9 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_node_os = require('../node/os.js');
|
|
5
|
+
const require_constants_platform = require('../constants/platform.js');
|
|
5
6
|
const require_env_home = require('../env/home.js');
|
|
7
|
+
const require_env_xdg = require('../env/xdg.js');
|
|
6
8
|
const require_paths_normalize = require('./normalize.js');
|
|
7
9
|
const require_node_path = require('../node/path.js');
|
|
8
10
|
const require_env_socket = require('../env/socket.js');
|
|
@@ -19,8 +21,8 @@ const require_paths_rewire = require('./rewire.js');
|
|
|
19
21
|
* `_dlx/<hash>/` name+version binary store (node, jre, python, sfw, …);
|
|
20
22
|
* `_state/<app>/` version-LESS persistent app state (daemon socket + lock +
|
|
21
23
|
* OAuth refresh; mirrors pnpm `state-dir` / XDG_STATE_HOME), with
|
|
22
|
-
* `_state/<app>/run/` for a daemon's socket/lock/pid; `_wheelhouse`
|
|
23
|
-
*
|
|
24
|
+
* `_state/<app>/run/` for a daemon's socket/lock/pid; `_wheelhouse` shared
|
|
25
|
+
* bin across Socket tools. Generic per-app dirs (`getSocketAppDir('<name>')`)
|
|
24
26
|
* nest under the same `_`-prefix.
|
|
25
27
|
*/
|
|
26
28
|
/**
|
|
@@ -44,6 +46,33 @@ function getOsTmpDir() {
|
|
|
44
46
|
return require_paths_rewire.getPathValue("tmpdir", () => os.tmpdir());
|
|
45
47
|
}
|
|
46
48
|
/**
|
|
49
|
+
* Resolve the runtime socket path for a local daemon named `name`. Distinct
|
|
50
|
+
* from getSocketAppRuntimeDir (the persistent ~/.socket/_state/<app>/run/
|
|
51
|
+
* home): the SOCKET endpoint itself belongs in the ephemeral, owner-only XDG
|
|
52
|
+
* runtime dir — correctly permissioned and auto-cleaned on logout — while the
|
|
53
|
+
* downloaded daemon binary + durable token cache live under ~/.socket. The
|
|
54
|
+
* daemon and every client MUST compute the identical path (1 path, 1
|
|
55
|
+
* reference), so this is the single resolver both sides call.
|
|
56
|
+
*
|
|
57
|
+
* Resolution:
|
|
58
|
+
*
|
|
59
|
+
* - Windows: `\\.\pipe\<name>-sock` (named pipe; Unix sockets are unavailable
|
|
60
|
+
* pre-Win10 1803, same framing/semantics). Returned raw — a pipe path is not
|
|
61
|
+
* a filesystem path and must not be slash-normalized.
|
|
62
|
+
* - `$XDG_RUNTIME_DIR/<name>.sock` when XDG_RUNTIME_DIR is set (systemd
|
|
63
|
+
* `/run/user/<uid>/`).
|
|
64
|
+
* - Else `$TMPDIR/<name>-<uid>.sock` (the `<uid>` suffix avoids collisions when
|
|
65
|
+
* TMPDIR is shared across users on a multi-tenant box).
|
|
66
|
+
*/
|
|
67
|
+
function getRuntimeSocketPath(name) {
|
|
68
|
+
if (require_constants_platform.WIN32) return `\\\\.\\pipe\\${name}-sock`;
|
|
69
|
+
const path = require_node_path.getNodePath();
|
|
70
|
+
const xdgRuntimeDir = require_env_xdg.getXdgRuntimeDir();
|
|
71
|
+
if (xdgRuntimeDir) return require_paths_normalize.normalizePath(path.join(xdgRuntimeDir, `${name}.sock`));
|
|
72
|
+
const { uid } = require_node_os.getNodeOs().userInfo();
|
|
73
|
+
return require_paths_normalize.normalizePath(path.join(getOsTmpDir(), `${name}-${uid}.sock`));
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
47
76
|
* Get a Socket app cache directory (~/.socket/_<appName>/cache).
|
|
48
77
|
*/
|
|
49
78
|
/**
|
|
@@ -142,12 +171,54 @@ function getSocketHomePath() {
|
|
|
142
171
|
return getSocketUserDir();
|
|
143
172
|
}
|
|
144
173
|
/**
|
|
145
|
-
* Get the
|
|
146
|
-
*
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
*
|
|
174
|
+
* Get the Wheelhouse rack directory (~/.socket/_wheelhouse/rack) — the tool
|
|
175
|
+
* STORE. Every `_wheelhouse`-managed CLI tool keeps its real binaries here,
|
|
176
|
+
* racked by name + version as `<rack>/<tool>/<version>/…` (the wheelhouse
|
|
177
|
+
* analog of Homebrew's `Cellar/`). The handles on PATH live in
|
|
178
|
+
* `<wheelhouse>/bin` (getSocketWheelhouseBinDir) and point into the rack.
|
|
179
|
+
* Inherits the `_wheelhouse` override chain (SOCKET_HOME /
|
|
180
|
+
* setPath('socket-wheelhouse-dir')).
|
|
150
181
|
*/
|
|
182
|
+
function getSocketRackDir() {
|
|
183
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketWheelhouseDir(), "rack"));
|
|
184
|
+
}
|
|
185
|
+
/**
|
|
186
|
+
* Get a racked tool's version directory (~/.socket/_wheelhouse/rack/<tool>/
|
|
187
|
+
* <version>) — the per-tool, per-version home under the rack. The
|
|
188
|
+
* 1-path-1-reference owner of a tool install destination: installers resolve
|
|
189
|
+
* their extract/copy target through this, and the `<wheelhouse>/bin/<tool>`
|
|
190
|
+
* shim points at a binary inside it.
|
|
191
|
+
*/
|
|
192
|
+
function getSocketRackToolDir(options) {
|
|
193
|
+
const opts = {
|
|
194
|
+
__proto__: null,
|
|
195
|
+
...options
|
|
196
|
+
};
|
|
197
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketRackDir(), opts.tool, opts.version));
|
|
198
|
+
}
|
|
199
|
+
/**
|
|
200
|
+
* Get the Wheelhouse repo-clones directory (~/.socket/_wheelhouse/repo-clones).
|
|
201
|
+
* Sits beside the per-tool dirs (sfw, codedb, janus, bin) under `_wheelhouse`.
|
|
202
|
+
* The home for reference clones of EXTERNAL repos an agent reviews, each as
|
|
203
|
+
* `<org>-<repo>` lowercased + dash-cased (e.g. `justrach-codedb`).
|
|
204
|
+
*
|
|
205
|
+
* Smallest-practical clone form (smallest disk + fastest initial fetch without
|
|
206
|
+
* the treeless tax): git clone --depth=1 --single-branch --filter=blob:none
|
|
207
|
+
* <url> <dest> `--depth=1` truncates history, `--single-branch` skips other
|
|
208
|
+
* refs, and `--filter=blob:none` (a BLOBLESS partial clone) fetches file blobs
|
|
209
|
+
* lazily on first access — so the initial download is tree-metadata only.
|
|
210
|
+
* (Treeless `--filter=tree:0` is smaller still but refetches trees on every
|
|
211
|
+
* walk, which is slow + breaks offline, so it is NOT the default.)
|
|
212
|
+
*
|
|
213
|
+
* Deliberately OUTSIDE `~/projects/` so Socket's sibling-walk tooling (e.g.
|
|
214
|
+
* cascade `--all`) never mistakes a reference clone for a Socket repo
|
|
215
|
+
* checkout. Disposable: a reference cache, not a working tree. Inherits the
|
|
216
|
+
* `_wheelhouse` override chain (SOCKET_HOME /
|
|
217
|
+
* setPath('socket-wheelhouse-dir')).
|
|
218
|
+
*/
|
|
219
|
+
function getSocketRepoClonesDir() {
|
|
220
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketWheelhouseDir(), "repo-clones"));
|
|
221
|
+
}
|
|
151
222
|
/**
|
|
152
223
|
* Get the Socket state directory (~/.socket/_state) — version-LESS persistent
|
|
153
224
|
* app state (the home for daemon sockets, locks, OAuth refresh, durable caches
|
|
@@ -162,11 +233,6 @@ function getSocketStateDir() {
|
|
|
162
233
|
});
|
|
163
234
|
}
|
|
164
235
|
/**
|
|
165
|
-
* Get an app's persistent state directory (~/.socket/_state/<app>/). The
|
|
166
|
-
* `<app>` is a real app (proteus, acorn) nesting its version-less state inside
|
|
167
|
-
* the `_state` infra dir.
|
|
168
|
-
*/
|
|
169
|
-
/**
|
|
170
236
|
* Get the Socket user directory (~/.socket). Override precedence:
|
|
171
237
|
* setPath('socket-user-dir', …) → SOCKET_HOME env → $HOME/.socket →
|
|
172
238
|
* /tmp/.socket (Unix) or %TEMP%.socket (Windows).
|
|
@@ -179,24 +245,27 @@ function getSocketUserDir() {
|
|
|
179
245
|
});
|
|
180
246
|
}
|
|
181
247
|
/**
|
|
182
|
-
* Get the
|
|
183
|
-
*
|
|
184
|
-
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
*
|
|
188
|
-
*
|
|
189
|
-
*
|
|
248
|
+
* Get the Wheelhouse bin directory (~/.socket/_wheelhouse/bin) — the single
|
|
249
|
+
* directory placed on PATH. Holds only flat handles (thin exec shims or
|
|
250
|
+
* symlinks), one per tool, each pointing at a real binary racked under
|
|
251
|
+
* `<wheelhouse>/rack/<tool>/<version>/…` (getSocketRackToolDir). The shim IS
|
|
252
|
+
* the bin, the npm `prefix/bin` / Homebrew `bin/` model: PATH lookup does not
|
|
253
|
+
* recurse, so this dir stays flat (never a `bin/<tool>/` subdir). Inherits the
|
|
254
|
+
* `_wheelhouse` override chain (SOCKET_HOME /
|
|
255
|
+
* setPath('socket-wheelhouse-dir')).
|
|
190
256
|
*/
|
|
257
|
+
function getSocketWheelhouseBinDir() {
|
|
258
|
+
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketWheelhouseDir(), "bin"));
|
|
259
|
+
}
|
|
191
260
|
/**
|
|
192
|
-
* Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared
|
|
193
|
-
*
|
|
194
|
-
* each one re-downloading and re-extracting per-repo. Tool installers
|
|
195
|
-
* sfw, etc.)
|
|
196
|
-
* `<wheelhouse
|
|
197
|
-
*
|
|
198
|
-
* precedence: setPath('socket-wheelhouse-dir', …)
|
|
199
|
-
* $HOME/.socket/_wheelhouse.
|
|
261
|
+
* Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared location,
|
|
262
|
+
* common across Socket repos, for binaries that every Socket repo can reach
|
|
263
|
+
* without each one re-downloading and re-extracting per-repo. Tool installers
|
|
264
|
+
* (janus, sfw, etc.) rack their resolved executables under
|
|
265
|
+
* `<wheelhouse>/rack/<tool>/<version>/…` (getSocketRackToolDir) and expose a
|
|
266
|
+
* handle in `<wheelhouse>/bin` (getSocketWheelhouseBinDir); consumers add that
|
|
267
|
+
* one `bin/` to PATH. Override precedence: setPath('socket-wheelhouse-dir', …)
|
|
268
|
+
* → $SOCKET_HOME/_wheelhouse → $HOME/.socket/_wheelhouse.
|
|
200
269
|
*/
|
|
201
270
|
function getSocketWheelhouseDir() {
|
|
202
271
|
return require_paths_rewire.getPathValue("socket-wheelhouse-dir", () => {
|
|
@@ -234,6 +303,7 @@ function getUserHomeDir() {
|
|
|
234
303
|
//#endregion
|
|
235
304
|
exports.getOsHomeDir = getOsHomeDir;
|
|
236
305
|
exports.getOsTmpDir = getOsTmpDir;
|
|
306
|
+
exports.getRuntimeSocketPath = getRuntimeSocketPath;
|
|
237
307
|
exports.getSocketAppCacheDir = getSocketAppCacheDir;
|
|
238
308
|
exports.getSocketAppCacheTtlDir = getSocketAppCacheTtlDir;
|
|
239
309
|
exports.getSocketAppDir = getSocketAppDir;
|
|
@@ -242,7 +312,11 @@ exports.getSocketAppStateDir = getSocketAppStateDir;
|
|
|
242
312
|
exports.getSocketCacacheDir = getSocketCacacheDir;
|
|
243
313
|
exports.getSocketDlxDir = getSocketDlxDir;
|
|
244
314
|
exports.getSocketHomePath = getSocketHomePath;
|
|
315
|
+
exports.getSocketRackDir = getSocketRackDir;
|
|
316
|
+
exports.getSocketRackToolDir = getSocketRackToolDir;
|
|
317
|
+
exports.getSocketRepoClonesDir = getSocketRepoClonesDir;
|
|
245
318
|
exports.getSocketStateDir = getSocketStateDir;
|
|
246
319
|
exports.getSocketUserDir = getSocketUserDir;
|
|
320
|
+
exports.getSocketWheelhouseBinDir = getSocketWheelhouseBinDir;
|
|
247
321
|
exports.getSocketWheelhouseDir = getSocketWheelhouseDir;
|
|
248
322
|
exports.getUserHomeDir = getUserHomeDir;
|
package/dist/perf/metrics.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_math = require('../primordials/math.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_primordials_math = require('../primordials/math.js');
|
|
6
6
|
const require_debug_output = require('../debug/output.js');
|
|
7
7
|
const require_perf__internal = require('./_internal.js');
|
|
8
8
|
|
package/dist/perf/report.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_math = require('../primordials/math.js');
|
|
5
4
|
const require_primordials_object = require('../primordials/object.js');
|
|
5
|
+
const require_primordials_math = require('../primordials/math.js');
|
|
6
6
|
const require_debug_output = require('../debug/output.js');
|
|
7
7
|
const require_perf__internal = require('./_internal.js');
|
|
8
8
|
const require_perf_enabled = require('./enabled.js');
|
|
@@ -43,7 +43,8 @@ function generatePerformanceReport() {
|
|
|
43
43
|
let report = "\n╔═══════════════════════════════════════════════╗\n";
|
|
44
44
|
report += "║ Performance Report ║\n";
|
|
45
45
|
report += "╚═══════════════════════════════════════════════╝\n\n";
|
|
46
|
-
for (
|
|
46
|
+
for (let i = 0, { length } = operations; i < length; i += 1) {
|
|
47
|
+
const operation = operations[i];
|
|
47
48
|
const stats = summary[operation];
|
|
48
49
|
report += `${operation}:\n`;
|
|
49
50
|
report += ` Calls: ${stats.count}\n`;
|
|
@@ -72,7 +73,8 @@ function printPerformanceSummary() {
|
|
|
72
73
|
const summary = require_perf_metrics.getPerformanceSummary();
|
|
73
74
|
const operations = require_primordials_object.ObjectKeys(summary).toSorted();
|
|
74
75
|
require_debug_output.debugLog("[perf]\n=== Performance Summary ===");
|
|
75
|
-
for (
|
|
76
|
+
for (let i = 0, { length } = operations; i < length; i += 1) {
|
|
77
|
+
const operation = operations[i];
|
|
76
78
|
const stats = summary[operation];
|
|
77
79
|
require_debug_output.debugLog(`[perf] ${operation}: ${stats.count} calls, avg ${stats.avg}ms (min ${stats.min}ms, max ${stats.max}ms, total ${stats.total}ms)`);
|
|
78
80
|
}
|
package/dist/pkg-ext/data.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
4
|
let src_external__yarnpkg_extensions = require("../external/@yarnpkg/extensions");
|
|
6
|
-
src_external__yarnpkg_extensions = require_runtime.__toESM(src_external__yarnpkg_extensions);
|
|
7
5
|
|
|
8
6
|
//#region src/pkg-ext/data.ts
|
|
9
7
|
/**
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
export declare const BigIntCtor: BigIntConstructor;
|
|
10
10
|
export declare const BooleanCtor: BooleanConstructor;
|
|
11
11
|
export declare const ProxyCtor: ProxyConstructor;
|
|
12
|
-
export declare const SharedArrayBufferCtor: SharedArrayBufferConstructor;
|
|
12
|
+
export declare const SharedArrayBufferCtor: SharedArrayBufferConstructor | undefined;
|
|
13
13
|
export declare const InfinityValue: number;
|
|
14
14
|
export declare const NaNValue: number;
|
|
15
15
|
declare const capturedGlobalThis: typeof globalThis;
|
|
@@ -14,7 +14,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
14
14
|
const BigIntCtor = BigInt;
|
|
15
15
|
const BooleanCtor = Boolean;
|
|
16
16
|
const ProxyCtor = Proxy;
|
|
17
|
-
const SharedArrayBufferCtor = SharedArrayBuffer;
|
|
17
|
+
const SharedArrayBufferCtor = typeof SharedArrayBuffer === "undefined" ? void 0 : SharedArrayBuffer;
|
|
18
18
|
const InfinityValue = Infinity;
|
|
19
19
|
const NaNValue = NaN;
|
|
20
20
|
const capturedGlobalThis = globalThis;
|
|
@@ -1,10 +1,22 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Safe references to the Fetch `Headers` constructor and its
|
|
3
|
-
* `Headers.prototype` methods. `Headers` is a global on Node 22+ (
|
|
3
|
+
* `Headers.prototype` methods. `Headers` is a global on Node 22+ (Socket's
|
|
4
4
|
* floor), captured unguarded like `URL` / `URLSearchParams`.
|
|
5
5
|
*/
|
|
6
|
+
/**
|
|
7
|
+
* @unused No internal or Socket consumers.
|
|
8
|
+
*/
|
|
6
9
|
export declare const HeadersCtor: typeof Headers;
|
|
7
10
|
export declare const HeadersPrototypeForEach: (self: unknown, callbackfn: (value: string, key: string, parent: Headers) => void, thisArg?: any) => void;
|
|
11
|
+
/**
|
|
12
|
+
* @unused No internal or Socket consumers.
|
|
13
|
+
*/
|
|
8
14
|
export declare const HeadersPrototypeGet: (self: unknown, name: string) => string | null;
|
|
15
|
+
/**
|
|
16
|
+
* @unused No internal or Socket consumers.
|
|
17
|
+
*/
|
|
9
18
|
export declare const HeadersPrototypeHas: (self: unknown, name: string) => boolean;
|
|
19
|
+
/**
|
|
20
|
+
* @unused No internal or Socket consumers.
|
|
21
|
+
*/
|
|
10
22
|
export declare const HeadersPrototypeSet: (self: unknown, name: string, value: string) => void;
|
|
@@ -6,13 +6,25 @@ const require_primordials_uncurry = require('./uncurry.js');
|
|
|
6
6
|
//#region src/primordials/headers.ts
|
|
7
7
|
/**
|
|
8
8
|
* @file Safe references to the Fetch `Headers` constructor and its
|
|
9
|
-
* `Headers.prototype` methods. `Headers` is a global on Node 22+ (
|
|
9
|
+
* `Headers.prototype` methods. `Headers` is a global on Node 22+ (Socket's
|
|
10
10
|
* floor), captured unguarded like `URL` / `URLSearchParams`.
|
|
11
11
|
*/
|
|
12
|
+
/**
|
|
13
|
+
* @unused No internal or Socket consumers.
|
|
14
|
+
*/
|
|
12
15
|
const HeadersCtor = Headers;
|
|
13
16
|
const HeadersPrototypeForEach = require_primordials_uncurry.uncurryThis(Headers.prototype.forEach);
|
|
17
|
+
/**
|
|
18
|
+
* @unused No internal or Socket consumers.
|
|
19
|
+
*/
|
|
14
20
|
const HeadersPrototypeGet = require_primordials_uncurry.uncurryThis(Headers.prototype.get);
|
|
21
|
+
/**
|
|
22
|
+
* @unused No internal or Socket consumers.
|
|
23
|
+
*/
|
|
15
24
|
const HeadersPrototypeHas = require_primordials_uncurry.uncurryThis(Headers.prototype.has);
|
|
25
|
+
/**
|
|
26
|
+
* @unused No internal or Socket consumers.
|
|
27
|
+
*/
|
|
16
28
|
const HeadersPrototypeSet = require_primordials_uncurry.uncurryThis(Headers.prototype.set);
|
|
17
29
|
|
|
18
30
|
//#endregion
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* the method reference instead (`process.cwd.bind(process)`) would freeze it
|
|
8
8
|
* and break that test seam, so we deliberately keep the late call. Consumers
|
|
9
9
|
* read cwd / platform / env / argv through these instead of touching
|
|
10
|
-
* `process` directly; enforced
|
|
10
|
+
* `process` directly; enforced Socket-wide by
|
|
11
11
|
* `socket/prefer-process-primordial`. This is the `process` leaf of the
|
|
12
12
|
* node-module primordials: where `node/fs` / `node/path` lazy-load a `node:`
|
|
13
13
|
* module behind a function, this captures the always-present `process` global
|
|
@@ -12,7 +12,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
12
12
|
* the method reference instead (`process.cwd.bind(process)`) would freeze it
|
|
13
13
|
* and break that test seam, so we deliberately keep the late call. Consumers
|
|
14
14
|
* read cwd / platform / env / argv through these instead of touching
|
|
15
|
-
* `process` directly; enforced
|
|
15
|
+
* `process` directly; enforced Socket-wide by
|
|
16
16
|
* `socket/prefer-process-primordial`. This is the `process` leaf of the
|
|
17
17
|
* node-module primordials: where `node/fs` / `node/path` lazy-load a `node:`
|
|
18
18
|
* module behind a function, this captures the always-present `process` global
|
|
@@ -4,10 +4,28 @@
|
|
|
4
4
|
*/
|
|
5
5
|
export declare const URLCtor: typeof URL;
|
|
6
6
|
export declare const URLSearchParamsCtor: typeof URLSearchParams;
|
|
7
|
+
/**
|
|
8
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
9
|
+
*/
|
|
7
10
|
export declare const URLSearchParamsPrototypeAppend: (self: unknown, name: string, value: string) => void;
|
|
11
|
+
/**
|
|
12
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
13
|
+
*/
|
|
8
14
|
export declare const URLSearchParamsPrototypeDelete: (self: unknown, name: string, value?: string | undefined) => void;
|
|
9
15
|
export declare const URLSearchParamsPrototypeForEach: (self: unknown, callbackfn: (value: string, key: string, parent: URLSearchParams) => void, thisArg?: any) => void;
|
|
16
|
+
/**
|
|
17
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
18
|
+
*/
|
|
10
19
|
export declare const URLSearchParamsPrototypeGet: (self: unknown, name: string) => string | null;
|
|
20
|
+
/**
|
|
21
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
22
|
+
*/
|
|
11
23
|
export declare const URLSearchParamsPrototypeGetAll: (self: unknown, name: string) => string[];
|
|
24
|
+
/**
|
|
25
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
26
|
+
*/
|
|
12
27
|
export declare const URLSearchParamsPrototypeHas: (self: unknown, name: string, value?: string | undefined) => boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
30
|
+
*/
|
|
13
31
|
export declare const URLSearchParamsPrototypeSet: (self: unknown, name: string, value: string) => void;
|
package/dist/primordials/url.js
CHANGED
|
@@ -10,12 +10,30 @@ const require_primordials_uncurry = require('./uncurry.js');
|
|
|
10
10
|
*/
|
|
11
11
|
const URLCtor = URL;
|
|
12
12
|
const URLSearchParamsCtor = URLSearchParams;
|
|
13
|
+
/**
|
|
14
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
15
|
+
*/
|
|
13
16
|
const URLSearchParamsPrototypeAppend = require_primordials_uncurry.uncurryThis(URLSearchParams.prototype.append);
|
|
17
|
+
/**
|
|
18
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
19
|
+
*/
|
|
14
20
|
const URLSearchParamsPrototypeDelete = require_primordials_uncurry.uncurryThis(URLSearchParams.prototype.delete);
|
|
15
21
|
const URLSearchParamsPrototypeForEach = require_primordials_uncurry.uncurryThis(URLSearchParams.prototype.forEach);
|
|
22
|
+
/**
|
|
23
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
24
|
+
*/
|
|
16
25
|
const URLSearchParamsPrototypeGet = require_primordials_uncurry.uncurryThis(URLSearchParams.prototype.get);
|
|
26
|
+
/**
|
|
27
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
28
|
+
*/
|
|
17
29
|
const URLSearchParamsPrototypeGetAll = require_primordials_uncurry.uncurryThis(URLSearchParams.prototype.getAll);
|
|
30
|
+
/**
|
|
31
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
32
|
+
*/
|
|
18
33
|
const URLSearchParamsPrototypeHas = require_primordials_uncurry.uncurryThis(URLSearchParams.prototype.has);
|
|
34
|
+
/**
|
|
35
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
36
|
+
*/
|
|
19
37
|
const URLSearchParamsPrototypeSet = require_primordials_uncurry.uncurryThis(URLSearchParams.prototype.set);
|
|
20
38
|
|
|
21
39
|
//#endregion
|
|
@@ -37,14 +37,12 @@ node_process = require_runtime.__toESM(node_process);
|
|
|
37
37
|
* - https://nodejs.org/api/child_process.html#child_processspawncommand-args-options
|
|
38
38
|
* - https://cheatsheetseries.owasp.org/cheatsheets/Nodejs_Security_Cheat_Sheet.html
|
|
39
39
|
*/
|
|
40
|
-
const abortSignal = require_process_abort.getAbortSignal();
|
|
41
|
-
const spinner = require_spinner_default.getDefaultSpinner();
|
|
42
40
|
function spawn(cmd, args, options, extra) {
|
|
43
|
-
const { spinner: optionsSpinner
|
|
41
|
+
const { spinner: optionsSpinner, stripAnsi: shouldStripAnsi = true, ...rawSpawnOptions } = {
|
|
44
42
|
__proto__: null,
|
|
45
43
|
...options
|
|
46
44
|
};
|
|
47
|
-
const spinnerInstance = optionsSpinner;
|
|
45
|
+
const spinnerInstance = optionsSpinner ?? require_spinner_default.getDefaultSpinner();
|
|
48
46
|
const spawnOptions = {
|
|
49
47
|
__proto__: null,
|
|
50
48
|
...rawSpawnOptions
|
|
@@ -89,7 +87,7 @@ function spawn(cmd, args, options, extra) {
|
|
|
89
87
|
__proto__: null,
|
|
90
88
|
cwd: typeof spawnOptions.cwd === "string" ? spawnOptions.cwd : void 0,
|
|
91
89
|
env: envToUse,
|
|
92
|
-
signal:
|
|
90
|
+
signal: require_process_abort.getAbortSignal(),
|
|
93
91
|
stdio: spawnOptions.stdio,
|
|
94
92
|
stdioString,
|
|
95
93
|
shell: spawnOptions.shell,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* prefix excludes from public exports.
|
|
5
5
|
*/
|
|
6
6
|
import type timersPromises from 'node:timers/promises';
|
|
7
|
-
export
|
|
7
|
+
export { getAbortSignal } from '../process/abort';
|
|
8
8
|
/**
|
|
9
9
|
* Get the timers/promises module. Lazy `require` (not a top-level import) to
|
|
10
10
|
* avoid Webpack bundling issues.
|
|
@@ -5,7 +5,6 @@ const require_constants_runtime = require('../constants/runtime.js');
|
|
|
5
5
|
const require_process_abort = require('../process/abort.js');
|
|
6
6
|
|
|
7
7
|
//#region src/promises/_internal.ts
|
|
8
|
-
const abortSignal = require_process_abort.getAbortSignal();
|
|
9
8
|
/**
|
|
10
9
|
* Get the timers/promises module. Lazy `require` (not a top-level import) to
|
|
11
10
|
* avoid Webpack bundling issues.
|
|
@@ -26,5 +25,5 @@ function getTimers() {
|
|
|
26
25
|
}
|
|
27
26
|
|
|
28
27
|
//#endregion
|
|
29
|
-
exports.
|
|
28
|
+
exports.getAbortSignal = require_process_abort.getAbortSignal;
|
|
30
29
|
exports.getTimers = getTimers;
|
package/dist/promises/options.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_math = require('../primordials/math.js');
|
|
5
|
-
const
|
|
5
|
+
const require_process_abort = require('../process/abort.js');
|
|
6
6
|
|
|
7
7
|
//#region src/promises/options.ts
|
|
8
8
|
/**
|
|
@@ -34,7 +34,7 @@ const require_promises__internal = require('./_internal.js');
|
|
|
34
34
|
* @returns Normalized options with concurrency, retries, and signal
|
|
35
35
|
*/
|
|
36
36
|
function normalizeIterationOptions(options) {
|
|
37
|
-
const { concurrency = 1, retries, signal =
|
|
37
|
+
const { concurrency = 1, retries, signal = require_process_abort.getAbortSignal() } = {
|
|
38
38
|
__proto__: null,
|
|
39
39
|
...typeof options === "number" ? { concurrency: options } : options
|
|
40
40
|
};
|
|
@@ -70,7 +70,7 @@ function normalizeIterationOptions(options) {
|
|
|
70
70
|
* @returns Normalized retry options with all properties set
|
|
71
71
|
*/
|
|
72
72
|
function normalizeRetryOptions(options) {
|
|
73
|
-
const { args = [], backoffFactor = 2, baseDelayMs = 200, jitter = true, maxDelayMs = 1e4, onRetry, onRetryCancelOnFalse = false, onRetryRethrow = false, retries = 0, signal =
|
|
73
|
+
const { args = [], backoffFactor = 2, baseDelayMs = 200, jitter = true, maxDelayMs = 1e4, onRetry, onRetryCancelOnFalse = false, onRetryRethrow = false, retries = 0, signal = require_process_abort.getAbortSignal() } = resolveRetryOptions(options);
|
|
74
74
|
return {
|
|
75
75
|
args,
|
|
76
76
|
backoffFactor,
|
package/dist/regexps/spec.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_string = require('../primordials/string.js');
|
|
5
|
+
const require_primordials_map_set = require('../primordials/map-set.js');
|
|
6
6
|
const require_regexps_hex = require('./hex.js');
|
|
7
7
|
|
|
8
8
|
//#region src/regexps/spec.ts
|
|
@@ -25,6 +25,17 @@ const ARCH_MAP = {
|
|
|
25
25
|
x64: "x64"
|
|
26
26
|
};
|
|
27
27
|
/**
|
|
28
|
+
* Windows platform token per binary family. The node-smol pipeline names its
|
|
29
|
+
* Windows assets with the RELEASE platform token (`node-win-x64.exe`), while
|
|
30
|
+
* the binject/binflate/boringssl families keep `process.platform` verbatim
|
|
31
|
+
* (`binject-win32-x64.exe`). Published releases are immutable, so this table
|
|
32
|
+
* encodes the split rather than pretending one style exists.
|
|
33
|
+
*/
|
|
34
|
+
const WIN_TOKEN_BY_BASENAME = {
|
|
35
|
+
__proto__: null,
|
|
36
|
+
node: "win"
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
28
39
|
* Get asset name for a socket-btm binary.
|
|
29
40
|
*
|
|
30
41
|
* @example
|
|
@@ -47,7 +58,7 @@ function getBinaryAssetName(binaryBaseName, platform, arch, libc) {
|
|
|
47
58
|
const ext = platform === "win32" ? ".exe" : "";
|
|
48
59
|
if (platform === "darwin") return `${binaryBaseName}-darwin-${mappedArch}${ext}`;
|
|
49
60
|
if (platform === "linux") return `${binaryBaseName}-linux-${mappedArch}${muslSuffix}${ext}`;
|
|
50
|
-
if (platform === "win32") return `${binaryBaseName}
|
|
61
|
+
if (platform === "win32") return `${binaryBaseName}-${WIN_TOKEN_BY_BASENAME[binaryBaseName] ?? "win32"}-${mappedArch}${ext}`;
|
|
51
62
|
throw new require_primordials_error.ErrorCtor(`Unsupported platform: ${platform}`);
|
|
52
63
|
}
|
|
53
64
|
/**
|
package/dist/schema/validate.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_primordials_error = require('../primordials/error.js');
|
|
5
|
-
const require_primordials_number = require('../primordials/number.js');
|
|
6
5
|
const require_primordials_object = require('../primordials/object.js');
|
|
6
|
+
const require_primordials_number = require('../primordials/number.js');
|
|
7
7
|
const require_primordials_array = require('../primordials/array.js');
|
|
8
8
|
|
|
9
9
|
//#region src/schema/validate.ts
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @file Private internals for `secrets/` — process-scoped read cache for the
|
|
3
3
|
* keychain backend. Underscore-prefixed and skipped by the export generator
|
|
4
4
|
* (`dist/**\/_*` ignore pattern in
|
|
5
|
-
* `scripts/
|
|
5
|
+
* `scripts/fleet/make-package-exports.mts`) so this module is NOT part
|
|
6
6
|
* of the public API surface. Imported by `./keychain.ts`. Every `readSecret`
|
|
7
7
|
* call shells out to the OS credential CLI (`security`, `secret-tool`,
|
|
8
8
|
* PowerShell). On macOS, the first read of a given entry by a new binary path
|
|
@@ -8,7 +8,7 @@ const require_primordials_map_set = require('../primordials/map-set.js');
|
|
|
8
8
|
* @file Private internals for `secrets/` — process-scoped read cache for the
|
|
9
9
|
* keychain backend. Underscore-prefixed and skipped by the export generator
|
|
10
10
|
* (`dist/**\/_*` ignore pattern in
|
|
11
|
-
* `scripts/
|
|
11
|
+
* `scripts/fleet/make-package-exports.mts`) so this module is NOT part
|
|
12
12
|
* of the public API surface. Imported by `./keychain.ts`. Every `readSecret`
|
|
13
13
|
* call shells out to the OS credential CLI (`security`, `secret-tool`,
|
|
14
14
|
* PowerShell). On macOS, the first read of a given entry by a new binary path
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Proteus broker client. Asks the running proteus credential daemon for a
|
|
3
|
+
* secret over its local Unix socket (Windows named pipe later), so a
|
|
4
|
+
* biometric-gated read happens inside the daemon and the value is vended to
|
|
5
|
+
* this process in memory rather than sitting in an env var. This is the layer
|
|
6
|
+
* `ai/credentials.mts` documents as slotting between the env check and the
|
|
7
|
+
* keychain read in `secrets/find.ts` `resolve()`.
|
|
8
|
+
* The broker is OPTIONAL and self-gating: when the daemon isn't running (no
|
|
9
|
+
* socket file), `requestFromBroker` returns `undefined` immediately and the
|
|
10
|
+
* caller falls through to the keychain. It never throws — a broker miss is a
|
|
11
|
+
* fall-through, not an error. The daemon binary itself is built by socket-btm
|
|
12
|
+
* (`packages/proteus-builder`); download-and-start is a later layer, so today
|
|
13
|
+
* this only talks to an already-running daemon.
|
|
14
|
+
*/
|
|
15
|
+
export interface BrokerRequestOptions {
|
|
16
|
+
/**
|
|
17
|
+
* The keychain service scope (e.g. `socketsecurity`).
|
|
18
|
+
*/
|
|
19
|
+
readonly service: string;
|
|
20
|
+
/**
|
|
21
|
+
* The account within the service (e.g. `ANTHROPIC_API_KEY`).
|
|
22
|
+
*/
|
|
23
|
+
readonly account: string;
|
|
24
|
+
}
|
|
25
|
+
export interface BrokerResponse {
|
|
26
|
+
readonly ok?: boolean | undefined;
|
|
27
|
+
readonly value?: string | undefined;
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Ask the proteus daemon for a credential. Returns the value on success, or
|
|
31
|
+
* `undefined` when the daemon isn't running, doesn't hold it, or the biometric
|
|
32
|
+
* prompt was declined. Never throws: a miss falls through to the next resolver
|
|
33
|
+
* layer (the keychain).
|
|
34
|
+
*/
|
|
35
|
+
export declare function requestFromBroker({ account, service, }: BrokerRequestOptions): Promise<string | undefined>;
|