@socketsecurity/cli 1.14.1 → 1.16.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 (784) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/README.md +42 -10
  3. package/dist/.config/tsconfig.dts.tsbuildinfo +1 -0
  4. package/dist/cli.js +2811 -1149
  5. package/dist/cli.js.map +1 -1
  6. package/dist/constants.js +53 -19
  7. package/dist/constants.js.map +1 -1
  8. package/dist/manifest-scripts/dotnet-tool/socket-facts-dotnet.deps.json +2 -1
  9. package/dist/manifest-scripts/dotnet-tool/socket-facts-dotnet.dll +0 -0
  10. package/dist/manifest-scripts/maven-extension/coana-maven-extension.jar +0 -0
  11. package/dist/shadow-npm-bin2.js +5 -2
  12. package/dist/shadow-npm-bin2.js.map +1 -1
  13. package/dist/shadow-pnpm-bin2.js +3 -2
  14. package/dist/shadow-pnpm-bin2.js.map +1 -1
  15. package/dist/shadow-yarn-bin.js +4 -2
  16. package/dist/shadow-yarn-bin.js.map +1 -1
  17. package/dist/types/cli.d.mts +0 -1
  18. package/dist/types/commands/analytics/cmd-analytics.d.mts +0 -1
  19. package/dist/types/commands/analytics/fetch-org-analytics.d.mts +0 -1
  20. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts +0 -1
  21. package/dist/types/commands/analytics/handle-analytics.d.mts +0 -1
  22. package/dist/types/commands/analytics/output-analytics.d.mts +0 -1
  23. package/dist/types/commands/audit-log/cmd-audit-log.d.mts +0 -1
  24. package/dist/types/commands/audit-log/fetch-audit-log.d.mts +0 -1
  25. package/dist/types/commands/audit-log/handle-audit-log.d.mts +0 -1
  26. package/dist/types/commands/audit-log/output-audit-log.d.mts +0 -1
  27. package/dist/types/commands/ci/cmd-ci.d.mts +0 -1
  28. package/dist/types/commands/ci/fetch-default-org-slug.d.mts +0 -1
  29. package/dist/types/commands/ci/handle-ci.d.mts +0 -1
  30. package/dist/types/commands/config/cmd-config-auto.d.mts +0 -1
  31. package/dist/types/commands/config/cmd-config-get.d.mts +0 -1
  32. package/dist/types/commands/config/cmd-config-list.d.mts +0 -1
  33. package/dist/types/commands/config/cmd-config-set.d.mts +0 -1
  34. package/dist/types/commands/config/cmd-config-unset.d.mts +0 -1
  35. package/dist/types/commands/config/cmd-config.d.mts +0 -1
  36. package/dist/types/commands/config/discover-config-value.d.mts +0 -1
  37. package/dist/types/commands/config/handle-config-auto.d.mts +0 -1
  38. package/dist/types/commands/config/handle-config-get.d.mts +0 -1
  39. package/dist/types/commands/config/handle-config-set.d.mts +0 -1
  40. package/dist/types/commands/config/handle-config-unset.d.mts +0 -1
  41. package/dist/types/commands/config/output-config-auto.d.mts +0 -1
  42. package/dist/types/commands/config/output-config-get.d.mts +0 -1
  43. package/dist/types/commands/config/output-config-list.d.mts +0 -1
  44. package/dist/types/commands/config/output-config-set.d.mts +0 -1
  45. package/dist/types/commands/config/output-config-unset.d.mts +0 -1
  46. package/dist/types/commands/fix/branch-cleanup.d.mts +0 -1
  47. package/dist/types/commands/fix/cmd-fix.d.mts +0 -1
  48. package/dist/types/commands/fix/coana-fix.d.mts +0 -1
  49. package/dist/types/commands/fix/env-helpers.d.mts +0 -1
  50. package/dist/types/commands/fix/generated-socket-facts.d.mts +2 -1
  51. package/dist/types/commands/fix/git.d.mts +0 -1
  52. package/dist/types/commands/fix/handle-fix.d.mts +0 -1
  53. package/dist/types/commands/fix/output-fix-result.d.mts +0 -1
  54. package/dist/types/commands/fix/pull-request.d.mts +0 -1
  55. package/dist/types/commands/fix/types.d.mts +0 -1
  56. package/dist/types/commands/install/cmd-install-completion.d.mts +0 -1
  57. package/dist/types/commands/install/cmd-install.d.mts +0 -1
  58. package/dist/types/commands/install/handle-install-completion.d.mts +0 -1
  59. package/dist/types/commands/install/output-install-completion.d.mts +0 -1
  60. package/dist/types/commands/install/setup-tab-completion.d.mts +0 -1
  61. package/dist/types/commands/json/cmd-json.d.mts +0 -1
  62. package/dist/types/commands/json/handle-cmd-json.d.mts +0 -1
  63. package/dist/types/commands/json/output-cmd-json.d.mts +0 -1
  64. package/dist/types/commands/login/apply-login.d.mts +0 -1
  65. package/dist/types/commands/login/attempt-login.d.mts +5 -2
  66. package/dist/types/commands/login/cmd-login.d.mts +0 -1
  67. package/dist/types/commands/logout/apply-logout.d.mts +0 -1
  68. package/dist/types/commands/logout/attempt-logout.d.mts +1 -2
  69. package/dist/types/commands/logout/cmd-logout.d.mts +0 -1
  70. package/dist/types/commands/manifest/bazel/bazel-socket-json-trust.d.mts +34 -0
  71. package/dist/types/commands/manifest/bazel/{bazel-bin-detect.d.mts → bin-detect.d.mts} +0 -1
  72. package/dist/types/commands/manifest/bazel/{bazel-cleanup.d.mts → cleanup.d.mts} +1 -2
  73. package/dist/types/commands/manifest/bazel/cmd-manifest-bazel.d.mts +0 -1
  74. package/dist/types/commands/manifest/bazel/{bazel-cquery.d.mts → cquery.d.mts} +1 -2
  75. package/dist/types/commands/manifest/bazel/extract_bazel_to_maven.d.mts +1 -2
  76. package/dist/types/commands/manifest/bazel/extract_bazel_to_pypi.d.mts +1 -1
  77. package/dist/types/commands/manifest/bazel/{bazel-java-shim.d.mts → java-shim.d.mts} +0 -1
  78. package/dist/types/commands/manifest/bazel/{bazel-output-base-check.d.mts → output-base-check.d.mts} +0 -1
  79. package/dist/types/commands/manifest/bazel/paths/manifest.d.mts +7 -0
  80. package/dist/types/commands/manifest/bazel/{bazel-process.d.mts → process.d.mts} +1 -1
  81. package/dist/types/commands/manifest/bazel/{bazel-pypi-discovery.d.mts → pypi-discovery.d.mts} +1 -2
  82. package/dist/types/commands/manifest/bazel/{bazel-pypi-parser.d.mts → pypi-parser.d.mts} +0 -1
  83. package/dist/types/commands/manifest/bazel/{bazel-python-shim.d.mts → python-shim.d.mts} +0 -1
  84. package/dist/types/commands/manifest/bazel/{bazel-query-runner.d.mts → query-runner.d.mts} +5 -6
  85. package/dist/types/commands/manifest/bazel/{bazel-repo-discovery.d.mts → repo-discovery.d.mts} +0 -1
  86. package/dist/types/commands/manifest/bazel/{bazel-workspace-detect.d.mts → workspace-detect.d.mts} +0 -1
  87. package/dist/types/commands/manifest/bazel/{bazel-workspace-walk.d.mts → workspace-walk.d.mts} +0 -1
  88. package/dist/types/commands/manifest/build-root-config.d.mts +27 -0
  89. package/dist/types/commands/manifest/cmd-manifest-auto.d.mts +0 -1
  90. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts +0 -1
  91. package/dist/types/commands/manifest/cmd-manifest-conda.d.mts +0 -1
  92. package/dist/types/commands/manifest/cmd-manifest-dotnet.d.mts +0 -1
  93. package/dist/types/commands/manifest/cmd-manifest-dynamic-sbom-inference.d.mts +0 -1
  94. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts +0 -1
  95. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts +0 -1
  96. package/dist/types/commands/manifest/cmd-manifest-maven.d.mts +0 -1
  97. package/dist/types/commands/manifest/cmd-manifest-scala.d.mts +0 -1
  98. package/dist/types/commands/manifest/cmd-manifest-setup.d.mts +0 -1
  99. package/dist/types/commands/manifest/cmd-manifest.d.mts +0 -1
  100. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts +0 -1
  101. package/dist/types/commands/manifest/convert-dotnet-to-facts.d.mts +0 -1
  102. package/dist/types/commands/manifest/convert-gradle-to-facts.d.mts +0 -1
  103. package/dist/types/commands/manifest/convert-maven-to-facts.d.mts +0 -1
  104. package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts +0 -1
  105. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts +0 -1
  106. package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts +0 -1
  107. package/dist/types/commands/manifest/detect-manifest-actions.d.mts +0 -1
  108. package/dist/types/commands/manifest/discover-manifest-roots.d.mts +23 -8
  109. package/dist/types/commands/manifest/enumerate-workspaces.d.mts +3 -5
  110. package/dist/types/commands/manifest/expand-env-var-refs.d.mts +0 -1
  111. package/dist/types/commands/manifest/generate-recursive-manifests.d.mts +15 -7
  112. package/dist/types/commands/manifest/generate_auto_manifest.d.mts +0 -1
  113. package/dist/types/commands/manifest/handle-manifest-conda.d.mts +0 -1
  114. package/dist/types/commands/manifest/handle-manifest-dynamic-sbom-inference.d.mts +0 -1
  115. package/dist/types/commands/manifest/handle-manifest-setup.d.mts +0 -1
  116. package/dist/types/commands/manifest/load-build.d.mts +19 -0
  117. package/dist/types/commands/manifest/manifest-flags.d.mts +0 -1
  118. package/dist/types/commands/manifest/output-manifest-dynamic-sbom-inference.d.mts +0 -1
  119. package/dist/types/commands/manifest/output-manifest-setup.d.mts +0 -1
  120. package/dist/types/commands/manifest/output-requirements.d.mts +0 -1
  121. package/dist/types/commands/manifest/parse-build-tool-opts.d.mts +0 -1
  122. package/dist/types/commands/manifest/run-cdxgen.d.mts +0 -1
  123. package/dist/types/commands/manifest/run-manifest-facts.d.mts +3 -1
  124. package/dist/types/commands/manifest/scripts/assemble.d.mts +0 -1
  125. package/dist/types/commands/manifest/scripts/build-tool.d.mts +9 -5
  126. package/dist/types/commands/manifest/scripts/exclude-paths-glob.d.mts +0 -1
  127. package/dist/types/commands/manifest/scripts/facts.d.mts +4 -3
  128. package/dist/types/commands/manifest/scripts/records.d.mts +2 -1
  129. package/dist/types/commands/manifest/scripts/resolution-report-gradle.d.mts +0 -1
  130. package/dist/types/commands/manifest/scripts/resolution-report-ivy.d.mts +0 -1
  131. package/dist/types/commands/manifest/scripts/resolution-report-maven.d.mts +0 -1
  132. package/dist/types/commands/manifest/scripts/resolution-report-nuget.d.mts +0 -1
  133. package/dist/types/commands/manifest/scripts/resolution-report-render.d.mts +0 -1
  134. package/dist/types/commands/manifest/scripts/resolution-report.d.mts +0 -1
  135. package/dist/types/commands/manifest/scripts/run.d.mts +0 -1
  136. package/dist/types/commands/manifest/scripts/sidecar.d.mts +1 -3
  137. package/dist/types/commands/manifest/scripts/test/assemble-records.d.mts +1 -0
  138. package/dist/types/commands/manifest/setup-manifest-config.d.mts +0 -1
  139. package/dist/types/commands/manifest/setup-recursive-manifest-config.d.mts +10 -65
  140. package/dist/types/commands/npm/cmd-npm.d.mts +0 -1
  141. package/dist/types/commands/npx/cmd-npx.d.mts +0 -1
  142. package/dist/types/commands/oops/cmd-oops.d.mts +0 -1
  143. package/dist/types/commands/optimize/add-overrides.d.mts +0 -1
  144. package/dist/types/commands/optimize/apply-optimization.d.mts +0 -1
  145. package/dist/types/commands/optimize/cmd-optimize.d.mts +0 -1
  146. package/dist/types/commands/optimize/deps-includes-by-agent.d.mts +0 -1
  147. package/dist/types/commands/optimize/get-dependency-entries.d.mts +0 -1
  148. package/dist/types/commands/optimize/get-overrides-by-agent.d.mts +0 -1
  149. package/dist/types/commands/optimize/handle-optimize.d.mts +0 -1
  150. package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts +0 -1
  151. package/dist/types/commands/optimize/ls-by-agent.d.mts +0 -1
  152. package/dist/types/commands/optimize/output-optimize-result.d.mts +0 -1
  153. package/dist/types/commands/optimize/shared.d.mts +0 -1
  154. package/dist/types/commands/optimize/types.d.mts +0 -1
  155. package/dist/types/commands/optimize/update-lockfile.d.mts +0 -1
  156. package/dist/types/commands/optimize/update-manifest-by-agent.d.mts +0 -1
  157. package/dist/types/commands/organization/cmd-organization-dependencies.d.mts +0 -1
  158. package/dist/types/commands/organization/cmd-organization-list.d.mts +0 -1
  159. package/dist/types/commands/organization/cmd-organization-policy-license.d.mts +0 -1
  160. package/dist/types/commands/organization/cmd-organization-policy-security.d.mts +0 -1
  161. package/dist/types/commands/organization/cmd-organization-policy.d.mts +0 -1
  162. package/dist/types/commands/organization/cmd-organization-quota.d.mts +0 -1
  163. package/dist/types/commands/organization/cmd-organization.d.mts +0 -1
  164. package/dist/types/commands/organization/dependencies-filters.d.mts +10 -0
  165. package/dist/types/commands/organization/fetch-dependencies.d.mts +1 -1
  166. package/dist/types/commands/organization/fetch-license-policy.d.mts +0 -1
  167. package/dist/types/commands/organization/fetch-organization-list.d.mts +0 -1
  168. package/dist/types/commands/organization/fetch-quota.d.mts +0 -1
  169. package/dist/types/commands/organization/fetch-security-policy.d.mts +0 -1
  170. package/dist/types/commands/organization/handle-dependencies.d.mts +2 -2
  171. package/dist/types/commands/organization/handle-license-policy.d.mts +0 -1
  172. package/dist/types/commands/organization/handle-organization-list.d.mts +0 -1
  173. package/dist/types/commands/organization/handle-quota.d.mts +0 -1
  174. package/dist/types/commands/organization/handle-security-policy.d.mts +0 -1
  175. package/dist/types/commands/organization/output-dependencies.d.mts +0 -1
  176. package/dist/types/commands/organization/output-license-policy.d.mts +0 -1
  177. package/dist/types/commands/organization/output-organization-list.d.mts +0 -1
  178. package/dist/types/commands/organization/output-quota.d.mts +0 -1
  179. package/dist/types/commands/organization/output-security-policy.d.mts +0 -1
  180. package/dist/types/commands/package/cmd-package-score.d.mts +0 -1
  181. package/dist/types/commands/package/cmd-package-shallow.d.mts +0 -1
  182. package/dist/types/commands/package/cmd-package.d.mts +0 -1
  183. package/dist/types/commands/package/fetch-purl-deep-score.d.mts +0 -1
  184. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts +0 -1
  185. package/dist/types/commands/package/handle-purl-deep-score.d.mts +0 -1
  186. package/dist/types/commands/package/handle-purls-shallow-score.d.mts +0 -1
  187. package/dist/types/commands/package/output-purls-deep-score.d.mts +0 -1
  188. package/dist/types/commands/package/output-purls-shallow-score.d.mts +0 -1
  189. package/dist/types/commands/package/parse-package-specifiers.d.mts +0 -1
  190. package/dist/types/commands/patch/cmd-patch.d.mts +0 -1
  191. package/dist/types/commands/pnpm/cmd-pnpm.d.mts +0 -1
  192. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts +0 -1
  193. package/dist/types/commands/raw-npm/run-raw-npm.d.mts +0 -1
  194. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts +0 -1
  195. package/dist/types/commands/raw-npx/run-raw-npx.d.mts +0 -1
  196. package/dist/types/commands/repository/cmd-repository-create.d.mts +0 -1
  197. package/dist/types/commands/repository/cmd-repository-del.d.mts +0 -1
  198. package/dist/types/commands/repository/cmd-repository-list.d.mts +0 -1
  199. package/dist/types/commands/repository/cmd-repository-update.d.mts +0 -1
  200. package/dist/types/commands/repository/cmd-repository-view.d.mts +0 -1
  201. package/dist/types/commands/repository/cmd-repository.d.mts +0 -1
  202. package/dist/types/commands/repository/fetch-create-repo.d.mts +0 -1
  203. package/dist/types/commands/repository/fetch-delete-repo.d.mts +0 -1
  204. package/dist/types/commands/repository/fetch-list-all-repos.d.mts +0 -1
  205. package/dist/types/commands/repository/fetch-list-repos.d.mts +0 -1
  206. package/dist/types/commands/repository/fetch-update-repo.d.mts +0 -1
  207. package/dist/types/commands/repository/fetch-view-repo.d.mts +0 -1
  208. package/dist/types/commands/repository/handle-create-repo.d.mts +0 -1
  209. package/dist/types/commands/repository/handle-delete-repo.d.mts +0 -1
  210. package/dist/types/commands/repository/handle-list-repos.d.mts +0 -1
  211. package/dist/types/commands/repository/handle-update-repo.d.mts +0 -1
  212. package/dist/types/commands/repository/handle-view-repo.d.mts +0 -1
  213. package/dist/types/commands/repository/output-create-repo.d.mts +0 -1
  214. package/dist/types/commands/repository/output-delete-repo.d.mts +0 -1
  215. package/dist/types/commands/repository/output-list-repos.d.mts +0 -1
  216. package/dist/types/commands/repository/output-update-repo.d.mts +0 -1
  217. package/dist/types/commands/repository/output-view-repo.d.mts +0 -1
  218. package/dist/types/commands/repository/types.d.mts +0 -1
  219. package/dist/types/commands/scan/cmd-scan-create.d.mts +0 -1
  220. package/dist/types/commands/scan/cmd-scan-del.d.mts +0 -1
  221. package/dist/types/commands/scan/cmd-scan-diff.d.mts +0 -1
  222. package/dist/types/commands/scan/cmd-scan-github.d.mts +0 -1
  223. package/dist/types/commands/scan/cmd-scan-list.d.mts +0 -1
  224. package/dist/types/commands/scan/cmd-scan-metadata.d.mts +0 -1
  225. package/dist/types/commands/scan/cmd-scan-reach.d.mts +0 -1
  226. package/dist/types/commands/scan/cmd-scan-report.d.mts +0 -1
  227. package/dist/types/commands/scan/cmd-scan-setup.d.mts +0 -1
  228. package/dist/types/commands/scan/cmd-scan-view.d.mts +0 -1
  229. package/dist/types/commands/scan/cmd-scan.d.mts +0 -1
  230. package/dist/types/commands/scan/create-scan-from-github.d.mts +0 -1
  231. package/dist/types/commands/scan/exclude-paths.d.mts +0 -1
  232. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts +0 -1
  233. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts +0 -1
  234. package/dist/types/commands/scan/fetch-diff-scan.d.mts +0 -1
  235. package/dist/types/commands/scan/fetch-list-scans.d.mts +0 -1
  236. package/dist/types/commands/scan/fetch-report-data.d.mts +1 -9
  237. package/dist/types/commands/scan/fetch-scan-metadata.d.mts +0 -1
  238. package/dist/types/commands/scan/fetch-scan.d.mts +0 -1
  239. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts +0 -1
  240. package/dist/types/commands/scan/finalize-tier1-scan.d.mts +0 -1
  241. package/dist/types/commands/scan/generate-report.d.mts +1 -3
  242. package/dist/types/commands/scan/generate-uv-member-sboms.d.mts +0 -1
  243. package/dist/types/commands/scan/handle-create-github-scan.d.mts +0 -1
  244. package/dist/types/commands/scan/handle-create-new-scan.d.mts +0 -1
  245. package/dist/types/commands/scan/handle-delete-scan.d.mts +0 -1
  246. package/dist/types/commands/scan/handle-diff-scan.d.mts +0 -1
  247. package/dist/types/commands/scan/handle-list-scans.d.mts +0 -1
  248. package/dist/types/commands/scan/handle-scan-config.d.mts +0 -1
  249. package/dist/types/commands/scan/handle-scan-metadata.d.mts +0 -1
  250. package/dist/types/commands/scan/handle-scan-reach.d.mts +0 -1
  251. package/dist/types/commands/scan/handle-scan-report.d.mts +0 -1
  252. package/dist/types/commands/scan/handle-scan-view.d.mts +0 -1
  253. package/dist/types/commands/scan/output-create-new-scan.d.mts +0 -1
  254. package/dist/types/commands/scan/output-delete-scan.d.mts +0 -1
  255. package/dist/types/commands/scan/output-diff-scan.d.mts +0 -1
  256. package/dist/types/commands/scan/output-list-scans.d.mts +0 -1
  257. package/dist/types/commands/scan/output-scan-config-result.d.mts +0 -1
  258. package/dist/types/commands/scan/output-scan-github.d.mts +0 -1
  259. package/dist/types/commands/scan/output-scan-metadata.d.mts +0 -1
  260. package/dist/types/commands/scan/output-scan-reach.d.mts +0 -1
  261. package/dist/types/commands/scan/output-scan-report.d.mts +12 -3
  262. package/dist/types/commands/scan/output-scan-view.d.mts +0 -1
  263. package/dist/types/commands/scan/perform-reachability-analysis.d.mts +0 -2
  264. package/dist/types/commands/scan/reach-advisories.d.mts +0 -1
  265. package/dist/types/commands/scan/reachability-flags.d.mts +0 -1
  266. package/dist/types/commands/scan/reachability-units.d.mts +0 -1
  267. package/dist/types/commands/scan/run-dynamic-sbom-inference.d.mts +5 -1
  268. package/dist/types/commands/scan/setup-scan-config.d.mts +0 -1
  269. package/dist/types/commands/scan/stream-scan.d.mts +0 -1
  270. package/dist/types/commands/scan/suggest-org-slug.d.mts +0 -1
  271. package/dist/types/commands/scan/suggest-to-persist-orgslug.d.mts +0 -1
  272. package/dist/types/commands/scan/suggest_branch_slug.d.mts +0 -1
  273. package/dist/types/commands/scan/suggest_target.d.mts +0 -1
  274. package/dist/types/commands/scan/types.d.mts +0 -1
  275. package/dist/types/commands/scan/validate-reachability-target.d.mts +0 -1
  276. package/dist/types/commands/scan/warn-socket-json-only-flags.d.mts +0 -1
  277. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts +0 -1
  278. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts +0 -1
  279. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts +0 -1
  280. package/dist/types/commands/threat-feed/output-threat-feed.d.mts +0 -1
  281. package/dist/types/commands/threat-feed/types.d.mts +0 -1
  282. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts +0 -1
  283. package/dist/types/commands/uninstall/cmd-uninstall.d.mts +0 -1
  284. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts +0 -1
  285. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts +0 -1
  286. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts +0 -1
  287. package/dist/types/commands/wrapper/add-socket-wrapper.d.mts +0 -1
  288. package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts +0 -1
  289. package/dist/types/commands/wrapper/cmd-wrapper.d.mts +0 -1
  290. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts +0 -1
  291. package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts +0 -1
  292. package/dist/types/commands/yarn/cmd-yarn.d.mts +0 -1
  293. package/dist/types/commands.d.mts +0 -1
  294. package/dist/types/constants.d.mts +9 -6
  295. package/dist/types/flags.d.mts +0 -1
  296. package/dist/types/instrument-with-sentry.d.mts +0 -1
  297. package/dist/types/npm-cli.d.mts +0 -1
  298. package/dist/types/npx-cli.d.mts +0 -1
  299. package/dist/types/pnpm-cli.d.mts +0 -1
  300. package/dist/types/sea/adapters/cdxgen.d.mts +8 -0
  301. package/dist/types/sea/adapters/synp.d.mts +9 -0
  302. package/dist/types/sea/archive-paths.d.mts +6 -0
  303. package/dist/types/sea/bootstrap.d.mts +0 -1
  304. package/dist/types/sea/build/lock.d.mts +2 -0
  305. package/dist/types/sea/build/publish.d.mts +13 -0
  306. package/dist/types/sea/build-sea.d.mts +14 -24
  307. package/dist/types/sea/capabilities.d.mts +21 -0
  308. package/dist/types/sea/download-bytes.d.mts +14 -0
  309. package/dist/types/sea/download-cache.d.mts +15 -0
  310. package/dist/types/sea/node-version.d.mts +1 -0
  311. package/dist/types/sea/readme-version.d.mts +4 -0
  312. package/dist/types/sea/runtime.d.mts +34 -0
  313. package/dist/types/sea/stage/synp.d.mts +15 -0
  314. package/dist/types/sea/stage/uv.d.mts +34 -0
  315. package/dist/types/sea/version.d.mts +34 -0
  316. package/dist/types/shadow/common.d.mts +0 -1
  317. package/dist/types/shadow/npm/arborist/index.d.mts +0 -1
  318. package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts +0 -1
  319. package/dist/types/shadow/npm/arborist/types.d.mts +0 -1
  320. package/dist/types/shadow/npm/arborist-helpers.d.mts +0 -1
  321. package/dist/types/shadow/npm/bin.d.mts +0 -1
  322. package/dist/types/shadow/npm/inject.d.mts +0 -1
  323. package/dist/types/shadow/npm/install.d.mts +0 -1
  324. package/dist/types/shadow/npm/paths.d.mts +0 -1
  325. package/dist/types/shadow/npm-base.d.mts +0 -1
  326. package/dist/types/shadow/npx/bin.d.mts +0 -1
  327. package/dist/types/shadow/pnpm/bin.d.mts +0 -1
  328. package/dist/types/shadow/stdio-ipc.d.mts +0 -1
  329. package/dist/types/shadow/yarn/bin.d.mts +0 -1
  330. package/dist/types/test/json-output-validation.d.mts +0 -1
  331. package/dist/types/test/mocks/socket-auth.d.mts +0 -1
  332. package/dist/types/types.d.mts +0 -1
  333. package/dist/types/utils/advisory-ids.d.mts +0 -1
  334. package/dist/types/utils/agent.d.mts +5 -11
  335. package/dist/types/utils/alert/artifact.d.mts +0 -1
  336. package/dist/types/utils/alert/fix.d.mts +0 -1
  337. package/dist/types/utils/alert/severity.d.mts +0 -1
  338. package/dist/types/utils/alerts-map.d.mts +0 -1
  339. package/dist/types/utils/api-transport.d.mts +3 -0
  340. package/dist/types/utils/api.d.mts +4 -2
  341. package/dist/types/utils/check-input.d.mts +0 -1
  342. package/dist/types/utils/cmd.d.mts +0 -1
  343. package/dist/types/utils/coana-release.d.mts +5 -1
  344. package/dist/types/utils/coana.d.mts +0 -1
  345. package/dist/types/utils/color-or-markdown.d.mts +0 -1
  346. package/dist/types/utils/completion.d.mts +0 -1
  347. package/dist/types/utils/config.d.mts +1 -1
  348. package/dist/types/utils/cve-to-ghsa.d.mts +0 -1
  349. package/dist/types/utils/debug.d.mts +0 -1
  350. package/dist/types/utils/determine-org-slug.d.mts +0 -1
  351. package/dist/types/utils/dlx-detection.d.mts +0 -1
  352. package/dist/types/utils/dlx.d.mts +0 -1
  353. package/dist/types/utils/ecosystem.d.mts +0 -1
  354. package/dist/types/utils/editable-json.d.mts +0 -1
  355. package/dist/types/utils/errors.d.mts +0 -1
  356. package/dist/types/utils/extract-names.d.mts +0 -1
  357. package/dist/types/utils/fail-msg-with-badge.d.mts +0 -1
  358. package/dist/types/utils/filter-config.d.mts +0 -1
  359. package/dist/types/utils/fs.d.mts +0 -1
  360. package/dist/types/utils/get-or-insert.d.mts +0 -1
  361. package/dist/types/utils/get-output-kind.d.mts +0 -1
  362. package/dist/types/utils/git.d.mts +0 -1
  363. package/dist/types/utils/github-errors.d.mts +0 -1
  364. package/dist/types/utils/github.d.mts +0 -1
  365. package/dist/types/utils/glob.d.mts +0 -1
  366. package/dist/types/utils/lockfile.d.mts +0 -1
  367. package/dist/types/utils/map-to-object.d.mts +0 -1
  368. package/dist/types/utils/markdown.d.mts +0 -1
  369. package/dist/types/utils/meow-with-subcommands.d.mts +0 -1
  370. package/dist/types/utils/ms-at-home.d.mts +0 -1
  371. package/dist/types/utils/npm-config.d.mts +0 -1
  372. package/dist/types/utils/npm-package-arg.d.mts +0 -1
  373. package/dist/types/utils/npm-paths.d.mts +0 -1
  374. package/dist/types/utils/npm-spec.d.mts +0 -1
  375. package/dist/types/utils/oauth.d.mts +32 -0
  376. package/dist/types/utils/objects.d.mts +0 -1
  377. package/dist/types/utils/organization.d.mts +0 -1
  378. package/dist/types/utils/output-formatting.d.mts +0 -1
  379. package/dist/types/utils/package-environment.d.mts +0 -1
  380. package/dist/types/utils/package-manager.d.mts +2 -3
  381. package/dist/types/utils/path-resolve.d.mts +0 -1
  382. package/dist/types/utils/pnpm-paths.d.mts +0 -1
  383. package/dist/types/utils/pnpm.d.mts +0 -1
  384. package/dist/types/utils/purl-to-ghsa.d.mts +0 -1
  385. package/dist/types/utils/purl.d.mts +0 -1
  386. package/dist/types/utils/quote-powershell.d.mts +2 -0
  387. package/dist/types/utils/requirements.d.mts +0 -1
  388. package/dist/types/utils/sdk.d.mts +14 -7
  389. package/dist/types/utils/self-update.d.mts +2 -1
  390. package/dist/types/utils/semver.d.mts +0 -1
  391. package/dist/types/utils/serialize-result-json.d.mts +0 -1
  392. package/dist/types/utils/shadow-links.d.mts +0 -1
  393. package/dist/types/utils/socket-json.d.mts +15 -5
  394. package/dist/types/utils/socket-package-alert.d.mts +0 -1
  395. package/dist/types/utils/socket-url.d.mts +0 -1
  396. package/dist/types/utils/spec.d.mts +0 -1
  397. package/dist/types/utils/strings.d.mts +0 -1
  398. package/dist/types/utils/telemetry/integration.d.mts +0 -1
  399. package/dist/types/utils/telemetry/service.d.mts +0 -1
  400. package/dist/types/utils/telemetry/types.d.mts +0 -1
  401. package/dist/types/utils/terminal-link.d.mts +0 -1
  402. package/dist/types/utils/tildify.d.mts +0 -1
  403. package/dist/types/utils/translations.d.mts +0 -1
  404. package/dist/types/utils/walk-nested-map.d.mts +0 -1
  405. package/dist/types/utils/yarn-paths.d.mts +0 -1
  406. package/dist/types/utils/yarn-version.d.mts +0 -1
  407. package/dist/types/yarn-cli.d.mts +0 -1
  408. package/dist/utils.js +1318 -244
  409. package/dist/utils.js.map +1 -1
  410. package/dist/vendor.js +567 -567
  411. package/external/@socketsecurity/registry/lib/packages.js +12 -9
  412. package/package.json +30 -10
  413. package/requirements.json +2 -2
  414. package/dist/tsconfig.dts.tsbuildinfo +0 -1
  415. package/dist/types/cli.d.mts.map +0 -1
  416. package/dist/types/commands/analytics/cmd-analytics.d.mts.map +0 -1
  417. package/dist/types/commands/analytics/fetch-org-analytics.d.mts.map +0 -1
  418. package/dist/types/commands/analytics/fetch-repo-analytics.d.mts.map +0 -1
  419. package/dist/types/commands/analytics/handle-analytics.d.mts.map +0 -1
  420. package/dist/types/commands/analytics/output-analytics.d.mts.map +0 -1
  421. package/dist/types/commands/audit-log/cmd-audit-log.d.mts.map +0 -1
  422. package/dist/types/commands/audit-log/fetch-audit-log.d.mts.map +0 -1
  423. package/dist/types/commands/audit-log/handle-audit-log.d.mts.map +0 -1
  424. package/dist/types/commands/audit-log/output-audit-log.d.mts.map +0 -1
  425. package/dist/types/commands/ci/cmd-ci.d.mts.map +0 -1
  426. package/dist/types/commands/ci/fetch-default-org-slug.d.mts.map +0 -1
  427. package/dist/types/commands/ci/handle-ci.d.mts.map +0 -1
  428. package/dist/types/commands/config/cmd-config-auto.d.mts.map +0 -1
  429. package/dist/types/commands/config/cmd-config-get.d.mts.map +0 -1
  430. package/dist/types/commands/config/cmd-config-list.d.mts.map +0 -1
  431. package/dist/types/commands/config/cmd-config-set.d.mts.map +0 -1
  432. package/dist/types/commands/config/cmd-config-unset.d.mts.map +0 -1
  433. package/dist/types/commands/config/cmd-config.d.mts.map +0 -1
  434. package/dist/types/commands/config/discover-config-value.d.mts.map +0 -1
  435. package/dist/types/commands/config/handle-config-auto.d.mts.map +0 -1
  436. package/dist/types/commands/config/handle-config-get.d.mts.map +0 -1
  437. package/dist/types/commands/config/handle-config-set.d.mts.map +0 -1
  438. package/dist/types/commands/config/handle-config-unset.d.mts.map +0 -1
  439. package/dist/types/commands/config/output-config-auto.d.mts.map +0 -1
  440. package/dist/types/commands/config/output-config-get.d.mts.map +0 -1
  441. package/dist/types/commands/config/output-config-list.d.mts.map +0 -1
  442. package/dist/types/commands/config/output-config-set.d.mts.map +0 -1
  443. package/dist/types/commands/config/output-config-unset.d.mts.map +0 -1
  444. package/dist/types/commands/fix/branch-cleanup.d.mts.map +0 -1
  445. package/dist/types/commands/fix/cmd-fix.d.mts.map +0 -1
  446. package/dist/types/commands/fix/coana-fix.d.mts.map +0 -1
  447. package/dist/types/commands/fix/env-helpers.d.mts.map +0 -1
  448. package/dist/types/commands/fix/generated-socket-facts.d.mts.map +0 -1
  449. package/dist/types/commands/fix/git.d.mts.map +0 -1
  450. package/dist/types/commands/fix/handle-fix.d.mts.map +0 -1
  451. package/dist/types/commands/fix/output-fix-result.d.mts.map +0 -1
  452. package/dist/types/commands/fix/pull-request.d.mts.map +0 -1
  453. package/dist/types/commands/fix/types.d.mts.map +0 -1
  454. package/dist/types/commands/install/cmd-install-completion.d.mts.map +0 -1
  455. package/dist/types/commands/install/cmd-install.d.mts.map +0 -1
  456. package/dist/types/commands/install/handle-install-completion.d.mts.map +0 -1
  457. package/dist/types/commands/install/output-install-completion.d.mts.map +0 -1
  458. package/dist/types/commands/install/setup-tab-completion.d.mts.map +0 -1
  459. package/dist/types/commands/json/cmd-json.d.mts.map +0 -1
  460. package/dist/types/commands/json/handle-cmd-json.d.mts.map +0 -1
  461. package/dist/types/commands/json/output-cmd-json.d.mts.map +0 -1
  462. package/dist/types/commands/login/apply-login.d.mts.map +0 -1
  463. package/dist/types/commands/login/attempt-login.d.mts.map +0 -1
  464. package/dist/types/commands/login/cmd-login.d.mts.map +0 -1
  465. package/dist/types/commands/logout/apply-logout.d.mts.map +0 -1
  466. package/dist/types/commands/logout/attempt-logout.d.mts.map +0 -1
  467. package/dist/types/commands/logout/cmd-logout.d.mts.map +0 -1
  468. package/dist/types/commands/manifest/bazel/bazel-bin-detect.d.mts.map +0 -1
  469. package/dist/types/commands/manifest/bazel/bazel-cleanup.d.mts.map +0 -1
  470. package/dist/types/commands/manifest/bazel/bazel-cquery.d.mts.map +0 -1
  471. package/dist/types/commands/manifest/bazel/bazel-java-shim.d.mts.map +0 -1
  472. package/dist/types/commands/manifest/bazel/bazel-output-base-check.d.mts.map +0 -1
  473. package/dist/types/commands/manifest/bazel/bazel-process.d.mts.map +0 -1
  474. package/dist/types/commands/manifest/bazel/bazel-pypi-discovery.d.mts.map +0 -1
  475. package/dist/types/commands/manifest/bazel/bazel-pypi-parser.d.mts.map +0 -1
  476. package/dist/types/commands/manifest/bazel/bazel-python-shim.d.mts.map +0 -1
  477. package/dist/types/commands/manifest/bazel/bazel-query-runner.d.mts.map +0 -1
  478. package/dist/types/commands/manifest/bazel/bazel-repo-discovery.d.mts.map +0 -1
  479. package/dist/types/commands/manifest/bazel/bazel-workspace-detect.d.mts.map +0 -1
  480. package/dist/types/commands/manifest/bazel/bazel-workspace-walk.d.mts.map +0 -1
  481. package/dist/types/commands/manifest/bazel/cmd-manifest-bazel.d.mts.map +0 -1
  482. package/dist/types/commands/manifest/bazel/extract_bazel_to_maven.d.mts.map +0 -1
  483. package/dist/types/commands/manifest/bazel/extract_bazel_to_pypi.d.mts.map +0 -1
  484. package/dist/types/commands/manifest/cmd-manifest-auto.d.mts.map +0 -1
  485. package/dist/types/commands/manifest/cmd-manifest-cdxgen.d.mts.map +0 -1
  486. package/dist/types/commands/manifest/cmd-manifest-conda.d.mts.map +0 -1
  487. package/dist/types/commands/manifest/cmd-manifest-dotnet.d.mts.map +0 -1
  488. package/dist/types/commands/manifest/cmd-manifest-dynamic-sbom-inference.d.mts.map +0 -1
  489. package/dist/types/commands/manifest/cmd-manifest-gradle.d.mts.map +0 -1
  490. package/dist/types/commands/manifest/cmd-manifest-kotlin.d.mts.map +0 -1
  491. package/dist/types/commands/manifest/cmd-manifest-maven.d.mts.map +0 -1
  492. package/dist/types/commands/manifest/cmd-manifest-scala.d.mts.map +0 -1
  493. package/dist/types/commands/manifest/cmd-manifest-setup.d.mts.map +0 -1
  494. package/dist/types/commands/manifest/cmd-manifest.d.mts.map +0 -1
  495. package/dist/types/commands/manifest/convert-conda-to-requirements.d.mts.map +0 -1
  496. package/dist/types/commands/manifest/convert-dotnet-to-facts.d.mts.map +0 -1
  497. package/dist/types/commands/manifest/convert-gradle-to-facts.d.mts.map +0 -1
  498. package/dist/types/commands/manifest/convert-maven-to-facts.d.mts.map +0 -1
  499. package/dist/types/commands/manifest/convert-sbt-to-facts.d.mts.map +0 -1
  500. package/dist/types/commands/manifest/convert_gradle_to_maven.d.mts.map +0 -1
  501. package/dist/types/commands/manifest/convert_sbt_to_maven.d.mts.map +0 -1
  502. package/dist/types/commands/manifest/detect-manifest-actions.d.mts.map +0 -1
  503. package/dist/types/commands/manifest/discover-manifest-roots.d.mts.map +0 -1
  504. package/dist/types/commands/manifest/enumerate-workspaces.d.mts.map +0 -1
  505. package/dist/types/commands/manifest/expand-env-var-refs.d.mts.map +0 -1
  506. package/dist/types/commands/manifest/generate-recursive-manifests.d.mts.map +0 -1
  507. package/dist/types/commands/manifest/generate_auto_manifest.d.mts.map +0 -1
  508. package/dist/types/commands/manifest/handle-manifest-conda.d.mts.map +0 -1
  509. package/dist/types/commands/manifest/handle-manifest-dynamic-sbom-inference.d.mts.map +0 -1
  510. package/dist/types/commands/manifest/handle-manifest-setup.d.mts.map +0 -1
  511. package/dist/types/commands/manifest/manifest-flags.d.mts.map +0 -1
  512. package/dist/types/commands/manifest/output-manifest-dynamic-sbom-inference.d.mts.map +0 -1
  513. package/dist/types/commands/manifest/output-manifest-setup.d.mts.map +0 -1
  514. package/dist/types/commands/manifest/output-requirements.d.mts.map +0 -1
  515. package/dist/types/commands/manifest/parse-build-tool-opts.d.mts.map +0 -1
  516. package/dist/types/commands/manifest/run-cdxgen.d.mts.map +0 -1
  517. package/dist/types/commands/manifest/run-manifest-facts.d.mts.map +0 -1
  518. package/dist/types/commands/manifest/scripts/assemble.d.mts.map +0 -1
  519. package/dist/types/commands/manifest/scripts/build-tool.d.mts.map +0 -1
  520. package/dist/types/commands/manifest/scripts/exclude-paths-glob.d.mts.map +0 -1
  521. package/dist/types/commands/manifest/scripts/facts.d.mts.map +0 -1
  522. package/dist/types/commands/manifest/scripts/records.d.mts.map +0 -1
  523. package/dist/types/commands/manifest/scripts/resolution-report-gradle.d.mts.map +0 -1
  524. package/dist/types/commands/manifest/scripts/resolution-report-ivy.d.mts.map +0 -1
  525. package/dist/types/commands/manifest/scripts/resolution-report-maven.d.mts.map +0 -1
  526. package/dist/types/commands/manifest/scripts/resolution-report-nuget.d.mts.map +0 -1
  527. package/dist/types/commands/manifest/scripts/resolution-report-render.d.mts.map +0 -1
  528. package/dist/types/commands/manifest/scripts/resolution-report.d.mts.map +0 -1
  529. package/dist/types/commands/manifest/scripts/run.d.mts.map +0 -1
  530. package/dist/types/commands/manifest/scripts/sidecar.d.mts.map +0 -1
  531. package/dist/types/commands/manifest/setup-manifest-config.d.mts.map +0 -1
  532. package/dist/types/commands/manifest/setup-recursive-manifest-config.d.mts.map +0 -1
  533. package/dist/types/commands/npm/cmd-npm.d.mts.map +0 -1
  534. package/dist/types/commands/npx/cmd-npx.d.mts.map +0 -1
  535. package/dist/types/commands/oops/cmd-oops.d.mts.map +0 -1
  536. package/dist/types/commands/optimize/add-overrides.d.mts.map +0 -1
  537. package/dist/types/commands/optimize/apply-optimization.d.mts.map +0 -1
  538. package/dist/types/commands/optimize/cmd-optimize.d.mts.map +0 -1
  539. package/dist/types/commands/optimize/deps-includes-by-agent.d.mts.map +0 -1
  540. package/dist/types/commands/optimize/get-dependency-entries.d.mts.map +0 -1
  541. package/dist/types/commands/optimize/get-overrides-by-agent.d.mts.map +0 -1
  542. package/dist/types/commands/optimize/handle-optimize.d.mts.map +0 -1
  543. package/dist/types/commands/optimize/lockfile-includes-by-agent.d.mts.map +0 -1
  544. package/dist/types/commands/optimize/ls-by-agent.d.mts.map +0 -1
  545. package/dist/types/commands/optimize/output-optimize-result.d.mts.map +0 -1
  546. package/dist/types/commands/optimize/shared.d.mts.map +0 -1
  547. package/dist/types/commands/optimize/types.d.mts.map +0 -1
  548. package/dist/types/commands/optimize/update-lockfile.d.mts.map +0 -1
  549. package/dist/types/commands/optimize/update-manifest-by-agent.d.mts.map +0 -1
  550. package/dist/types/commands/organization/cmd-organization-dependencies.d.mts.map +0 -1
  551. package/dist/types/commands/organization/cmd-organization-list.d.mts.map +0 -1
  552. package/dist/types/commands/organization/cmd-organization-policy-license.d.mts.map +0 -1
  553. package/dist/types/commands/organization/cmd-organization-policy-security.d.mts.map +0 -1
  554. package/dist/types/commands/organization/cmd-organization-policy.d.mts.map +0 -1
  555. package/dist/types/commands/organization/cmd-organization-quota.d.mts.map +0 -1
  556. package/dist/types/commands/organization/cmd-organization.d.mts.map +0 -1
  557. package/dist/types/commands/organization/fetch-dependencies.d.mts.map +0 -1
  558. package/dist/types/commands/organization/fetch-license-policy.d.mts.map +0 -1
  559. package/dist/types/commands/organization/fetch-organization-list.d.mts.map +0 -1
  560. package/dist/types/commands/organization/fetch-quota.d.mts.map +0 -1
  561. package/dist/types/commands/organization/fetch-security-policy.d.mts.map +0 -1
  562. package/dist/types/commands/organization/handle-dependencies.d.mts.map +0 -1
  563. package/dist/types/commands/organization/handle-license-policy.d.mts.map +0 -1
  564. package/dist/types/commands/organization/handle-organization-list.d.mts.map +0 -1
  565. package/dist/types/commands/organization/handle-quota.d.mts.map +0 -1
  566. package/dist/types/commands/organization/handle-security-policy.d.mts.map +0 -1
  567. package/dist/types/commands/organization/output-dependencies.d.mts.map +0 -1
  568. package/dist/types/commands/organization/output-license-policy.d.mts.map +0 -1
  569. package/dist/types/commands/organization/output-organization-list.d.mts.map +0 -1
  570. package/dist/types/commands/organization/output-quota.d.mts.map +0 -1
  571. package/dist/types/commands/organization/output-security-policy.d.mts.map +0 -1
  572. package/dist/types/commands/package/cmd-package-score.d.mts.map +0 -1
  573. package/dist/types/commands/package/cmd-package-shallow.d.mts.map +0 -1
  574. package/dist/types/commands/package/cmd-package.d.mts.map +0 -1
  575. package/dist/types/commands/package/fetch-purl-deep-score.d.mts.map +0 -1
  576. package/dist/types/commands/package/fetch-purls-shallow-score.d.mts.map +0 -1
  577. package/dist/types/commands/package/handle-purl-deep-score.d.mts.map +0 -1
  578. package/dist/types/commands/package/handle-purls-shallow-score.d.mts.map +0 -1
  579. package/dist/types/commands/package/output-purls-deep-score.d.mts.map +0 -1
  580. package/dist/types/commands/package/output-purls-shallow-score.d.mts.map +0 -1
  581. package/dist/types/commands/package/parse-package-specifiers.d.mts.map +0 -1
  582. package/dist/types/commands/patch/cmd-patch.d.mts.map +0 -1
  583. package/dist/types/commands/pnpm/cmd-pnpm.d.mts.map +0 -1
  584. package/dist/types/commands/raw-npm/cmd-raw-npm.d.mts.map +0 -1
  585. package/dist/types/commands/raw-npm/run-raw-npm.d.mts.map +0 -1
  586. package/dist/types/commands/raw-npx/cmd-raw-npx.d.mts.map +0 -1
  587. package/dist/types/commands/raw-npx/run-raw-npx.d.mts.map +0 -1
  588. package/dist/types/commands/repository/cmd-repository-create.d.mts.map +0 -1
  589. package/dist/types/commands/repository/cmd-repository-del.d.mts.map +0 -1
  590. package/dist/types/commands/repository/cmd-repository-list.d.mts.map +0 -1
  591. package/dist/types/commands/repository/cmd-repository-update.d.mts.map +0 -1
  592. package/dist/types/commands/repository/cmd-repository-view.d.mts.map +0 -1
  593. package/dist/types/commands/repository/cmd-repository.d.mts.map +0 -1
  594. package/dist/types/commands/repository/fetch-create-repo.d.mts.map +0 -1
  595. package/dist/types/commands/repository/fetch-delete-repo.d.mts.map +0 -1
  596. package/dist/types/commands/repository/fetch-list-all-repos.d.mts.map +0 -1
  597. package/dist/types/commands/repository/fetch-list-repos.d.mts.map +0 -1
  598. package/dist/types/commands/repository/fetch-update-repo.d.mts.map +0 -1
  599. package/dist/types/commands/repository/fetch-view-repo.d.mts.map +0 -1
  600. package/dist/types/commands/repository/handle-create-repo.d.mts.map +0 -1
  601. package/dist/types/commands/repository/handle-delete-repo.d.mts.map +0 -1
  602. package/dist/types/commands/repository/handle-list-repos.d.mts.map +0 -1
  603. package/dist/types/commands/repository/handle-update-repo.d.mts.map +0 -1
  604. package/dist/types/commands/repository/handle-view-repo.d.mts.map +0 -1
  605. package/dist/types/commands/repository/output-create-repo.d.mts.map +0 -1
  606. package/dist/types/commands/repository/output-delete-repo.d.mts.map +0 -1
  607. package/dist/types/commands/repository/output-list-repos.d.mts.map +0 -1
  608. package/dist/types/commands/repository/output-update-repo.d.mts.map +0 -1
  609. package/dist/types/commands/repository/output-view-repo.d.mts.map +0 -1
  610. package/dist/types/commands/repository/types.d.mts.map +0 -1
  611. package/dist/types/commands/scan/cmd-scan-create.d.mts.map +0 -1
  612. package/dist/types/commands/scan/cmd-scan-del.d.mts.map +0 -1
  613. package/dist/types/commands/scan/cmd-scan-diff.d.mts.map +0 -1
  614. package/dist/types/commands/scan/cmd-scan-github.d.mts.map +0 -1
  615. package/dist/types/commands/scan/cmd-scan-list.d.mts.map +0 -1
  616. package/dist/types/commands/scan/cmd-scan-metadata.d.mts.map +0 -1
  617. package/dist/types/commands/scan/cmd-scan-reach.d.mts.map +0 -1
  618. package/dist/types/commands/scan/cmd-scan-report.d.mts.map +0 -1
  619. package/dist/types/commands/scan/cmd-scan-setup.d.mts.map +0 -1
  620. package/dist/types/commands/scan/cmd-scan-view.d.mts.map +0 -1
  621. package/dist/types/commands/scan/cmd-scan.d.mts.map +0 -1
  622. package/dist/types/commands/scan/create-scan-from-github.d.mts.map +0 -1
  623. package/dist/types/commands/scan/exclude-paths.d.mts.map +0 -1
  624. package/dist/types/commands/scan/fetch-create-org-full-scan.d.mts.map +0 -1
  625. package/dist/types/commands/scan/fetch-delete-org-full-scan.d.mts.map +0 -1
  626. package/dist/types/commands/scan/fetch-diff-scan.d.mts.map +0 -1
  627. package/dist/types/commands/scan/fetch-list-scans.d.mts.map +0 -1
  628. package/dist/types/commands/scan/fetch-report-data.d.mts.map +0 -1
  629. package/dist/types/commands/scan/fetch-scan-metadata.d.mts.map +0 -1
  630. package/dist/types/commands/scan/fetch-scan.d.mts.map +0 -1
  631. package/dist/types/commands/scan/fetch-supported-scan-file-names.d.mts.map +0 -1
  632. package/dist/types/commands/scan/finalize-tier1-scan.d.mts.map +0 -1
  633. package/dist/types/commands/scan/generate-report.d.mts.map +0 -1
  634. package/dist/types/commands/scan/generate-uv-member-sboms.d.mts.map +0 -1
  635. package/dist/types/commands/scan/handle-create-github-scan.d.mts.map +0 -1
  636. package/dist/types/commands/scan/handle-create-new-scan.d.mts.map +0 -1
  637. package/dist/types/commands/scan/handle-delete-scan.d.mts.map +0 -1
  638. package/dist/types/commands/scan/handle-diff-scan.d.mts.map +0 -1
  639. package/dist/types/commands/scan/handle-list-scans.d.mts.map +0 -1
  640. package/dist/types/commands/scan/handle-scan-config.d.mts.map +0 -1
  641. package/dist/types/commands/scan/handle-scan-metadata.d.mts.map +0 -1
  642. package/dist/types/commands/scan/handle-scan-reach.d.mts.map +0 -1
  643. package/dist/types/commands/scan/handle-scan-report.d.mts.map +0 -1
  644. package/dist/types/commands/scan/handle-scan-view.d.mts.map +0 -1
  645. package/dist/types/commands/scan/output-create-new-scan.d.mts.map +0 -1
  646. package/dist/types/commands/scan/output-delete-scan.d.mts.map +0 -1
  647. package/dist/types/commands/scan/output-diff-scan.d.mts.map +0 -1
  648. package/dist/types/commands/scan/output-list-scans.d.mts.map +0 -1
  649. package/dist/types/commands/scan/output-scan-config-result.d.mts.map +0 -1
  650. package/dist/types/commands/scan/output-scan-github.d.mts.map +0 -1
  651. package/dist/types/commands/scan/output-scan-metadata.d.mts.map +0 -1
  652. package/dist/types/commands/scan/output-scan-reach.d.mts.map +0 -1
  653. package/dist/types/commands/scan/output-scan-report.d.mts.map +0 -1
  654. package/dist/types/commands/scan/output-scan-view.d.mts.map +0 -1
  655. package/dist/types/commands/scan/perform-reachability-analysis.d.mts.map +0 -1
  656. package/dist/types/commands/scan/reach-advisories.d.mts.map +0 -1
  657. package/dist/types/commands/scan/reachability-flags.d.mts.map +0 -1
  658. package/dist/types/commands/scan/reachability-units.d.mts.map +0 -1
  659. package/dist/types/commands/scan/run-dynamic-sbom-inference.d.mts.map +0 -1
  660. package/dist/types/commands/scan/setup-scan-config.d.mts.map +0 -1
  661. package/dist/types/commands/scan/stream-scan.d.mts.map +0 -1
  662. package/dist/types/commands/scan/suggest-org-slug.d.mts.map +0 -1
  663. package/dist/types/commands/scan/suggest-to-persist-orgslug.d.mts.map +0 -1
  664. package/dist/types/commands/scan/suggest_branch_slug.d.mts.map +0 -1
  665. package/dist/types/commands/scan/suggest_target.d.mts.map +0 -1
  666. package/dist/types/commands/scan/types.d.mts.map +0 -1
  667. package/dist/types/commands/scan/validate-reachability-target.d.mts.map +0 -1
  668. package/dist/types/commands/scan/warn-socket-json-only-flags.d.mts.map +0 -1
  669. package/dist/types/commands/threat-feed/cmd-threat-feed.d.mts.map +0 -1
  670. package/dist/types/commands/threat-feed/fetch-threat-feed.d.mts.map +0 -1
  671. package/dist/types/commands/threat-feed/handle-threat-feed.d.mts.map +0 -1
  672. package/dist/types/commands/threat-feed/output-threat-feed.d.mts.map +0 -1
  673. package/dist/types/commands/threat-feed/types.d.mts.map +0 -1
  674. package/dist/types/commands/uninstall/cmd-uninstall-completion.d.mts.map +0 -1
  675. package/dist/types/commands/uninstall/cmd-uninstall.d.mts.map +0 -1
  676. package/dist/types/commands/uninstall/handle-uninstall-completion.d.mts.map +0 -1
  677. package/dist/types/commands/uninstall/output-uninstall-completion.d.mts.map +0 -1
  678. package/dist/types/commands/uninstall/teardown-tab-completion.d.mts.map +0 -1
  679. package/dist/types/commands/wrapper/add-socket-wrapper.d.mts.map +0 -1
  680. package/dist/types/commands/wrapper/check-socket-wrapper-setup.d.mts.map +0 -1
  681. package/dist/types/commands/wrapper/cmd-wrapper.d.mts.map +0 -1
  682. package/dist/types/commands/wrapper/postinstall-wrapper.d.mts.map +0 -1
  683. package/dist/types/commands/wrapper/remove-socket-wrapper.d.mts.map +0 -1
  684. package/dist/types/commands/yarn/cmd-yarn.d.mts.map +0 -1
  685. package/dist/types/commands.d.mts.map +0 -1
  686. package/dist/types/constants.d.mts.map +0 -1
  687. package/dist/types/flags.d.mts.map +0 -1
  688. package/dist/types/instrument-with-sentry.d.mts.map +0 -1
  689. package/dist/types/npm-cli.d.mts.map +0 -1
  690. package/dist/types/npx-cli.d.mts.map +0 -1
  691. package/dist/types/pnpm-cli.d.mts.map +0 -1
  692. package/dist/types/sea/bootstrap.d.mts.map +0 -1
  693. package/dist/types/sea/build-sea.d.mts.map +0 -1
  694. package/dist/types/shadow/common.d.mts.map +0 -1
  695. package/dist/types/shadow/npm/arborist/index.d.mts.map +0 -1
  696. package/dist/types/shadow/npm/arborist/lib/arborist/index.d.mts.map +0 -1
  697. package/dist/types/shadow/npm/arborist/types.d.mts.map +0 -1
  698. package/dist/types/shadow/npm/arborist-helpers.d.mts.map +0 -1
  699. package/dist/types/shadow/npm/bin.d.mts.map +0 -1
  700. package/dist/types/shadow/npm/inject.d.mts.map +0 -1
  701. package/dist/types/shadow/npm/install.d.mts.map +0 -1
  702. package/dist/types/shadow/npm/paths.d.mts.map +0 -1
  703. package/dist/types/shadow/npm-base.d.mts.map +0 -1
  704. package/dist/types/shadow/npx/bin.d.mts.map +0 -1
  705. package/dist/types/shadow/pnpm/bin.d.mts.map +0 -1
  706. package/dist/types/shadow/stdio-ipc.d.mts.map +0 -1
  707. package/dist/types/shadow/yarn/bin.d.mts.map +0 -1
  708. package/dist/types/test/json-output-validation.d.mts.map +0 -1
  709. package/dist/types/test/mocks/socket-auth.d.mts.map +0 -1
  710. package/dist/types/types.d.mts.map +0 -1
  711. package/dist/types/utils/advisory-ids.d.mts.map +0 -1
  712. package/dist/types/utils/agent.d.mts.map +0 -1
  713. package/dist/types/utils/alert/artifact.d.mts.map +0 -1
  714. package/dist/types/utils/alert/fix.d.mts.map +0 -1
  715. package/dist/types/utils/alert/severity.d.mts.map +0 -1
  716. package/dist/types/utils/alerts-map.d.mts.map +0 -1
  717. package/dist/types/utils/api.d.mts.map +0 -1
  718. package/dist/types/utils/check-input.d.mts.map +0 -1
  719. package/dist/types/utils/cmd.d.mts.map +0 -1
  720. package/dist/types/utils/coana-release.d.mts.map +0 -1
  721. package/dist/types/utils/coana.d.mts.map +0 -1
  722. package/dist/types/utils/color-or-markdown.d.mts.map +0 -1
  723. package/dist/types/utils/completion.d.mts.map +0 -1
  724. package/dist/types/utils/config.d.mts.map +0 -1
  725. package/dist/types/utils/cve-to-ghsa.d.mts.map +0 -1
  726. package/dist/types/utils/debug.d.mts.map +0 -1
  727. package/dist/types/utils/determine-org-slug.d.mts.map +0 -1
  728. package/dist/types/utils/dlx-binary.d.mts +0 -58
  729. package/dist/types/utils/dlx-binary.d.mts.map +0 -1
  730. package/dist/types/utils/dlx-detection.d.mts.map +0 -1
  731. package/dist/types/utils/dlx.d.mts.map +0 -1
  732. package/dist/types/utils/ecosystem.d.mts.map +0 -1
  733. package/dist/types/utils/editable-json.d.mts.map +0 -1
  734. package/dist/types/utils/errors.d.mts.map +0 -1
  735. package/dist/types/utils/extract-names.d.mts.map +0 -1
  736. package/dist/types/utils/fail-msg-with-badge.d.mts.map +0 -1
  737. package/dist/types/utils/filter-config.d.mts.map +0 -1
  738. package/dist/types/utils/fs.d.mts.map +0 -1
  739. package/dist/types/utils/get-or-insert.d.mts.map +0 -1
  740. package/dist/types/utils/get-output-kind.d.mts.map +0 -1
  741. package/dist/types/utils/git.d.mts.map +0 -1
  742. package/dist/types/utils/github-errors.d.mts.map +0 -1
  743. package/dist/types/utils/github.d.mts.map +0 -1
  744. package/dist/types/utils/glob.d.mts.map +0 -1
  745. package/dist/types/utils/lockfile.d.mts.map +0 -1
  746. package/dist/types/utils/map-to-object.d.mts.map +0 -1
  747. package/dist/types/utils/markdown.d.mts.map +0 -1
  748. package/dist/types/utils/meow-with-subcommands.d.mts.map +0 -1
  749. package/dist/types/utils/ms-at-home.d.mts.map +0 -1
  750. package/dist/types/utils/npm-config.d.mts.map +0 -1
  751. package/dist/types/utils/npm-package-arg.d.mts.map +0 -1
  752. package/dist/types/utils/npm-paths.d.mts.map +0 -1
  753. package/dist/types/utils/npm-spec.d.mts.map +0 -1
  754. package/dist/types/utils/objects.d.mts.map +0 -1
  755. package/dist/types/utils/organization.d.mts.map +0 -1
  756. package/dist/types/utils/output-formatting.d.mts.map +0 -1
  757. package/dist/types/utils/package-environment.d.mts.map +0 -1
  758. package/dist/types/utils/package-manager.d.mts.map +0 -1
  759. package/dist/types/utils/path-resolve.d.mts.map +0 -1
  760. package/dist/types/utils/pnpm-paths.d.mts.map +0 -1
  761. package/dist/types/utils/pnpm.d.mts.map +0 -1
  762. package/dist/types/utils/purl-to-ghsa.d.mts.map +0 -1
  763. package/dist/types/utils/purl.d.mts.map +0 -1
  764. package/dist/types/utils/requirements.d.mts.map +0 -1
  765. package/dist/types/utils/sdk.d.mts.map +0 -1
  766. package/dist/types/utils/self-update.d.mts.map +0 -1
  767. package/dist/types/utils/semver.d.mts.map +0 -1
  768. package/dist/types/utils/serialize-result-json.d.mts.map +0 -1
  769. package/dist/types/utils/shadow-links.d.mts.map +0 -1
  770. package/dist/types/utils/socket-json.d.mts.map +0 -1
  771. package/dist/types/utils/socket-package-alert.d.mts.map +0 -1
  772. package/dist/types/utils/socket-url.d.mts.map +0 -1
  773. package/dist/types/utils/spec.d.mts.map +0 -1
  774. package/dist/types/utils/strings.d.mts.map +0 -1
  775. package/dist/types/utils/telemetry/integration.d.mts.map +0 -1
  776. package/dist/types/utils/telemetry/service.d.mts.map +0 -1
  777. package/dist/types/utils/telemetry/types.d.mts.map +0 -1
  778. package/dist/types/utils/terminal-link.d.mts.map +0 -1
  779. package/dist/types/utils/tildify.d.mts.map +0 -1
  780. package/dist/types/utils/translations.d.mts.map +0 -1
  781. package/dist/types/utils/walk-nested-map.d.mts.map +0 -1
  782. package/dist/types/utils/yarn-paths.d.mts.map +0 -1
  783. package/dist/types/utils/yarn-version.d.mts.map +0 -1
  784. package/dist/types/yarn-cli.d.mts.map +0 -1
package/dist/utils.js CHANGED
@@ -26,7 +26,7 @@ var require$$11 = require('node:zlib');
26
26
  var fs = require('../external/@socketsecurity/registry/lib/fs');
27
27
  var url = require('../external/@socketsecurity/registry/lib/url');
28
28
  var require$$1 = require('node:module');
29
- var agent = require('../external/@socketsecurity/registry/lib/agent');
29
+ var agent$1 = require('../external/@socketsecurity/registry/lib/agent');
30
30
  var bin = require('../external/@socketsecurity/registry/lib/bin');
31
31
  var packages = require('../external/@socketsecurity/registry/lib/packages');
32
32
  var os = require('node:os');
@@ -36,6 +36,7 @@ var promises = require('../external/@socketsecurity/registry/lib/promises');
36
36
  var require$$13 = require('node:https');
37
37
  var web = require('node:stream/web');
38
38
  var require$$0$1 = require('node:url');
39
+ var node_worker_threads = require('node:worker_threads');
39
40
  var globs = require('../external/@socketsecurity/registry/lib/globs');
40
41
  var streams = require('../external/@socketsecurity/registry/lib/streams');
41
42
  var require$$10 = require('node:util');
@@ -674,7 +675,7 @@ function normalizeConfigKey(key) {
674
675
  // property apiKey, we'll copy that to apiToken and delete the old property.
675
676
  // We added `org` as a convenience alias for `defaultOrg`
676
677
  const normalizedKey = key === 'apiKey' ? constants.CONFIG_KEY_API_TOKEN : key === constants.CONFIG_KEY_ORG ? constants.CONFIG_KEY_DEFAULT_ORG : key;
677
- if (!isSupportedConfigKey(normalizedKey)) {
678
+ if (normalizedKey !== constants.CONFIG_KEY_AUTH_TYPE && !isSupportedConfigKey(normalizedKey)) {
678
679
  return {
679
680
  ok: false,
680
681
  message: `Invalid config key: ${normalizedKey}`,
@@ -969,6 +970,610 @@ function getRequirementsKey(cmdPath) {
969
970
  return cmdPath.replace(/^socket[: ]/, '').replace(/ +/g, ':');
970
971
  }
971
972
 
973
+ // Cached extra CA certificates for SSL_CERT_FILE support.
974
+ let extraCaCerts;
975
+ let extraCaCertsResolved = false;
976
+
977
+ // Node reads NODE_EXTRA_CA_CERTS only at process start. If only SSL_CERT_FILE
978
+ // is set, pass the extra certificates to each outbound TLS agent explicitly.
979
+ function getExtraCaCerts() {
980
+ if (extraCaCertsResolved) {
981
+ return extraCaCerts;
982
+ }
983
+ extraCaCertsResolved = true;
984
+ if (process.env['NODE_EXTRA_CA_CERTS']) {
985
+ return undefined;
986
+ }
987
+ const certPath = constants.default.ENV.NODE_EXTRA_CA_CERTS;
988
+ if (!certPath) {
989
+ return undefined;
990
+ }
991
+ try {
992
+ const extraCerts = u.readFileSync(certPath, 'utf-8');
993
+ extraCaCerts = [...node_tls.rootCertificates, extraCerts];
994
+ return extraCaCerts;
995
+ } catch (error) {
996
+ debug$2.debugFn('warn', `Failed to read certificate file: ${certPath}`, error);
997
+ return undefined;
998
+ }
999
+ }
1000
+
1001
+ const OAUTH_ISSUER = 'https://api.socket.dev';
1002
+ const OAUTH_RESOURCE = 'https://mcp.socket.dev/';
1003
+ const RESOURCE_METADATA = `${OAUTH_RESOURCE}.well-known/oauth-protected-resource`;
1004
+ const ISSUER_METADATA = `${OAUTH_ISSUER}/.well-known/oauth-authorization-server`;
1005
+ const REQUIRED_SCOPES = ['packages:list', 'alerts:list', 'threat-feed:list'];
1006
+ const FLOW_TIMEOUT = 5 * 60_000;
1007
+ const REQUEST_TIMEOUT = 20_000;
1008
+ const MAX_RESPONSE = 256 * 1024;
1009
+ const LOCK_TIMEOUT = 60_000;
1010
+ const FILE = 'oauth.json';
1011
+ const error = message => new Error(`Socket browser sign-in: ${message}`);
1012
+ const random = (n = 32) => require$$0.randomBytes(n).toString('base64url');
1013
+ const form = data => new URLSearchParams(data).toString();
1014
+ function trustedEndpoint(value) {
1015
+ if (typeof value !== 'string') {
1016
+ throw error('OAuth metadata is invalid.');
1017
+ }
1018
+ let u;
1019
+ try {
1020
+ u = new URL(value);
1021
+ } catch {
1022
+ throw error('OAuth metadata is invalid.');
1023
+ }
1024
+ if (u.protocol !== 'https:' || u.origin !== OAUTH_ISSUER || u.username || u.password || u.search || u.hash) {
1025
+ throw error('OAuth metadata contains an untrusted endpoint.');
1026
+ }
1027
+ return u.href;
1028
+ }
1029
+ function agent(proxy, timeoutMs = REQUEST_TIMEOUT) {
1030
+ const ca = getExtraCaCerts();
1031
+ return proxy ? new vendor.HttpsProxyAgent({
1032
+ proxy,
1033
+ timeout: timeoutMs,
1034
+ ...(ca ? {
1035
+ ca,
1036
+ proxyRequestOptions: {
1037
+ ca
1038
+ }
1039
+ } : {})
1040
+ }) : ca ? new require$$13.Agent({
1041
+ ca
1042
+ }) : undefined;
1043
+ }
1044
+ function oauthCancellationError(signal) {
1045
+ return signal?.reason instanceof Error ? signal.reason : error('Sign-in was cancelled.');
1046
+ }
1047
+ function http(url, opts = {}) {
1048
+ const target = new URL(url);
1049
+ if (target.protocol !== 'https:' || target.origin !== OAUTH_ISSUER && target.origin !== new URL(OAUTH_RESOURCE).origin) {
1050
+ throw error('Refusing to contact an untrusted OAuth endpoint.');
1051
+ }
1052
+ return new Promise((resolve, reject) => {
1053
+ if (opts.signal?.aborted) {
1054
+ reject(opts.signal.reason ?? error('Sign-in was cancelled.'));
1055
+ return;
1056
+ }
1057
+ let done = false;
1058
+ const finish = fn => {
1059
+ if (!done) {
1060
+ done = true;
1061
+ clearTimeout(deadline);
1062
+ opts.signal?.removeEventListener('abort', abort);
1063
+ requestAgent?.destroy();
1064
+ fn();
1065
+ }
1066
+ };
1067
+ const timeoutMs = Math.min(opts.timeoutMs ?? REQUEST_TIMEOUT, REQUEST_TIMEOUT);
1068
+ const requestAgent = agent(opts.proxy, timeoutMs);
1069
+ const req = require$$13.request(target, {
1070
+ method: opts.method ?? 'GET',
1071
+ timeout: timeoutMs,
1072
+ ...(requestAgent ? {
1073
+ agent: requestAgent
1074
+ } : {}),
1075
+ headers: {
1076
+ accept: 'application/json',
1077
+ ...opts.headers,
1078
+ ...(opts.body ? {
1079
+ 'content-length': String(Buffer.byteLength(opts.body))
1080
+ } : {})
1081
+ }
1082
+ }, res => {
1083
+ const chunks = [];
1084
+ let size = 0;
1085
+ res.on('data', chunk => {
1086
+ size += chunk.length;
1087
+ if (size > MAX_RESPONSE) {
1088
+ req.destroy(error('OAuth response was too large.'));
1089
+ return;
1090
+ }
1091
+ chunks.push(Buffer.from(chunk));
1092
+ });
1093
+ res.on('error', () => finish(() => reject(error('OAuth response could not be read.'))));
1094
+ res.on('aborted', () => finish(() => reject(error('OAuth response ended unexpectedly.'))));
1095
+ res.on('end', () => {
1096
+ const text = Buffer.concat(chunks).toString('utf8');
1097
+ if (!text && opts.allowEmpty) {
1098
+ finish(() => resolve({
1099
+ status: res.statusCode ?? 0,
1100
+ body: {}
1101
+ }));
1102
+ return;
1103
+ }
1104
+ try {
1105
+ const body = JSON.parse(text);
1106
+ finish(() => resolve({
1107
+ status: res.statusCode ?? 0,
1108
+ body
1109
+ }));
1110
+ } catch {
1111
+ finish(() => reject(error('OAuth server returned an invalid response.')));
1112
+ }
1113
+ });
1114
+ });
1115
+ const abort = () => {
1116
+ finish(() => reject(error('Sign-in was cancelled.')));
1117
+ req.destroy();
1118
+ };
1119
+ const deadline = setTimeout(() => {
1120
+ finish(() => reject(error('OAuth request timed out.')));
1121
+ req.destroy();
1122
+ }, timeoutMs);
1123
+ opts.signal?.addEventListener('abort', abort, {
1124
+ once: true
1125
+ });
1126
+ req.on('error', () => finish(() => reject(error('OAuth request failed.'))));
1127
+ if (opts.body) {
1128
+ req.write(opts.body);
1129
+ }
1130
+ req.end();
1131
+ });
1132
+ }
1133
+ async function discover(opts) {
1134
+ const r = await http(RESOURCE_METADATA, {
1135
+ signal: opts.signal,
1136
+ proxy: opts.apiProxy
1137
+ });
1138
+ const rb = r.body;
1139
+ if (r.status !== 200 || !objects.isObjectObject(rb) || rb['resource'] !== OAUTH_RESOURCE || !Array.isArray(rb['authorization_servers']) || !rb['authorization_servers'].some(server => server === OAUTH_ISSUER) || !Array.isArray(rb['scopes_supported']) || rb['scopes_supported'].length !== REQUIRED_SCOPES.length || REQUIRED_SCOPES.some(s => !rb['scopes_supported'].includes(s))) {
1140
+ throw error('Socket OAuth resource metadata could not be verified.');
1141
+ }
1142
+ const ir = await http(ISSUER_METADATA, {
1143
+ signal: opts.signal,
1144
+ proxy: opts.apiProxy
1145
+ });
1146
+ const m = ir.body;
1147
+ if (ir.status !== 200 || !objects.isObjectObject(m) || m['issuer'] !== OAUTH_ISSUER || !Array.isArray(m['grant_types_supported']) || !m['grant_types_supported'].includes('authorization_code') || !m['grant_types_supported'].includes('refresh_token') || !Array.isArray(m['code_challenge_methods_supported']) || !m['code_challenge_methods_supported'].includes('S256') || !Array.isArray(m['token_endpoint_auth_methods_supported']) || !m['token_endpoint_auth_methods_supported'].includes('none')) {
1148
+ throw error('Socket OAuth issuer metadata is invalid.');
1149
+ }
1150
+ return {
1151
+ authorize: trustedEndpoint(m['authorization_endpoint']),
1152
+ register: trustedEndpoint(m['registration_endpoint']),
1153
+ token: trustedEndpoint(m['token_endpoint']),
1154
+ ...(m['revocation_endpoint'] ? {
1155
+ revoke: trustedEndpoint(m['revocation_endpoint'])
1156
+ } : {})
1157
+ };
1158
+ }
1159
+ function parseToken(r, fallback, meta) {
1160
+ const b = r.body;
1161
+ if (r.status < 200 || r.status >= 300 || !objects.isObjectObject(b) || typeof b['access_token'] !== 'string' || !b['access_token'].trim() || typeof b['token_type'] !== 'string' || b['token_type'].toLowerCase() !== 'bearer' || typeof b['expires_in'] !== 'number' || !Number.isFinite(b['expires_in']) || b['expires_in'] <= 0 || !Number.isSafeInteger(Date.now() + b['expires_in'] * 1000) || b['refresh_token'] !== undefined && (typeof b['refresh_token'] !== 'string' || !b['refresh_token'])) {
1162
+ const code = objects.isObjectObject(b) && b['error'] === 'invalid_grant';
1163
+ throw error(code ? 'The saved session expired or was revoked. Run `socket login` again.' : 'Token exchange failed. Run `socket login` again if the problem continues.');
1164
+ }
1165
+ if (b['scope'] !== undefined && typeof b['scope'] !== 'string') {
1166
+ throw error('The authorization server returned invalid permissions.');
1167
+ }
1168
+ const scopes = typeof b['scope'] === 'string' ? b['scope'].split(/\s+/).filter(Boolean) : fallback;
1169
+ if (scopes.some(s => !REQUIRED_SCOPES.includes(s))) {
1170
+ throw error('The authorization server returned unsupported permissions.');
1171
+ }
1172
+ if (REQUIRED_SCOPES.some(scope => !scopes.includes(scope))) {
1173
+ throw error('The authorization server did not grant the required read-only permissions.');
1174
+ }
1175
+ return {
1176
+ version: 1,
1177
+ issuer: OAUTH_ISSUER,
1178
+ resource: OAUTH_RESOURCE,
1179
+ apiOrigin: OAUTH_ISSUER,
1180
+ clientId: meta.clientId,
1181
+ accessToken: b['access_token'],
1182
+ ...(typeof b['refresh_token'] === 'string' ? {
1183
+ refreshToken: b['refresh_token']
1184
+ } : {}),
1185
+ expiresAt: Date.now() + b['expires_in'] * 1000,
1186
+ scopes,
1187
+ tokenEndpoint: meta.tokenEndpoint,
1188
+ ...(meta.revocationEndpoint ? {
1189
+ revocationEndpoint: meta.revocationEndpoint
1190
+ } : {})
1191
+ };
1192
+ }
1193
+ function same(a, b) {
1194
+ const x = Buffer.from(a);
1195
+ const y = Buffer.from(b);
1196
+ return x.length === y.length && require$$0.timingSafeEqual(x, y);
1197
+ }
1198
+ async function beginOAuthLogin(options) {
1199
+ const controller = new AbortController();
1200
+ const abort = () => controller.abort(options.signal?.reason);
1201
+ if (options.signal?.aborted) {
1202
+ abort();
1203
+ }
1204
+ options.signal?.addEventListener('abort', abort, {
1205
+ once: true
1206
+ });
1207
+ const timeout = setTimeout(() => controller.abort(error('Sign-in timed out. Run `socket login` to try again.')), FLOW_TIMEOUT);
1208
+ const signal = controller.signal;
1209
+ let server;
1210
+ try {
1211
+ const meta = await discover({
1212
+ signal,
1213
+ apiProxy: options.apiProxy
1214
+ });
1215
+ const state = random();
1216
+ const verifier = random(48);
1217
+ const challenge = require$$0.createHash('sha256').update(verifier).digest('base64url');
1218
+ let resolveCode;
1219
+ let rejectCode;
1220
+ let settled = false;
1221
+ const codePromise = new Promise((resolve, reject) => {
1222
+ resolveCode = resolve;
1223
+ rejectCode = reject;
1224
+ });
1225
+ // Attach a rejection observer immediately: an OAuth error callback can arrive while DCR is pending.
1226
+ void codePromise.catch(() => {});
1227
+ server = require$$12.createServer((req, res) => {
1228
+ let u;
1229
+ try {
1230
+ u = new URL(req.url ?? '/', 'http://127.0.0.1');
1231
+ } catch {
1232
+ res.writeHead(400).end('Invalid callback request.');
1233
+ return;
1234
+ }
1235
+ if (req.method !== 'GET' || u.pathname !== '/oauth/callback') {
1236
+ res.writeHead(404).end();
1237
+ return;
1238
+ }
1239
+ if (settled) {
1240
+ res.writeHead(410).end();
1241
+ return;
1242
+ }
1243
+ if (!same(u.searchParams.get('state') ?? '', state)) {
1244
+ res.writeHead(400).end('Sign-in state did not match.');
1245
+ return;
1246
+ }
1247
+ if (u.searchParams.has('error') || !u.searchParams.get('code')) {
1248
+ settled = true;
1249
+ res.writeHead(400).end('Sign-in was not completed.');
1250
+ rejectCode(error('Authorization was declined.'));
1251
+ return;
1252
+ }
1253
+ settled = true;
1254
+ res.writeHead(200, {
1255
+ 'content-type': 'text/html; charset=utf-8',
1256
+ 'cache-control': 'no-store'
1257
+ }).end('<!doctype html><title>Socket CLI</title><p>Sign-in complete. Return to your terminal.</p>');
1258
+ resolveCode(u.searchParams.get('code'));
1259
+ });
1260
+ signal.addEventListener('abort', () => {
1261
+ if (!settled) {
1262
+ settled = true;
1263
+ rejectCode(oauthCancellationError(signal));
1264
+ }
1265
+ }, {
1266
+ once: true
1267
+ });
1268
+ if (signal.aborted && !settled) {
1269
+ settled = true;
1270
+ rejectCode(oauthCancellationError(signal));
1271
+ }
1272
+ const redirectUri = await new Promise((resolve, reject) => {
1273
+ server.once('error', () => reject(error('Could not start the local callback listener.')));
1274
+ server.listen(0, '127.0.0.1', () => {
1275
+ const a = server.address();
1276
+ if (!a || typeof a === 'string') {
1277
+ reject(error('Could not start the local callback listener.'));
1278
+ } else {
1279
+ resolve(`http://127.0.0.1:${a.port}/oauth/callback`);
1280
+ }
1281
+ });
1282
+ });
1283
+ const registration = await http(meta.register, {
1284
+ method: 'POST',
1285
+ signal,
1286
+ proxy: options.apiProxy,
1287
+ headers: {
1288
+ 'content-type': 'application/json'
1289
+ },
1290
+ body: JSON.stringify({
1291
+ client_name: 'Socket CLI',
1292
+ redirect_uris: [redirectUri],
1293
+ grant_types: ['authorization_code', 'refresh_token'],
1294
+ response_types: ['code'],
1295
+ token_endpoint_auth_method: 'none'
1296
+ })
1297
+ });
1298
+ const reg = registration.body;
1299
+ if (registration.status < 200 || registration.status >= 300 || !objects.isObjectObject(reg) || typeof reg['client_id'] !== 'string' || !reg['client_id'].trim() || reg['token_endpoint_auth_method'] !== undefined && reg['token_endpoint_auth_method'] !== 'none' || reg['redirect_uris'] !== undefined && (!Array.isArray(reg['redirect_uris']) || !reg['redirect_uris'].some(value => value === redirectUri)) || reg['grant_types'] !== undefined && (!Array.isArray(reg['grant_types']) || !['authorization_code', 'refresh_token'].every(grant => reg['grant_types'].some(value => value === grant))) || reg['response_types'] !== undefined && (!Array.isArray(reg['response_types']) || !reg['response_types'].some(value => value === 'code'))) {
1300
+ throw error('The OAuth client could not be registered.');
1301
+ }
1302
+ const clientId = reg['client_id'];
1303
+ const url = new URL(meta.authorize);
1304
+ url.search = form({
1305
+ response_type: 'code',
1306
+ client_id: clientId,
1307
+ redirect_uri: redirectUri,
1308
+ scope: REQUIRED_SCOPES.join(' '),
1309
+ state,
1310
+ code_challenge: challenge,
1311
+ code_challenge_method: 'S256',
1312
+ resource: OAUTH_RESOURCE
1313
+ });
1314
+ options.onAuthorizationUrl(url.href);
1315
+ if (options.openBrowser !== false) {
1316
+ try {
1317
+ await vendor.open(url.href);
1318
+ } catch {
1319
+ /* URL was printed; manual browser completion remains available. */
1320
+ }
1321
+ }
1322
+ const code = await codePromise;
1323
+ const token = await http(meta.token, {
1324
+ method: 'POST',
1325
+ signal,
1326
+ proxy: options.apiProxy,
1327
+ headers: {
1328
+ 'content-type': 'application/x-www-form-urlencoded'
1329
+ },
1330
+ body: form({
1331
+ grant_type: 'authorization_code',
1332
+ code,
1333
+ client_id: clientId,
1334
+ redirect_uri: redirectUri,
1335
+ code_verifier: verifier,
1336
+ resource: OAUTH_RESOURCE
1337
+ })
1338
+ });
1339
+ return parseToken(token, REQUIRED_SCOPES, {
1340
+ clientId,
1341
+ tokenEndpoint: meta.token,
1342
+ ...(meta.revoke ? {
1343
+ revocationEndpoint: meta.revoke
1344
+ } : {})
1345
+ });
1346
+ } finally {
1347
+ clearTimeout(timeout);
1348
+ options.signal?.removeEventListener('abort', abort);
1349
+ server?.close();
1350
+ server?.closeAllConnections();
1351
+ }
1352
+ }
1353
+ const filePath = dir => path.join(dir, FILE);
1354
+ function validCredentials(value) {
1355
+ if (!objects.isObjectObject(value) || value['version'] !== 1 || value['issuer'] !== OAUTH_ISSUER || value['resource'] !== OAUTH_RESOURCE || value['apiOrigin'] !== OAUTH_ISSUER || typeof value['clientId'] !== 'string' || !value['clientId'] || typeof value['accessToken'] !== 'string' || !value['accessToken'] || typeof value['expiresAt'] !== 'number' || !Number.isFinite(value['expiresAt']) || value['expiresAt'] <= 0 || !Array.isArray(value['scopes']) || value['scopes'].some(s => typeof s !== 'string' || !REQUIRED_SCOPES.includes(s)) || value['refreshToken'] !== undefined && (typeof value['refreshToken'] !== 'string' || !value['refreshToken'])) {
1356
+ return false;
1357
+ }
1358
+ try {
1359
+ trustedEndpoint(value['tokenEndpoint']);
1360
+ if (value['revocationEndpoint'] !== undefined) {
1361
+ trustedEndpoint(value['revocationEndpoint']);
1362
+ }
1363
+ return true;
1364
+ } catch {
1365
+ return false;
1366
+ }
1367
+ }
1368
+ function readOAuthCredentials(directory) {
1369
+ try {
1370
+ const x = JSON.parse(u.readFileSync(filePath(directory), 'utf8'));
1371
+ if (!validCredentials(x)) {
1372
+ throw error('Saved OAuth credentials are invalid. Run `socket login` again.');
1373
+ }
1374
+ return x;
1375
+ } catch (e) {
1376
+ if (e.code === 'ENOENT') {
1377
+ return undefined;
1378
+ }
1379
+ if (e instanceof SyntaxError) {
1380
+ throw error('Saved OAuth credentials are corrupt. Run `socket login` again.');
1381
+ }
1382
+ throw e;
1383
+ }
1384
+ }
1385
+ async function locked(directory, action, signal) {
1386
+ if (signal?.aborted) {
1387
+ throw oauthCancellationError(signal);
1388
+ }
1389
+ await u.promises.mkdir(directory, {
1390
+ recursive: true,
1391
+ mode: 0o700
1392
+ });
1393
+ const lock = `${filePath(directory)}.lock`;
1394
+ const until = Date.now() + LOCK_TIMEOUT;
1395
+ while (true) {
1396
+ try {
1397
+ // This await performs the inter-process mutex acquisition.
1398
+ // eslint-disable-next-line no-await-in-loop
1399
+ await u.promises.mkdir(lock, {
1400
+ mode: 0o700
1401
+ });
1402
+ break;
1403
+ } catch (e) {
1404
+ if (e.code !== 'EEXIST') {
1405
+ throw e;
1406
+ }
1407
+ if (Date.now() >= until) {
1408
+ throw error(`Could not acquire sign-in lock ${lock}. After confirming no other Socket CLI process is running, remove this lock directory and retry.`);
1409
+ }
1410
+ if (signal?.aborted) {
1411
+ throw oauthCancellationError(signal);
1412
+ }
1413
+ // eslint-disable-next-line no-await-in-loop
1414
+ await new Promise((resolve, reject) => {
1415
+ const timer = setTimeout(() => {
1416
+ signal?.removeEventListener('abort', onAbort);
1417
+ resolve();
1418
+ }, 100);
1419
+ const onAbort = () => {
1420
+ clearTimeout(timer);
1421
+ reject(oauthCancellationError(signal));
1422
+ };
1423
+ signal?.addEventListener('abort', onAbort, {
1424
+ once: true
1425
+ });
1426
+ if (signal?.aborted) {
1427
+ onAbort();
1428
+ }
1429
+ });
1430
+ }
1431
+ }
1432
+ try {
1433
+ return await action();
1434
+ } finally {
1435
+ await u.promises.rm(lock, {
1436
+ recursive: true,
1437
+ force: true
1438
+ });
1439
+ }
1440
+ }
1441
+ async function writeAtomic(directory, credentials) {
1442
+ await u.promises.chmod(directory, 0o700).catch(() => {});
1443
+ const target = filePath(directory);
1444
+ const tmp = `${target}.${process.pid}.${random(6)}.tmp`;
1445
+ try {
1446
+ await u.promises.writeFile(tmp, `${JSON.stringify(credentials, null, 2)}\n`, {
1447
+ mode: 0o600,
1448
+ flag: 'wx'
1449
+ });
1450
+ await u.promises.chmod(tmp, 0o600);
1451
+ await u.promises.rename(tmp, target);
1452
+ } finally {
1453
+ await u.promises.rm(tmp, {
1454
+ force: true
1455
+ }).catch(() => {});
1456
+ }
1457
+ }
1458
+ async function saveOAuthCredentials(directory, credentials) {
1459
+ if (!validCredentials(credentials)) {
1460
+ throw error('Refusing to save invalid OAuth credentials.');
1461
+ }
1462
+ await locked(directory, () => writeAtomic(directory, credentials));
1463
+ }
1464
+ async function resolveOAuthAccessToken(directory, options = {}) {
1465
+ if (options.signal?.aborted) {
1466
+ throw oauthCancellationError(options.signal);
1467
+ }
1468
+ const current = readOAuthCredentials(directory);
1469
+ if (!current) {
1470
+ return undefined;
1471
+ }
1472
+ if (current.expiresAt > Date.now() + 30_000) {
1473
+ return current.accessToken;
1474
+ }
1475
+ return await locked(directory, async () => {
1476
+ if (options.signal?.aborted) {
1477
+ throw oauthCancellationError(options.signal);
1478
+ }
1479
+ const latest = readOAuthCredentials(directory);
1480
+ if (!latest) {
1481
+ throw error('The saved session was removed. Run `socket login` again.');
1482
+ }
1483
+ if (latest.expiresAt > Date.now() + 30_000) {
1484
+ return latest.accessToken;
1485
+ }
1486
+ if (!latest.refreshToken) {
1487
+ throw error('The saved session expired. Run `socket login` again.');
1488
+ }
1489
+ if (options.signal?.aborted) {
1490
+ throw oauthCancellationError(options.signal);
1491
+ }
1492
+ // Durably discard the rotating token before sending it. A timeout/crash can
1493
+ // never cause another process to replay a token the server may have used.
1494
+ const refreshToken = latest.refreshToken;
1495
+ await writeAtomic(directory, {
1496
+ ...latest,
1497
+ refreshToken: undefined
1498
+ });
1499
+ const result = await http(latest.tokenEndpoint, {
1500
+ method: 'POST',
1501
+ signal: options.signal,
1502
+ proxy: options.apiProxy,
1503
+ timeoutMs: options.requestTimeoutMs,
1504
+ headers: {
1505
+ 'content-type': 'application/x-www-form-urlencoded'
1506
+ },
1507
+ body: form({
1508
+ grant_type: 'refresh_token',
1509
+ client_id: latest.clientId,
1510
+ refresh_token: refreshToken,
1511
+ resource: OAUTH_RESOURCE
1512
+ })
1513
+ });
1514
+ const fresh = parseToken(result, latest.scopes, {
1515
+ clientId: latest.clientId,
1516
+ tokenEndpoint: latest.tokenEndpoint,
1517
+ ...(latest.revocationEndpoint ? {
1518
+ revocationEndpoint: latest.revocationEndpoint
1519
+ } : {})
1520
+ });
1521
+ await writeAtomic(directory, fresh);
1522
+ return fresh.accessToken;
1523
+ }, options.signal);
1524
+ }
1525
+ async function logoutOAuth(directory, options = {}) {
1526
+ return await locked(directory, async () => {
1527
+ let creds;
1528
+ let warning;
1529
+ try {
1530
+ creds = readOAuthCredentials(directory);
1531
+ } catch {
1532
+ warning = 'Saved credentials were invalid; local sign-in data was removed.';
1533
+ }
1534
+ let revoked = false;
1535
+ if (creds) {
1536
+ if (!creds.revocationEndpoint) {
1537
+ warning = 'Remote session revocation was not confirmed.';
1538
+ } else {
1539
+ try {
1540
+ const token = creds.refreshToken ?? creds.accessToken;
1541
+ const hint = creds.refreshToken ? 'refresh_token' : 'access_token';
1542
+ const r = await http(creds.revocationEndpoint, {
1543
+ method: 'POST',
1544
+ signal: options.signal,
1545
+ proxy: options.apiProxy,
1546
+ allowEmpty: true,
1547
+ headers: {
1548
+ 'content-type': 'application/x-www-form-urlencoded'
1549
+ },
1550
+ body: form({
1551
+ client_id: creds.clientId,
1552
+ token,
1553
+ token_type_hint: hint
1554
+ })
1555
+ });
1556
+ revoked = r.status >= 200 && r.status < 300;
1557
+ if (!revoked) {
1558
+ warning = 'Remote session revocation was not confirmed.';
1559
+ }
1560
+ } catch {
1561
+ warning = 'Remote session revocation was not confirmed.';
1562
+ }
1563
+ }
1564
+ }
1565
+ await u.promises.rm(filePath(directory), {
1566
+ force: true
1567
+ });
1568
+ return {
1569
+ revoked,
1570
+ ...(warning ? {
1571
+ warning
1572
+ } : {})
1573
+ };
1574
+ });
1575
+ }
1576
+
972
1577
  /**
973
1578
  * Telemetry service for Socket CLI.
974
1579
  * Manages event collection, batching, and submission to Socket API.
@@ -1879,76 +2484,117 @@ function getDefaultProxyUrl() {
1879
2484
  const apiProxy = constants.default.ENV.SOCKET_CLI_API_PROXY || getConfigValueOrUndef(constants.CONFIG_KEY_API_PROXY);
1880
2485
  return url.isUrl(apiProxy) ? apiProxy : undefined;
1881
2486
  }
1882
-
1883
- // Cached extra CA certificates for SSL_CERT_FILE support.
1884
- let _extraCaCerts;
1885
- let _extraCaCertsResolved = false;
1886
-
1887
- // Returns combined root and extra CA certificates when SSL_CERT_FILE is set
1888
- // but NODE_EXTRA_CA_CERTS is not. Node.js loads NODE_EXTRA_CA_CERTS at process
1889
- // startup, so setting SSL_CERT_FILE alone does not affect the current process.
1890
- // This function reads the certificate file manually and combines it with the
1891
- // default root certificates for use in HTTPS agents.
1892
- function getExtraCaCerts() {
1893
- if (_extraCaCertsResolved) {
1894
- return _extraCaCerts;
1895
- }
1896
- _extraCaCertsResolved = true;
1897
- // Node.js already loaded extra CA certs at startup.
1898
- if (process.env['NODE_EXTRA_CA_CERTS']) {
2487
+ function getDefaultApiToken() {
2488
+ if (constants.default.ENV.SOCKET_CLI_NO_API_TOKEN) {
1899
2489
  return undefined;
1900
2490
  }
1901
- // Check for SSL_CERT_FILE fallback via constants.
1902
- const certPath = constants.default.ENV.NODE_EXTRA_CA_CERTS;
1903
- if (!certPath) {
1904
- return undefined;
2491
+ const environmentToken = constants.default.ENV.SOCKET_CLI_API_TOKEN;
2492
+ if (strings.isNonEmptyString(environmentToken)) {
2493
+ return environmentToken;
1905
2494
  }
1906
- try {
1907
- const extraCerts = u.readFileSync(certPath, 'utf-8');
1908
- // Combine default root certificates with extra certificates. Specifying ca
1909
- // in an agent replaces the default trust store, so both must be included.
1910
- _extraCaCerts = [...node_tls.rootCertificates, extraCerts];
1911
- return _extraCaCerts;
1912
- } catch (e) {
1913
- debug$2.debugFn('warn', `Failed to read certificate file: ${certPath}`, e);
2495
+ if (getConfigValueOrUndef(constants.CONFIG_KEY_AUTH_TYPE) === 'oauth') {
1914
2496
  return undefined;
1915
2497
  }
2498
+ const key = getConfigValueOrUndef(constants.CONFIG_KEY_API_TOKEN);
2499
+ return strings.isNonEmptyString(key) ? key : undefined;
1916
2500
  }
1917
2501
 
1918
- // This Socket API token should be stored globally for the duration of the CLI execution.
1919
- let _defaultToken;
1920
- function getDefaultApiToken() {
1921
- if (constants.default.ENV.SOCKET_CLI_NO_API_TOKEN) {
1922
- _defaultToken = undefined;
1923
- return _defaultToken;
1924
- }
1925
- const key = constants.default.ENV.SOCKET_CLI_API_TOKEN || getConfigValueOrUndef(constants.CONFIG_KEY_API_TOKEN) || _defaultToken;
1926
- _defaultToken = strings.isNonEmptyString(key) ? key : undefined;
1927
- return _defaultToken;
2502
+ /** Whether saved OAuth auth is active instead of a flag or explicit token. */
2503
+ function isOAuthLoginActive() {
2504
+ return !isConfigFromFlag() && !constants.default.ENV.SOCKET_CLI_NO_API_TOKEN && !constants.default.ENV.SOCKET_CLI_API_TOKEN && getConfigValueOrUndef(constants.CONFIG_KEY_AUTH_TYPE) === 'oauth';
1928
2505
  }
1929
- function getPublicApiToken() {
1930
- return getDefaultApiToken() || constants.default.ENV.SOCKET_CLI_API_TOKEN || constants.default.SOCKET_PUBLIC_API_TOKEN;
2506
+ async function resolvePublicApiToken(options) {
2507
+ const token = await resolveDefaultApiToken(options);
2508
+ if (token) {
2509
+ return token;
2510
+ }
2511
+ if (!constants.default.ENV.SOCKET_CLI_NO_API_TOKEN && getConfigValueOrUndef(constants.CONFIG_KEY_AUTH_TYPE) === 'oauth') {
2512
+ throw new Error('Browser sign-in has no usable access token. Run `socket login` to sign in again.');
2513
+ }
2514
+ return constants.default.SOCKET_PUBLIC_API_TOKEN;
1931
2515
  }
1932
2516
  function getVisibleTokenPrefix() {
2517
+ if (!constants.default.ENV.SOCKET_CLI_NO_API_TOKEN && getConfigValueOrUndef(constants.CONFIG_KEY_AUTH_TYPE) === 'oauth' && !constants.default.ENV.SOCKET_CLI_API_TOKEN) {
2518
+ return 'oauth';
2519
+ }
1933
2520
  const apiToken = getDefaultApiToken();
1934
2521
  return apiToken ? apiToken.slice(TOKEN_PREFIX_LENGTH, TOKEN_PREFIX_LENGTH + TOKEN_VISIBLE_LENGTH) : '';
1935
2522
  }
1936
2523
  function hasDefaultApiToken() {
1937
- return !!getDefaultApiToken();
2524
+ if (getDefaultApiToken()) {
2525
+ return true;
2526
+ }
2527
+ const directory = constants.default.socketAppDataPath;
2528
+ return Boolean(isOAuthLoginActive() && directory && hasOAuthCredentialFile(directory));
2529
+ }
2530
+ function hasOAuthCredentialFile(directory) {
2531
+ try {
2532
+ return Boolean(readOAuthCredentials(directory));
2533
+ } catch {
2534
+ // Keep preflight from crashing; async token resolution reports a useful
2535
+ // error and must not fall back to another credential.
2536
+ return true;
2537
+ }
2538
+ }
2539
+ async function resolveDefaultApiToken(options) {
2540
+ if (constants.default.ENV.SOCKET_CLI_NO_API_TOKEN) {
2541
+ return undefined;
2542
+ }
2543
+ const environmentToken = constants.default.ENV.SOCKET_CLI_API_TOKEN;
2544
+ if (strings.isNonEmptyString(environmentToken)) {
2545
+ return environmentToken;
2546
+ }
2547
+ if (getConfigValueOrUndef(constants.CONFIG_KEY_AUTH_TYPE) !== 'oauth') {
2548
+ const configured = getConfigValueOrUndef(constants.CONFIG_KEY_API_TOKEN);
2549
+ return strings.isNonEmptyString(configured) ? configured : undefined;
2550
+ }
2551
+
2552
+ // Explicit config is read-only and must never consult persisted OAuth state.
2553
+ if (isConfigFromFlag()) {
2554
+ return undefined;
2555
+ }
2556
+ const directory = constants.default.socketAppDataPath;
2557
+ if (!directory) {
2558
+ throw new Error('OAuth credentials are unavailable in this environment. Run `socket login` in a supported user session.');
2559
+ }
2560
+ const credentials = readOAuthCredentials(directory);
2561
+ if (!credentials) {
2562
+ throw new Error('Browser sign-in is selected but its credentials are missing or invalid. Run `socket login` to sign in again.');
2563
+ }
2564
+ const apiBaseUrl = options?.apiBaseUrl ?? getDefaultApiBaseUrl$1();
2565
+ if (apiBaseUrl) {
2566
+ let origin;
2567
+ try {
2568
+ origin = new URL(apiBaseUrl).origin;
2569
+ } catch {
2570
+ throw new Error('The configured Socket API URL is invalid for OAuth.');
2571
+ }
2572
+ if (origin !== credentials.apiOrigin) {
2573
+ throw new Error('Browser sign-in can only be used with Socket’s trusted API origin. Use `socket login --api-token` for a custom API URL.');
2574
+ }
2575
+ }
2576
+ return await resolveOAuthAccessToken(directory, {
2577
+ apiProxy: options?.apiProxy ?? getDefaultProxyUrl(),
2578
+ signal: options?.signal
2579
+ });
1938
2580
  }
1939
2581
  async function setupSdk(options) {
1940
2582
  const opts = {
1941
2583
  __proto__: null,
1942
2584
  ...options
1943
2585
  };
1944
- let {
1945
- apiToken = getDefaultApiToken()
1946
- } = opts;
1947
- if (typeof apiToken !== 'string' && vendor.isInteractiveExports()) {
1948
- apiToken = await prompts.password({
1949
- message: 'Enter your Socket.dev API token (not saved, use socket login to persist)'
1950
- });
1951
- _defaultToken = apiToken;
2586
+ let apiToken;
2587
+ try {
2588
+ apiToken = opts.apiToken ?? (await resolveDefaultApiToken({
2589
+ apiBaseUrl: opts.apiBaseUrl,
2590
+ apiProxy: opts.apiProxy
2591
+ }));
2592
+ } catch (error) {
2593
+ return {
2594
+ ok: false,
2595
+ message: 'Auth Error',
2596
+ cause: getErrorCause(error)
2597
+ };
1952
2598
  }
1953
2599
  if (!apiToken) {
1954
2600
  return {
@@ -2095,6 +2741,18 @@ async function setupSdk(options) {
2095
2741
 
2096
2742
  const MAX_REDIRECTS = 20;
2097
2743
  const NO_ERROR_MESSAGE = 'No error message returned';
2744
+ function getApiErrorText(value) {
2745
+ if (typeof value === 'string') {
2746
+ return value;
2747
+ }
2748
+ if (!value || typeof value !== 'object') {
2749
+ return '';
2750
+ }
2751
+ const record = value;
2752
+ const details = record['details'];
2753
+ const nestedCode = details && typeof details === 'object' ? details['code'] : undefined;
2754
+ return [record['code'], nestedCode, record['message'], record['error']].filter(part => typeof part === 'string').join(' ');
2755
+ }
2098
2756
 
2099
2757
  // Cached HTTPS agent for direct API calls. Undefined only until the first
2100
2758
  // getHttpsAgent() call lazily creates it.
@@ -2139,12 +2797,17 @@ function getHttpsAgent() {
2139
2797
  // SSL_CERT_FILE is configured) so requests do not inherit Node's global-agent
2140
2798
  // keepAlive socket timeout.
2141
2799
 
2800
+ function resolveConfiguredSocketApiTimeout(timeout = constants.default.ENV.SOCKET_CLI_API_TIMEOUT) {
2801
+ return Number.isFinite(timeout) && timeout > 0 ? timeout : undefined;
2802
+ }
2803
+
2142
2804
  // Internal httpsRequest-based fetch with redirect support.
2143
2805
  function _httpsRequestFetch(url, init, agent, redirectCount) {
2144
2806
  return new Promise((resolve, reject) => {
2145
2807
  const headers = {
2146
2808
  ...init.headers
2147
2809
  };
2810
+ let timedOutError;
2148
2811
  // Set Content-Length for request bodies to avoid chunked transfer encoding.
2149
2812
  if (init.body) {
2150
2813
  headers['content-length'] = String(Buffer.byteLength(init.body));
@@ -2152,7 +2815,8 @@ function _httpsRequestFetch(url, init, agent, redirectCount) {
2152
2815
  const req = require$$13.request(url, {
2153
2816
  method: init.method || 'GET',
2154
2817
  headers,
2155
- agent
2818
+ agent,
2819
+ timeout: init.timeout
2156
2820
  }, res => {
2157
2821
  const {
2158
2822
  statusCode
@@ -2189,7 +2853,8 @@ function _httpsRequestFetch(url, init, agent, redirectCount) {
2189
2853
  headers: redirectHeaders
2190
2854
  } : {
2191
2855
  headers: redirectHeaders,
2192
- method: 'GET'
2856
+ method: 'GET',
2857
+ timeout: init.timeout
2193
2858
  }, agent, redirectCount + 1));
2194
2859
  return;
2195
2860
  }
@@ -2219,6 +2884,9 @@ function _httpsRequestFetch(url, init, agent, redirectCount) {
2219
2884
  res.on('error', err => {
2220
2885
  controller.error(err);
2221
2886
  });
2887
+ res.on('aborted', () => {
2888
+ controller.error(timedOutError ?? new Error('Socket API response aborted'));
2889
+ });
2222
2890
  },
2223
2891
  cancel() {
2224
2892
  res.destroy();
@@ -2230,6 +2898,14 @@ function _httpsRequestFetch(url, init, agent, redirectCount) {
2230
2898
  headers: responseHeaders
2231
2899
  }));
2232
2900
  });
2901
+ if (init.timeout !== undefined) {
2902
+ req.on('timeout', () => {
2903
+ timedOutError = Object.assign(new Error(`Socket API request timed out after ${init.timeout} ms`), {
2904
+ code: 'ETIMEDOUT'
2905
+ });
2906
+ req.destroy(timedOutError);
2907
+ });
2908
+ }
2233
2909
  if (init.body) {
2234
2910
  req.write(init.body);
2235
2911
  }
@@ -2243,14 +2919,18 @@ function _httpsRequestFetch(url, init, agent, redirectCount) {
2243
2919
  * API gives in its `{ error: { message } }` body when there is one.
2244
2920
  */
2245
2921
  async function describeApiFailure(response, path) {
2246
- let serverMessage;
2922
+ let serverMessage = '';
2923
+ let serverCode = '';
2247
2924
  try {
2248
- serverMessage = JSON.parse(await response.text())?.error?.message;
2925
+ const payload = JSON.parse(await response.text());
2926
+ const serverError = payload?.error;
2927
+ serverMessage = getApiErrorText(serverError);
2928
+ serverCode = [payload?.code, serverError?.code, serverError?.details?.code].filter(part => typeof part === 'string').join(' ');
2249
2929
  } catch {
2250
2930
  // A body that isn't JSON carries no message.
2251
2931
  }
2252
- const reason = await getErrorMessageForHttpStatusCode(response.status);
2253
- return typeof serverMessage === 'string' && serverMessage ? `${response.statusText}: ${serverMessage} (reason: ${reason}) (path: ${path})` : `${response.statusText} (reason: ${reason}) (path: ${path})`;
2932
+ const reason = await getErrorMessageForHttpStatusCode(response.status, [serverCode, serverMessage].filter(Boolean).join(' '));
2933
+ return serverMessage ? `${response.statusText}: ${serverMessage} (reason: ${reason}) (path: ${path})` : `${response.statusText} (reason: ${reason}) (path: ${path})`;
2254
2934
  }
2255
2935
  async function apiFetch(url, init = {}) {
2256
2936
  return await _httpsRequestFetch(url, init, getHttpsAgent(), 0);
@@ -2270,7 +2950,13 @@ function getCommandRequirements(cmdPath) {
2270
2950
  /**
2271
2951
  * Log required permissions for a command when encountering 403 errors.
2272
2952
  */
2273
- function logPermissionsFor403(cmdPath) {
2953
+ function logPermissionsFor403(cmdPath, apiError) {
2954
+ if (isOAuthLoginActive()) {
2955
+ const guidance = getOAuth403Guidance(apiError);
2956
+ if (guidance) {
2957
+ logger.logger.error(guidance);
2958
+ }
2959
+ }
2274
2960
  const requirements = getCommandRequirements(cmdPath);
2275
2961
  if (!requirements?.permissions?.length) {
2276
2962
  return;
@@ -2279,7 +2965,9 @@ function logPermissionsFor403(cmdPath) {
2279
2965
  for (const permission of requirements.permissions) {
2280
2966
  logger.logger.error(` - ${permission}`);
2281
2967
  }
2282
- logger.logger.error('Please ensure your API token has the required permissions.');
2968
+ if (!isOAuthLoginActive()) {
2969
+ logger.logger.error('Please ensure your API token has the required permissions.');
2970
+ }
2283
2971
  }
2284
2972
 
2285
2973
  // The Socket API server that should be used for operations.
@@ -2295,7 +2983,16 @@ function getDefaultApiBaseUrl() {
2295
2983
  /**
2296
2984
  * Get user-friendly error message for HTTP status codes.
2297
2985
  */
2298
- async function getErrorMessageForHttpStatusCode(code) {
2986
+ function getOAuth403Guidance(apiError) {
2987
+ if (/missing[_ -]capability/i.test(apiError ?? '')) {
2988
+ return 'This organization does not grant the capability required for this command. Ask an organization admin to enable it.';
2989
+ }
2990
+ if (/missing[_ -]scope/i.test(apiError ?? '')) {
2991
+ return 'Browser sign-in is read-only. Use `socket login --api-token` or SOCKET_CLI_API_TOKEN for scans and write operations.';
2992
+ }
2993
+ return undefined;
2994
+ }
2995
+ async function getErrorMessageForHttpStatusCode(code, apiError) {
2299
2996
  if (code === constants.HTTP_STATUS_BAD_REQUEST) {
2300
2997
  return 'One of the options passed might be incorrect';
2301
2998
  }
@@ -2303,6 +3000,13 @@ async function getErrorMessageForHttpStatusCode(code) {
2303
3000
  return 'Your Socket API token appears to be invalid, expired, or revoked. Please verify your token is correct and active';
2304
3001
  }
2305
3002
  if (code === constants.HTTP_STATUS_FORBIDDEN) {
3003
+ if (isOAuthLoginActive()) {
3004
+ const guidance = getOAuth403Guidance(apiError);
3005
+ if (guidance) {
3006
+ return guidance;
3007
+ }
3008
+ return 'Browser sign-in is read-only and does not support this operation. Use `socket login --api-token` or SOCKET_CLI_API_TOKEN';
3009
+ }
2306
3010
  return 'Your Socket API token may not have the required permissions for this command or you might be trying to access (data from) an organization that is not linked to the API token you are logged in with';
2307
3011
  }
2308
3012
  if (code === constants.HTTP_STATUS_NOT_FOUND) {
@@ -2395,15 +3099,16 @@ async function handleApiCall(value, options) {
2395
3099
  debug$2.debugDir('inspect', {
2396
3100
  sdkResult
2397
3101
  });
2398
- const errStr = sdkResult.error ? String(sdkResult.error).trim() : '';
3102
+ const errStr = getApiErrorText(sdkResult.error);
2399
3103
  const message = errStr || NO_ERROR_MESSAGE;
2400
- const reason = sdkResult.cause || NO_ERROR_MESSAGE;
3104
+ const reason = getApiErrorText(sdkResult.cause) || NO_ERROR_MESSAGE;
3105
+ const statusReason = sdkResult.status === constants.HTTP_STATUS_FORBIDDEN && isOAuthLoginActive() ? await getErrorMessageForHttpStatusCode(sdkResult.status, `${errStr} ${reason}`) : undefined;
2401
3106
  const baseCause = reason && message !== reason ? `${message} (reason: ${reason})` : message;
2402
3107
  const cause = sdkResult.url ? `${baseCause} (url: ${sdkResult.url})` : baseCause;
2403
3108
  const socketSdkErrorResult = {
2404
3109
  ok: false,
2405
3110
  message: 'Socket API error',
2406
- cause,
3111
+ cause: statusReason ? `${cause} (reason: ${statusReason})` : cause,
2407
3112
  data: {
2408
3113
  code: sdkResult.status
2409
3114
  }
@@ -2411,7 +3116,7 @@ async function handleApiCall(value, options) {
2411
3116
 
2412
3117
  // Log required permissions for 403 errors when in a command context.
2413
3118
  if (commandPath && sdkResult.status === 403) {
2414
- logPermissionsFor403(commandPath);
3119
+ logPermissionsFor403(commandPath, `${errStr} ${reason}`);
2415
3120
  }
2416
3121
  return socketSdkErrorResult;
2417
3122
  }
@@ -2424,61 +3129,13 @@ async function handleApiCall(value, options) {
2424
3129
  };
2425
3130
  return socketSdkSuccessResult;
2426
3131
  }
2427
- async function handleApiCallNoSpinner(value, description) {
2428
- let sdkResult;
2429
- try {
2430
- sdkResult = await value;
2431
- } catch (e) {
2432
- debug$2.debugFn('error', `API request failed: ${description}`);
2433
- debug$2.debugDir('error', e);
2434
- const errStr = e ? String(e).trim() : '';
2435
- const message = 'Socket API error';
2436
- const rawCause = errStr || NO_ERROR_MESSAGE;
2437
- const cause = message !== rawCause ? rawCause : '';
2438
- return {
2439
- ok: false,
2440
- message,
2441
- ...(cause ? {
2442
- cause
2443
- } : {})
2444
- };
2445
- }
2446
-
2447
- // The `success` discriminant is a concrete boolean literal in both branches,
2448
- // so this narrows the result to its error branch regardless of `R`.
2449
- if (sdkResult.success === false) {
2450
- debug$2.debugFn('error', `fail: ${description} bad response`);
2451
- debug$2.debugDir('inspect', {
2452
- sdkResult
2453
- });
2454
- const errStr = sdkResult.error ? String(sdkResult.error).trim() : '';
2455
- const message = errStr || NO_ERROR_MESSAGE;
2456
- const reason = sdkResult.cause || NO_ERROR_MESSAGE;
2457
- const baseCause = reason && message !== reason ? `${message} (reason: ${reason})` : message;
2458
- const cause = sdkResult.url ? `${baseCause} (url: ${sdkResult.url})` : baseCause;
2459
- return {
2460
- ok: false,
2461
- message: 'Socket API error',
2462
- cause,
2463
- data: {
2464
- code: sdkResult.status
2465
- }
2466
- };
2467
- } else {
2468
- // Narrowing a type parameter by its `success` discriminant resolves `.data`
2469
- // through the constraint's success branch (`unknown`); re-apply the precise
2470
- // per-call success type the return contract already guarantees.
2471
- return {
2472
- ok: true,
2473
- data: sdkResult.data
2474
- };
2475
- }
2476
- }
2477
3132
  async function queryApi(path, apiToken) {
2478
3133
  const baseUrl = getDefaultApiBaseUrl();
2479
3134
  const url = `${baseUrl}${baseUrl.endsWith('/') ? '' : '/'}${path}`;
3135
+ const timeout = resolveConfiguredSocketApiTimeout();
2480
3136
  const result = await apiFetch(url, {
2481
3137
  method: 'GET',
3138
+ timeout,
2482
3139
  headers: {
2483
3140
  Authorization: `Basic ${btoa(`${apiToken}:`)}`,
2484
3141
  'User-Agent': getCliUserAgent()
@@ -2493,12 +3150,23 @@ async function queryApi(path, apiToken) {
2493
3150
  * status-dependent flows such as the cached-scan 202 poll loop.
2494
3151
  */
2495
3152
  async function queryApiSafeTextWithStatus(path, description, commandPath) {
2496
- const apiToken = getDefaultApiToken();
3153
+ let apiToken;
3154
+ try {
3155
+ apiToken = await resolveDefaultApiToken({
3156
+ apiBaseUrl: getDefaultApiBaseUrl()
3157
+ });
3158
+ } catch (error) {
3159
+ return {
3160
+ ok: false,
3161
+ message: 'Authentication Error',
3162
+ cause: getErrorCause(error)
3163
+ };
3164
+ }
2497
3165
  if (!apiToken) {
2498
3166
  return {
2499
3167
  ok: false,
2500
3168
  message: 'Authentication Error',
2501
- cause: 'User must be authenticated to run this command. Run `socket login` and enter your Socket API token.'
3169
+ cause: 'User must be authenticated to run this command. Run `socket login` or set SOCKET_CLI_API_TOKEN.'
2502
3170
  };
2503
3171
  }
2504
3172
  const {
@@ -2561,10 +3229,11 @@ async function queryApiSafeTextWithStatus(path, description, commandPath) {
2561
3229
  } catch (e) {
2562
3230
  debug$2.debugFn('error', 'Failed to read API response text');
2563
3231
  debug$2.debugDir('error', e);
3232
+ const cause = isErrnoException(e) && e.code === 'ETIMEDOUT' ? `${getErrorCause(e)} (path: ${path})` : `Unexpected error reading response text (path: ${path})`;
2564
3233
  return {
2565
3234
  ok: false,
2566
3235
  message: 'API request failed',
2567
- cause: `Unexpected error reading response text (path: ${path})`
3236
+ cause
2568
3237
  };
2569
3238
  }
2570
3239
  }
@@ -2605,15 +3274,26 @@ async function queryApiSafeJson(path, description = '') {
2605
3274
  * Send POST/PUT request to Socket API with JSON response handling.
2606
3275
  */
2607
3276
  async function sendApiRequest(path, options) {
2608
- const apiToken = getDefaultApiToken();
3277
+ const baseUrl = getDefaultApiBaseUrl();
3278
+ let apiToken;
3279
+ try {
3280
+ apiToken = await resolveDefaultApiToken({
3281
+ apiBaseUrl: baseUrl
3282
+ });
3283
+ } catch (error) {
3284
+ return {
3285
+ ok: false,
3286
+ message: 'Authentication Error',
3287
+ cause: getErrorCause(error)
3288
+ };
3289
+ }
2609
3290
  if (!apiToken) {
2610
3291
  return {
2611
3292
  ok: false,
2612
3293
  message: 'Authentication Error',
2613
- cause: 'User must be authenticated to run this command. To log in, run the command `socket login` and enter your Socket API token.'
3294
+ cause: 'User must be authenticated to run this command. Run `socket login` or set SOCKET_CLI_API_TOKEN.'
2614
3295
  };
2615
3296
  }
2616
- const baseUrl = getDefaultApiBaseUrl();
2617
3297
  const {
2618
3298
  body,
2619
3299
  commandPath,
@@ -2631,8 +3311,10 @@ async function sendApiRequest(path, options) {
2631
3311
  }
2632
3312
  let result;
2633
3313
  try {
3314
+ const timeout = resolveConfiguredSocketApiTimeout();
2634
3315
  const fetchOptions = {
2635
3316
  method,
3317
+ timeout,
2636
3318
  headers: {
2637
3319
  Authorization: `Basic ${btoa(`${apiToken}:`)}`,
2638
3320
  'Content-Type': 'application/json',
@@ -2689,10 +3371,11 @@ async function sendApiRequest(path, options) {
2689
3371
  } catch (e) {
2690
3372
  debug$2.debugFn('error', 'Failed to parse API response JSON');
2691
3373
  debug$2.debugDir('error', e);
3374
+ const cause = isErrnoException(e) && e.code === 'ETIMEDOUT' ? `${getErrorCause(e)} (path: ${path})` : `Unexpected error parsing response JSON (path: ${path})`;
2692
3375
  return {
2693
3376
  ok: false,
2694
3377
  message: 'API request failed',
2695
- cause: `Unexpected error parsing response JSON (path: ${path})`
3378
+ cause
2696
3379
  };
2697
3380
  }
2698
3381
  }
@@ -2914,17 +3597,10 @@ function socketDocsLink(docPath, text) {
2914
3597
  */
2915
3598
  function socketPackageLink(ecosystem, packageName, version, text) {
2916
3599
  let url;
2917
- if (version) {
2918
- // Check if version contains a path like 'files/1.0.0/CHANGELOG.md'.
2919
- if (version.includes('/')) {
2920
- url = `https://socket.dev/${ecosystem}/package/${packageName}/${version}`;
2921
- } else {
2922
- url = `https://socket.dev/${ecosystem}/package/${packageName}/overview/${version}`;
2923
- }
2924
- } else {
3600
+ {
2925
3601
  url = `https://socket.dev/${ecosystem}/package/${packageName}`;
2926
3602
  }
2927
- return vendor.terminalLinkExports(text ?? url, url);
3603
+ return vendor.terminalLinkExports(text, url);
2928
3604
  }
2929
3605
 
2930
3606
  /**
@@ -3566,7 +4242,7 @@ async function meowWithSubcommands(config, options) {
3566
4242
  const showFullHelp = argv.includes(constants.FLAG_HELP_FULL);
3567
4243
  if (showFullHelp) {
3568
4244
  // Show full help with environment variables.
3569
- lines.push('', 'Environment variables', ' SOCKET_CLI_API_TOKEN Set the Socket API token', ' SOCKET_CLI_CONFIG A JSON stringified Socket configuration object', ' SOCKET_CLI_GITHUB_API_URL Change the base URL for GitHub REST API calls', ' SOCKET_CLI_GIT_USER_EMAIL The git config `user.email` used by Socket CLI', ` ${vendor.yoctocolorsCjsExports.italic('Defaults:')} github-actions[bot]@users.noreply.github.com`, ' SOCKET_CLI_GIT_USER_NAME The git config `user.name` used by Socket CLI', ` ${vendor.yoctocolorsCjsExports.italic('Defaults:')} github-actions[bot]`, ` SOCKET_CLI_GITHUB_TOKEN A classic or fine-grained ${vendor.terminalLinkExports('GitHub personal access token', 'https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens')}`, ` ${vendor.yoctocolorsCjsExports.italic('Aliases:')} GITHUB_TOKEN`, ' SOCKET_CLI_NO_API_TOKEN Make the default API token `undefined`', ' SOCKET_CLI_NPM_PATH The absolute location of the npm directory', ' SOCKET_CLI_ORG_SLUG Specify the Socket organization slug', '', ' SOCKET_CLI_ACCEPT_RISKS Accept risks of a Socket wrapped npm/npx run', ' SOCKET_CLI_VIEW_ALL_RISKS View all risks of a Socket wrapped npm/npx run', '', 'Environment variables for development', ' SOCKET_CLI_API_BASE_URL Change the base URL for Socket API calls', ` ${vendor.yoctocolorsCjsExports.italic('Defaults:')} The "apiBaseUrl" value of socket/settings local app data`, ` if present, else ${constants.API_V0_URL}`, ' SOCKET_CLI_API_PROXY Set the proxy Socket API requests are routed through, e.g. if set to', ` ${vendor.terminalLinkExports('http://127.0.0.1:9090', 'https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries')} then all request are passed through that proxy`, ` ${vendor.yoctocolorsCjsExports.italic('Aliases:')} HTTPS_PROXY, https_proxy, HTTP_PROXY, and http_proxy`, ' SOCKET_CLI_API_TIMEOUT Set the timeout in milliseconds for Socket API requests', ' SOCKET_CLI_DEBUG Enable debug logging in Socket CLI', ` DEBUG Enable debug logging based on the ${socketPackageLink('npm', 'debug', undefined, 'debug')} package`);
4245
+ lines.push('', 'Environment variables', ' SOCKET_CLI_API_TOKEN Set the Socket API token', ' SOCKET_CLI_CONFIG A JSON stringified Socket configuration object', ' SOCKET_CLI_GITHUB_API_URL Change the base URL for GitHub REST API calls', ' SOCKET_CLI_GIT_USER_EMAIL The git config `user.email` used by Socket CLI', ` ${vendor.yoctocolorsCjsExports.italic('Defaults:')} github-actions[bot]@users.noreply.github.com`, ' SOCKET_CLI_GIT_USER_NAME The git config `user.name` used by Socket CLI', ` ${vendor.yoctocolorsCjsExports.italic('Defaults:')} github-actions[bot]`, ` SOCKET_CLI_GITHUB_TOKEN A classic or fine-grained ${vendor.terminalLinkExports('GitHub personal access token', 'https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens')}`, ` ${vendor.yoctocolorsCjsExports.italic('Aliases:')} GITHUB_TOKEN`, ' SOCKET_CLI_NO_API_TOKEN Make the default API token `undefined`', ' SOCKET_CLI_NPM_PATH The absolute location of the npm directory', ' SOCKET_CLI_SOCKET_PATCH_PATH Executable socket-patch path for standalone builds', ' SOCKET_CLI_ORG_SLUG Specify the Socket organization slug', '', ' SOCKET_CLI_ACCEPT_RISKS Accept risks of a Socket wrapped npm/npx run', ' SOCKET_CLI_VIEW_ALL_RISKS View all risks of a Socket wrapped npm/npx run', '', 'Environment variables for development', ' SOCKET_CLI_API_BASE_URL Change the base URL for Socket API calls', ` ${vendor.yoctocolorsCjsExports.italic('Defaults:')} The "apiBaseUrl" value of socket/settings local app data`, ` if present, else ${constants.API_V0_URL}`, ' SOCKET_CLI_API_PROXY Set the proxy Socket API requests are routed through, e.g. if set to', ` ${vendor.terminalLinkExports('http://127.0.0.1:9090', 'https://docs.proxyman.io/troubleshooting/couldnt-see-any-requests-from-3rd-party-network-libraries')} then all request are passed through that proxy`, ` ${vendor.yoctocolorsCjsExports.italic('Aliases:')} HTTPS_PROXY, https_proxy, HTTP_PROXY, and http_proxy`, ' SOCKET_CLI_API_TIMEOUT Set the timeout in milliseconds for Socket API requests', ' SOCKET_CLI_DEBUG Enable debug logging in Socket CLI', ` DEBUG Enable debug logging based on the ${socketPackageLink('npm', 'debug', undefined, 'debug')} package`);
3570
4246
  } else {
3571
4247
  // Show condensed help with hint about --help-full.
3572
4248
  lines.push('', 'Environment variables [more...]', ` Use ${vendor.yoctocolorsCjsExports.bold(constants.FLAG_HELP_FULL)} to view all environment variables`);
@@ -4586,6 +5262,18 @@ function ignoreFileLinesToGlobPatterns(lines, filepath, cwd) {
4586
5262
  function ignoreFileToGlobPatterns(content, filepath, cwd) {
4587
5263
  return ignoreFileLinesToGlobPatterns(content.split(/\r?\n/), filepath, cwd);
4588
5264
  }
5265
+ function escapeMinimatchGroupStarts(pattern) {
5266
+ let escaped = '';
5267
+ let previousWasOddBackslash = false;
5268
+ for (const char of pattern) {
5269
+ if ((char === '{' || char === '(') && !previousWasOddBackslash) {
5270
+ escaped += '\\';
5271
+ }
5272
+ escaped += char;
5273
+ previousWasOddBackslash = char === '\\' ? !previousWasOddBackslash : false;
5274
+ }
5275
+ return escaped;
5276
+ }
4589
5277
 
4590
5278
  // Based on `@eslint/compat` convertIgnorePatternToMinimatch.
4591
5279
  // Apache v2.0 licensed
@@ -4609,7 +5297,7 @@ function ignorePatternToMinimatch(pattern) {
4609
5297
  // For example, gitignore pattern `src/{a,b}.js` ignores file `src/{a,b}.js`.
4610
5298
  // But, the same minimatch pattern `src/{a,b}.js` ignores files `src/a.js` and `src/b.js`.
4611
5299
  // Minimatch pattern `src/\{a,b}.js` is equivalent to gitignore pattern `src/{a,b}.js`.
4612
- const escapedPatternWithoutLeadingSlash = patternWithoutLeadingSlash.replaceAll(/(?=((?:\\.|[^{(])*))\1([{(])/guy, '$1\\$2');
5300
+ const escapedPatternWithoutLeadingSlash = escapeMinimatchGroupStarts(patternWithoutLeadingSlash);
4613
5301
  const matchInsideSuffix = patternToTest.endsWith('/**') ? '/*' : '';
4614
5302
  return `${negatedPrefix}${matchEverywherePrefix}${escapedPatternWithoutLeadingSlash}${matchInsideSuffix}`;
4615
5303
  }
@@ -5158,6 +5846,311 @@ async function realpathOrResolved(target) {
5158
5846
  }
5159
5847
  }
5160
5848
 
5849
+ /**
5850
+ * SEA runtime adapters. Node 27 VFS Workers share the parent PID, so these are
5851
+ * for allowlisted JavaScript tools that are compatible with Worker threads;
5852
+ * native helpers use getBundledTool() and a real child process instead.
5853
+ */
5854
+
5855
+ const sea = (() => {
5856
+ try {
5857
+ return require$$1.createRequire((typeof document === 'undefined' ? require$$0$1.pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.tagName.toUpperCase() === 'SCRIPT' && _documentCurrentScript.src || new URL('utils.js', document.baseURI).href)))('node:sea');
5858
+ } catch {
5859
+ // The regular Socket CLI supports Node releases predating `node:sea`.
5860
+ return {};
5861
+ }
5862
+ })();
5863
+ const extractedToolDirectories = new Map();
5864
+ // These are the only JS entrypoints the Worker adapter may launch. The paths
5865
+ // are staged under the archive root by a later helper-payload build slice;
5866
+ // absent files remain unavailable and fail closed here.
5867
+ const embeddedJsToolEntrypoints = Object.freeze({
5868
+ cdxgen: 'tools/cdxgen/sea-worker.mjs',
5869
+ synp: 'tools/synp/bin/synp.js'
5870
+ });
5871
+ const embeddedNativeToolPaths = Object.freeze({
5872
+ uv: platform => `tools/uv/${platform === 'win32' ? 'uv.exe' : 'uv'}`
5873
+ });
5874
+ function getVfsRoot() {
5875
+ const root = globalThis.__socketSeaVfsRoot;
5876
+ if (!root) {
5877
+ throw new Error('The standalone Socket VFS root is not available');
5878
+ }
5879
+ return root;
5880
+ }
5881
+ function signalFromAbortReason(reason) {
5882
+ const code = reason !== null && typeof reason === 'object' ? reason.code : undefined;
5883
+ return typeof code === 'string' && ['SIGABRT', 'SIGALRM', 'SIGBUS', 'SIGCHLD', 'SIGCONT', 'SIGFPE', 'SIGHUP', 'SIGILL', 'SIGINT', 'SIGIO', 'SIGIOT', 'SIGKILL', 'SIGPIPE', 'SIGPOLL', 'SIGPROF', 'SIGPWR', 'SIGQUIT', 'SIGSEGV', 'SIGSTKFLT', 'SIGSTOP', 'SIGSYS', 'SIGTERM', 'SIGTRAP', 'SIGTSTP', 'SIGTTIN', 'SIGTTOU', 'SIGURG', 'SIGUSR1', 'SIGUSR2', 'SIGVTALRM', 'SIGWINCH', 'SIGXCPU', 'SIGXFSZ'].includes(code) ? code : null;
5884
+ }
5885
+ function isStandaloneSea() {
5886
+ return typeof sea.isSea === 'function' && sea.isSea();
5887
+ }
5888
+ function getEmbeddedAsset(id) {
5889
+ if (!isStandaloneSea()) {
5890
+ throw new Error(`Embedded asset '${id}' is available only in the standalone Socket build`);
5891
+ }
5892
+ const files = {
5893
+ 'socket-patch': `resources/${process.platform === 'win32' ? 'socket-patch.exe' : 'socket-patch'}`,
5894
+ 'socket-patch-sha256': 'resources/socket-patch.sha256'
5895
+ };
5896
+ const relative = files[id];
5897
+ const root = globalThis.__socketSeaVfsRoot;
5898
+ if (!relative || !root) {
5899
+ throw new Error(`Standalone Socket asset '${id}' is missing from this build`);
5900
+ }
5901
+ try {
5902
+ return u.readFileSync(path.join(root, relative));
5903
+ } catch {
5904
+ throw new Error(`Standalone Socket asset '${id}' is missing from this build`);
5905
+ }
5906
+ }
5907
+
5908
+ /** Fail closed unless the build manifest explicitly advertises this tool. */
5909
+ function assertEmbeddedToolAvailable(id, capability) {
5910
+ if (!isStandaloneSea()) {
5911
+ return;
5912
+ }
5913
+ const root = globalThis.__socketSeaVfsRoot;
5914
+ let capabilities;
5915
+ try {
5916
+ if (!root) {
5917
+ throw new Error('missing VFS root');
5918
+ }
5919
+ capabilities = JSON.parse(u.readFileSync(path.join(root, 'resources/capabilities.json'), 'utf8'));
5920
+ } catch {
5921
+ throw new Error(`Embedded ${id} is unavailable because tool capabilities are missing or invalid in this build.`);
5922
+ }
5923
+ if (capabilities === null || typeof capabilities !== 'object' || Array.isArray(capabilities) || !Array.isArray(capabilities.available) || !Array.isArray(capabilities.unavailable)) {
5924
+ throw new Error(`Embedded ${id} is unavailable because tool capabilities are missing or invalid in this build.`);
5925
+ }
5926
+ const manifest = capabilities;
5927
+ const required = capability ? [capability] : id === 'cdxgen' ? ['manifest-cdxgen-npm-lock-v3', 'manifest-cdxgen-yarn-classic'] : ['synp'];
5928
+ if (required.some(tool => manifest.available.includes(tool))) {
5929
+ return;
5930
+ }
5931
+ const unavailableIds = id === 'cdxgen' ? [...required, id] : [id];
5932
+ const reasons = manifest.unavailable.flatMap(entry => {
5933
+ if (entry === null || typeof entry !== 'object') {
5934
+ return [];
5935
+ }
5936
+ const {
5937
+ id: unavailableId,
5938
+ reason
5939
+ } = entry;
5940
+ return unavailableIds.includes(unavailableId) && typeof reason === 'string' ? [reason] : [];
5941
+ });
5942
+ const reason = reasons.length ? ` ${[...new Set(reasons)].join(' ')}` : '';
5943
+ throw new Error(`Embedded ${id} is unavailable in this standalone build.${reason}`);
5944
+ }
5945
+ async function getBundledTool(id) {
5946
+ if (id !== 'socket-patch' && id !== 'uv') {
5947
+ throw new Error(`Bundled tool '${id}' is not configured in this SEA foundation`);
5948
+ }
5949
+ if (!isStandaloneSea()) {
5950
+ throw new Error(`Bundled tool '${id}' is available only in the standalone Socket build`);
5951
+ }
5952
+ if (id === 'uv') {
5953
+ const relative = embeddedNativeToolPaths.uv(process.platform);
5954
+ const source = path.join(getVfsRoot(), relative);
5955
+ const binary = await u.promises.readFile(source);
5956
+ const expectedDigest = await u.promises.readFile(path.join(getVfsRoot(), 'tools/uv/uv.sha256'), 'utf8');
5957
+ const actualDigest = require$$0.createHash('sha256').update(binary).digest('hex');
5958
+ if (!/^[a-f0-9]{64}$/.test(expectedDigest.trim()) || actualDigest !== expectedDigest.trim()) {
5959
+ throw new Error('Embedded uv payload failed SHA-256 verification');
5960
+ }
5961
+ const directory = await u.promises.mkdtemp(path.join(os.tmpdir(), 'socket-cli-sea-'));
5962
+ const filename = path.join(directory, path.basename(relative));
5963
+ try {
5964
+ await u.promises.writeFile(filename, binary, {
5965
+ flag: 'wx',
5966
+ mode: 0o700
5967
+ });
5968
+ if (process.platform !== 'win32') {
5969
+ await u.promises.chmod(filename, 0o700);
5970
+ }
5971
+ extractedToolDirectories.set(filename, directory);
5972
+ return filename;
5973
+ } catch (error) {
5974
+ await u.promises.rm(directory, {
5975
+ recursive: true,
5976
+ force: true
5977
+ });
5978
+ throw error;
5979
+ }
5980
+ }
5981
+ const binary = getEmbeddedAsset('socket-patch');
5982
+ const expectedDigest = getEmbeddedAsset('socket-patch-sha256').toString('utf8').trim();
5983
+ const actualDigest = require$$0.createHash('sha256').update(binary).digest('hex');
5984
+ if (!/^[a-f0-9]{64}$/.test(expectedDigest) || actualDigest !== expectedDigest) {
5985
+ throw new Error('Embedded socket-patch payload failed SHA-256 verification');
5986
+ }
5987
+ const directory = await u.promises.mkdtemp(path.join(os.tmpdir(), 'socket-cli-sea-'));
5988
+ const filename = path.join(directory, process.platform === 'win32' ? 'socket-patch.exe' : 'socket-patch');
5989
+ try {
5990
+ await u.promises.writeFile(filename, binary, {
5991
+ flag: 'wx',
5992
+ mode: 0o700
5993
+ });
5994
+ if (process.platform !== 'win32') {
5995
+ await u.promises.chmod(filename, 0o700);
5996
+ }
5997
+ extractedToolDirectories.set(filename, directory);
5998
+ return filename;
5999
+ } catch (error) {
6000
+ await u.promises.rm(directory, {
6001
+ recursive: true,
6002
+ force: true
6003
+ });
6004
+ throw error;
6005
+ }
6006
+ }
6007
+ async function cleanupBundledTool(filename) {
6008
+ const directory = extractedToolDirectories.get(filename);
6009
+ if (!directory) {
6010
+ return;
6011
+ }
6012
+ extractedToolDirectories.delete(filename);
6013
+ await u.promises.rm(directory, {
6014
+ recursive: true,
6015
+ force: true
6016
+ });
6017
+ }
6018
+ async function runEmbeddedJsTool(id, args, options = {}) {
6019
+ if (!isStandaloneSea()) {
6020
+ throw new Error(`Embedded JavaScript tool '${id}' is available only in the standalone Socket build`);
6021
+ }
6022
+ if (!Object.hasOwn(embeddedJsToolEntrypoints, id)) {
6023
+ throw new Error(`Embedded JavaScript tool '${id}' is not allowlisted`);
6024
+ }
6025
+ if (id === 'cdxgen' || id === 'synp') {
6026
+ assertEmbeddedToolAvailable(id);
6027
+ }
6028
+ if (options.signal?.aborted) {
6029
+ return {
6030
+ code: null,
6031
+ signal: signalFromAbortReason(options.signal.reason),
6032
+ cancelled: true
6033
+ };
6034
+ }
6035
+
6036
+ // Worker threads inherit cwd and Node does not support changing it per
6037
+ // Worker. Reject a different request rather than process.chdir() in the
6038
+ // shared parent process.
6039
+ const requestedCwd = options.cwd instanceof URL ? require$$0$1.fileURLToPath(options.cwd) : options.cwd;
6040
+ if (requestedCwd && path.resolve(requestedCwd) !== process.cwd()) {
6041
+ throw new Error(`Embedded JavaScript tool '${id}' cannot change cwd in a VFS Worker; ` + 'run Socket from the target project directory.');
6042
+ }
6043
+ const entrypoint = path.join(getVfsRoot(), embeddedJsToolEntrypoints[id]);
6044
+ if (!u.existsSync(entrypoint)) {
6045
+ throw new Error(`Embedded JavaScript tool '${id}' is unavailable because its VFS entrypoint is not bundled for this target.`);
6046
+ }
6047
+ const requestedStdio = options.stdio ?? 'inherit';
6048
+ if (requestedStdio !== 'inherit' && requestedStdio !== 'ignore' && requestedStdio !== 'pipe') {
6049
+ throw new Error(`Embedded JavaScript tool '${id}' supports only inherit, ignore, or pipe stdio in a VFS Worker.`);
6050
+ }
6051
+ const stdio = requestedStdio;
6052
+ const wantsStreams = stdio !== 'ignore';
6053
+ const pipeInput = options.stdin;
6054
+ const captureStdout = [];
6055
+ const captureStderr = [];
6056
+ const worker = new node_worker_threads.Worker(entrypoint, {
6057
+ argv: [...args],
6058
+ env: options.inheritEnv === false ? Object.fromEntries(Object.entries(options.env ?? {}).filter(entry => entry[1] !== undefined)) : {
6059
+ ...process.env,
6060
+ ...options.env
6061
+ },
6062
+ execArgv: [],
6063
+ workerData: {
6064
+ socketIpc: options.ipc
6065
+ },
6066
+ stdin: wantsStreams,
6067
+ // Always capture Worker stdio. In ignore mode we drain it below so it
6068
+ // cannot inherit the CLI's streams or stall on a full pipe.
6069
+ stdout: true,
6070
+ stderr: true
6071
+ });
6072
+ if (wantsStreams && worker.stdin) {
6073
+ if (pipeInput !== undefined) {
6074
+ const input = typeof pipeInput === 'string' || Buffer.isBuffer(pipeInput) ? require$$1$1.Readable.from([pipeInput]) : Symbol.asyncIterator in Object(pipeInput) ? require$$1$1.Readable.from(pipeInput) : pipeInput;
6075
+ input.pipe(worker.stdin);
6076
+ } else if (stdio === 'inherit') {
6077
+ process.stdin.pipe(worker.stdin);
6078
+ } else {
6079
+ worker.stdin.end();
6080
+ }
6081
+ }
6082
+ const outputTarget = kind => {
6083
+ const explicit = options[kind];
6084
+ if (explicit) {
6085
+ return explicit;
6086
+ }
6087
+ if (stdio === 'inherit') {
6088
+ return kind === 'stdout' ? process.stdout : process.stderr;
6089
+ }
6090
+ return undefined;
6091
+ };
6092
+ const stdoutTarget = outputTarget('stdout');
6093
+ const stderrTarget = outputTarget('stderr');
6094
+ if (!wantsStreams) {
6095
+ worker.stdout?.resume();
6096
+ worker.stderr?.resume();
6097
+ }
6098
+ if (wantsStreams && worker.stdout) {
6099
+ if (stdoutTarget) {
6100
+ worker.stdout.pipe(stdoutTarget, {
6101
+ end: false
6102
+ });
6103
+ } else if (stdio === 'pipe') {
6104
+ worker.stdout.on('data', chunk => captureStdout.push(Buffer.from(chunk)));
6105
+ }
6106
+ }
6107
+ if (wantsStreams && worker.stderr) {
6108
+ if (stderrTarget) {
6109
+ worker.stderr.pipe(stderrTarget, {
6110
+ end: false
6111
+ });
6112
+ } else if (stdio === 'pipe') {
6113
+ worker.stderr.on('data', chunk => captureStderr.push(Buffer.from(chunk)));
6114
+ }
6115
+ }
6116
+ let cancelled = false;
6117
+ const onAbort = () => {
6118
+ cancelled = true;
6119
+ void worker.terminate();
6120
+ };
6121
+ options.signal?.addEventListener('abort', onAbort, {
6122
+ once: true
6123
+ });
6124
+ try {
6125
+ const code = await new Promise((resolve, reject) => {
6126
+ worker.once('error', reject);
6127
+ worker.once('exit', resolve);
6128
+ });
6129
+ return {
6130
+ code: cancelled ? null : code,
6131
+ signal: cancelled ? signalFromAbortReason(options.signal?.reason) : null,
6132
+ ...(cancelled ? {
6133
+ cancelled: true
6134
+ } : {}),
6135
+ ...(stdio === 'pipe' ? {
6136
+ stdout: Buffer.concat(captureStdout).toString(),
6137
+ stderr: Buffer.concat(captureStderr).toString()
6138
+ } : {})
6139
+ };
6140
+ } finally {
6141
+ options.signal?.removeEventListener('abort', onAbort);
6142
+ if (stdio === 'inherit' && !pipeInput && worker.stdin) {
6143
+ process.stdin.unpipe(worker.stdin);
6144
+ }
6145
+ if (worker.stdout && stdoutTarget) {
6146
+ worker.stdout.unpipe(stdoutTarget);
6147
+ }
6148
+ if (worker.stderr && stderrTarget) {
6149
+ worker.stderr.unpipe(stderrTarget);
6150
+ }
6151
+ }
6152
+ }
6153
+
5161
6154
  /**
5162
6155
  * Coana CLI releases for Socket CLI.
5163
6156
  * Runs the Coana CLI from the cache that Coana and the Socket CLIs share, and
@@ -5177,6 +6170,7 @@ const COANA_CACHE_SCRIPT = 'coana-cache.mjs';
5177
6170
  const COMPONENT = 'cli';
5178
6171
  const NOT_CACHED_EXIT_CODE = 4;
5179
6172
  const SHA256_REGEXP = /^[0-9a-f]{64}$/;
6173
+ const TOKEN_VARIABLES = new Set([...constants.SOCKET_CLI_API_TOKEN_VARIABLES, 'SOCKET_CLI_CONFIG']);
5180
6174
  function cacheResultToCResult(result) {
5181
6175
  if (result.exitCode === 0) {
5182
6176
  return {
@@ -5191,6 +6185,27 @@ function cacheResultToCResult(result) {
5191
6185
  };
5192
6186
  }
5193
6187
 
6188
+ /**
6189
+ * The user's `env` for Coana, without:
6190
+ * - the `npm_package_*` variables that npm, pnpm and yarn classic set for each
6191
+ * leaf of the cwd's package.json. Coana doesn't read them, and in a large
6192
+ * monorepo they can push argv and env past ARG_MAX, so that the spawn fails
6193
+ * with E2BIG.
6194
+ * - the variables socket-cli reads the API token from, and SOCKET_CLI_CONFIG,
6195
+ * which can carry one. Coana gets the token from socket-cli, and would pass
6196
+ * them on to the tools it runs.
6197
+ *
6198
+ * The registry's `spawn` spreads `process.env` under the env it is given, so
6199
+ * they are set to `undefined`, which Node drops.
6200
+ */
6201
+ function coanaUserEnv(env) {
6202
+ const out = {};
6203
+ for (const key of Object.keys(env)) {
6204
+ out[key] = key.toLowerCase().startsWith('npm_package_') || TOKEN_VARIABLES.has(key.toUpperCase()) ? undefined : env[key];
6205
+ }
6206
+ return out;
6207
+ }
6208
+
5194
6209
  /**
5195
6210
  * Build a CResult error from a thrown spawn error, preserving exit code,
5196
6211
  * signal, and stderr context.
@@ -5430,28 +6445,15 @@ async function runCoanaCache(args, env) {
5430
6445
  }
5431
6446
  }
5432
6447
 
5433
- /**
5434
- * `env` without the `npm_package_*` variables that npm, pnpm and yarn classic
5435
- * set for each leaf of the cwd's package.json. Coana doesn't read them, and in
5436
- * a large monorepo they can push argv and env past ARG_MAX, so that the spawn
5437
- * fails with E2BIG.
5438
- *
5439
- * The registry's `spawn` spreads `process.env` under the env it is given, so
5440
- * they are set to `undefined`, which Node drops.
5441
- */
5442
- function withoutNpmPackageEnv(env) {
5443
- const out = {};
5444
- for (const key of Object.keys(env)) {
5445
- out[key] = key.startsWith('npm_package_') ? undefined : env[key];
5446
- }
5447
- return out;
5448
- }
5449
-
5450
6448
  /**
5451
6449
  * Run the Coana CLI, downloading it into the cache that Coana and the Socket
5452
6450
  * CLIs share when the cache lacks the version. Returns a CResult with Coana's
5453
6451
  * stdout.
5454
6452
  *
6453
+ * Coana runs in the user's environment, less what coanaUserEnv leaves out, plus
6454
+ * the variables socket-cli sets for it. Coana passes its environment on to the
6455
+ * build tools it runs, after removing the variables it reads.
6456
+ *
5455
6457
  * If SOCKET_CLI_COANA_LOCAL_PATH environment variable is set, uses the local
5456
6458
  * Coana CLI at that path instead.
5457
6459
  */
@@ -5460,42 +6462,79 @@ async function spawnCoana(args, orgSlug, options) {
5460
6462
  coanaVersion,
5461
6463
  cwd,
5462
6464
  env: spawnEnv,
6465
+ repoName,
5463
6466
  spinner,
5464
6467
  stdio = 'inherit'
5465
6468
  } = {
5466
6469
  __proto__: null,
5467
6470
  ...options
5468
6471
  };
5469
- const mixinsEnv = {
5470
- SOCKET_CLI_VERSION: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
5471
- // Forwarded to the Coana CLI so it can append our product token to its
5472
- // outbound axios User-Agent header.
5473
- SOCKET_CALLER_USER_AGENT: getCliUserAgent()
5474
- };
5475
- const defaultApiToken = getDefaultApiToken();
5476
- if (defaultApiToken) {
5477
- mixinsEnv['SOCKET_CLI_API_TOKEN'] = defaultApiToken;
6472
+ const localPath = process.env['SOCKET_CLI_COANA_LOCAL_PATH'];
6473
+ const standaloneSea = isStandaloneSea();
6474
+ if (standaloneSea && !localPath) {
6475
+ return {
6476
+ ok: false,
6477
+ message: 'Coana is unavailable in the standalone Socket build',
6478
+ cause: 'Set SOCKET_CLI_COANA_LOCAL_PATH to a native Coana executable to run Coana from a standalone build.'
6479
+ };
6480
+ }
6481
+ if (standaloneSea && localPath && (localPath.endsWith('.js') || localPath.endsWith('.mjs'))) {
6482
+ return {
6483
+ ok: false,
6484
+ message: 'Cannot launch a JavaScript Coana CLI from the standalone Socket build',
6485
+ cause: 'SOCKET_CLI_COANA_LOCAL_PATH must name a native Coana executable; the standalone JavaScript Worker adapter is not configured.'
6486
+ };
6487
+ }
6488
+ let apiToken;
6489
+ try {
6490
+ apiToken = await resolveDefaultApiToken();
6491
+ } catch (error) {
6492
+ return {
6493
+ ok: false,
6494
+ message: 'Socket authentication failed',
6495
+ cause: error instanceof Error ? error.message : String(error)
6496
+ };
5478
6497
  }
5479
6498
  const org = orgSlug ? {
5480
6499
  ok: true,
5481
6500
  data: orgSlug
5482
6501
  } : await getDefaultOrgSlug();
5483
- if (org.ok) {
5484
- mixinsEnv['SOCKET_ORG_SLUG'] = org.data;
6502
+ const socketCliVariables = {
6503
+ SOCKET_CALLER_USER_AGENT: getCliUserAgent(),
6504
+ SOCKET_CLI_API_BASE_URL: getDefaultApiBaseUrl$1(),
6505
+ SOCKET_CLI_API_PROXY: getDefaultProxyUrl(),
6506
+ SOCKET_CLI_API_TOKEN: apiToken,
6507
+ SOCKET_CLI_VERSION: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
6508
+ SOCKET_ORG_SLUG: org.ok ? org.data : undefined,
6509
+ // The default name would mix the cached configuration of unrelated
6510
+ // projects.
6511
+ SOCKET_REPO_NAME: repoName && repoName !== constants.default.SOCKET_DEFAULT_REPOSITORY ? repoName : undefined
6512
+ };
6513
+ const userEnv = coanaUserEnv(process.env);
6514
+ const env = {
6515
+ ...userEnv
6516
+ };
6517
+ for (const {
6518
+ 0: name,
6519
+ 1: value
6520
+ } of Object.entries(socketCliVariables)) {
6521
+ // Unset ones leave the user's own, except SOCKET_CLI_API_TOKEN, which
6522
+ // coanaUserEnv removed: with no token from socket-cli, Coana gets none.
6523
+ if (value !== undefined) {
6524
+ env[name] = value;
6525
+ }
5485
6526
  }
5486
- const proxyUrl = getDefaultProxyUrl();
5487
- if (proxyUrl) {
5488
- mixinsEnv['SOCKET_CLI_API_PROXY'] = proxyUrl;
5489
- }
5490
- const finalEnv = withoutNpmPackageEnv({
5491
- ...process.env,
5492
- ...constants.default.processEnv,
5493
- ...mixinsEnv,
5494
- ...spawnEnv
5495
- });
5496
- let scriptPath = process.env['SOCKET_CLI_COANA_LOCAL_PATH'];
6527
+ for (const {
6528
+ 0: name,
6529
+ 1: value
6530
+ } of Object.entries(coanaUserEnv(spawnEnv ?? {}))) {
6531
+ if (!TOKEN_VARIABLES.has(name.toUpperCase())) {
6532
+ env[name] = value;
6533
+ }
6534
+ }
6535
+ let scriptPath = localPath;
5497
6536
  if (!scriptPath) {
5498
- const coanaDirCResult = await getCoanaCliDir(coanaVersion || constants.COANA_CLI_VERSION, org, finalEnv, spinner);
6537
+ const coanaDirCResult = await getCoanaCliDir(coanaVersion || constants.COANA_CLI_VERSION, org, userEnv, spinner);
5499
6538
  if (!coanaDirCResult.ok) {
5500
6539
  return coanaDirCResult;
5501
6540
  }
@@ -5507,7 +6546,7 @@ async function spawnCoana(args, orgSlug, options) {
5507
6546
  try {
5508
6547
  const spawnResult = await spawn.spawn(isBinary ? scriptPath : constants.default.execPath, isBinary ? args : [scriptPath, ...args], {
5509
6548
  cwd,
5510
- env: finalEnv,
6549
+ env,
5511
6550
  spinner,
5512
6551
  stdio
5513
6552
  });
@@ -5878,29 +6917,33 @@ function mergeManifestDefaults(base, override) {
5878
6917
  };
5879
6918
  }
5880
6919
 
5881
- // Cascades `defaults.manifest.*` from `rootSockJson` down to `dir`: each
5882
- // ancestor's own socket.json, between `dir` and `boundaryDir` (exclusive),
5883
- // merges in, nearest-to-`dir` winning field by field.
5884
- function readSocketJsonCascade(dir, boundaryDir, rootSockJson) {
5885
- const boundary = path.resolve(boundaryDir);
6920
+ // Merges `defaults.manifest.*` of `chain`, the nearest winning field by field.
6921
+ function mergeSocketJsonChain(chain) {
6922
+ return chain.reduce((merged, {
6923
+ sockJson
6924
+ }) => mergeManifestDefaults(merged, sockJson), getDefaultSocketJson());
6925
+ }
6926
+
6927
+ // Every socket.json from the filesystem root down to `dir`, farthest first.
6928
+ function readSocketJsonChain(dir) {
6929
+ const chain = [];
5886
6930
  let current = path.resolve(dir);
5887
- // Farthest-from-dir first, so the merge loop below applies overrides in
5888
- // increasing precedence and the nearest-to-dir file wins last.
5889
- const ancestorsFarToNear = [];
5890
- while (current !== boundary) {
6931
+ for (;;) {
5891
6932
  if (u.existsSync(path.join(current, constants.SOCKET_JSON))) {
5892
6933
  const jsonCResult = readSocketJsonSync(current, true);
5893
6934
  if (jsonCResult.ok) {
5894
- ancestorsFarToNear.unshift(jsonCResult.data);
6935
+ chain.unshift({
6936
+ dir: current,
6937
+ sockJson: jsonCResult.data
6938
+ });
5895
6939
  }
5896
6940
  }
5897
6941
  const parent = path.dirname(current);
5898
6942
  if (parent === current) {
5899
- break;
6943
+ return chain;
5900
6944
  }
5901
6945
  current = parent;
5902
6946
  }
5903
- return ancestorsFarToNear.reduce(mergeManifestDefaults, rootSockJson);
5904
6947
  }
5905
6948
  function getDefaultSocketJson() {
5906
6949
  return {
@@ -6089,7 +7132,7 @@ function findNpmDirPathSync(npmBinPath) {
6089
7132
  */
6090
7133
  function normalizeScanInputPath(pathToNormalize, cwd) {
6091
7134
  if (!path.isAbsolute(pathToNormalize)) {
6092
- return pathToNormalize;
7135
+ return stripTrailingSlash(path$1.normalizePath(pathToNormalize));
6093
7136
  }
6094
7137
  const relativePath = path.relative(cwd, pathToNormalize);
6095
7138
  const isInsideCwd = relativePath === '' || !relativePath.startsWith('..') && !path.isAbsolute(relativePath);
@@ -6653,6 +7696,14 @@ function isHelpFlag(cmdArg) {
6653
7696
  return helpFlags.has(cmdArg);
6654
7697
  }
6655
7698
 
7699
+ /**
7700
+ * Check if npm command requires lockfile scanning.
7701
+ * npm uses: install, i, update
7702
+ */
7703
+ function isNpmLockfileScanCommand(command) {
7704
+ return command === 'install' || command === 'i' || command === 'ci' || command === 'update';
7705
+ }
7706
+
6656
7707
  /**
6657
7708
  * Check if pnpm command requires lockfile scanning.
6658
7709
  * pnpm uses: install, i, update, up
@@ -6726,10 +7777,10 @@ function parseReachEcosystems(raw) {
6726
7777
  * within an ecosystem (e.g. only PNPM artifacts in a mixed pnpm/yarn/npm repo).
6727
7778
  *
6728
7779
  * Mirrors the list returned by Coana's `getFilterablePackageManagers()` in
6729
- * packages/web-compat-utils/src/package-manager-utils.ts.
7780
+ * packages/utils/src/package-manager-utils.ts.
6730
7781
  */
6731
7782
 
6732
- const ALL_PACKAGE_MANAGERS = ['CARGO', 'COMPOSER', 'GO', 'GRADLE', 'MAVEN', 'NPM', 'NUGET', 'PIPENV', 'PIP_REQUIREMENTS', 'PNPM', 'POETRY', 'RUBYGEMS', 'RUSH', 'SBT', 'YARN'];
7783
+ const ALL_PACKAGE_MANAGERS = ['CARGO', 'COMPOSER', 'GO', 'GRADLE', 'MAVEN', 'NPM', 'NUGET', 'PIPENV', 'PIP_REQUIREMENTS', 'PNPM', 'POETRY', 'RUBYGEMS', 'RUSH', 'SBT', 'UV', 'YARN'];
6733
7784
  const ALL_PACKAGE_MANAGERS_SET = new Set(ALL_PACKAGE_MANAGERS);
6734
7785
  function isValidPackageManager(value) {
6735
7786
  return ALL_PACKAGE_MANAGERS_SET.has(value);
@@ -6888,6 +7939,12 @@ const {
6888
7939
  * Automatically detects the appropriate package manager if not specified.
6889
7940
  */
6890
7941
  async function spawnDlx(packageSpec, args, options, spawnExtra) {
7942
+ // Standalone builds must never turn a missing embedded helper into a
7943
+ // package-manager install. Keep this guard ahead of lockfile detection and
7944
+ // shadow-bin loading so every generic dlx caller fails closed consistently.
7945
+ if (isStandaloneSea()) {
7946
+ throw new Error(`Cannot run '${packageSpec.name}' from a standalone Socket CLI: this helper is not bundled for this target, and runtime package installation is disabled.`);
7947
+ }
6891
7948
  const {
6892
7949
  agent,
6893
7950
  silent = false,
@@ -7185,10 +8242,10 @@ function shadowNpmInstall(options) {
7185
8242
  const useDebug = debug$2.isDebug('stdio');
7186
8243
  const terminatorPos = args.indexOf('--');
7187
8244
  const rawBinArgs = terminatorPos === -1 ? args : args.slice(0, terminatorPos);
7188
- const binArgs = rawBinArgs.filter(a => !agent.isNpmAuditFlag(a) && !agent.isNpmFundFlag(a) && !agent.isNpmProgressFlag(a));
8245
+ const binArgs = rawBinArgs.filter(a => !agent$1.isNpmAuditFlag(a) && !agent$1.isNpmFundFlag(a) && !agent$1.isNpmProgressFlag(a));
7189
8246
  const otherArgs = terminatorPos === -1 ? [] : args.slice(terminatorPos);
7190
- const progressArg = rawBinArgs.findLast(agent.isNpmProgressFlag) !== '--no-progress';
7191
- const isSilent = !useDebug && !binArgs.some(agent.isNpmLoglevelFlag);
8247
+ const progressArg = rawBinArgs.findLast(agent$1.isNpmProgressFlag) !== '--no-progress';
8248
+ const isSilent = !useDebug && !binArgs.some(agent$1.isNpmLoglevelFlag);
7192
8249
  const logLevelArgs = isSilent ? [constants.FLAG_LOGLEVEL, 'silent'] : [];
7193
8250
  const useIpc = objects.isObject(ipc);
7194
8251
 
@@ -7205,7 +8262,7 @@ function shadowNpmInstall(options) {
7205
8262
  } else {
7206
8263
  stdio = useIpc ? ['pipe', 'pipe', 'pipe', 'ipc'] : 'pipe';
7207
8264
  }
7208
- const spawnPromise = spawn.spawn(constants.default.execPath, [...constants.default.nodeNoWarningsFlags, ...constants.default.nodeDebugFlags, ...constants.default.nodeHardenFlags, ...constants.default.nodeMemoryFlags, ...(constants.default.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD ? ['--require', constants.default.instrumentWithSentryPath] : []), '--require', constants.default.shadowNpmInjectPath, agent.resolveBinPathSync(agentExecPath), 'install',
8265
+ const spawnPromise = spawn.spawn(constants.default.execPath, [...constants.default.nodeNoWarningsFlags, ...constants.default.nodeDebugFlags, ...constants.default.nodeHardenFlags, ...constants.default.nodeMemoryFlags, ...(constants.default.ENV.INLINED_SOCKET_CLI_SENTRY_BUILD ? ['--require', constants.default.instrumentWithSentryPath] : []), '--require', constants.default.shadowNpmInjectPath, agent$1.resolveBinPathSync(agentExecPath), 'install',
7209
8266
  // Avoid code paths for 'audit' and 'fund'.
7210
8267
  '--no-audit', '--no-fund',
7211
8268
  // Add '--no-progress' to fix input being swallowed by the npm spinner.
@@ -7234,71 +8291,47 @@ function shadowNpmInstall(options) {
7234
8291
  return spawnPromise;
7235
8292
  }
7236
8293
 
7237
- /**
7238
- * Package manager agent utilities for Socket CLI.
7239
- * Manages package installation via different package managers.
7240
- *
7241
- * Key Functions:
7242
- * - runAgentInstall: Execute package installation with detected agent
7243
- *
7244
- * Supported Agents:
7245
- * - npm: Node Package Manager
7246
- * - pnpm: Fast, disk space efficient package manager
7247
- * - yarn: Alternative package manager
7248
- *
7249
- * Features:
7250
- * - Automatic agent detection
7251
- * - Shadow installation for security scanning
7252
- * - Spinner support for progress indication
7253
- */
8294
+ /** Run detected package manager install commands with Socket's safe defaults. */
7254
8295
 
7255
- function runAgentInstall(pkgEnvDetails, options) {
8296
+ /** Run the detected package manager's install command with Socket's safe defaults. */
8297
+ function runAgentInstall(pkgEnvDetails, options = {}) {
7256
8298
  const {
7257
8299
  agent,
7258
8300
  agentExecPath,
7259
8301
  pkgPath
7260
8302
  } = pkgEnvDetails;
8303
+ const {
8304
+ args = [],
8305
+ spinner,
8306
+ ...spawnOptions
8307
+ } = options;
7261
8308
  const isNpm = agent === constants.NPM;
7262
- const isPnpm = agent === constants.PNPM;
7263
- // All package managers support the "install" command.
7264
- if (isNpm) {
8309
+ if (isNpm && !isStandaloneSea()) {
7265
8310
  return shadowNpmInstall({
7266
8311
  agentExecPath,
7267
8312
  cwd: pkgPath,
7268
- ...options
8313
+ args,
8314
+ spinner,
8315
+ ...spawnOptions
7269
8316
  });
7270
8317
  }
7271
- const {
7272
- args = [],
7273
- spinner,
7274
- ...spawnOpts
7275
- } = {
7276
- __proto__: null,
7277
- ...options
7278
- };
8318
+ const isPnpm = agent === constants.PNPM;
7279
8319
  const skipNodeHardenFlags = isPnpm && pkgEnvDetails.agentVersion.major < 11;
7280
- // In CI mode, pnpm uses --frozen-lockfile by default, which prevents lockfile updates.
7281
- // We need to explicitly disable it when updating the lockfile with overrides.
7282
- // Also add --config.confirmModulesPurge=false to avoid interactive prompts.
7283
- const installArgs = isPnpm ? ['install', '--config.confirmModulesPurge=false', '--no-frozen-lockfile', ...args] : ['install', ...args];
8320
+ const installArgs = isNpm ? ['install', '--no-audit', '--no-fund', ...args] : isPnpm ? ['install', '--config.confirmModulesPurge=false', '--no-frozen-lockfile', ...args] : ['install', ...args];
8321
+ const nodeOptions = [process.env['NODE_OPTIONS'], ...(skipNodeHardenFlags ? [] : constants.default.nodeHardenFlags), ...constants.default.nodeNoWarningsFlags, '--disable-sigusr1'].filter(Boolean).join(' ');
7284
8322
  return spawn.spawn(agentExecPath, installArgs, {
7285
8323
  cwd: pkgPath,
7286
- // On Windows, package managers are often .cmd files that require shell execution.
7287
- // The spawn function from @socketsecurity/registry will handle this properly
7288
- // when shell is true.
7289
8324
  shell: constants.default.WIN32,
7290
8325
  spinner,
7291
8326
  stdio: 'inherit',
7292
- ...spawnOpts,
8327
+ ...spawnOptions,
7293
8328
  env: {
7294
8329
  ...process.env,
7295
- ...constants.default.processEnv,
7296
- // Set CI for pnpm to ensure non-interactive mode and consistent behavior.
7297
8330
  ...(isPnpm ? {
7298
8331
  CI: '1'
7299
8332
  } : {}),
7300
- NODE_OPTIONS: cmdFlagsToString([...(skipNodeHardenFlags ? [] : constants.default.nodeHardenFlags), ...constants.default.nodeNoWarningsFlags]),
7301
- ...objects.getOwn(spawnOpts, 'env')
8333
+ NODE_OPTIONS: nodeOptions,
8334
+ ...spawnOptions.env
7302
8335
  }
7303
8336
  });
7304
8337
  }
@@ -7359,7 +8392,19 @@ const readLockFileByAgent = (() => {
7359
8392
  return undefined;
7360
8393
  };
7361
8394
  }
7362
- const binaryReader = wrapReader(fs.readFileBinary);
8395
+ const binaryReader = wrapReader(async lockPath => {
8396
+ // registry 1.1.17 declares Buffer but decodes with `binary`, returning a
8397
+ // Latin-1 string at runtime. Restore the original byte buffer for Bun's
8398
+ // binary lockfile parser.
8399
+ const content = await fs.readFileBinary(lockPath);
8400
+ if (Buffer.isBuffer(content)) {
8401
+ return content;
8402
+ }
8403
+ if (typeof content === 'string') {
8404
+ return Buffer.from(content, 'latin1');
8405
+ }
8406
+ throw new TypeError('Expected binary lockfile content');
8407
+ });
7363
8408
  const defaultReader = wrapReader(async lockPath => await fs.readFileUtf8(lockPath));
7364
8409
  return new Map([[BUN, wrapReader(async (lockPath, agentExecPath, cwd = process.cwd()) => {
7365
8410
  const ext = path.extname(lockPath);
@@ -8013,16 +9058,31 @@ fetchImpl = apiFetch) {
8013
9058
  }
8014
9059
  }
8015
9060
 
9061
+ /** Format a release notice for the current Socket distribution. */
9062
+ function formatUpdateNotice(current, latest) {
9063
+ return isStandaloneSea() ? `Socket ${current} → ${latest}. Run: socket update` : `Socket ${current} → ${latest}. Update with your favorite package manager.`;
9064
+ }
9065
+
8016
9066
  // Check the public npm registry for a newer socket release.
8017
9067
  async function runSelfUpdateCheck() {
9068
+ // Match the conventional opt-out used by update notifiers.
9069
+ if (process.env['NO_UPDATE_NOTIFIER']) {
9070
+ return;
9071
+ }
9072
+
9073
+ // A standalone executable cannot be updated through the npm package path.
9074
+ // Keep its startup independent from registry metadata and avoid suggesting
9075
+ // that an npm CLI update can replace this artifact.
9076
+ if (isStandaloneSea()) {
9077
+ return;
9078
+ }
8018
9079
  await vendor.updater({
8019
9080
  name: constants.default.SOCKET_CLI_BIN_NAME,
8020
9081
  registryUrl: 'https://registry.npmjs.org/',
8021
- ttl: 86_400_000 /* 24 hours in milliseconds */,
9082
+ ttl: process.env['SOCKET_CLI_FORCE_UPDATE_NOTIFIER'] === '1' ? 0 : 86_400_000 /* 24 hours in milliseconds */,
8022
9083
  version: constants.default.ENV.INLINED_SOCKET_CLI_VERSION,
8023
- logCallback: (name, version, latest) => {
8024
- logger.logger.log(`\n\n📦 Update available for ${vendor.yoctocolorsCjsExports.cyan(name)}: ${vendor.yoctocolorsCjsExports.gray(version)} → ${vendor.yoctocolorsCjsExports.green(latest)}`);
8025
- logger.logger.log(`📝 ${socketPackageLink('npm', name, `files/${latest}/CHANGELOG.md`, 'View changelog')}`);
9084
+ logCallback: (_name, version, latest) => {
9085
+ logger.logger.log(formatUpdateNotice(version, latest));
8026
9086
  }
8027
9087
  });
8028
9088
  }
@@ -9104,13 +10164,17 @@ exports.CVE_FORMAT_REGEXP = CVE_FORMAT_REGEXP;
9104
10164
  exports.GHSA_FORMAT_REGEXP = GHSA_FORMAT_REGEXP;
9105
10165
  exports.IGNORED_DIRS = IGNORED_DIRS;
9106
10166
  exports.InputError = InputError;
10167
+ exports.OAUTH_ISSUER = OAUTH_ISSUER;
9107
10168
  exports.RangeStyles = RangeStyles;
9108
10169
  exports.apiFetch = apiFetch;
10170
+ exports.assertEmbeddedToolAvailable = assertEmbeddedToolAvailable;
10171
+ exports.beginOAuthLogin = beginOAuthLogin;
9109
10172
  exports.cacheFetch = cacheFetch;
9110
10173
  exports.camelToKebab = camelToKebab;
9111
10174
  exports.captureException = captureException;
9112
10175
  exports.checkCommandInput = checkCommandInput;
9113
10176
  exports.classifyGitHubResponse = classifyGitHubResponse;
10177
+ exports.cleanupBundledTool = cleanupBundledTool;
9114
10178
  exports.cmdFlagValueToArray = cmdFlagValueToArray;
9115
10179
  exports.cmdFlagsToString = cmdFlagsToString;
9116
10180
  exports.cmdPrefixMessage = cmdPrefixMessage;
@@ -9139,9 +10203,12 @@ exports.getAlertsMapFromPnpmLockfile = getAlertsMapFromPnpmLockfile;
9139
10203
  exports.getAlertsMapFromPurls = getAlertsMapFromPurls;
9140
10204
  exports.getBaseBranch = getBaseBranch;
9141
10205
  exports.getBashrcDetails = getBashrcDetails;
10206
+ exports.getBundledTool = getBundledTool;
9142
10207
  exports.getConfigValue = getConfigValue;
9143
10208
  exports.getConfigValueOrUndef = getConfigValueOrUndef;
10209
+ exports.getDefaultApiBaseUrl = getDefaultApiBaseUrl$1;
9144
10210
  exports.getDefaultOrgSlug = getDefaultOrgSlug;
10211
+ exports.getDefaultProxyUrl = getDefaultProxyUrl;
9145
10212
  exports.getEcosystemChoicesForMeow = getEcosystemChoicesForMeow;
9146
10213
  exports.getEnterpriseOrgs = getEnterpriseOrgs;
9147
10214
  exports.getErrorCause = getErrorCause;
@@ -9160,7 +10227,7 @@ exports.getOrInsert = getOrInsert;
9160
10227
  exports.getOrgSlugs = getOrgSlugs;
9161
10228
  exports.getOutputKind = getOutputKind;
9162
10229
  exports.getPackageFilesForScan = getPackageFilesForScan;
9163
- exports.getPublicApiToken = getPublicApiToken;
10230
+ exports.getPurlObject = getPurlObject;
9164
10231
  exports.getReachabilityEcosystemChoices = getReachabilityEcosystemChoices;
9165
10232
  exports.getRepoInfo = getRepoInfo;
9166
10233
  exports.getRepoName = getRepoName;
@@ -9184,7 +10251,6 @@ exports.githubApiRequest = githubApiRequest;
9184
10251
  exports.globWithGitIgnore = globWithGitIgnore;
9185
10252
  exports.globWorkspace = globWorkspace;
9186
10253
  exports.handleApiCall = handleApiCall;
9187
- exports.handleApiCallNoSpinner = handleApiCallNoSpinner;
9188
10254
  exports.hasDefaultApiToken = hasDefaultApiToken;
9189
10255
  exports.hasEnterpriseOrgPlan = hasEnterpriseOrgPlan;
9190
10256
  exports.idToNpmPurl = idToNpmPurl;
@@ -9198,16 +10264,19 @@ exports.isErrnoException = isErrnoException;
9198
10264
  exports.isFactsOnlyTypes = isFactsOnlyTypes;
9199
10265
  exports.isGitHubBlockingError = isGitHubBlockingError;
9200
10266
  exports.isHelpFlag = isHelpFlag;
10267
+ exports.isNpmLockfileScanCommand = isNpmLockfileScanCommand;
9201
10268
  exports.isPnpmLockfileScanCommand = isPnpmLockfileScanCommand;
9202
10269
  exports.isReachabilityReportPath = isReachabilityReportPath;
9203
10270
  exports.isReportSupportedFile = isReportSupportedFile;
9204
10271
  exports.isSensitiveConfigKey = isSensitiveConfigKey;
9205
10272
  exports.isSocketFactsFile = isSocketFactsFile;
10273
+ exports.isStandaloneSea = isStandaloneSea;
9206
10274
  exports.isSupportedConfigKey = isSupportedConfigKey;
9207
10275
  exports.isValidPackageManager = isValidPackageManager;
9208
10276
  exports.isYarnBerry = isYarnBerry;
9209
10277
  exports.loadSocketConfig = loadSocketConfig;
9210
10278
  exports.logAlertsMap = logAlertsMap;
10279
+ exports.logoutOAuth = logoutOAuth;
9211
10280
  exports.mailtoLink = mailtoLink;
9212
10281
  exports.mapToObject = mapToObject;
9213
10282
  exports.mdTable = mdTable;
@@ -9215,7 +10284,9 @@ exports.mdTableOfPairs = mdTableOfPairs;
9215
10284
  exports.mdTableStringNumber = mdTableStringNumber;
9216
10285
  exports.meowOrExit = meowOrExit;
9217
10286
  exports.meowWithSubcommands = meowWithSubcommands;
10287
+ exports.mergeSocketJsonChain = mergeSocketJsonChain;
9218
10288
  exports.msAtHome = msAtHome;
10289
+ exports.normalizePurl = normalizePurl;
9219
10290
  exports.parseEcosystemChoices = parseEcosystemChoices;
9220
10291
  exports.parsePnpmLockfile = parsePnpmLockfile;
9221
10292
  exports.parseReachEcosystems = parseReachEcosystems;
@@ -9225,14 +10296,17 @@ exports.queryApiSafeTextWithStatus = queryApiSafeTextWithStatus;
9225
10296
  exports.readOrDefaultSocketJson = readOrDefaultSocketJson;
9226
10297
  exports.readOrDefaultSocketJsonUp = readOrDefaultSocketJsonUp;
9227
10298
  exports.readPnpmLockfile = readPnpmLockfile;
9228
- exports.readSocketJsonCascade = readSocketJsonCascade;
10299
+ exports.readSocketJsonChain = readSocketJsonChain;
9229
10300
  exports.readSocketJsonSync = readSocketJsonSync;
9230
10301
  exports.realpathOrResolved = realpathOrResolved;
9231
10302
  exports.resolveAdvisoryIds = resolveAdvisoryIds;
10303
+ exports.resolvePublicApiToken = resolvePublicApiToken;
9232
10304
  exports.runAgentInstall = runAgentInstall;
10305
+ exports.runEmbeddedJsTool = runEmbeddedJsTool;
9233
10306
  exports.runSelfUpdateCheck = runSelfUpdateCheck;
9234
10307
  exports.safeNpa = safeNpa$1;
9235
10308
  exports.safeNpmSpecToPurl = safeNpmSpecToPurl;
10309
+ exports.saveOAuthCredentials = saveOAuthCredentials;
9236
10310
  exports.sendApiRequest = sendApiRequest;
9237
10311
  exports.serializeResultJson = serializeResultJson;
9238
10312
  exports.setGitRemoteGithubRepoUrl = setGitRemoteGithubRepoUrl;
@@ -9260,5 +10334,5 @@ exports.walkNestedMap = walkNestedMap;
9260
10334
  exports.webLink = webLink;
9261
10335
  exports.withTmpDir = withTmpDir;
9262
10336
  exports.writeSocketJson = writeSocketJson;
9263
- //# debugId=871c30cb-bdbb-449e-8766-245047cb9b4d
10337
+ //# debugId=793b47de-2817-4385-a9a7-bed77f6ee0a3
9264
10338
  //# sourceMappingURL=utils.js.map