@socketsecurity/lib 6.0.9 → 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 +6 -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 +10 -9
- package/dist/ai/route.js +14 -13
- package/dist/ai/spawn.d.mts +2 -1
- package/dist/ai/spawn.js +25 -2
- 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 +9 -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 +446 -300
- 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 +10 -33
- 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 +4 -0
- package/dist/compression/gzip.d.ts +6 -2
- package/dist/compression/gzip.js +6 -1
- package/dist/config/layers.d.ts +4 -4
- package/dist/config/layers.js +4 -4
- 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/namespace.js +11 -8
- package/dist/debug/output.d.ts +12 -1
- package/dist/debug/output.js +33 -16
- package/dist/dlx/binary-resolution.js +7 -4
- package/dist/eco/npm/npm/parse-lockfile.js +2 -1
- package/dist/eco/npm/vlt/exec.d.ts +1 -1
- package/dist/eco/npm/vlt/exec.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 +32 -0
- package/dist/env/rewire.js +55 -23
- 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/errors/predicates.d.ts +3 -2
- package/dist/errors/predicates.js +5 -3
- package/dist/errors/stack.js +2 -1
- package/dist/events/exit/_internal.d.ts +1 -23
- package/dist/external/@npmcli/package-json.js +179 -88
- 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/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 +41 -34
- 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 +1551 -1867
- 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/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/from-download.d.ts +1 -1
- package/dist/external-tools/manifest.d.ts +5 -3
- package/dist/external-tools/manifest.js +4 -2
- 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 +7 -3
- 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/sbt/resolve.d.ts +3 -0
- package/dist/external-tools/sbt/resolve.js +3 -0
- package/dist/external-tools/skillspector/from-uv.d.ts +1 -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 +1 -1
- package/dist/external-tools/uv/resolve.d.ts +3 -0
- package/dist/external-tools/uv/resolve.js +3 -0
- package/dist/fleet/repo-config.d.ts +8 -6
- package/dist/fleet/repo-config.js +8 -6
- 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/allowed-dirs-cache.js +5 -3
- 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 +1 -1
- package/dist/git/_internal.js +5 -1
- 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/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/http-request/_internal.d.ts +1 -1
- package/dist/http-request/browser.d.ts +6 -0
- package/dist/http-request/browser.js +3 -2
- package/dist/http-request/download.js +2 -0
- package/dist/http-request/headers.d.ts +1 -1
- package/dist/http-request/headers.js +1 -1
- 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 +3 -1
- package/dist/integrity.js +3 -1
- 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 +9 -3
- package/dist/logger/colors.js +6 -13
- 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/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/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/packages/manifest.js +6 -7
- package/dist/packages/metadata-extensions.js +2 -4
- package/dist/packages/provenance.d.ts +8 -0
- package/dist/packages/provenance.js +8 -0
- 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/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/resolve.js +19 -14
- package/dist/paths/socket.d.ts +8 -8
- package/dist/paths/socket.js +8 -8
- package/dist/perf/report.js +4 -2
- 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/releases/socket-btm-binary-naming.js +12 -1
- package/dist/secrets/_internal.d.ts +1 -1
- package/dist/secrets/_internal.js +1 -1
- package/dist/secrets/find.d.ts +2 -2
- package/dist/secrets/find.js +2 -2
- package/dist/secrets/keychain.d.ts +10 -1
- package/dist/secrets/keychain.js +10 -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/http.d.ts +2 -0
- package/dist/smol/http.js +2 -0
- package/dist/smol/https.d.ts +2 -0
- package/dist/smol/https.js +2 -0
- package/dist/sorts/_internal.d.ts +2 -3
- package/dist/sorts/_internal.js +1 -3
- package/dist/spinner/format.js +2 -4
- package/dist/stdio/footer.js +8 -7
- package/dist/stdio/prompts.d.ts +8 -15
- package/dist/stdio/prompts.js +18 -29
- package/dist/strings/predicates.d.ts +2 -2
- package/dist/strings/search.js +1 -1
- 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 +13 -0
- package/dist/themes/context.js +23 -8
- 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 -750
- package/package.json +200 -35
package/dist/paths/globs.js
CHANGED
|
@@ -8,9 +8,15 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
8
8
|
*/
|
|
9
9
|
const LICENSE_GLOB = "LICEN[CS]E{[.-]*,}";
|
|
10
10
|
const LICENSE_GLOB_RECURSIVE = "**/LICEN[CS]E{[.-]*,}";
|
|
11
|
+
/**
|
|
12
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
13
|
+
*/
|
|
11
14
|
const LICENSE_ORIGINAL_GLOB = "*.original{.*,}";
|
|
12
15
|
const LICENSE_ORIGINAL_GLOB_RECURSIVE = "**/*.original{.*,}";
|
|
13
16
|
const README_GLOB = "README{.*,}";
|
|
17
|
+
/**
|
|
18
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
19
|
+
*/
|
|
14
20
|
const README_GLOB_RECURSIVE = "**/README{.*,}";
|
|
15
21
|
|
|
16
22
|
//#endregion
|
package/dist/paths/resolve.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
const require_primordials_string = require('../primordials/string.js');
|
|
5
|
+
const require_constants_platform = require('../constants/platform.js');
|
|
6
|
+
const require_constants_encoding = require('../constants/encoding.js');
|
|
7
|
+
const require_paths_predicates = require('./predicates.js');
|
|
8
|
+
const require_paths_normalize = require('./normalize.js');
|
|
4
9
|
|
|
5
10
|
//#region src/paths/resolve.ts
|
|
6
11
|
/**
|
|
@@ -39,7 +44,7 @@ function relative(from, to) {
|
|
|
39
44
|
const actualTo = resolve(to);
|
|
40
45
|
if (actualFrom === actualTo) return "";
|
|
41
46
|
/* c8 ignore start - Windows-only case-insensitive comparison. */
|
|
42
|
-
if (WIN32) {
|
|
47
|
+
if (require_constants_platform.WIN32) {
|
|
43
48
|
if (actualFrom.toLowerCase() === actualTo.toLowerCase()) return "";
|
|
44
49
|
}
|
|
45
50
|
/* c8 ignore stop */
|
|
@@ -52,32 +57,32 @@ function relative(from, to) {
|
|
|
52
57
|
let lastCommonSep = -1;
|
|
53
58
|
let i = 0;
|
|
54
59
|
for (; i < length; i += 1) {
|
|
55
|
-
let fromCode = StringPrototypeCharCodeAt(actualFrom, fromStart + i);
|
|
56
|
-
let toCode = StringPrototypeCharCodeAt(actualTo, toStart + i);
|
|
60
|
+
let fromCode = require_primordials_string.StringPrototypeCharCodeAt(actualFrom, fromStart + i);
|
|
61
|
+
let toCode = require_primordials_string.StringPrototypeCharCodeAt(actualTo, toStart + i);
|
|
57
62
|
/* c8 ignore start - Windows-only case folding. */
|
|
58
|
-
if (WIN32) {
|
|
59
|
-
if (fromCode >=
|
|
60
|
-
if (toCode >=
|
|
63
|
+
if (require_constants_platform.WIN32) {
|
|
64
|
+
if (fromCode >= 65 && fromCode <= 90) fromCode += 32;
|
|
65
|
+
if (toCode >= 65 && toCode <= 90) toCode += 32;
|
|
61
66
|
}
|
|
62
67
|
/* c8 ignore stop */
|
|
63
68
|
if (fromCode !== toCode) break;
|
|
64
|
-
if (isPathSeparator(StringPrototypeCharCodeAt(actualFrom, fromStart + i))) lastCommonSep = i;
|
|
69
|
+
if (require_paths_predicates.isPathSeparator(require_primordials_string.StringPrototypeCharCodeAt(actualFrom, fromStart + i))) lastCommonSep = i;
|
|
65
70
|
}
|
|
66
71
|
/* c8 ignore start */
|
|
67
72
|
if (i === length) {
|
|
68
73
|
if (toLen > length) {
|
|
69
|
-
if (isPathSeparator(StringPrototypeCharCodeAt(actualTo, toStart + i))) return actualTo.slice(toStart + i + 1);
|
|
74
|
+
if (require_paths_predicates.isPathSeparator(require_primordials_string.StringPrototypeCharCodeAt(actualTo, toStart + i))) return actualTo.slice(toStart + i + 1);
|
|
70
75
|
if (i === 0) return actualTo.slice(toStart + i);
|
|
71
76
|
} else if (fromLen > length) {
|
|
72
|
-
if (isPathSeparator(StringPrototypeCharCodeAt(actualFrom, fromStart + i))) lastCommonSep = i;
|
|
77
|
+
if (require_paths_predicates.isPathSeparator(require_primordials_string.StringPrototypeCharCodeAt(actualFrom, fromStart + i))) lastCommonSep = i;
|
|
73
78
|
else if (i === 0) lastCommonSep = 0;
|
|
74
79
|
}
|
|
75
80
|
}
|
|
76
81
|
/* c8 ignore stop */
|
|
77
82
|
let out = "";
|
|
78
83
|
for (i = fromStart + lastCommonSep + 1; i <= fromEnd; i += 1) {
|
|
79
|
-
const code = StringPrototypeCharCodeAt(actualFrom, i);
|
|
80
|
-
if (i === fromEnd || isPathSeparator(code)) out += out.length === 0 ? ".." : "/..";
|
|
84
|
+
const code = require_primordials_string.StringPrototypeCharCodeAt(actualFrom, i);
|
|
85
|
+
if (i === fromEnd || require_paths_predicates.isPathSeparator(code)) out += out.length === 0 ? ".." : "/..";
|
|
81
86
|
}
|
|
82
87
|
return out + actualTo.slice(toStart + lastCommonSep);
|
|
83
88
|
}
|
|
@@ -103,7 +108,7 @@ function relative(from, to) {
|
|
|
103
108
|
function relativeResolve(from, to) {
|
|
104
109
|
const rel = relative(from, to);
|
|
105
110
|
if (rel === "") return "";
|
|
106
|
-
return normalizePath(rel);
|
|
111
|
+
return require_paths_normalize.normalizePath(rel);
|
|
107
112
|
}
|
|
108
113
|
/**
|
|
109
114
|
* Resolve an absolute path from path segments.
|
|
@@ -132,11 +137,11 @@ function resolve(...segments) {
|
|
|
132
137
|
/* c8 ignore start */
|
|
133
138
|
if (typeof segment !== "string" || segment.length === 0) continue;
|
|
134
139
|
resolvedPath = segment + (resolvedPath.length === 0 ? "" : `/${resolvedPath}`);
|
|
135
|
-
resolvedAbsolute = isAbsolute(segment);
|
|
140
|
+
resolvedAbsolute = require_paths_predicates.isAbsolute(segment);
|
|
136
141
|
}
|
|
137
142
|
if (!resolvedAbsolute) resolvedPath = /* @__PURE__ */ require("node:process").cwd() + (resolvedPath.length === 0 ? "" : `/${resolvedPath}`);
|
|
138
143
|
/* c8 ignore stop */
|
|
139
|
-
return normalizePath(resolvedPath);
|
|
144
|
+
return require_paths_normalize.normalizePath(resolvedPath);
|
|
140
145
|
}
|
|
141
146
|
|
|
142
147
|
//#endregion
|
package/dist/paths/socket.d.ts
CHANGED
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
* `_dlx/<hash>/` name+version binary store (node, jre, python, sfw, …);
|
|
6
6
|
* `_state/<app>/` version-LESS persistent app state (daemon socket + lock +
|
|
7
7
|
* OAuth refresh; mirrors pnpm `state-dir` / XDG_STATE_HOME), with
|
|
8
|
-
* `_state/<app>/run/` for a daemon's socket/lock/pid; `_wheelhouse`
|
|
9
|
-
*
|
|
8
|
+
* `_state/<app>/run/` for a daemon's socket/lock/pid; `_wheelhouse` shared
|
|
9
|
+
* bin across Socket tools. Generic per-app dirs (`getSocketAppDir('<name>')`)
|
|
10
10
|
* nest under the same `_`-prefix.
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
@@ -154,8 +154,8 @@ export declare function getSocketRackToolDir(options: {
|
|
|
154
154
|
* (Treeless `--filter=tree:0` is smaller still but refetches trees on every
|
|
155
155
|
* walk, which is slow + breaks offline, so it is NOT the default.)
|
|
156
156
|
*
|
|
157
|
-
* Deliberately OUTSIDE `~/projects/` so
|
|
158
|
-
* cascade `--all`) never mistakes a reference clone for a
|
|
157
|
+
* Deliberately OUTSIDE `~/projects/` so Socket's sibling-walk tooling (e.g.
|
|
158
|
+
* cascade `--all`) never mistakes a reference clone for a Socket repo
|
|
159
159
|
* checkout. Disposable: a reference cache, not a working tree. Inherits the
|
|
160
160
|
* `_wheelhouse` override chain (SOCKET_HOME /
|
|
161
161
|
* setPath('socket-wheelhouse-dir')).
|
|
@@ -187,10 +187,10 @@ export declare function getSocketUserDir(): string;
|
|
|
187
187
|
*/
|
|
188
188
|
export declare function getSocketWheelhouseBinDir(): string;
|
|
189
189
|
/**
|
|
190
|
-
* Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared
|
|
191
|
-
*
|
|
192
|
-
* each one re-downloading and re-extracting per-repo. Tool installers
|
|
193
|
-
* sfw, etc.) rack their resolved executables under
|
|
190
|
+
* Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared location,
|
|
191
|
+
* common across Socket repos, for binaries that every Socket repo can reach
|
|
192
|
+
* without each one re-downloading and re-extracting per-repo. Tool installers
|
|
193
|
+
* (janus, sfw, etc.) rack their resolved executables under
|
|
194
194
|
* `<wheelhouse>/rack/<tool>/<version>/…` (getSocketRackToolDir) and expose a
|
|
195
195
|
* handle in `<wheelhouse>/bin` (getSocketWheelhouseBinDir); consumers add that
|
|
196
196
|
* one `bin/` to PATH. Override precedence: setPath('socket-wheelhouse-dir', …)
|
package/dist/paths/socket.js
CHANGED
|
@@ -21,8 +21,8 @@ const require_paths_rewire = require('./rewire.js');
|
|
|
21
21
|
* `_dlx/<hash>/` name+version binary store (node, jre, python, sfw, …);
|
|
22
22
|
* `_state/<app>/` version-LESS persistent app state (daemon socket + lock +
|
|
23
23
|
* OAuth refresh; mirrors pnpm `state-dir` / XDG_STATE_HOME), with
|
|
24
|
-
* `_state/<app>/run/` for a daemon's socket/lock/pid; `_wheelhouse`
|
|
25
|
-
*
|
|
24
|
+
* `_state/<app>/run/` for a daemon's socket/lock/pid; `_wheelhouse` shared
|
|
25
|
+
* bin across Socket tools. Generic per-app dirs (`getSocketAppDir('<name>')`)
|
|
26
26
|
* nest under the same `_`-prefix.
|
|
27
27
|
*/
|
|
28
28
|
/**
|
|
@@ -210,8 +210,8 @@ function getSocketRackToolDir(options) {
|
|
|
210
210
|
* (Treeless `--filter=tree:0` is smaller still but refetches trees on every
|
|
211
211
|
* walk, which is slow + breaks offline, so it is NOT the default.)
|
|
212
212
|
*
|
|
213
|
-
* Deliberately OUTSIDE `~/projects/` so
|
|
214
|
-
* cascade `--all`) never mistakes a reference clone for a
|
|
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
215
|
* checkout. Disposable: a reference cache, not a working tree. Inherits the
|
|
216
216
|
* `_wheelhouse` override chain (SOCKET_HOME /
|
|
217
217
|
* setPath('socket-wheelhouse-dir')).
|
|
@@ -258,10 +258,10 @@ function getSocketWheelhouseBinDir() {
|
|
|
258
258
|
return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketWheelhouseDir(), "bin"));
|
|
259
259
|
}
|
|
260
260
|
/**
|
|
261
|
-
* Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared
|
|
262
|
-
*
|
|
263
|
-
* each one re-downloading and re-extracting per-repo. Tool installers
|
|
264
|
-
* sfw, etc.) rack their resolved executables under
|
|
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
265
|
* `<wheelhouse>/rack/<tool>/<version>/…` (getSocketRackToolDir) and expose a
|
|
266
266
|
* handle in `<wheelhouse>/bin` (getSocketWheelhouseBinDir); consumers add that
|
|
267
267
|
* one `bin/` to PATH. Override precedence: setPath('socket-wheelhouse-dir', …)
|
package/dist/perf/report.js
CHANGED
|
@@ -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,
|
|
@@ -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
|
/**
|
|
@@ -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
|
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
|
package/dist/secrets/find.js
CHANGED
|
@@ -6,10 +6,10 @@ const require_secrets_keychain = require('./keychain.js');
|
|
|
6
6
|
|
|
7
7
|
//#region src/secrets/find.ts
|
|
8
8
|
/**
|
|
9
|
-
* @file Resolve a secret from the canonical
|
|
9
|
+
* @file Resolve a secret from the canonical Socket precedence order: process env
|
|
10
10
|
* → OS keychain. Returns the value + the source it came from so the caller
|
|
11
11
|
* can log which slot won. Why a helper instead of inlining: every consumer of
|
|
12
|
-
* the
|
|
12
|
+
* the Socket API token does the same dance — check
|
|
13
13
|
* `process.env.SOCKET_API_TOKEN`, fall back to a legacy env-var alias, fall
|
|
14
14
|
* back to `readSecret({...})` from the keychain. Tools drift on the exact
|
|
15
15
|
* order and on which aliases they consider. This helper centralizes the
|
|
@@ -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) {
|
|
@@ -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/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;
|