@openai/codex-security 0.8.2 → 0.8.3

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 (375) hide show
  1. package/README.md +43 -61
  2. package/_bundled_plugin/.app.json +4 -0
  3. package/_bundled_plugin/.mcp.json +1 -0
  4. package/_bundled_plugin/mcp/helpers.mjs.br.part-000 +0 -0
  5. package/_bundled_plugin/mcp/helpers.mjs.br.part-001 +0 -0
  6. package/_bundled_plugin/mcp/native/darwin-arm64/unix.node +0 -0
  7. package/_bundled_plugin/mcp/native/darwin-x64/unix.node +0 -0
  8. package/_bundled_plugin/mcp/native/linux-arm64-gnu/unix.node +0 -0
  9. package/_bundled_plugin/mcp/native/linux-arm64-musl/unix.node +0 -0
  10. package/_bundled_plugin/mcp/native/linux-x64-gnu/unix.node +0 -0
  11. package/_bundled_plugin/mcp/native/linux-x64-musl/unix.node +0 -0
  12. package/_bundled_plugin/mcp/native/win32-arm64/windows.node +0 -0
  13. package/_bundled_plugin/mcp/native/win32-x64/windows.node +0 -0
  14. package/_bundled_plugin/mcp/permission-profile-preflight.mjs +46 -12
  15. package/_bundled_plugin/mcp/server.mjs.br.part-000 +0 -0
  16. package/_bundled_plugin/mcp/server.mjs.br.part-001 +0 -0
  17. package/_bundled_plugin/mcp/server.mjs.br.part-002 +0 -0
  18. package/_bundled_plugin/references/artifact-storage.md +1 -1
  19. package/_bundled_plugin/references/core-scan.md +14 -5
  20. package/_bundled_plugin/references/default-severity-rubric.md +28 -0
  21. package/_bundled_plugin/references/finding-detail-fields.md +1 -0
  22. package/_bundled_plugin/references/threat-model.md +1 -0
  23. package/_bundled_plugin/scripts/deep_scan_workbench.py +23 -112
  24. package/_bundled_plugin/scripts/finalize_scan_contract.py +167 -153
  25. package/_bundled_plugin/scripts/finding_preview.py +5 -29
  26. package/_bundled_plugin/scripts/posix_scan_local_files.py +187 -0
  27. package/_bundled_plugin/scripts/report_projection.py +87 -136
  28. package/_bundled_plugin/scripts/validate_scan_contract.py +2 -6
  29. package/_bundled_plugin/scripts/windows_scan_local_files.py +212 -55
  30. package/_bundled_plugin/scripts/workbench/retained_coverage.py +8 -24
  31. package/_bundled_plugin/scripts/workbench/saved_coverage.py +143 -231
  32. package/_bundled_plugin/scripts/workbench_cli.py +102 -13
  33. package/_bundled_plugin/scripts/workbench_constants.py +9 -0
  34. package/_bundled_plugin/scripts/workbench_db.py +186 -360
  35. package/_bundled_plugin/scripts/workbench_finding_workflows.py +86 -4
  36. package/_bundled_plugin/scripts/workbench_native_indexes.py +17 -21
  37. package/_bundled_plugin/scripts/workbench_remediation.py +495 -11
  38. package/_bundled_plugin/scripts/workbench_scan_history.py +22 -25
  39. package/_bundled_plugin/scripts/workbench_scan_start.py +1 -1
  40. package/_bundled_plugin/scripts/workbench_scan_usage.py +25 -52
  41. package/_bundled_plugin/scripts/workbench_schema.py +1 -1
  42. package/_bundled_plugin/scripts/workbench_setup.py +239 -0
  43. package/_bundled_plugin/scripts/workbench_source_scopes.py +15 -23
  44. package/_bundled_plugin/scripts/workbench_target.py +213 -20
  45. package/_bundled_plugin/scripts/workbench_validation.py +1 -9
  46. package/_bundled_plugin/shared/workbench-history-repairs.json +7 -0
  47. package/_bundled_plugin/shared/workbench-migrations.json +19 -0
  48. package/_bundled_plugin/skills/attack-path-analysis/SKILL.md +1 -1
  49. package/_bundled_plugin/skills/attack-path-analysis/references/severity-policy.md +4 -68
  50. package/_bundled_plugin/skills/check-skills/SKILL.md +43 -0
  51. package/_bundled_plugin/skills/check-skills/agents/openai.yaml +4 -0
  52. package/_bundled_plugin/skills/cloud-findings/SKILL.md +2 -0
  53. package/_bundled_plugin/skills/fix-finding/SKILL.md +18 -1
  54. package/_bundled_plugin/skills/publish-findings/SKILL.md +64 -35
  55. package/_bundled_plugin/skills/publish-findings/references/wiz-import.md +2 -21
  56. package/_bundled_plugin/skills/threat-model-visualize/scripts/build_explorer.py +14 -8
  57. package/_bundled_plugin/skills/track-findings/SKILL.md +5 -3
  58. package/_bundled_plugin/skills/triage-finding/references/github-rest-intake.md +22 -68
  59. package/_bundled_plugin/skills/triage-finding/references/ticket-intake.md +6 -4
  60. package/dist/api.d.ts +6 -1
  61. package/dist/api.d.ts.map +1 -1
  62. package/dist/api.js +411 -160
  63. package/dist/api.js.map +1 -1
  64. package/dist/auth.js +6 -1
  65. package/dist/auth.js.map +1 -1
  66. package/dist/blackduck-findings.d.ts +8 -0
  67. package/dist/blackduck-findings.d.ts.map +1 -0
  68. package/dist/blackduck-findings.js +305 -0
  69. package/dist/blackduck-findings.js.map +1 -0
  70. package/dist/bulk-scan-discovery.d.ts.map +1 -1
  71. package/dist/bulk-scan-discovery.js +51 -36
  72. package/dist/bulk-scan-discovery.js.map +1 -1
  73. package/dist/classify-severity-records.d.ts +5 -0
  74. package/dist/classify-severity-records.d.ts.map +1 -1
  75. package/dist/classify-severity-records.js +6 -8
  76. package/dist/classify-severity-records.js.map +1 -1
  77. package/dist/classify-severity.d.ts +4 -1
  78. package/dist/classify-severity.d.ts.map +1 -1
  79. package/dist/classify-severity.js +28 -9
  80. package/dist/classify-severity.js.map +1 -1
  81. package/dist/cli.d.ts +3 -0
  82. package/dist/cli.d.ts.map +1 -1
  83. package/dist/cli.js +608 -258
  84. package/dist/cli.js.map +1 -1
  85. package/dist/codex-prompt.d.ts +2 -0
  86. package/dist/codex-prompt.d.ts.map +1 -1
  87. package/dist/codex-prompt.js +6 -0
  88. package/dist/codex-prompt.js.map +1 -1
  89. package/dist/component-scan.d.ts.map +1 -1
  90. package/dist/component-scan.js +6 -5
  91. package/dist/component-scan.js.map +1 -1
  92. package/dist/config.d.ts +2 -1
  93. package/dist/config.d.ts.map +1 -1
  94. package/dist/config.js +162 -40
  95. package/dist/config.js.map +1 -1
  96. package/dist/continuum-findings.d.ts +7 -0
  97. package/dist/continuum-findings.d.ts.map +1 -0
  98. package/dist/continuum-findings.js +157 -0
  99. package/dist/continuum-findings.js.map +1 -0
  100. package/dist/contract-values.d.ts +28 -0
  101. package/dist/contract-values.d.ts.map +1 -0
  102. package/dist/contract-values.js +75 -0
  103. package/dist/contract-values.js.map +1 -0
  104. package/dist/contract.d.ts +2 -20
  105. package/dist/contract.d.ts.map +1 -1
  106. package/dist/contract.js +58 -669
  107. package/dist/contract.js.map +1 -1
  108. package/dist/cost-model.d.ts.map +1 -1
  109. package/dist/cost-model.js +1 -4
  110. package/dist/cost-model.js.map +1 -1
  111. package/dist/cost.d.ts +19 -1
  112. package/dist/cost.d.ts.map +1 -1
  113. package/dist/cost.js +2120 -39
  114. package/dist/cost.js.map +1 -1
  115. package/dist/custom-validation-prompt.d.ts +1 -1
  116. package/dist/custom-validation-prompt.d.ts.map +1 -1
  117. package/dist/custom-validation-prompt.js +5 -0
  118. package/dist/custom-validation-prompt.js.map +1 -1
  119. package/dist/custom-validation.d.ts +2 -0
  120. package/dist/custom-validation.d.ts.map +1 -1
  121. package/dist/custom-validation.js +4 -0
  122. package/dist/custom-validation.js.map +1 -1
  123. package/dist/deduplication/deduplication-prompts.d.ts +4 -4
  124. package/dist/deduplication/deduplication-prompts.d.ts.map +1 -1
  125. package/dist/deduplication/deduplication-prompts.js +2 -2
  126. package/dist/deduplication/deduplication-prompts.js.map +1 -1
  127. package/dist/deduplication/deduplication-reviewer.d.ts +14 -11
  128. package/dist/deduplication/deduplication-reviewer.d.ts.map +1 -1
  129. package/dist/deduplication/deduplication-reviewer.js +11 -4
  130. package/dist/deduplication/deduplication-reviewer.js.map +1 -1
  131. package/dist/deduplication/deduplication.js.map +1 -1
  132. package/dist/deduplication/finding-schema.d.ts +19 -1
  133. package/dist/deduplication/finding-schema.d.ts.map +1 -1
  134. package/dist/deduplication/finding-schema.js +25 -0
  135. package/dist/deduplication/finding-schema.js.map +1 -1
  136. package/dist/deduplication/local.d.ts.map +1 -1
  137. package/dist/deduplication/local.js +3 -8
  138. package/dist/deduplication/local.js.map +1 -1
  139. package/dist/deduplication/records.d.ts +8 -2
  140. package/dist/deduplication/records.d.ts.map +1 -1
  141. package/dist/deduplication/records.js +36 -8
  142. package/dist/deduplication/records.js.map +1 -1
  143. package/dist/deep-scan.d.ts +11 -0
  144. package/dist/deep-scan.d.ts.map +1 -1
  145. package/dist/deep-scan.js +235 -4
  146. package/dist/deep-scan.js.map +1 -1
  147. package/dist/default-severity-rubric.d.ts +1 -2
  148. package/dist/default-severity-rubric.d.ts.map +1 -1
  149. package/dist/default-severity-rubric.js +2 -66
  150. package/dist/default-severity-rubric.js.map +1 -1
  151. package/dist/endor-findings.d.ts.map +1 -1
  152. package/dist/endor-findings.js +7 -37
  153. package/dist/endor-findings.js.map +1 -1
  154. package/dist/errors.js +1 -1
  155. package/dist/errors.js.map +1 -1
  156. package/dist/external-findings-import.d.ts.map +1 -1
  157. package/dist/external-findings-import.js +5 -11
  158. package/dist/external-findings-import.js.map +1 -1
  159. package/dist/external-findings-local.d.ts +9 -0
  160. package/dist/external-findings-local.d.ts.map +1 -1
  161. package/dist/external-findings-local.js +325 -179
  162. package/dist/external-findings-local.js.map +1 -1
  163. package/dist/external-findings-publish.d.ts +12 -0
  164. package/dist/external-findings-publish.d.ts.map +1 -1
  165. package/dist/external-findings-publish.js +1202 -214
  166. package/dist/external-findings-publish.js.map +1 -1
  167. package/dist/external-findings-read.d.ts +8 -0
  168. package/dist/external-findings-read.d.ts.map +1 -1
  169. package/dist/external-findings-read.js +65 -54
  170. package/dist/external-findings-read.js.map +1 -1
  171. package/dist/external-findings.d.ts +2 -0
  172. package/dist/external-findings.d.ts.map +1 -1
  173. package/dist/external-findings.js +111 -0
  174. package/dist/external-findings.js.map +1 -1
  175. package/dist/external-import-contract.d.ts +29 -1
  176. package/dist/external-import-contract.d.ts.map +1 -1
  177. package/dist/external-import-contract.js +314 -44
  178. package/dist/external-import-contract.js.map +1 -1
  179. package/dist/external-import-models.d.ts +1 -1
  180. package/dist/external-import-models.d.ts.map +1 -1
  181. package/dist/external-import-models.js.map +1 -1
  182. package/dist/finding-normalization.d.ts +1 -1
  183. package/dist/finding-normalization.d.ts.map +1 -1
  184. package/dist/finding-normalization.js +46 -11
  185. package/dist/finding-normalization.js.map +1 -1
  186. package/dist/finding-retrieval.d.ts +3 -3
  187. package/dist/finding-retrieval.d.ts.map +1 -1
  188. package/dist/finding-retrieval.js.map +1 -1
  189. package/dist/finding-workflow.d.ts +6 -1
  190. package/dist/finding-workflow.d.ts.map +1 -1
  191. package/dist/finding-workflow.js +2 -2
  192. package/dist/finding-workflow.js.map +1 -1
  193. package/dist/git-remote.d.ts +4 -0
  194. package/dist/git-remote.d.ts.map +1 -1
  195. package/dist/git-remote.js +20 -0
  196. package/dist/git-remote.js.map +1 -1
  197. package/dist/github-advisories.d.ts +3 -12
  198. package/dist/github-advisories.d.ts.map +1 -1
  199. package/dist/github-advisories.js +9 -29
  200. package/dist/github-advisories.js.map +1 -1
  201. package/dist/github-dependabot-findings.d.ts.map +1 -1
  202. package/dist/github-dependabot-findings.js +7 -16
  203. package/dist/github-dependabot-findings.js.map +1 -1
  204. package/dist/github-findings.d.ts.map +1 -1
  205. package/dist/github-findings.js +344 -56
  206. package/dist/github-findings.js.map +1 -1
  207. package/dist/github.d.ts +17 -7
  208. package/dist/github.d.ts.map +1 -1
  209. package/dist/github.js +43 -30
  210. package/dist/github.js.map +1 -1
  211. package/dist/host-protocol.d.ts +2 -2
  212. package/dist/host-protocol.d.ts.map +1 -1
  213. package/dist/host-protocol.js.map +1 -1
  214. package/dist/host-records-protocol.d.ts +10 -11
  215. package/dist/host-records-protocol.d.ts.map +1 -1
  216. package/dist/host-records-protocol.js +69 -9
  217. package/dist/host-records-protocol.js.map +1 -1
  218. package/dist/hosted-scan.d.ts +15 -0
  219. package/dist/hosted-scan.d.ts.map +1 -1
  220. package/dist/hosted-scan.js +55 -33
  221. package/dist/hosted-scan.js.map +1 -1
  222. package/dist/index.d.ts +7 -0
  223. package/dist/index.d.ts.map +1 -1
  224. package/dist/index.js +6 -0
  225. package/dist/index.js.map +1 -1
  226. package/dist/inspector-findings.d.ts.map +1 -1
  227. package/dist/inspector-findings.js +13 -18
  228. package/dist/inspector-findings.js.map +1 -1
  229. package/dist/knowledge-base.js +18 -5
  230. package/dist/knowledge-base.js.map +1 -1
  231. package/dist/local-git-metadata.d.ts +5 -0
  232. package/dist/local-git-metadata.d.ts.map +1 -0
  233. package/dist/local-git-metadata.js +131 -0
  234. package/dist/local-git-metadata.js.map +1 -0
  235. package/dist/multiscan.d.ts.map +1 -1
  236. package/dist/multiscan.js +22 -12
  237. package/dist/multiscan.js.map +1 -1
  238. package/dist/opengrep-findings.d.ts.map +1 -1
  239. package/dist/opengrep-findings.js +34 -20
  240. package/dist/opengrep-findings.js.map +1 -1
  241. package/dist/patch-tui.d.ts.map +1 -1
  242. package/dist/patch-tui.js +90 -35
  243. package/dist/patch-tui.js.map +1 -1
  244. package/dist/private-finding-import.d.ts +246 -0
  245. package/dist/private-finding-import.d.ts.map +1 -0
  246. package/dist/private-finding-import.js +387 -0
  247. package/dist/private-finding-import.js.map +1 -0
  248. package/dist/project-config.d.ts.map +1 -1
  249. package/dist/project-config.js +2 -2
  250. package/dist/project-config.js.map +1 -1
  251. package/dist/provider-profile.d.ts +10 -2
  252. package/dist/provider-profile.d.ts.map +1 -1
  253. package/dist/provider-profile.js +72 -10
  254. package/dist/provider-profile.js.map +1 -1
  255. package/dist/publication.js +7 -1
  256. package/dist/publication.js.map +1 -1
  257. package/dist/reader-selection.d.ts +13 -0
  258. package/dist/reader-selection.d.ts.map +1 -0
  259. package/dist/reader-selection.js +81 -0
  260. package/dist/reader-selection.js.map +1 -0
  261. package/dist/record.d.ts +6 -1
  262. package/dist/record.d.ts.map +1 -1
  263. package/dist/record.js +53 -2
  264. package/dist/record.js.map +1 -1
  265. package/dist/remediation.d.ts +5 -0
  266. package/dist/remediation.d.ts.map +1 -1
  267. package/dist/remediation.js +30 -0
  268. package/dist/remediation.js.map +1 -1
  269. package/dist/result.d.ts +2 -0
  270. package/dist/result.d.ts.map +1 -1
  271. package/dist/result.js +3 -1
  272. package/dist/result.js.map +1 -1
  273. package/dist/runtime.d.ts +2 -1
  274. package/dist/runtime.d.ts.map +1 -1
  275. package/dist/runtime.js +95 -52
  276. package/dist/runtime.js.map +1 -1
  277. package/dist/scan-activity.js +40 -17
  278. package/dist/scan-activity.js.map +1 -1
  279. package/dist/scan-comparison.d.ts +1 -1
  280. package/dist/scan-comparison.d.ts.map +1 -1
  281. package/dist/scan-comparison.js +11 -13
  282. package/dist/scan-comparison.js.map +1 -1
  283. package/dist/scan-dashboard.d.ts +1 -0
  284. package/dist/scan-dashboard.d.ts.map +1 -1
  285. package/dist/scan-dashboard.js +16 -37
  286. package/dist/scan-dashboard.js.map +1 -1
  287. package/dist/scan-executor.d.ts +2 -0
  288. package/dist/scan-executor.d.ts.map +1 -1
  289. package/dist/scan-executor.js.map +1 -1
  290. package/dist/scan-history-renderer.d.ts.map +1 -1
  291. package/dist/scan-history-renderer.js +22 -9
  292. package/dist/scan-history-renderer.js.map +1 -1
  293. package/dist/scan-logs.d.ts.map +1 -1
  294. package/dist/scan-logs.js +5 -5
  295. package/dist/scan-logs.js.map +1 -1
  296. package/dist/scanner-import.d.ts +46 -6
  297. package/dist/scanner-import.d.ts.map +1 -1
  298. package/dist/scanner-import.js +208 -42
  299. package/dist/scanner-import.js.map +1 -1
  300. package/dist/scanner-repository-url.d.ts +14 -0
  301. package/dist/scanner-repository-url.d.ts.map +1 -0
  302. package/dist/scanner-repository-url.js +67 -0
  303. package/dist/scanner-repository-url.js.map +1 -0
  304. package/dist/semgrep-findings.d.ts.map +1 -1
  305. package/dist/semgrep-findings.js +20 -48
  306. package/dist/semgrep-findings.js.map +1 -1
  307. package/dist/semgrep-platform-findings.d.ts +12 -0
  308. package/dist/semgrep-platform-findings.d.ts.map +1 -0
  309. package/dist/semgrep-platform-findings.js +198 -0
  310. package/dist/semgrep-platform-findings.js.map +1 -0
  311. package/dist/severity-rubric.d.ts +20 -0
  312. package/dist/severity-rubric.d.ts.map +1 -0
  313. package/dist/severity-rubric.js +73 -0
  314. package/dist/severity-rubric.js.map +1 -0
  315. package/dist/severity-store.js +15 -5
  316. package/dist/severity-store.js.map +1 -1
  317. package/dist/snyk-findings.d.ts.map +1 -1
  318. package/dist/snyk-findings.js +21 -20
  319. package/dist/snyk-findings.js.map +1 -1
  320. package/dist/sonar-collector.d.ts +16 -0
  321. package/dist/sonar-collector.d.ts.map +1 -0
  322. package/dist/sonar-collector.js +383 -0
  323. package/dist/sonar-collector.js.map +1 -0
  324. package/dist/sonar-findings.d.ts +49 -0
  325. package/dist/sonar-findings.d.ts.map +1 -0
  326. package/dist/sonar-findings.js +288 -0
  327. package/dist/sonar-findings.js.map +1 -0
  328. package/dist/sonar-import.d.ts +111 -0
  329. package/dist/sonar-import.d.ts.map +1 -0
  330. package/dist/sonar-import.js +279 -0
  331. package/dist/sonar-import.js.map +1 -0
  332. package/dist/suggest-owners.d.ts.map +1 -1
  333. package/dist/suggest-owners.js +2 -1
  334. package/dist/suggest-owners.js.map +1 -1
  335. package/dist/targets.d.ts +3 -0
  336. package/dist/targets.d.ts.map +1 -1
  337. package/dist/targets.js +18 -12
  338. package/dist/targets.js.map +1 -1
  339. package/dist/terminal-columns.d.ts +4 -0
  340. package/dist/terminal-columns.d.ts.map +1 -0
  341. package/dist/terminal-columns.js +19 -0
  342. package/dist/terminal-columns.js.map +1 -0
  343. package/dist/validation-records.d.ts +0 -3
  344. package/dist/validation-records.d.ts.map +1 -1
  345. package/dist/validation-records.js +0 -16
  346. package/dist/validation-records.js.map +1 -1
  347. package/dist/veracode-findings.d.ts +7 -0
  348. package/dist/veracode-findings.d.ts.map +1 -0
  349. package/dist/veracode-findings.js +371 -0
  350. package/dist/veracode-findings.js.map +1 -0
  351. package/dist/windows-path.d.ts.map +1 -1
  352. package/dist/windows-path.js +1 -0
  353. package/dist/windows-path.js.map +1 -1
  354. package/dist/wiz-csv.d.ts +2 -2
  355. package/dist/wiz-csv.d.ts.map +1 -1
  356. package/dist/wiz-csv.js +1 -3
  357. package/dist/wiz-csv.js.map +1 -1
  358. package/dist/wiz-findings.d.ts +10 -2
  359. package/dist/wiz-findings.d.ts.map +1 -1
  360. package/dist/wiz-findings.js +88 -49
  361. package/dist/wiz-findings.js.map +1 -1
  362. package/docs/classify-severity-records.md +1 -1
  363. package/docs/cli.md +310 -477
  364. package/docs/dedupe-records.md +10 -0
  365. package/docs/findings-service.md +21 -8
  366. package/docs/hosted-scans.md +16 -1
  367. package/package.json +8 -9
  368. package/schemas/external-findings.schema.json +12 -1
  369. package/schemas/hosted-scan-v2.fixture.json +16 -1
  370. package/_bundled_plugin/scripts/validate_tracking_source.py +0 -82
  371. package/_bundled_plugin/scripts/workbench_local_dedupe.py +0 -136
  372. package/dist/deduplication/records-protocol.d.ts +0 -4
  373. package/dist/deduplication/records-protocol.d.ts.map +0 -1
  374. package/dist/deduplication/records-protocol.js +0 -49
  375. package/dist/deduplication/records-protocol.js.map +0 -1
@@ -1,15 +1,75 @@
1
- import { runHostProtocol } from "./host-protocol.js";
1
+ import { randomUUID } from "node:crypto";
2
+ import { z } from "zod";
3
+ import { classifySeverityRecords, } from "./classify-severity-records.js";
4
+ import { missingSubmissionPrompt } from "./deduplication/deduplication-prompts.js";
5
+ import { runRecords, } from "./deduplication/records.js";
6
+ import { PendingReviewSubmission, runHostProtocol, } from "./host-protocol.js";
7
+ import { validateRecords, } from "./validation-records.js";
8
+ const missingSubmission = z.strictObject({
9
+ status: z.literal("missing_submission"),
10
+ });
11
+ const released = z.strictObject({ status: z.literal("released") });
12
+ async function runDeduplicationReview(request, validateSubmission, execute) {
13
+ const first = await execute(request.requestId, {
14
+ ...request,
15
+ supportsContinuation: true,
16
+ supportsSubmissionValidation: true,
17
+ });
18
+ let rejection;
19
+ if (first instanceof PendingReviewSubmission) {
20
+ try {
21
+ validateSubmission(first.submission);
22
+ }
23
+ catch (error) {
24
+ rejection =
25
+ error instanceof Error ? error.message : "Invalid submission.";
26
+ }
27
+ if (rejection === undefined) {
28
+ const receipt = await execute(randomUUID(), { requestId: request.requestId }, undefined, "review.release");
29
+ released.parse(receipt);
30
+ return first.submission;
31
+ }
32
+ }
33
+ else if (!missingSubmission.safeParse(first).success)
34
+ return first;
35
+ const result = await execute(randomUUID(), {
36
+ requestId: request.requestId,
37
+ prompt: missingSubmissionPrompt(rejection),
38
+ }, undefined, "review.continue");
39
+ if (missingSubmission.safeParse(result).success)
40
+ throw new Error("Review ended without a terminal submission after correction.");
41
+ return result;
42
+ }
43
+ const labels = {
44
+ dedupe: "Deduplication",
45
+ validate: "Validation",
46
+ "classify-severity": "Records processing",
47
+ };
2
48
  /** Adapt record reviews to the shared host transport without replaying work. */
3
- export function runHostRecordsProtocol(input, output, run, signal) {
49
+ export function runHostRecordsProtocol(command, input, output, options = {}) {
4
50
  return runHostProtocol(input, output, {
5
- label: "Records processing",
51
+ label: labels[command],
6
52
  requestMethod: "review.run",
7
- run: (params, execute, signal) => run(params, {
8
- signal,
9
- reviewRunner: {
53
+ run: async (params, execute, signal) => {
54
+ if (command === "dedupe")
55
+ return runRecords(params, (request, validate) => runDeduplicationReview(request, validate, execute), signal);
56
+ const reviewRunner = {
10
57
  run: (review) => execute(review.requestId, review),
11
- },
12
- }),
13
- }, signal);
58
+ };
59
+ if (command === "validate")
60
+ return {
61
+ status: "completed",
62
+ result: await validateRecords(params, {
63
+ signal,
64
+ reviewRunner,
65
+ }),
66
+ };
67
+ return classifySeverityRecords(params, {
68
+ classificationRuns: options.classificationRuns,
69
+ signal,
70
+ reviewRunner,
71
+ });
72
+ },
73
+ }, options.signal);
14
74
  }
15
75
  //# sourceMappingURL=host-records-protocol.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"host-records-protocol.js","sourceRoot":"","sources":["../src/host-records-protocol.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAIrD,gFAAgF;AAChF,MAAM,UAAU,sBAAsB,CAIpC,KAAe,EACf,MAA6B,EAC7B,GAMoB,EACpB,MAAoB;IAEpB,OAAO,eAAe,CACpB,KAAK,EACL,MAAM,EACN;QACE,KAAK,EAAE,oBAAoB;QAC3B,aAAa,EAAE,YAAY;QAC3B,GAAG,EAAE,CAAC,MAAM,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,CAC/B,GAAG,CAAC,MAAM,EAAE;YACV,MAAM;YACN,YAAY,EAAE;gBACZ,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC;aACnD;SACF,CAAC;KACL,EACD,MAAM,CACP,CAAC;AACJ,CAAC","sourcesContent":["import type { Readable } from \"node:stream\";\nimport { runHostProtocol } from \"./host-protocol.js\";\n\nexport type RecordsProtocolOutput = Parameters<typeof runHostProtocol>[1];\n\n/** Adapt record reviews to the shared host transport without replaying work. */\nexport function runHostRecordsProtocol<\n Review extends { requestId: string },\n Result extends { status: \"completed\" | \"unresolved\" },\n>(\n input: Readable,\n output: RecordsProtocolOutput,\n run: (\n input: unknown,\n options: {\n signal: AbortSignal;\n reviewRunner: { run(review: Review): Promise<unknown> };\n },\n ) => Promise<Result>,\n signal?: AbortSignal,\n): Promise<number> {\n return runHostProtocol(\n input,\n output,\n {\n label: \"Records processing\",\n requestMethod: \"review.run\",\n run: (params, execute, signal) =>\n run(params, {\n signal,\n reviewRunner: {\n run: (review) => execute(review.requestId, review),\n },\n }),\n },\n signal,\n );\n}\n"]}
1
+ {"version":3,"file":"host-records-protocol.js","sourceRoot":"","sources":["../src/host-records-protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EACL,uBAAuB,GAExB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EACL,UAAU,GAEX,MAAM,4BAA4B,CAAC;AAEpC,O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BACb,CAAC;iBACH,CAAC;YACJ,OAAO,uBAAuB,CAAC,MAAsC,EAAE;gBACrE,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;gBAC9C,MAAM;gBACN,YAAY;aACb,CAAC,CAAC;QACL,CAAC;KACF,EACD,OAAO,CAAC,MAAM,CACf,CAAC;AACJ,CAAC","sourcesContent":["import { randomUUID } from \"node:crypto\";\nimport type { Readable } from \"node:stream\";\nimport { z } from \"zod\";\nimport {\n classifySeverityRecords,\n type ClassifySeverityRecordsInput,\n} from \"./classify-severity-records.js\";\nimport { missingSubmissionPrompt } from \"./deduplication/deduplication-prompts.js\";\nimport {\n runRecords,\n type DeduplicateRecordsInput,\n} from \"./deduplication/records.js\";\nimport type { DeduplicationReviewRequest } from \"./deduplication/review.js\";\nimport {\n PendingReviewSubmission,\n runHostProtocol,\n type HostExecute,\n} from \"./host-protocol.js\";\nimport {\n validateRecords,\n type ValidateRecordsInput,\n} from \"./validation-records.js\";\n\nconst missingSubmission = z.strictObject({\n status: z.literal(\"missing_submission\"),\n});\nconst released = z.strictObject({ status: z.literal(\"released\") });\n\nasync function runDeduplicationReview(\n request: DeduplicationReviewRequest,\n validateSubmission: (value: unknown) => void,\n execute: HostExecute,\n) {\n const first = await execute(request.requestId, {\n ...request,\n supportsContinuation: true,\n supportsSubmissionValidation: true,\n });\n let rejection: string | undefined;\n if (first instanceof PendingReviewSubmission) {\n try {\n validateSubmission(first.submission);\n } catch (error) {\n rejection =\n error instanceof Error ? error.message : \"Invalid submission.\";\n }\n if (rejection === undefined) {\n const receipt = await execute(\n randomUUID(),\n { requestId: request.requestId },\n undefined,\n \"review.release\",\n );\n released.parse(receipt);\n return first.submission;\n }\n } else if (!missingSubmission.safeParse(first).success) return first;\n const result = await execute(\n randomUUID(),\n {\n requestId: request.requestId,\n prompt: missingSubmissionPrompt(rejection),\n },\n undefined,\n \"review.continue\",\n );\n if (missingSubmission.safeParse(result).success)\n throw new Error(\n \"Review ended without a terminal submission after correction.\",\n );\n return result;\n}\n\nconst labels = {\n dedupe: \"Deduplication\",\n validate: \"Validation\",\n \"classify-severity\": \"Records processing\",\n};\n\n/** Adapt record reviews to the shared host transport without replaying work. */\nexport function runHostRecordsProtocol(\n command: keyof typeof labels,\n input: Readable,\n output: Parameters<typeof runHostProtocol>[1],\n options: {\n signal?: AbortSignal;\n classificationRuns?: number;\n } = {},\n): Promise<number> {\n return runHostProtocol(\n input,\n output,\n {\n label: labels[command],\n requestMethod: \"review.run\",\n run: async (params, execute, signal) => {\n if (command === \"dedupe\")\n return runRecords(\n params as DeduplicateRecordsInput,\n (request, validate) =>\n runDeduplicationReview(request, validate, execute),\n signal,\n );\n const reviewRunner = {\n run: (review: { requestId: string }) =>\n execute(review.requestId, review),\n };\n if (command === \"validate\")\n return {\n status: \"completed\",\n result: await validateRecords(params as ValidateRecordsInput, {\n signal,\n reviewRunner,\n }),\n };\n return classifySeverityRecords(params as ClassifySeverityRecordsInput, {\n classificationRuns: options.classificationRuns,\n signal,\n reviewRunner,\n });\n },\n },\n options.signal,\n );\n}\n"]}
@@ -13,6 +13,11 @@ export declare const HostedScanInputSchema: z.ZodObject<{
13
13
  stateDirectory: z.ZodString;
14
14
  model: z.ZodString;
15
15
  reasoningEffort: z.ZodString;
16
+ severityRubric: z.ZodOptional<z.ZodObject<{
17
+ revision: z.ZodNumber;
18
+ markdown: z.ZodString;
19
+ sha256: z.ZodString;
20
+ }, z.core.$strict>>;
16
21
  ownerSuggestions: z.ZodOptional<z.ZodBoolean>;
17
22
  identity: z.ZodObject<{
18
23
  runId: z.ZodString;
@@ -58,6 +63,11 @@ export declare function runHostedScan(value: HostedScanInput, options: HostedSca
58
63
  attemptId: string;
59
64
  buildId: string;
60
65
  };
66
+ severityRubric?: {
67
+ revision: number;
68
+ markdown: string;
69
+ sha256: string;
70
+ } | undefined;
61
71
  version: 2;
62
72
  outputDirectory: string;
63
73
  scanId?: string | undefined;
@@ -98,6 +108,11 @@ export declare function runHostedScan(value: HostedScanInput, options: HostedSca
98
108
  attemptId: string;
99
109
  buildId: string;
100
110
  };
111
+ severityRubric?: {
112
+ revision: number;
113
+ markdown: string;
114
+ sha256: string;
115
+ } | undefined;
101
116
  version: 2;
102
117
  outputDirectory: string;
103
118
  scanId?: string | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-scan.d.ts","sourceRoot":"","sources":["../src/hosted-scan.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,YAAY,EAEjB,KAAK,kBAAkB,EAExB,MAAM,oBAAoB,CAAC;AAC5B,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAG7E,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAMxB,qFAAqF;AACrF,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;kBAiBhC,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,qBAAqB,CAAC,CAAC;AACpE,qBAAa,0BAA2B,SAAQ,KAAK;IAEjD,QAAQ,CAAC,MAAM,EACX,cAAc,GACd,eAAe,GACf,0BAA0B,GAC1B,aAAa,GACb,mBAAmB;IANzB,YACW,MAAM,EACX,cAAc,GACd,eAAe,GACf,0BAA0B,GAC1B,aAAa,GACb,mBAAmB,EACvB,OAAO,EAAE,MAAM,EAIhB;CACF;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyBzD;AAMD,wBAAgB,oBAAoB,CAClC,KAAK,GAAE,SAAS,MAAM,EAAU,GAC/B,MAAM,EAAE,CAeV;AAmED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAC;IACvB,4FAA4F;IAC5F,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,OAAO,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG;YACvE,GAAG,CACD,KAAK,EA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aAAa,GACb,mBAAmB,EACvB,OAAO,EAAE,MAAM,EAIhB;CACF;AAED,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAyBzD;AAMD,wBAAgB,oBAAoB,CAClC,KAAK,GAAE,SAAS,MAAM,EAAU,GAC/B,MAAM,EAAE,CAeV;AAiED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,YAAY,CAAC;IACvB,4FAA4F;IAC5F,UAAU,CAAC,EAAE;QACX,WAAW,CAAC,OAAO,EAAE;YAAE,KAAK,CAAC,EAAE,MAAM,CAAC;YAAC,oBAAoB,CAAC,EAAE,MAAM,CAAA;SAAE,GAAG;YACvE,GAAG,CACD,KAAK,EAAE,MAAM,EACb,OAAO,EAAE;gBAAE,YAAY,CAAC,EAAE,OAAO,CAAC;gBAAC,MAAM,CAAC,EAAE,WAAW,CAAA;aAAE,GACxD,OAAO,CAAC;gBAAE,aAAa,EAAE,MAAM,CAAA;aAAE,CAAC,CAAC;SACvC,CAAC;KACH,CAAC;IACF,MAAM,CAAC,EAAE,WAAW,CAAC;IACrB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,kBAAkB,KAAK,IAAI,CAAC;CAC/C;AAED,0FAA0F;AAC1F,wBAAsB,aAAa,CACjC,KAAK,EAAE,eAAe,EACtB,OAAO,EAAE,iBAAiB;;;;QAMf,KAAK;;;;;;;;;;;;aAWL,CAAC;;;;;;;;;;;;;;;;;;;;;;YAyIA,WAAW;;;;;;;;;;;QApJZ,KAAK;;;;;;;;;;;;aAWL,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;GA8Kb;AAED,MAAM,MAAM,gBAAgB,GAAG,OAAO,CAAC,UAAU,CAAC,OAAO,aAAa,CAAC,CAAC,CAAC"}
@@ -8,8 +8,9 @@ import { realpath } from "node:fs/promises";
8
8
  import { isAbsolute, relative, resolve, sep } from "node:path";
9
9
  import { z } from "zod";
10
10
  import { CodexSecurity } from "./api.js";
11
+ import { severityRubricSnapshotSchema } from "./classify-severity-records.js";
11
12
  import { ScanInterruptedError, errorMessage } from "./errors.js";
12
- import { normalizeRepository, repositoryRevision } from "./targets.js";
13
+ import { abortable, normalizeRepository, repositoryRevision, } from "./targets.js";
13
14
  import { isWithin } from "./trusted-executable.js";
14
15
  /** Hosted v2 mirrors repository/paths targets; only Standard scans are supported. */
15
16
  export const HostedScanInputSchema = z.strictObject({
@@ -23,6 +24,9 @@ export const HostedScanInputSchema = z.strictObject({
23
24
  stateDirectory: z.string().min(1),
24
25
  model: z.string().min(1),
25
26
  reasoningEffort: z.string(),
27
+ severityRubric: severityRubricSnapshotSchema
28
+ .refine(({ markdown, sha256 }) => hash("sha256", markdown) === sha256, "Rubric SHA-256 does not match its exact UTF-8 Markdown.")
29
+ .optional(),
26
30
  ownerSuggestions: z.boolean().optional(),
27
31
  identity: z.strictObject({
28
32
  runId: z.string().min(1),
@@ -69,19 +73,19 @@ export function normalizeHostedPaths(paths = ["."]) {
69
73
  return normalized;
70
74
  }
71
75
  /** Validate every path at the frozen commit before registering a scan/executing. */
72
- async function prepareHostedScan(input, signal) {
73
- const scope = { paths: normalizeHostedPaths(input.scope?.paths) };
76
+ async function prepareHostedRepository(input, signal) {
74
77
  const repository = await normalizeRepository(input.repository, signal);
75
78
  if ((await repositoryRevision(repository, signal)) !== input.revision)
76
79
  throw new HostedScanPreparationError("revision_mismatch", "Checkout does not match the frozen revision.");
77
- for (const path of scope.paths) {
80
+ for (const path of input.scope.paths) {
78
81
  const selected = resolve(repository, path);
79
82
  let target;
80
83
  try {
81
- target = await realpath(selected);
84
+ target = await abortable(() => realpath(selected), signal);
82
85
  }
83
86
  catch (error) {
84
- if (!(error instanceof Error) ||
87
+ if ((signal?.aborted && error === signal.reason) ||
88
+ !(error instanceof Error) ||
85
89
  !("code" in error) ||
86
90
  error.code !== "ENOENT")
87
91
  throw error;
@@ -94,12 +98,7 @@ async function prepareHostedScan(input, signal) {
94
98
  throw new HostedScanPreparationError("scope_alias", `${path} resolves to ${canonical}. Use the canonical repository path and start a new scan.`);
95
99
  }
96
100
  }
97
- return {
98
- repository,
99
- revision: input.revision,
100
- scope,
101
- identity: input.identity,
102
- };
101
+ return repository;
103
102
  }
104
103
  function hostedScanEnvironment(stateDirectory) {
105
104
  const environment = {
@@ -121,10 +120,53 @@ function hostedScanEnvironment(stateDirectory) {
121
120
  /** One invocation, with only scan-domain state. The host decides retry/reconciliation. */
122
121
  export async function runHostedScan(value, options) {
123
122
  const input = HostedScanInputSchema.parse(value);
124
- const context = await prepareHostedScan(input, options.signal);
123
+ const context = {
124
+ repository: input.repository,
125
+ revision: input.revision,
126
+ scope: { paths: normalizeHostedPaths(input.scope?.paths) },
127
+ identity: input.identity,
128
+ ...(input.severityRubric === undefined
129
+ ? {}
130
+ : { severityRubric: input.severityRubric }),
131
+ };
125
132
  let execution;
126
133
  let request;
127
134
  let scanId;
135
+ let outputDirectory = resolve(input.outputDirectory);
136
+ const base = () => ({
137
+ version: 2,
138
+ ...context,
139
+ outputDirectory,
140
+ ...(scanId === undefined ? {} : { scanId }),
141
+ ...(request === undefined
142
+ ? {}
143
+ : {
144
+ pluginVersion: request.runtime.pluginVersion,
145
+ }),
146
+ provenance: {
147
+ cliVersion: VERSION,
148
+ buildId: input.identity.buildId,
149
+ ...(request === undefined
150
+ ? {}
151
+ : { pluginVersion: request.runtime.pluginVersion }),
152
+ },
153
+ ...(execution === undefined ? {} : { execution }),
154
+ });
155
+ try {
156
+ context.repository = await prepareHostedRepository(context, options.signal);
157
+ }
158
+ catch (error) {
159
+ if (options.signal?.aborted &&
160
+ (Object.is(error, options.signal.reason) ||
161
+ (error instanceof DOMException && error.name === "AbortError")))
162
+ return {
163
+ ...base(),
164
+ status: "canceled",
165
+ error: `Canceled before checkout verification finished: ${errorMessage(error)}`,
166
+ artifacts: [],
167
+ };
168
+ throw error;
169
+ }
128
170
  const onEvent = (event) => {
129
171
  void Promise.resolve()
130
172
  .then(() => options.onEvent?.(event))
@@ -152,26 +194,6 @@ export async function runHostedScan(value, options) {
152
194
  throw new Error("Local inference is unavailable in hosted mode.");
153
195
  },
154
196
  }, { surface: "sdk" });
155
- let outputDirectory = resolve(input.outputDirectory);
156
- const base = () => ({
157
- version: 2,
158
- ...context,
159
- outputDirectory,
160
- ...(scanId === undefined ? {} : { scanId }),
161
- ...(request === undefined
162
- ? {}
163
- : {
164
- pluginVersion: request.runtime.pluginVersion,
165
- }),
166
- provenance: {
167
- cliVersion: VERSION,
168
- buildId: input.identity.buildId,
169
- ...(request === undefined
170
- ? {}
171
- : { pluginVersion: request.runtime.pluginVersion }),
172
- },
173
- ...(execution === undefined ? {} : { execution }),
174
- });
175
197
  try {
176
198
  const result = await client.run(context.repository, {
177
199
  target: context.scope.paths[0] === "."
@@ -1 +1 @@
1
- {"version":3,"file":"hosted-scan.js","sourceRoot":"","sources":["../src/hosted-scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,kBAAkB,GAKnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,cAAc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IAAI,KAAK,YAAY,kBAAkB;YAAE,SAAS,GAAG,KAAK,CAAC,MAAM,CAAC;QAClE,OAAO;YACL,GAAG,IAAI,EAAE;YACT,MAAM,EACJ,SAAS,EAAE,MAAM,KAAK,oBAAoB;gBACxC,CAAC,CAAE,oBAA8B;gBACjC,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,OAAO;oBACrB,SAAS,EAAE,MAAM,KAAK,UAAU;oBAChC,KAAK,YAAY,oBAAoB;oBACvC,CAAC,CAAE,UAAoB;oBACvB,CAAC,CAAE,QAAkB;YAC3B,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;YAC1B,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC;gBACN,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE;oBACR,EAAE,EAAE,iBAAiB;oBACrB,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE,QAAQ;oBAChB,WAAW,EAAE,+BAA+B,YAAY,CAAC,KAAK,CAAC,EAAE;oBACjE,KAAK,EAAE,EAAE;iBACV;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { hash } from \"node:crypto\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport {\n readScanFile,\n safeScopePath,\n validatedFileDigests,\n} from \"./contract.js\";\nimport { isRecord } from \"./record.js\";\nimport { VERSION } from \"./version.js\";\nimport {\n ScanExecutionError,\n type ScanExecutor,\n type ScanExecutionResult,\n type ScanExecutionEvent,\n type ScanExecutionRequest,\n} from \"./scan-executor.js\";\nexport type { ScanExecutor, ScanExecutionRequest } from \"./scan-executor.js\";\nimport { realpath } from \"node:fs/promises\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport { z } from \"zod\";\nimport { CodexSecurity } from \"./api.js\";\nimport { ScanInterruptedError, errorMessage } from \"./errors.js\";\nimport { normalizeRepository, repositoryRevision } from \"./targets.js\";\nimport { isWithin } from \"./trusted-executable.js\";\n\n/** Hosted v2 mirrors repository/paths targets; only Standard scans are supported. */\nexport const HostedScanInputSchema = z.strictObject({\n version: z.literal(2),\n repository: z.string().min(1),\n revision: z.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),\n scope: z\n .strictObject({ paths: z.array(z.string().min(1)).min(1) })\n .optional(),\n outputDirectory: z.string().min(1),\n stateDirectory: z.string().min(1),\n model: z.string().min(1),\n reasoningEffort: z.string(),\n ownerSuggestions: z.boolean().optional(),\n identity: z.strictObject({\n runId: z.string().min(1),\n attemptId: z.string().min(1),\n buildId: z.string().min(1),\n }),\n});\n\nexport type HostedScanInput = z.infer<typeof HostedScanInputSchema>;\nexport class HostedScanPreparationError extends Error {\n constructor(\n readonly reason:\n | \"scope_syntax\"\n | \"scope_missing\"\n | \"scope_outside_repository\"\n | \"scope_alias\"\n | \"revision_mismatch\",\n message: string,\n ) {\n super(message);\n this.name = \"HostedScanPreparationError\";\n }\n}\n\nexport function normalizeHostedScope(path: string): string {\n const parts = path.split(process.platform === \"win32\" ? /[/\\\\]/ : \"/\");\n if (\n path.length === 0 ||\n path.includes(\"\\0\") ||\n isAbsolute(path) ||\n (process.platform === \"win32\" && /^[a-z]:/i.test(path)) ||\n parts.includes(\"..\")\n ) {\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n \"Use non-empty repository-relative folders or files without parent traversal or NUL characters.\",\n );\n }\n const normalized = parts\n .filter((part) => part !== \"\" && part !== \".\")\n .join(\"/\");\n try {\n return safeScopePath(normalized || \".\");\n } catch {\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n `${JSON.stringify(path)} cannot be used as scan scope: the output contract requires UTF-8 repository-relative paths without drive prefixes, backslashes, or control characters.`,\n );\n }\n}\n\nfunction comparePaths(left: string, right: string): number {\n return Buffer.compare(Buffer.from(left), Buffer.from(right));\n}\n\nexport function normalizeHostedPaths(\n paths: readonly string[] = [\".\"],\n): string[] {\n if (paths.length === 0)\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n \"An explicit path scope must not be empty. Omit scope to scan the repository.\",\n );\n const normalized = [...new Set(paths.map(normalizeHostedScope))].sort(\n comparePaths,\n );\n if (normalized.length > 1 && normalized.includes(\".\"))\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n \"Repository scope cannot be mixed with narrower paths.\",\n );\n return normalized;\n}\n\n/** Validate every path at the frozen commit before registering a scan/executing. */\nasync function prepareHostedScan(input: HostedScanInput, signal?: AbortSignal) {\n const scope = { paths: normalizeHostedPaths(input.scope?.paths) };\n const repository = await normalizeRepository(input.repository, signal);\n if ((await repositoryRevision(repository, signal)) !== input.revision)\n throw new HostedScanPreparationError(\n \"revision_mismatch\",\n \"Checkout does not match the frozen revision.\",\n );\n for (const path of scope.paths) {\n const selected = resolve(repository, path);\n let target: string;\n try {\n target = await realpath(selected);\n } catch (error) {\n if (\n !(error instanceof Error) ||\n !(\"code\" in error) ||\n error.code !== \"ENOENT\"\n )\n throw error;\n throw new HostedScanPreparationError(\n \"scope_missing\",\n `${path} does not exist at the selected revision. Update the paths and start a new scan.`,\n );\n }\n if (!isWithin(repository, target))\n throw new HostedScanPreparationError(\n \"scope_outside_repository\",\n `${path} resolves outside the repository.`,\n );\n if (target !== selected) {\n const canonical =\n relative(repository, target).split(sep).join(\"/\") || \".\";\n throw new HostedScanPreparationError(\n \"scope_alias\",\n `${path} resolves to ${canonical}. Use the canonical repository path and start a new scan.`,\n );\n }\n }\n return {\n repository,\n revision: input.revision,\n scope,\n identity: input.identity,\n };\n}\n\nfunction hostedScanEnvironment(stateDirectory: string): Record<string, string> {\n const environment: Record<string, string> = {\n PATH: process.env[\"PATH\"] ?? \"\",\n CODEX_SECURITY_STATE_DIR: resolve(stateDirectory),\n };\n for (const key of [\n \"SYSTEMROOT\",\n \"WINDIR\",\n \"PATHEXT\",\n \"TMPDIR\",\n \"TEMP\",\n \"TMP\",\n ])\n if (process.env[key] !== undefined) environment[key] = process.env[key]!;\n return environment;\n}\n\nexport interface HostedScanOptions {\n executor: ScanExecutor;\n /** @deprecated Automatic owner reports validate scan hints without additional inference. */\n ownerCodex?: {\n startThread(options: { model?: string; modelReasoningEffort?: string }): {\n run(\n input: string,\n options: { outputSchema?: unknown; signal?: AbortSignal },\n ): Promise<{ finalResponse: string }>;\n };\n };\n signal?: AbortSignal;\n onEvent?: (event: ScanExecutionEvent) => void;\n}\n\n/** One invocation, with only scan-domain state. The host decides retry/reconciliation. */\nexport async function runHostedScan(\n value: HostedScanInput,\n options: HostedScanOptions,\n) {\n const input = HostedScanInputSchema.parse(value);\n const context = await prepareHostedScan(input, options.signal);\n let execution: ScanExecutionResult | undefined;\n let request: ScanExecutionRequest | undefined;\n let scanId: string | undefined;\n const onEvent = (event: ScanExecutionEvent): void => {\n void Promise.resolve()\n .then(() => options.onEvent?.(event))\n .catch(() => {});\n };\n const client = new CodexSecurity(\n {\n codexOverrides: {\n model: input.model,\n model_reasoning_effort: input.reasoningEffort,\n },\n },\n {\n environment: hostedScanEnvironment(input.stateDirectory),\n hostedScan: {\n context,\n executor: {\n async run(value, runOptions) {\n request = value;\n execution = await options.executor.run(value, runOptions);\n return execution;\n },\n },\n onEvent,\n },\n createCodex() {\n throw new Error(\"Local inference is unavailable in hosted mode.\");\n },\n },\n { surface: \"sdk\" },\n );\n let outputDirectory = resolve(input.outputDirectory);\n const base = () => ({\n version: 2 as const,\n ...context,\n outputDirectory,\n ...(scanId === undefined ? {} : { scanId }),\n ...(request === undefined\n ? {}\n : {\n pluginVersion: request.runtime.pluginVersion,\n }),\n provenance: {\n cliVersion: VERSION,\n buildId: input.identity.buildId,\n ...(request === undefined\n ? {}\n : { pluginVersion: request.runtime.pluginVersion }),\n },\n ...(execution === undefined ? {} : { execution }),\n });\n try {\n const result = await client.run(context.repository, {\n target:\n context.scope.paths[0] === \".\"\n ? \"repository\"\n : context.scope.paths.map((path) => `./${path}`),\n mode: \"standard\",\n outputDir: outputDirectory,\n signal: options.signal,\n ownerSuggestions: input.ownerSuggestions,\n onOutputDirReady(path) {\n outputDirectory = path;\n },\n onScanRegistered(scan) {\n scanId = scan.scanId;\n outputDirectory = scan.scanDir;\n },\n onProgress(progress) {\n onEvent({ type: \"progress\", progress });\n },\n onActivity(activity) {\n onEvent({ type: \"activity\", activity });\n },\n });\n if (\n result.manifest.scan.target.revision !== context.revision ||\n // Owner cancellation cannot invalidate an already sealed base scan.\n (await repositoryRevision(context.repository)) !== context.revision\n )\n throw new Error(\n \"Checkout changed from the frozen revision during execution.\",\n );\n if (\n !isDeepStrictEqual(\n [...result.manifest.scan.scope.includePaths].sort(comparePaths),\n context.scope.paths,\n ) ||\n result.manifest.scan.scope.excludePaths.length !== 0\n )\n throw new Error(\"Completed artifacts do not match the requested scope.\");\n const sources = result.manifest.scan[\"preservedSources\"];\n const sealedDigests = validatedFileDigests.get(result.manifest)!;\n const names = new Set([\n \"scan-manifest.json\",\n \"findings.json\",\n \"report.md\",\n ...result.manifest.scan.artifacts.map(({ path }) => path),\n ...(isRecord(sources) ? Object.keys(sources) : []),\n ]);\n if (result.ownerSuggestionsPath !== undefined)\n names.add(\"owner-suggestions.json\");\n const artifacts = await Promise.all(\n [...names].sort().map(async (path) => {\n const contents = await readScanFile(outputDirectory, path, path);\n return {\n path,\n sha256: hash(\"sha256\", contents),\n bytes: contents.byteLength,\n };\n }),\n );\n // Report a seal mismatch after the concurrent reads have closed their files.\n for (const { path, sha256 } of artifacts) {\n const expected = sealedDigests.get(path);\n if (expected !== undefined && expected !== sha256) {\n throw new Error(\n `The sealed file ${path} changed before the hosted receipt was created.`,\n );\n }\n }\n return {\n ...base(),\n status: \"completed\" as const,\n ...(result.ownerSuggestionsError === undefined\n ? {}\n : { ownerSuggestionsError: result.ownerSuggestionsError }),\n artifacts,\n };\n } catch (error) {\n if (error instanceof ScanExecutionError) execution = error.result;\n return {\n ...base(),\n status:\n execution?.status === \"acceptance_unknown\"\n ? (\"acceptance_unknown\" as const)\n : options.signal?.aborted ||\n execution?.status === \"canceled\" ||\n error instanceof ScanInterruptedError\n ? (\"canceled\" as const)\n : (\"failed\" as const),\n error: errorMessage(error),\n artifacts: [],\n };\n } finally {\n try {\n await client.close();\n } catch (error) {\n onEvent({\n type: \"activity\",\n activity: {\n id: \"runtime.cleanup\",\n kind: \"message\",\n status: \"failed\",\n description: `Hosted scan cleanup failed: ${errorMessage(error)}`,\n paths: [],\n },\n });\n }\n }\n}\n\nexport type HostedScanResult = Awaited<ReturnType<typeof runHostedScan>>;\n"]}
1
+ {"version":3,"file":"hosted-scan.js","sourceRoot":"","sources":["../src/hosted-scan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AACnC,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACL,YAAY,EACZ,aAAa,EACb,oBAAoB,GACrB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AACvC,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EACL,kBAAkB,GAKnB,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5C,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AACjE,OAAO,EACL,SAAS,EACT,mBAAmB,EACnB,kBAAkB,GACnB,MAAM,cAAc,CAAC;AACtB,OAAO,EAAE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B;oBACvC,CAAC,CAAE,UAAoB;oBACvB,CAAC,CAAE,QAAkB;YAC3B,KAAK,EAAE,YAAY,CAAC,KAAK,CAAC;YAC1B,SAAS,EAAE,EAAE;SACd,CAAC;IACJ,CAAC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;QACvB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,CAAC;gBACN,IAAI,EAAE,UAAU;gBAChB,QAAQ,EAAE;oBACR,EAAE,EAAE,iBAAiB;oBACrB,IAAI,EAAE,SAAS;oBACf,MAAM,EAAE,QAAQ;oBAChB,WAAW,EAAE,+BAA+B,YAAY,CAAC,KAAK,CAAC,EAAE;oBACjE,KAAK,EAAE,EAAE;iBACV;aACF,CAAC,CAAC;QACL,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { hash } from \"node:crypto\";\nimport { isDeepStrictEqual } from \"node:util\";\nimport {\n readScanFile,\n safeScopePath,\n validatedFileDigests,\n} from \"./contract.js\";\nimport { isRecord } from \"./record.js\";\nimport { VERSION } from \"./version.js\";\nimport {\n ScanExecutionError,\n type ScanExecutor,\n type ScanExecutionResult,\n type ScanExecutionEvent,\n type ScanExecutionRequest,\n} from \"./scan-executor.js\";\nexport type { ScanExecutor, ScanExecutionRequest } from \"./scan-executor.js\";\nimport { realpath } from \"node:fs/promises\";\nimport { isAbsolute, relative, resolve, sep } from \"node:path\";\nimport { z } from \"zod\";\nimport { CodexSecurity } from \"./api.js\";\nimport { severityRubricSnapshotSchema } from \"./classify-severity-records.js\";\nimport { ScanInterruptedError, errorMessage } from \"./errors.js\";\nimport {\n abortable,\n normalizeRepository,\n repositoryRevision,\n} from \"./targets.js\";\nimport { isWithin } from \"./trusted-executable.js\";\n\n/** Hosted v2 mirrors repository/paths targets; only Standard scans are supported. */\nexport const HostedScanInputSchema = z.strictObject({\n version: z.literal(2),\n repository: z.string().min(1),\n revision: z.string().regex(/^(?:[a-f0-9]{40}|[a-f0-9]{64})$/),\n scope: z\n .strictObject({ paths: z.array(z.string().min(1)).min(1) })\n .optional(),\n outputDirectory: z.string().min(1),\n stateDirectory: z.string().min(1),\n model: z.string().min(1),\n reasoningEffort: z.string(),\n severityRubric: severityRubricSnapshotSchema\n .refine(\n ({ markdown, sha256 }) => hash(\"sha256\", markdown) === sha256,\n \"Rubric SHA-256 does not match its exact UTF-8 Markdown.\",\n )\n .optional(),\n ownerSuggestions: z.boolean().optional(),\n identity: z.strictObject({\n runId: z.string().min(1),\n attemptId: z.string().min(1),\n buildId: z.string().min(1),\n }),\n});\n\nexport type HostedScanInput = z.infer<typeof HostedScanInputSchema>;\nexport class HostedScanPreparationError extends Error {\n constructor(\n readonly reason:\n | \"scope_syntax\"\n | \"scope_missing\"\n | \"scope_outside_repository\"\n | \"scope_alias\"\n | \"revision_mismatch\",\n message: string,\n ) {\n super(message);\n this.name = \"HostedScanPreparationError\";\n }\n}\n\nexport function normalizeHostedScope(path: string): string {\n const parts = path.split(process.platform === \"win32\" ? /[/\\\\]/ : \"/\");\n if (\n path.length === 0 ||\n path.includes(\"\\0\") ||\n isAbsolute(path) ||\n (process.platform === \"win32\" && /^[a-z]:/i.test(path)) ||\n parts.includes(\"..\")\n ) {\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n \"Use non-empty repository-relative folders or files without parent traversal or NUL characters.\",\n );\n }\n const normalized = parts\n .filter((part) => part !== \"\" && part !== \".\")\n .join(\"/\");\n try {\n return safeScopePath(normalized || \".\");\n } catch {\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n `${JSON.stringify(path)} cannot be used as scan scope: the output contract requires UTF-8 repository-relative paths without drive prefixes, backslashes, or control characters.`,\n );\n }\n}\n\nfunction comparePaths(left: string, right: string): number {\n return Buffer.compare(Buffer.from(left), Buffer.from(right));\n}\n\nexport function normalizeHostedPaths(\n paths: readonly string[] = [\".\"],\n): string[] {\n if (paths.length === 0)\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n \"An explicit path scope must not be empty. Omit scope to scan the repository.\",\n );\n const normalized = [...new Set(paths.map(normalizeHostedScope))].sort(\n comparePaths,\n );\n if (normalized.length > 1 && normalized.includes(\".\"))\n throw new HostedScanPreparationError(\n \"scope_syntax\",\n \"Repository scope cannot be mixed with narrower paths.\",\n );\n return normalized;\n}\n\n/** Validate every path at the frozen commit before registering a scan/executing. */\nasync function prepareHostedRepository(\n input: Pick<ScanExecutionRequest, \"repository\" | \"revision\" | \"scope\">,\n signal?: AbortSignal,\n) {\n const repository = await normalizeRepository(input.repository, signal);\n if ((await repositoryRevision(repository, signal)) !== input.revision)\n throw new HostedScanPreparationError(\n \"revision_mismatch\",\n \"Checkout does not match the frozen revision.\",\n );\n for (const path of input.scope.paths) {\n const selected = resolve(repository, path);\n let target: string;\n try {\n target = await abortable(() => realpath(selected), signal);\n } catch (error) {\n if (\n (signal?.aborted && error === signal.reason) ||\n !(error instanceof Error) ||\n !(\"code\" in error) ||\n error.code !== \"ENOENT\"\n )\n throw error;\n throw new HostedScanPreparationError(\n \"scope_missing\",\n `${path} does not exist at the selected revision. Update the paths and start a new scan.`,\n );\n }\n if (!isWithin(repository, target))\n throw new HostedScanPreparationError(\n \"scope_outside_repository\",\n `${path} resolves outside the repository.`,\n );\n if (target !== selected) {\n const canonical =\n relative(repository, target).split(sep).join(\"/\") || \".\";\n throw new HostedScanPreparationError(\n \"scope_alias\",\n `${path} resolves to ${canonical}. Use the canonical repository path and start a new scan.`,\n );\n }\n }\n return repository;\n}\n\nfunction hostedScanEnvironment(stateDirectory: string): Record<string, string> {\n const environment: Record<string, string> = {\n PATH: process.env[\"PATH\"] ?? \"\",\n CODEX_SECURITY_STATE_DIR: resolve(stateDirectory),\n };\n for (const key of [\n \"SYSTEMROOT\",\n \"WINDIR\",\n \"PATHEXT\",\n \"TMPDIR\",\n \"TEMP\",\n \"TMP\",\n ])\n if (process.env[key] !== undefined) environment[key] = process.env[key]!;\n return environment;\n}\n\nexport interface HostedScanOptions {\n executor: ScanExecutor;\n /** @deprecated Automatic owner reports validate scan hints without additional inference. */\n ownerCodex?: {\n startThread(options: { model?: string; modelReasoningEffort?: string }): {\n run(\n input: string,\n options: { outputSchema?: unknown; signal?: AbortSignal },\n ): Promise<{ finalResponse: string }>;\n };\n };\n signal?: AbortSignal;\n onEvent?: (event: ScanExecutionEvent) => void;\n}\n\n/** One invocation, with only scan-domain state. The host decides retry/reconciliation. */\nexport async function runHostedScan(\n value: HostedScanInput,\n options: HostedScanOptions,\n) {\n const input = HostedScanInputSchema.parse(value);\n const context = {\n repository: input.repository,\n revision: input.revision,\n scope: { paths: normalizeHostedPaths(input.scope?.paths) },\n identity: input.identity,\n ...(input.severityRubric === undefined\n ? {}\n : { severityRubric: input.severityRubric }),\n };\n let execution: ScanExecutionResult | undefined;\n let request: ScanExecutionRequest | undefined;\n let scanId: string | undefined;\n let outputDirectory = resolve(input.outputDirectory);\n const base = () => ({\n version: 2 as const,\n ...context,\n outputDirectory,\n ...(scanId === undefined ? {} : { scanId }),\n ...(request === undefined\n ? {}\n : {\n pluginVersion: request.runtime.pluginVersion,\n }),\n provenance: {\n cliVersion: VERSION,\n buildId: input.identity.buildId,\n ...(request === undefined\n ? {}\n : { pluginVersion: request.runtime.pluginVersion }),\n },\n ...(execution === undefined ? {} : { execution }),\n });\n try {\n context.repository = await prepareHostedRepository(context, options.signal);\n } catch (error) {\n if (\n options.signal?.aborted &&\n (Object.is(error, options.signal.reason) ||\n (error instanceof DOMException && error.name === \"AbortError\"))\n )\n return {\n ...base(),\n status: \"canceled\" as const,\n error: `Canceled before checkout verification finished: ${errorMessage(error)}`,\n artifacts: [],\n };\n throw error;\n }\n const onEvent = (event: ScanExecutionEvent): void => {\n void Promise.resolve()\n .then(() => options.onEvent?.(event))\n .catch(() => {});\n };\n const client = new CodexSecurity(\n {\n codexOverrides: {\n model: input.model,\n model_reasoning_effort: input.reasoningEffort,\n },\n },\n {\n environment: hostedScanEnvironment(input.stateDirectory),\n hostedScan: {\n context,\n executor: {\n async run(value, runOptions) {\n request = value;\n execution = await options.executor.run(value, runOptions);\n return execution;\n },\n },\n onEvent,\n },\n createCodex() {\n throw new Error(\"Local inference is unavailable in hosted mode.\");\n },\n },\n { surface: \"sdk\" },\n );\n try {\n const result = await client.run(context.repository, {\n target:\n context.scope.paths[0] === \".\"\n ? \"repository\"\n : context.scope.paths.map((path) => `./${path}`),\n mode: \"standard\",\n outputDir: outputDirectory,\n signal: options.signal,\n ownerSuggestions: input.ownerSuggestions,\n onOutputDirReady(path) {\n outputDirectory = path;\n },\n onScanRegistered(scan) {\n scanId = scan.scanId;\n outputDirectory = scan.scanDir;\n },\n onProgress(progress) {\n onEvent({ type: \"progress\", progress });\n },\n onActivity(activity) {\n onEvent({ type: \"activity\", activity });\n },\n });\n if (\n result.manifest.scan.target.revision !== context.revision ||\n // Owner cancellation cannot invalidate an already sealed base scan.\n (await repositoryRevision(context.repository)) !== context.revision\n )\n throw new Error(\n \"Checkout changed from the frozen revision during execution.\",\n );\n if (\n !isDeepStrictEqual(\n [...result.manifest.scan.scope.includePaths].sort(comparePaths),\n context.scope.paths,\n ) ||\n result.manifest.scan.scope.excludePaths.length !== 0\n )\n throw new Error(\"Completed artifacts do not match the requested scope.\");\n const sources = result.manifest.scan[\"preservedSources\"];\n const sealedDigests = validatedFileDigests.get(result.manifest)!;\n const names = new Set([\n \"scan-manifest.json\",\n \"findings.json\",\n \"report.md\",\n ...result.manifest.scan.artifacts.map(({ path }) => path),\n ...(isRecord(sources) ? Object.keys(sources) : []),\n ]);\n if (result.ownerSuggestionsPath !== undefined)\n names.add(\"owner-suggestions.json\");\n const artifacts = await Promise.all(\n [...names].sort().map(async (path) => {\n const contents = await readScanFile(outputDirectory, path, path);\n return {\n path,\n sha256: hash(\"sha256\", contents),\n bytes: contents.byteLength,\n };\n }),\n );\n // Report a seal mismatch after the concurrent reads have closed their files.\n for (const { path, sha256 } of artifacts) {\n const expected = sealedDigests.get(path);\n if (expected !== undefined && expected !== sha256) {\n throw new Error(\n `The sealed file ${path} changed before the hosted receipt was created.`,\n );\n }\n }\n return {\n ...base(),\n status: \"completed\" as const,\n ...(result.ownerSuggestionsError === undefined\n ? {}\n : { ownerSuggestionsError: result.ownerSuggestionsError }),\n artifacts,\n };\n } catch (error) {\n if (error instanceof ScanExecutionError) execution = error.result;\n return {\n ...base(),\n status:\n execution?.status === \"acceptance_unknown\"\n ? (\"acceptance_unknown\" as const)\n : options.signal?.aborted ||\n execution?.status === \"canceled\" ||\n error instanceof ScanInterruptedError\n ? (\"canceled\" as const)\n : (\"failed\" as const),\n error: errorMessage(error),\n artifacts: [],\n };\n } finally {\n try {\n await client.close();\n } catch (error) {\n onEvent({\n type: \"activity\",\n activity: {\n id: \"runtime.cleanup\",\n kind: \"message\",\n status: \"failed\",\n description: `Hosted scan cleanup failed: ${errorMessage(error)}`,\n paths: [],\n },\n });\n }\n }\n}\n\nexport type HostedScanResult = Awaited<ReturnType<typeof runHostedScan>>;\n"]}
package/dist/index.d.ts CHANGED
@@ -12,6 +12,7 @@ export { loadProjectConfig, resolveProjectConfig } from "./project-config.js";
12
12
  export type { ResolvedProjectConfig, ProjectConfigProvenance, } from "./project-config.js";
13
13
  export type { ProjectConfigInput, ProjectScope, } from "./project-config-schema.js";
14
14
  export type { ScanSettings } from "./scan-settings.js";
15
+ export type { SeverityRubricSnapshot } from "./severity-rubric.js";
15
16
  export { classifySeverity } from "./classify-severity.js";
16
17
  export { suggestOwners, suggestOwnersFromScan } from "./suggest-owners.js";
17
18
  export type { OwnerFinding, CodeownerIdentity, OwnerIdentity, OwnerSuggestion, OwnerSuggestions, SuggestOwnersOptions, } from "./suggest-owners.js";
@@ -82,8 +83,14 @@ export { validateRecords } from "./validation-records.js";
82
83
  export type { ValidateRecordsInput, ValidateRecordsOptions, ValidationReviewRequest, } from "./validation-records.js";
83
84
  export { prepareLocalExternalImport } from "./external-findings-import.js";
84
85
  export { normalizeOpenGrepFindings, readOpenGrepFindings, type OpenGrepImportOptions, } from "./opengrep-findings.js";
86
+ export { readSonarFindings, type SonarCapture } from "./sonar-findings.js";
87
+ export { collectSonarIssues, type SonarCollectionOptions, } from "./sonar-collector.js";
88
+ export { normalizeVeracodeFindings, readVeracodeFindings, } from "./veracode-findings.js";
89
+ export { normalizeBlackDuckFindings, readBlackDuckFindings, } from "./blackduck-findings.js";
90
+ export { normalizeContinuumFindings, readContinuumFindings, } from "./continuum-findings.js";
85
91
  export { normalizeInspectorFindings, readInspectorFindings, } from "./inspector-findings.js";
86
92
  export { normalizeSnykFindingsExport, normalizeSnykJson, normalizeSnykSarif, readSnykFindings, } from "./snyk-findings.js";
93
+ export { normalizeSelectedSemgrepPlatformFindings } from "./semgrep-platform-findings.js";
87
94
  export { normalizeSemgrepFindings, normalizeSemgrepSarif, readSemgrepFindings, type SemgrepImportOptions, } from "./semgrep-findings.js";
88
95
  export { normalizeEndorFindings, normalizeEndorSarif, readEndorFindings, } from "./endor-findings.js";
89
96
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,YAAY,EACV,qBAAqB,EACrB,oBAAoB,GACrB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AACjC,YAAY,EACV,sBAAsB,EACtB,wBAAwB,EACxB,uBAAuB,EACvB,mBAAmB,EACnB,2BAA2B,EAC3B,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAChF,YAAY,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC1E,OA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ACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,wCAAwC,EAAE,MAAM,gCAAgC,CAAC;AAC1F,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,EACnB,KAAK,oBAAoB,GAC1B,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC"}
package/dist/index.js CHANGED
@@ -34,8 +34,14 @@ export { classifySeverityRecords, classifySeverityRecordsInputSchema, } from "./
34
34
  export { validateRecords } from "./validation-records.js";
35
35
  export { prepareLocalExternalImport } from "./external-findings-import.js";
36
36
  export { normalizeOpenGrepFindings, readOpenGrepFindings, } from "./opengrep-findings.js";
37
+ export { readSonarFindings } from "./sonar-findings.js";
38
+ export { collectSonarIssues, } from "./sonar-collector.js";
39
+ export { normalizeVeracodeFindings, readVeracodeFindings, } from "./veracode-findings.js";
40
+ export { normalizeBlackDuckFindings, readBlackDuckFindings, } from "./blackduck-findings.js";
41
+ export { normalizeContinuumFindings, readContinuumFindings, } from "./continuum-findings.js";
37
42
  export { normalizeInspectorFindings, readInspectorFindings, } from "./inspector-findings.js";
38
43
  export { normalizeSnykFindingsExport, normalizeSnykJson, normalizeSnykSarif, readSnykFindings, } from "./snyk-findings.js";
44
+ export { normalizeSelectedSemgrepPlatformFindings } from "./semgrep-platform-findings.js";
39
45
  export { normalizeSemgrepFindings, normalizeSemgrepSarif, readSemgrepFindings, } from "./semgrep-findings.js";
40
46
  export { normalizeEndorFindings, normalizeEndorSarif, readEndorFindings, } from "./endor-findings.js";
41
47
  //# sourceMappingURL=index.js.map
package/dist/index.js.map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tB,OAAO,EAAE,sBAAsB,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAE/D,OAAO,EACL,uBAAuB,EACvB,kCAAkC,GACnC,MAAM,gCAAgC,CAAC;AAQxC,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAO1D,OAAO,EAAE,0BAA0B,EAAE,MAAM,+BAA+B,CAAC;AAC3E,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GAErB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACL,2BAA2B,EAC3B,iBAAiB,EACjB,kBAAkB,EAClB,gBAAgB,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC","sourcesContent":["export { exportArtifact } from \"./artifact-export.js\";\nexport type {\n ExportArtifactOptions,\n ArtifactExportResult,\n} from \"./artifact-export.js\";\nexport { CodexSecurity, createSecurity } from \"./api.js\";\nexport {\n runHostedRemediation,\n HostedRemediationInputSchema,\n HostedRemediationPreparationError,\n} from \"./hosted-remediation.js\";\nexport type {\n HostedRemediationInput,\n HostedRemediationOptions,\n HostedRemediationResult,\n RemediationExecutor,\n RemediationExecutionRequest,\n RemediationExecutionResult,\n RemediationExecutionEvent,\n} from \"./hosted-remediation.js\";\nexport { runHostedRemediationProtocol } from \"./hosted-remediation-protocol.js\";\nexport type { FindingPatch, FindingVerification } from \"./remediation.js\";\nexport {\n runHostedScan,\n HostedScanInputSchema,\n HostedScanPreparationError,\n} from \"./hosted-scan.js\";\nexport type {\n HostedScanInput,\n HostedScanOptions,\n HostedScanResult,\n} from \"./hosted-scan.js\";\nexport type {\n ScanExecutor,\n ScanExecutionRequest,\n ScanExecutionResult,\n ScanExecutionEvent,\n} from \"./scan-executor.js\";\nexport { loadProjectConfig, resolveProjectConfig } from \"./project-config.js\";\nexport type {\n ResolvedProjectConfig,\n ProjectConfigProvenance,\n} from \"./project-config.js\";\nexport type {\n ProjectConfigInput,\n ProjectScope,\n} from \"./project-config-schema.js\";\nexport type { ScanSettings } from \"./scan-settings.js\";\nexport { classifySeverity } from \"./classify-severity.js\";\nexport { suggestOwners, suggestOwnersFromScan } from \"./suggest-owners.js\";\nexport type {\n OwnerFinding,\n CodeownerIdentity,\n OwnerIdentity,\n OwnerSuggestion,\n OwnerSuggestions,\n SuggestOwnersOptions,\n} from \"./suggest-owners.js\";\nexport type {\n ClassifySeverityOptions,\n SeverityClassificationFinding,\n SeverityClassification,\n SeverityAssessment,\n} from \"./classify-severity.js\";\nexport {\n classifyScanSeverity,\n classifyScanDirectorySeverity,\n} from \"./classify-scan-severity.js\";\nexport type {\n ClassifyScanSeverityOptions,\n ScanSeverityClassification,\n} from \"./classify-scan-severity.js\";\nexport { runComponentScans } from \"./component-scan.js\";\nexport type {\n ComponentDeduplicationSummary,\n ComponentReceipt,\n ComponentScanOptions,\n ComponentScanEvent,\n ComponentScanResult,\n} from \"./component-scan.js\";\nexport { normalizeComponentPlan, planComponents } from \"./component-plan.js\";\nexport type {\n ComponentPlan,\n ComponentPlanningOptions,\n} from \"./component-plan.js\";\nexport { estimateScanCost } from \"./cost.js\";\nexport type {\n ScanAccountRateLimit,\n ScanAccountRateLimitWindow,\n ScanCost,\n ScanSessionEvent,\n ScanUsageObservation,\n ScanWorkerEvent,\n} from \"./cost.js\";\nexport type { ScanTokenUsage } from \"./cost-model.js\";\nexport type { DeepScanProgress } from \"./scan-progress.js\";\nexport type { CustomValidationResult } from \"./custom-validation.js\";\nexport type { ScanActivity, ScanActivityStatus } from \"./scan-activity.js\";\nexport { matchScanFindings } from \"./scan-comparison.js\";\nexport type {\n ScanComparisonInput,\n ScanComparisonOptions,\n ScanComparisonProgress,\n ScanComparisonResult,\n} from \"./scan-comparison.js\";\nexport type {\n CodexSecurityMetadata,\n DeepScanOptions,\n PatchOptions,\n PatchResult,\n ScanAuthMode,\n ScanAuthentication,\n ScanBudget,\n ScanOptions,\n ScanPreflight,\n ScanReconnectDetails,\n ScanTrustedAccessStatus,\n ScanWarningDetails,\n ValidationOptions,\n ValidationResult,\n} from \"./api.js\";\nexport type {\n ScanPhase,\n ScanProgress,\n ScanWorkerPhase,\n ScanWorkerStatus,\n} from \"./worker-progress.js\";\nexport { CodexLoginHandle } from \"./auth.js\";\nexport type { AccountStatus, LoginResult } from \"./auth.js\";\n\nexport {\n AuthenticationRequiredError,\n CodexSecurityError,\n ConfigurationError,\n ContractValidationError,\n DeduplicationReviewError,\n IncompleteScanError,\n InvalidTargetError,\n LocalPluginBootstrapError,\n OutputDirectoryError,\n OutputDirectoryNotEmptyError,\n OutputInsideProtectedRootError,\n PluginBootstrapError,\n PluginPythonUnavailableError,\n SandboxUnavailableError,\n ScanCostLimitExceededError,\n ScanInterruptedError,\n} from \"./errors.js\";\nexport type {\n DeduplicationReviewFailureCategory,\n DeduplicationReviewFailureMetadata,\n DeduplicationReviewStage,\n ProtectedScanPathKind,\n} from \"./errors.js\";\nexport {\n DEFAULT_CODEX_CONFIG,\n mergedCodexConfig,\n writeCodexConfig,\n} from \"./config.js\";\nexport type { CodexSecurityConfig, JsonObject, JsonValue } from \"./config.js\";\nexport { loadContract, requireScanFile } from \"./contract.js\";\nexport type { LoadedContract, ScanExpectation } from \"./contract.js\";\nexport type * from \"./models.js\";\nexport {\n resolveSecurityPolicyTarget,\n securityPolicyDiff,\n} from \"./security-policy.js\";\nexport type {\n SecurityPolicyDraft,\n SecurityPolicyOptions,\n SecurityPolicyPreflight,\n SecurityPolicyStage,\n SecurityPolicyTarget,\n} from \"./security-policy.js\";\nexport { checkScanPublication, publishScan } from \"./publish.js\";\nexport { publishScanToCustom } from \"./custom-publish.js\";\nexport type {\n PublishScanToCustomOptions,\n CustomPublicationResult,\n} from \"./custom-publish.js\";\nexport { deduplicateRecords } from \"./deduplication/records.js\";\nexport type {\n DeduplicateRecordsInput,\n DeduplicateRecordsOptions,\n DeduplicateRecordsResult,\n} from \"./deduplication/records.js\";\nexport type {\n DeduplicationReviewRequest,\n DeduplicationReviewAttribution,\n DeduplicationReviewRunner,\n} from \"./deduplication/review.js\";\nexport {\n deduplicateScan,\n deduplicateScanDirectory,\n} from \"./deduplication/scan.js\";\nexport type {\n DeduplicateScanDirectoryOptions,\n DeduplicateScanOptions,\n DeduplicateScanResult,\n} from \"./deduplication/scan.js\";\nexport type { DeduplicationRefusal } from \"./deduplication/deduplication.js\";\nexport type { FindingEmbeddingBinding } from \"./deduplication/local.js\";\nexport type {\n DeduplicationDiagnostic,\n DeduplicationDiagnosticObserver,\n} from \"./deduplication/diagnostics.js\";\nexport type { FindingEmbedder } from \"./server/embeddings.js\";\nexport {\n ExternalPublicationError,\n prepareExternalPublication,\n prepareNormalizedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport type {\n ExternalPublicationOptions,\n NormalizedExternalPublicationOptions,\n ExternalPublicationDependencies,\n ExternalPublicationPreview,\n ExternalPublicationProgress,\n ExternalPublicationResult,\n PreparedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport {\n prepareNormalizedLocalImport,\n listLocalExternalFindings,\n} from \"./external-findings-local.js\";\nexport type {\n StoredExternalFinding,\n NormalizedLocalImportOptions,\n LocalExternalImportDependencies,\n LocalExternalImportPreview,\n LocalExternalImportResult,\n PreparedLocalExternalImport,\n} from \"./external-findings-local.js\";\nexport type {\n ExternalFinding,\n ExternalFindings,\n ExternalSourceRepository,\n} from \"./external-findings.js\";\nexport type {\n ExternalFindingEvidence,\n FindingImportRequest,\n FindingImportReceipt,\n ImportRepository,\n SourceReport,\n} from \"./external-import-models.js\";\nexport {\n normalizeGitHubCodeScanningAlerts,\n normalizeGitHubAdvisories,\n readGitHubFindings,\n} from \"./github-findings.js\";\nexport { importGitHubAdvisories } from \"./github-advisories.js\";\nexport { normalizeGitHubDependabotAlerts } from \"./github-dependabot-findings.js\";\nexport type {\n GitHubAdvisoryImportOptions,\n ImportedGitHubAdvisory,\n} from \"./github-advisories.js\";\nexport { importGitHubCodeScanningAlerts } from \"./github.js\";\nexport type {\n GitHubCodeScanningImportOptions,\n ImportedGitHubCodeScanningAlert,\n} from \"./github.js\";\nexport type {\n CheckScanPublicationOptions,\n CheckScanPublicationResult,\n PublishScanOptions,\n PublishScanProgress,\n PublishScanResult,\n} from \"./publish.js\";\nexport { ScanResult } from \"./result.js\";\nexport type {\n RepositoryFinding,\n ScanResultOptions,\n TurnResultMetadata,\n} from \"./result.js\";\nexport {\n bootstrapPlugin,\n bundledPluginRoot,\n cleanupSdkDirectory,\n createIsolatedHome,\n createMarketplace,\n extractPluginZip,\n importAmbientAuth,\n MARKETPLACE_NAME,\n pluginExecutionEnvironment,\n pluginMetadata,\n PLUGIN_NAME,\n prepareOutputDir,\n resolveCodexCommand,\n resolvePluginPath,\n resolvePluginPython,\n validateOutputDir,\n} from \"./runtime.js\";\nexport type {\n CodexCommand,\n PluginInstall,\n PluginPythonOptions,\n ProcessEnvironment,\n} from \"./runtime.js\";\nexport {\n DiffTarget,\n normalizeRepository,\n normalizeTarget,\n repositoryRevision,\n validateMode,\n} from \"./targets.js\";\nexport type { NormalizedTarget, ScanMode, ScanTarget } from \"./targets.js\";\nexport type { AbsolutePath } from \"./config-path.js\";\nexport { BUNDLED_PLUGIN_VERSION, VERSION } from \"./version.js\";\n\nexport {\n classifySeverityRecords,\n classifySeverityRecordsInputSchema,\n} from \"./classify-severity-records.js\";\nexport type {\n ClassifySeverityRecordsInput,\n ClassifySeverityRecordsOptions,\n ClassifySeverityRecordsResult,\n CanonicalSeverityAssessment,\n SeverityClassificationReviewRequest,\n} from \"./classify-severity-records.js\";\nexport { validateRecords } from \"./validation-records.js\";\nexport type {\n ValidateRecordsInput,\n ValidateRecordsOptions,\n ValidationReviewRequest,\n} from \"./validation-records.js\";\n\nexport { prepareLocalExternalImport } from \"./external-findings-import.js\";\nexport {\n normalizeOpenGrepFindings,\n readOpenGrepFindings,\n type OpenGrepImportOptions,\n} from \"./opengrep-findings.js\";\nexport {\n normalizeInspectorFindings,\n readInspectorFindings,\n} from \"./inspector-findings.js\";\nexport {\n normalizeSnykFindingsExport,\n normalizeSnykJson,\n normalizeSnykSarif,\n readSnykFindings,\n} from \"./snyk-findings.js\";\nexport {\n normalizeSemgrepFindings,\n normalizeSemgrepSarif,\n readSemgrepFindings,\n type SemgrepImportOptions,\n} from \"./semgrep-findings.js\";\nexport {\n normalizeEndorFindings,\n normalizeEndorSarif,\n readEndorFindings,\n} from \"./endor-findings.js\";\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAKtD,OAAO,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AACzD,OAAO,EACL,oBAAoB,EACpB,4BAA4B,EAC5B,iCAAiC,GAClC,MAAM,yBAAyB,CAAC;AAUjC,OAAO,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC;AAEhF,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,kBAAkB,CAAC;AAY1B,OAAO,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,qBAAqB,CAAC;AAW9E,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC;AAe3E,OAAO,EACL,oBAAoB,EACpB,6BAA6B,GAC9B,MAAM,6BAA6B,CAAC;AAKrC,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAQxD,OAAO,EAAE,sBAAsB,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAK7E,OAAO,EAAE,gBAAgB,EAAE,MAAM,WA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AAC1F,OAAO,EACL,wBAAwB,EACxB,qBAAqB,EACrB,mBAAmB,GAEpB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,sBAAsB,EACtB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qBAAqB,CAAC","sourcesContent":["export { exportArtifact } from \"./artifact-export.js\";\nexport type {\n ExportArtifactOptions,\n ArtifactExportResult,\n} from \"./artifact-export.js\";\nexport { CodexSecurity, createSecurity } from \"./api.js\";\nexport {\n runHostedRemediation,\n HostedRemediationInputSchema,\n HostedRemediationPreparationError,\n} from \"./hosted-remediation.js\";\nexport type {\n HostedRemediationInput,\n HostedRemediationOptions,\n HostedRemediationResult,\n RemediationExecutor,\n RemediationExecutionRequest,\n RemediationExecutionResult,\n RemediationExecutionEvent,\n} from \"./hosted-remediation.js\";\nexport { runHostedRemediationProtocol } from \"./hosted-remediation-protocol.js\";\nexport type { FindingPatch, FindingVerification } from \"./remediation.js\";\nexport {\n runHostedScan,\n HostedScanInputSchema,\n HostedScanPreparationError,\n} from \"./hosted-scan.js\";\nexport type {\n HostedScanInput,\n HostedScanOptions,\n HostedScanResult,\n} from \"./hosted-scan.js\";\nexport type {\n ScanExecutor,\n ScanExecutionRequest,\n ScanExecutionResult,\n ScanExecutionEvent,\n} from \"./scan-executor.js\";\nexport { loadProjectConfig, resolveProjectConfig } from \"./project-config.js\";\nexport type {\n ResolvedProjectConfig,\n ProjectConfigProvenance,\n} from \"./project-config.js\";\nexport type {\n ProjectConfigInput,\n ProjectScope,\n} from \"./project-config-schema.js\";\nexport type { ScanSettings } from \"./scan-settings.js\";\nexport type { SeverityRubricSnapshot } from \"./severity-rubric.js\";\nexport { classifySeverity } from \"./classify-severity.js\";\nexport { suggestOwners, suggestOwnersFromScan } from \"./suggest-owners.js\";\nexport type {\n OwnerFinding,\n CodeownerIdentity,\n OwnerIdentity,\n OwnerSuggestion,\n OwnerSuggestions,\n SuggestOwnersOptions,\n} from \"./suggest-owners.js\";\nexport type {\n ClassifySeverityOptions,\n SeverityClassificationFinding,\n SeverityClassification,\n SeverityAssessment,\n} from \"./classify-severity.js\";\nexport {\n classifyScanSeverity,\n classifyScanDirectorySeverity,\n} from \"./classify-scan-severity.js\";\nexport type {\n ClassifyScanSeverityOptions,\n ScanSeverityClassification,\n} from \"./classify-scan-severity.js\";\nexport { runComponentScans } from \"./component-scan.js\";\nexport type {\n ComponentDeduplicationSummary,\n ComponentReceipt,\n ComponentScanOptions,\n ComponentScanEvent,\n ComponentScanResult,\n} from \"./component-scan.js\";\nexport { normalizeComponentPlan, planComponents } from \"./component-plan.js\";\nexport type {\n ComponentPlan,\n ComponentPlanningOptions,\n} from \"./component-plan.js\";\nexport { estimateScanCost } from \"./cost.js\";\nexport type {\n ScanAccountRateLimit,\n ScanAccountRateLimitWindow,\n ScanCost,\n ScanSessionEvent,\n ScanUsageObservation,\n ScanWorkerEvent,\n} from \"./cost.js\";\nexport type { ScanTokenUsage } from \"./cost-model.js\";\nexport type { DeepScanProgress } from \"./scan-progress.js\";\nexport type { CustomValidationResult } from \"./custom-validation.js\";\nexport type { ScanActivity, ScanActivityStatus } from \"./scan-activity.js\";\nexport { matchScanFindings } from \"./scan-comparison.js\";\nexport type {\n ScanComparisonInput,\n ScanComparisonOptions,\n ScanComparisonProgress,\n ScanComparisonResult,\n} from \"./scan-comparison.js\";\nexport type {\n CodexSecurityMetadata,\n DeepScanOptions,\n PatchOptions,\n PatchResult,\n ScanAuthMode,\n ScanAuthentication,\n ScanBudget,\n ScanOptions,\n ScanPreflight,\n ScanReconnectDetails,\n ScanTrustedAccessStatus,\n ScanWarningDetails,\n ValidationOptions,\n ValidationResult,\n} from \"./api.js\";\nexport type {\n ScanPhase,\n ScanProgress,\n ScanWorkerPhase,\n ScanWorkerStatus,\n} from \"./worker-progress.js\";\nexport { CodexLoginHandle } from \"./auth.js\";\nexport type { AccountStatus, LoginResult } from \"./auth.js\";\n\nexport {\n AuthenticationRequiredError,\n CodexSecurityError,\n ConfigurationError,\n ContractValidationError,\n DeduplicationReviewError,\n IncompleteScanError,\n InvalidTargetError,\n LocalPluginBootstrapError,\n OutputDirectoryError,\n OutputDirectoryNotEmptyError,\n OutputInsideProtectedRootError,\n PluginBootstrapError,\n PluginPythonUnavailableError,\n SandboxUnavailableError,\n ScanCostLimitExceededError,\n ScanInterruptedError,\n} from \"./errors.js\";\nexport type {\n DeduplicationReviewFailureCategory,\n DeduplicationReviewFailureMetadata,\n DeduplicationReviewStage,\n ProtectedScanPathKind,\n} from \"./errors.js\";\nexport {\n DEFAULT_CODEX_CONFIG,\n mergedCodexConfig,\n writeCodexConfig,\n} from \"./config.js\";\nexport type { CodexSecurityConfig, JsonObject, JsonValue } from \"./config.js\";\nexport { loadContract, requireScanFile } from \"./contract.js\";\nexport type { LoadedContract, ScanExpectation } from \"./contract.js\";\nexport type * from \"./models.js\";\nexport {\n resolveSecurityPolicyTarget,\n securityPolicyDiff,\n} from \"./security-policy.js\";\nexport type {\n SecurityPolicyDraft,\n SecurityPolicyOptions,\n SecurityPolicyPreflight,\n SecurityPolicyStage,\n SecurityPolicyTarget,\n} from \"./security-policy.js\";\nexport { checkScanPublication, publishScan } from \"./publish.js\";\nexport { publishScanToCustom } from \"./custom-publish.js\";\nexport type {\n PublishScanToCustomOptions,\n CustomPublicationResult,\n} from \"./custom-publish.js\";\nexport { deduplicateRecords } from \"./deduplication/records.js\";\nexport type {\n DeduplicateRecordsInput,\n DeduplicateRecordsOptions,\n DeduplicateRecordsResult,\n} from \"./deduplication/records.js\";\nexport type {\n DeduplicationReviewRequest,\n DeduplicationReviewAttribution,\n DeduplicationReviewRunner,\n} from \"./deduplication/review.js\";\nexport {\n deduplicateScan,\n deduplicateScanDirectory,\n} from \"./deduplication/scan.js\";\nexport type {\n DeduplicateScanDirectoryOptions,\n DeduplicateScanOptions,\n DeduplicateScanResult,\n} from \"./deduplication/scan.js\";\nexport type { DeduplicationRefusal } from \"./deduplication/deduplication.js\";\nexport type { FindingEmbeddingBinding } from \"./deduplication/local.js\";\nexport type {\n DeduplicationDiagnostic,\n DeduplicationDiagnosticObserver,\n} from \"./deduplication/diagnostics.js\";\nexport type { FindingEmbedder } from \"./server/embeddings.js\";\nexport {\n ExternalPublicationError,\n prepareExternalPublication,\n prepareNormalizedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport type {\n ExternalPublicationOptions,\n NormalizedExternalPublicationOptions,\n ExternalPublicationDependencies,\n ExternalPublicationPreview,\n ExternalPublicationProgress,\n ExternalPublicationResult,\n PreparedExternalPublication,\n} from \"./external-findings-publish.js\";\nexport {\n prepareNormalizedLocalImport,\n listLocalExternalFindings,\n} from \"./external-findings-local.js\";\nexport type {\n StoredExternalFinding,\n NormalizedLocalImportOptions,\n LocalExternalImportDependencies,\n LocalExternalImportPreview,\n LocalExternalImportResult,\n PreparedLocalExternalImport,\n} from \"./external-findings-local.js\";\nexport type {\n ExternalFinding,\n ExternalFindings,\n ExternalSourceRepository,\n} from \"./external-findings.js\";\nexport type {\n ExternalFindingEvidence,\n FindingImportRequest,\n FindingImportReceipt,\n ImportRepository,\n SourceReport,\n} from \"./external-import-models.js\";\nexport {\n normalizeGitHubCodeScanningAlerts,\n normalizeGitHubAdvisories,\n readGitHubFindings,\n} from \"./github-findings.js\";\nexport { importGitHubAdvisories } from \"./github-advisories.js\";\nexport { normalizeGitHubDependabotAlerts } from \"./github-dependabot-findings.js\";\nexport type {\n GitHubAdvisoryImportOptions,\n ImportedGitHubAdvisory,\n} from \"./github-advisories.js\";\nexport { importGitHubCodeScanningAlerts } from \"./github.js\";\nexport type {\n GitHubCodeScanningImportOptions,\n ImportedGitHubCodeScanningAlert,\n} from \"./github.js\";\nexport type {\n CheckScanPublicationOptions,\n CheckScanPublicationResult,\n PublishScanOptions,\n PublishScanProgress,\n PublishScanResult,\n} from \"./publish.js\";\nexport { ScanResult } from \"./result.js\";\nexport type {\n RepositoryFinding,\n ScanResultOptions,\n TurnResultMetadata,\n} from \"./result.js\";\nexport {\n bootstrapPlugin,\n bundledPluginRoot,\n cleanupSdkDirectory,\n createIsolatedHome,\n createMarketplace,\n extractPluginZip,\n importAmbientAuth,\n MARKETPLACE_NAME,\n pluginExecutionEnvironment,\n pluginMetadata,\n PLUGIN_NAME,\n prepareOutputDir,\n resolveCodexCommand,\n resolvePluginPath,\n resolvePluginPython,\n validateOutputDir,\n} from \"./runtime.js\";\nexport type {\n CodexCommand,\n PluginInstall,\n PluginPythonOptions,\n ProcessEnvironment,\n} from \"./runtime.js\";\nexport {\n DiffTarget,\n normalizeRepository,\n normalizeTarget,\n repositoryRevision,\n validateMode,\n} from \"./targets.js\";\nexport type { NormalizedTarget, ScanMode, ScanTarget } from \"./targets.js\";\nexport type { AbsolutePath } from \"./config-path.js\";\nexport { BUNDLED_PLUGIN_VERSION, VERSION } from \"./version.js\";\n\nexport {\n classifySeverityRecords,\n classifySeverityRecordsInputSchema,\n} from \"./classify-severity-records.js\";\nexport type {\n ClassifySeverityRecordsInput,\n ClassifySeverityRecordsOptions,\n ClassifySeverityRecordsResult,\n CanonicalSeverityAssessment,\n SeverityClassificationReviewRequest,\n} from \"./classify-severity-records.js\";\nexport { validateRecords } from \"./validation-records.js\";\nexport type {\n ValidateRecordsInput,\n ValidateRecordsOptions,\n ValidationReviewRequest,\n} from \"./validation-records.js\";\n\nexport { prepareLocalExternalImport } from \"./external-findings-import.js\";\nexport {\n normalizeOpenGrepFindings,\n readOpenGrepFindings,\n type OpenGrepImportOptions,\n} from \"./opengrep-findings.js\";\nexport { readSonarFindings, type SonarCapture } from \"./sonar-findings.js\";\nexport {\n collectSonarIssues,\n type SonarCollectionOptions,\n} from \"./sonar-collector.js\";\nexport {\n normalizeVeracodeFindings,\n readVeracodeFindings,\n} from \"./veracode-findings.js\";\nexport {\n normalizeBlackDuckFindings,\n readBlackDuckFindings,\n} from \"./blackduck-findings.js\";\nexport {\n normalizeContinuumFindings,\n readContinuumFindings,\n} from \"./continuum-findings.js\";\nexport {\n normalizeInspectorFindings,\n readInspectorFindings,\n} from \"./inspector-findings.js\";\nexport {\n normalizeSnykFindingsExport,\n normalizeSnykJson,\n normalizeSnykSarif,\n readSnykFindings,\n} from \"./snyk-findings.js\";\nexport { normalizeSelectedSemgrepPlatformFindings } from \"./semgrep-platform-findings.js\";\nexport {\n normalizeSemgrepFindings,\n normalizeSemgrepSarif,\n readSemgrepFindings,\n type SemgrepImportOptions,\n} from \"./semgrep-findings.js\";\nexport {\n normalizeEndorFindings,\n normalizeEndorSarif,\n readEndorFindings,\n} from \"./endor-findings.js\";\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"inspector-findings.d.ts","sourceRoot":"","sources":["../src/inspector-findings.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,+BAA+B,CAAC;AAGvC,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AA6W5D,wBAAgB,yBAAyB,CACvC,QAAQ,EAAE,QAAQ,EAClB,QAAQ,EAAE,SAAS,eAAe,EAAE,EACpC,MAAM,EAAE,oBAAoB,EAC5B,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,CAAC,wBAAwB,GAAG;IAAE,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,GAAG,SAAS,CA0DhE;AAsND,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,EACd,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GACvC,gBAAgB,CA8ClB;AAED,wBAAsB,qBAAqB,CACzC,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,MAAM,EAC3B,MAAM,GAAE,oBAA8B,EACtC,UAAU,CAAC,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,CAAC,GAC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