@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.
Files changed (335) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/README.md +8 -9
  3. package/dist/abort/signal.d.ts +1 -1
  4. package/dist/abort/signal.js +1 -1
  5. package/dist/ai/agent-context.d.mts +1 -1
  6. package/dist/ai/agent-context.js +3 -2
  7. package/dist/ai/backends.d.mts +3 -3
  8. package/dist/ai/backends.js +2 -2
  9. package/dist/ai/billing-context.d.mts +74 -0
  10. package/dist/ai/billing-context.js +129 -0
  11. package/dist/ai/credentials.d.mts +39 -5
  12. package/dist/ai/credentials.js +61 -6
  13. package/dist/ai/discover.d.mts +4 -0
  14. package/dist/ai/discover.js +4 -0
  15. package/dist/ai/exec.d.mts +1 -1
  16. package/dist/ai/exec.js +1 -1
  17. package/dist/ai/http.d.mts +8 -8
  18. package/dist/ai/http.js +6 -6
  19. package/dist/ai/profiles.d.mts +9 -10
  20. package/dist/ai/profiles.js +0 -5
  21. package/dist/ai/role.d.mts +58 -0
  22. package/dist/ai/role.js +96 -0
  23. package/dist/ai/route-heuristic.d.mts +177 -0
  24. package/dist/ai/route-heuristic.js +194 -0
  25. package/dist/ai/route.d.mts +10 -9
  26. package/dist/ai/route.js +14 -13
  27. package/dist/ai/spawn.d.mts +2 -1
  28. package/dist/ai/spawn.js +25 -2
  29. package/dist/ai/subagent-status.d.mts +2 -0
  30. package/dist/ai/subagent-status.js +2 -0
  31. package/dist/ai/tier.d.mts +1 -1
  32. package/dist/ai/types.d.mts +9 -2
  33. package/dist/ai/worktree.d.mts +1 -1
  34. package/dist/ai/worktree.js +3 -2
  35. package/dist/argv/parse.d.ts +2 -0
  36. package/dist/argv/parse.js +2 -0
  37. package/dist/bin/_internal.d.ts +1 -1
  38. package/dist/bin/_internal.js +1 -1
  39. package/dist/bin/prim.cjs +446 -300
  40. package/dist/bin/shadow.js +2 -1
  41. package/dist/bin/which.d.ts +28 -3
  42. package/dist/bin/which.js +45 -3
  43. package/dist/cacache/_internal.d.ts +10 -2
  44. package/dist/cacache/_internal.js +6 -10
  45. package/dist/cache/ttl/_internal.d.ts +33 -0
  46. package/dist/cache/ttl/_internal.js +68 -0
  47. package/dist/cache/ttl/browser.d.ts +56 -0
  48. package/dist/cache/ttl/browser.js +257 -0
  49. package/dist/cache/ttl/store.js +10 -33
  50. package/dist/cache/ttl/types.d.ts +46 -3
  51. package/dist/checks/primordials-defaults.d.ts +5 -5
  52. package/dist/checks/primordials-defaults.js +5 -5
  53. package/dist/checks/primordials.d.ts +1 -1
  54. package/dist/checks/primordials.js +25 -17
  55. package/dist/cli/check-primordials.d.ts +6 -1
  56. package/dist/cli/check-primordials.js +14 -5
  57. package/dist/cli/check.js +1 -1
  58. package/dist/cli/socket-lib.d.ts +1 -1
  59. package/dist/cli/socket-lib.js +3 -3
  60. package/dist/colors/socket-palette.d.ts +1 -1
  61. package/dist/compression/brotli.d.ts +6 -2
  62. package/dist/compression/brotli.js +4 -0
  63. package/dist/compression/gzip.d.ts +6 -2
  64. package/dist/compression/gzip.js +6 -1
  65. package/dist/config/layers.d.ts +4 -4
  66. package/dist/config/layers.js +4 -4
  67. package/dist/constants/agents.d.ts +3 -0
  68. package/dist/constants/agents.js +3 -0
  69. package/dist/constants/node.d.ts +14 -0
  70. package/dist/constants/node.js +14 -0
  71. package/dist/constants/package-default-node-range.js +1 -5
  72. package/dist/constants/packages.d.ts +5 -0
  73. package/dist/constants/packages.js +5 -0
  74. package/dist/constants/platform.d.ts +1 -1
  75. package/dist/constants/platform.js +1 -1
  76. package/dist/constants/socket.js +1 -1
  77. package/dist/constants/typescript.d.ts +5 -0
  78. package/dist/constants/typescript.js +5 -0
  79. package/dist/debug/_internal.d.ts +22 -7
  80. package/dist/debug/_internal.js +33 -15
  81. package/dist/debug/namespace.js +11 -8
  82. package/dist/debug/output.d.ts +12 -1
  83. package/dist/debug/output.js +33 -16
  84. package/dist/dlx/binary-resolution.js +7 -4
  85. package/dist/eco/npm/npm/parse-lockfile.js +2 -1
  86. package/dist/eco/npm/vlt/exec.d.ts +1 -1
  87. package/dist/eco/npm/vlt/exec.js +1 -1
  88. package/dist/env/agents.d.ts +6 -0
  89. package/dist/env/agents.js +29 -0
  90. package/dist/env/flags.d.ts +12 -0
  91. package/dist/env/flags.js +23 -0
  92. package/dist/env/github-status.js +2 -2
  93. package/dist/env/providers.d.ts +6 -0
  94. package/dist/env/providers.js +23 -0
  95. package/dist/env/proxy.js +1 -1
  96. package/dist/env/rewire.d.ts +32 -0
  97. package/dist/env/rewire.js +55 -23
  98. package/dist/env/runtimes.d.ts +9 -0
  99. package/dist/env/runtimes.js +53 -0
  100. package/dist/env/socket-cli.d.ts +5 -2
  101. package/dist/env/socket-cli.js +6 -3
  102. package/dist/errors/predicates.d.ts +3 -2
  103. package/dist/errors/predicates.js +5 -3
  104. package/dist/errors/stack.js +2 -1
  105. package/dist/events/exit/_internal.d.ts +1 -23
  106. package/dist/external/@npmcli/package-json.js +179 -88
  107. package/dist/external/@npmcli/promise-spawn.js +2 -2
  108. package/dist/external/@sinclair/typebox/value.js +5 -4
  109. package/dist/external/@socketregistry/yocto-spinner.js +3 -3
  110. package/dist/external/adm-zip.d.ts +82 -0
  111. package/dist/external/adm-zip.js +2 -2
  112. package/dist/external/cacache.d.ts +87 -0
  113. package/dist/external/debug.d.ts +22 -0
  114. package/dist/external/debug.js +11 -4
  115. package/dist/external/del.d.ts +1 -0
  116. package/dist/external/external-pack.d.ts +12 -0
  117. package/dist/external/external-pack.js +41 -34
  118. package/dist/external/fast-glob.d.ts +8 -0
  119. package/dist/external/fast-sort.d.ts +1 -0
  120. package/dist/external/get-east-asian-width.d.ts +5 -0
  121. package/dist/external/get-east-asian-width.js +8 -1
  122. package/dist/external/has-flag.d.ts +1 -0
  123. package/dist/external/inquirer-pack.d.ts +18 -0
  124. package/dist/external/libnpmexec.d.ts +35 -0
  125. package/dist/external/libnpmpack.d.ts +1 -0
  126. package/dist/external/make-fetch-happen.d.ts +13 -0
  127. package/dist/external/normalize-package-data.d.ts +4 -0
  128. package/dist/external/npm-core.d.ts +14 -0
  129. package/dist/external/npm-pack.d.ts +24 -0
  130. package/dist/external/npm-pack.js +1551 -1867
  131. package/dist/external/npm-package-arg.d.ts +4 -0
  132. package/dist/external/p-map.js +8 -1
  133. package/dist/external/pacote.d.ts +15 -0
  134. package/dist/external/pico-pack.d.ts +16 -0
  135. package/dist/external/pico-pack.js +38 -23
  136. package/dist/external/picomatch.d.ts +96 -0
  137. package/dist/external/pony-cause.d.ts +14 -0
  138. package/dist/external/semver.d.ts +60 -0
  139. package/dist/external/semver.js +1459 -4
  140. package/dist/external/shell-quote.d.ts +51 -0
  141. package/dist/external/shell-quote.js +55 -15
  142. package/dist/external/signal-exit.d.ts +1 -0
  143. package/dist/external/spdx-correct.d.ts +4 -0
  144. package/dist/external/spdx-expression-parse.d.ts +4 -0
  145. package/dist/external/spdx-pack.d.ts +10 -0
  146. package/dist/external/std-env.d.ts +284 -0
  147. package/dist/external/std-env.js +323 -0
  148. package/dist/external/streaming-iterables.d.ts +11 -0
  149. package/dist/external/supports-color.d.ts +1 -0
  150. package/dist/external/tar-fs.d.ts +31 -0
  151. package/dist/external/validate-npm-package-name.d.ts +4 -0
  152. package/dist/external/which.d.ts +25 -0
  153. package/dist/external/which.js +2 -2
  154. package/dist/external/yargs-parser.d.ts +2 -0
  155. package/dist/external/yargs-parser.js +11 -3
  156. package/dist/external/yoctocolors-cjs.d.ts +51 -0
  157. package/dist/external-tools/bazel/asset-names.d.ts +1 -1
  158. package/dist/external-tools/bazel/from-download.d.ts +1 -1
  159. package/dist/external-tools/bazel/resolve.d.ts +3 -0
  160. package/dist/external-tools/bazel/resolve.js +3 -0
  161. package/dist/external-tools/cdxgen/asset-names.d.ts +5 -5
  162. package/dist/external-tools/cdxgen/asset-names.js +3 -3
  163. package/dist/external-tools/cdxgen/from-download.d.ts +2 -2
  164. package/dist/external-tools/cdxgen/from-download.js +1 -1
  165. package/dist/external-tools/cdxgen/resolve.d.ts +4 -1
  166. package/dist/external-tools/cdxgen/resolve.js +4 -1
  167. package/dist/external-tools/cdxgen/types.d.ts +1 -1
  168. package/dist/external-tools/from-download.d.ts +2 -2
  169. package/dist/external-tools/from-download.js +1 -1
  170. package/dist/external-tools/janus/asset-names.d.ts +4 -1
  171. package/dist/external-tools/janus/asset-names.js +3 -0
  172. package/dist/external-tools/janus/from-download.d.ts +3 -3
  173. package/dist/external-tools/janus/from-download.js +2 -2
  174. package/dist/external-tools/janus/resolve.d.ts +3 -0
  175. package/dist/external-tools/janus/resolve.js +3 -0
  176. package/dist/external-tools/jre/asset-names.d.ts +3 -1
  177. package/dist/external-tools/jre/asset-names.js +2 -0
  178. package/dist/external-tools/jre/from-download.d.ts +1 -1
  179. package/dist/external-tools/manifest.d.ts +5 -3
  180. package/dist/external-tools/manifest.js +4 -2
  181. package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
  182. package/dist/external-tools/opengrep/resolve.d.ts +3 -0
  183. package/dist/external-tools/opengrep/resolve.js +3 -0
  184. package/dist/external-tools/python/asset-names.d.ts +3 -1
  185. package/dist/external-tools/python/asset-names.js +7 -3
  186. package/dist/external-tools/python/pin.js +3 -1
  187. package/dist/external-tools/python/resolve.d.ts +3 -0
  188. package/dist/external-tools/python/resolve.js +3 -0
  189. package/dist/external-tools/sbt/resolve.d.ts +3 -0
  190. package/dist/external-tools/sbt/resolve.js +3 -0
  191. package/dist/external-tools/skillspector/from-uv.d.ts +1 -1
  192. package/dist/external-tools/synp/resolve.d.ts +3 -0
  193. package/dist/external-tools/synp/resolve.js +3 -0
  194. package/dist/external-tools/trivy/asset-names.d.ts +1 -1
  195. package/dist/external-tools/trivy/resolve.d.ts +3 -0
  196. package/dist/external-tools/trivy/resolve.js +3 -0
  197. package/dist/external-tools/trufflehog/asset-names.d.ts +4 -1
  198. package/dist/external-tools/trufflehog/asset-names.js +3 -0
  199. package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
  200. package/dist/external-tools/trufflehog/resolve.d.ts +3 -0
  201. package/dist/external-tools/trufflehog/resolve.js +3 -0
  202. package/dist/external-tools/uv/asset-names.d.ts +1 -1
  203. package/dist/external-tools/uv/resolve.d.ts +3 -0
  204. package/dist/external-tools/uv/resolve.js +3 -0
  205. package/dist/fleet/repo-config.d.ts +8 -6
  206. package/dist/fleet/repo-config.js +8 -6
  207. package/dist/fs/_internal.d.ts +1 -1
  208. package/dist/fs/_internal.js +1 -1
  209. package/dist/fs/access.d.ts +2 -0
  210. package/dist/fs/access.js +2 -0
  211. package/dist/fs/allowed-dirs-cache.js +5 -3
  212. package/dist/fs/find.js +1 -2
  213. package/dist/fs/inspect.d.ts +2 -2
  214. package/dist/fs/read-file.js +3 -4
  215. package/dist/fs/safe.js +1 -1
  216. package/dist/git/_internal.js +5 -1
  217. package/dist/github/commit.d.ts +92 -0
  218. package/dist/github/commit.js +113 -0
  219. package/dist/github/ghsa.js +1 -1
  220. package/dist/github/refs-graphql.js +1 -1
  221. package/dist/github/request.js +1 -1
  222. package/dist/github/token.d.ts +5 -2
  223. package/dist/github/token.js +6 -4
  224. package/dist/github/workflow-runs.d.ts +107 -0
  225. package/dist/github/workflow-runs.js +98 -0
  226. package/dist/http-request/_internal.d.ts +1 -1
  227. package/dist/http-request/browser.d.ts +6 -0
  228. package/dist/http-request/browser.js +3 -2
  229. package/dist/http-request/download.js +2 -0
  230. package/dist/http-request/headers.d.ts +1 -1
  231. package/dist/http-request/headers.js +1 -1
  232. package/dist/http-request/request-attempt.js +6 -3
  233. package/dist/http-request/request-types.d.ts +10 -1
  234. package/dist/http-request/request.js +2 -2
  235. package/dist/http-request/user-agent.d.ts +23 -2
  236. package/dist/http-request/user-agent.js +48 -6
  237. package/dist/integrity.d.ts +3 -1
  238. package/dist/integrity.js +3 -1
  239. package/dist/json/format.js +4 -1
  240. package/dist/logger/_internal.d.ts +13 -15
  241. package/dist/logger/_internal.js +21 -21
  242. package/dist/logger/colors.d.ts +9 -3
  243. package/dist/logger/colors.js +6 -13
  244. package/dist/logger/console-methods.js +2 -2
  245. package/dist/logger/console.d.ts +1 -0
  246. package/dist/logger/console.js +9 -9
  247. package/dist/logger/node.js +2 -1
  248. package/dist/native-messaging/install.js +1 -1
  249. package/dist/native-messaging/rate-limit.d.ts +4 -1
  250. package/dist/native-messaging/rate-limit.js +4 -1
  251. package/dist/node/events.d.ts +3 -0
  252. package/dist/node/events.js +3 -0
  253. package/dist/node/fs.d.ts +1 -1
  254. package/dist/node/timers-promises.d.ts +3 -0
  255. package/dist/node/timers-promises.js +3 -0
  256. package/dist/node/url.d.ts +3 -0
  257. package/dist/node/url.js +3 -0
  258. package/dist/npm/meta-cache.d.ts +183 -0
  259. package/dist/npm/meta-cache.js +318 -0
  260. package/dist/npm/meta-slice.d.ts +27 -0
  261. package/dist/npm/meta-slice.js +68 -0
  262. package/dist/npm/meta-types.d.ts +282 -0
  263. package/dist/npm/meta-types.js +2 -0
  264. package/dist/npm/meta.d.ts +125 -0
  265. package/dist/npm/meta.js +347 -0
  266. package/dist/npm/registry.d.ts +212 -0
  267. package/dist/npm/registry.js +284 -0
  268. package/dist/objects/getters.d.ts +1 -1
  269. package/dist/objects/getters.js +1 -1
  270. package/dist/packages/manifest.js +6 -7
  271. package/dist/packages/metadata-extensions.js +2 -4
  272. package/dist/packages/provenance.d.ts +8 -0
  273. package/dist/packages/provenance.js +8 -0
  274. package/dist/packages/tarball.js +1 -2
  275. package/dist/packages/validation.d.ts +0 -10
  276. package/dist/packages/validation.js +0 -14
  277. package/dist/paths/exts.d.ts +30 -0
  278. package/dist/paths/exts.js +30 -0
  279. package/dist/paths/filenames.d.ts +6 -0
  280. package/dist/paths/filenames.js +6 -0
  281. package/dist/paths/globs.d.ts +6 -0
  282. package/dist/paths/globs.js +6 -0
  283. package/dist/paths/resolve.js +19 -14
  284. package/dist/paths/socket.d.ts +8 -8
  285. package/dist/paths/socket.js +8 -8
  286. package/dist/perf/report.js +4 -2
  287. package/dist/pkg-ext/data.js +0 -2
  288. package/dist/primordials/globals.d.ts +1 -1
  289. package/dist/primordials/globals.js +1 -1
  290. package/dist/primordials/headers.d.ts +13 -1
  291. package/dist/primordials/headers.js +13 -1
  292. package/dist/primordials/process.d.ts +1 -1
  293. package/dist/primordials/process.js +1 -1
  294. package/dist/primordials/url.d.ts +18 -0
  295. package/dist/primordials/url.js +18 -0
  296. package/dist/process/spawn/child.js +3 -5
  297. package/dist/promises/_internal.d.ts +1 -1
  298. package/dist/promises/_internal.js +1 -2
  299. package/dist/promises/options.js +3 -3
  300. package/dist/releases/socket-btm-binary-naming.js +12 -1
  301. package/dist/secrets/_internal.d.ts +1 -1
  302. package/dist/secrets/_internal.js +1 -1
  303. package/dist/secrets/find.d.ts +2 -2
  304. package/dist/secrets/find.js +2 -2
  305. package/dist/secrets/keychain.d.ts +10 -1
  306. package/dist/secrets/keychain.js +10 -1
  307. package/dist/secrets/socket-api-token.d.ts +1 -1
  308. package/dist/secrets/socket-api-token.js +1 -1
  309. package/dist/secrets/types.d.ts +1 -1
  310. package/dist/smol/http.d.ts +2 -0
  311. package/dist/smol/http.js +2 -0
  312. package/dist/smol/https.d.ts +2 -0
  313. package/dist/smol/https.js +2 -0
  314. package/dist/sorts/_internal.d.ts +2 -3
  315. package/dist/sorts/_internal.js +1 -3
  316. package/dist/spinner/format.js +2 -4
  317. package/dist/stdio/footer.js +8 -7
  318. package/dist/stdio/prompts.d.ts +8 -15
  319. package/dist/stdio/prompts.js +18 -29
  320. package/dist/strings/predicates.d.ts +2 -2
  321. package/dist/strings/search.js +1 -1
  322. package/dist/strings/types.d.ts +4 -0
  323. package/dist/strings/width.d.ts +1 -0
  324. package/dist/strings/width.js +17 -8
  325. package/dist/themes/context.d.ts +13 -0
  326. package/dist/themes/context.js +23 -8
  327. package/dist/versions/_internal.d.ts +43 -13
  328. package/dist/versions/_internal.js +27 -15
  329. package/dist/versions/compare.d.ts +16 -10
  330. package/dist/versions/compare.js +36 -16
  331. package/dist/versions/parse.js +1 -1
  332. package/dist/versions/range.js +3 -2
  333. package/dist/words/pluralize.js +4 -1
  334. package/llms.txt +63 -750
  335. package/package.json +200 -35
@@ -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
- /* c8 ignore next - External semver call */
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 fleet-general naming for
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 fleet-general naming for
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`
@@ -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.9";
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 cached logger instance,
3
- * lazy `node:util` accessor, the `debugByNamespace` cache that
4
- * `namespace.getDebugJsInstance` fills, the lazy `pointingTriangle` glyph
5
- * used by every output function, and `customLog` (the `debug-js` log-writer
6
- * override). Co-located so the namespace / output / caller-info leaves don't
7
- * fragment ownership of this shared module state.
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
- export declare const logger: import("../logger/node").Logger;
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
@@ -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 cached logger instance,
17
- * lazy `node:util` accessor, the `debugByNamespace` cache that
18
- * `namespace.getDebugJsInstance` fills, the lazy `pointingTriangle` glyph
19
- * used by every output function, and `customLog` (the `debug-js` log-writer
20
- * override). Co-located so the namespace / output / caller-info leaves don't
21
- * fragment ownership of this shared module state.
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 inspectOpts = src_external_debug.default.inspectOpts ? {
38
- ...src_external_debug.default.inspectOpts,
39
- showHidden: src_external_debug.default.inspectOpts.showHidden === null ? void 0 : src_external_debug.default.inspectOpts.showHidden,
40
- depth: src_external_debug.default.inspectOpts.depth === null || typeof src_external_debug.default.inspectOpts.depth === "boolean" ? void 0 : src_external_debug.default.inspectOpts.depth
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;
@@ -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
- if (!require_env_debug.getDebug() && require_env_socket.getSocketDebug() && (namespace === "error" || namespace === "notice")) src_external_debug.default.enable(namespace);
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 = (0, src_external_debug.default)(namespace);
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 (const ns of split) if (require_primordials_string.StringPrototypeStartsWith(ns, "-")) skips.push(ns.slice(1));
76
- else names.push(ns);
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
  }
@@ -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;
@@ -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 require_runtime = require('../_virtual/_rolldown/runtime.js');
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
- require_primordials_reflect.ReflectApply(require_debug__internal.logger.info, require_debug__internal.logger, args);
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 || require_spinner_default.getDefaultSpinner();
59
+ const spinnerInstance = options.spinner || getSpinner();
60
60
  const wasSpinning = spinnerInstance?.isSpinning;
61
61
  spinnerInstance?.stop();
62
- require_primordials_reflect.ReflectApply(require_debug__internal.logger.info, require_debug__internal.logger, logArgs);
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 = src_external_debug.default.inspectOpts;
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 || require_spinner_default.getDefaultSpinner();
95
+ const spinnerInstance = options.spinner || getSpinner();
95
96
  const wasSpinning = spinnerInstance?.isSpinning;
96
97
  spinnerInstance?.stop();
97
- require_debug__internal.logger.info(`[DEBUG] ${callerName} ${pointingTriangle} object inspection:`);
98
- require_debug__internal.logger.dir(obj, inspectOpts);
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 || require_spinner_default.getDefaultSpinner();
122
+ const spinnerInstance = options.spinner || getSpinner();
121
123
  const wasSpinning = spinnerInstance?.isSpinning;
122
124
  spinnerInstance?.stop();
123
- require_primordials_reflect.ReflectApply(require_debug__internal.logger.info, require_debug__internal.logger, logArgs);
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 || require_spinner_default.getDefaultSpinner();
142
+ const spinnerInstance = options.spinner || getSpinner();
140
143
  const wasSpinning = spinnerInstance?.isSpinning;
141
144
  spinnerInstance?.stop();
142
- require_primordials_reflect.ReflectApply(require_debug__internal.logger.info, require_debug__internal.logger, logArgs);
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 (const candidate of candidates) if (candidate && binObj[candidate]) {
74
- binName = candidate;
75
- binPath = binObj[candidate];
76
- break;
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
- require_primordials_array.ArrayPrototypePush(packages, buildPackageRef(name, pkg));
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 fleet code that needs override support should branch around it (see
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
  */
@@ -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 fleet code that needs override support should branch around it (see
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],