@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
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
+
const require_paths_socket = require('../paths/socket.js');
|
|
6
|
+
let node_fs = require("node:fs");
|
|
7
|
+
let node_net = require("node:net");
|
|
8
|
+
node_net = require_runtime.__toESM(node_net);
|
|
9
|
+
|
|
10
|
+
//#region src/secrets/broker.ts
|
|
11
|
+
/**
|
|
12
|
+
* @file Proteus broker client. Asks the running proteus credential daemon for a
|
|
13
|
+
* secret over its local Unix socket (Windows named pipe later), so a
|
|
14
|
+
* biometric-gated read happens inside the daemon and the value is vended to
|
|
15
|
+
* this process in memory rather than sitting in an env var. This is the layer
|
|
16
|
+
* `ai/credentials.mts` documents as slotting between the env check and the
|
|
17
|
+
* keychain read in `secrets/find.ts` `resolve()`.
|
|
18
|
+
* The broker is OPTIONAL and self-gating: when the daemon isn't running (no
|
|
19
|
+
* socket file), `requestFromBroker` returns `undefined` immediately and the
|
|
20
|
+
* caller falls through to the keychain. It never throws — a broker miss is a
|
|
21
|
+
* fall-through, not an error. The daemon binary itself is built by socket-btm
|
|
22
|
+
* (`packages/proteus-builder`); download-and-start is a later layer, so today
|
|
23
|
+
* this only talks to an already-running daemon.
|
|
24
|
+
*/
|
|
25
|
+
const PROTEUS_SOCKET_NAME = "proteus";
|
|
26
|
+
const BROKER_TIMEOUT_MS = 1e3;
|
|
27
|
+
/**
|
|
28
|
+
* Ask the proteus daemon for a credential. Returns the value on success, or
|
|
29
|
+
* `undefined` when the daemon isn't running, doesn't hold it, or the biometric
|
|
30
|
+
* prompt was declined. Never throws: a miss falls through to the next resolver
|
|
31
|
+
* layer (the keychain).
|
|
32
|
+
*/
|
|
33
|
+
async function requestFromBroker({ account, service }) {
|
|
34
|
+
const socketPath = require_paths_socket.getRuntimeSocketPath(PROTEUS_SOCKET_NAME);
|
|
35
|
+
if (!(0, node_fs.existsSync)(socketPath)) return;
|
|
36
|
+
return await new Promise((resolvePromise) => {
|
|
37
|
+
const conn = node_net.default.connect(socketPath);
|
|
38
|
+
let buffer = "";
|
|
39
|
+
let settled = false;
|
|
40
|
+
function settle(value) {
|
|
41
|
+
if (settled) return;
|
|
42
|
+
settled = true;
|
|
43
|
+
conn.destroy();
|
|
44
|
+
resolvePromise(value);
|
|
45
|
+
}
|
|
46
|
+
conn.setTimeout(BROKER_TIMEOUT_MS);
|
|
47
|
+
conn.on("timeout", () => settle(void 0));
|
|
48
|
+
conn.on("error", () => settle(void 0));
|
|
49
|
+
conn.on("connect", () => {
|
|
50
|
+
const payload = JSON.stringify({
|
|
51
|
+
account,
|
|
52
|
+
op: "get",
|
|
53
|
+
service
|
|
54
|
+
});
|
|
55
|
+
conn.write(`${payload}\n`);
|
|
56
|
+
});
|
|
57
|
+
conn.on("data", (chunk) => {
|
|
58
|
+
buffer += String(chunk);
|
|
59
|
+
const newlineAt = buffer.indexOf("\n");
|
|
60
|
+
if (newlineAt === -1) return;
|
|
61
|
+
try {
|
|
62
|
+
const parsed = JSON.parse(buffer.slice(0, newlineAt));
|
|
63
|
+
settle(parsed.ok && typeof parsed.value === "string" ? parsed.value : void 0);
|
|
64
|
+
} catch {
|
|
65
|
+
settle(void 0);
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
//#endregion
|
|
72
|
+
exports.requestFromBroker = requestFromBroker;
|
package/dist/secrets/find.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Resolve a secret from the canonical
|
|
2
|
+
* @file Resolve a secret from the canonical Socket precedence order: process env
|
|
3
3
|
* → OS keychain. Returns the value + the source it came from so the caller
|
|
4
4
|
* can log which slot won. Why a helper instead of inlining: every consumer of
|
|
5
|
-
* the
|
|
5
|
+
* the Socket API token does the same dance — check
|
|
6
6
|
* `process.env.SOCKET_API_TOKEN`, fall back to a legacy env-var alias, fall
|
|
7
7
|
* back to `readSecret({...})` from the keychain. Tools drift on the exact
|
|
8
8
|
* order and on which aliases they consider. This helper centralizes the
|
|
@@ -51,10 +51,11 @@ export interface ResolveResult {
|
|
|
51
51
|
value: string;
|
|
52
52
|
/**
|
|
53
53
|
* Where the value came from: 'env' — `process.env[<account>]` had a non-empty
|
|
54
|
-
* value. '
|
|
55
|
-
*
|
|
54
|
+
* value. 'broker' — the proteus daemon vended it after a biometric unlock.
|
|
55
|
+
* 'keychain' — env-var was empty and no broker was running; the value was
|
|
56
|
+
* read from the OS credential store under the matching account.
|
|
56
57
|
*/
|
|
57
|
-
source: 'env' | 'keychain';
|
|
58
|
+
source: 'broker' | 'env' | 'keychain';
|
|
58
59
|
/**
|
|
59
60
|
* Which account in `accounts` was the actual hit.
|
|
60
61
|
*/
|
|
@@ -74,6 +75,7 @@ export declare function readEnv(name: string): string | undefined;
|
|
|
74
75
|
export declare function resolve(options: ResolveOptions): Promise<ResolveResult | undefined>;
|
|
75
76
|
/**
|
|
76
77
|
* Sync variant for non-async callers (hook initializers, schema validators that
|
|
77
|
-
* run before any `await` machinery exists).
|
|
78
|
+
* run before any `await` machinery exists). Has no proteus broker tier — the
|
|
79
|
+
* broker socket round-trip is async — so this path is env → keychain only.
|
|
78
80
|
*/
|
|
79
81
|
export declare function resolveSync(options: ResolveOptions): ResolveResult | undefined;
|
package/dist/secrets/find.js
CHANGED
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_secrets_broker = require('./broker.js');
|
|
4
5
|
const require_secrets_keychain = require('./keychain.js');
|
|
5
6
|
|
|
6
7
|
//#region src/secrets/find.ts
|
|
7
8
|
/**
|
|
8
|
-
* @file Resolve a secret from the canonical
|
|
9
|
+
* @file Resolve a secret from the canonical Socket precedence order: process env
|
|
9
10
|
* → OS keychain. Returns the value + the source it came from so the caller
|
|
10
11
|
* can log which slot won. Why a helper instead of inlining: every consumer of
|
|
11
|
-
* the
|
|
12
|
+
* the Socket API token does the same dance — check
|
|
12
13
|
* `process.env.SOCKET_API_TOKEN`, fall back to a legacy env-var alias, fall
|
|
13
14
|
* back to `readSecret({...})` from the keychain. Tools drift on the exact
|
|
14
15
|
* order and on which aliases they consider. This helper centralizes the
|
|
@@ -57,6 +58,18 @@ async function resolve(options) {
|
|
|
57
58
|
};
|
|
58
59
|
}
|
|
59
60
|
if (allowEnvOnly) return;
|
|
61
|
+
for (let i = 0, { length } = accounts; i < length; i += 1) {
|
|
62
|
+
const account = accounts[i];
|
|
63
|
+
const fromBroker = await require_secrets_broker.requestFromBroker({
|
|
64
|
+
account,
|
|
65
|
+
service
|
|
66
|
+
});
|
|
67
|
+
if (fromBroker) return {
|
|
68
|
+
value: fromBroker,
|
|
69
|
+
source: "broker",
|
|
70
|
+
account
|
|
71
|
+
};
|
|
72
|
+
}
|
|
60
73
|
for (let i = 0, { length } = accounts; i < length; i += 1) {
|
|
61
74
|
const account = accounts[i];
|
|
62
75
|
const fromKeychain = await require_secrets_keychain.readSecret({
|
|
@@ -72,7 +85,8 @@ async function resolve(options) {
|
|
|
72
85
|
}
|
|
73
86
|
/**
|
|
74
87
|
* Sync variant for non-async callers (hook initializers, schema validators that
|
|
75
|
-
* run before any `await` machinery exists).
|
|
88
|
+
* run before any `await` machinery exists). Has no proteus broker tier — the
|
|
89
|
+
* broker socket round-trip is async — so this path is env → keychain only.
|
|
76
90
|
*/
|
|
77
91
|
function resolveSync(options) {
|
|
78
92
|
const { accounts, allowEnvOnly, service } = {
|
|
@@ -42,6 +42,9 @@ export interface DeleteFromSlotsOptions {
|
|
|
42
42
|
accounts: readonly string[];
|
|
43
43
|
}
|
|
44
44
|
export declare function deleteSecretFromSlots({ service, accounts, }: DeleteFromSlotsOptions): Promise<SecretDeleteResult[]>;
|
|
45
|
+
/**
|
|
46
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
47
|
+
*/
|
|
45
48
|
export declare function deleteSecretFromSlotsSync({ service, accounts, }: DeleteFromSlotsOptions): SecretDeleteResult[];
|
|
46
49
|
export declare function deleteSecretSync({ service, account, }: DeleteOptions): 'removed' | 'absent';
|
|
47
50
|
export type { BackendAvailability, SecretDeleteResult, SecretWriteResult, } from './types';
|
|
@@ -50,7 +53,7 @@ export type Platform = 'darwin' | 'linux' | 'win32' | 'other';
|
|
|
50
53
|
/**
|
|
51
54
|
* Resolve the current OS to one of our four backend categories.
|
|
52
55
|
*
|
|
53
|
-
* Exported only because
|
|
56
|
+
* Exported only because Socket's `export-top-level-functions` lint rule
|
|
54
57
|
* requires top-level functions to be exported for testability. Not part of the
|
|
55
58
|
* public `secrets/keychain` API surface — consumers should call `readSecret` /
|
|
56
59
|
* `writeSecret` / `getBackendAvailability` instead, which handle the dispatch
|
|
@@ -90,6 +93,9 @@ export declare function readSecretFromSlots({ service, accounts, }: ReadFromSlot
|
|
|
90
93
|
value: string;
|
|
91
94
|
account: string;
|
|
92
95
|
} | undefined>;
|
|
96
|
+
/**
|
|
97
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
98
|
+
*/
|
|
93
99
|
export declare function readSecretFromSlotsSync({ service, accounts, }: ReadFromSlotsOptions): {
|
|
94
100
|
value: string;
|
|
95
101
|
account: string;
|
|
@@ -135,4 +141,7 @@ export interface WriteToSlotsOptions {
|
|
|
135
141
|
* the next successful write cleans up).
|
|
136
142
|
*/
|
|
137
143
|
export declare function writeSecretToSlots({ service, accounts, value, label, }: WriteToSlotsOptions): Promise<SecretWriteResult[]>;
|
|
144
|
+
/**
|
|
145
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
146
|
+
*/
|
|
138
147
|
export declare function writeSecretToSlotsSync({ service, accounts, value, label, }: WriteToSlotsOptions): SecretWriteResult[];
|
package/dist/secrets/keychain.js
CHANGED
|
@@ -77,6 +77,9 @@ async function deleteSecretFromSlots({ service, accounts }) {
|
|
|
77
77
|
}
|
|
78
78
|
return results;
|
|
79
79
|
}
|
|
80
|
+
/**
|
|
81
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
82
|
+
*/
|
|
80
83
|
function deleteSecretFromSlotsSync({ service, accounts }) {
|
|
81
84
|
const results = [];
|
|
82
85
|
for (const account of accounts) {
|
|
@@ -111,7 +114,7 @@ function deleteSecretSync({ service, account }) {
|
|
|
111
114
|
/**
|
|
112
115
|
* Resolve the current OS to one of our four backend categories.
|
|
113
116
|
*
|
|
114
|
-
* Exported only because
|
|
117
|
+
* Exported only because Socket's `export-top-level-functions` lint rule
|
|
115
118
|
* requires top-level functions to be exported for testability. Not part of the
|
|
116
119
|
* public `secrets/keychain` API surface — consumers should call `readSecret` /
|
|
117
120
|
* `writeSecret` / `getBackendAvailability` instead, which handle the dispatch
|
|
@@ -190,6 +193,9 @@ async function readSecretFromSlots({ service, accounts }) {
|
|
|
190
193
|
};
|
|
191
194
|
}
|
|
192
195
|
}
|
|
196
|
+
/**
|
|
197
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
198
|
+
*/
|
|
193
199
|
function readSecretFromSlotsSync({ service, accounts }) {
|
|
194
200
|
for (const account of accounts) {
|
|
195
201
|
const value = readSecretSync({
|
|
@@ -302,6 +308,9 @@ async function writeSecretToSlots({ service, accounts, value, label }) {
|
|
|
302
308
|
}
|
|
303
309
|
return results;
|
|
304
310
|
}
|
|
311
|
+
/**
|
|
312
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
313
|
+
*/
|
|
305
314
|
function writeSecretToSlotsSync({ service, accounts, value, label }) {
|
|
306
315
|
const results = [];
|
|
307
316
|
for (const account of accounts) {
|
package/dist/secrets/rc.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
5
|
const require_primordials_object = require('../primordials/object.js');
|
|
6
|
-
const require_env_home = require('../env/home.js');
|
|
7
6
|
const require_primordials_string = require('../primordials/string.js');
|
|
7
|
+
const require_env_home = require('../env/home.js');
|
|
8
8
|
const require_primordials_regexp = require('../primordials/regexp.js');
|
|
9
9
|
let node_fs = require("node:fs");
|
|
10
10
|
let node_process = require("node:process");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @file Convenience helper for reading the Socket API token from the canonical
|
|
3
|
-
* env → keychain precedence order. Centralizes two constants every
|
|
3
|
+
* env → keychain precedence order. Centralizes two constants every Socket
|
|
4
4
|
* consumer would otherwise hard-code: the keychain service name
|
|
5
5
|
* (`socketsecurity`) and the env-var + account fallback list
|
|
6
6
|
* (`SOCKET_API_TOKEN` canonical, `SOCKET_API_KEY` legacy alias). Consumers
|
|
@@ -6,7 +6,7 @@ const require_secrets_find = require('./find.js');
|
|
|
6
6
|
//#region src/secrets/socket-api-token.ts
|
|
7
7
|
/**
|
|
8
8
|
* @file Convenience helper for reading the Socket API token from the canonical
|
|
9
|
-
* env → keychain precedence order. Centralizes two constants every
|
|
9
|
+
* env → keychain precedence order. Centralizes two constants every Socket
|
|
10
10
|
* consumer would otherwise hard-code: the keychain service name
|
|
11
11
|
* (`socketsecurity`) and the env-var + account fallback list
|
|
12
12
|
* (`SOCKET_API_TOKEN` canonical, `SOCKET_API_KEY` legacy alias). Consumers
|
package/dist/secrets/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Public type surface for `secrets/*`. Secrets in
|
|
2
|
+
* @file Public type surface for `secrets/*`. Secrets in Socket tools are stored
|
|
3
3
|
* under the OS's native credential store keyed by `{ service, account }`:
|
|
4
4
|
*
|
|
5
5
|
* - macOS: Keychain generic-password items (service = `-s`, account = `-a`
|
package/dist/smol/detect.js
CHANGED
|
@@ -43,7 +43,7 @@ function getSmolUtil() {
|
|
|
43
43
|
if (!smolUtilProbed) {
|
|
44
44
|
smolUtilProbed = true;
|
|
45
45
|
/* c8 ignore start - smol Node binary only. */
|
|
46
|
-
if (require_node_module.isNodeBuiltin("node:smol-util")) smolUtilCache =
|
|
46
|
+
if (require_node_module.isNodeBuiltin("node:smol-util")) smolUtilCache = require_node_module.requireBuiltin("node:smol-util");
|
|
47
47
|
}
|
|
48
48
|
return smolUtilCache;
|
|
49
49
|
}
|
package/dist/smol/http.d.ts
CHANGED
|
@@ -56,5 +56,7 @@ export interface SmolHttpBinding {
|
|
|
56
56
|
/**
|
|
57
57
|
* Returns `node:smol-http` when running on the smol Node binary, otherwise
|
|
58
58
|
* `undefined`. Result is cached across calls.
|
|
59
|
+
*
|
|
60
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
59
61
|
*/
|
|
60
62
|
export declare function getSmolHttp(): SmolHttpBinding | undefined;
|
package/dist/smol/http.js
CHANGED
|
@@ -23,12 +23,14 @@ let smolHttpProbed = false;
|
|
|
23
23
|
/**
|
|
24
24
|
* Returns `node:smol-http` when running on the smol Node binary, otherwise
|
|
25
25
|
* `undefined`. Result is cached across calls.
|
|
26
|
+
*
|
|
27
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
26
28
|
*/
|
|
27
29
|
function getSmolHttp() {
|
|
28
30
|
if (!smolHttpProbed) {
|
|
29
31
|
smolHttpProbed = true;
|
|
30
32
|
/* c8 ignore start - smol Node binary only. */
|
|
31
|
-
if (require_node_module.isNodeBuiltin("node:smol-http")) smolHttpBinding =
|
|
33
|
+
if (require_node_module.isNodeBuiltin("node:smol-http")) smolHttpBinding = require_node_module.requireBuiltin("node:smol-http");
|
|
32
34
|
}
|
|
33
35
|
return smolHttpBinding;
|
|
34
36
|
}
|
package/dist/smol/https.d.ts
CHANGED
|
@@ -55,5 +55,7 @@ export interface SmolHttpsBinding {
|
|
|
55
55
|
/**
|
|
56
56
|
* Returns `node:smol-https` when running on the smol Node binary, otherwise
|
|
57
57
|
* `undefined`. Result is cached across calls.
|
|
58
|
+
*
|
|
59
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
58
60
|
*/
|
|
59
61
|
export declare function getSmolHttps(): SmolHttpsBinding | undefined;
|
package/dist/smol/https.js
CHANGED
|
@@ -21,12 +21,14 @@ let smolHttpsProbed = false;
|
|
|
21
21
|
/**
|
|
22
22
|
* Returns `node:smol-https` when running on the smol Node binary, otherwise
|
|
23
23
|
* `undefined`. Result is cached across calls.
|
|
24
|
+
*
|
|
25
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
24
26
|
*/
|
|
25
27
|
function getSmolHttps() {
|
|
26
28
|
if (!smolHttpsProbed) {
|
|
27
29
|
smolHttpsProbed = true;
|
|
28
30
|
/* c8 ignore start - smol Node binary only. */
|
|
29
|
-
if (require_node_module.isNodeBuiltin("node:smol-https")) smolHttps =
|
|
31
|
+
if (require_node_module.isNodeBuiltin("node:smol-https")) smolHttps = require_node_module.requireBuiltin("node:smol-https");
|
|
30
32
|
}
|
|
31
33
|
return smolHttps;
|
|
32
34
|
}
|
package/dist/smol/manifest.js
CHANGED
|
@@ -28,7 +28,7 @@ function getSmolManifest() {
|
|
|
28
28
|
if (!smolManifestProbed) {
|
|
29
29
|
smolManifestProbed = true;
|
|
30
30
|
/* c8 ignore start - smol Node binary only. */
|
|
31
|
-
if (require_node_module.isNodeBuiltin("node:smol-manifest")) cachedSmolManifest =
|
|
31
|
+
if (require_node_module.isNodeBuiltin("node:smol-manifest")) cachedSmolManifest = require_node_module.requireBuiltin("node:smol-manifest");
|
|
32
32
|
}
|
|
33
33
|
return cachedSmolManifest;
|
|
34
34
|
}
|
package/dist/smol/path.js
CHANGED
|
@@ -28,7 +28,7 @@ function getSmolPath() {
|
|
|
28
28
|
if (!smolPathProbed) {
|
|
29
29
|
smolPathProbed = true;
|
|
30
30
|
/* c8 ignore start - smol Node binary only. */
|
|
31
|
-
if (require_node_module.isNodeBuiltin("node:smol-path")) smolPathCache =
|
|
31
|
+
if (require_node_module.isNodeBuiltin("node:smol-path")) smolPathCache = require_node_module.requireBuiltin("node:smol-path");
|
|
32
32
|
}
|
|
33
33
|
return smolPathCache;
|
|
34
34
|
}
|
package/dist/smol/primordial.js
CHANGED
|
@@ -30,7 +30,7 @@ function getSmolPrimordial() {
|
|
|
30
30
|
if (!smolPrimordialProbed) {
|
|
31
31
|
smolPrimordialProbed = true;
|
|
32
32
|
/* c8 ignore start - smol Node binary only. */
|
|
33
|
-
if (require_node_module.isNodeBuiltin("node:smol-primordial")) smolPrimordial =
|
|
33
|
+
if (require_node_module.isNodeBuiltin("node:smol-primordial")) smolPrimordial = require_node_module.requireBuiltin("node:smol-primordial");
|
|
34
34
|
}
|
|
35
35
|
return smolPrimordial;
|
|
36
36
|
}
|
package/dist/smol/purl.js
CHANGED
|
@@ -29,7 +29,7 @@ function getSmolPurl() {
|
|
|
29
29
|
if (!smolPurlProbed) {
|
|
30
30
|
smolPurlProbed = true;
|
|
31
31
|
/* c8 ignore start - smol Node binary only. */
|
|
32
|
-
if (require_node_module.isNodeBuiltin("node:smol-purl")) smolPurl =
|
|
32
|
+
if (require_node_module.isNodeBuiltin("node:smol-purl")) smolPurl = require_node_module.requireBuiltin("node:smol-purl");
|
|
33
33
|
}
|
|
34
34
|
return smolPurl;
|
|
35
35
|
}
|
package/dist/smol/versions.js
CHANGED
|
@@ -26,7 +26,7 @@ function getSmolVersions() {
|
|
|
26
26
|
if (!smolVersionsProbed) {
|
|
27
27
|
smolVersionsProbed = true;
|
|
28
28
|
/* c8 ignore start - smol Node binary only. */
|
|
29
|
-
if (require_node_module.isNodeBuiltin("node:smol-versions")) smolVersions =
|
|
29
|
+
if (require_node_module.isNodeBuiltin("node:smol-versions")) smolVersions = require_node_module.requireBuiltin("node:smol-versions");
|
|
30
30
|
}
|
|
31
31
|
return smolVersions;
|
|
32
32
|
}
|
package/dist/smol/vfs.js
CHANGED
|
@@ -41,7 +41,7 @@ function getSmolVfs() {
|
|
|
41
41
|
if (!smolVfsProbed) {
|
|
42
42
|
smolVfsProbed = true;
|
|
43
43
|
/* c8 ignore start - smol Node binary only. */
|
|
44
|
-
if (require_node_module.isNodeBuiltin("node:smol-vfs")) cachedSmolVfs =
|
|
44
|
+
if (require_node_module.isNodeBuiltin("node:smol-vfs")) cachedSmolVfs = require_node_module.requireBuiltin("node:smol-vfs").getSmolVfs();
|
|
45
45
|
}
|
|
46
46
|
return cachedSmolVfs;
|
|
47
47
|
}
|
|
@@ -3,7 +3,5 @@
|
|
|
3
3
|
* fast-sort + semver, and the cached Intl.Collator instances. Used by the
|
|
4
4
|
* locale / natural / semver comparison entrypoints.
|
|
5
5
|
*/
|
|
6
|
-
import type
|
|
7
|
-
|
|
8
|
-
export declare function getFastSort(): typeof fastSortType;
|
|
9
|
-
export declare function getSemver(): typeof semverType;
|
|
6
|
+
import type { default as FastSort } from '../external/fast-sort';
|
|
7
|
+
export declare function getFastSort(): typeof FastSort;
|
package/dist/sorts/_internal.js
CHANGED
|
@@ -4,16 +4,10 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
4
4
|
|
|
5
5
|
//#region src/sorts/_internal.ts
|
|
6
6
|
let fastSort;
|
|
7
|
-
let semver;
|
|
8
7
|
function getFastSort() {
|
|
9
8
|
if (fastSort === void 0) fastSort = /*@__PURE__*/ require("../external/fast-sort.js");
|
|
10
9
|
return fastSort;
|
|
11
10
|
}
|
|
12
|
-
function getSemver() {
|
|
13
|
-
if (semver === void 0) semver = /*@__PURE__*/ require("../external/semver.js");
|
|
14
|
-
return semver;
|
|
15
|
-
}
|
|
16
11
|
|
|
17
12
|
//#endregion
|
|
18
|
-
exports.getFastSort = getFastSort;
|
|
19
|
-
exports.getSemver = getSemver;
|
|
13
|
+
exports.getFastSort = getFastSort;
|
package/dist/sorts/semver.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const
|
|
4
|
+
const require_versions__internal = require('../versions/_internal.js');
|
|
5
5
|
|
|
6
6
|
//#region src/sorts/semver.ts
|
|
7
7
|
/**
|
|
@@ -20,7 +20,7 @@ const require_sorts__internal = require('./_internal.js');
|
|
|
20
20
|
*/
|
|
21
21
|
function compareSemver(a, b) {
|
|
22
22
|
/* c8 ignore start */
|
|
23
|
-
const semver =
|
|
23
|
+
const semver = require_versions__internal.getSemver();
|
|
24
24
|
const validA = semver.valid(a);
|
|
25
25
|
/* c8 ignore stop */
|
|
26
26
|
const validB = semver.valid(b);
|
|
@@ -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_primordials_array = require('../primordials/array.js');
|
|
7
7
|
const require_process_abort = require('../process/abort.js');
|
|
8
8
|
const require_logger_symbols = require('../logger/symbols.js');
|
package/dist/spinner/format.js
CHANGED
|
@@ -1,10 +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_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
4
|
const require_primordials_math = require('../primordials/math.js');
|
|
6
|
-
|
|
7
|
-
src_external_yoctocolors_cjs = require_runtime.__toESM(src_external_yoctocolors_cjs);
|
|
5
|
+
const require_logger_colors = require('../logger/colors.js');
|
|
8
6
|
|
|
9
7
|
//#region src/spinner/format.ts
|
|
10
8
|
/**
|
|
@@ -86,7 +84,7 @@ function renderProgressBar(percentage, width = 20) {
|
|
|
86
84
|
const filled = require_primordials_math.MathMax(0, Math.min(width, Math.round(percentage / 100 * width)));
|
|
87
85
|
const empty = require_primordials_math.MathMax(0, width - filled);
|
|
88
86
|
const bar = "█".repeat(filled) + "░".repeat(empty);
|
|
89
|
-
return
|
|
87
|
+
return require_logger_colors.getYoctocolors().cyan(bar);
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
//#endregion
|
package/dist/stdio/footer.js
CHANGED
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
4
|
const require_primordials_array = require('../primordials/array.js');
|
|
6
5
|
const require_primordials_date = require('../primordials/date.js');
|
|
7
6
|
const require_logger_symbols = require('../logger/symbols.js');
|
|
8
7
|
const require_strings_format = require('../strings/format.js');
|
|
9
8
|
const require_logger_default = require('../logger/default.js');
|
|
10
|
-
let src_external_yoctocolors_cjs = require("../external/yoctocolors-cjs");
|
|
11
|
-
src_external_yoctocolors_cjs = require_runtime.__toESM(src_external_yoctocolors_cjs);
|
|
12
9
|
|
|
13
10
|
//#region src/stdio/footer.ts
|
|
14
11
|
/**
|
|
@@ -44,16 +41,17 @@ function createFooter(message, options) {
|
|
|
44
41
|
__proto__: null,
|
|
45
42
|
...options
|
|
46
43
|
};
|
|
44
|
+
const colors = require("../external/yoctocolors-cjs");
|
|
47
45
|
const border = require_strings_format.repeatString(borderChar, width);
|
|
48
46
|
const lines = [];
|
|
49
|
-
if (message) require_primordials_array.ArrayPrototypePush(lines, (color &&
|
|
47
|
+
if (message) require_primordials_array.ArrayPrototypePush(lines, (color && colors[color] ? colors[color] : (s) => s)(message));
|
|
50
48
|
if (showTimestamp) {
|
|
51
49
|
const timestamp = new require_primordials_date.DateCtor().toISOString();
|
|
52
|
-
require_primordials_array.ArrayPrototypePush(lines,
|
|
50
|
+
require_primordials_array.ArrayPrototypePush(lines, colors.gray(`Completed at: ${timestamp}`));
|
|
53
51
|
}
|
|
54
52
|
if (showDuration && startTime) {
|
|
55
53
|
const seconds = ((require_primordials_date.DateNow() - startTime) / 1e3).toFixed(2);
|
|
56
|
-
require_primordials_array.ArrayPrototypePush(lines,
|
|
54
|
+
require_primordials_array.ArrayPrototypePush(lines, colors.gray(`Duration: ${seconds}s`));
|
|
57
55
|
}
|
|
58
56
|
require_primordials_array.ArrayPrototypePush(lines, border);
|
|
59
57
|
return lines.join("\n");
|
|
@@ -114,7 +112,10 @@ function createSummaryFooter(stats, options) {
|
|
|
114
112
|
function printFooter(message) {
|
|
115
113
|
const border = require_strings_format.repeatString("─", 55);
|
|
116
114
|
logger.log(border);
|
|
117
|
-
if (message)
|
|
115
|
+
if (message) {
|
|
116
|
+
const colors = require("../external/yoctocolors-cjs");
|
|
117
|
+
logger.log(colors.green(message));
|
|
118
|
+
}
|
|
118
119
|
}
|
|
119
120
|
|
|
120
121
|
//#endregion
|
package/dist/stdio/progress.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
4
|
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
|
-
const require_primordials_math = require('../primordials/math.js');
|
|
6
5
|
const require_primordials_object = require('../primordials/object.js');
|
|
7
6
|
const require_primordials_string = require('../primordials/string.js');
|
|
7
|
+
const require_primordials_math = require('../primordials/math.js');
|
|
8
8
|
const require_primordials_date = require('../primordials/date.js');
|
|
9
9
|
const require_ansi_strip = require('../ansi/strip.js');
|
|
10
10
|
const require_strings_format = require('../strings/format.js');
|
package/dist/stdio/prompts.d.ts
CHANGED
|
@@ -2,18 +2,10 @@
|
|
|
2
2
|
* @file User prompt utilities for interactive scripts. Provides inquirer.js
|
|
3
3
|
* integration with spinner support, context handling, and theming.
|
|
4
4
|
*/
|
|
5
|
-
import checkboxRaw from '../external/@inquirer/checkbox';
|
|
6
|
-
import confirmRaw from '../external/@inquirer/confirm';
|
|
7
|
-
import inputRaw from '../external/@inquirer/input';
|
|
8
|
-
import passwordRaw from '../external/@inquirer/password';
|
|
9
|
-
import type { ColorValue } from '../colors/types';
|
|
10
5
|
import type { Remap } from '../objects/types';
|
|
11
6
|
import type { SpinnerInstance } from '../spinner/types';
|
|
12
7
|
import type { ThemeName } from '../themes/themes';
|
|
13
8
|
import type { Theme } from '../themes/types';
|
|
14
|
-
declare const searchRaw: any;
|
|
15
|
-
declare const selectRaw: any;
|
|
16
|
-
declare const ActualSeparator: any;
|
|
17
9
|
/**
|
|
18
10
|
* Choice option for select and search prompts.
|
|
19
11
|
*
|
|
@@ -94,13 +86,6 @@ export declare class SeparatorType {
|
|
|
94
86
|
constructor(separator?: string);
|
|
95
87
|
}
|
|
96
88
|
export type Separator = SeparatorType;
|
|
97
|
-
/**
|
|
98
|
-
* Apply a color to text using yoctocolors. Handles both named colors and RGB
|
|
99
|
-
* tuples.
|
|
100
|
-
*
|
|
101
|
-
* @private
|
|
102
|
-
*/
|
|
103
|
-
export declare function applyColor(text: string, color: ColorValue): string;
|
|
104
89
|
/**
|
|
105
90
|
* Convert Socket theme to @inquirer theme format. Maps our theme colors to
|
|
106
91
|
* inquirer's style functions. Handles theme names, Theme objects, and passes
|
|
@@ -143,7 +128,7 @@ export declare function createInquirerTheme(theme: Theme | ThemeName | unknown):
|
|
|
143
128
|
*
|
|
144
129
|
* @returns Separator instance
|
|
145
130
|
*/
|
|
146
|
-
export declare function createSeparator(text?: string):
|
|
131
|
+
export declare function createSeparator(text?: string): Separator;
|
|
147
132
|
/**
|
|
148
133
|
* Check if value is a Socket Theme object.
|
|
149
134
|
*
|
|
@@ -191,7 +176,7 @@ export declare function wrapPrompt<T = unknown>(inquirerPrompt: (...args: unknow
|
|
|
191
176
|
* ],
|
|
192
177
|
* })
|
|
193
178
|
*/
|
|
194
|
-
export declare const checkbox:
|
|
179
|
+
export declare const checkbox: (...args: unknown[]) => Promise<unknown>;
|
|
195
180
|
/**
|
|
196
181
|
* Prompt for a yes/no confirmation. Wrapped with spinner handling and abort
|
|
197
182
|
* signal support.
|
|
@@ -200,7 +185,7 @@ export declare const checkbox: typeof checkboxRaw;
|
|
|
200
185
|
* const answer = await confirm({ message: 'Continue?' })
|
|
201
186
|
* if (answer) { // user confirmed }
|
|
202
187
|
*/
|
|
203
|
-
export declare const confirm:
|
|
188
|
+
export declare const confirm: (...args: unknown[]) => Promise<unknown>;
|
|
204
189
|
/**
|
|
205
190
|
* Prompt for text input. Wrapped with spinner handling and abort signal
|
|
206
191
|
* support. Result is automatically trimmed.
|
|
@@ -208,7 +193,7 @@ export declare const confirm: typeof confirmRaw;
|
|
|
208
193
|
* @example
|
|
209
194
|
* const name = await input({ message: 'Enter your name:' })
|
|
210
195
|
*/
|
|
211
|
-
export declare const input:
|
|
196
|
+
export declare const input: (...args: unknown[]) => Promise<unknown>;
|
|
212
197
|
/**
|
|
213
198
|
* Prompt for password input (hidden characters). Wrapped with spinner handling
|
|
214
199
|
* and abort signal support.
|
|
@@ -216,7 +201,7 @@ export declare const input: typeof inputRaw;
|
|
|
216
201
|
* @example
|
|
217
202
|
* const token = await password({ message: 'Enter API token:' })
|
|
218
203
|
*/
|
|
219
|
-
export declare const password:
|
|
204
|
+
export declare const password: (...args: unknown[]) => Promise<unknown>;
|
|
220
205
|
/**
|
|
221
206
|
* Prompt with searchable/filterable choices. Wrapped with spinner handling and
|
|
222
207
|
* abort signal support.
|
|
@@ -227,7 +212,7 @@ export declare const password: typeof passwordRaw;
|
|
|
227
212
|
* source: async input => fetchPackages(input),
|
|
228
213
|
* })
|
|
229
214
|
*/
|
|
230
|
-
export declare const search:
|
|
215
|
+
export declare const search: (...args: unknown[]) => Promise<unknown>;
|
|
231
216
|
/**
|
|
232
217
|
* Prompt to select from a list of choices. Wrapped with spinner handling and
|
|
233
218
|
* abort signal support.
|
|
@@ -241,5 +226,5 @@ export declare const search: typeof searchRaw;
|
|
|
241
226
|
* ],
|
|
242
227
|
* })
|
|
243
228
|
*/
|
|
244
|
-
export declare const select:
|
|
245
|
-
export
|
|
229
|
+
export declare const select: (...args: unknown[]) => Promise<unknown>;
|
|
230
|
+
export declare const Separator: typeof SeparatorType;
|