@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/constants/node.js
CHANGED
|
@@ -106,6 +106,8 @@ function getNodeNoWarningsFlags() {
|
|
|
106
106
|
* Get the patch component of the current Node.js version.
|
|
107
107
|
*
|
|
108
108
|
* @returns The patch version number, or `0` if it cannot be parsed.
|
|
109
|
+
*
|
|
110
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
109
111
|
*/
|
|
110
112
|
function getNodePatchVersion() {
|
|
111
113
|
/* c8 ignore start */
|
|
@@ -142,6 +144,8 @@ function getNodeVersion() {
|
|
|
142
144
|
* API. The API is available on Node.js 24+.
|
|
143
145
|
*
|
|
144
146
|
* @returns `true` when the current runtime is Node.js 24 or newer.
|
|
147
|
+
*
|
|
148
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
145
149
|
*/
|
|
146
150
|
function supportsNodeCompileCacheApi() {
|
|
147
151
|
return getNodeMajorVersion() >= 24;
|
|
@@ -151,6 +155,8 @@ function supportsNodeCompileCacheApi() {
|
|
|
151
155
|
* Env-var-based compile caching is available on Node.js 22+.
|
|
152
156
|
*
|
|
153
157
|
* @returns `true` when the current runtime is Node.js 22 or newer.
|
|
158
|
+
*
|
|
159
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
154
160
|
*/
|
|
155
161
|
function supportsNodeCompileCacheEnvVar() {
|
|
156
162
|
return getNodeMajorVersion() >= 22;
|
|
@@ -180,6 +186,8 @@ function supportsNodeDisableSigusr1Flag() {
|
|
|
180
186
|
* The flag is available on Node.js 21+.
|
|
181
187
|
*
|
|
182
188
|
* @returns `true` when the current runtime is Node.js 21 or newer.
|
|
189
|
+
*
|
|
190
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
183
191
|
*/
|
|
184
192
|
function supportsNodeDisableWarningFlag() {
|
|
185
193
|
return getNodeMajorVersion() >= 21;
|
|
@@ -189,6 +197,8 @@ function supportsNodeDisableWarningFlag() {
|
|
|
189
197
|
* (`--experimental-permission` on Node 20-23, `--permission` on Node 24+).
|
|
190
198
|
*
|
|
191
199
|
* @returns `true` when the current runtime is Node.js 20 or newer.
|
|
200
|
+
*
|
|
201
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
192
202
|
*/
|
|
193
203
|
function supportsNodePermissionFlag() {
|
|
194
204
|
return getNodeMajorVersion() >= 20;
|
|
@@ -198,6 +208,8 @@ function supportsNodePermissionFlag() {
|
|
|
198
208
|
* Node.js 22.12+ or Node.js 23+.
|
|
199
209
|
*
|
|
200
210
|
* @returns `true` when the runtime supports `require()`-ing ES modules.
|
|
211
|
+
*
|
|
212
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
201
213
|
*/
|
|
202
214
|
function supportsNodeRequireModule() {
|
|
203
215
|
const major = getNodeMajorVersion();
|
|
@@ -253,6 +265,8 @@ function supportsNodeStripTypesDefault() {
|
|
|
253
265
|
* `process.send()` is callable to message the parent process.
|
|
254
266
|
*
|
|
255
267
|
* @returns `true` when the current process has an IPC channel to its parent.
|
|
268
|
+
*
|
|
269
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
256
270
|
*/
|
|
257
271
|
function supportsProcessSend() {
|
|
258
272
|
return typeof node_process.default.send === "function";
|
|
@@ -1,17 +1,13 @@
|
|
|
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_constants_maintained_node_versions = require('./maintained-node-versions.js');
|
|
6
|
-
let src_external_semver = require("../external/semver");
|
|
7
|
-
src_external_semver = require_runtime.__toESM(src_external_semver);
|
|
8
5
|
|
|
9
6
|
//#region src/constants/package-default-node-range.ts
|
|
10
7
|
/**
|
|
11
8
|
* @file Default Node.js version range for packages.
|
|
12
9
|
*/
|
|
13
|
-
|
|
14
|
-
const packageDefaultNodeRange = `>=${src_external_semver.parse(require_constants_maintained_node_versions.maintainedNodeVersions.last).major}`;
|
|
10
|
+
const packageDefaultNodeRange = `>=${Number.parseInt(require_constants_maintained_node_versions.maintainedNodeVersions.last, 10)}`;
|
|
15
11
|
|
|
16
12
|
//#endregion
|
|
17
13
|
exports.packageDefaultNodeRange = packageDefaultNodeRange;
|
|
@@ -11,8 +11,13 @@ export declare const PACKAGE_DEFAULT_VERSION = "1.0.0";
|
|
|
11
11
|
/**
|
|
12
12
|
* Clear the packument cache. Useful for long-running processes that want to
|
|
13
13
|
* force a re-fetch of registry metadata.
|
|
14
|
+
*
|
|
15
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
14
16
|
*/
|
|
15
17
|
export declare function clearPackumentCache(): void;
|
|
18
|
+
/**
|
|
19
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
20
|
+
*/
|
|
16
21
|
export declare function getLifecycleScriptNames(): string[];
|
|
17
22
|
export declare function getPackageDefaultNodeRange(): string | undefined;
|
|
18
23
|
export declare function getPackageDefaultSocketCategories(): readonly string[];
|
|
@@ -33,11 +33,16 @@ const PACKAGE_DEFAULT_VERSION = "1.0.0";
|
|
|
33
33
|
/**
|
|
34
34
|
* Clear the packument cache. Useful for long-running processes that want to
|
|
35
35
|
* force a re-fetch of registry metadata.
|
|
36
|
+
*
|
|
37
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
36
38
|
*/
|
|
37
39
|
function clearPackumentCache() {
|
|
38
40
|
/* c8 ignore next 3 - uninitialized-cache branch unreachable in tests */
|
|
39
41
|
if (cachedPackumentCache !== void 0) cachedPackumentCache.clear();
|
|
40
42
|
}
|
|
43
|
+
/**
|
|
44
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
45
|
+
*/
|
|
41
46
|
function getLifecycleScriptNames() {
|
|
42
47
|
if (cachedLifecycleScriptNames === void 0) cachedLifecycleScriptNames = require_primordials_array.ArrayFrom(require_constants_lifecycle_script_names.lifecycleScriptNames);
|
|
43
48
|
return cachedLifecycleScriptNames;
|
|
@@ -34,7 +34,7 @@ export declare function getOs(): Platform;
|
|
|
34
34
|
* Get the current host **target** in the pnpm `pack-app` vocabulary (memoized):
|
|
35
35
|
* `<os>-<arch>[-<libc>]`, e.g. `darwin-arm64`, `linux-x64`, `win32-x64`,
|
|
36
36
|
* `linux-x64-musl`. Raw Node `process.platform`/`process.arch` joined with `-`,
|
|
37
|
-
* plus a `-musl` suffix on Alpine. This is the
|
|
37
|
+
* plus a `-musl` suffix on Alpine. This is the Socket-wide naming for
|
|
38
38
|
* non-python / non-JRE tools (matches pnpm's release assets,
|
|
39
39
|
* `pnpm-<os>-<arch>[-<libc>].{tar.gz,zip}`). Tool-specific resolvers that need
|
|
40
40
|
* a different vocabulary own their own helper — see `getPythonArch`
|
|
@@ -60,7 +60,7 @@ let memoizedTarget;
|
|
|
60
60
|
* Get the current host **target** in the pnpm `pack-app` vocabulary (memoized):
|
|
61
61
|
* `<os>-<arch>[-<libc>]`, e.g. `darwin-arm64`, `linux-x64`, `win32-x64`,
|
|
62
62
|
* `linux-x64-musl`. Raw Node `process.platform`/`process.arch` joined with `-`,
|
|
63
|
-
* plus a `-musl` suffix on Alpine. This is the
|
|
63
|
+
* plus a `-musl` suffix on Alpine. This is the Socket-wide naming for
|
|
64
64
|
* non-python / non-JRE tools (matches pnpm's release assets,
|
|
65
65
|
* `pnpm-<os>-<arch>[-<libc>].{tar.gz,zip}`). Tool-specific resolvers that need
|
|
66
66
|
* a different vocabulary own their own helper — see `getPythonArch`
|
package/dist/constants/socket.js
CHANGED
|
@@ -35,7 +35,7 @@ const SOCKET_DIR = {
|
|
|
35
35
|
wheelhouse: `${"_"}wheelhouse`
|
|
36
36
|
};
|
|
37
37
|
const SOCKET_LIB_NAME = "@socketsecurity/lib";
|
|
38
|
-
const SOCKET_LIB_VERSION = "6.0.
|
|
38
|
+
const SOCKET_LIB_VERSION = "6.0.10";
|
|
39
39
|
const SOCKET_IPC_HANDSHAKE = "SOCKET_IPC_HANDSHAKE";
|
|
40
40
|
const CACHE_SOCKET_API_DIR = "socket-api";
|
|
41
41
|
const REGISTRY = "registry";
|
|
@@ -8,6 +8,11 @@
|
|
|
8
8
|
* project by probing `typescript/lib`.
|
|
9
9
|
*
|
|
10
10
|
* @returns `true` when the `typescript` package's libs can be resolved.
|
|
11
|
+
*
|
|
12
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
11
13
|
*/
|
|
12
14
|
export declare function getTsLibsAvailable(): boolean;
|
|
15
|
+
/**
|
|
16
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
17
|
+
*/
|
|
13
18
|
export declare function getTsTypesAvailable(): boolean;
|
|
@@ -13,6 +13,8 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
13
13
|
* project by probing `typescript/lib`.
|
|
14
14
|
*
|
|
15
15
|
* @returns `true` when the `typescript` package's libs can be resolved.
|
|
16
|
+
*
|
|
17
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
16
18
|
*/
|
|
17
19
|
function getTsLibsAvailable() {
|
|
18
20
|
try {
|
|
@@ -22,6 +24,9 @@ function getTsLibsAvailable() {
|
|
|
22
24
|
return false;
|
|
23
25
|
}
|
|
24
26
|
}
|
|
27
|
+
/**
|
|
28
|
+
* @unused No internal or Socket consumers (exercised only by its unit tests).
|
|
29
|
+
*/
|
|
25
30
|
function getTsTypesAvailable() {
|
|
26
31
|
try {
|
|
27
32
|
require.resolve("typescript/lib/lib.d.ts");
|
|
@@ -1,12 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file Private internals for `debug/*` modules — the
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
7
|
-
*
|
|
2
|
+
* @file Private internals for `debug/*` modules — the lazy debug-js accessor,
|
|
3
|
+
* the `debugByNamespace` cache that `namespace.getDebugJsInstance` fills,
|
|
4
|
+
* the lazy `pointingTriangle` glyph used by every output function, and
|
|
5
|
+
* `customLog` (the `debug-js` log-writer override). Node-bound pieces are
|
|
6
|
+
* deferred to first use — the vendored debug-js bundle is required lazily
|
|
7
|
+
* (its module top-level reads env / requires tty), the default `Logger` is
|
|
8
|
+
* constructed per call via the already-lazy `getDefaultLogger`, and
|
|
9
|
+
* `node:util` loads through the `getNodeUtil` accessor. Every call site
|
|
10
|
+
* sits behind the SOCKET_DEBUG / DEBUG env gates, so importing a `debug/*`
|
|
11
|
+
* leaf stays browser-load-safe and V8-snapshot-safe. Co-located so the
|
|
12
|
+
* namespace / output / caller-info leaves don't fragment ownership of this
|
|
13
|
+
* shared module state.
|
|
8
14
|
*/
|
|
9
|
-
|
|
15
|
+
import type debugJs from '../external/debug';
|
|
10
16
|
export declare const debugByNamespace: Map<any, any>;
|
|
11
17
|
export { getNodeUtil as getUtil } from '../node/util';
|
|
12
18
|
/**
|
|
@@ -15,6 +21,15 @@ export { getNodeUtil as getUtil } from '../node/util';
|
|
|
15
21
|
* @private
|
|
16
22
|
*/
|
|
17
23
|
export declare function customLog(...args: unknown[]): void;
|
|
24
|
+
/**
|
|
25
|
+
* Lazily require the vendored `debug-js` bundle. Deferred to first use so
|
|
26
|
+
* importing a `debug/*` leaf never evaluates debug-js's node-bound module
|
|
27
|
+
* top-level (tty/util requires, process.env reads); every caller sits behind
|
|
28
|
+
* the env gates, so browser bundles load this leaf without executing it.
|
|
29
|
+
*
|
|
30
|
+
* @private
|
|
31
|
+
*/
|
|
32
|
+
export declare function getDebugJs(): typeof debugJs;
|
|
18
33
|
/**
|
|
19
34
|
* Lazily resolve the "pointing triangle" glyph — `▸` on terminals with unicode
|
|
20
35
|
* support, `>` everywhere else. Initialised on first call by the output
|
package/dist/debug/_internal.js
CHANGED
|
@@ -8,20 +8,24 @@ const require_logger_default = require('../logger/default.js');
|
|
|
8
8
|
const require_node_util = require('../node/util.js');
|
|
9
9
|
let src_external__socketregistry_is_unicode_supported = require("../external/@socketregistry/is-unicode-supported");
|
|
10
10
|
src_external__socketregistry_is_unicode_supported = require_runtime.__toESM(src_external__socketregistry_is_unicode_supported);
|
|
11
|
-
let src_external_debug = require("../external/debug");
|
|
12
|
-
src_external_debug = require_runtime.__toESM(src_external_debug);
|
|
13
11
|
|
|
14
12
|
//#region src/debug/_internal.ts
|
|
15
13
|
/**
|
|
16
|
-
* @file Private internals for `debug/*` modules — the
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
14
|
+
* @file Private internals for `debug/*` modules — the lazy debug-js accessor,
|
|
15
|
+
* the `debugByNamespace` cache that `namespace.getDebugJsInstance` fills,
|
|
16
|
+
* the lazy `pointingTriangle` glyph used by every output function, and
|
|
17
|
+
* `customLog` (the `debug-js` log-writer override). Node-bound pieces are
|
|
18
|
+
* deferred to first use — the vendored debug-js bundle is required lazily
|
|
19
|
+
* (its module top-level reads env / requires tty), the default `Logger` is
|
|
20
|
+
* constructed per call via the already-lazy `getDefaultLogger`, and
|
|
21
|
+
* `node:util` loads through the `getNodeUtil` accessor. Every call site
|
|
22
|
+
* sits behind the SOCKET_DEBUG / DEBUG env gates, so importing a `debug/*`
|
|
23
|
+
* leaf stays browser-load-safe and V8-snapshot-safe. Co-located so the
|
|
24
|
+
* namespace / output / caller-info leaves don't fragment ownership of this
|
|
25
|
+
* shared module state.
|
|
22
26
|
*/
|
|
23
|
-
const logger = require_logger_default.getDefaultLogger();
|
|
24
27
|
const debugByNamespace = new require_primordials_map_set.MapCtor();
|
|
28
|
+
let cachedDebugJs;
|
|
25
29
|
let pointingTriangle;
|
|
26
30
|
/**
|
|
27
31
|
* Custom log function for debug output.
|
|
@@ -34,15 +38,29 @@ set at the right module-load timing. Tests use the SOCKET_DEBUG
|
|
|
34
38
|
path which writes via logger.info directly. */
|
|
35
39
|
function customLog(...args) {
|
|
36
40
|
const util = require_node_util.getNodeUtil();
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
+
const debugJsInstance = getDebugJs();
|
|
42
|
+
const inspectOpts = debugJsInstance.inspectOpts ? {
|
|
43
|
+
...debugJsInstance.inspectOpts,
|
|
44
|
+
showHidden: debugJsInstance.inspectOpts.showHidden === null ? void 0 : debugJsInstance.inspectOpts.showHidden,
|
|
45
|
+
depth: debugJsInstance.inspectOpts.depth === null || typeof debugJsInstance.inspectOpts.depth === "boolean" ? void 0 : debugJsInstance.inspectOpts.depth
|
|
41
46
|
} : {};
|
|
47
|
+
const logger = require_logger_default.getDefaultLogger();
|
|
42
48
|
require_primordials_reflect.ReflectApply(logger.info, logger, [util.formatWithOptions(inspectOpts, ...args)]);
|
|
43
49
|
}
|
|
44
50
|
/* c8 ignore stop */
|
|
45
51
|
/**
|
|
52
|
+
* Lazily require the vendored `debug-js` bundle. Deferred to first use so
|
|
53
|
+
* importing a `debug/*` leaf never evaluates debug-js's node-bound module
|
|
54
|
+
* top-level (tty/util requires, process.env reads); every caller sits behind
|
|
55
|
+
* the env gates, so browser bundles load this leaf without executing it.
|
|
56
|
+
*
|
|
57
|
+
* @private
|
|
58
|
+
*/
|
|
59
|
+
function getDebugJs() {
|
|
60
|
+
if (cachedDebugJs === void 0) cachedDebugJs = require("../external/debug");
|
|
61
|
+
return cachedDebugJs;
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
46
64
|
* Lazily resolve the "pointing triangle" glyph — `▸` on terminals with unicode
|
|
47
65
|
* support, `>` everywhere else. Initialised on first call by the output
|
|
48
66
|
* functions.
|
|
@@ -61,6 +79,6 @@ function getPointingTriangle() {
|
|
|
61
79
|
//#endregion
|
|
62
80
|
exports.customLog = customLog;
|
|
63
81
|
exports.debugByNamespace = debugByNamespace;
|
|
82
|
+
exports.getDebugJs = getDebugJs;
|
|
64
83
|
exports.getPointingTriangle = getPointingTriangle;
|
|
65
|
-
exports.getUtil = require_node_util.getNodeUtil;
|
|
66
|
-
exports.logger = logger;
|
|
84
|
+
exports.getUtil = require_node_util.getNodeUtil;
|
package/dist/debug/namespace.js
CHANGED
|
@@ -1,13 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/* Socket Lib - Built with rolldown */
|
|
3
3
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
-
const require_runtime = require('../_virtual/_rolldown/runtime.js');
|
|
5
4
|
const require_primordials_string = require('../primordials/string.js');
|
|
6
5
|
const require_env_debug = require('../env/debug.js');
|
|
7
6
|
const require_env_socket = require('../env/socket.js');
|
|
8
7
|
const require_debug__internal = require('./_internal.js');
|
|
9
|
-
let src_external_debug = require("../external/debug");
|
|
10
|
-
src_external_debug = require_runtime.__toESM(src_external_debug);
|
|
11
8
|
|
|
12
9
|
//#region src/debug/namespace.ts
|
|
13
10
|
/**
|
|
@@ -39,12 +36,15 @@ function extractOptions(namespaces) {
|
|
|
39
36
|
*/
|
|
40
37
|
function getDebugJsInstance(namespace) {
|
|
41
38
|
let inst = require_debug__internal.debugByNamespace.get(namespace);
|
|
42
|
-
/* c8 ignore start */
|
|
39
|
+
/* c8 ignore start - cache-hit arm needs a repeated same-namespace probe */
|
|
43
40
|
if (inst) return inst;
|
|
44
|
-
|
|
41
|
+
/* c8 ignore stop */
|
|
42
|
+
const debugJs = require_debug__internal.getDebugJs();
|
|
43
|
+
/* c8 ignore start - error/notice auto-enable needs SOCKET_DEBUG without DEBUG */
|
|
44
|
+
if (!require_env_debug.getDebug() && require_env_socket.getSocketDebug() && (namespace === "error" || namespace === "notice")) debugJs.enable(namespace);
|
|
45
45
|
/* c8 ignore stop */
|
|
46
46
|
/* c8 ignore next - External debug library call */
|
|
47
|
-
inst = (
|
|
47
|
+
inst = debugJs(namespace);
|
|
48
48
|
inst.log = require_debug__internal.customLog;
|
|
49
49
|
require_debug__internal.debugByNamespace.set(namespace, inst);
|
|
50
50
|
return inst;
|
|
@@ -72,8 +72,11 @@ function isEnabled(namespaces) {
|
|
|
72
72
|
const split = namespaces.trim().replace(/\s+/g, ",").split(",").filter(Boolean);
|
|
73
73
|
const names = [];
|
|
74
74
|
const skips = [];
|
|
75
|
-
for (
|
|
76
|
-
|
|
75
|
+
for (let i = 0, { length } = split; i < length; i += 1) {
|
|
76
|
+
const ns = split[i];
|
|
77
|
+
if (require_primordials_string.StringPrototypeStartsWith(ns, "-")) skips.push(ns.slice(1));
|
|
78
|
+
else names.push(ns);
|
|
79
|
+
}
|
|
77
80
|
if (names.length && !names.some((ns) => getDebugJsInstance(ns).enabled)) return false;
|
|
78
81
|
return skips.every((ns) => !getDebugJsInstance(ns).enabled);
|
|
79
82
|
}
|
package/dist/debug/output.d.ts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* active spinner across the write, and uses the lazy `pointingTriangle` glyph
|
|
7
7
|
* for the divider.
|
|
8
8
|
*/
|
|
9
|
+
import type { SpinnerInstance } from '../spinner/types';
|
|
9
10
|
import type { InspectOptions, NamespacesOrOptions } from './types';
|
|
10
11
|
/**
|
|
11
12
|
* Debug output with caller info (wrapper for debugNs with default namespace).
|
|
@@ -52,7 +53,7 @@ export declare function debugNs(namespacesOrOpts: NamespacesOrOptions, ...args:
|
|
|
52
53
|
* Create a Node.js util.debuglog compatible function. Returns a function that
|
|
53
54
|
* conditionally writes debug messages to stderr.
|
|
54
55
|
*/
|
|
55
|
-
export declare function debuglog(section: string): import("util").DebugLogger;
|
|
56
|
+
export declare function debuglog(section: string): import("node:util").DebugLogger;
|
|
56
57
|
/**
|
|
57
58
|
* Create timing functions for measuring code execution time. Returns an object
|
|
58
59
|
* with start() and end() methods, plus a callable function.
|
|
@@ -62,3 +63,13 @@ export declare function debugtime(label: string): {
|
|
|
62
63
|
start: () => void;
|
|
63
64
|
end: () => void;
|
|
64
65
|
};
|
|
66
|
+
/**
|
|
67
|
+
* Resolve the default spinner on Node; off Node (browser bundles) there is no
|
|
68
|
+
* spinner — callers no-op through their optional chains. Construction is
|
|
69
|
+
* deferred to first debug write (every call site sits behind the `isEnabled`
|
|
70
|
+
* / `getSocketDebug` gates), so a browser bundle never constructs the
|
|
71
|
+
* node-bound spinner even when debug output is force-enabled.
|
|
72
|
+
*
|
|
73
|
+
* @private
|
|
74
|
+
*/
|
|
75
|
+
export declare function getSpinner(): SpinnerInstance | undefined;
|
package/dist/debug/output.js
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
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_constants_runtime = require('../constants/runtime.js');
|
|
5
5
|
const require_primordials_array = require('../primordials/array.js');
|
|
6
6
|
const require_primordials_date = require('../primordials/date.js');
|
|
7
7
|
const require_primordials_reflect = require('../primordials/reflect.js');
|
|
8
8
|
const require_strings_format = require('../strings/format.js');
|
|
9
|
+
const require_logger_default = require('../logger/default.js');
|
|
9
10
|
const require_env_socket = require('../env/socket.js');
|
|
10
11
|
const require_node_util = require('../node/util.js');
|
|
11
12
|
const require_debug__internal = require('./_internal.js');
|
|
12
13
|
const require_debug_namespace = require('./namespace.js');
|
|
13
14
|
const require_spinner_default = require('../spinner/default.js');
|
|
14
15
|
const require_debug_caller_info = require('./caller-info.js');
|
|
15
|
-
let src_external_debug = require("../external/debug");
|
|
16
|
-
src_external_debug = require_runtime.__toESM(src_external_debug);
|
|
17
16
|
|
|
18
17
|
//#region src/debug/output.ts
|
|
19
18
|
/**
|
|
@@ -43,7 +42,8 @@ function debugCache(operation, key, meta) {
|
|
|
43
42
|
if (!require_env_socket.getSocketDebug()) return;
|
|
44
43
|
const prefix = `[CACHE] ${require_debug_caller_info.getCallerInfo(3) || "cache"} ${require_debug__internal.getPointingTriangle()} ${operation}: ${key}`;
|
|
45
44
|
const args = meta !== void 0 ? [prefix, meta] : [prefix];
|
|
46
|
-
|
|
45
|
+
const logger = require_logger_default.getDefaultLogger();
|
|
46
|
+
require_primordials_reflect.ReflectApply(logger.info, logger, args);
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* Debug output for cache operations with caller info. First argument is the
|
|
@@ -56,10 +56,11 @@ function debugCacheNs(namespacesOrOpts, operation, key, meta) {
|
|
|
56
56
|
if (!require_debug_namespace.isEnabled(namespaces)) return;
|
|
57
57
|
const prefix = `[CACHE] ${require_debug_caller_info.getCallerInfo(4) || "cache"} ${require_debug__internal.getPointingTriangle()} ${operation}: ${key}`;
|
|
58
58
|
const logArgs = meta !== void 0 ? [prefix, meta] : [prefix];
|
|
59
|
-
const spinnerInstance = options.spinner ||
|
|
59
|
+
const spinnerInstance = options.spinner || getSpinner();
|
|
60
60
|
const wasSpinning = spinnerInstance?.isSpinning;
|
|
61
61
|
spinnerInstance?.stop();
|
|
62
|
-
|
|
62
|
+
const logger = require_logger_default.getDefaultLogger();
|
|
63
|
+
require_primordials_reflect.ReflectApply(logger.info, logger, logArgs);
|
|
63
64
|
if (wasSpinning) spinnerInstance?.start();
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
@@ -81,9 +82,9 @@ function debugDirNs(namespacesOrOpts, obj, inspectOpts) {
|
|
|
81
82
|
/* c8 ignore stop */
|
|
82
83
|
const pointingTriangle = require_debug__internal.getPointingTriangle();
|
|
83
84
|
let opts = inspectOpts;
|
|
84
|
-
/* c8 ignore start */
|
|
85
|
+
/* c8 ignore start - inspectOpts fallback needs DEBUG_INSPECT_OPTIONS env */
|
|
85
86
|
if (opts === void 0) {
|
|
86
|
-
const debugOpts =
|
|
87
|
+
const debugOpts = require_debug__internal.getDebugJs().inspectOpts;
|
|
87
88
|
if (debugOpts) opts = {
|
|
88
89
|
...debugOpts,
|
|
89
90
|
showHidden: debugOpts.showHidden === null ? void 0 : debugOpts.showHidden,
|
|
@@ -91,11 +92,12 @@ function debugDirNs(namespacesOrOpts, obj, inspectOpts) {
|
|
|
91
92
|
};
|
|
92
93
|
}
|
|
93
94
|
/* c8 ignore stop */
|
|
94
|
-
const spinnerInstance = options.spinner ||
|
|
95
|
+
const spinnerInstance = options.spinner || getSpinner();
|
|
95
96
|
const wasSpinning = spinnerInstance?.isSpinning;
|
|
96
97
|
spinnerInstance?.stop();
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
const logger = require_logger_default.getDefaultLogger();
|
|
99
|
+
logger.info(`[DEBUG] ${callerName} ${pointingTriangle} object inspection:`);
|
|
100
|
+
logger.dir(obj, inspectOpts);
|
|
99
101
|
if (wasSpinning) spinnerInstance?.start();
|
|
100
102
|
}
|
|
101
103
|
/**
|
|
@@ -117,10 +119,11 @@ function debugLogNs(namespacesOrOpts, ...args) {
|
|
|
117
119
|
const pointingTriangle = require_debug__internal.getPointingTriangle();
|
|
118
120
|
const text = require_primordials_array.ArrayPrototypeAt(args, 0);
|
|
119
121
|
const logArgs = typeof text === "string" ? [require_strings_format.applyLinePrefix(`${callerName} ${pointingTriangle} ${text}`, { prefix: "[DEBUG] " }), ...require_primordials_array.ArrayPrototypeSlice(args, 1)] : [`[DEBUG] ${callerName} ${pointingTriangle}`, ...args];
|
|
120
|
-
const spinnerInstance = options.spinner ||
|
|
122
|
+
const spinnerInstance = options.spinner || getSpinner();
|
|
121
123
|
const wasSpinning = spinnerInstance?.isSpinning;
|
|
122
124
|
spinnerInstance?.stop();
|
|
123
|
-
|
|
125
|
+
const logger = require_logger_default.getDefaultLogger();
|
|
126
|
+
require_primordials_reflect.ReflectApply(logger.info, logger, logArgs);
|
|
124
127
|
if (wasSpinning) spinnerInstance?.start();
|
|
125
128
|
}
|
|
126
129
|
/**
|
|
@@ -136,10 +139,11 @@ function debugNs(namespacesOrOpts, ...args) {
|
|
|
136
139
|
const pointingTriangle = require_debug__internal.getPointingTriangle();
|
|
137
140
|
const text = require_primordials_array.ArrayPrototypeAt(args, 0);
|
|
138
141
|
const logArgs = typeof text === "string" ? [require_strings_format.applyLinePrefix(`${name} ${pointingTriangle} ${text}`, { prefix: "[DEBUG] " }), ...require_primordials_array.ArrayPrototypeSlice(args, 1)] : args;
|
|
139
|
-
const spinnerInstance = options.spinner ||
|
|
142
|
+
const spinnerInstance = options.spinner || getSpinner();
|
|
140
143
|
const wasSpinning = spinnerInstance?.isSpinning;
|
|
141
144
|
spinnerInstance?.stop();
|
|
142
|
-
|
|
145
|
+
const logger = require_logger_default.getDefaultLogger();
|
|
146
|
+
require_primordials_reflect.ReflectApply(logger.info, logger, logArgs);
|
|
143
147
|
if (wasSpinning) spinnerInstance?.start();
|
|
144
148
|
}
|
|
145
149
|
/**
|
|
@@ -176,6 +180,18 @@ function debugtime(label) {
|
|
|
176
180
|
};
|
|
177
181
|
return impl;
|
|
178
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Resolve the default spinner on Node; off Node (browser bundles) there is no
|
|
185
|
+
* spinner — callers no-op through their optional chains. Construction is
|
|
186
|
+
* deferred to first debug write (every call site sits behind the `isEnabled`
|
|
187
|
+
* / `getSocketDebug` gates), so a browser bundle never constructs the
|
|
188
|
+
* node-bound spinner even when debug output is force-enabled.
|
|
189
|
+
*
|
|
190
|
+
* @private
|
|
191
|
+
*/
|
|
192
|
+
function getSpinner() {
|
|
193
|
+
return require_constants_runtime.IS_NODE ? require_spinner_default.getDefaultSpinner() : void 0;
|
|
194
|
+
}
|
|
179
195
|
|
|
180
196
|
//#endregion
|
|
181
197
|
exports.debug = debug;
|
|
@@ -187,4 +203,5 @@ exports.debugLog = debugLog;
|
|
|
187
203
|
exports.debugLogNs = debugLogNs;
|
|
188
204
|
exports.debugNs = debugNs;
|
|
189
205
|
exports.debuglog = debuglog;
|
|
190
|
-
exports.debugtime = debugtime;
|
|
206
|
+
exports.debugtime = debugtime;
|
|
207
|
+
exports.getSpinner = getSpinner;
|
|
@@ -70,10 +70,13 @@ function findBinaryPath(packageDir, packageName, binaryName) {
|
|
|
70
70
|
packageName.split("/").pop() ?? packageName,
|
|
71
71
|
packageName.replace(/^@[^/]+\//, "")
|
|
72
72
|
].filter(Boolean);
|
|
73
|
-
for (
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
73
|
+
for (let i = 0, { length } = candidates; i < length; i += 1) {
|
|
74
|
+
const candidate = candidates[i];
|
|
75
|
+
if (candidate && binObj[candidate]) {
|
|
76
|
+
binName = candidate;
|
|
77
|
+
binPath = binObj[candidate];
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
77
80
|
}
|
|
78
81
|
if (!binPath && binKeys.length > 0) {
|
|
79
82
|
binName = binKeys[0];
|
|
@@ -134,7 +134,8 @@ function parseV1(data, rootDeps) {
|
|
|
134
134
|
const key = `${name}@${typeof pkg.version === "string" ? pkg.version : "0.0.0"}`;
|
|
135
135
|
if (visited.has(key)) continue;
|
|
136
136
|
if (packageIndex[name] === void 0) {
|
|
137
|
-
|
|
137
|
+
const ref = buildPackageRef(name, pkg);
|
|
138
|
+
require_primordials_array.ArrayPrototypePush(packages, ref);
|
|
138
139
|
packageIndex[name] = packages.length - 1;
|
|
139
140
|
}
|
|
140
141
|
if (pkg.dependencies && typeof pkg.dependencies === "object") {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* The dir exists so downstream code can import from a stable canonical path;
|
|
4
4
|
* populate when first concrete need arrives. vlt lockfile is `vlt-lock.json`.
|
|
5
5
|
* Reference: socket-sdxgen/src/parsers/vlt/. vlt does not support overrides,
|
|
6
|
-
* so
|
|
6
|
+
* so Socket code that needs override support should branch around it (see
|
|
7
7
|
* socket-cli/packages/cli/src/commands/optimize/ for the canonical pattern of
|
|
8
8
|
* agent-conditional logic).
|
|
9
9
|
*/
|
package/dist/eco/npm/vlt/exec.js
CHANGED
|
@@ -9,7 +9,7 @@ const require_primordials_error = require('../../../primordials/error.js');
|
|
|
9
9
|
* The dir exists so downstream code can import from a stable canonical path;
|
|
10
10
|
* populate when first concrete need arrives. vlt lockfile is `vlt-lock.json`.
|
|
11
11
|
* Reference: socket-sdxgen/src/parsers/vlt/. vlt does not support overrides,
|
|
12
|
-
* so
|
|
12
|
+
* so Socket code that needs override support should branch around it (see
|
|
13
13
|
* socket-cli/packages/cli/src/commands/optimize/ for the canonical pattern of
|
|
14
14
|
* agent-conditional logic).
|
|
15
15
|
*/
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file AI coding-agent detection, re-exported from std-env — not
|
|
3
|
+
* reimplemented. std-env is a devDependency, inlined by the bundler.
|
|
4
|
+
*/
|
|
5
|
+
export { agent, agentInfo, detectAgent, isAgent } from '../external/std-env';
|
|
6
|
+
export type { AgentInfo, AgentName } from '../external/std-env';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
let src_external_std_env = require("../external/std-env");
|
|
5
|
+
|
|
6
|
+
Object.defineProperty(exports, 'agent', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return src_external_std_env.agent;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, 'agentInfo', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return src_external_std_env.agentInfo;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, 'detectAgent', {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return src_external_std_env.detectAgent;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
Object.defineProperty(exports, 'isAgent', {
|
|
25
|
+
enumerable: true,
|
|
26
|
+
get: function () {
|
|
27
|
+
return src_external_std_env.isAgent;
|
|
28
|
+
}
|
|
29
|
+
});
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @file Environment flag booleans, re-exported from std-env — not
|
|
3
|
+
* reimplemented. std-env is a devDependency; the bundler inlines it, so dist
|
|
4
|
+
* carries the logic with no runtime std-env import.
|
|
5
|
+
* Only the flags socket-lib does NOT already own live here. CI, DEBUG,
|
|
6
|
+
* NODE_ENV, test, platform, and Node-version detection are handled by
|
|
7
|
+
* socket-lib's own rewire-aware getters and constants (`env/ci` `getCI`,
|
|
8
|
+
* `env/debug` `getDebug`, `env/node-env` `getNodeEnv`, `env/test` `isTest`,
|
|
9
|
+
* `constants/platform`, `constants/node`, `constants/runtime`), so std-env's
|
|
10
|
+
* overlapping flags are intentionally not re-exported.
|
|
11
|
+
*/
|
|
12
|
+
export { hasTTY, isColorSupported, isMinimal } from '../external/std-env';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/* Socket Lib - Built with rolldown */
|
|
3
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
4
|
+
let src_external_std_env = require("../external/std-env");
|
|
5
|
+
|
|
6
|
+
Object.defineProperty(exports, 'hasTTY', {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return src_external_std_env.hasTTY;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
Object.defineProperty(exports, 'isColorSupported', {
|
|
13
|
+
enumerable: true,
|
|
14
|
+
get: function () {
|
|
15
|
+
return src_external_std_env.isColorSupported;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, 'isMinimal', {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () {
|
|
21
|
+
return src_external_std_env.isMinimal;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
@@ -13,12 +13,12 @@ const require_http_request_node = require('../http-request/node.js');
|
|
|
13
13
|
* most 8 seconds to startup (configurable timeout) and fails open on network
|
|
14
14
|
* error so a down status page never blocks a healthy workflow.
|
|
15
15
|
*/
|
|
16
|
-
const MONITORED_COMPONENT_IDS = new Map([
|
|
16
|
+
const MONITORED_COMPONENT_IDS = /* @__PURE__ */ new Map([
|
|
17
17
|
["br0l2tvcx85d", "Actions"],
|
|
18
18
|
["8l4ygp009s5s", "Git Operations"],
|
|
19
19
|
["brv1bkgrwx7q", "API Requests"]
|
|
20
20
|
]);
|
|
21
|
-
const SEVERITY = new Map([
|
|
21
|
+
const SEVERITY = /* @__PURE__ */ new Map([
|
|
22
22
|
["major_outage", 4],
|
|
23
23
|
["partial_outage", 3],
|
|
24
24
|
["degraded_performance", 2],
|