@socketsecurity/lib 6.0.8 → 6.0.9

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.
Files changed (119) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/dist/ai/route.d.mts +21 -8
  3. package/dist/ai/route.js +21 -6
  4. package/dist/ai/spawn.d.mts +32 -0
  5. package/dist/ai/spawn.js +91 -2
  6. package/dist/ai/types.d.mts +10 -0
  7. package/dist/bin/prim.cjs +18797 -13627
  8. package/dist/bin/resolve.js +1 -1
  9. package/dist/cache/ttl/store.js +1 -1
  10. package/dist/compression/brotli.js +1 -1
  11. package/dist/compression/gzip.js +1 -1
  12. package/dist/config/layers.d.ts +53 -0
  13. package/dist/config/layers.js +83 -0
  14. package/dist/constants/socket.js +1 -1
  15. package/dist/debug/caller-info.js +1 -1
  16. package/dist/dlx/binary-cache.js +1 -1
  17. package/dist/dlx/binary-resolution.js +1 -1
  18. package/dist/dlx/firewall.js +1 -1
  19. package/dist/dlx/lockfile.js +1 -1
  20. package/dist/eco/npm/npm/parse-lockfile.js +1 -1
  21. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +1 -1
  22. package/dist/env/rewire.d.ts +5 -3
  23. package/dist/env/rewire.js +6 -7
  24. package/dist/env/xdg.d.ts +17 -0
  25. package/dist/env/xdg.js +21 -1
  26. package/dist/errors/stack.js +1 -2
  27. package/dist/external/@npmcli/package-json.js +3455 -4881
  28. package/dist/external/@yarnpkg/extensions.js +1 -1
  29. package/dist/external/external-pack.js +1 -1
  30. package/dist/external/npm-pack.js +29164 -31799
  31. package/dist/external/tar-fs.js +63 -16
  32. package/dist/external-tools/jre/detect-platform-arch.js +1 -1
  33. package/dist/external-tools/manifest.js +1 -1
  34. package/dist/external-tools/python/asset-names.js +1 -1
  35. package/dist/external-tools/python/uv-install.d.ts +89 -0
  36. package/dist/external-tools/python/uv-install.js +165 -0
  37. package/dist/external-tools/skillspector/from-uv.d.ts +30 -0
  38. package/dist/external-tools/skillspector/from-uv.js +56 -0
  39. package/dist/external-tools/skillspector/resolve.d.ts +18 -3
  40. package/dist/external-tools/skillspector/resolve.js +21 -8
  41. package/dist/external-tools/skillspector/types.d.ts +3 -1
  42. package/dist/external-tools/uv/asset-names.d.ts +36 -0
  43. package/dist/external-tools/uv/asset-names.js +73 -0
  44. package/dist/external-tools/uv/from-download.d.ts +17 -0
  45. package/dist/external-tools/uv/from-download.js +50 -0
  46. package/dist/external-tools/uv/from-path.d.ts +5 -0
  47. package/dist/external-tools/uv/from-path.js +22 -0
  48. package/dist/external-tools/uv/from-vfs.d.ts +7 -0
  49. package/dist/external-tools/uv/from-vfs.js +26 -0
  50. package/dist/external-tools/uv/resolve.d.ts +25 -0
  51. package/dist/external-tools/uv/resolve.js +61 -0
  52. package/dist/external-tools/uv/types.d.ts +24 -0
  53. package/dist/external-tools/uv/types.js +2 -0
  54. package/dist/fleet/repo-config.d.ts +53 -0
  55. package/dist/fleet/repo-config.js +79 -0
  56. package/dist/fs/allowed-dirs-cache.js +3 -5
  57. package/dist/fs/copy.d.ts +88 -0
  58. package/dist/fs/copy.js +89 -0
  59. package/dist/fs/safe.js +1 -1
  60. package/dist/git/_internal.js +2 -2
  61. package/dist/github/refs.js +10 -15
  62. package/dist/globs/_internal.js +1 -1
  63. package/dist/http-request/browser.js +1 -1
  64. package/dist/http-request/checksum-file.js +1 -1
  65. package/dist/http-request/headers.js +1 -1
  66. package/dist/integrity.d.ts +125 -78
  67. package/dist/integrity.js +168 -84
  68. package/dist/logger/colors.d.ts +1 -2
  69. package/dist/logger/colors.js +2 -2
  70. package/dist/logger/symbols-builder.js +7 -8
  71. package/dist/logger/symbols.js +8 -8
  72. package/dist/node/module.d.ts +73 -2
  73. package/dist/node/module.js +97 -12
  74. package/dist/objects/predicates.js +1 -1
  75. package/dist/packages/exports.js +2 -2
  76. package/dist/packages/isolation.js +1 -1
  77. package/dist/packages/manifest.d.ts +29 -0
  78. package/dist/packages/manifest.js +38 -2
  79. package/dist/packages/normalize.js +1 -1
  80. package/dist/packages/provenance.js +2 -2
  81. package/dist/packages/specs.js +1 -1
  82. package/dist/paths/_internal.d.ts +1 -7
  83. package/dist/paths/_internal.js +9 -15
  84. package/dist/paths/conversion.js +1 -1
  85. package/dist/paths/normalize.js +1 -1
  86. package/dist/paths/predicates.js +2 -1
  87. package/dist/paths/socket.d.ts +74 -23
  88. package/dist/paths/socket.js +97 -23
  89. package/dist/perf/metrics.js +1 -1
  90. package/dist/perf/report.js +1 -1
  91. package/dist/regexps/spec.js +1 -1
  92. package/dist/schema/validate.js +1 -1
  93. package/dist/secrets/broker.d.ts +35 -0
  94. package/dist/secrets/broker.js +72 -0
  95. package/dist/secrets/find.d.ts +6 -4
  96. package/dist/secrets/find.js +15 -1
  97. package/dist/secrets/rc.js +1 -1
  98. package/dist/smol/detect.js +1 -1
  99. package/dist/smol/http.js +1 -1
  100. package/dist/smol/https.js +1 -1
  101. package/dist/smol/manifest.js +1 -1
  102. package/dist/smol/path.js +1 -1
  103. package/dist/smol/primordial.js +1 -1
  104. package/dist/smol/purl.js +1 -1
  105. package/dist/smol/versions.js +1 -1
  106. package/dist/smol/vfs.js +1 -1
  107. package/dist/sorts/_internal.d.ts +1 -2
  108. package/dist/sorts/_internal.js +2 -6
  109. package/dist/sorts/semver.js +2 -2
  110. package/dist/spinner/create-spinner-class.js +1 -1
  111. package/dist/stdio/progress.js +1 -1
  112. package/dist/stdio/prompts.d.ts +0 -8
  113. package/dist/stdio/prompts.js +10 -23
  114. package/dist/strings/format.js +1 -1
  115. package/dist/strings/search.js +1 -1
  116. package/dist/themes/context.d.ts +5 -3
  117. package/dist/themes/context.js +5 -6
  118. package/llms.txt +750 -0
  119. package/package.json +79 -13
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @file Proteus broker client. Asks the running proteus credential daemon for a
3
+ * secret over its local Unix socket (Windows named pipe later), so a
4
+ * biometric-gated read happens inside the daemon and the value is vended to
5
+ * this process in memory rather than sitting in an env var. This is the layer
6
+ * `ai/credentials.mts` documents as slotting between the env check and the
7
+ * keychain read in `secrets/find.ts` `resolve()`.
8
+ * The broker is OPTIONAL and self-gating: when the daemon isn't running (no
9
+ * socket file), `requestFromBroker` returns `undefined` immediately and the
10
+ * caller falls through to the keychain. It never throws — a broker miss is a
11
+ * fall-through, not an error. The daemon binary itself is built by socket-btm
12
+ * (`packages/proteus-builder`); download-and-start is a later layer, so today
13
+ * this only talks to an already-running daemon.
14
+ */
15
+ export interface BrokerRequestOptions {
16
+ /**
17
+ * The keychain service scope (e.g. `socketsecurity`).
18
+ */
19
+ readonly service: string;
20
+ /**
21
+ * The account within the service (e.g. `ANTHROPIC_API_KEY`).
22
+ */
23
+ readonly account: string;
24
+ }
25
+ export interface BrokerResponse {
26
+ readonly ok?: boolean | undefined;
27
+ readonly value?: string | undefined;
28
+ }
29
+ /**
30
+ * Ask the proteus daemon for a credential. Returns the value on success, or
31
+ * `undefined` when the daemon isn't running, doesn't hold it, or the biometric
32
+ * prompt was declined. Never throws: a miss falls through to the next resolver
33
+ * layer (the keychain).
34
+ */
35
+ export declare function requestFromBroker({ account, service, }: BrokerRequestOptions): Promise<string | undefined>;
@@ -0,0 +1,72 @@
1
+ "use strict";
2
+ /* Socket Lib - Built with rolldown */
3
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_runtime = require('../_virtual/_rolldown/runtime.js');
5
+ const require_paths_socket = require('../paths/socket.js');
6
+ let node_fs = require("node:fs");
7
+ let node_net = require("node:net");
8
+ node_net = require_runtime.__toESM(node_net);
9
+
10
+ //#region src/secrets/broker.ts
11
+ /**
12
+ * @file Proteus broker client. Asks the running proteus credential daemon for a
13
+ * secret over its local Unix socket (Windows named pipe later), so a
14
+ * biometric-gated read happens inside the daemon and the value is vended to
15
+ * this process in memory rather than sitting in an env var. This is the layer
16
+ * `ai/credentials.mts` documents as slotting between the env check and the
17
+ * keychain read in `secrets/find.ts` `resolve()`.
18
+ * The broker is OPTIONAL and self-gating: when the daemon isn't running (no
19
+ * socket file), `requestFromBroker` returns `undefined` immediately and the
20
+ * caller falls through to the keychain. It never throws — a broker miss is a
21
+ * fall-through, not an error. The daemon binary itself is built by socket-btm
22
+ * (`packages/proteus-builder`); download-and-start is a later layer, so today
23
+ * this only talks to an already-running daemon.
24
+ */
25
+ const PROTEUS_SOCKET_NAME = "proteus";
26
+ const BROKER_TIMEOUT_MS = 1e3;
27
+ /**
28
+ * Ask the proteus daemon for a credential. Returns the value on success, or
29
+ * `undefined` when the daemon isn't running, doesn't hold it, or the biometric
30
+ * prompt was declined. Never throws: a miss falls through to the next resolver
31
+ * layer (the keychain).
32
+ */
33
+ async function requestFromBroker({ account, service }) {
34
+ const socketPath = require_paths_socket.getRuntimeSocketPath(PROTEUS_SOCKET_NAME);
35
+ if (!(0, node_fs.existsSync)(socketPath)) return;
36
+ return await new Promise((resolvePromise) => {
37
+ const conn = node_net.default.connect(socketPath);
38
+ let buffer = "";
39
+ let settled = false;
40
+ function settle(value) {
41
+ if (settled) return;
42
+ settled = true;
43
+ conn.destroy();
44
+ resolvePromise(value);
45
+ }
46
+ conn.setTimeout(BROKER_TIMEOUT_MS);
47
+ conn.on("timeout", () => settle(void 0));
48
+ conn.on("error", () => settle(void 0));
49
+ conn.on("connect", () => {
50
+ const payload = JSON.stringify({
51
+ account,
52
+ op: "get",
53
+ service
54
+ });
55
+ conn.write(`${payload}\n`);
56
+ });
57
+ conn.on("data", (chunk) => {
58
+ buffer += String(chunk);
59
+ const newlineAt = buffer.indexOf("\n");
60
+ if (newlineAt === -1) return;
61
+ try {
62
+ const parsed = JSON.parse(buffer.slice(0, newlineAt));
63
+ settle(parsed.ok && typeof parsed.value === "string" ? parsed.value : void 0);
64
+ } catch {
65
+ settle(void 0);
66
+ }
67
+ });
68
+ });
69
+ }
70
+
71
+ //#endregion
72
+ exports.requestFromBroker = requestFromBroker;
@@ -51,10 +51,11 @@ export interface ResolveResult {
51
51
  value: string;
52
52
  /**
53
53
  * Where the value came from: 'env' — `process.env[<account>]` had a non-empty
54
- * value. 'keychain' — env-var was empty/missing; the value was read from the
55
- * OS credential store under the matching account.
54
+ * value. 'broker' — the proteus daemon vended it after a biometric unlock.
55
+ * 'keychain' env-var was empty and no broker was running; the value was
56
+ * read from the OS credential store under the matching account.
56
57
  */
57
- source: 'env' | 'keychain';
58
+ source: 'broker' | 'env' | 'keychain';
58
59
  /**
59
60
  * Which account in `accounts` was the actual hit.
60
61
  */
@@ -74,6 +75,7 @@ export declare function readEnv(name: string): string | undefined;
74
75
  export declare function resolve(options: ResolveOptions): Promise<ResolveResult | undefined>;
75
76
  /**
76
77
  * Sync variant for non-async callers (hook initializers, schema validators that
77
- * run before any `await` machinery exists).
78
+ * run before any `await` machinery exists). Has no proteus broker tier — the
79
+ * broker socket round-trip is async — so this path is env → keychain only.
78
80
  */
79
81
  export declare function resolveSync(options: ResolveOptions): ResolveResult | undefined;
@@ -1,6 +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_secrets_broker = require('./broker.js');
4
5
  const require_secrets_keychain = require('./keychain.js');
5
6
 
6
7
  //#region src/secrets/find.ts
@@ -57,6 +58,18 @@ async function resolve(options) {
57
58
  };
58
59
  }
59
60
  if (allowEnvOnly) return;
61
+ for (let i = 0, { length } = accounts; i < length; i += 1) {
62
+ const account = accounts[i];
63
+ const fromBroker = await require_secrets_broker.requestFromBroker({
64
+ account,
65
+ service
66
+ });
67
+ if (fromBroker) return {
68
+ value: fromBroker,
69
+ source: "broker",
70
+ account
71
+ };
72
+ }
60
73
  for (let i = 0, { length } = accounts; i < length; i += 1) {
61
74
  const account = accounts[i];
62
75
  const fromKeychain = await require_secrets_keychain.readSecret({
@@ -72,7 +85,8 @@ async function resolve(options) {
72
85
  }
73
86
  /**
74
87
  * Sync variant for non-async callers (hook initializers, schema validators that
75
- * run before any `await` machinery exists).
88
+ * run before any `await` machinery exists). Has no proteus broker tier — the
89
+ * broker socket round-trip is async — so this path is env → keychain only.
76
90
  */
77
91
  function resolveSync(options) {
78
92
  const { accounts, allowEnvOnly, service } = {
@@ -3,8 +3,8 @@
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_runtime = require('../_virtual/_rolldown/runtime.js');
5
5
  const require_primordials_object = require('../primordials/object.js');
6
- const require_env_home = require('../env/home.js');
7
6
  const require_primordials_string = require('../primordials/string.js');
7
+ const require_env_home = require('../env/home.js');
8
8
  const require_primordials_regexp = require('../primordials/regexp.js');
9
9
  let node_fs = require("node:fs");
10
10
  let node_process = require("node:process");
@@ -43,7 +43,7 @@ function getSmolUtil() {
43
43
  if (!smolUtilProbed) {
44
44
  smolUtilProbed = true;
45
45
  /* c8 ignore start - smol Node binary only. */
46
- if (require_node_module.isNodeBuiltin("node:smol-util")) smolUtilCache = require("node:smol-util");
46
+ if (require_node_module.isNodeBuiltin("node:smol-util")) smolUtilCache = require_node_module.requireBuiltin("node:smol-util");
47
47
  }
48
48
  return smolUtilCache;
49
49
  }
package/dist/smol/http.js CHANGED
@@ -28,7 +28,7 @@ function getSmolHttp() {
28
28
  if (!smolHttpProbed) {
29
29
  smolHttpProbed = true;
30
30
  /* c8 ignore start - smol Node binary only. */
31
- if (require_node_module.isNodeBuiltin("node:smol-http")) smolHttpBinding = require("node:smol-http");
31
+ if (require_node_module.isNodeBuiltin("node:smol-http")) smolHttpBinding = require_node_module.requireBuiltin("node:smol-http");
32
32
  }
33
33
  return smolHttpBinding;
34
34
  }
@@ -26,7 +26,7 @@ function getSmolHttps() {
26
26
  if (!smolHttpsProbed) {
27
27
  smolHttpsProbed = true;
28
28
  /* c8 ignore start - smol Node binary only. */
29
- if (require_node_module.isNodeBuiltin("node:smol-https")) smolHttps = require("node:smol-https");
29
+ if (require_node_module.isNodeBuiltin("node:smol-https")) smolHttps = require_node_module.requireBuiltin("node:smol-https");
30
30
  }
31
31
  return smolHttps;
32
32
  }
@@ -28,7 +28,7 @@ function getSmolManifest() {
28
28
  if (!smolManifestProbed) {
29
29
  smolManifestProbed = true;
30
30
  /* c8 ignore start - smol Node binary only. */
31
- if (require_node_module.isNodeBuiltin("node:smol-manifest")) cachedSmolManifest = require("node:smol-manifest");
31
+ if (require_node_module.isNodeBuiltin("node:smol-manifest")) cachedSmolManifest = require_node_module.requireBuiltin("node:smol-manifest");
32
32
  }
33
33
  return cachedSmolManifest;
34
34
  }
package/dist/smol/path.js CHANGED
@@ -28,7 +28,7 @@ function getSmolPath() {
28
28
  if (!smolPathProbed) {
29
29
  smolPathProbed = true;
30
30
  /* c8 ignore start - smol Node binary only. */
31
- if (require_node_module.isNodeBuiltin("node:smol-path")) smolPathCache = require("node:smol-path");
31
+ if (require_node_module.isNodeBuiltin("node:smol-path")) smolPathCache = require_node_module.requireBuiltin("node:smol-path");
32
32
  }
33
33
  return smolPathCache;
34
34
  }
@@ -30,7 +30,7 @@ function getSmolPrimordial() {
30
30
  if (!smolPrimordialProbed) {
31
31
  smolPrimordialProbed = true;
32
32
  /* c8 ignore start - smol Node binary only. */
33
- if (require_node_module.isNodeBuiltin("node:smol-primordial")) smolPrimordial = require("node:smol-primordial");
33
+ if (require_node_module.isNodeBuiltin("node:smol-primordial")) smolPrimordial = require_node_module.requireBuiltin("node:smol-primordial");
34
34
  }
35
35
  return smolPrimordial;
36
36
  }
package/dist/smol/purl.js CHANGED
@@ -29,7 +29,7 @@ function getSmolPurl() {
29
29
  if (!smolPurlProbed) {
30
30
  smolPurlProbed = true;
31
31
  /* c8 ignore start - smol Node binary only. */
32
- if (require_node_module.isNodeBuiltin("node:smol-purl")) smolPurl = require("node:smol-purl");
32
+ if (require_node_module.isNodeBuiltin("node:smol-purl")) smolPurl = require_node_module.requireBuiltin("node:smol-purl");
33
33
  }
34
34
  return smolPurl;
35
35
  }
@@ -26,7 +26,7 @@ function getSmolVersions() {
26
26
  if (!smolVersionsProbed) {
27
27
  smolVersionsProbed = true;
28
28
  /* c8 ignore start - smol Node binary only. */
29
- if (require_node_module.isNodeBuiltin("node:smol-versions")) smolVersions = require("node:smol-versions");
29
+ if (require_node_module.isNodeBuiltin("node:smol-versions")) smolVersions = require_node_module.requireBuiltin("node:smol-versions");
30
30
  }
31
31
  return smolVersions;
32
32
  }
package/dist/smol/vfs.js CHANGED
@@ -41,7 +41,7 @@ function getSmolVfs() {
41
41
  if (!smolVfsProbed) {
42
42
  smolVfsProbed = true;
43
43
  /* c8 ignore start - smol Node binary only. */
44
- if (require_node_module.isNodeBuiltin("node:smol-vfs")) cachedSmolVfs = require("node:smol-vfs").getSmolVfs();
44
+ if (require_node_module.isNodeBuiltin("node:smol-vfs")) cachedSmolVfs = require_node_module.requireBuiltin("node:smol-vfs").getSmolVfs();
45
45
  }
46
46
  return cachedSmolVfs;
47
47
  }
@@ -4,6 +4,5 @@
4
4
  * locale / natural / semver comparison entrypoints.
5
5
  */
6
6
  import type * as fastSortType from '../external/fast-sort';
7
- import type * as semverType from '../external/semver';
7
+ export { getSemver } from '../versions/_internal';
8
8
  export declare function getFastSort(): typeof fastSortType;
9
- export declare function getSemver(): typeof semverType;
@@ -1,19 +1,15 @@
1
1
  "use strict";
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
+ const require_versions__internal = require('../versions/_internal.js');
4
5
 
5
6
  //#region src/sorts/_internal.ts
6
7
  let fastSort;
7
- let semver;
8
8
  function getFastSort() {
9
9
  if (fastSort === void 0) fastSort = /*@__PURE__*/ require("../external/fast-sort.js");
10
10
  return fastSort;
11
11
  }
12
- function getSemver() {
13
- if (semver === void 0) semver = /*@__PURE__*/ require("../external/semver.js");
14
- return semver;
15
- }
16
12
 
17
13
  //#endregion
18
14
  exports.getFastSort = getFastSort;
19
- exports.getSemver = getSemver;
15
+ exports.getSemver = require_versions__internal.getSemver;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_sorts__internal = require('./_internal.js');
4
+ const require_versions__internal = require('../versions/_internal.js');
5
5
 
6
6
  //#region src/sorts/semver.ts
7
7
  /**
@@ -20,7 +20,7 @@ const require_sorts__internal = require('./_internal.js');
20
20
  */
21
21
  function compareSemver(a, b) {
22
22
  /* c8 ignore start */
23
- const semver = require_sorts__internal.getSemver();
23
+ const semver = require_versions__internal.getSemver();
24
24
  const validA = semver.valid(a);
25
25
  /* c8 ignore stop */
26
26
  const validB = semver.valid(b);
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_primordials_math = require('../primordials/math.js');
5
4
  const require_primordials_object = require('../primordials/object.js');
5
+ const require_primordials_math = require('../primordials/math.js');
6
6
  const require_primordials_array = require('../primordials/array.js');
7
7
  const require_process_abort = require('../process/abort.js');
8
8
  const require_logger_symbols = require('../logger/symbols.js');
@@ -2,9 +2,9 @@
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_runtime = require('../_virtual/_rolldown/runtime.js');
5
- const require_primordials_math = require('../primordials/math.js');
6
5
  const require_primordials_object = require('../primordials/object.js');
7
6
  const require_primordials_string = require('../primordials/string.js');
7
+ const require_primordials_math = require('../primordials/math.js');
8
8
  const require_primordials_date = require('../primordials/date.js');
9
9
  const require_ansi_strip = require('../ansi/strip.js');
10
10
  const require_strings_format = require('../strings/format.js');
@@ -6,7 +6,6 @@ import checkboxRaw from '../external/@inquirer/checkbox';
6
6
  import confirmRaw from '../external/@inquirer/confirm';
7
7
  import inputRaw from '../external/@inquirer/input';
8
8
  import passwordRaw from '../external/@inquirer/password';
9
- import type { ColorValue } from '../colors/types';
10
9
  import type { Remap } from '../objects/types';
11
10
  import type { SpinnerInstance } from '../spinner/types';
12
11
  import type { ThemeName } from '../themes/themes';
@@ -94,13 +93,6 @@ export declare class SeparatorType {
94
93
  constructor(separator?: string);
95
94
  }
96
95
  export type Separator = SeparatorType;
97
- /**
98
- * Apply a color to text using yoctocolors. Handles both named colors and RGB
99
- * tuples.
100
- *
101
- * @private
102
- */
103
- export declare function applyColor(text: string, color: ColorValue): string;
104
96
  /**
105
97
  * Convert Socket theme to @inquirer theme format. Maps our theme colors to
106
98
  * inquirer's style functions. Handles theme names, Theme objects, and passes
@@ -5,10 +5,9 @@ const require_runtime = require('../_virtual/_rolldown/runtime.js');
5
5
  const require_process_abort = require('../process/abort.js');
6
6
  const require_themes_themes = require('../themes/themes.js');
7
7
  const require_themes_context = require('../themes/context.js');
8
+ const require_logger_colors = require('../logger/colors.js');
8
9
  const require_themes_resolve = require('../themes/resolve.js');
9
10
  const require_spinner_default = require('../spinner/default.js');
10
- let src_external_yoctocolors_cjs = require("../external/yoctocolors-cjs");
11
- src_external_yoctocolors_cjs = require_runtime.__toESM(src_external_yoctocolors_cjs);
12
11
  let src_external__inquirer_checkbox = require("../external/@inquirer/checkbox");
13
12
  src_external__inquirer_checkbox = require_runtime.__toESM(src_external__inquirer_checkbox);
14
13
  let src_external__inquirer_confirm = require("../external/@inquirer/confirm");
@@ -34,17 +33,6 @@ const selectModule = src_external__inquirer_select;
34
33
  const selectRaw = selectModule.default;
35
34
  const ActualSeparator = selectModule.Separator;
36
35
  /**
37
- * Apply a color to text using yoctocolors. Handles both named colors and RGB
38
- * tuples.
39
- *
40
- * @private
41
- */
42
- function applyColor(text, color) {
43
- if (typeof color === "string") return src_external_yoctocolors_cjs.default[color](text);
44
- const { 0: r, 1: g, 2: b } = color;
45
- return `\u001B[38;2;${r};${g};${b}m${text}\u001B[39m`;
46
- }
47
- /**
48
36
  * Convert Socket theme to @inquirer theme format. Maps our theme colors to
49
37
  * inquirer's style functions. Handles theme names, Theme objects, and passes
50
38
  * through @inquirer themes.
@@ -75,18 +63,18 @@ function createInquirerTheme(theme) {
75
63
  const primaryColor = socketTheme.colors.primary;
76
64
  return {
77
65
  style: {
78
- message: (text) => applyColor(text, promptColor),
79
- answer: (text) => applyColor(text, primaryColor),
80
- help: (text) => applyColor(text, textDimColor),
81
- description: (text) => applyColor(text, textDimColor),
82
- disabled: (text) => applyColor(text, textDimColor),
83
- error: (text) => applyColor(text, errorColor),
84
- highlight: (text) => applyColor(text, primaryColor)
66
+ message: (text) => require_logger_colors.applyColor(text, promptColor),
67
+ answer: (text) => require_logger_colors.applyColor(text, primaryColor),
68
+ help: (text) => require_logger_colors.applyColor(text, textDimColor),
69
+ description: (text) => require_logger_colors.applyColor(text, textDimColor),
70
+ disabled: (text) => require_logger_colors.applyColor(text, textDimColor),
71
+ error: (text) => require_logger_colors.applyColor(text, errorColor),
72
+ highlight: (text) => require_logger_colors.applyColor(text, primaryColor)
85
73
  },
86
74
  icon: {
87
- checked: applyColor("✓", successColor),
75
+ checked: require_logger_colors.applyColor("✓", successColor),
88
76
  unchecked: " ",
89
- cursor: applyColor("❯", primaryColor)
77
+ cursor: require_logger_colors.applyColor("❯", primaryColor)
90
78
  }
91
79
  };
92
80
  }
@@ -246,7 +234,6 @@ const select = wrapPrompt(selectRaw);
246
234
 
247
235
  //#endregion
248
236
  exports.Separator = ActualSeparator;
249
- exports.applyColor = applyColor;
250
237
  exports.checkbox = checkbox;
251
238
  exports.confirm = confirm;
252
239
  exports.createInquirerTheme = createInquirerTheme;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_primordials_math = require('../primordials/math.js');
5
4
  const require_primordials_string = require('../primordials/string.js');
5
+ const require_primordials_math = require('../primordials/math.js');
6
6
  const require_ansi_strip = require('../ansi/strip.js');
7
7
 
8
8
  //#region src/strings/format.ts
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
- const require_primordials_math = require('../primordials/math.js');
5
4
  const require_primordials_string = require('../primordials/string.js');
5
+ const require_primordials_math = require('../primordials/math.js');
6
6
 
7
7
  //#region src/strings/search.ts
8
8
  /**
@@ -4,7 +4,7 @@
4
4
  */
5
5
  import type { Theme } from './types';
6
6
  import type { ThemeName } from './themes';
7
- import type * as AsyncHooks from 'node:async_hooks';
7
+ import { getNodeAsyncHooks } from '../node/async-hooks';
8
8
  /**
9
9
  * Theme change event listener signature.
10
10
  */
@@ -16,11 +16,13 @@ export type ThemeChangeListener = (theme: Theme) => void;
16
16
  */
17
17
  export declare function emitThemeChange(theme: Theme): void;
18
18
  /**
19
- * Lazily load the async_hooks module to avoid Webpack errors.
19
+ * Lazily load the async_hooks module. Aliases the canonical `node/async-hooks`
20
+ * accessor (single owner of the bundler-safe require); kept as an export so
21
+ * this module's surface is unchanged.
20
22
  *
21
23
  * @private
22
24
  */
23
- export declare function getAsyncHooks(): typeof AsyncHooks;
25
+ export declare const getAsyncHooks: typeof getNodeAsyncHooks;
24
26
  /**
25
27
  * Get the active theme from context.
26
28
  *
@@ -1,11 +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_node_async_hooks = require('../node/async-hooks.js');
4
5
  const require_primordials_map_set = require('../primordials/map-set.js');
5
6
  const require_themes_themes = require('./themes.js');
6
7
 
7
8
  //#region src/themes/context.ts
8
- let asyncHooks;
9
9
  /**
10
10
  * Emit theme change event to listeners.
11
11
  *
@@ -15,14 +15,13 @@ function emitThemeChange(theme) {
15
15
  for (const listener of listeners) listener(theme);
16
16
  }
17
17
  /**
18
- * Lazily load the async_hooks module to avoid Webpack errors.
18
+ * Lazily load the async_hooks module. Aliases the canonical `node/async-hooks`
19
+ * accessor (single owner of the bundler-safe require); kept as an export so
20
+ * this module's surface is unchanged.
19
21
  *
20
22
  * @private
21
23
  */
22
- function getAsyncHooks() {
23
- if (asyncHooks === void 0) asyncHooks = /*@__PURE__*/ require("node:async_hooks");
24
- return asyncHooks;
25
- }
24
+ const getAsyncHooks = require_node_async_hooks.getNodeAsyncHooks;
26
25
  /**
27
26
  * AsyncLocalStorage for theme context isolation.
28
27
  */