@socketsecurity/lib 6.0.7 → 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 (323) hide show
  1. package/CHANGELOG.md +42 -0
  2. package/README.md +1 -1
  3. package/dist/ai/agent-context.d.mts +103 -0
  4. package/dist/ai/agent-context.js +157 -0
  5. package/dist/ai/backends.d.mts +83 -0
  6. package/dist/ai/backends.js +173 -0
  7. package/dist/ai/credentials.d.mts +49 -0
  8. package/dist/ai/credentials.js +82 -0
  9. package/dist/ai/discover.d.mts +4 -0
  10. package/dist/ai/discover.js +1 -1
  11. package/dist/ai/exec.d.mts +52 -0
  12. package/dist/ai/exec.js +92 -0
  13. package/dist/ai/http.d.mts +132 -0
  14. package/dist/ai/http.js +130 -0
  15. package/dist/ai/profiles.d.mts +41 -6
  16. package/dist/ai/profiles.js +52 -10
  17. package/dist/ai/route.d.mts +82 -0
  18. package/dist/ai/route.js +171 -0
  19. package/dist/ai/spawn.d.mts +42 -2
  20. package/dist/ai/spawn.js +146 -33
  21. package/dist/ai/subagent-status.d.mts +48 -0
  22. package/dist/ai/subagent-status.js +57 -0
  23. package/dist/ai/tier.d.mts +60 -0
  24. package/dist/ai/tier.js +53 -0
  25. package/dist/ai/types.d.mts +25 -2
  26. package/dist/ai/worktree.js +4 -0
  27. package/dist/archives/tar.js +1 -1
  28. package/dist/archives/zip.js +2 -2
  29. package/dist/argv/parse.d.ts +19 -2
  30. package/dist/argv/parse.js +1 -1
  31. package/dist/arrays/join.js +4 -0
  32. package/dist/bin/find.js +4 -4
  33. package/dist/bin/prim.cjs +23322 -18018
  34. package/dist/bin/resolve.js +2 -2
  35. package/dist/cache/ttl/store.js +2 -2
  36. package/dist/cli/check-primordials.d.ts +8 -3
  37. package/dist/cli/check-primordials.js +4 -4
  38. package/dist/compression/_internal.js +1 -1
  39. package/dist/compression/brotli.d.ts +1 -2
  40. package/dist/compression/brotli.js +5 -1
  41. package/dist/compression/gzip.js +5 -1
  42. package/dist/config/layers.d.ts +53 -0
  43. package/dist/config/layers.js +83 -0
  44. package/dist/constants/packages.d.ts +3 -0
  45. package/dist/constants/packages.js +2 -1
  46. package/dist/constants/socket.d.ts +2 -6
  47. package/dist/constants/socket.js +12 -14
  48. package/dist/cover/code.js +2 -2
  49. package/dist/crypto/hash.d.ts +4 -1
  50. package/dist/crypto/hash.js +4 -1
  51. package/dist/dlx/arborist.js +13 -3
  52. package/dist/dlx/binary-cache.js +1 -1
  53. package/dist/dlx/binary-resolution.js +1 -1
  54. package/dist/dlx/detect.d.ts +8 -0
  55. package/dist/dlx/firewall.d.ts +8 -0
  56. package/dist/dlx/lockfile.js +5 -2
  57. package/dist/dlx/manifest.js +1 -1
  58. package/dist/dlx/package.js +4 -0
  59. package/dist/eco/cargo/parse-lockfile.d.ts +1 -2
  60. package/dist/eco/cargo/parse-lockfile.js +3 -3
  61. package/dist/eco/manifest/detect-format.js +1 -1
  62. package/dist/eco/npm/npm/parse-lockfile.d.ts +3 -4
  63. package/dist/eco/npm/npm/parse-lockfile.js +2 -2
  64. package/dist/eco/npm/parse-package-json.d.ts +11 -0
  65. package/dist/eco/npm/parse-package-json.js +1 -1
  66. package/dist/eco/npm/pnpm/parse-lockfile.d.ts +5 -3
  67. package/dist/eco/npm/pnpm/parse-lockfile.js +3 -3
  68. package/dist/eco/npm/yarnpkg/yarn/exec.js +1 -1
  69. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.d.ts +1 -2
  70. package/dist/eco/npm/yarnpkg/yarn/parse-lockfile.js +2 -2
  71. package/dist/env/proxy.js +1 -1
  72. package/dist/env/rewire.d.ts +6 -3
  73. package/dist/env/rewire.js +7 -8
  74. package/dist/env/socket.d.ts +7 -0
  75. package/dist/env/socket.js +10 -0
  76. package/dist/env/xdg.d.ts +17 -0
  77. package/dist/env/xdg.js +21 -1
  78. package/dist/errors/predicates.js +1 -1
  79. package/dist/errors/stack.js +1 -2
  80. package/dist/external/@npmcli/package-json.js +3455 -4881
  81. package/dist/external/@npmcli/promise-spawn.js +3 -1
  82. package/dist/external/@yarnpkg/extensions.js +1 -1
  83. package/dist/external/external-pack.js +1 -1
  84. package/dist/external/npm-pack.js +29164 -31799
  85. package/dist/external/pico-pack.js +4 -2
  86. package/dist/external/tar-fs.js +63 -16
  87. package/dist/external/which.js +3 -1
  88. package/dist/external-tools/bazel/asset-names.d.ts +1 -1
  89. package/dist/external-tools/bazel/asset-names.js +5 -2
  90. package/dist/external-tools/bazel/from-download.d.ts +1 -1
  91. package/dist/external-tools/bazel/from-download.js +5 -2
  92. package/dist/external-tools/bazel/resolve-bazel-version.js +4 -0
  93. package/dist/external-tools/bazel/resolve.d.ts +3 -3
  94. package/dist/external-tools/bazel/resolve.js +16 -8
  95. package/dist/external-tools/cdxgen/asset-names.d.ts +1 -1
  96. package/dist/external-tools/cdxgen/asset-names.js +5 -2
  97. package/dist/external-tools/cdxgen/from-download.d.ts +1 -1
  98. package/dist/external-tools/cdxgen/from-download.js +7 -4
  99. package/dist/external-tools/cdxgen/resolve.d.ts +3 -3
  100. package/dist/external-tools/cdxgen/resolve.js +16 -8
  101. package/dist/external-tools/from-download.d.ts +2 -2
  102. package/dist/external-tools/from-download.js +11 -5
  103. package/dist/external-tools/from-pip-venv.d.ts +1 -1
  104. package/dist/external-tools/from-pip-venv.js +12 -5
  105. package/dist/external-tools/janus/asset-names.d.ts +1 -1
  106. package/dist/external-tools/janus/asset-names.js +5 -2
  107. package/dist/external-tools/janus/from-download.d.ts +1 -1
  108. package/dist/external-tools/janus/from-download.js +5 -2
  109. package/dist/external-tools/janus/resolve.d.ts +3 -3
  110. package/dist/external-tools/janus/resolve.js +16 -8
  111. package/dist/external-tools/jre/asset-names.d.ts +1 -1
  112. package/dist/external-tools/jre/asset-names.js +5 -2
  113. package/dist/external-tools/jre/detect-platform-arch.js +1 -1
  114. package/dist/external-tools/jre/from-download.d.ts +1 -1
  115. package/dist/external-tools/jre/from-download.js +7 -4
  116. package/dist/external-tools/jre/from-java-home.js +2 -2
  117. package/dist/external-tools/jre/from-vfs.js +2 -2
  118. package/dist/external-tools/jre/resolve.d.ts +3 -3
  119. package/dist/external-tools/jre/resolve.js +16 -8
  120. package/dist/external-tools/manifest.d.ts +18 -0
  121. package/dist/external-tools/manifest.js +2 -2
  122. package/dist/external-tools/opengrep/asset-names.d.ts +1 -1
  123. package/dist/external-tools/opengrep/asset-names.js +5 -2
  124. package/dist/external-tools/opengrep/from-download.d.ts +1 -1
  125. package/dist/external-tools/opengrep/from-download.js +5 -2
  126. package/dist/external-tools/opengrep/resolve.d.ts +3 -3
  127. package/dist/external-tools/opengrep/resolve.js +16 -8
  128. package/dist/external-tools/python/asset-names.d.ts +1 -1
  129. package/dist/external-tools/python/asset-names.js +11 -4
  130. package/dist/external-tools/python/dlx.d.ts +3 -3
  131. package/dist/external-tools/python/dlx.js +20 -9
  132. package/dist/external-tools/python/from-download.d.ts +1 -1
  133. package/dist/external-tools/python/from-download.js +12 -5
  134. package/dist/external-tools/python/pin.js +6 -3
  135. package/dist/external-tools/python/pip-install.js +6 -3
  136. package/dist/external-tools/python/resolve.d.ts +3 -3
  137. package/dist/external-tools/python/resolve.js +19 -11
  138. package/dist/external-tools/python/uv-install.d.ts +89 -0
  139. package/dist/external-tools/python/uv-install.js +165 -0
  140. package/dist/external-tools/sbt/asset-names.d.ts +1 -1
  141. package/dist/external-tools/sbt/asset-names.js +5 -2
  142. package/dist/external-tools/sbt/from-download.d.ts +1 -1
  143. package/dist/external-tools/sbt/from-download.js +5 -2
  144. package/dist/external-tools/sbt/resolve.d.ts +3 -3
  145. package/dist/external-tools/sbt/resolve.js +16 -8
  146. package/dist/external-tools/skillspector/from-dlx.d.ts +1 -1
  147. package/dist/external-tools/skillspector/from-dlx.js +10 -3
  148. package/dist/external-tools/skillspector/from-uv.d.ts +30 -0
  149. package/dist/external-tools/skillspector/from-uv.js +56 -0
  150. package/dist/external-tools/skillspector/resolve.d.ts +20 -5
  151. package/dist/external-tools/skillspector/resolve.js +27 -6
  152. package/dist/external-tools/skillspector/types.d.ts +3 -1
  153. package/dist/external-tools/synp/asset-names.d.ts +1 -1
  154. package/dist/external-tools/synp/asset-names.js +6 -2
  155. package/dist/external-tools/synp/from-download.d.ts +1 -1
  156. package/dist/external-tools/synp/from-download.js +5 -2
  157. package/dist/external-tools/synp/resolve.d.ts +3 -3
  158. package/dist/external-tools/synp/resolve.js +16 -8
  159. package/dist/external-tools/trivy/asset-names.d.ts +1 -1
  160. package/dist/external-tools/trivy/asset-names.js +5 -2
  161. package/dist/external-tools/trivy/from-download.d.ts +1 -1
  162. package/dist/external-tools/trivy/from-download.js +7 -4
  163. package/dist/external-tools/trivy/resolve.d.ts +3 -3
  164. package/dist/external-tools/trivy/resolve.js +16 -8
  165. package/dist/external-tools/trufflehog/asset-names.d.ts +1 -1
  166. package/dist/external-tools/trufflehog/asset-names.js +5 -2
  167. package/dist/external-tools/trufflehog/from-download.d.ts +1 -1
  168. package/dist/external-tools/trufflehog/from-download.js +7 -4
  169. package/dist/external-tools/trufflehog/resolve.d.ts +3 -3
  170. package/dist/external-tools/trufflehog/resolve.js +16 -8
  171. package/dist/external-tools/uv/asset-names.d.ts +36 -0
  172. package/dist/external-tools/uv/asset-names.js +73 -0
  173. package/dist/external-tools/uv/from-download.d.ts +17 -0
  174. package/dist/external-tools/uv/from-download.js +50 -0
  175. package/dist/external-tools/uv/from-path.d.ts +5 -0
  176. package/dist/external-tools/uv/from-path.js +22 -0
  177. package/dist/external-tools/uv/from-vfs.d.ts +7 -0
  178. package/dist/external-tools/uv/from-vfs.js +26 -0
  179. package/dist/external-tools/uv/resolve.d.ts +25 -0
  180. package/dist/external-tools/uv/resolve.js +61 -0
  181. package/dist/external-tools/uv/types.d.ts +24 -0
  182. package/dist/external-tools/uv/types.js +2 -0
  183. package/dist/fleet/repo-config.d.ts +53 -0
  184. package/dist/fleet/repo-config.js +79 -0
  185. package/dist/fs/allowed-dirs-cache.d.ts +27 -1
  186. package/dist/fs/allowed-dirs-cache.js +39 -6
  187. package/dist/fs/copy.d.ts +88 -0
  188. package/dist/fs/copy.js +89 -0
  189. package/dist/fs/find.js +1 -1
  190. package/dist/fs/read-json-cache.d.ts +7 -0
  191. package/dist/fs/resolve-module.js +6 -2
  192. package/dist/fs/safe.js +1 -1
  193. package/dist/git/_internal.js +3 -3
  194. package/dist/git/repo.js +2 -4
  195. package/dist/git/staged.js +8 -0
  196. package/dist/git/tracked.d.ts +84 -0
  197. package/dist/git/tracked.js +163 -0
  198. package/dist/git/unstaged.js +8 -0
  199. package/dist/github/refs-graphql.js +4 -0
  200. package/dist/github/refs-rest.js +4 -0
  201. package/dist/globs/_internal.js +1 -1
  202. package/dist/globs/match.js +9 -1
  203. package/dist/globs/matcher.js +5 -1
  204. package/dist/http-request/browser.js +7 -3
  205. package/dist/http-request/checksum-file.js +1 -1
  206. package/dist/http-request/{browser-fetch.d.ts → fetch/browser.d.ts} +2 -2
  207. package/dist/http-request/{browser-fetch.js → fetch/browser.js} +4 -4
  208. package/dist/http-request/headers.js +1 -1
  209. package/dist/http-request/request-attempt.js +2 -2
  210. package/dist/http-request/user-agent.js +1 -1
  211. package/dist/integrity.d.ts +124 -71
  212. package/dist/integrity.js +168 -78
  213. package/dist/json/edit.js +38 -30
  214. package/dist/json/format.js +1 -1
  215. package/dist/logger/colors.d.ts +1 -2
  216. package/dist/logger/colors.js +2 -2
  217. package/dist/logger/symbols-builder.js +7 -8
  218. package/dist/logger/symbols.js +8 -8
  219. package/dist/native-messaging/install.d.ts +1 -1
  220. package/dist/native-messaging/install.js +7 -4
  221. package/dist/native-messaging/rate-limit.d.ts +7 -0
  222. package/dist/native-messaging/rate-limit.js +4 -0
  223. package/dist/node/async-hooks.js +1 -1
  224. package/dist/node/child-process.js +1 -1
  225. package/dist/node/crypto.js +1 -1
  226. package/dist/node/events.js +1 -1
  227. package/dist/node/fs-promises.js +1 -1
  228. package/dist/node/fs.d.ts +22 -6
  229. package/dist/node/fs.js +16 -3
  230. package/dist/node/http.js +1 -1
  231. package/dist/node/https.js +1 -1
  232. package/dist/node/module.d.ts +73 -2
  233. package/dist/node/module.js +97 -12
  234. package/dist/node/os.d.ts +10 -2
  235. package/dist/node/os.js +11 -4
  236. package/dist/node/path.d.ts +11 -2
  237. package/dist/node/path.js +17 -4
  238. package/dist/node/timers-promises.js +1 -1
  239. package/dist/node/url.js +1 -1
  240. package/dist/node/util.js +1 -1
  241. package/dist/objects/getters.js +1 -1
  242. package/dist/objects/mutate.js +2 -2
  243. package/dist/packages/edit-class.d.ts +2 -3
  244. package/dist/packages/edit-class.js +41 -35
  245. package/dist/packages/exports.js +4 -4
  246. package/dist/packages/fetch.js +1 -1
  247. package/dist/packages/isolation.js +2 -2
  248. package/dist/packages/licenses.js +2 -2
  249. package/dist/packages/manifest.d.ts +29 -0
  250. package/dist/packages/manifest.js +40 -4
  251. package/dist/packages/normalize.js +2 -2
  252. package/dist/packages/provenance.js +3 -3
  253. package/dist/packages/specs.js +1 -1
  254. package/dist/packages/tarball.js +4 -2
  255. package/dist/packages/types.d.ts +1 -2
  256. package/dist/paths/_internal.d.ts +1 -7
  257. package/dist/paths/_internal.js +9 -15
  258. package/dist/paths/conversion.js +1 -1
  259. package/dist/paths/dirnames.d.ts +1 -0
  260. package/dist/paths/dirnames.js +2 -0
  261. package/dist/paths/normalize.js +1 -1
  262. package/dist/paths/predicates.js +2 -1
  263. package/dist/paths/resolve.js +14 -19
  264. package/dist/paths/rewire.d.ts +5 -0
  265. package/dist/paths/socket.d.ts +137 -123
  266. package/dist/paths/socket.js +172 -131
  267. package/dist/perf/metrics.js +1 -1
  268. package/dist/perf/report.js +1 -1
  269. package/dist/primordials/process.d.ts +88 -0
  270. package/dist/primordials/process.js +132 -0
  271. package/dist/primordials/uncurry.d.ts +1 -2
  272. package/dist/process/spawn/child.js +8 -2
  273. package/dist/process/spawn/errors.js +1 -1
  274. package/dist/releases/github-archives.js +1 -1
  275. package/dist/releases/github-listing.d.ts +1 -2
  276. package/dist/schema/types.d.ts +3 -4
  277. package/dist/schema/validate.js +1 -1
  278. package/dist/secrets/broker.d.ts +35 -0
  279. package/dist/secrets/broker.js +72 -0
  280. package/dist/secrets/find.d.ts +8 -6
  281. package/dist/secrets/find.js +25 -5
  282. package/dist/secrets/keychain.d.ts +1 -1
  283. package/dist/secrets/linux.js +32 -44
  284. package/dist/secrets/macos.d.ts +1 -2
  285. package/dist/secrets/macos.js +20 -29
  286. package/dist/secrets/rc.d.ts +2 -2
  287. package/dist/secrets/rc.js +21 -13
  288. package/dist/secrets/socket-api-token.js +8 -0
  289. package/dist/secrets/windows.js +27 -33
  290. package/dist/shell/parse.d.ts +32 -0
  291. package/dist/shell/parse.js +60 -0
  292. package/dist/smol/detect.js +1 -1
  293. package/dist/smol/http.js +1 -1
  294. package/dist/smol/https.js +1 -1
  295. package/dist/smol/manifest.js +1 -1
  296. package/dist/smol/path.js +1 -1
  297. package/dist/smol/primordial.js +1 -1
  298. package/dist/smol/purl.js +1 -1
  299. package/dist/smol/versions.js +1 -1
  300. package/dist/smol/vfs.js +1 -1
  301. package/dist/sorts/_internal.d.ts +1 -2
  302. package/dist/sorts/_internal.js +2 -6
  303. package/dist/sorts/semver.js +2 -2
  304. package/dist/spinner/create-spinner-class.js +2 -2
  305. package/dist/spinner/spinner-internals.d.ts +1 -1
  306. package/dist/spinner/spinner-internals.js +9 -5
  307. package/dist/spinner/spinner.d.ts +4 -0
  308. package/dist/spinner/spinner.js +1 -1
  309. package/dist/stdio/progress.js +6 -2
  310. package/dist/stdio/prompts.d.ts +2 -10
  311. package/dist/stdio/prompts.js +11 -24
  312. package/dist/strings/format.js +1 -1
  313. package/dist/strings/search.js +1 -1
  314. package/dist/temporal/instant.js +2 -2
  315. package/dist/themes/context.d.ts +5 -3
  316. package/dist/themes/context.js +5 -6
  317. package/dist/url/assert-safe.d.ts +29 -0
  318. package/dist/url/assert-safe.js +54 -0
  319. package/dist/url/predicates.d.ts +31 -1
  320. package/dist/url/predicates.js +42 -1
  321. package/dist/url/types.d.ts +4 -0
  322. package/llms.txt +750 -0
  323. package/package.json +253 -125
@@ -2,33 +2,36 @@
2
2
  /* Socket Lib - Built with rolldown */
3
3
  Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
4
4
  const require_node_os = require('../node/os.js');
5
+ const require_constants_platform = require('../constants/platform.js');
6
+ const require_env_home = require('../env/home.js');
7
+ const require_env_xdg = require('../env/xdg.js');
5
8
  const require_paths_normalize = require('./normalize.js');
6
9
  const require_node_path = require('../node/path.js');
7
10
  const require_env_socket = require('../env/socket.js');
8
- const require_constants_github = require('../constants/github.js');
9
11
  const require_constants_socket = require('../constants/socket.js');
10
- const require_env_home = require('../env/home.js');
11
12
  const require_env_windows = require('../env/windows.js');
12
13
  const require_paths_dirnames = require('./dirnames.js');
13
14
  const require_paths_rewire = require('./rewire.js');
14
15
 
15
16
  //#region src/paths/socket.ts
16
17
  /**
17
- * @file Path utilities for Socket ecosystem directories. Provides
18
- * platform-aware path resolution for Socket tools' shared directory
19
- * structure. Directory Structure: ~/.socket/ ├── _cacache/ #
20
- * Content-addressable cache for npm packages ├── _dlx/ # DLX installations
21
- * (content-addressed by hash) ├── <hash>/ # npm package installs
22
- * (dlx-package) └── <hash>/ # binary downloads (dlx-binary) ├── _socket/ #
23
- * Socket CLI app directory ├── _registry/ # Socket Registry app directory └──
24
- * _sfw/ # Socket Firewall app directory.
18
+ * @file Path utilities for Socket ecosystem directories. Platform-aware
19
+ * resolution for the shared ~/.socket/ layout. The `_`-prefixed entries are
20
+ * Socket-managed DIRS (not apps): `_cacache` content-addressable cache;
21
+ * `_dlx/<hash>/` name+version binary store (node, jre, python, sfw, …);
22
+ * `_state/<app>/` version-LESS persistent app state (daemon socket + lock +
23
+ * OAuth refresh; mirrors pnpm `state-dir` / XDG_STATE_HOME), with
24
+ * `_state/<app>/run/` for a daemon's socket/lock/pid; `_wheelhouse`
25
+ * cross-fleet shared bin. Generic per-app dirs (`getSocketAppDir('<name>')`)
26
+ * nest under the same `_`-prefix.
25
27
  */
26
28
  /**
27
29
  * Get the OS home directory. Can be overridden in tests using
28
30
  * setPath('homedir', ...) from paths/rewire.
29
31
  */
30
32
  function getOsHomeDir() {
31
- return require_paths_rewire.getPathValue("homedir", () => require_node_os.getNodeOs().homedir());
33
+ const os = require_node_os.getNodeOs();
34
+ return require_paths_rewire.getPathValue("homedir", () => os.homedir());
32
35
  }
33
36
  /**
34
37
  * Get the OS temporary directory. Can be overridden in tests using
@@ -39,7 +42,35 @@ function getOsHomeDir() {
39
42
  * setPath('tmpdir', ...) from paths/rewire.
40
43
  */
41
44
  function getOsTmpDir() {
42
- return require_paths_rewire.getPathValue("tmpdir", () => require_node_os.getNodeOs().tmpdir());
45
+ const os = require_node_os.getNodeOs();
46
+ return require_paths_rewire.getPathValue("tmpdir", () => os.tmpdir());
47
+ }
48
+ /**
49
+ * Resolve the runtime socket path for a local daemon named `name`. Distinct
50
+ * from getSocketAppRuntimeDir (the persistent ~/.socket/_state/<app>/run/
51
+ * home): the SOCKET endpoint itself belongs in the ephemeral, owner-only XDG
52
+ * runtime dir — correctly permissioned and auto-cleaned on logout — while the
53
+ * downloaded daemon binary + durable token cache live under ~/.socket. The
54
+ * daemon and every client MUST compute the identical path (1 path, 1
55
+ * reference), so this is the single resolver both sides call.
56
+ *
57
+ * Resolution:
58
+ *
59
+ * - Windows: `\\.\pipe\<name>-sock` (named pipe; Unix sockets are unavailable
60
+ * pre-Win10 1803, same framing/semantics). Returned raw — a pipe path is not
61
+ * a filesystem path and must not be slash-normalized.
62
+ * - `$XDG_RUNTIME_DIR/<name>.sock` when XDG_RUNTIME_DIR is set (systemd
63
+ * `/run/user/<uid>/`).
64
+ * - Else `$TMPDIR/<name>-<uid>.sock` (the `<uid>` suffix avoids collisions when
65
+ * TMPDIR is shared across users on a multi-tenant box).
66
+ */
67
+ function getRuntimeSocketPath(name) {
68
+ if (require_constants_platform.WIN32) return `\\\\.\\pipe\\${name}-sock`;
69
+ const path = require_node_path.getNodePath();
70
+ const xdgRuntimeDir = require_env_xdg.getXdgRuntimeDir();
71
+ if (xdgRuntimeDir) return require_paths_normalize.normalizePath(path.join(xdgRuntimeDir, `${name}.sock`));
72
+ const { uid } = require_node_os.getNodeOs().userInfo();
73
+ return require_paths_normalize.normalizePath(path.join(getOsTmpDir(), `${name}-${uid}.sock`));
43
74
  }
44
75
  /**
45
76
  * Get a Socket app cache directory (~/.socket/_<appName>/cache).
@@ -60,81 +91,72 @@ function getSocketAppCacheTtlDir(appName) {
60
91
  return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketAppCacheDir(appName), "ttl"));
61
92
  }
62
93
  /**
63
- * Get a Socket app directory (~/.socket/_<appName>).
94
+ * Get a Socket app directory (~/.socket/_<appName>). The `_` prefix is applied
95
+ * here; pass the bare app name (e.g. 'socket', 'registry').
64
96
  */
65
97
  /**
66
- * Get a Socket app directory (~/.socket/_<appName>).
98
+ * Get a Socket app directory (~/.socket/_<appName>). The `_` prefix is applied
99
+ * here; pass the bare app name (e.g. 'socket', 'registry').
67
100
  */
68
101
  function getSocketAppDir(appName) {
69
102
  return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}${appName}`));
70
103
  }
71
104
  /**
72
- * Get the Socket cacache directory (~/.socket/_cacache). Can be overridden with
73
- * SOCKET_CACACHE_DIR environment variable or via setPath() for testing. Result
74
- * is cached via getPathValue for performance.
75
- *
76
- * Priority order:
77
- *
78
- * 1. Test override via setPath('socket-cacache-dir', ...)
79
- * 2. SOCKET_CACACHE_DIR - Full override of cacache directory
80
- * 3. Default: $SOCKET_HOME/_cacache or $HOME/.socket/_cacache
105
+ * Get the Socket cacache directory (~/.socket/_cacache). Override precedence:
106
+ * setPath('socket-cacache-dir', …) SOCKET_CACACHE_DIR env →
107
+ * $SOCKET_HOME/_cacache $HOME/.socket/_cacache.
81
108
  */
82
109
  /**
83
- * Get the Socket cacache directory (~/.socket/_cacache). Can be overridden with
84
- * SOCKET_CACACHE_DIR environment variable or via setPath() for testing. Result
85
- * is cached via getPathValue for performance.
86
- *
87
- * Priority order:
88
- *
89
- * 1. Test override via setPath('socket-cacache-dir', ...)
90
- * 2. SOCKET_CACACHE_DIR - Full override of cacache directory
91
- * 3. Default: $SOCKET_HOME/_cacache or $HOME/.socket/_cacache
110
+ * Get an app's runtime directory (~/.socket/_state/<app>/run/) the home for a
111
+ * daemon's Unix socket + `concurrency.lock` + `<socket>.pid`. Version-less so
112
+ * the socket path is stable across binary upgrades.
92
113
  */
93
- function getSocketCacacheDir() {
94
- return require_paths_rewire.getPathValue("socket-cacache-dir", () => {
95
- if (require_env_socket.getSocketCacacheDirEnv()) return require_paths_normalize.normalizePath(require_env_socket.getSocketCacacheDirEnv());
96
- return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}cacache`));
97
- });
114
+ function getSocketAppRuntimeDir(appName) {
115
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketAppStateDir(appName), "run"));
98
116
  }
99
117
  /**
100
- * Get the Socket CLI directory (~/.socket/_socket).
118
+ * Get the Socket user directory (~/.socket). Override precedence:
119
+ * setPath('socket-user-dir', …) → SOCKET_HOME env → $HOME/.socket →
120
+ * /tmp/.socket (Unix) or %TEMP%.socket (Windows).
101
121
  */
102
122
  /**
103
- * Get the Socket CLI directory (~/.socket/_socket).
123
+ * Get an app's persistent state directory (~/.socket/_state/<app>/). The
124
+ * `<app>` is a real app (proteus, acorn) nesting its version-less state inside
125
+ * the `_state` infra dir.
104
126
  */
105
- function getSocketCliDir() {
106
- return getSocketAppDir(require_constants_socket.SOCKET_CLI_APP_NAME);
127
+ function getSocketAppStateDir(appName) {
128
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketStateDir(), appName));
107
129
  }
108
130
  /**
109
- * Get the Socket DLX directory (~/.socket/_dlx). Can be overridden with
110
- * SOCKET_DLX_DIR environment variable or via setPath() for testing. Result is
111
- * cached via getPathValue for performance.
112
- *
113
- * Priority order:
114
- *
115
- * 1. Test override via setPath('socket-dlx-dir', ...)
116
- * 2. SOCKET_DLX_DIR - Full override of DLX cache directory
117
- * 3. SOCKET_HOME/_dlx - Base directory override (inherits from getSocketUserDir)
118
- * 4. Default: $HOME/.socket/_dlx
119
- * 5. Fallback: /tmp/.socket/_dlx (Unix) or %TEMP%.socket_dlx (Windows)
131
+ * Get an app's runtime directory (~/.socket/_state/<app>/run/) the home for a
132
+ * daemon's Unix socket + `concurrency.lock` + `<socket>.pid`. Version-less so
133
+ * the socket path is stable across binary upgrades.
120
134
  */
121
135
  /**
122
- * Get the Socket DLX directory (~/.socket/_dlx). Can be overridden with
123
- * SOCKET_DLX_DIR environment variable or via setPath() for testing. Result is
124
- * cached via getPathValue for performance.
125
- *
126
- * Priority order:
127
- *
128
- * 1. Test override via setPath('socket-dlx-dir', ...)
129
- * 2. SOCKET_DLX_DIR - Full override of DLX cache directory
130
- * 3. SOCKET_HOME/_dlx - Base directory override (inherits from getSocketUserDir)
131
- * 4. Default: $HOME/.socket/_dlx
132
- * 5. Fallback: /tmp/.socket/_dlx (Unix) or %TEMP%.socket_dlx (Windows)
136
+ * Get the Socket cacache directory (~/.socket/_cacache). Override precedence:
137
+ * setPath('socket-cacache-dir', …) SOCKET_CACACHE_DIR env
138
+ * $SOCKET_HOME/_cacache $HOME/.socket/_cacache.
139
+ */
140
+ function getSocketCacacheDir() {
141
+ return require_paths_rewire.getPathValue("socket-cacache-dir", () => {
142
+ if (require_env_socket.getSocketCacacheDirEnv()) return require_paths_normalize.normalizePath(require_env_socket.getSocketCacacheDirEnv());
143
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), require_constants_socket.SOCKET_DIR.cacache));
144
+ });
145
+ }
146
+ /**
147
+ * Get the Socket DLX directory (~/.socket/_dlx) — the name+version binary store
148
+ * (node, jre, python, sfw, …). Override precedence: setPath('socket-dlx-dir',
149
+ * …) → SOCKET_DLX_DIR env → $SOCKET_HOME/_dlx → $HOME/.socket/_dlx.
150
+ */
151
+ /**
152
+ * Get the Socket DLX directory (~/.socket/_dlx) — the name+version binary store
153
+ * (node, jre, python, sfw, …). Override precedence: setPath('socket-dlx-dir',
154
+ * …) → SOCKET_DLX_DIR env → $SOCKET_HOME/_dlx → $HOME/.socket/_dlx.
133
155
  */
134
156
  function getSocketDlxDir() {
135
157
  return require_paths_rewire.getPathValue("socket-dlx-dir", () => {
136
158
  if (require_env_socket.getSocketDlxDirEnv()) return require_paths_normalize.normalizePath(require_env_socket.getSocketDlxDirEnv());
137
- return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}${"dlx"}`));
159
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), require_constants_socket.SOCKET_DIR.dlx));
138
160
  });
139
161
  }
140
162
  /**
@@ -149,51 +171,71 @@ function getSocketHomePath() {
149
171
  return getSocketUserDir();
150
172
  }
151
173
  /**
152
- * Get the Socket Registry directory (~/.socket/_registry).
153
- */
154
- /**
155
- * Get the Socket Registry directory (~/.socket/_registry).
174
+ * Get the Wheelhouse rack directory (~/.socket/_wheelhouse/rack) — the tool
175
+ * STORE. Every `_wheelhouse`-managed CLI tool keeps its real binaries here,
176
+ * racked by name + version as `<rack>/<tool>/<version>/…` (the wheelhouse
177
+ * analog of Homebrew's `Cellar/`). The handles on PATH live in
178
+ * `<wheelhouse>/bin` (getSocketWheelhouseBinDir) and point into the rack.
179
+ * Inherits the `_wheelhouse` override chain (SOCKET_HOME /
180
+ * setPath('socket-wheelhouse-dir')).
156
181
  */
157
- function getSocketRegistryDir() {
158
- return getSocketAppDir(require_constants_socket.SOCKET_REGISTRY_APP_NAME);
182
+ function getSocketRackDir() {
183
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketWheelhouseDir(), "rack"));
159
184
  }
160
185
  /**
161
- * Get the Socket Registry GitHub cache directory
162
- * (~/.socket/_registry/cache/ttl/github).
186
+ * Get a racked tool's version directory (~/.socket/_wheelhouse/rack/<tool>/
187
+ * <version>) — the per-tool, per-version home under the rack. The
188
+ * 1-path-1-reference owner of a tool install destination: installers resolve
189
+ * their extract/copy target through this, and the `<wheelhouse>/bin/<tool>`
190
+ * shim points at a binary inside it.
163
191
  */
164
- /**
165
- * Get the Socket Registry GitHub cache directory
166
- * (~/.socket/_registry/cache/ttl/github).
167
- */
168
- function getSocketRegistryGithubCacheDir() {
169
- return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketAppCacheTtlDir(require_constants_socket.SOCKET_REGISTRY_APP_NAME), require_constants_github.CACHE_GITHUB_DIR));
192
+ function getSocketRackToolDir(options) {
193
+ const opts = {
194
+ __proto__: null,
195
+ ...options
196
+ };
197
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketRackDir(), opts.tool, opts.version));
170
198
  }
171
199
  /**
172
- * Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared
173
- * cross-fleet location for binaries that every fleet member can reach without
174
- * each one re-downloading and re-extracting per-repo. Tool installers (janus,
175
- * sfw, etc.) drop their resolved executables under
176
- * `<wheelhouse>/<tool>/<version>/<platform-arch>/`; consumers add the
177
- * appropriate `bin/` to PATH or invoke the binary by absolute path.
200
+ * Get the Wheelhouse repo-clones directory (~/.socket/_wheelhouse/repo-clones).
201
+ * Sits beside the per-tool dirs (sfw, codedb, janus, bin) under `_wheelhouse`.
202
+ * The home for reference clones of EXTERNAL repos an agent reviews, each as
203
+ * `<org>-<repo>` lowercased + dash-cased (e.g. `justrach-codedb`).
178
204
  *
179
- * Priority order:
205
+ * Smallest-practical clone form (smallest disk + fastest initial fetch without
206
+ * the treeless tax): git clone --depth=1 --single-branch --filter=blob:none
207
+ * <url> <dest> `--depth=1` truncates history, `--single-branch` skips other
208
+ * refs, and `--filter=blob:none` (a BLOBLESS partial clone) fetches file blobs
209
+ * lazily on first access — so the initial download is tree-metadata only.
210
+ * (Treeless `--filter=tree:0` is smaller still but refetches trees on every
211
+ * walk, which is slow + breaks offline, so it is NOT the default.)
180
212
  *
181
- * 1. Test override via setPath('socket-wheelhouse-dir', ...)
182
- * 2. SOCKET_HOME/_wheelhouse - Base directory override (inherits from
183
- * getSocketUserDir)
184
- * 3. Default: $HOME/.socket/_wheelhouse
213
+ * Deliberately OUTSIDE `~/projects/` so the fleet's sibling-walk tooling (e.g.
214
+ * cascade `--all`) never mistakes a reference clone for a fleet member
215
+ * checkout. Disposable: a reference cache, not a working tree. Inherits the
216
+ * `_wheelhouse` override chain (SOCKET_HOME /
217
+ * setPath('socket-wheelhouse-dir')).
185
218
  */
219
+ function getSocketRepoClonesDir() {
220
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketWheelhouseDir(), "repo-clones"));
221
+ }
186
222
  /**
187
- * Get the Socket user directory (~/.socket). Can be overridden with SOCKET_HOME
188
- * environment variable or via setPath() for testing. Result is cached via
189
- * getPathValue for performance.
190
- *
191
- * Priority order:
192
- *
193
- * 1. Test override via setPath('socket-user-dir', ...)
194
- * 2. SOCKET_HOME - Base directory override
195
- * 3. Default: $HOME/.socket
196
- * 4. Fallback: /tmp/.socket (Unix) or %TEMP%.socket (Windows)
223
+ * Get the Socket state directory (~/.socket/_state) version-LESS persistent
224
+ * app state (the home for daemon sockets, locks, OAuth refresh, durable caches
225
+ * that survive version bumps; mirrors pnpm `state-dir` / XDG_STATE_HOME).
226
+ * Override precedence: setPath('socket-state-dir', …) → SOCKET_STATE_DIR env →
227
+ * $SOCKET_HOME/_state → $HOME/.socket/_state.
228
+ */
229
+ function getSocketStateDir() {
230
+ return require_paths_rewire.getPathValue("socket-state-dir", () => {
231
+ if (require_env_socket.getSocketStateDirEnv()) return require_paths_normalize.normalizePath(require_env_socket.getSocketStateDirEnv());
232
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), require_constants_socket.SOCKET_DIR.state));
233
+ });
234
+ }
235
+ /**
236
+ * Get the Socket user directory (~/.socket). Override precedence:
237
+ * setPath('socket-user-dir', …) → SOCKET_HOME env → $HOME/.socket →
238
+ * /tmp/.socket (Unix) or %TEMP%.socket (Windows).
197
239
  */
198
240
  function getSocketUserDir() {
199
241
  return require_paths_rewire.getPathValue("socket-user-dir", () => {
@@ -203,52 +245,46 @@ function getSocketUserDir() {
203
245
  });
204
246
  }
205
247
  /**
206
- * Get the user's home directory. Uses environment variables directly to support
207
- * test mocking. Falls back to temporary directory if home is not available.
208
- *
209
- * Priority order: 1. HOME environment variable (Unix) 2. USERPROFILE
210
- * environment variable (Windows) 3. getNodeOs().homedir() 4. Fallback:
211
- * getNodeOs().tmpdir() (rarely used, for restricted environments)
248
+ * Get the Wheelhouse bin directory (~/.socket/_wheelhouse/bin) the single
249
+ * directory placed on PATH. Holds only flat handles (thin exec shims or
250
+ * symlinks), one per tool, each pointing at a real binary racked under
251
+ * `<wheelhouse>/rack/<tool>/<version>/…` (getSocketRackToolDir). The shim IS
252
+ * the bin, the npm `prefix/bin` / Homebrew `bin/` model: PATH lookup does not
253
+ * recurse, so this dir stays flat (never a `bin/<tool>/` subdir). Inherits the
254
+ * `_wheelhouse` override chain (SOCKET_HOME /
255
+ * setPath('socket-wheelhouse-dir')).
212
256
  */
257
+ function getSocketWheelhouseBinDir() {
258
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketWheelhouseDir(), "bin"));
259
+ }
213
260
  /**
214
261
  * Get the Socket Wheelhouse directory (~/.socket/_wheelhouse). Shared
215
262
  * cross-fleet location for binaries that every fleet member can reach without
216
263
  * each one re-downloading and re-extracting per-repo. Tool installers (janus,
217
- * sfw, etc.) drop their resolved executables under
218
- * `<wheelhouse>/<tool>/<version>/<platform-arch>/`; consumers add the
219
- * appropriate `bin/` to PATH or invoke the binary by absolute path.
220
- *
221
- * Priority order:
222
- *
223
- * 1. Test override via setPath('socket-wheelhouse-dir', ...)
224
- * 2. SOCKET_HOME/_wheelhouse - Base directory override (inherits from
225
- * getSocketUserDir)
226
- * 3. Default: $HOME/.socket/_wheelhouse
264
+ * sfw, etc.) rack their resolved executables under
265
+ * `<wheelhouse>/rack/<tool>/<version>/…` (getSocketRackToolDir) and expose a
266
+ * handle in `<wheelhouse>/bin` (getSocketWheelhouseBinDir); consumers add that
267
+ * one `bin/` to PATH. Override precedence: setPath('socket-wheelhouse-dir', …)
268
+ * $SOCKET_HOME/_wheelhouse → $HOME/.socket/_wheelhouse.
227
269
  */
228
270
  function getSocketWheelhouseDir() {
229
271
  return require_paths_rewire.getPathValue("socket-wheelhouse-dir", () => {
230
- return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), `${"_"}${require_constants_socket.SOCKET_WHEELHOUSE_APP_NAME}`));
272
+ return require_paths_normalize.normalizePath(require_node_path.getNodePath().join(getSocketUserDir(), require_constants_socket.SOCKET_DIR.wheelhouse));
231
273
  });
232
274
  }
233
275
  /**
234
- * Get the Socket user directory (~/.socket). Can be overridden with SOCKET_HOME
235
- * environment variable or via setPath() for testing. Result is cached via
236
- * getPathValue for performance.
237
- *
238
- * Priority order:
276
+ * Get the user's home directory. Uses environment variables directly to support
277
+ * test mocking. Falls back to temporary directory if home is not available.
239
278
  *
240
- * 1. Test override via setPath('socket-user-dir', ...)
241
- * 2. SOCKET_HOME - Base directory override
242
- * 3. Default: $HOME/.socket
243
- * 4. Fallback: /tmp/.socket (Unix) or %TEMP%.socket (Windows)
279
+ * Priority order: 1. HOME (Unix) 2. USERPROFILE (Windows) 3.
280
+ * getNodeOs().homedir() 4. Fallback: getNodeOs().tmpdir() (restricted envs).
244
281
  */
245
282
  /**
246
283
  * Get the user's home directory. Uses environment variables directly to support
247
284
  * test mocking. Falls back to temporary directory if home is not available.
248
285
  *
249
- * Priority order: 1. HOME environment variable (Unix) 2. USERPROFILE
250
- * environment variable (Windows) 3. getNodeOs().homedir() 4. Fallback:
251
- * getNodeOs().tmpdir() (rarely used, for restricted environments)
286
+ * Priority order: 1. HOME (Unix) 2. USERPROFILE (Windows) 3.
287
+ * getNodeOs().homedir() 4. Fallback: getNodeOs().tmpdir() (restricted envs).
252
288
  */
253
289
  function getUserHomeDir() {
254
290
  const home = require_env_home.getHome();
@@ -267,15 +303,20 @@ function getUserHomeDir() {
267
303
  //#endregion
268
304
  exports.getOsHomeDir = getOsHomeDir;
269
305
  exports.getOsTmpDir = getOsTmpDir;
306
+ exports.getRuntimeSocketPath = getRuntimeSocketPath;
270
307
  exports.getSocketAppCacheDir = getSocketAppCacheDir;
271
308
  exports.getSocketAppCacheTtlDir = getSocketAppCacheTtlDir;
272
309
  exports.getSocketAppDir = getSocketAppDir;
310
+ exports.getSocketAppRuntimeDir = getSocketAppRuntimeDir;
311
+ exports.getSocketAppStateDir = getSocketAppStateDir;
273
312
  exports.getSocketCacacheDir = getSocketCacacheDir;
274
- exports.getSocketCliDir = getSocketCliDir;
275
313
  exports.getSocketDlxDir = getSocketDlxDir;
276
314
  exports.getSocketHomePath = getSocketHomePath;
277
- exports.getSocketRegistryDir = getSocketRegistryDir;
278
- exports.getSocketRegistryGithubCacheDir = getSocketRegistryGithubCacheDir;
315
+ exports.getSocketRackDir = getSocketRackDir;
316
+ exports.getSocketRackToolDir = getSocketRackToolDir;
317
+ exports.getSocketRepoClonesDir = getSocketRepoClonesDir;
318
+ exports.getSocketStateDir = getSocketStateDir;
279
319
  exports.getSocketUserDir = getSocketUserDir;
320
+ exports.getSocketWheelhouseBinDir = getSocketWheelhouseBinDir;
280
321
  exports.getSocketWheelhouseDir = getSocketWheelhouseDir;
281
322
  exports.getUserHomeDir = getUserHomeDir;
@@ -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_debug_output = require('../debug/output.js');
7
7
  const require_perf__internal = require('./_internal.js');
8
8
 
@@ -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_debug_output = require('../debug/output.js');
7
7
  const require_perf__internal = require('./_internal.js');
8
8
  const require_perf_enabled = require('./enabled.js');
@@ -0,0 +1,88 @@
1
+ /**
2
+ * @file Safe call-through accessors for the `process` global's methods and
3
+ * value reads. The `process` object reference is captured once at module load
4
+ * (immune to a later `globalThis.process = …` reassignment), but each method
5
+ * is CALLED at access time off that captured object — so `vi.spyOn(process,
6
+ * 'cwd')`, which mutates the same captured object, still intercepts. Binding
7
+ * the method reference instead (`process.cwd.bind(process)`) would freeze it
8
+ * and break that test seam, so we deliberately keep the late call. Consumers
9
+ * read cwd / platform / env / argv through these instead of touching
10
+ * `process` directly; enforced fleet-wide by
11
+ * `socket/prefer-process-primordial`. This is the `process` leaf of the
12
+ * node-module primordials: where `node/fs` / `node/path` lazy-load a `node:`
13
+ * module behind a function, this captures the always-present `process` global
14
+ * and routes its hot reads through one tamper-resistant surface.
15
+ */
16
+ /**
17
+ * The CPU architecture token (`'x64'` / `'arm64'` / …).
18
+ */
19
+ export declare function processArch(): string;
20
+ /**
21
+ * The argv array (`[execPath, scriptPath, ...args]`).
22
+ *
23
+ * @example
24
+ * ;```typescript
25
+ * const entry = processArgv()[1]
26
+ * ```
27
+ */
28
+ export declare function processArgv(): string[];
29
+ /**
30
+ * The current working directory. Call-through to the captured process's `cwd` —
31
+ * late-bound so test spies still intercept.
32
+ *
33
+ * @example
34
+ * ;```typescript
35
+ * const dir = processCwd()
36
+ * ```
37
+ */
38
+ export declare function processCwd(): string;
39
+ /**
40
+ * Emit a process warning. Call-through so a test spy on `process.emitWarning`
41
+ * still intercepts.
42
+ */
43
+ export declare function processEmitWarning(...args: Parameters<NodeJS.Process['emitWarning']>): void;
44
+ /**
45
+ * The process environment object. Returns the live `process.env` off the
46
+ * captured process (call-through, so a test that swaps `process.env` is seen).
47
+ *
48
+ * @example
49
+ * ;```typescript
50
+ * const token = processEnv()['SOCKET_API_TOKEN']
51
+ * ```
52
+ */
53
+ export declare function processEnv(): NodeJS.ProcessEnv;
54
+ /**
55
+ * The absolute path to the Node executable (`process.execPath`).
56
+ */
57
+ export declare function processExecPath(): string;
58
+ /**
59
+ * Schedule a callback on the next tick. Call-through (late-bound).
60
+ */
61
+ export declare function processNextTick(...args: Parameters<NodeJS.Process['nextTick']>): void;
62
+ /**
63
+ * The process id.
64
+ */
65
+ export declare function processPid(): number;
66
+ /**
67
+ * The OS platform token (`'darwin'` / `'linux'` / `'win32'` / …).
68
+ *
69
+ * @example
70
+ * ;```typescript
71
+ * if (processPlatform() === 'win32') { … }
72
+ * ```
73
+ */
74
+ export declare function processPlatform(): NodeJS.Platform;
75
+ /**
76
+ * The standard error stream. Returned off the captured process so a test that
77
+ * spies on `process.stderr.write` still intercepts.
78
+ */
79
+ export declare function processStderr(): NodeJS.WriteStream;
80
+ /**
81
+ * The standard output stream. Returned off the captured process so a test that
82
+ * spies on `process.stdout.write` still intercepts.
83
+ */
84
+ export declare function processStdout(): NodeJS.WriteStream;
85
+ /**
86
+ * The Node version string (`process.version`, e.g. `'v26.2.0'`).
87
+ */
88
+ export declare function processVersion(): string;