@socketsecurity/cli-with-sentry 1.16.0 → 1.17.0

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 (316) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE +87 -0
  3. package/README.md +13 -13
  4. package/bin/cli.js +9 -9
  5. package/dist/.config/tsconfig.dts.tsbuildinfo +1 -1
  6. package/dist/cli.js +2120 -4305
  7. package/dist/cli.js.map +1 -1
  8. package/dist/constants.js +71 -87
  9. package/dist/constants.js.map +1 -1
  10. package/dist/env-helpers.js +63 -0
  11. package/dist/env-helpers.js.map +1 -0
  12. package/dist/instrument-with-sentry.js +7 -7
  13. package/dist/instrument-with-sentry.js.map +1 -1
  14. package/dist/manifest-scripts/dotnet-tool/Microsoft.Build.Locator.dll +0 -0
  15. package/dist/manifest-scripts/dotnet-tool/socket-facts-dotnet.deps.json +2 -2
  16. package/dist/manifest-scripts/dotnet-tool/socket-facts-dotnet.dll +0 -0
  17. package/dist/manifest-scripts/maven-extension/coana-maven-extension.jar +0 -0
  18. package/dist/runtime-constants.js +345 -0
  19. package/dist/runtime-constants.js.map +1 -0
  20. package/dist/shadow-npm-bin2.js +9 -13
  21. package/dist/shadow-npm-bin2.js.map +1 -1
  22. package/dist/shadow-npm-inject.js +10 -15
  23. package/dist/shadow-npm-inject.js.map +1 -1
  24. package/dist/shadow-npx-bin.js.map +1 -1
  25. package/dist/shadow-pnpm-bin2.js +21 -25
  26. package/dist/shadow-pnpm-bin2.js.map +1 -1
  27. package/dist/shadow-yarn-bin.js +4 -6
  28. package/dist/shadow-yarn-bin.js.map +1 -1
  29. package/dist/socket-completion.bash +0 -0
  30. package/dist/spawn-sync.js +47 -0
  31. package/dist/spawn-sync.js.map +1 -0
  32. package/dist/spinner.js +182 -0
  33. package/dist/spinner.js.map +1 -0
  34. package/dist/types/commands/fix/generated-socket-facts.d.mts +5 -2
  35. package/dist/types/commands/fix/handle-fix.d.mts +1 -1
  36. package/dist/types/commands/fix/types.d.mts +1 -1
  37. package/dist/types/commands/manifest/bazel/process.d.mts +2 -2
  38. package/dist/types/commands/manifest/convert-dotnet-to-facts.d.mts +3 -6
  39. package/dist/types/commands/manifest/discover-manifest-roots.d.mts +10 -11
  40. package/dist/types/commands/manifest/generate-recursive-manifests.d.mts +16 -30
  41. package/dist/types/commands/manifest/generate_auto_manifest.d.mts +6 -11
  42. package/dist/types/commands/manifest/load-build.d.mts +3 -11
  43. package/dist/types/commands/manifest/run-manifest-facts.d.mts +88 -29
  44. package/dist/types/commands/manifest/scripts/build-tool.d.mts +2 -0
  45. package/dist/types/commands/optimize/add-overrides.d.mts +2 -2
  46. package/dist/types/commands/optimize/get-dependency-entries.d.mts +1 -1
  47. package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +16 -7
  48. package/dist/types/commands/optimize/update-lockfile.d.mts +2 -2
  49. package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +4 -2
  50. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +2 -2
  51. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +1 -1
  52. package/dist/types/commands/scan/generate-report.d.mts +1 -1
  53. package/dist/types/commands/scan/handle-create-new-scan.d.mts +5 -1
  54. package/dist/types/commands/scan/output-create-new-scan.d.mts +1 -1
  55. package/dist/types/commands/scan/output-diff-scan.d.mts +4 -2
  56. package/dist/types/commands/scan/perform-reachability-analysis.d.mts +4 -6
  57. package/dist/types/commands/scan/run-dynamic-sbom-inference.d.mts +7 -15
  58. package/dist/types/constants/runtime.d.mts +417 -0
  59. package/dist/types/constants.d.mts +9 -10
  60. package/dist/types/paths/coana.d.mts +5 -0
  61. package/dist/types/paths/uv.d.mts +2 -0
  62. package/dist/types/sea/adapters/cdxgen-worker.d.mts +1 -0
  63. package/dist/types/sea/adapters/synp-worker.d.mts +1 -0
  64. package/dist/types/sea/build/cdxgen-fixture.d.mts +4 -0
  65. package/dist/types/sea/build/smoke-test.d.mts +2 -0
  66. package/dist/types/sea/build-sea.d.mts +4 -2
  67. package/dist/types/sea/download-bytes.d.mts +0 -1
  68. package/dist/types/sea/paths/archive.d.mts +3 -0
  69. package/dist/types/sea/paths/coana-cache.d.mts +1 -0
  70. package/dist/types/sea/paths/native-tools.d.mts +13 -0
  71. package/dist/types/sea/pnpm-lock.d.mts +22 -0
  72. package/dist/types/sea/rollup-workers.d.mts +1 -0
  73. package/dist/types/sea/runtime.d.mts +4 -3
  74. package/dist/types/sea/vfs-digest.d.mts +2 -0
  75. package/dist/types/shadow/common.d.mts +1 -1
  76. package/dist/types/shadow/npm/arborist-helpers.d.mts +1 -1
  77. package/dist/types/shadow/npm/bin.d.mts +1 -1
  78. package/dist/types/shadow/npm/install.d.mts +3 -3
  79. package/dist/types/shadow/npm-base.d.mts +1 -1
  80. package/dist/types/shadow/npx/bin.d.mts +1 -1
  81. package/dist/types/shadow/pnpm/bin.d.mts +1 -1
  82. package/dist/types/shadow/yarn/bin.d.mts +1 -1
  83. package/dist/types/test/mocks/socket-auth.d.mts +40 -39
  84. package/dist/types/utils/agent.d.mts +6 -1
  85. package/dist/types/utils/alert/artifact.d.mts +1 -1
  86. package/dist/types/utils/alerts-map.d.mts +1 -1
  87. package/dist/types/utils/api.d.mts +1 -1
  88. package/dist/types/utils/arrays.d.mts +6 -0
  89. package/dist/types/utils/bin.d.mts +26 -0
  90. package/dist/types/utils/{coana-release.d.mts → coana/release.d.mts} +5 -3
  91. package/dist/types/utils/debug.d.mts +23 -49
  92. package/dist/types/utils/dlx.d.mts +1 -1
  93. package/dist/types/utils/ecosystem.d.mts +1 -9
  94. package/dist/types/utils/env.d.mts +24 -0
  95. package/dist/types/utils/errors.d.mts +2 -2
  96. package/dist/types/utils/escape-regexp.d.mts +6 -0
  97. package/dist/types/utils/fs.d.mts +33 -0
  98. package/dist/types/utils/github.d.mts +1 -1
  99. package/dist/types/utils/globs.d.mts +1 -0
  100. package/dist/types/utils/logger.d.mts +51 -0
  101. package/dist/types/utils/objects.d.mts +11 -0
  102. package/dist/types/utils/package-environment.d.mts +3 -3
  103. package/dist/types/utils/packages.d.mts +65 -0
  104. package/dist/types/utils/path.d.mts +3 -0
  105. package/dist/types/utils/promises.d.mts +23 -0
  106. package/dist/types/utils/prompts.d.mts +25 -0
  107. package/dist/types/utils/purl.d.mts +4 -1
  108. package/dist/types/utils/socket-package-alert.d.mts +1 -1
  109. package/dist/types/utils/socket-url.d.mts +1 -1
  110. package/dist/types/utils/sorts.d.mts +1 -0
  111. package/dist/types/utils/spawn-sync.d.mts +3 -0
  112. package/dist/types/utils/spawn.d.mts +67 -0
  113. package/dist/types/utils/spec.d.mts +1 -1
  114. package/dist/types/utils/spinner.d.mts +46 -0
  115. package/dist/types/utils/streams.d.mts +3 -0
  116. package/dist/types/utils/strings.d.mts +6 -0
  117. package/dist/types/utils/url.d.mts +2 -0
  118. package/dist/types/utils/words.d.mts +1 -0
  119. package/dist/utils.js +4481 -806
  120. package/dist/utils.js.map +1 -1
  121. package/dist/vendor.js +39737 -41318
  122. package/external/blessed-contrib/lib/widget/charts/line.js +172 -149
  123. package/package.json +43 -36
  124. package/shadow-bin/npm +0 -0
  125. package/shadow-bin/npx +0 -0
  126. package/shadow-bin/pnpm +0 -0
  127. package/shadow-bin/yarn +0 -0
  128. package/dist/types/commands/manifest/convert-gradle-to-facts.d.mts +0 -19
  129. package/dist/types/commands/manifest/convert-maven-to-facts.d.mts +0 -19
  130. package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts +0 -22
  131. package/dist/types/commands/manifest/enumerate-workspaces.d.mts +0 -22
  132. package/dist/types/commands/manifest/expand-env-var-refs.d.mts +0 -9
  133. package/dist/types/sea/archive-paths.d.mts +0 -6
  134. package/external/@socketsecurity/registry/LICENSE +0 -21
  135. package/external/@socketsecurity/registry/README.md +0 -9
  136. package/external/@socketsecurity/registry/extensions.json +0 -28
  137. package/external/@socketsecurity/registry/external/@inquirer/confirm.js +0 -3165
  138. package/external/@socketsecurity/registry/external/@inquirer/input.js +0 -3202
  139. package/external/@socketsecurity/registry/external/@inquirer/password.js +0 -3307
  140. package/external/@socketsecurity/registry/external/@inquirer/search.js +0 -3519
  141. package/external/@socketsecurity/registry/external/@inquirer/select.js +0 -3655
  142. package/external/@socketsecurity/registry/external/@npmcli/package-json/index.js +0 -21406
  143. package/external/@socketsecurity/registry/external/@npmcli/package-json/lib/read-package.js +0 -183
  144. package/external/@socketsecurity/registry/external/@npmcli/package-json/lib/sort.js +0 -274
  145. package/external/@socketsecurity/registry/external/@npmcli/promise-spawn.js +0 -704
  146. package/external/@socketsecurity/registry/external/@socketregistry/is-unicode-supported.js +0 -54
  147. package/external/@socketsecurity/registry/external/@socketregistry/packageurl-js.js +0 -4516
  148. package/external/@socketsecurity/registry/external/@socketregistry/yocto-spinner.js +0 -453
  149. package/external/@socketsecurity/registry/external/@yarnpkg/extensions.js +0 -1406
  150. package/external/@socketsecurity/registry/external/browserslist.js +0 -20496
  151. package/external/@socketsecurity/registry/external/cacache.js +0 -16208
  152. package/external/@socketsecurity/registry/external/debug.js +0 -1163
  153. package/external/@socketsecurity/registry/external/fast-glob.js +0 -7994
  154. package/external/@socketsecurity/registry/external/fast-sort.js +0 -181
  155. package/external/@socketsecurity/registry/external/libnpmpack.js +0 -106271
  156. package/external/@socketsecurity/registry/external/make-fetch-happen.js +0 -38997
  157. package/external/@socketsecurity/registry/external/normalize-package-data.js +0 -5343
  158. package/external/@socketsecurity/registry/external/npm-package-arg.js +0 -5773
  159. package/external/@socketsecurity/registry/external/pacote.js +0 -74109
  160. package/external/@socketsecurity/registry/external/picomatch.js +0 -2307
  161. package/external/@socketsecurity/registry/external/semver.js +0 -2618
  162. package/external/@socketsecurity/registry/external/signal-exit.js +0 -336
  163. package/external/@socketsecurity/registry/external/spdx-correct.js +0 -1457
  164. package/external/@socketsecurity/registry/external/spdx-expression-parse.js +0 -1043
  165. package/external/@socketsecurity/registry/external/streaming-iterables.js +0 -326
  166. package/external/@socketsecurity/registry/external/validate-npm-package-name.js +0 -108
  167. package/external/@socketsecurity/registry/external/which.js +0 -405
  168. package/external/@socketsecurity/registry/external/yoctocolors-cjs.js +0 -101
  169. package/external/@socketsecurity/registry/index.js +0 -31
  170. package/external/@socketsecurity/registry/lib/agent.js +0 -390
  171. package/external/@socketsecurity/registry/lib/arrays.js +0 -89
  172. package/external/@socketsecurity/registry/lib/bin.js +0 -650
  173. package/external/@socketsecurity/registry/lib/constants/abort-controller.js +0 -15
  174. package/external/@socketsecurity/registry/lib/constants/abort-signal.js +0 -27
  175. package/external/@socketsecurity/registry/lib/constants/at-latest.js +0 -3
  176. package/external/@socketsecurity/registry/lib/constants/biome-json.js +0 -3
  177. package/external/@socketsecurity/registry/lib/constants/bun-lock.js +0 -3
  178. package/external/@socketsecurity/registry/lib/constants/bun-lockb.js +0 -3
  179. package/external/@socketsecurity/registry/lib/constants/bun.js +0 -3
  180. package/external/@socketsecurity/registry/lib/constants/ci.js +0 -3
  181. package/external/@socketsecurity/registry/lib/constants/column-limit.js +0 -3
  182. package/external/@socketsecurity/registry/lib/constants/copy-left-licenses.js +0 -27
  183. package/external/@socketsecurity/registry/lib/constants/darwin.js +0 -3
  184. package/external/@socketsecurity/registry/lib/constants/dot-git-dir.js +0 -3
  185. package/external/@socketsecurity/registry/lib/constants/dot-package-lock-json.js +0 -3
  186. package/external/@socketsecurity/registry/lib/constants/dot-socket-dir.js +0 -3
  187. package/external/@socketsecurity/registry/lib/constants/empty-file.js +0 -3
  188. package/external/@socketsecurity/registry/lib/constants/empty-value.js +0 -3
  189. package/external/@socketsecurity/registry/lib/constants/env.js +0 -59
  190. package/external/@socketsecurity/registry/lib/constants/eslint-config-js.js +0 -3
  191. package/external/@socketsecurity/registry/lib/constants/esnext.js +0 -3
  192. package/external/@socketsecurity/registry/lib/constants/exec-path.js +0 -3
  193. package/external/@socketsecurity/registry/lib/constants/ext-cjs.js +0 -3
  194. package/external/@socketsecurity/registry/lib/constants/ext-cmd.js +0 -3
  195. package/external/@socketsecurity/registry/lib/constants/ext-cts.js +0 -3
  196. package/external/@socketsecurity/registry/lib/constants/ext-dts.js +0 -3
  197. package/external/@socketsecurity/registry/lib/constants/ext-js.js +0 -3
  198. package/external/@socketsecurity/registry/lib/constants/ext-json.js +0 -3
  199. package/external/@socketsecurity/registry/lib/constants/ext-lock.js +0 -3
  200. package/external/@socketsecurity/registry/lib/constants/ext-lockb.js +0 -3
  201. package/external/@socketsecurity/registry/lib/constants/ext-md.js +0 -3
  202. package/external/@socketsecurity/registry/lib/constants/ext-mjs.js +0 -3
  203. package/external/@socketsecurity/registry/lib/constants/ext-mts.js +0 -3
  204. package/external/@socketsecurity/registry/lib/constants/ext-ps1.js +0 -3
  205. package/external/@socketsecurity/registry/lib/constants/ext-yaml.js +0 -3
  206. package/external/@socketsecurity/registry/lib/constants/ext-yml.js +0 -3
  207. package/external/@socketsecurity/registry/lib/constants/extensions-json.js +0 -3
  208. package/external/@socketsecurity/registry/lib/constants/extensions.js +0 -3
  209. package/external/@socketsecurity/registry/lib/constants/get-ipc.js +0 -10
  210. package/external/@socketsecurity/registry/lib/constants/gitignore.js +0 -3
  211. package/external/@socketsecurity/registry/lib/constants/index.js +0 -139
  212. package/external/@socketsecurity/registry/lib/constants/ipc-handler.js +0 -19
  213. package/external/@socketsecurity/registry/lib/constants/ipc-object.js +0 -6
  214. package/external/@socketsecurity/registry/lib/constants/ipc-promise.js +0 -47
  215. package/external/@socketsecurity/registry/lib/constants/ipc-target.js +0 -3
  216. package/external/@socketsecurity/registry/lib/constants/k-internals-symbol.js +0 -3
  217. package/external/@socketsecurity/registry/lib/constants/latest.js +0 -3
  218. package/external/@socketsecurity/registry/lib/constants/license-glob-recursive.js +0 -3
  219. package/external/@socketsecurity/registry/lib/constants/license-glob.js +0 -3
  220. package/external/@socketsecurity/registry/lib/constants/license-original-glob-recursive.js +0 -3
  221. package/external/@socketsecurity/registry/lib/constants/license-original-glob.js +0 -3
  222. package/external/@socketsecurity/registry/lib/constants/license-original.js +0 -3
  223. package/external/@socketsecurity/registry/lib/constants/license.js +0 -3
  224. package/external/@socketsecurity/registry/lib/constants/lifecycle-script-names.js +0 -18
  225. package/external/@socketsecurity/registry/lib/constants/loop-sentinel.js +0 -3
  226. package/external/@socketsecurity/registry/lib/constants/maintained-node-versions.js +0 -47
  227. package/external/@socketsecurity/registry/lib/constants/manifest-json.js +0 -3
  228. package/external/@socketsecurity/registry/lib/constants/mit.js +0 -3
  229. package/external/@socketsecurity/registry/lib/constants/node-auth-token.js +0 -3
  230. package/external/@socketsecurity/registry/lib/constants/node-debug-flags.js +0 -9
  231. package/external/@socketsecurity/registry/lib/constants/node-env.js +0 -3
  232. package/external/@socketsecurity/registry/lib/constants/node-harden-flags.js +0 -29
  233. package/external/@socketsecurity/registry/lib/constants/node-modules-glob-recursive.js +0 -3
  234. package/external/@socketsecurity/registry/lib/constants/node-modules.js +0 -3
  235. package/external/@socketsecurity/registry/lib/constants/node-no-warnings-flags.js +0 -16
  236. package/external/@socketsecurity/registry/lib/constants/node-version.js +0 -3
  237. package/external/@socketsecurity/registry/lib/constants/npm-exec-path.js +0 -5
  238. package/external/@socketsecurity/registry/lib/constants/npm-real-exec-path.js +0 -6
  239. package/external/@socketsecurity/registry/lib/constants/npm-shrinkwrap-json.js +0 -3
  240. package/external/@socketsecurity/registry/lib/constants/npm.js +0 -3
  241. package/external/@socketsecurity/registry/lib/constants/npx.js +0 -3
  242. package/external/@socketsecurity/registry/lib/constants/overrides.js +0 -3
  243. package/external/@socketsecurity/registry/lib/constants/package-default-node-range.js +0 -6
  244. package/external/@socketsecurity/registry/lib/constants/package-default-socket-categories.js +0 -3
  245. package/external/@socketsecurity/registry/lib/constants/package-default-version.js +0 -3
  246. package/external/@socketsecurity/registry/lib/constants/package-extensions.js +0 -47
  247. package/external/@socketsecurity/registry/lib/constants/package-json.js +0 -3
  248. package/external/@socketsecurity/registry/lib/constants/package-lock-json.js +0 -3
  249. package/external/@socketsecurity/registry/lib/constants/packument-cache.js +0 -3
  250. package/external/@socketsecurity/registry/lib/constants/pacote-cache-path.js +0 -9
  251. package/external/@socketsecurity/registry/lib/constants/pnpm-exec-path.js +0 -5
  252. package/external/@socketsecurity/registry/lib/constants/pnpm-lock-yaml.js +0 -3
  253. package/external/@socketsecurity/registry/lib/constants/pnpm.js +0 -3
  254. package/external/@socketsecurity/registry/lib/constants/pre-commit.js +0 -3
  255. package/external/@socketsecurity/registry/lib/constants/readme-glob-recursive.js +0 -3
  256. package/external/@socketsecurity/registry/lib/constants/readme-glob.js +0 -3
  257. package/external/@socketsecurity/registry/lib/constants/readme-md.js +0 -3
  258. package/external/@socketsecurity/registry/lib/constants/registry-scope-delimiter.js +0 -3
  259. package/external/@socketsecurity/registry/lib/constants/registry.js +0 -3
  260. package/external/@socketsecurity/registry/lib/constants/resolutions.js +0 -3
  261. package/external/@socketsecurity/registry/lib/constants/socket-github-org.js +0 -3
  262. package/external/@socketsecurity/registry/lib/constants/socket-ipc-handshake.js +0 -3
  263. package/external/@socketsecurity/registry/lib/constants/socket-override-scope.js +0 -3
  264. package/external/@socketsecurity/registry/lib/constants/socket-public-api-token.js +0 -3
  265. package/external/@socketsecurity/registry/lib/constants/socket-registry-npm-org.js +0 -3
  266. package/external/@socketsecurity/registry/lib/constants/socket-registry-package-name.js +0 -3
  267. package/external/@socketsecurity/registry/lib/constants/socket-registry-repo-name.js +0 -3
  268. package/external/@socketsecurity/registry/lib/constants/socket-registry-scope.js +0 -3
  269. package/external/@socketsecurity/registry/lib/constants/socket-security-scope.js +0 -3
  270. package/external/@socketsecurity/registry/lib/constants/spinner.js +0 -4
  271. package/external/@socketsecurity/registry/lib/constants/supports-node-compile-cache-api.js +0 -8
  272. package/external/@socketsecurity/registry/lib/constants/supports-node-compile-cache-env-var.js +0 -8
  273. package/external/@socketsecurity/registry/lib/constants/supports-node-disable-warning-flag.js +0 -8
  274. package/external/@socketsecurity/registry/lib/constants/supports-node-permission-flag.js +0 -8
  275. package/external/@socketsecurity/registry/lib/constants/supports-node-require-module.js +0 -3
  276. package/external/@socketsecurity/registry/lib/constants/supports-node-run.js +0 -8
  277. package/external/@socketsecurity/registry/lib/constants/supports-process-send.js +0 -5
  278. package/external/@socketsecurity/registry/lib/constants/ts-libs-available.js +0 -22
  279. package/external/@socketsecurity/registry/lib/constants/ts-types-available.js +0 -3
  280. package/external/@socketsecurity/registry/lib/constants/tsconfig-json.js +0 -3
  281. package/external/@socketsecurity/registry/lib/constants/undefined-token.js +0 -3
  282. package/external/@socketsecurity/registry/lib/constants/unknown-error.js +0 -3
  283. package/external/@socketsecurity/registry/lib/constants/unknown-value.js +0 -3
  284. package/external/@socketsecurity/registry/lib/constants/unlicenced.js +0 -3
  285. package/external/@socketsecurity/registry/lib/constants/unlicensed.js +0 -3
  286. package/external/@socketsecurity/registry/lib/constants/utf8.js +0 -3
  287. package/external/@socketsecurity/registry/lib/constants/vitest.js +0 -3
  288. package/external/@socketsecurity/registry/lib/constants/vlt-lock-json.js +0 -3
  289. package/external/@socketsecurity/registry/lib/constants/vlt.js +0 -3
  290. package/external/@socketsecurity/registry/lib/constants/win32.js +0 -3
  291. package/external/@socketsecurity/registry/lib/constants/yarn-berry.js +0 -3
  292. package/external/@socketsecurity/registry/lib/constants/yarn-classic.js +0 -3
  293. package/external/@socketsecurity/registry/lib/constants/yarn-exec-path.js +0 -5
  294. package/external/@socketsecurity/registry/lib/constants/yarn-lock.js +0 -3
  295. package/external/@socketsecurity/registry/lib/constants/yarn.js +0 -3
  296. package/external/@socketsecurity/registry/lib/debug.js +0 -264
  297. package/external/@socketsecurity/registry/lib/env.js +0 -62
  298. package/external/@socketsecurity/registry/lib/fs.js +0 -556
  299. package/external/@socketsecurity/registry/lib/functions.js +0 -20
  300. package/external/@socketsecurity/registry/lib/globs.js +0 -145
  301. package/external/@socketsecurity/registry/lib/json.js +0 -69
  302. package/external/@socketsecurity/registry/lib/logger.js +0 -534
  303. package/external/@socketsecurity/registry/lib/objects.js +0 -422
  304. package/external/@socketsecurity/registry/lib/packages.js +0 -1379
  305. package/external/@socketsecurity/registry/lib/path.js +0 -231
  306. package/external/@socketsecurity/registry/lib/promises.js +0 -286
  307. package/external/@socketsecurity/registry/lib/prompts.js +0 -63
  308. package/external/@socketsecurity/registry/lib/regexps.js +0 -23
  309. package/external/@socketsecurity/registry/lib/sorts.js +0 -70
  310. package/external/@socketsecurity/registry/lib/spawn.js +0 -252
  311. package/external/@socketsecurity/registry/lib/spinner.js +0 -205
  312. package/external/@socketsecurity/registry/lib/streams.js +0 -84
  313. package/external/@socketsecurity/registry/lib/strings.js +0 -235
  314. package/external/@socketsecurity/registry/lib/url.js +0 -68
  315. package/external/@socketsecurity/registry/lib/words.js +0 -45
  316. package/external/@socketsecurity/registry/manifest.json +0 -1875
@@ -1,11 +1,11 @@
1
- import registryConstants from '@socketsecurity/registry/lib/constants';
1
+ import type { RuntimeConstants, RuntimeEnv as RuntimeConstantsEnv, RuntimeInternals as RuntimeConstantsInternals } from './constants/runtime.mts';
2
+ import type { Remap } from './utils/objects.mts';
2
3
  import type { Agent } from './utils/package-environment.mts';
3
- import type { Remap } from '@socketsecurity/registry/lib/objects';
4
- declare const AT_LATEST: "@latest", BIOME_JSON: "biome.json", BUN: "bun", CI: "CI", COLUMN_LIMIT: 80, DOT_GIT_DIR: ".git", DOT_PACKAGE_LOCK_JSON: ".package-lock.json", DOT_SOCKET_DIR: ".socket", EMPTY_FILE: "/* empty */\n", EMPTY_VALUE: "<value>", ESLINT_CONFIG_JS: "eslint.config.js", ESNEXT: "esnext", EXT_CJS: ".cjs", EXT_CMD: ".cmd", EXT_CTS: ".cts", EXT_DTS: ".d.ts", EXT_JS: ".js", EXT_JSON: ".json", EXT_LOCK: ".lock", EXT_LOCKB: ".lockb", EXT_MD: ".md", EXT_MJS: ".mjs", EXT_MTS: ".mts", EXT_PS1: ".ps1", EXT_YAML: ".yaml", EXT_YML: ".yml", EXTENSIONS: "extensions", EXTENSIONS_JSON: "extensions.json", GITIGNORE: ".gitignore", LATEST: "latest", LICENSE: "LICENSE", LICENSE_GLOB: "LICEN[CS]E{[.-]*,}", LICENSE_GLOB_RECURSIVE: "**/LICEN[CS]E{[.-]*,}", LICENSE_ORIGINAL: "LICENSE.original", LICENSE_ORIGINAL_GLOB: "*.original{.*,}", LICENSE_ORIGINAL_GLOB_RECURSIVE: "**/*.original{.*,}", LOOP_SENTINEL: 1000000, MANIFEST_JSON: "manifest.json", MIT: "MIT", NODE_AUTH_TOKEN: "NODE_AUTH_TOKEN", NODE_ENV: "NODE_ENV", NODE_MODULES: "node_modules", NODE_MODULES_GLOB_RECURSIVE: "**/node_modules", NPM: "npm", NPX: "npx", OVERRIDES: "overrides", PACKAGE_DEFAULT_VERSION: "1.0.0", PACKAGE_JSON: "package.json", PACKAGE_LOCK_JSON: "package-lock.json", PNPM: "pnpm", PNPM_LOCK_YAML: "pnpm-lock.yaml", PRE_COMMIT: "PRE_COMMIT", README_GLOB: "README{.*,}", README_GLOB_RECURSIVE: "**/README{.*,}", README_MD: "README.md", REGISTRY: "registry", REGISTRY_SCOPE_DELIMITER: "__", RESOLUTIONS: "resolutions", SOCKET_GITHUB_ORG: "SocketDev", SOCKET_IPC_HANDSHAKE: "SOCKET_IPC_HANDSHAKE", SOCKET_OVERRIDE_SCOPE: "@socketoverride", SOCKET_PUBLIC_API_TOKEN: string, SOCKET_REGISTRY_NPM_ORG: "socketregistry", SOCKET_REGISTRY_PACKAGE_NAME: "@socketsecurity/registry", SOCKET_REGISTRY_REPO_NAME: "socket-registry", SOCKET_REGISTRY_SCOPE: "@socketregistry", SOCKET_SECURITY_SCOPE: "@socketsecurity", TSCONFIG_JSON: "tsconfig.json", UNKNOWN_ERROR: "Unknown error", UNKNOWN_VALUE: "<unknown>", UNLICENCED: "UNLICENCED", UNLICENSED: "UNLICENSED", UTF8: "utf8", VITEST: "VITEST", VLT: "vlt", YARN: "yarn", YARN_BERRY: "yarn/berry", YARN_CLASSIC: "yarn/classic", YARN_LOCK: "yarn.lock";
5
- export type RegistryEnv = typeof registryConstants.ENV;
6
- export type RegistryInternals = (typeof registryConstants)['Symbol(kInternalsSymbol)'];
4
+ declare const AT_LATEST: "@latest", BIOME_JSON: "biome.json", BUN: "bun", CI: "CI", COLUMN_LIMIT: 80, DOT_GIT_DIR: ".git", DOT_PACKAGE_LOCK_JSON: ".package-lock.json", DOT_SOCKET_DIR: ".socket", EMPTY_FILE: "/* empty */\n", EMPTY_VALUE: "<value>", ESLINT_CONFIG_JS: "eslint.config.js", ESNEXT: "esnext", EXT_CJS: ".cjs", EXT_CMD: ".cmd", EXT_CTS: ".cts", EXT_DTS: ".d.ts", EXT_JS: ".js", EXT_JSON: ".json", EXT_LOCK: ".lock", EXT_LOCKB: ".lockb", EXT_MD: ".md", EXT_MJS: ".mjs", EXT_MTS: ".mts", EXT_PS1: ".ps1", EXT_YAML: ".yaml", EXT_YML: ".yml", EXTENSIONS: "extensions", EXTENSIONS_JSON: "extensions.json", GITIGNORE: ".gitignore", LATEST: "latest", LICENSE: "LICENSE", LICENSE_GLOB: "LICEN[CS]E{[.-]*,}", LICENSE_GLOB_RECURSIVE: "**/LICEN[CS]E{[.-]*,}", LICENSE_ORIGINAL: "LICENSE.original", LICENSE_ORIGINAL_GLOB: "*.original{.*,}", LICENSE_ORIGINAL_GLOB_RECURSIVE: "**/*.original{.*,}", LOOP_SENTINEL: 1000000, MANIFEST_JSON: "manifest.json", MIT: "MIT", NODE_AUTH_TOKEN: "NODE_AUTH_TOKEN", NODE_ENV: "NODE_ENV", NODE_MODULES: "node_modules", NODE_MODULES_GLOB_RECURSIVE: "**/node_modules", NPM: "npm", NPX: "npx", OVERRIDES: "overrides", PACKAGE_DEFAULT_VERSION: "1.0.0", PACKAGE_JSON: "package.json", PACKAGE_LOCK_JSON: "package-lock.json", PNPM: "pnpm", PNPM_LOCK_YAML: "pnpm-lock.yaml", PRE_COMMIT: "PRE_COMMIT", README_GLOB: "README{.*,}", README_GLOB_RECURSIVE: "**/README{.*,}", README_MD: "README.md", REGISTRY: "registry", REGISTRY_SCOPE_DELIMITER: "__", RESOLUTIONS: "resolutions", SOCKET_GITHUB_ORG: "SocketDev", SOCKET_IPC_HANDSHAKE: "SOCKET_IPC_HANDSHAKE", SOCKET_OVERRIDE_SCOPE: "@socketoverride", SOCKET_PUBLIC_API_TOKEN: "sktsec_t_--RAN5U4ivauy4w37-6aoKyYPDt5ZbaT5JBVMqiwKo_api", SOCKET_REGISTRY_NPM_ORG: "socketregistry", SOCKET_REGISTRY_PACKAGE_NAME: "@socketsecurity/registry", SOCKET_REGISTRY_REPO_NAME: "socket-registry", SOCKET_REGISTRY_SCOPE: "@socketregistry", SOCKET_SECURITY_SCOPE: "@socketsecurity", TSCONFIG_JSON: "tsconfig.json", UNKNOWN_ERROR: "Unknown error", UNKNOWN_VALUE: "<unknown>", UNLICENCED: "UNLICENCED", UNLICENSED: "UNLICENSED", UTF8: "utf8", VITEST: "VITEST", VLT: "vlt", YARN: "yarn", YARN_BERRY: "yarn/berry", YARN_CLASSIC: "yarn/classic", YARN_LOCK: "yarn.lock";
5
+ export type RuntimeEnv = RuntimeConstantsEnv;
6
+ export type RuntimeInternals = RuntimeConstantsInternals;
7
7
  export type Sentry = any;
8
- export type Internals = Remap<Omit<RegistryInternals, 'getIpc'> & Readonly<{
8
+ export type Internals = Remap<Omit<RuntimeInternals, 'getIpc'> & Readonly<{
9
9
  getIpc: {
10
10
  (): Promise<IpcObject>;
11
11
  <K extends keyof IpcObject | undefined>(key?: K | undefined): Promise<K extends keyof IpcObject ? IpcObject[K] : IpcObject>;
@@ -13,7 +13,7 @@ export type Internals = Remap<Omit<RegistryInternals, 'getIpc'> & Readonly<{
13
13
  getSentry: () => Sentry;
14
14
  setSentry(Sentry: Sentry): boolean;
15
15
  }>>;
16
- export type ENV = Remap<RegistryEnv & Readonly<{
16
+ export type ENV = Remap<RuntimeEnv & Readonly<{
17
17
  DISABLE_GITHUB_CACHE: boolean;
18
18
  GITHUB_API_URL: string;
19
19
  GITHUB_BASE_REF: string;
@@ -76,7 +76,7 @@ declare const ALERT_TYPE_MILD_CVE = "mildCVE";
76
76
  declare const API_V0_URL = "https://api.socket.dev/v0/";
77
77
  // The Coana CLI version Socket CLI runs by default. Coana's release workflow
78
78
  // rewrites this line in its bump PRs.
79
- declare const COANA_CLI_VERSION = "15.15.2";
79
+ declare const COANA_CLI_VERSION = "15.15.5";
80
80
  declare const CONFIG_KEY_API_BASE_URL = "apiBaseUrl";
81
81
  declare const CONFIG_KEY_API_PROXY = "apiProxy";
82
82
  declare const CONFIG_KEY_API_TOKEN = "apiToken";
@@ -159,7 +159,7 @@ declare const SOCKET_WEBSITE_URL = "https://socket.dev";
159
159
  declare const SOCKET_YAML = "socket.yaml";
160
160
  declare const SOCKET_YML = "socket.yml";
161
161
  declare const V1_MIGRATION_GUIDE_URL = "https://docs.socket.dev/docs/v1-migration-guide";
162
- export type Constants = Remap<Omit<typeof registryConstants, 'Symbol(kInternalsSymbol)' | 'ENV' | 'ipcObject'> & {
162
+ export type Constants = Remap<Omit<RuntimeConstants, 'Symbol(kInternalsSymbol)' | 'ENV' | 'ipcObject'> & {
163
163
  readonly 'Symbol(kInternalsSymbol)': Internals;
164
164
  readonly ALERT_TYPE_CRITICAL_CVE: typeof ALERT_TYPE_CRITICAL_CVE;
165
165
  readonly ALERT_TYPE_CVE: typeof ALERT_TYPE_CVE;
@@ -299,7 +299,6 @@ export type Constants = Remap<Omit<typeof registryConstants, 'Symbol(kInternalsS
299
299
  readonly shadowYarnBinPath: string;
300
300
  readonly socketAppDataPath: string;
301
301
  readonly socketCachePath: string;
302
- readonly socketRegistryPath: string;
303
302
  readonly zshRcPath: string;
304
303
  }>;
305
304
  export declare function resolveBlessedTerm(term: string | undefined, win32: boolean): string;
@@ -0,0 +1,5 @@
1
+ export declare const COANA_CACHE_FILENAME = "coana-cache.mjs";
2
+ export declare const COANA_CACHE_SOURCE_PATH = "vendor/coana-cache.mjs";
3
+ export declare function coanaCacheDistPath(distDirectory: string): string;
4
+ export declare const COANA_CLI_WRAPPER_FILENAME = "cli-wrapper.mjs";
5
+ export declare function coanaCliWrapperPath(cliDirectory: string): string;
@@ -0,0 +1,2 @@
1
+ export declare function uvReleaseUrl(archive: string): string;
2
+ export declare function uvLicenseUrl(filename: string): string;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,4 @@
1
+ export type CdxgenFixture = 'npm' | 'yarn';
2
+ export declare const CDXGEN_FIXTURE_OUTPUT = "socket-cdx.json";
3
+ export declare function assertCdxgenFixtureOutput(cwd: string, mode: CdxgenFixture): Promise<void>;
4
+ export declare function writeCdxgenFixture(cwd: string, mode: CdxgenFixture): Promise<void>;
@@ -0,0 +1,2 @@
1
+ import type { SeaCapabilities } from '../capabilities.mts';
2
+ export declare function smokeTestSea(executable: string, cwd: string, version: string, patchVersion: string, capabilities: SeaCapabilities): Promise<void>;
@@ -1,7 +1,10 @@
1
1
  #!/usr/bin/env node
2
+ export declare function getSocketPatchPackageName(platform: string, arch: string, options?: {
3
+ libc?: 'glibc' | 'musl' | undefined;
4
+ } | undefined): string;
2
5
  export declare function sha512IntegrityHex(integrity: string): string | undefined;
3
6
  export declare function findNodeArchiveSha256(sums: string, archive: string): string | undefined;
4
- export declare function findLockedPackageIntegrity(lock: string, packageName: string, version: string): string | undefined;
7
+ export { findLockedPackageIntegrity } from './pnpm-lock.mts';
5
8
  declare function pinnedNode(target: string): Promise<{
6
9
  executable: string;
7
10
  licenseFile: string;
@@ -11,7 +14,6 @@ export declare function parseArgs(argv?: string[], env?: NodeJS.ProcessEnv): {
11
14
  platform?: string;
12
15
  arch?: string;
13
16
  outputDir: string;
14
- prototype: boolean;
15
17
  };
16
18
  declare function main(): Promise<void>;
17
19
  export { main, pinnedNode };
@@ -4,7 +4,6 @@ type DownloadBytesOptions = {
4
4
  timeoutMs?: number | undefined;
5
5
  acceptedStatuses?: readonly number[] | undefined;
6
6
  };
7
- export declare function errorMessage(error: unknown): string;
8
7
  export declare function isRetryable(error: unknown): boolean;
9
8
  export declare function cancelBody(response: Response): Promise<void>;
10
9
  export declare function failedDownload(url: string, attempts: number, cause: unknown): Error;
@@ -0,0 +1,3 @@
1
+ export declare const SEA_RESOURCES_DIRECTORY = "resources";
2
+ export declare const SEA_CAPABILITIES_PATH = "resources/capabilities.json";
3
+ export declare function seaArchivePaths(rootFiles: readonly string[]): string[];
@@ -0,0 +1 @@
1
+ export declare const SEA_COANA_CACHE_PATH = "dist/coana-cache.mjs";
@@ -0,0 +1,13 @@
1
+ export declare const SEA_NODE_LICENSE_PATH = "node-runtime-LICENSE";
2
+ export declare const SEA_SOCKET_PATCH_LICENSE_PATH = "resources/socket-patch-LICENSE.txt";
3
+ declare const TOOL_DIRECTORIES: {
4
+ readonly node: "tools/node";
5
+ readonly "socket-patch": "resources";
6
+ readonly uv: "tools/uv";
7
+ };
8
+ export type SeaNativeTool = keyof typeof TOOL_DIRECTORIES;
9
+ export declare function seaNativeToolPaths(id: SeaNativeTool, platform: string): {
10
+ binary: string;
11
+ digest: string;
12
+ };
13
+ export {};
@@ -0,0 +1,22 @@
1
+ interface PnpmLockPackage {
2
+ resolution?: {
3
+ integrity?: unknown;
4
+ };
5
+ }
6
+ interface PnpmLock {
7
+ importers?: Record<string, {
8
+ dependencies?: Record<string, unknown>;
9
+ devDependencies?: Record<string, unknown>;
10
+ optionalDependencies?: Record<string, unknown>;
11
+ } | undefined>;
12
+ packages?: Record<string, PnpmLockPackage | undefined>;
13
+ patchedDependencies?: Record<string, {
14
+ path?: string;
15
+ hash?: string;
16
+ } | string>;
17
+ }
18
+ /** Read the package graph from both single-document and split pnpm lockfiles. */
19
+ export declare function parsePnpmLock(source: string, workspaceSource?: string): PnpmLock;
20
+ export declare function readPnpmLock(root: string, lockfile?: string): Promise<PnpmLock>;
21
+ export declare function findLockedPackageIntegrity(source: string, packageName: string, version: string): string | undefined;
22
+ export {};
@@ -0,0 +1 @@
1
+ export declare function seaWorkerTypeScript(): import("rollup").Plugin<any>;
@@ -1,4 +1,5 @@
1
1
  import { type Writable } from 'node:stream';
2
+ import type { SeaNativeTool } from './paths/native-tools.mts';
2
3
  import type { StdioOptions } from 'node:child_process';
3
4
  /**
4
5
  * SEA runtime adapters. Node 27 VFS Workers share the parent PID, so these are
@@ -25,10 +26,10 @@ export interface EmbeddedToolRunResult {
25
26
  stdout?: string;
26
27
  stderr?: string;
27
28
  }
28
- export declare function isStandaloneSea(): boolean;
29
- export declare function getEmbeddedAsset(id: string): Buffer;
29
+ export declare function isSea(): boolean;
30
+ export declare function getEmbeddedVfsPath(relativePath: string): string;
30
31
  /** Fail closed unless the build manifest explicitly advertises this tool. */
31
32
  export declare function assertEmbeddedToolAvailable(id: 'cdxgen' | 'synp', capability?: 'manifest-cdxgen-npm-lock-v3' | 'manifest-cdxgen-yarn-classic'): void;
32
- export declare function getBundledTool(id: string): Promise<string>;
33
+ export declare function getBundledTool(id: SeaNativeTool): Promise<string>;
33
34
  export declare function cleanupBundledTool(filename: string): Promise<void>;
34
35
  export declare function runEmbeddedJsTool(id: string, args: readonly string[], options?: EmbeddedToolRunOptions): Promise<EmbeddedToolRunResult>;
@@ -0,0 +1,2 @@
1
+ /** Hash the paths, directory entries, and bytes that the runtime can read. */
2
+ export declare function digestVfs(root: string, entries: string[]): string;
@@ -1,5 +1,5 @@
1
1
  import type { AlertsByPurl } from '../utils/socket-package-alert.mts';
2
- import type { Spinner } from '@socketsecurity/registry/lib/spinner';
2
+ import type { Spinner } from '../utils/spinner.mts';
3
3
  export type DlxFlags = {
4
4
  // Options whose value names a package to download.
5
5
  package: ReadonlySet<string>;
@@ -1,6 +1,6 @@
1
1
  import type { ArboristInstance, Diff, NodeClass } from './arborist/types.mts';
2
2
  import type { AlertFilter, AlertsByPurl } from '../../utils/socket-package-alert.mts';
3
- import type { Spinner } from '@socketsecurity/registry/lib/spinner';
3
+ import type { Spinner } from '../../utils/spinner.mts';
4
4
  export type GetAlertsMapFromArboristOptions = {
5
5
  apiToken?: string | undefined;
6
6
  consolidate?: boolean | undefined;
@@ -1,4 +1,4 @@
1
+ import type { SpawnExtra } from '../../utils/spawn.mts';
1
2
  import type { ShadowBinOptions, ShadowBinResult } from '../npm-base.mts';
2
- import type { SpawnExtra } from '@socketsecurity/registry/lib/spawn';
3
3
  export type { ShadowBinOptions, ShadowBinResult };
4
4
  export default function shadowNpmBin(args?: string[] | readonly string[], options?: ShadowBinOptions | undefined, extra?: SpawnExtra | undefined): Promise<ShadowBinResult>;
@@ -1,6 +1,6 @@
1
- import { spawn } from '@socketsecurity/registry/lib/spawn';
2
- import type { SpawnResult } from '@socketsecurity/registry/lib/spawn';
3
- import type { Spinner } from '@socketsecurity/registry/lib/spinner';
1
+ import { spawn } from '../../utils/spawn.mts';
2
+ import type { SpawnResult } from '../../utils/spawn.mts';
3
+ import type { Spinner } from '../../utils/spinner.mts';
4
4
  type SpawnOption = Exclude<Parameters<typeof spawn>[2], undefined>;
5
5
  export type ShadowNpmInstallOptions = SpawnOption & {
6
6
  agentExecPath?: string | undefined;
@@ -1,6 +1,6 @@
1
1
  import { NPM, NPX } from '../constants.mts';
2
2
  import type { IpcObject } from '../constants.mts';
3
- import type { SpawnExtra, SpawnOptions, SpawnResult } from '@socketsecurity/registry/lib/spawn';
3
+ import type { SpawnExtra, SpawnOptions, SpawnResult } from '../utils/spawn.mts';
4
4
  export type ShadowBinOptions = SpawnOptions & {
5
5
  ipc?: IpcObject | undefined;
6
6
  };
@@ -1,4 +1,4 @@
1
+ import type { SpawnExtra } from '../../utils/spawn.mts';
1
2
  import type { ShadowBinOptions, ShadowBinResult } from '../npm-base.mts';
2
- import type { SpawnExtra } from '@socketsecurity/registry/lib/spawn';
3
3
  export type { ShadowBinOptions, ShadowBinResult };
4
4
  export default function shadowNpxBin(args?: string[] | readonly string[], options?: ShadowBinOptions | undefined, extra?: SpawnExtra | undefined): Promise<ShadowBinResult>;
@@ -1,5 +1,5 @@
1
1
  import type { IpcObject } from '../../constants.mts';
2
- import type { SpawnExtra, SpawnOptions, SpawnResult } from '@socketsecurity/registry/lib/spawn';
2
+ import type { SpawnExtra, SpawnOptions, SpawnResult } from '../../utils/spawn.mts';
3
3
  export type ShadowPnpmOptions = SpawnOptions & {
4
4
  ipc?: IpcObject | undefined;
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import type { IpcObject } from '../../constants.mts';
2
- import type { SpawnExtra, SpawnOptions, SpawnResult } from '@socketsecurity/registry/lib/spawn';
2
+ import type { SpawnExtra, SpawnOptions, SpawnResult } from '../../utils/spawn.mts';
3
3
  export type ShadowYarnOptions = SpawnOptions & {
4
4
  ipc?: IpcObject | undefined;
5
5
  };
@@ -1,3 +1,8 @@
1
+ /**
2
+ * Mock utilities for Socket authentication and login flow.
3
+ * Provides test doubles for authentication-related functionality.
4
+ */
5
+ import type { Mock } from 'vitest';
1
6
  export declare const MOCK_API_TOKEN = "mock_socket_api_token_1234567890";
2
7
  export declare const MOCK_ORG_NAME = "test-org";
3
8
  export declare const MOCK_ORG_ID = "org_123456";
@@ -13,48 +18,59 @@ export interface MockAuthResponse {
13
18
  name: string;
14
19
  };
15
20
  }
21
+ type MockFunction<Args extends unknown[], Result> = Mock<(...args: Args) => Result>;
22
+ interface MockConfigStorage {
23
+ get: Mock<(key: string) => unknown>;
24
+ set: Mock<(key: string, value: unknown) => boolean>;
25
+ unset: Mock<(key: string) => boolean>;
26
+ has: Mock<(key: string) => boolean>;
27
+ clear: Mock<() => void>;
28
+ storage: Map<string, unknown>;
29
+ }
30
+ interface MockAuthenticatedApiClient {
31
+ isAuthenticated: Mock<() => boolean>;
32
+ getToken: Mock<() => string | null>;
33
+ setToken: Mock<(...args: unknown[]) => unknown>;
34
+ clearToken: Mock<(...args: unknown[]) => unknown>;
35
+ validateToken: Mock<() => Promise<boolean>>;
36
+ getOrganizations: Mock<() => Promise<Array<{
37
+ id: string;
38
+ name: string;
39
+ }>>>;
40
+ }
16
41
  /**
17
42
  * Mock the interactive login flow.
18
43
  * Simulates opening browser, polling for auth completion.
19
44
  */
20
45
  export declare function mockInteractiveLogin(options?: {
21
46
  shouldSucceed?: boolean;
22
- }): import("vitest").Mock<(...args: any[]) => any>;
47
+ }): MockFunction<[], Promise<MockAuthResponse>>;
23
48
  /**
24
49
  * Mock configuration storage for auth tokens.
25
50
  */
26
- export declare function mockConfigStorage(): {
27
- get: import("vitest").Mock<(key: string) => any>;
28
- set: import("vitest").Mock<(key: string, value: any) => boolean>;
29
- unset: import("vitest").Mock<(key: string) => boolean>;
30
- has: import("vitest").Mock<(key: string) => boolean>;
31
- clear: import("vitest").Mock<() => void>;
32
- storage: Map<string, any>;
33
- };
51
+ export declare function mockConfigStorage(): MockConfigStorage;
34
52
  /**
35
53
  * Mock API client with authentication.
36
54
  */
37
55
  export declare function mockAuthenticatedApiClient(options?: {
38
56
  isAuthenticated?: boolean;
39
- }): {
40
- isAuthenticated: import("vitest").Mock<(...args: any[]) => any>;
41
- getToken: import("vitest").Mock<(...args: any[]) => any>;
42
- setToken: import("vitest").Mock<(...args: any[]) => any>;
43
- clearToken: import("vitest").Mock<(...args: any[]) => any>;
44
- validateToken: import("vitest").Mock<(...args: any[]) => any>;
45
- getOrganizations: import("vitest").Mock<(...args: any[]) => any>;
46
- };
57
+ }): MockAuthenticatedApiClient;
47
58
  /**
48
59
  * Mock browser opener for OAuth flow.
49
60
  */
50
- export declare function mockBrowserOpener(): import("vitest").Mock<(...args: any[]) => any>;
61
+ export declare function mockBrowserOpener(): MockFunction<[
62
+ ...args: unknown[]
63
+ ], Promise<void>>;
51
64
  /**
52
65
  * Mock OAuth polling mechanism.
53
66
  */
54
67
  export declare function mockOAuthPoller(options?: {
55
68
  shouldSucceed?: boolean;
56
69
  pollCount?: number;
57
- }): import("vitest").Mock<(...args: any[]) => any>;
70
+ }): MockFunction<[], Promise<{
71
+ pending: boolean;
72
+ token?: string;
73
+ }>>;
58
74
  /**
59
75
  * Complete mock setup for login command testing.
60
76
  */
@@ -62,26 +78,11 @@ export declare function setupLoginMocks(options?: {
62
78
  authenticated?: boolean;
63
79
  loginShouldSucceed?: boolean;
64
80
  }): {
65
- config: {
66
- get: import("vitest").Mock<(key: string) => any>;
67
- set: import("vitest").Mock<(key: string, value: any) => boolean>;
68
- unset: import("vitest").Mock<(key: string) => boolean>;
69
- has: import("vitest").Mock<(key: string) => boolean>;
70
- clear: import("vitest").Mock<() => void>;
71
- storage: Map<string, any>;
72
- };
73
- apiClient: {
74
- isAuthenticated: import("vitest").Mock<(...args: any[]) => any>;
75
- getToken: import("vitest").Mock<(...args: any[]) => any>;
76
- setToken: import("vitest").Mock<(...args: any[]) => any>;
77
- clearToken: import("vitest").Mock<(...args: any[]) => any>;
78
- validateToken: import("vitest").Mock<(...args: any[]) => any>;
79
- getOrganizations: import("vitest").Mock<(...args: any[]) => any>;
80
- };
81
- browserOpener: import("vitest").Mock<(...args: any[]) => any>;
82
- authFlow: import("vitest").Mock<(...args: any[]) => any>;
83
- // Helper to verify login completed.
81
+ config: MockConfigStorage;
82
+ apiClient: MockAuthenticatedApiClient;
83
+ browserOpener: ReturnType<typeof mockBrowserOpener>;
84
+ authFlow: ReturnType<typeof mockInteractiveLogin>;
84
85
  expectLoginSuccess: () => void;
85
- // Helper to verify logout completed.
86
86
  expectLogoutSuccess: () => void;
87
87
  };
88
+ export {};
@@ -1,5 +1,10 @@
1
1
  import type { EnvDetails } from './package-environment.mts';
2
- import type { SpawnExtra, SpawnOptions, SpawnResult } from '@socketsecurity/registry/lib/spawn';
2
+ import type { SpawnExtra, SpawnOptions, SpawnResult } from './spawn.mts';
3
+ export declare function isNpmAuditFlag(arg: string): boolean;
4
+ export declare function isNpmFundFlag(arg: string): boolean;
5
+ export declare function isNpmLoglevelFlag(arg: string): boolean;
6
+ export declare function isNpmNodeOptionsFlag(arg: string): boolean;
7
+ export declare function isNpmProgressFlag(arg: string): boolean;
3
8
  /** Run the detected package manager's install command with Socket's safe defaults. */
4
9
  export declare function runAgentInstall(pkgEnvDetails: EnvDetails, options?: SpawnOptions & {
5
10
  args?: string[] | readonly string[];
@@ -1,4 +1,4 @@
1
- import type { Remap } from '@socketsecurity/registry/lib/objects';
1
+ import type { Remap } from '../objects.mts';
2
2
  import type { ALERT_ACTION, ALERT_TYPE, CompactSocketArtifact, CompactSocketArtifactAlert, SocketArtifact, SocketArtifactAlert } from '@socketsecurity/sdk';
3
3
  export type { ALERT_ACTION, ALERT_TYPE, CompactSocketArtifact, CompactSocketArtifactAlert, SocketArtifact, SocketArtifactAlert, };
4
4
  export type CVE_ALERT_TYPE = 'cve' | 'mediumCVE' | 'mildCVE' | 'criticalCVE';
@@ -1,6 +1,6 @@
1
1
  import type { AlertFilter, AlertsByPurl } from './socket-package-alert.mts';
2
+ import type { Spinner } from './spinner.mts';
2
3
  import type { LockfileObject } from '@pnpm/lockfile.fs';
3
- import type { Spinner } from '@socketsecurity/registry/lib/spinner';
4
4
  export type GetAlertsMapFromPnpmLockfileOptions = {
5
5
  apiToken?: string | undefined;
6
6
  consolidate?: boolean | undefined;
@@ -1,5 +1,5 @@
1
1
  import type { CResult } from '../types.mts';
2
- import type { Spinner } from '@socketsecurity/registry/lib/spinner';
2
+ import type { Spinner } from './spinner.mts';
3
3
  // All outbound API requests use node:https.request rather than global fetch.
4
4
  // This ensures no body timeout is applied — large streaming ND-JSON responses
5
5
  // (e.g. full scan results) can transfer without a hard deadline. An explicit
@@ -0,0 +1,6 @@
1
+ /** Join values with the English conjunction "and". */
2
+ export declare function joinAnd(values: readonly string[]): string;
3
+ /** Return an array containing each value once, preserving its first occurrence. */
4
+ export declare function arrayUnique<T>(values: readonly T[]): T[];
5
+ /** Join values with the English disjunction "or". */
6
+ export declare function joinOr(values: readonly string[]): string;
@@ -0,0 +1,26 @@
1
+ export declare function resolveBinPathSync(input: string): string;
2
+ type LookupOptions = {
3
+ all?: boolean;
4
+ nothrow?: boolean;
5
+ path?: string;
6
+ pathExt?: string;
7
+ };
8
+ export declare function whichBin(name: string, options: LookupOptions & {
9
+ all: true;
10
+ nothrow: true;
11
+ }): Promise<string[] | null>;
12
+ export declare function whichBin(name: string, options: LookupOptions & {
13
+ nothrow: true;
14
+ all?: false;
15
+ }): Promise<string | null>;
16
+ export declare function whichBin(name: string, options?: LookupOptions): Promise<string>;
17
+ export declare function whichBinSync(name: string, options: LookupOptions & {
18
+ all: true;
19
+ nothrow: true;
20
+ }): string[] | null;
21
+ export declare function whichBinSync(name: string, options: LookupOptions & {
22
+ nothrow: true;
23
+ all?: false;
24
+ }): string | null;
25
+ export declare function whichBinSync(name: string, options?: LookupOptions): string;
26
+ export {};
@@ -1,10 +1,12 @@
1
- import type { CResult } from '../types.mts';
2
- import type { SpawnOptions } from '@socketsecurity/registry/lib/spawn';
3
- import type { Spinner } from '@socketsecurity/registry/lib/spinner';
1
+ import type { CResult } from '../../types.mts';
2
+ import type { SpawnOptions } from '../spawn.mts';
3
+ import type { Spinner } from '../spinner.mts';
4
4
  type CoanaSpawnOptions = {
5
5
  coanaVersion?: string | undefined;
6
6
  cwd?: string | URL | undefined;
7
7
  env?: Record<string, string | undefined> | undefined;
8
+ // The resolved Coana release must meet the minimum version for this command.
9
+ minimumVersion?: string | undefined;
8
10
  repoName?: string | undefined;
9
11
  spinner?: Spinner | undefined;
10
12
  stdio?: SpawnOptions['stdio'] | undefined;
@@ -1,49 +1,23 @@
1
- /**
2
- * Debug utilities for Socket CLI.
3
- * Provides structured debugging with categorized levels and helpers.
4
- *
5
- * Debug Categories:
6
- * DEFAULT (shown with SOCKET_CLI_DEBUG=1):
7
- * - 'error': Critical errors that prevent operation
8
- * - 'warn': Important warnings that may affect behavior
9
- * - 'notice': Notable events and state changes
10
- * - 'silly': Very verbose debugging info
11
- *
12
- * OPT-IN ONLY (require explicit DEBUG='category' even with SOCKET_CLI_DEBUG=1):
13
- * - 'inspect': Detailed object inspection (DEBUG='inspect' or DEBUG='*')
14
- * - 'stdio': Command execution logs (DEBUG='stdio' or DEBUG='*')
15
- *
16
- * These opt-in categories are intentionally excluded from default debug output
17
- * to reduce noise. Enable them explicitly when needed for deep debugging.
18
- */
19
- import { debugDir, debugFn, isDebug } from '@socketsecurity/registry/lib/debug';
20
- /**
21
- * Debug an API request start.
22
- * Logs essential info without exposing sensitive data.
23
- */
24
- export declare function debugApiRequest(method: string, endpoint: string, timeout?: number | undefined): void;
25
- /**
26
- * Debug an API response end.
27
- * Logs essential info without exposing sensitive data.
28
- */
29
- export declare function debugApiResponse(method: string, endpoint: string, status?: number | undefined, error?: unknown | undefined, duration?: number | undefined, headers?: Record<string, string> | undefined): void;
30
- /**
31
- * Debug file operation.
32
- * Logs file operations with appropriate level.
33
- */
34
- export declare function debugFileOp(operation: 'read' | 'write' | 'delete' | 'create', filepath: string, error?: unknown | undefined): void;
35
- /**
36
- * Debug package scanning.
37
- * Provides insight into security scanning.
38
- */
39
- export declare function debugScan(phase: 'start' | 'progress' | 'complete' | 'error', packageCount?: number | undefined, details?: unknown | undefined): void;
40
- /**
41
- * Debug configuration loading.
42
- */
43
- export declare function debugConfig(source: string, found: boolean, error?: unknown | undefined): void;
44
- /**
45
- * Debug git operations.
46
- * Only logs important git operations, not every command.
47
- */
48
- export declare function debugGit(operation: string, success: boolean, details?: Record<string, unknown> | undefined): void;
49
- export { debugDir, debugFn, isDebug };
1
+ import util from 'node:util';
2
+ type SpinnerLike = {
3
+ isSpinning: boolean;
4
+ start(): unknown;
5
+ stop(): unknown;
6
+ };
7
+ type DebugOptions = {
8
+ namespaces?: string;
9
+ spinner?: SpinnerLike;
10
+ };
11
+ type NamespaceArg = string | DebugOptions;
12
+ export declare function isDebug(namespaces?: string): boolean;
13
+ export declare function debugDir(namespacesOrOpts: NamespaceArg, obj: unknown, inspectOptions?: util.InspectOptions): void;
14
+ export declare function debugFn(namespacesOrOpts: NamespaceArg, ...args: unknown[]): void;
15
+ export declare function debugLog(namespacesOrOpts: NamespaceArg, ...args: unknown[]): void;
16
+ /** Structured CLI debug helpers retained from the existing Socket CLI module. */
17
+ export declare function debugApiRequest(method: string, endpoint: string, timeout?: number): void;
18
+ export declare function debugApiResponse(method: string, endpoint: string, status?: number, error?: unknown, duration?: number, headers?: Record<string, string>): void;
19
+ export declare function debugFileOp(operation: 'read' | 'write' | 'delete' | 'create', filepath: string, error?: unknown): void;
20
+ export declare function debugScan(phase: 'start' | 'progress' | 'complete' | 'error', packageCount?: number, details?: unknown): void;
21
+ export declare function debugConfig(source: string, found: boolean, error?: unknown): void;
22
+ export declare function debugGit(operation: string, success: boolean, details?: Record<string, unknown>): void;
23
+ export {};
@@ -1,5 +1,5 @@
1
+ import type { SpawnExtra } from './spawn.mts';
1
2
  import type { ShadowBinOptions, ShadowBinResult } from '../shadow/npm-base.mts';
2
- import type { SpawnExtra } from '@socketsecurity/registry/lib/spawn';
3
3
  export type DlxOptions = ShadowBinOptions & {
4
4
  agent?: 'npm' | 'pnpm' | 'yarn' | undefined;
5
5
  silent?: boolean | undefined;
@@ -1,15 +1,7 @@
1
- import type { EcosystemString } from '@socketsecurity/registry';
2
1
  import type { components } from '@socketsecurity/sdk/types/api';
3
2
  export type PURL_Type = components['schemas']['SocketPURL_Type'];
4
3
  type ExpectNever<T extends never> = T;
5
- // Temporarily commented out due to dependency version mismatch.
6
- // SDK has "alpm" but registry's EcosystemString doesn't yet.
7
- // type MissingInEcosystemString = Exclude<PURL_Type, EcosystemString>
8
- type ExtraInEcosystemString = Exclude<EcosystemString, PURL_Type>;
9
- // export type _Check_EcosystemString_has_all_purl_types =
10
- // ExpectNever<MissingInEcosystemString>
11
- export type _Check_EcosystemString_has_no_extras = ExpectNever<ExtraInEcosystemString>;
12
- export declare const ALL_ECOSYSTEMS: readonly ["alpm", "apk", "bitbucket", "cargo", "chrome", "clawhub", "cocoapods", "composer", "conan", "conda", "cran", "deb", "docker", "gem", "generic", "github", "golang", "hackage", "hex", "huggingface", "maven", "mlflow", "npm", "nuget", "oci", "pub", "pypi", "qpkg", "rpm", "socket", "swift", "swid", "unknown", "vscode"];
4
+ export declare const ALL_ECOSYSTEMS: readonly ["alpm", "apk", "bitbucket", "cargo", "chrome", "clawhub", "cocoapods", "composer", "conan", "conda", "cran", "deb", "docker", "edge-extension", "firefox-extension", "gem", "generic", "github", "golang", "hackage", "hex", "huggingface", "maven", "mlflow", "npm", "nuget", "oci", "pub", "pypi", "qpkg", "rpm", "socket", "swift", "swid", "unknown", "vscode", "vscode-extension"];
13
5
  type AllEcosystemsUnion = (typeof ALL_ECOSYSTEMS)[number];
14
6
  type MissingInAllEcosystems = Exclude<PURL_Type, AllEcosystemsUnion>;
15
7
  type ExtraInAllEcosystems = Exclude<AllEcosystemsUnion, PURL_Type>;
@@ -0,0 +1,24 @@
1
+ /**
2
+ * Convert an environment variable value to a boolean.
3
+ * @param value The value to convert.
4
+ * @param defaultValue Default value when input is null/undefined.
5
+ * @returns The boolean representation of the value.
6
+ */
7
+ /*@__NO_SIDE_EFFECTS__*/
8
+ export declare function envAsBoolean(value: unknown, defaultValue?: boolean): boolean;
9
+ /**
10
+ * Convert an environment variable value to a number.
11
+ * @param value The value to convert.
12
+ * @param defaultValue Default value when conversion fails.
13
+ * @returns The numeric representation of the value.
14
+ */
15
+ /*@__NO_SIDE_EFFECTS__*/
16
+ export declare function envAsNumber(value: unknown, defaultValue?: number): number;
17
+ /**
18
+ * Convert an environment variable value to a trimmed string.
19
+ * @param value The value to convert.
20
+ * @param defaultValue Default value when input is null/undefined.
21
+ * @returns The trimmed string representation of the value.
22
+ */
23
+ /*@__NO_SIDE_EFFECTS__*/
24
+ export declare function envAsString(value: unknown, defaultValue?: string): string;
@@ -40,9 +40,9 @@ export declare function getErrorMessageOr(error: unknown, fallback: string): str
40
40
  * @returns The error message or UNKNOWN_ERROR constant
41
41
  *
42
42
  * @example
43
- * return { ok: false, message: 'Operation failed', cause: getErrorCause(e) }
43
+ * return { ok: false, message: 'Operation failed', cause: errorMessage(e) }
44
44
  */
45
- export declare function getErrorCause(error: unknown): string;
45
+ export declare function errorMessage(error: unknown): string;
46
46
  /**
47
47
  * Formats an error message with an optional error detail appended.
48
48
  * Extracts the message from an unknown error value and appends it