autoremediator 0.21.2 → 0.22.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.
- package/LICENSE +21 -0
- package/README.md +5 -0
- package/dist/a2a/agent-card.d.ts +89 -0
- package/dist/a2a/agent-card.d.ts.map +1 -0
- package/dist/a2a/agent-card.js +127 -0
- package/dist/a2a/agent-card.js.map +1 -0
- package/dist/a2a/index.d.ts +7 -0
- package/dist/a2a/index.d.ts.map +1 -0
- package/dist/a2a/index.js +4 -0
- package/dist/a2a/index.js.map +1 -0
- package/dist/a2a/server.d.ts +46 -0
- package/dist/a2a/server.d.ts.map +1 -0
- package/dist/a2a/server.js +312 -0
- package/dist/a2a/server.js.map +1 -0
- package/dist/a2a/sign.d.ts +28 -0
- package/dist/a2a/sign.d.ts.map +1 -0
- package/dist/a2a/sign.js +123 -0
- package/dist/a2a/sign.js.map +1 -0
- package/dist/a2a/task-store.d.ts +55 -0
- package/dist/a2a/task-store.d.ts.map +1 -0
- package/dist/a2a/task-store.js +90 -0
- package/dist/a2a/task-store.js.map +1 -0
- package/dist/api/assess/index.d.ts +45 -0
- package/dist/api/assess/index.d.ts.map +1 -0
- package/dist/api/assess/index.js +21 -0
- package/dist/api/assess/index.js.map +1 -0
- package/dist/api/autonomy/index.d.ts +65 -0
- package/dist/api/autonomy/index.d.ts.map +1 -0
- package/dist/api/autonomy/index.js +166 -0
- package/dist/api/autonomy/index.js.map +1 -0
- package/dist/api/bisect/changes.d.ts +20 -0
- package/dist/api/bisect/changes.d.ts.map +1 -0
- package/dist/api/bisect/changes.js +47 -0
- package/dist/api/bisect/changes.js.map +1 -0
- package/dist/api/bisect/ddmin.d.ts +33 -0
- package/dist/api/bisect/ddmin.d.ts.map +1 -0
- package/dist/api/bisect/ddmin.js +91 -0
- package/dist/api/bisect/ddmin.js.map +1 -0
- package/dist/api/bisect/index.d.ts +20 -0
- package/dist/api/bisect/index.d.ts.map +1 -0
- package/dist/api/bisect/index.js +463 -0
- package/dist/api/bisect/index.js.map +1 -0
- package/dist/api/bisect/pins.d.ts +40 -0
- package/dist/api/bisect/pins.d.ts.map +1 -0
- package/dist/api/bisect/pins.js +83 -0
- package/dist/api/bisect/pins.js.map +1 -0
- package/dist/api/bisect/remedy.d.ts +25 -0
- package/dist/api/bisect/remedy.d.ts.map +1 -0
- package/dist/api/bisect/remedy.js +116 -0
- package/dist/api/bisect/remedy.js.map +1 -0
- package/dist/api/bisect/shell.d.ts +41 -0
- package/dist/api/bisect/shell.d.ts.map +1 -0
- package/dist/api/bisect/shell.js +155 -0
- package/dist/api/bisect/shell.js.map +1 -0
- package/dist/api/bisect/types.d.ts +130 -0
- package/dist/api/bisect/types.d.ts.map +1 -0
- package/dist/api/bisect/types.js +2 -0
- package/dist/api/bisect/types.js.map +1 -0
- package/dist/api/change-request/branch.d.ts +13 -0
- package/dist/api/change-request/branch.d.ts.map +1 -0
- package/dist/api/change-request/branch.js +78 -0
- package/dist/api/change-request/branch.js.map +1 -0
- package/dist/api/change-request/hosts.d.ts +83 -0
- package/dist/api/change-request/hosts.d.ts.map +1 -0
- package/dist/api/change-request/hosts.js +292 -0
- package/dist/api/change-request/hosts.js.map +1 -0
- package/dist/api/change-request/index.d.ts +3 -1
- package/dist/api/change-request/index.d.ts.map +1 -1
- package/dist/api/change-request/index.js +302 -56
- package/dist/api/change-request/index.js.map +1 -1
- package/dist/api/diet/analyze.d.ts +8 -0
- package/dist/api/diet/analyze.d.ts.map +1 -0
- package/dist/api/diet/analyze.js +214 -0
- package/dist/api/diet/analyze.js.map +1 -0
- package/dist/api/diet/apply.d.ts +31 -0
- package/dist/api/diet/apply.d.ts.map +1 -0
- package/dist/api/diet/apply.js +175 -0
- package/dist/api/diet/apply.js.map +1 -0
- package/dist/api/diet/duplicates.d.ts +9 -0
- package/dist/api/diet/duplicates.d.ts.map +1 -0
- package/dist/api/diet/duplicates.js +125 -0
- package/dist/api/diet/duplicates.js.map +1 -0
- package/dist/api/diet/files.d.ts +30 -0
- package/dist/api/diet/files.d.ts.map +1 -0
- package/dist/api/diet/files.js +182 -0
- package/dist/api/diet/files.js.map +1 -0
- package/dist/api/diet/index.d.ts +4 -0
- package/dist/api/diet/index.d.ts.map +1 -0
- package/dist/api/diet/index.js +3 -0
- package/dist/api/diet/index.js.map +1 -0
- package/dist/api/diet/lockfile.d.ts +65 -0
- package/dist/api/diet/lockfile.d.ts.map +1 -0
- package/dist/api/diet/lockfile.js +329 -0
- package/dist/api/diet/lockfile.js.map +1 -0
- package/dist/api/diet/replaceable.d.ts +46 -0
- package/dist/api/diet/replaceable.d.ts.map +1 -0
- package/dist/api/diet/replaceable.js +115 -0
- package/dist/api/diet/replaceable.js.map +1 -0
- package/dist/api/diet/replaceable.json +168 -0
- package/dist/api/diet/scan.d.ts +43 -0
- package/dist/api/diet/scan.d.ts.map +1 -0
- package/dist/api/diet/scan.js +357 -0
- package/dist/api/diet/scan.js.map +1 -0
- package/dist/api/diet/surface.d.ts +32 -0
- package/dist/api/diet/surface.d.ts.map +1 -0
- package/dist/api/diet/surface.js +130 -0
- package/dist/api/diet/surface.js.map +1 -0
- package/dist/api/diet/types.d.ts +205 -0
- package/dist/api/diet/types.d.ts.map +1 -0
- package/dist/api/diet/types.js +2 -0
- package/dist/api/diet/types.js.map +1 -0
- package/dist/api/diet/unused.d.ts +73 -0
- package/dist/api/diet/unused.d.ts.map +1 -0
- package/dist/api/diet/unused.js +342 -0
- package/dist/api/diet/unused.js.map +1 -0
- package/dist/api/evidence-pack/attest.d.ts +43 -0
- package/dist/api/evidence-pack/attest.d.ts.map +1 -0
- package/dist/api/evidence-pack/attest.js +140 -0
- package/dist/api/evidence-pack/attest.js.map +1 -0
- package/dist/api/evidence-pack/components.d.ts +49 -0
- package/dist/api/evidence-pack/components.d.ts.map +1 -0
- package/dist/api/evidence-pack/components.js +278 -0
- package/dist/api/evidence-pack/components.js.map +1 -0
- package/dist/api/evidence-pack/cra.d.ts +54 -0
- package/dist/api/evidence-pack/cra.d.ts.map +1 -0
- package/dist/api/evidence-pack/cra.js +234 -0
- package/dist/api/evidence-pack/cra.js.map +1 -0
- package/dist/api/evidence-pack/dsse.d.ts +53 -0
- package/dist/api/evidence-pack/dsse.d.ts.map +1 -0
- package/dist/api/evidence-pack/dsse.js +132 -0
- package/dist/api/evidence-pack/dsse.js.map +1 -0
- package/dist/api/evidence-pack/findings.d.ts +57 -0
- package/dist/api/evidence-pack/findings.d.ts.map +1 -0
- package/dist/api/evidence-pack/findings.js +232 -0
- package/dist/api/evidence-pack/findings.js.map +1 -0
- package/dist/api/evidence-pack/index.d.ts +70 -0
- package/dist/api/evidence-pack/index.d.ts.map +1 -0
- package/dist/api/evidence-pack/index.js +482 -0
- package/dist/api/evidence-pack/index.js.map +1 -0
- package/dist/api/evidence-pack/readme.d.ts +5 -0
- package/dist/api/evidence-pack/readme.d.ts.map +1 -0
- package/dist/api/evidence-pack/readme.js +55 -0
- package/dist/api/evidence-pack/readme.js.map +1 -0
- package/dist/api/evidence-pack/sbom.d.ts +87 -0
- package/dist/api/evidence-pack/sbom.d.ts.map +1 -0
- package/dist/api/evidence-pack/sbom.js +221 -0
- package/dist/api/evidence-pack/sbom.js.map +1 -0
- package/dist/api/evidence-pack/types.d.ts +62 -0
- package/dist/api/evidence-pack/types.d.ts.map +1 -0
- package/dist/api/evidence-pack/types.js +2 -0
- package/dist/api/evidence-pack/types.js.map +1 -0
- package/dist/api/evidence-pack/vex.d.ts +114 -0
- package/dist/api/evidence-pack/vex.d.ts.map +1 -0
- package/dist/api/evidence-pack/vex.js +197 -0
- package/dist/api/evidence-pack/vex.js.map +1 -0
- package/dist/api/freshness/deps.d.ts +27 -0
- package/dist/api/freshness/deps.d.ts.map +1 -0
- package/dist/api/freshness/deps.js +60 -0
- package/dist/api/freshness/deps.js.map +1 -0
- package/dist/api/freshness/distance.d.ts +42 -0
- package/dist/api/freshness/distance.d.ts.map +1 -0
- package/dist/api/freshness/distance.js +86 -0
- package/dist/api/freshness/distance.js.map +1 -0
- package/dist/api/freshness/index.d.ts +12 -0
- package/dist/api/freshness/index.d.ts.map +1 -0
- package/dist/api/freshness/index.js +11 -0
- package/dist/api/freshness/index.js.map +1 -0
- package/dist/api/freshness/path.d.ts +29 -0
- package/dist/api/freshness/path.d.ts.map +1 -0
- package/dist/api/freshness/path.js +103 -0
- package/dist/api/freshness/path.js.map +1 -0
- package/dist/api/freshness/report.d.ts +55 -0
- package/dist/api/freshness/report.d.ts.map +1 -0
- package/dist/api/freshness/report.js +334 -0
- package/dist/api/freshness/report.js.map +1 -0
- package/dist/api/freshness/step.d.ts +47 -0
- package/dist/api/freshness/step.d.ts.map +1 -0
- package/dist/api/freshness/step.js +286 -0
- package/dist/api/freshness/step.js.map +1 -0
- package/dist/api/freshness/types.d.ts +192 -0
- package/dist/api/freshness/types.d.ts.map +1 -0
- package/dist/api/freshness/types.js +2 -0
- package/dist/api/freshness/types.js.map +1 -0
- package/dist/api/guard/checks.d.ts +31 -0
- package/dist/api/guard/checks.d.ts.map +1 -0
- package/dist/api/guard/checks.js +101 -0
- package/dist/api/guard/checks.js.map +1 -0
- package/dist/api/guard/diff.d.ts +46 -0
- package/dist/api/guard/diff.d.ts.map +1 -0
- package/dist/api/guard/diff.js +89 -0
- package/dist/api/guard/diff.js.map +1 -0
- package/dist/api/guard/hook.d.ts +59 -0
- package/dist/api/guard/hook.d.ts.map +1 -0
- package/dist/api/guard/hook.js +179 -0
- package/dist/api/guard/hook.js.map +1 -0
- package/dist/api/guard/index.d.ts +32 -0
- package/dist/api/guard/index.d.ts.map +1 -0
- package/dist/api/guard/index.js +199 -0
- package/dist/api/guard/index.js.map +1 -0
- package/dist/api/guard/popular.d.ts +7 -0
- package/dist/api/guard/popular.d.ts.map +1 -0
- package/dist/api/guard/popular.js +206 -0
- package/dist/api/guard/popular.js.map +1 -0
- package/dist/api/guard/spec.d.ts +22 -0
- package/dist/api/guard/spec.d.ts.map +1 -0
- package/dist/api/guard/spec.js +124 -0
- package/dist/api/guard/spec.js.map +1 -0
- package/dist/api/guard/types.d.ts +34 -0
- package/dist/api/guard/types.d.ts.map +1 -0
- package/dist/api/guard/types.js +2 -0
- package/dist/api/guard/types.js.map +1 -0
- package/dist/api/hooks/detect.d.ts +28 -0
- package/dist/api/hooks/detect.d.ts.map +1 -0
- package/dist/api/hooks/detect.js +112 -0
- package/dist/api/hooks/detect.js.map +1 -0
- package/dist/api/hooks/index.d.ts +14 -0
- package/dist/api/hooks/index.d.ts.map +1 -0
- package/dist/api/hooks/index.js +77 -0
- package/dist/api/hooks/index.js.map +1 -0
- package/dist/api/hooks/merge.d.ts +35 -0
- package/dist/api/hooks/merge.d.ts.map +1 -0
- package/dist/api/hooks/merge.js +345 -0
- package/dist/api/hooks/merge.js.map +1 -0
- package/dist/api/hooks/plan.d.ts +18 -0
- package/dist/api/hooks/plan.d.ts.map +1 -0
- package/dist/api/hooks/plan.js +270 -0
- package/dist/api/hooks/plan.js.map +1 -0
- package/dist/api/hooks/scripts.d.ts +18 -0
- package/dist/api/hooks/scripts.d.ts.map +1 -0
- package/dist/api/hooks/scripts.js +193 -0
- package/dist/api/hooks/scripts.js.map +1 -0
- package/dist/api/hooks/types.d.ts +85 -0
- package/dist/api/hooks/types.d.ts.map +1 -0
- package/dist/api/hooks/types.js +5 -0
- package/dist/api/hooks/types.js.map +1 -0
- package/dist/api/incident/ci-secrets.d.ts +76 -0
- package/dist/api/incident/ci-secrets.d.ts.map +1 -0
- package/dist/api/incident/ci-secrets.js +420 -0
- package/dist/api/incident/ci-secrets.js.map +1 -0
- package/dist/api/incident/history.d.ts +81 -0
- package/dist/api/incident/history.d.ts.map +1 -0
- package/dist/api/incident/history.js +379 -0
- package/dist/api/incident/history.js.map +1 -0
- package/dist/api/incident/index.d.ts +36 -0
- package/dist/api/incident/index.d.ts.map +1 -0
- package/dist/api/incident/index.js +165 -0
- package/dist/api/incident/index.js.map +1 -0
- package/dist/api/incident/markdown.d.ts +8 -0
- package/dist/api/incident/markdown.d.ts.map +1 -0
- package/dist/api/incident/markdown.js +208 -0
- package/dist/api/incident/markdown.js.map +1 -0
- package/dist/api/incident/project.d.ts +28 -0
- package/dist/api/incident/project.d.ts.map +1 -0
- package/dist/api/incident/project.js +111 -0
- package/dist/api/incident/project.js.map +1 -0
- package/dist/api/incident/rollback.d.ts +50 -0
- package/dist/api/incident/rollback.d.ts.map +1 -0
- package/dist/api/incident/rollback.js +132 -0
- package/dist/api/incident/rollback.js.map +1 -0
- package/dist/api/incident/target.d.ts +18 -0
- package/dist/api/incident/target.d.ts.map +1 -0
- package/dist/api/incident/target.js +110 -0
- package/dist/api/incident/target.js.map +1 -0
- package/dist/api/incident/text.d.ts +3 -0
- package/dist/api/incident/text.d.ts.map +1 -0
- package/dist/api/incident/text.js +13 -0
- package/dist/api/incident/text.js.map +1 -0
- package/dist/api/incident/types.d.ts +118 -0
- package/dist/api/incident/types.d.ts.map +1 -0
- package/dist/api/incident/types.js +2 -0
- package/dist/api/incident/types.js.map +1 -0
- package/dist/api/index.d.ts +30 -2
- package/dist/api/index.d.ts.map +1 -1
- package/dist/api/index.js +24 -1
- package/dist/api/index.js.map +1 -1
- package/dist/api/init/assets.d.ts +47 -0
- package/dist/api/init/assets.d.ts.map +1 -0
- package/dist/api/init/assets.js +195 -0
- package/dist/api/init/assets.js.map +1 -0
- package/dist/api/init/detect.d.ts +8 -0
- package/dist/api/init/detect.d.ts.map +1 -0
- package/dist/api/init/detect.js +136 -0
- package/dist/api/init/detect.js.map +1 -0
- package/dist/api/init/diff.d.ts +3 -0
- package/dist/api/init/diff.d.ts.map +1 -0
- package/dist/api/init/diff.js +40 -0
- package/dist/api/init/diff.js.map +1 -0
- package/dist/api/init/guard-assets.d.ts +37 -0
- package/dist/api/init/guard-assets.d.ts.map +1 -0
- package/dist/api/init/guard-assets.js +173 -0
- package/dist/api/init/guard-assets.js.map +1 -0
- package/dist/api/init/index.d.ts +13 -0
- package/dist/api/init/index.d.ts.map +1 -0
- package/dist/api/init/index.js +50 -0
- package/dist/api/init/index.js.map +1 -0
- package/dist/api/init/merge.d.ts +43 -0
- package/dist/api/init/merge.d.ts.map +1 -0
- package/dist/api/init/merge.js +303 -0
- package/dist/api/init/merge.js.map +1 -0
- package/dist/api/init/plan.d.ts +4 -0
- package/dist/api/init/plan.d.ts.map +1 -0
- package/dist/api/init/plan.js +168 -0
- package/dist/api/init/plan.js.map +1 -0
- package/dist/api/init/plugin-files.d.ts +3 -0
- package/dist/api/init/plugin-files.d.ts.map +1 -0
- package/dist/api/init/plugin-files.js +80 -0
- package/dist/api/init/plugin-files.js.map +1 -0
- package/dist/api/init/types.d.ts +72 -0
- package/dist/api/init/types.d.ts.map +1 -0
- package/dist/api/init/types.js +10 -0
- package/dist/api/init/types.js.map +1 -0
- package/dist/api/maintain/index.d.ts +21 -0
- package/dist/api/maintain/index.d.ts.map +1 -0
- package/dist/api/maintain/index.js +367 -0
- package/dist/api/maintain/index.js.map +1 -0
- package/dist/api/maintain/package-files.d.ts +37 -0
- package/dist/api/maintain/package-files.d.ts.map +1 -0
- package/dist/api/maintain/package-files.js +156 -0
- package/dist/api/maintain/package-files.js.map +1 -0
- package/dist/api/maintain/types.d.ts +87 -0
- package/dist/api/maintain/types.d.ts.map +1 -0
- package/dist/api/maintain/types.js +2 -0
- package/dist/api/maintain/types.js.map +1 -0
- package/dist/api/maintain/vex-file.d.ts +33 -0
- package/dist/api/maintain/vex-file.d.ts.map +1 -0
- package/dist/api/maintain/vex-file.js +95 -0
- package/dist/api/maintain/vex-file.js.map +1 -0
- package/dist/api/maintainer-vex/index.d.ts +57 -0
- package/dist/api/maintainer-vex/index.d.ts.map +1 -0
- package/dist/api/maintainer-vex/index.js +107 -0
- package/dist/api/maintainer-vex/index.js.map +1 -0
- package/dist/api/memory/index.d.ts +88 -0
- package/dist/api/memory/index.d.ts.map +1 -0
- package/dist/api/memory/index.js +89 -0
- package/dist/api/memory/index.js.map +1 -0
- package/dist/api/options-schema.d.ts +9 -61
- package/dist/api/options-schema.d.ts.map +1 -1
- package/dist/api/options-schema.js +21 -315
- package/dist/api/options-schema.js.map +1 -1
- package/dist/api/patches/reconcile.d.ts.map +1 -1
- package/dist/api/patches/reconcile.js +4 -1
- package/dist/api/patches/reconcile.js.map +1 -1
- package/dist/api/policy-nl/apply-patch.d.ts +23 -0
- package/dist/api/policy-nl/apply-patch.d.ts.map +1 -0
- package/dist/api/policy-nl/apply-patch.js +153 -0
- package/dist/api/policy-nl/apply-patch.js.map +1 -0
- package/dist/api/policy-nl/compile.d.ts +98 -0
- package/dist/api/policy-nl/compile.d.ts.map +1 -0
- package/dist/api/policy-nl/compile.js +308 -0
- package/dist/api/policy-nl/compile.js.map +1 -0
- package/dist/api/policy-nl/explain.d.ts +33 -0
- package/dist/api/policy-nl/explain.d.ts.map +1 -0
- package/dist/api/policy-nl/explain.js +137 -0
- package/dist/api/policy-nl/explain.js.map +1 -0
- package/dist/api/policy-nl/index.d.ts +6 -0
- package/dist/api/policy-nl/index.d.ts.map +1 -0
- package/dist/api/policy-nl/index.js +6 -0
- package/dist/api/policy-nl/index.js.map +1 -0
- package/dist/api/policy-nl/prompt.d.ts +16 -0
- package/dist/api/policy-nl/prompt.d.ts.map +1 -0
- package/dist/api/policy-nl/prompt.js +45 -0
- package/dist/api/policy-nl/prompt.js.map +1 -0
- package/dist/api/policy-nl/proposal.d.ts +438 -0
- package/dist/api/policy-nl/proposal.d.ts.map +1 -0
- package/dist/api/policy-nl/proposal.js +105 -0
- package/dist/api/policy-nl/proposal.js.map +1 -0
- package/dist/api/policy-nl/request-match.d.ts +20 -0
- package/dist/api/policy-nl/request-match.d.ts.map +1 -0
- package/dist/api/policy-nl/request-match.js +94 -0
- package/dist/api/policy-nl/request-match.js.map +1 -0
- package/dist/api/policy-nl/sanitize.d.ts +21 -0
- package/dist/api/policy-nl/sanitize.d.ts.map +1 -0
- package/dist/api/policy-nl/sanitize.js +65 -0
- package/dist/api/policy-nl/sanitize.js.map +1 -0
- package/dist/api/policy-nl/vocabulary.d.ts +9 -0
- package/dist/api/policy-nl/vocabulary.d.ts.map +1 -0
- package/dist/api/policy-nl/vocabulary.js +118 -0
- package/dist/api/policy-nl/vocabulary.js.map +1 -0
- package/dist/api/premortem/index.d.ts +16 -0
- package/dist/api/premortem/index.d.ts.map +1 -0
- package/dist/api/premortem/index.js +274 -0
- package/dist/api/premortem/index.js.map +1 -0
- package/dist/api/premortem/playbook.d.ts +8 -0
- package/dist/api/premortem/playbook.d.ts.map +1 -0
- package/dist/api/premortem/playbook.js +131 -0
- package/dist/api/premortem/playbook.js.map +1 -0
- package/dist/api/premortem/types.d.ts +75 -0
- package/dist/api/premortem/types.d.ts.map +1 -0
- package/dist/api/premortem/types.js +2 -0
- package/dist/api/premortem/types.js.map +1 -0
- package/dist/api/prove/advisory.d.ts +26 -0
- package/dist/api/prove/advisory.d.ts.map +1 -0
- package/dist/api/prove/advisory.js +81 -0
- package/dist/api/prove/advisory.js.map +1 -0
- package/dist/api/prove/agent.d.ts +9 -0
- package/dist/api/prove/agent.d.ts.map +1 -0
- package/dist/api/prove/agent.js +203 -0
- package/dist/api/prove/agent.js.map +1 -0
- package/dist/api/prove/evidence.d.ts +108 -0
- package/dist/api/prove/evidence.d.ts.map +1 -0
- package/dist/api/prove/evidence.js +176 -0
- package/dist/api/prove/evidence.js.map +1 -0
- package/dist/api/prove/harness.d.ts +27 -0
- package/dist/api/prove/harness.d.ts.map +1 -0
- package/dist/api/prove/harness.js +148 -0
- package/dist/api/prove/harness.js.map +1 -0
- package/dist/api/prove/index.d.ts +84 -0
- package/dist/api/prove/index.d.ts.map +1 -0
- package/dist/api/prove/index.js +289 -0
- package/dist/api/prove/index.js.map +1 -0
- package/dist/api/prove/install.d.ts +24 -0
- package/dist/api/prove/install.d.ts.map +1 -0
- package/dist/api/prove/install.js +150 -0
- package/dist/api/prove/install.js.map +1 -0
- package/dist/api/prove/sandbox.d.ts +48 -0
- package/dist/api/prove/sandbox.d.ts.map +1 -0
- package/dist/api/prove/sandbox.js +269 -0
- package/dist/api/prove/sandbox.js.map +1 -0
- package/dist/api/prove/screen.d.ts +17 -0
- package/dist/api/prove/screen.d.ts.map +1 -0
- package/dist/api/prove/screen.js +256 -0
- package/dist/api/prove/screen.js.map +1 -0
- package/dist/api/prove/types.d.ts +105 -0
- package/dist/api/prove/types.d.ts.map +1 -0
- package/dist/api/prove/types.js +2 -0
- package/dist/api/prove/types.js.map +1 -0
- package/dist/api/radar/deps.d.ts +7 -0
- package/dist/api/radar/deps.d.ts.map +1 -0
- package/dist/api/radar/deps.js +263 -0
- package/dist/api/radar/deps.js.map +1 -0
- package/dist/api/radar/index.d.ts +16 -0
- package/dist/api/radar/index.d.ts.map +1 -0
- package/dist/api/radar/index.js +429 -0
- package/dist/api/radar/index.js.map +1 -0
- package/dist/api/radar/render.d.ts +6 -0
- package/dist/api/radar/render.d.ts.map +1 -0
- package/dist/api/radar/render.js +51 -0
- package/dist/api/radar/render.js.map +1 -0
- package/dist/api/radar/types.d.ts +162 -0
- package/dist/api/radar/types.d.ts.map +1 -0
- package/dist/api/radar/types.js +2 -0
- package/dist/api/radar/types.js.map +1 -0
- package/dist/api/reachability/index.d.ts.map +1 -1
- package/dist/api/reachability/index.js +35 -1
- package/dist/api/reachability/index.js.map +1 -1
- package/dist/api/recipes/index.d.ts +93 -0
- package/dist/api/recipes/index.d.ts.map +1 -0
- package/dist/api/recipes/index.js +159 -0
- package/dist/api/recipes/index.js.map +1 -0
- package/dist/api/remediate/index.d.ts.map +1 -1
- package/dist/api/remediate/index.js +25 -1
- package/dist/api/remediate/index.js.map +1 -1
- package/dist/api/remediate.evidence.d.ts.map +1 -1
- package/dist/api/remediate.evidence.js +1 -0
- package/dist/api/remediate.evidence.js.map +1 -1
- package/dist/api/reporting.d.ts +21 -0
- package/dist/api/reporting.d.ts.map +1 -1
- package/dist/api/reporting.js +39 -1
- package/dist/api/reporting.js.map +1 -1
- package/dist/api/runs/attempts.d.ts +86 -0
- package/dist/api/runs/attempts.d.ts.map +1 -0
- package/dist/api/runs/attempts.js +378 -0
- package/dist/api/runs/attempts.js.map +1 -0
- package/dist/api/runs/autonomy-events.d.ts +41 -0
- package/dist/api/runs/autonomy-events.d.ts.map +1 -0
- package/dist/api/runs/autonomy-events.js +130 -0
- package/dist/api/runs/autonomy-events.js.map +1 -0
- package/dist/api/runs/deps.d.ts +23 -0
- package/dist/api/runs/deps.d.ts.map +1 -0
- package/dist/api/runs/deps.js +51 -0
- package/dist/api/runs/deps.js.map +1 -0
- package/dist/api/runs/index.d.ts +167 -0
- package/dist/api/runs/index.d.ts.map +1 -0
- package/dist/api/runs/index.js +601 -0
- package/dist/api/runs/index.js.map +1 -0
- package/dist/api/runs/memory-events.d.ts +19 -0
- package/dist/api/runs/memory-events.d.ts.map +1 -0
- package/dist/api/runs/memory-events.js +78 -0
- package/dist/api/runs/memory-events.js.map +1 -0
- package/dist/api/runs/recipes.d.ts +40 -0
- package/dist/api/runs/recipes.d.ts.map +1 -0
- package/dist/api/runs/recipes.js +110 -0
- package/dist/api/runs/recipes.js.map +1 -0
- package/dist/api/runs/repair.d.ts +73 -0
- package/dist/api/runs/repair.d.ts.map +1 -0
- package/dist/api/runs/repair.js +226 -0
- package/dist/api/runs/repair.js.map +1 -0
- package/dist/api/trace/index.d.ts +6 -0
- package/dist/api/trace/index.d.ts.map +1 -0
- package/dist/api/trace/index.js +5 -0
- package/dist/api/trace/index.js.map +1 -0
- package/dist/api/update-outdated/index.d.ts.map +1 -1
- package/dist/api/update-outdated/index.js +13 -1
- package/dist/api/update-outdated/index.js.map +1 -1
- package/dist/api/vex/index.d.ts +44 -1
- package/dist/api/vex/index.d.ts.map +1 -1
- package/dist/api/vex/index.js +131 -3
- package/dist/api/vex/index.js.map +1 -1
- package/dist/autonomy/compute.d.ts +117 -0
- package/dist/autonomy/compute.d.ts.map +1 -0
- package/dist/autonomy/compute.js +346 -0
- package/dist/autonomy/compute.js.map +1 -0
- package/dist/autonomy/record.d.ts +21 -0
- package/dist/autonomy/record.d.ts.map +1 -0
- package/dist/autonomy/record.js +228 -0
- package/dist/autonomy/record.js.map +1 -0
- package/dist/autonomy/types.d.ts +78 -0
- package/dist/autonomy/types.d.ts.map +1 -0
- package/dist/autonomy/types.js +59 -0
- package/dist/autonomy/types.js.map +1 -0
- package/dist/catalog/adapters/http.d.ts +27 -0
- package/dist/catalog/adapters/http.d.ts.map +1 -0
- package/dist/catalog/adapters/http.js +190 -0
- package/dist/catalog/adapters/http.js.map +1 -0
- package/dist/catalog/adapters/mcp.d.ts +53 -0
- package/dist/catalog/adapters/mcp.d.ts.map +1 -0
- package/dist/catalog/adapters/mcp.js +105 -0
- package/dist/catalog/adapters/mcp.js.map +1 -0
- package/dist/catalog/api-deps.d.ts +64 -0
- package/dist/catalog/api-deps.d.ts.map +1 -0
- package/dist/catalog/api-deps.js +60 -0
- package/dist/catalog/api-deps.js.map +1 -0
- package/dist/catalog/define-operation.d.ts +59 -0
- package/dist/catalog/define-operation.d.ts.map +1 -0
- package/dist/catalog/define-operation.js +9 -0
- package/dist/catalog/define-operation.js.map +1 -0
- package/dist/catalog/evidence-pack-operations.d.ts +3 -0
- package/dist/catalog/evidence-pack-operations.d.ts.map +1 -0
- package/dist/catalog/evidence-pack-operations.js +93 -0
- package/dist/catalog/evidence-pack-operations.js.map +1 -0
- package/dist/catalog/freshness-operations.d.ts +3 -0
- package/dist/catalog/freshness-operations.d.ts.map +1 -0
- package/dist/catalog/freshness-operations.js +91 -0
- package/dist/catalog/freshness-operations.js.map +1 -0
- package/dist/catalog/incident-operations.d.ts +3 -0
- package/dist/catalog/incident-operations.d.ts.map +1 -0
- package/dist/catalog/incident-operations.js +125 -0
- package/dist/catalog/incident-operations.js.map +1 -0
- package/dist/catalog/index.d.ts +12 -0
- package/dist/catalog/index.d.ts.map +1 -0
- package/dist/catalog/index.js +7 -0
- package/dist/catalog/index.js.map +1 -0
- package/dist/catalog/maintainer-vex-operations.d.ts +3 -0
- package/dist/catalog/maintainer-vex-operations.d.ts.map +1 -0
- package/dist/catalog/maintainer-vex-operations.js +107 -0
- package/dist/catalog/maintainer-vex-operations.js.map +1 -0
- package/dist/catalog/memory-operations.d.ts +3 -0
- package/dist/catalog/memory-operations.d.ts.map +1 -0
- package/dist/catalog/memory-operations.js +128 -0
- package/dist/catalog/memory-operations.js.map +1 -0
- package/dist/catalog/operations.d.ts +4 -0
- package/dist/catalog/operations.d.ts.map +1 -0
- package/dist/catalog/operations.js +797 -0
- package/dist/catalog/operations.js.map +1 -0
- package/dist/catalog/policy-operations.d.ts +3 -0
- package/dist/catalog/policy-operations.d.ts.map +1 -0
- package/dist/catalog/policy-operations.js +87 -0
- package/dist/catalog/policy-operations.js.map +1 -0
- package/dist/catalog/prove-operations.d.ts +3 -0
- package/dist/catalog/prove-operations.d.ts.map +1 -0
- package/dist/catalog/prove-operations.js +87 -0
- package/dist/catalog/prove-operations.js.map +1 -0
- package/dist/catalog/radar-operations.d.ts +3 -0
- package/dist/catalog/radar-operations.d.ts.map +1 -0
- package/dist/catalog/radar-operations.js +82 -0
- package/dist/catalog/radar-operations.js.map +1 -0
- package/dist/catalog/responses.d.ts +229 -0
- package/dist/catalog/responses.d.ts.map +1 -0
- package/dist/catalog/responses.js +313 -0
- package/dist/catalog/responses.js.map +1 -0
- package/dist/catalog/schema.d.ts +11 -0
- package/dist/catalog/schema.d.ts.map +1 -0
- package/dist/catalog/schema.js +13 -0
- package/dist/catalog/schema.js.map +1 -0
- package/dist/cli/autonomy.d.ts +11 -0
- package/dist/cli/autonomy.d.ts.map +1 -0
- package/dist/cli/autonomy.js +80 -0
- package/dist/cli/autonomy.js.map +1 -0
- package/dist/cli/bisect.d.ts +19 -0
- package/dist/cli/bisect.d.ts.map +1 -0
- package/dist/cli/bisect.js +109 -0
- package/dist/cli/bisect.js.map +1 -0
- package/dist/cli/errors.d.ts +8 -0
- package/dist/cli/errors.d.ts.map +1 -0
- package/dist/cli/errors.js +23 -0
- package/dist/cli/errors.js.map +1 -0
- package/dist/cli/evidence-pack-commands.d.ts +21 -0
- package/dist/cli/evidence-pack-commands.d.ts.map +1 -0
- package/dist/cli/evidence-pack-commands.js +109 -0
- package/dist/cli/evidence-pack-commands.js.map +1 -0
- package/dist/cli/freshness-commands.d.ts +31 -0
- package/dist/cli/freshness-commands.d.ts.map +1 -0
- package/dist/cli/freshness-commands.js +241 -0
- package/dist/cli/freshness-commands.js.map +1 -0
- package/dist/cli/incident-commands.d.ts +29 -0
- package/dist/cli/incident-commands.d.ts.map +1 -0
- package/dist/cli/incident-commands.js +131 -0
- package/dist/cli/incident-commands.js.map +1 -0
- package/dist/cli/index.d.ts.map +1 -1
- package/dist/cli/index.js +4 -3
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/maintain-commands.d.ts +22 -0
- package/dist/cli/maintain-commands.d.ts.map +1 -0
- package/dist/cli/maintain-commands.js +161 -0
- package/dist/cli/maintain-commands.js.map +1 -0
- package/dist/cli/memory-commands.d.ts +23 -0
- package/dist/cli/memory-commands.d.ts.map +1 -0
- package/dist/cli/memory-commands.js +172 -0
- package/dist/cli/memory-commands.js.map +1 -0
- package/dist/cli/policy-commands.d.ts +29 -0
- package/dist/cli/policy-commands.d.ts.map +1 -0
- package/dist/cli/policy-commands.js +138 -0
- package/dist/cli/policy-commands.js.map +1 -0
- package/dist/cli/program.d.ts.map +1 -1
- package/dist/cli/program.js +254 -2
- package/dist/cli/program.js.map +1 -1
- package/dist/cli/prove-commands.d.ts +22 -0
- package/dist/cli/prove-commands.d.ts.map +1 -0
- package/dist/cli/prove-commands.js +65 -0
- package/dist/cli/prove-commands.js.map +1 -0
- package/dist/cli/radar-commands.d.ts +20 -0
- package/dist/cli/radar-commands.d.ts.map +1 -0
- package/dist/cli/radar-commands.js +60 -0
- package/dist/cli/radar-commands.js.map +1 -0
- package/dist/cli/recipes.d.ts +3 -0
- package/dist/cli/recipes.d.ts.map +1 -0
- package/dist/cli/recipes.js +124 -0
- package/dist/cli/recipes.js.map +1 -0
- package/dist/cli/runners.d.ts +95 -1
- package/dist/cli/runners.d.ts.map +1 -1
- package/dist/cli/runners.js +586 -157
- package/dist/cli/runners.js.map +1 -1
- package/dist/cli/trace.d.ts +12 -0
- package/dist/cli/trace.d.ts.map +1 -0
- package/dist/cli/trace.js +79 -0
- package/dist/cli/trace.js.map +1 -0
- package/dist/cli/types.d.ts +4 -2
- package/dist/cli/types.d.ts.map +1 -1
- package/dist/cli/types.js.map +1 -1
- package/dist/cli/validators.d.ts.map +1 -1
- package/dist/cli/validators.js +5 -0
- package/dist/cli/validators.js.map +1 -1
- package/dist/intelligence/sources/cisa-kev.d.ts +6 -0
- package/dist/intelligence/sources/cisa-kev.d.ts.map +1 -1
- package/dist/intelligence/sources/cisa-kev.js +27 -3
- package/dist/intelligence/sources/cisa-kev.js.map +1 -1
- package/dist/intelligence/sources/registry.d.ts +55 -6
- package/dist/intelligence/sources/registry.d.ts.map +1 -1
- package/dist/intelligence/sources/registry.js +182 -61
- package/dist/intelligence/sources/registry.js.map +1 -1
- package/dist/mcp/http.d.ts +23 -0
- package/dist/mcp/http.d.ts.map +1 -0
- package/dist/mcp/http.js +102 -0
- package/dist/mcp/http.js.map +1 -0
- package/dist/mcp/prompts.d.ts +25 -0
- package/dist/mcp/prompts.d.ts.map +1 -0
- package/dist/mcp/prompts.js +89 -0
- package/dist/mcp/prompts.js.map +1 -0
- package/dist/mcp/resources.d.ts +58 -0
- package/dist/mcp/resources.d.ts.map +1 -0
- package/dist/mcp/resources.js +131 -0
- package/dist/mcp/resources.js.map +1 -0
- package/dist/mcp/server.d.ts +19 -350
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +72 -423
- package/dist/mcp/server.js.map +1 -1
- package/dist/openapi/handlers/index.d.ts.map +1 -1
- package/dist/openapi/handlers/index.js +42 -35
- package/dist/openapi/handlers/index.js.map +1 -1
- package/dist/openapi/handlers/run-operation.d.ts +9 -0
- package/dist/openapi/handlers/run-operation.d.ts.map +1 -0
- package/dist/openapi/handlers/run-operation.js +46 -0
- package/dist/openapi/handlers/run-operation.js.map +1 -0
- package/dist/openapi/handlers/validators.d.ts +2 -3
- package/dist/openapi/handlers/validators.d.ts.map +1 -1
- package/dist/openapi/handlers/validators.js +1 -21
- package/dist/openapi/handlers/validators.js.map +1 -1
- package/dist/openapi/http-utils.d.ts +1 -14
- package/dist/openapi/http-utils.d.ts.map +1 -1
- package/dist/openapi/http-utils.js +1 -82
- package/dist/openapi/http-utils.js.map +1 -1
- package/dist/openapi/rbac.d.ts +1 -21
- package/dist/openapi/rbac.d.ts.map +1 -1
- package/dist/openapi/rbac.js +9 -135
- package/dist/openapi/rbac.js.map +1 -1
- package/dist/openapi/server.d.ts +7 -16
- package/dist/openapi/server.d.ts.map +1 -1
- package/dist/openapi/server.js +2 -16
- package/dist/openapi/server.js.map +1 -1
- package/dist/openapi/spec/index.d.ts +10 -1012
- package/dist/openapi/spec/index.d.ts.map +1 -1
- package/dist/openapi/spec/index.js +36 -2
- package/dist/openapi/spec/index.js.map +1 -1
- package/dist/platform/cooldown.d.ts +15 -0
- package/dist/platform/cooldown.d.ts.map +1 -0
- package/dist/platform/cooldown.js +136 -0
- package/dist/platform/cooldown.js.map +1 -0
- package/dist/platform/freshness-policy.d.ts +25 -0
- package/dist/platform/freshness-policy.d.ts.map +1 -0
- package/dist/platform/freshness-policy.js +25 -0
- package/dist/platform/freshness-policy.js.map +1 -0
- package/dist/platform/git-ref.d.ts +8 -0
- package/dist/platform/git-ref.d.ts.map +1 -0
- package/dist/platform/git-ref.js +35 -0
- package/dist/platform/git-ref.js.map +1 -0
- package/dist/platform/http-auth.d.ts +42 -0
- package/dist/platform/http-auth.d.ts.map +1 -0
- package/dist/platform/http-auth.js +151 -0
- package/dist/platform/http-auth.js.map +1 -0
- package/dist/platform/http-security.d.ts +25 -0
- package/dist/platform/http-security.d.ts.map +1 -0
- package/dist/platform/http-security.js +102 -0
- package/dist/platform/http-security.js.map +1 -0
- package/dist/platform/maintainer-vex/find.d.ts +25 -0
- package/dist/platform/maintainer-vex/find.d.ts.map +1 -0
- package/dist/platform/maintainer-vex/find.js +109 -0
- package/dist/platform/maintainer-vex/find.js.map +1 -0
- package/dist/platform/maintainer-vex/index.d.ts +5 -0
- package/dist/platform/maintainer-vex/index.d.ts.map +1 -0
- package/dist/platform/maintainer-vex/index.js +5 -0
- package/dist/platform/maintainer-vex/index.js.map +1 -0
- package/dist/platform/maintainer-vex/openvex.d.ts +91 -0
- package/dist/platform/maintainer-vex/openvex.d.ts.map +1 -0
- package/dist/platform/maintainer-vex/openvex.js +154 -0
- package/dist/platform/maintainer-vex/openvex.js.map +1 -0
- package/dist/platform/maintainer-vex/purl.d.ts +16 -0
- package/dist/platform/maintainer-vex/purl.d.ts.map +1 -0
- package/dist/platform/maintainer-vex/purl.js +46 -0
- package/dist/platform/maintainer-vex/purl.js.map +1 -0
- package/dist/platform/maintainer-vex/read.d.ts +78 -0
- package/dist/platform/maintainer-vex/read.d.ts.map +1 -0
- package/dist/platform/maintainer-vex/read.js +276 -0
- package/dist/platform/maintainer-vex/read.js.map +1 -0
- package/dist/platform/memory/consume.d.ts +35 -0
- package/dist/platform/memory/consume.d.ts.map +1 -0
- package/dist/platform/memory/consume.js +130 -0
- package/dist/platform/memory/consume.js.map +1 -0
- package/dist/platform/memory/entries.d.ts +119 -0
- package/dist/platform/memory/entries.d.ts.map +1 -0
- package/dist/platform/memory/entries.js +306 -0
- package/dist/platform/memory/entries.js.map +1 -0
- package/dist/platform/memory/format.d.ts +83 -0
- package/dist/platform/memory/format.d.ts.map +1 -0
- package/dist/platform/memory/format.js +285 -0
- package/dist/platform/memory/format.js.map +1 -0
- package/dist/platform/memory/index.d.ts +7 -0
- package/dist/platform/memory/index.d.ts.map +1 -0
- package/dist/platform/memory/index.js +7 -0
- package/dist/platform/memory/index.js.map +1 -0
- package/dist/platform/memory/path.d.ts +7 -0
- package/dist/platform/memory/path.d.ts.map +1 -0
- package/dist/platform/memory/path.js +7 -0
- package/dist/platform/memory/path.js.map +1 -0
- package/dist/platform/memory/propose.d.ts +30 -0
- package/dist/platform/memory/propose.d.ts.map +1 -0
- package/dist/platform/memory/propose.js +71 -0
- package/dist/platform/memory/propose.js.map +1 -0
- package/dist/platform/memory/store.d.ts +64 -0
- package/dist/platform/memory/store.d.ts.map +1 -0
- package/dist/platform/memory/store.js +206 -0
- package/dist/platform/memory/store.js.map +1 -0
- package/dist/platform/option-schemas.d.ts +1225 -0
- package/dist/platform/option-schemas.d.ts.map +1 -0
- package/dist/platform/option-schemas.js +484 -0
- package/dist/platform/option-schemas.js.map +1 -0
- package/dist/platform/package-manager/index.d.ts +11 -2
- package/dist/platform/package-manager/index.d.ts.map +1 -1
- package/dist/platform/package-manager/index.js +24 -1
- package/dist/platform/package-manager/index.js.map +1 -1
- package/dist/platform/package-manager/list-parser.d.ts +4 -2
- package/dist/platform/package-manager/list-parser.d.ts.map +1 -1
- package/dist/platform/package-manager/list-parser.js +13 -4
- package/dist/platform/package-manager/list-parser.js.map +1 -1
- package/dist/platform/package-name.d.ts +11 -0
- package/dist/platform/package-name.d.ts.map +1 -0
- package/dist/platform/package-name.js +18 -0
- package/dist/platform/package-name.js.map +1 -0
- package/dist/platform/path-guard.d.ts +29 -0
- package/dist/platform/path-guard.d.ts.map +1 -0
- package/dist/platform/path-guard.js +113 -0
- package/dist/platform/path-guard.js.map +1 -0
- package/dist/platform/policy-loosening.d.ts +31 -0
- package/dist/platform/policy-loosening.d.ts.map +1 -0
- package/dist/platform/policy-loosening.js +371 -0
- package/dist/platform/policy-loosening.js.map +1 -0
- package/dist/platform/policy.d.ts +248 -1
- package/dist/platform/policy.d.ts.map +1 -1
- package/dist/platform/policy.js +23 -51
- package/dist/platform/policy.js.map +1 -1
- package/dist/platform/redact.d.ts +7 -0
- package/dist/platform/redact.d.ts.map +1 -0
- package/dist/platform/redact.js +11 -0
- package/dist/platform/redact.js.map +1 -0
- package/dist/platform/registry-config.d.ts +27 -0
- package/dist/platform/registry-config.d.ts.map +1 -0
- package/dist/platform/registry-config.js +175 -0
- package/dist/platform/registry-config.js.map +1 -0
- package/dist/platform/repair-agent.d.ts +84 -0
- package/dist/platform/repair-agent.d.ts.map +1 -0
- package/dist/platform/repair-agent.js +7 -0
- package/dist/platform/repair-agent.js.map +1 -0
- package/dist/platform/rollback.d.ts.map +1 -1
- package/dist/platform/rollback.js +12 -0
- package/dist/platform/rollback.js.map +1 -1
- package/dist/platform/supply-chain.d.ts +2 -1
- package/dist/platform/supply-chain.d.ts.map +1 -1
- package/dist/platform/supply-chain.js +10 -4
- package/dist/platform/supply-chain.js.map +1 -1
- package/dist/platform/track-record-path.d.ts +8 -0
- package/dist/platform/track-record-path.d.ts.map +1 -0
- package/dist/platform/track-record-path.js +8 -0
- package/dist/platform/track-record-path.js.map +1 -0
- package/dist/platform/types.d.ts +97 -4
- package/dist/platform/types.d.ts.map +1 -1
- package/dist/platform/types.js +6 -1
- package/dist/platform/types.js.map +1 -1
- package/dist/recipes/capture.d.ts +36 -0
- package/dist/recipes/capture.d.ts.map +1 -0
- package/dist/recipes/capture.js +153 -0
- package/dist/recipes/capture.js.map +1 -0
- package/dist/recipes/discover.d.ts +42 -0
- package/dist/recipes/discover.d.ts.map +1 -0
- package/dist/recipes/discover.js +152 -0
- package/dist/recipes/discover.js.map +1 -0
- package/dist/recipes/engine.d.ts +38 -0
- package/dist/recipes/engine.d.ts.map +1 -0
- package/dist/recipes/engine.js +174 -0
- package/dist/recipes/engine.js.map +1 -0
- package/dist/recipes/schema.d.ts +53 -0
- package/dist/recipes/schema.d.ts.map +1 -0
- package/dist/recipes/schema.js +126 -0
- package/dist/recipes/schema.js.map +1 -0
- package/dist/recipes/store.d.ts +33 -0
- package/dist/recipes/store.d.ts.map +1 -0
- package/dist/recipes/store.js +114 -0
- package/dist/recipes/store.js.map +1 -0
- package/dist/remediation/evaluate-package.d.ts.map +1 -1
- package/dist/remediation/evaluate-package.js +4 -2
- package/dist/remediation/evaluate-package.js.map +1 -1
- package/dist/remediation/impact/api-diff.d.ts +51 -0
- package/dist/remediation/impact/api-diff.d.ts.map +1 -0
- package/dist/remediation/impact/api-diff.js +374 -0
- package/dist/remediation/impact/api-diff.js.map +1 -0
- package/dist/remediation/impact/assess.d.ts +51 -0
- package/dist/remediation/impact/assess.d.ts.map +1 -0
- package/dist/remediation/impact/assess.js +118 -0
- package/dist/remediation/impact/assess.js.map +1 -0
- package/dist/remediation/impact/ast.d.ts +37 -0
- package/dist/remediation/impact/ast.d.ts.map +1 -0
- package/dist/remediation/impact/ast.js +201 -0
- package/dist/remediation/impact/ast.js.map +1 -0
- package/dist/remediation/impact/dts-surface.d.ts +48 -0
- package/dist/remediation/impact/dts-surface.d.ts.map +1 -0
- package/dist/remediation/impact/dts-surface.js +658 -0
- package/dist/remediation/impact/dts-surface.js.map +1 -0
- package/dist/remediation/impact/fix-diff.d.ts +84 -0
- package/dist/remediation/impact/fix-diff.d.ts.map +1 -0
- package/dist/remediation/impact/fix-diff.js +493 -0
- package/dist/remediation/impact/fix-diff.js.map +1 -0
- package/dist/remediation/impact/impact.d.ts +96 -0
- package/dist/remediation/impact/impact.d.ts.map +1 -0
- package/dist/remediation/impact/impact.js +404 -0
- package/dist/remediation/impact/impact.js.map +1 -0
- package/dist/remediation/impact/js-exports.d.ts +63 -0
- package/dist/remediation/impact/js-exports.d.ts.map +1 -0
- package/dist/remediation/impact/js-exports.js +546 -0
- package/dist/remediation/impact/js-exports.js.map +1 -0
- package/dist/remediation/impact/manifest-diff.d.ts +23 -0
- package/dist/remediation/impact/manifest-diff.d.ts.map +1 -0
- package/dist/remediation/impact/manifest-diff.js +223 -0
- package/dist/remediation/impact/manifest-diff.js.map +1 -0
- package/dist/remediation/impact/package-index.d.ts +37 -0
- package/dist/remediation/impact/package-index.d.ts.map +1 -0
- package/dist/remediation/impact/package-index.js +313 -0
- package/dist/remediation/impact/package-index.js.map +1 -0
- package/dist/remediation/impact/tarball.d.ts +43 -0
- package/dist/remediation/impact/tarball.d.ts.map +1 -0
- package/dist/remediation/impact/tarball.js +216 -0
- package/dist/remediation/impact/tarball.js.map +1 -0
- package/dist/remediation/impact/types.d.ts +42 -0
- package/dist/remediation/impact/types.d.ts.map +1 -0
- package/dist/remediation/impact/types.js +3 -0
- package/dist/remediation/impact/types.js.map +1 -0
- package/dist/remediation/impact/usage-index.d.ts +28 -0
- package/dist/remediation/impact/usage-index.d.ts.map +1 -0
- package/dist/remediation/impact/usage-index.js +406 -0
- package/dist/remediation/impact/usage-index.js.map +1 -0
- package/dist/remediation/local/fallback.d.ts.map +1 -1
- package/dist/remediation/local/fallback.js +1 -0
- package/dist/remediation/local/fallback.js.map +1 -1
- package/dist/remediation/local/options.d.ts +3 -0
- package/dist/remediation/local/options.d.ts.map +1 -1
- package/dist/remediation/local/options.js +2 -0
- package/dist/remediation/local/options.js.map +1 -1
- package/dist/remediation/local/primary-strategy.d.ts +4 -0
- package/dist/remediation/local/primary-strategy.d.ts.map +1 -1
- package/dist/remediation/local/primary-strategy.js +61 -17
- package/dist/remediation/local/primary-strategy.js.map +1 -1
- package/dist/remediation/local/run.d.ts.map +1 -1
- package/dist/remediation/local/run.js +85 -6
- package/dist/remediation/local/run.js.map +1 -1
- package/dist/remediation/local/sbom.d.ts +3 -1
- package/dist/remediation/local/sbom.d.ts.map +1 -1
- package/dist/remediation/local/sbom.js +15 -9
- package/dist/remediation/local/sbom.js.map +1 -1
- package/dist/remediation/local/secops-preflight.d.ts +2 -1
- package/dist/remediation/local/secops-preflight.d.ts.map +1 -1
- package/dist/remediation/local/secops-preflight.js +1 -0
- package/dist/remediation/local/secops-preflight.js.map +1 -1
- package/dist/remediation/local/select-target.d.ts +53 -0
- package/dist/remediation/local/select-target.d.ts.map +1 -0
- package/dist/remediation/local/select-target.js +74 -0
- package/dist/remediation/local/select-target.js.map +1 -0
- package/dist/remediation/patch/llm-generator.d.ts.map +1 -1
- package/dist/remediation/patch/llm-generator.js +4 -4
- package/dist/remediation/patch/llm-generator.js.map +1 -1
- package/dist/remediation/radar/changelog.d.ts +38 -0
- package/dist/remediation/radar/changelog.d.ts.map +1 -0
- package/dist/remediation/radar/changelog.js +311 -0
- package/dist/remediation/radar/changelog.js.map +1 -0
- package/dist/remediation/radar/code-diff.d.ts +30 -0
- package/dist/remediation/radar/code-diff.d.ts.map +1 -0
- package/dist/remediation/radar/code-diff.js +512 -0
- package/dist/remediation/radar/code-diff.js.map +1 -0
- package/dist/remediation/radar/metadata.d.ts +14 -0
- package/dist/remediation/radar/metadata.d.ts.map +1 -0
- package/dist/remediation/radar/metadata.js +105 -0
- package/dist/remediation/radar/metadata.js.map +1 -0
- package/dist/remediation/radar/model.d.ts +40 -0
- package/dist/remediation/radar/model.d.ts.map +1 -0
- package/dist/remediation/radar/model.js +74 -0
- package/dist/remediation/radar/model.js.map +1 -0
- package/dist/remediation/radar/sanitize.d.ts +15 -0
- package/dist/remediation/radar/sanitize.d.ts.map +1 -0
- package/dist/remediation/radar/sanitize.js +47 -0
- package/dist/remediation/radar/sanitize.js.map +1 -0
- package/dist/remediation/radar/score.d.ts +12 -0
- package/dist/remediation/radar/score.d.ts.map +1 -0
- package/dist/remediation/radar/score.js +27 -0
- package/dist/remediation/radar/score.js.map +1 -0
- package/dist/remediation/radar/types.d.ts +74 -0
- package/dist/remediation/radar/types.d.ts.map +1 -0
- package/dist/remediation/radar/types.js +65 -0
- package/dist/remediation/radar/types.js.map +1 -0
- package/dist/remediation/repair/attempt.d.ts +74 -0
- package/dist/remediation/repair/attempt.d.ts.map +1 -0
- package/dist/remediation/repair/attempt.js +262 -0
- package/dist/remediation/repair/attempt.js.map +1 -0
- package/dist/remediation/repair/builtin-agent.d.ts +9 -0
- package/dist/remediation/repair/builtin-agent.d.ts.map +1 -0
- package/dist/remediation/repair/builtin-agent.js +139 -0
- package/dist/remediation/repair/builtin-agent.js.map +1 -0
- package/dist/remediation/repair/patch-apply.d.ts +12 -0
- package/dist/remediation/repair/patch-apply.d.ts.map +1 -0
- package/dist/remediation/repair/patch-apply.js +75 -0
- package/dist/remediation/repair/patch-apply.js.map +1 -0
- package/dist/remediation/repair/recipe-attempt.d.ts +56 -0
- package/dist/remediation/repair/recipe-attempt.d.ts.map +1 -0
- package/dist/remediation/repair/recipe-attempt.js +99 -0
- package/dist/remediation/repair/recipe-attempt.js.map +1 -0
- package/dist/remediation/repair/scope-guard.d.ts +18 -0
- package/dist/remediation/repair/scope-guard.d.ts.map +1 -0
- package/dist/remediation/repair/scope-guard.js +62 -0
- package/dist/remediation/repair/scope-guard.js.map +1 -0
- package/dist/remediation/repair/tools.d.ts +30 -0
- package/dist/remediation/repair/tools.d.ts.map +1 -0
- package/dist/remediation/repair/tools.js +370 -0
- package/dist/remediation/repair/tools.js.map +1 -0
- package/dist/remediation/tools/apply-package-override/helpers.d.ts +0 -1
- package/dist/remediation/tools/apply-package-override/helpers.d.ts.map +1 -1
- package/dist/remediation/tools/apply-package-override/helpers.js +0 -30
- package/dist/remediation/tools/apply-package-override/helpers.js.map +1 -1
- package/dist/remediation/tools/apply-package-override/index.d.ts.map +1 -1
- package/dist/remediation/tools/apply-package-override/index.js +51 -13
- package/dist/remediation/tools/apply-package-override/index.js.map +1 -1
- package/dist/remediation/tools/apply-package-override/pnpm-workspace.d.ts +19 -0
- package/dist/remediation/tools/apply-package-override/pnpm-workspace.d.ts.map +1 -0
- package/dist/remediation/tools/apply-package-override/pnpm-workspace.js +47 -0
- package/dist/remediation/tools/apply-package-override/pnpm-workspace.js.map +1 -0
- package/dist/remediation/tools/apply-patch-file/index.js +1 -1
- package/dist/remediation/tools/apply-patch-file/index.js.map +1 -1
- package/dist/remediation/tools/apply-version-bump.d.ts.map +1 -1
- package/dist/remediation/tools/apply-version-bump.js +20 -45
- package/dist/remediation/tools/apply-version-bump.js.map +1 -1
- package/dist/remediation/tools/check-inventory.d.ts +6 -0
- package/dist/remediation/tools/check-inventory.d.ts.map +1 -1
- package/dist/remediation/tools/check-inventory.js +39 -8
- package/dist/remediation/tools/check-inventory.js.map +1 -1
- package/dist/remediation/tools/check-reachability.d.ts +6 -0
- package/dist/remediation/tools/check-reachability.d.ts.map +1 -1
- package/dist/remediation/tools/check-reachability.js +32 -12
- package/dist/remediation/tools/check-reachability.js.map +1 -1
- package/dist/remediation/tools/fetch-package-source.d.ts +1 -0
- package/dist/remediation/tools/fetch-package-source.d.ts.map +1 -1
- package/dist/remediation/tools/fetch-package-source.js +29 -22
- package/dist/remediation/tools/fetch-package-source.js.map +1 -1
- package/dist/remediation/tools/manifest-format.d.ts +7 -0
- package/dist/remediation/tools/manifest-format.d.ts.map +1 -0
- package/dist/remediation/tools/manifest-format.js +14 -0
- package/dist/remediation/tools/manifest-format.js.map +1 -0
- package/dist/remediation/verify/changes.d.ts +33 -0
- package/dist/remediation/verify/changes.d.ts.map +1 -0
- package/dist/remediation/verify/changes.js +204 -0
- package/dist/remediation/verify/changes.js.map +1 -0
- package/dist/remediation/verify/checks.d.ts +30 -0
- package/dist/remediation/verify/checks.d.ts.map +1 -0
- package/dist/remediation/verify/checks.js +239 -0
- package/dist/remediation/verify/checks.js.map +1 -0
- package/dist/remediation/verify/command-check.d.ts +11 -0
- package/dist/remediation/verify/command-check.d.ts.map +1 -0
- package/dist/remediation/verify/command-check.js +26 -0
- package/dist/remediation/verify/command-check.js.map +1 -0
- package/dist/remediation/verify/types.d.ts +66 -0
- package/dist/remediation/verify/types.d.ts.map +1 -0
- package/dist/remediation/verify/types.js +4 -0
- package/dist/remediation/verify/types.js.map +1 -0
- package/dist/remediation/verify/verifier.d.ts +12 -0
- package/dist/remediation/verify/verifier.d.ts.map +1 -0
- package/dist/remediation/verify/verifier.js +56 -0
- package/dist/remediation/verify/verifier.js.map +1 -0
- package/dist/runs/fingerprint.d.ts +14 -0
- package/dist/runs/fingerprint.d.ts.map +1 -0
- package/dist/runs/fingerprint.js +55 -0
- package/dist/runs/fingerprint.js.map +1 -0
- package/dist/runs/hash.d.ts +4 -0
- package/dist/runs/hash.d.ts.map +1 -0
- package/dist/runs/hash.js +18 -0
- package/dist/runs/hash.js.map +1 -0
- package/dist/runs/ids.d.ts +6 -0
- package/dist/runs/ids.d.ts.map +1 -0
- package/dist/runs/ids.js +15 -0
- package/dist/runs/ids.js.map +1 -0
- package/dist/runs/ledger.d.ts +26 -0
- package/dist/runs/ledger.d.ts.map +1 -0
- package/dist/runs/ledger.js +61 -0
- package/dist/runs/ledger.js.map +1 -0
- package/dist/runs/plan.d.ts +67 -0
- package/dist/runs/plan.d.ts.map +1 -0
- package/dist/runs/plan.js +68 -0
- package/dist/runs/plan.js.map +1 -0
- package/dist/runs/run-store.d.ts +83 -0
- package/dist/runs/run-store.d.ts.map +1 -0
- package/dist/runs/run-store.js +161 -0
- package/dist/runs/run-store.js.map +1 -0
- package/dist/runs/snapshot-store.d.ts +13 -0
- package/dist/runs/snapshot-store.d.ts.map +1 -0
- package/dist/runs/snapshot-store.js +78 -0
- package/dist/runs/snapshot-store.js.map +1 -0
- package/dist/runs/worktree.d.ts +40 -0
- package/dist/runs/worktree.d.ts.map +1 -0
- package/dist/runs/worktree.js +144 -0
- package/dist/runs/worktree.js.map +1 -0
- package/dist/scanner/delta-scan.d.ts +10 -1
- package/dist/scanner/delta-scan.d.ts.map +1 -1
- package/dist/scanner/delta-scan.js +15 -3
- package/dist/scanner/delta-scan.js.map +1 -1
- package/dist/scanner/lock-graph/bun.d.ts +6 -0
- package/dist/scanner/lock-graph/bun.d.ts.map +1 -0
- package/dist/scanner/lock-graph/bun.js +116 -0
- package/dist/scanner/lock-graph/bun.js.map +1 -0
- package/dist/scanner/lock-graph/index.d.ts +32 -0
- package/dist/scanner/lock-graph/index.d.ts.map +1 -0
- package/dist/scanner/lock-graph/index.js +125 -0
- package/dist/scanner/lock-graph/index.js.map +1 -0
- package/dist/scanner/lock-graph/npm.d.ts +4 -0
- package/dist/scanner/lock-graph/npm.d.ts.map +1 -0
- package/dist/scanner/lock-graph/npm.js +119 -0
- package/dist/scanner/lock-graph/npm.js.map +1 -0
- package/dist/scanner/lock-graph/pnpm.d.ts +4 -0
- package/dist/scanner/lock-graph/pnpm.d.ts.map +1 -0
- package/dist/scanner/lock-graph/pnpm.js +101 -0
- package/dist/scanner/lock-graph/pnpm.js.map +1 -0
- package/dist/scanner/lock-graph/types.d.ts +44 -0
- package/dist/scanner/lock-graph/types.d.ts.map +1 -0
- package/dist/scanner/lock-graph/types.js +32 -0
- package/dist/scanner/lock-graph/types.js.map +1 -0
- package/dist/scanner/lock-graph/yarn.d.ts +4 -0
- package/dist/scanner/lock-graph/yarn.d.ts.map +1 -0
- package/dist/scanner/lock-graph/yarn.js +132 -0
- package/dist/scanner/lock-graph/yarn.js.map +1 -0
- package/dist/scanner/lockfile-diff.d.ts.map +1 -1
- package/dist/scanner/lockfile-diff.js +2 -2
- package/dist/scanner/lockfile-diff.js.map +1 -1
- package/dist/scanner/pnpm-lock-document.d.ts +8 -0
- package/dist/scanner/pnpm-lock-document.d.ts.map +1 -0
- package/dist/scanner/pnpm-lock-document.js +15 -0
- package/dist/scanner/pnpm-lock-document.js.map +1 -0
- package/dist/trace/esm-instrument.d.ts +26 -0
- package/dist/trace/esm-instrument.d.ts.map +1 -0
- package/dist/trace/esm-instrument.js +153 -0
- package/dist/trace/esm-instrument.js.map +1 -0
- package/dist/trace/fold.d.ts +24 -0
- package/dist/trace/fold.d.ts.map +1 -0
- package/dist/trace/fold.js +169 -0
- package/dist/trace/fold.js.map +1 -0
- package/dist/trace/locate.d.ts +18 -0
- package/dist/trace/locate.d.ts.map +1 -0
- package/dist/trace/locate.js +55 -0
- package/dist/trace/locate.js.map +1 -0
- package/dist/trace/register.d.ts +2 -0
- package/dist/trace/register.d.ts.map +1 -0
- package/dist/trace/register.js +15 -0
- package/dist/trace/register.js.map +1 -0
- package/dist/trace/run.d.ts +42 -0
- package/dist/trace/run.d.ts.map +1 -0
- package/dist/trace/run.js +97 -0
- package/dist/trace/run.js.map +1 -0
- package/dist/trace/runtime.d.ts +9 -0
- package/dist/trace/runtime.d.ts.map +1 -0
- package/dist/trace/runtime.js +341 -0
- package/dist/trace/runtime.js.map +1 -0
- package/dist/trace/types.d.ts +98 -0
- package/dist/trace/types.d.ts.map +1 -0
- package/dist/trace/types.js +16 -0
- package/dist/trace/types.js.map +1 -0
- package/dist/trace/verdict.d.ts +8 -0
- package/dist/trace/verdict.d.ts.map +1 -0
- package/dist/trace/verdict.js +111 -0
- package/dist/trace/verdict.js.map +1 -0
- package/dist/trace/wrap.d.ts +32 -0
- package/dist/trace/wrap.d.ts.map +1 -0
- package/dist/trace/wrap.js +151 -0
- package/dist/trace/wrap.js.map +1 -0
- package/llms.txt +21 -3
- package/package.json +23 -17
- package/dist/openapi/handlers/routes.d.ts +0 -6
- package/dist/openapi/handlers/routes.d.ts.map +0 -1
- package/dist/openapi/handlers/routes.js +0 -122
- package/dist/openapi/handlers/routes.js.map +0 -1
- package/dist/openapi/path-guard.d.ts +0 -12
- package/dist/openapi/path-guard.d.ts.map +0 -1
- package/dist/openapi/path-guard.js +0 -79
- package/dist/openapi/path-guard.js.map +0 -1
- package/dist/openapi/spec/paths.d.ts +0 -1053
- package/dist/openapi/spec/paths.d.ts.map +0 -1
- package/dist/openapi/spec/paths.js +0 -623
- package/dist/openapi/spec/paths.js.map +0 -1
- package/dist/openapi/spec/schemas.d.ts +0 -74
- package/dist/openapi/spec/schemas.d.ts.map +0 -1
- package/dist/openapi/spec/schemas.js +0 -32
- package/dist/openapi/spec/schemas.js.map +0 -1
package/dist/cli/runners.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { readFileSync, writeFileSync } from "node:fs";
|
|
2
|
-
import {
|
|
2
|
+
import { createInterface } from "node:readline/promises";
|
|
3
|
+
import { analyzeDependencies, removeUnusedDependencies, applyPlan, assessUpgrade, findVulnerableSymbols, checkReachability, ciExitCode, EXIT_CODES, evaluatePackage, getRun, init, installHooks, HOOK_MANAGERS, HOOK_NAMES, guardPackages, guardGitDiff, guardExitCode, runHostHook, AGENT_HOSTS, inspectPatchArtifact, listPatchArtifacts, listRuns, planRemediation, remediatePortfolio, remediate, remediateFromScan, resumeRun, rollbackRun, scanDelta, buildSlaBreachSummary, buildStrategyCounts, buildDependencyScopeCounts, toCiSummary, toCycloneDxVex, toSarifOutput, updateOutdated, validatePatchArtifact, verifyRun, reconcilePatchArtifacts, proofEvidenceRefs, } from "../api/index.js";
|
|
3
4
|
import { PACKAGE_VERSION } from "../version.js";
|
|
5
|
+
import { formatAutonomyLine } from "./autonomy.js";
|
|
4
6
|
import { formatCountMap, logJson } from "./output.js";
|
|
5
7
|
import { runInteractiveTriage } from "./triage.js";
|
|
6
8
|
export { runInteractiveTriage };
|
|
@@ -38,33 +40,13 @@ function resolveDispositionPolicy(opts) {
|
|
|
38
40
|
policy.escalateOnKev = true;
|
|
39
41
|
return policy;
|
|
40
42
|
}
|
|
41
|
-
|
|
43
|
+
/**
|
|
44
|
+
* Every SDK option the shared CLI flags can set, built in one place. Each command used to spell this
|
|
45
|
+
* out itself, and the copies drifted: `portfolio` and `update-outdated` accepted flags such as
|
|
46
|
+
* `--proof-of-fix` and `--offline` and silently dropped them.
|
|
47
|
+
*/
|
|
48
|
+
export function toRemediateOptions(opts) {
|
|
42
49
|
return {
|
|
43
|
-
schemaVersion: "1.0",
|
|
44
|
-
status: report.results.some((result) => !result.applied && !result.dryRun)
|
|
45
|
-
? report.results.some((result) => result.applied || result.dryRun)
|
|
46
|
-
? "partial"
|
|
47
|
-
: "failed"
|
|
48
|
-
: "ok",
|
|
49
|
-
generatedAt: new Date().toISOString(),
|
|
50
|
-
cveIds: [report.cveId],
|
|
51
|
-
reports: [report],
|
|
52
|
-
successCount: report.results.filter((result) => result.applied || result.dryRun).length,
|
|
53
|
-
failedCount: report.results.filter((result) => !result.applied && !result.dryRun).length,
|
|
54
|
-
errors: [],
|
|
55
|
-
evidenceFile: report.evidenceFile,
|
|
56
|
-
patchCount: report.results.filter((result) => result.strategy === "patch-file").length,
|
|
57
|
-
strategyCounts: buildStrategyCounts([report]),
|
|
58
|
-
dependencyScopeCounts: buildDependencyScopeCounts([report]),
|
|
59
|
-
slaBreachSummary: buildSlaBreachSummary([report]),
|
|
60
|
-
correlation: report.correlation,
|
|
61
|
-
provenance: report.provenance,
|
|
62
|
-
constraints: report.constraints,
|
|
63
|
-
};
|
|
64
|
-
}
|
|
65
|
-
export async function runSingleCve(cveId, opts) {
|
|
66
|
-
const changeRequest = resolveChangeRequestOptions(opts);
|
|
67
|
-
const report = await remediate(cveId, {
|
|
68
50
|
cwd: opts.cwd,
|
|
69
51
|
packageManager: opts.packageManager,
|
|
70
52
|
dryRun: opts.dryRun,
|
|
@@ -108,14 +90,44 @@ export async function runSingleCve(cveId, opts) {
|
|
|
108
90
|
slaCheck: opts.slaCheck,
|
|
109
91
|
skipUnreachable: opts.skipUnreachable,
|
|
110
92
|
containmentMode: opts.containmentMode,
|
|
111
|
-
|
|
93
|
+
campaignMode: opts.campaignMode,
|
|
94
|
+
changeRequest: resolveChangeRequestOptions(opts),
|
|
112
95
|
dispositionPolicy: resolveDispositionPolicy(opts),
|
|
113
96
|
offlineIntelligence: opts.offline,
|
|
114
97
|
intelligenceSnapshotPath: opts.intelligenceSnapshot,
|
|
115
98
|
proofOfFix: opts.proofOfFix,
|
|
116
99
|
requireProofOfFix: opts.requireProofOfFix,
|
|
100
|
+
reproductionTest: opts.reproductionTest,
|
|
117
101
|
breakingChangeRefactor: opts.breakingChangeRefactor,
|
|
118
|
-
|
|
102
|
+
ignoreMemory: opts.ignoreMemory,
|
|
103
|
+
};
|
|
104
|
+
}
|
|
105
|
+
function asSingleCveScanReport(report) {
|
|
106
|
+
return {
|
|
107
|
+
schemaVersion: "1.0",
|
|
108
|
+
status: report.results.some((result) => !result.applied && !result.dryRun)
|
|
109
|
+
? report.results.some((result) => result.applied || result.dryRun)
|
|
110
|
+
? "partial"
|
|
111
|
+
: "failed"
|
|
112
|
+
: "ok",
|
|
113
|
+
generatedAt: new Date().toISOString(),
|
|
114
|
+
cveIds: [report.cveId],
|
|
115
|
+
reports: [report],
|
|
116
|
+
successCount: report.results.filter((result) => result.applied || result.dryRun).length,
|
|
117
|
+
failedCount: report.results.filter((result) => !result.applied && !result.dryRun).length,
|
|
118
|
+
errors: [],
|
|
119
|
+
evidenceFile: report.evidenceFile,
|
|
120
|
+
patchCount: report.results.filter((result) => result.strategy === "patch-file").length,
|
|
121
|
+
strategyCounts: buildStrategyCounts([report]),
|
|
122
|
+
dependencyScopeCounts: buildDependencyScopeCounts([report]),
|
|
123
|
+
slaBreachSummary: buildSlaBreachSummary([report]),
|
|
124
|
+
correlation: report.correlation,
|
|
125
|
+
provenance: report.provenance,
|
|
126
|
+
constraints: report.constraints,
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
export async function runSingleCve(cveId, opts) {
|
|
130
|
+
const report = await remediate(cveId, toRemediateOptions(opts));
|
|
119
131
|
const reportAsScan = asSingleCveScanReport(report);
|
|
120
132
|
if (opts.outputFormat === "sarif") {
|
|
121
133
|
logJson(toSarifOutput(reportAsScan));
|
|
@@ -125,7 +137,10 @@ export async function runSingleCve(cveId, opts) {
|
|
|
125
137
|
return;
|
|
126
138
|
}
|
|
127
139
|
if (opts.outputFormat === "cyclonedx-vex") {
|
|
128
|
-
logJson(toCycloneDxVex(reportAsScan, {
|
|
140
|
+
logJson(toCycloneDxVex(reportAsScan, {
|
|
141
|
+
toolVersion: PACKAGE_VERSION,
|
|
142
|
+
proofEvidence: proofEvidenceRefs(opts.cwd, opts.patchesDir),
|
|
143
|
+
}));
|
|
129
144
|
if (opts.ci) {
|
|
130
145
|
process.exitCode = ciExitCode(toCiSummary(reportAsScan));
|
|
131
146
|
}
|
|
@@ -139,6 +154,8 @@ export async function runSingleCve(cveId, opts) {
|
|
|
139
154
|
return;
|
|
140
155
|
}
|
|
141
156
|
process.stdout.write(`${report.summary}\n`);
|
|
157
|
+
if (report.autonomy)
|
|
158
|
+
process.stdout.write(`${formatAutonomyLine(report.autonomy)}\n`);
|
|
142
159
|
process.stdout.write(`Results: ${report.results.length}\n`);
|
|
143
160
|
if (reportAsScan.dependencyScopeCounts?.transitive != null &&
|
|
144
161
|
reportAsScan.dependencyScopeCounts.transitive > 0) {
|
|
@@ -182,61 +199,10 @@ export async function runScanInput(inputPath, opts) {
|
|
|
182
199
|
await runInteractiveTriage(inputPath, opts);
|
|
183
200
|
return;
|
|
184
201
|
}
|
|
185
|
-
const changeRequest = resolveChangeRequestOptions(opts);
|
|
186
202
|
const report = await remediateFromScan(inputPath, {
|
|
187
|
-
|
|
188
|
-
packageManager: opts.packageManager,
|
|
203
|
+
...toRemediateOptions(opts),
|
|
189
204
|
format: opts.format,
|
|
190
205
|
audit: opts.audit,
|
|
191
|
-
policy: opts.policy,
|
|
192
|
-
patchesDir: opts.patchesDir,
|
|
193
|
-
dryRun: opts.dryRun,
|
|
194
|
-
preview: opts.preview,
|
|
195
|
-
simulationMode: opts.simulationMode,
|
|
196
|
-
runTests: opts.runTests,
|
|
197
|
-
typecheck: opts.typecheck,
|
|
198
|
-
model: opts.model,
|
|
199
|
-
patchConfidenceThresholds: {
|
|
200
|
-
low: typeof opts.patchConfidenceLow === "number" ? opts.patchConfidenceLow : undefined,
|
|
201
|
-
medium: typeof opts.patchConfidenceMedium === "number" ? opts.patchConfidenceMedium : undefined,
|
|
202
|
-
high: typeof opts.patchConfidenceHigh === "number" ? opts.patchConfidenceHigh : undefined,
|
|
203
|
-
},
|
|
204
|
-
evidence: opts.evidence,
|
|
205
|
-
requestId: opts.requestId,
|
|
206
|
-
sessionId: opts.sessionId,
|
|
207
|
-
parentRunId: opts.parentRunId,
|
|
208
|
-
idempotencyKey: opts.idempotencyKey,
|
|
209
|
-
resume: opts.resume,
|
|
210
|
-
actor: opts.actor,
|
|
211
|
-
source: opts.source ?? "cli",
|
|
212
|
-
constraints: {
|
|
213
|
-
directDependenciesOnly: opts.directDependenciesOnly,
|
|
214
|
-
preferVersionBump: opts.preferVersionBump,
|
|
215
|
-
installMode: opts.installMode,
|
|
216
|
-
installPreferOffline: opts.installPreferOffline,
|
|
217
|
-
enforceFrozenLockfile: opts.enforceFrozenLockfile,
|
|
218
|
-
workspace: opts.workspace,
|
|
219
|
-
},
|
|
220
|
-
exploitSignalOverride: opts.kevMandatory || opts.epssThreshold != null
|
|
221
|
-
? {
|
|
222
|
-
kev: opts.kevMandatory ? { mandatory: true } : undefined,
|
|
223
|
-
epss: opts.epssThreshold != null
|
|
224
|
-
? { mandatory: true, threshold: opts.epssThreshold }
|
|
225
|
-
: undefined,
|
|
226
|
-
}
|
|
227
|
-
: undefined,
|
|
228
|
-
suppressionsFile: opts.suppressionsFile,
|
|
229
|
-
slaCheck: opts.slaCheck,
|
|
230
|
-
skipUnreachable: opts.skipUnreachable,
|
|
231
|
-
containmentMode: opts.containmentMode,
|
|
232
|
-
campaignMode: opts.campaignMode,
|
|
233
|
-
changeRequest,
|
|
234
|
-
dispositionPolicy: resolveDispositionPolicy(opts),
|
|
235
|
-
offlineIntelligence: opts.offline,
|
|
236
|
-
intelligenceSnapshotPath: opts.intelligenceSnapshot,
|
|
237
|
-
proofOfFix: opts.proofOfFix,
|
|
238
|
-
requireProofOfFix: opts.requireProofOfFix,
|
|
239
|
-
breakingChangeRefactor: opts.breakingChangeRefactor,
|
|
240
206
|
});
|
|
241
207
|
if (opts.summaryFile) {
|
|
242
208
|
const summary = toCiSummary(report);
|
|
@@ -250,7 +216,10 @@ export async function runScanInput(inputPath, opts) {
|
|
|
250
216
|
return;
|
|
251
217
|
}
|
|
252
218
|
if (opts.outputFormat === "cyclonedx-vex") {
|
|
253
|
-
logJson(toCycloneDxVex(report, {
|
|
219
|
+
logJson(toCycloneDxVex(report, {
|
|
220
|
+
toolVersion: PACKAGE_VERSION,
|
|
221
|
+
proofEvidence: proofEvidenceRefs(opts.cwd, opts.patchesDir),
|
|
222
|
+
}));
|
|
254
223
|
if (opts.ci) {
|
|
255
224
|
process.exitCode = ciExitCode(toCiSummary(report));
|
|
256
225
|
}
|
|
@@ -403,32 +372,9 @@ export async function runValidatePatch(patchPath, opts) {
|
|
|
403
372
|
}
|
|
404
373
|
}
|
|
405
374
|
export async function runUpdateOutdated(opts) {
|
|
406
|
-
const changeRequest = resolveChangeRequestOptions(opts);
|
|
407
375
|
const report = await updateOutdated({
|
|
408
|
-
|
|
409
|
-
packageManager: opts.packageManager,
|
|
410
|
-
dryRun: opts.dryRun,
|
|
411
|
-
runTests: opts.runTests,
|
|
412
|
-
evidence: opts.evidence,
|
|
413
|
-
policy: opts.policy,
|
|
414
|
-
patchesDir: opts.patchesDir,
|
|
376
|
+
...toRemediateOptions(opts),
|
|
415
377
|
includeTransitive: opts.includeTransitive,
|
|
416
|
-
requestId: opts.requestId,
|
|
417
|
-
sessionId: opts.sessionId,
|
|
418
|
-
parentRunId: opts.parentRunId,
|
|
419
|
-
idempotencyKey: opts.idempotencyKey,
|
|
420
|
-
resume: opts.resume,
|
|
421
|
-
actor: opts.actor,
|
|
422
|
-
source: opts.source ?? "cli",
|
|
423
|
-
constraints: {
|
|
424
|
-
directDependenciesOnly: opts.directDependenciesOnly,
|
|
425
|
-
preferVersionBump: opts.preferVersionBump,
|
|
426
|
-
installMode: opts.installMode,
|
|
427
|
-
installPreferOffline: opts.installPreferOffline,
|
|
428
|
-
enforceFrozenLockfile: opts.enforceFrozenLockfile,
|
|
429
|
-
workspace: opts.workspace,
|
|
430
|
-
},
|
|
431
|
-
changeRequest,
|
|
432
378
|
});
|
|
433
379
|
if (opts.outputFormat === "json") {
|
|
434
380
|
logJson(report);
|
|
@@ -447,8 +393,12 @@ export async function runUpdateOutdated(opts) {
|
|
|
447
393
|
}
|
|
448
394
|
}
|
|
449
395
|
}
|
|
396
|
+
function portfolioExitCode(report) {
|
|
397
|
+
if (report.failedCount <= 0)
|
|
398
|
+
return EXIT_CODES.ok;
|
|
399
|
+
return report.successCount > 0 ? EXIT_CODES.partial : EXIT_CODES.failed;
|
|
400
|
+
}
|
|
450
401
|
export async function runPortfolio(targetsFilePath, opts) {
|
|
451
|
-
const changeRequest = resolveChangeRequestOptions(opts);
|
|
452
402
|
let parsedTargets;
|
|
453
403
|
try {
|
|
454
404
|
parsedTargets = JSON.parse(readFileSync(targetsFilePath, "utf8"));
|
|
@@ -459,57 +409,11 @@ export async function runPortfolio(targetsFilePath, opts) {
|
|
|
459
409
|
if (!Array.isArray(parsedTargets)) {
|
|
460
410
|
throw new Error("Portfolio targets file must be a JSON array.");
|
|
461
411
|
}
|
|
462
|
-
const report = await remediatePortfolio(parsedTargets,
|
|
463
|
-
cwd: opts.cwd,
|
|
464
|
-
packageManager: opts.packageManager,
|
|
465
|
-
dryRun: opts.dryRun,
|
|
466
|
-
preview: opts.preview,
|
|
467
|
-
simulationMode: opts.simulationMode,
|
|
468
|
-
runTests: opts.runTests,
|
|
469
|
-
patchesDir: opts.patchesDir,
|
|
470
|
-
policy: opts.policy,
|
|
471
|
-
evidence: opts.evidence,
|
|
472
|
-
model: opts.model,
|
|
473
|
-
patchConfidenceThresholds: {
|
|
474
|
-
low: typeof opts.patchConfidenceLow === "number" ? opts.patchConfidenceLow : undefined,
|
|
475
|
-
medium: typeof opts.patchConfidenceMedium === "number" ? opts.patchConfidenceMedium : undefined,
|
|
476
|
-
high: typeof opts.patchConfidenceHigh === "number" ? opts.patchConfidenceHigh : undefined,
|
|
477
|
-
},
|
|
478
|
-
requestId: opts.requestId,
|
|
479
|
-
sessionId: opts.sessionId,
|
|
480
|
-
parentRunId: opts.parentRunId,
|
|
481
|
-
idempotencyKey: opts.idempotencyKey,
|
|
482
|
-
resume: opts.resume,
|
|
483
|
-
actor: opts.actor,
|
|
484
|
-
source: opts.source ?? "cli",
|
|
485
|
-
constraints: {
|
|
486
|
-
directDependenciesOnly: opts.directDependenciesOnly,
|
|
487
|
-
preferVersionBump: opts.preferVersionBump,
|
|
488
|
-
installMode: opts.installMode,
|
|
489
|
-
installPreferOffline: opts.installPreferOffline,
|
|
490
|
-
enforceFrozenLockfile: opts.enforceFrozenLockfile,
|
|
491
|
-
workspace: opts.workspace,
|
|
492
|
-
},
|
|
493
|
-
exploitSignalOverride: opts.kevMandatory || opts.epssThreshold != null
|
|
494
|
-
? {
|
|
495
|
-
kev: opts.kevMandatory ? { mandatory: true } : undefined,
|
|
496
|
-
epss: opts.epssThreshold != null
|
|
497
|
-
? { mandatory: true, threshold: opts.epssThreshold }
|
|
498
|
-
: undefined,
|
|
499
|
-
}
|
|
500
|
-
: undefined,
|
|
501
|
-
suppressionsFile: opts.suppressionsFile,
|
|
502
|
-
slaCheck: opts.slaCheck,
|
|
503
|
-
skipUnreachable: opts.skipUnreachable,
|
|
504
|
-
containmentMode: opts.containmentMode,
|
|
505
|
-
campaignMode: opts.campaignMode,
|
|
506
|
-
changeRequest,
|
|
507
|
-
dispositionPolicy: resolveDispositionPolicy(opts),
|
|
508
|
-
});
|
|
412
|
+
const report = await remediatePortfolio(parsedTargets, toRemediateOptions(opts));
|
|
509
413
|
if (opts.outputFormat === "json") {
|
|
510
414
|
logJson(report);
|
|
511
415
|
if (opts.ci) {
|
|
512
|
-
process.exitCode = report
|
|
416
|
+
process.exitCode = portfolioExitCode(report);
|
|
513
417
|
}
|
|
514
418
|
return;
|
|
515
419
|
}
|
|
@@ -517,7 +421,7 @@ export async function runPortfolio(targetsFilePath, opts) {
|
|
|
517
421
|
process.stdout.write(`Successful targets: ${report.successCount}\n`);
|
|
518
422
|
process.stdout.write(`Failed targets: ${report.failedCount}\n`);
|
|
519
423
|
if (opts.ci) {
|
|
520
|
-
process.exitCode = report
|
|
424
|
+
process.exitCode = portfolioExitCode(report);
|
|
521
425
|
}
|
|
522
426
|
}
|
|
523
427
|
export async function runReachability(opts) {
|
|
@@ -525,6 +429,7 @@ export async function runReachability(opts) {
|
|
|
525
429
|
cwd: opts.cwd,
|
|
526
430
|
packageName: opts.package,
|
|
527
431
|
symbol: opts.symbol,
|
|
432
|
+
traceFile: opts.traceFile,
|
|
528
433
|
});
|
|
529
434
|
if (opts.outputFormat === "json") {
|
|
530
435
|
logJson(result);
|
|
@@ -533,6 +438,10 @@ export async function runReachability(opts) {
|
|
|
533
438
|
process.stdout.write(`Package: ${result.packageName}\n`);
|
|
534
439
|
process.stdout.write(`Status: ${result.status}\n`);
|
|
535
440
|
process.stdout.write(`Reason: ${result.reason}\n`);
|
|
441
|
+
if (result.runtime) {
|
|
442
|
+
process.stdout.write(`Runtime: ${result.runtime.verdict}\n`);
|
|
443
|
+
process.stdout.write(`Note: ${result.runtime.caveat}\n`);
|
|
444
|
+
}
|
|
536
445
|
if (result.evidence && result.evidence.length > 0) {
|
|
537
446
|
process.stdout.write(`Evidence files (${result.evidence.length}):\n`);
|
|
538
447
|
for (const ev of result.evidence) {
|
|
@@ -619,4 +528,524 @@ export async function runReconcilePatches(opts) {
|
|
|
619
528
|
}
|
|
620
529
|
}
|
|
621
530
|
}
|
|
531
|
+
export async function runPlan(cveId, opts) {
|
|
532
|
+
// A plan is always a preview; planRemediation rejects the flags that would say otherwise.
|
|
533
|
+
const { dryRun: _dryRun, preview: _preview, ...options } = toRemediateOptions(opts);
|
|
534
|
+
const report = await planRemediation(cveId, options);
|
|
535
|
+
if (opts.outputFormat === "json") {
|
|
536
|
+
logJson(report);
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
process.stdout.write(`${report.summary}\n`);
|
|
540
|
+
if (report.autonomy)
|
|
541
|
+
process.stdout.write(`${formatAutonomyLine(report.autonomy)}\n`);
|
|
542
|
+
if (report.runId) {
|
|
543
|
+
process.stdout.write(`Plan: ${report.planId}\nRun: ${report.runId}\n`);
|
|
544
|
+
process.stdout.write(`Apply it with: autoremediator runs apply ${report.runId}\n`);
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
export async function runRunsList(opts) {
|
|
548
|
+
const runs = listRuns({
|
|
549
|
+
cwd: opts.cwd,
|
|
550
|
+
status: opts.status,
|
|
551
|
+
limit: opts.limit,
|
|
552
|
+
});
|
|
553
|
+
if (opts.outputFormat === "json") {
|
|
554
|
+
logJson(runs);
|
|
555
|
+
return;
|
|
556
|
+
}
|
|
557
|
+
if (runs.length === 0) {
|
|
558
|
+
process.stdout.write("No runs recorded.\n");
|
|
559
|
+
return;
|
|
560
|
+
}
|
|
561
|
+
for (const run of runs) {
|
|
562
|
+
process.stdout.write(`${run.runId} ${run.status.padEnd(11)} ${run.cveIds.join(",")} ${run.createdAt}\n`);
|
|
563
|
+
}
|
|
564
|
+
}
|
|
565
|
+
export async function runRunsShow(runId, opts) {
|
|
566
|
+
const details = getRun({ cwd: opts.cwd, runId });
|
|
567
|
+
if (opts.outputFormat === "json") {
|
|
568
|
+
logJson(details);
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
const { run, plan } = details;
|
|
572
|
+
process.stdout.write(`Run ${run.runId}: ${run.status}\n`);
|
|
573
|
+
if (plan) {
|
|
574
|
+
process.stdout.write(`Plan ${plan.planId}: ${plan.items.length} change(s), ${plan.skipped.length} skipped\n`);
|
|
575
|
+
for (const item of plan.items) {
|
|
576
|
+
const outcome = details.items.find((candidate) => candidate.itemId === item.itemId);
|
|
577
|
+
process.stdout.write(` ${outcome?.status ?? "pending".padEnd(7)} ${item.packageName} ${item.fromVersion} -> ${item.toVersion} (${item.strategy}${item.rollback ? ", rollback" : ""}) [${item.itemId}]\n`);
|
|
578
|
+
}
|
|
579
|
+
for (const skip of plan.skipped) {
|
|
580
|
+
process.stdout.write(` skipped ${skip.packageName}: ${skip.reason}\n`);
|
|
581
|
+
}
|
|
582
|
+
}
|
|
583
|
+
process.stdout.write(details.ledger.ok
|
|
584
|
+
? `Ledger: ${details.ledger.events.length} events, intact\n`
|
|
585
|
+
: `Ledger: FAILED VERIFICATION (${details.ledger.reason})\n`);
|
|
586
|
+
}
|
|
587
|
+
function printRunReport(report) {
|
|
588
|
+
process.stdout.write(`${report.message}\n`);
|
|
589
|
+
if (report.autonomy)
|
|
590
|
+
process.stdout.write(`${formatAutonomyLine(report.autonomy)}\n`);
|
|
591
|
+
for (const item of report.items) {
|
|
592
|
+
process.stdout.write(` ${item.status} ${item.packageName} ${item.fromVersion} -> ${item.toVersion}: ${item.message}\n`);
|
|
593
|
+
}
|
|
594
|
+
if (report.pending.length > 0) {
|
|
595
|
+
process.stdout.write(`Pending: ${report.pending.join(", ")}\n`);
|
|
596
|
+
}
|
|
597
|
+
}
|
|
598
|
+
export async function runRunsApply(runId, opts) {
|
|
599
|
+
const report = await applyPlan({
|
|
600
|
+
cwd: opts.cwd,
|
|
601
|
+
runId,
|
|
602
|
+
planId: opts.planId,
|
|
603
|
+
itemIds: opts.item,
|
|
604
|
+
// `--no-verify` arrives as verify: false; verification is on unless it is turned off.
|
|
605
|
+
...(opts.verify === false ? { verify: false } : {}),
|
|
606
|
+
// `--repair` / `--no-repair`; unset means "on when a model is configured".
|
|
607
|
+
...(opts.repair === undefined ? {} : { repair: opts.repair }),
|
|
608
|
+
...(opts.model ? { model: opts.model } : {}),
|
|
609
|
+
...(opts.maxRepairRounds ? { repairBudget: { maxRepairRounds: opts.maxRepairRounds } } : {}),
|
|
610
|
+
});
|
|
611
|
+
if (opts.outputFormat === "json")
|
|
612
|
+
logJson(report);
|
|
613
|
+
else
|
|
614
|
+
printRunReport(report);
|
|
615
|
+
if (report.status !== "applied")
|
|
616
|
+
process.exitCode = 1;
|
|
617
|
+
}
|
|
618
|
+
export async function runRunsResume(runId, opts) {
|
|
619
|
+
const report = await resumeRun({ cwd: opts.cwd, runId });
|
|
620
|
+
if (opts.outputFormat === "json")
|
|
621
|
+
logJson(report);
|
|
622
|
+
else
|
|
623
|
+
printRunReport(report);
|
|
624
|
+
if (report.status !== "applied")
|
|
625
|
+
process.exitCode = 1;
|
|
626
|
+
}
|
|
627
|
+
export async function runRunsRollback(runId, opts) {
|
|
628
|
+
const report = await rollbackRun({ cwd: opts.cwd, runId, force: opts.force });
|
|
629
|
+
if (opts.outputFormat === "json")
|
|
630
|
+
logJson(report);
|
|
631
|
+
else
|
|
632
|
+
process.stdout.write(`${report.message}\n`);
|
|
633
|
+
}
|
|
634
|
+
export async function runRunsVerify(runId, opts) {
|
|
635
|
+
const result = await verifyRun({
|
|
636
|
+
cwd: opts.cwd,
|
|
637
|
+
runId,
|
|
638
|
+
...(opts.check ? { checks: opts.check } : {}),
|
|
639
|
+
...(opts.offline ? { offline: true } : {}),
|
|
640
|
+
});
|
|
641
|
+
if (opts.outputFormat === "json") {
|
|
642
|
+
logJson(result);
|
|
643
|
+
}
|
|
644
|
+
else {
|
|
645
|
+
process.stdout.write(`${result.passed ? "Verified" : `Failed (${result.failedCheck})`}\n`);
|
|
646
|
+
for (const check of result.checks) {
|
|
647
|
+
process.stdout.write(` ${check.status.padEnd(7)} ${check.name}: ${check.message}\n`);
|
|
648
|
+
for (const detail of check.details ?? [])
|
|
649
|
+
process.stdout.write(` ${detail}\n`);
|
|
650
|
+
}
|
|
651
|
+
}
|
|
652
|
+
if (!result.passed)
|
|
653
|
+
process.exitCode = 1;
|
|
654
|
+
}
|
|
655
|
+
function parseHosts(value) {
|
|
656
|
+
if (!value)
|
|
657
|
+
return undefined;
|
|
658
|
+
const hosts = value
|
|
659
|
+
.split(",")
|
|
660
|
+
.map((host) => host.trim())
|
|
661
|
+
.filter(Boolean);
|
|
662
|
+
const unknown = hosts.filter((host) => !AGENT_HOSTS.includes(host));
|
|
663
|
+
if (unknown.length > 0) {
|
|
664
|
+
throw new Error(`Unknown host: ${unknown.join(", ")}. Choose from ${AGENT_HOSTS.join(", ")}.`);
|
|
665
|
+
}
|
|
666
|
+
return hosts;
|
|
667
|
+
}
|
|
668
|
+
function describeInit(result, header) {
|
|
669
|
+
const lines = [header];
|
|
670
|
+
const { facts } = result;
|
|
671
|
+
lines.push(`Package manager ${facts.packageManager}, git host ${facts.gitHost}, CI ${facts.ci.join(", ") || "none"}`, `Agent hosts: ${result.hosts.join(", ") || "none found (use --hosts)"}`);
|
|
672
|
+
for (const change of result.changes) {
|
|
673
|
+
lines.push(` ${change.action.padEnd(9)} ${change.path}${change.action === "conflict" ? ` (${change.reason})` : ""}`);
|
|
674
|
+
}
|
|
675
|
+
return lines.join("\n");
|
|
676
|
+
}
|
|
677
|
+
async function confirmInteractively(question) {
|
|
678
|
+
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
679
|
+
try {
|
|
680
|
+
return /^y(es)?$/i.test((await rl.question(question)).trim());
|
|
681
|
+
}
|
|
682
|
+
finally {
|
|
683
|
+
rl.close();
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
export async function runInit(opts) {
|
|
687
|
+
const base = {
|
|
688
|
+
cwd: opts.cwd,
|
|
689
|
+
hosts: parseHosts(opts.hosts),
|
|
690
|
+
ci: opts.ci,
|
|
691
|
+
guard: opts.guard,
|
|
692
|
+
policy: opts.policy,
|
|
693
|
+
agentsMd: opts.agentsMd,
|
|
694
|
+
};
|
|
695
|
+
let result = await init({ ...base, check: opts.check, yes: opts.yes });
|
|
696
|
+
const json = opts.outputFormat === "json";
|
|
697
|
+
const interactive = !json && !opts.yes && !opts.check && process.stdin.isTTY && process.stdout.isTTY;
|
|
698
|
+
if (!json) {
|
|
699
|
+
process.stdout.write(`${describeInit(result, opts.check ? "Checking setup" : "Setup plan")}\n`);
|
|
700
|
+
if (!result.applied) {
|
|
701
|
+
for (const change of result.changes) {
|
|
702
|
+
if (change.diff)
|
|
703
|
+
process.stdout.write(`\n${change.diff}\n`);
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
}
|
|
707
|
+
if (interactive && result.drift) {
|
|
708
|
+
if (await confirmInteractively(`\nWrite ${result.changes.filter((c) => c.diff).length} file(s)? [y/N] `)) {
|
|
709
|
+
result = await init({ ...base, yes: true });
|
|
710
|
+
process.stdout.write("Done.\n");
|
|
711
|
+
}
|
|
712
|
+
return;
|
|
713
|
+
}
|
|
714
|
+
if (json)
|
|
715
|
+
logJson(result);
|
|
716
|
+
else if (result.applied)
|
|
717
|
+
process.stdout.write("\nWritten.\n");
|
|
718
|
+
else if (!opts.check && result.drift)
|
|
719
|
+
process.stdout.write("\nNothing written. Run again with --yes to apply.\n");
|
|
720
|
+
else if (!result.drift)
|
|
721
|
+
process.stdout.write("\nAlready set up.\n");
|
|
722
|
+
if (opts.check) {
|
|
723
|
+
if (result.drift || result.conflicts.length > 0)
|
|
724
|
+
process.exitCode = EXIT_CODES.failed;
|
|
725
|
+
}
|
|
726
|
+
else if (!result.applied && result.drift) {
|
|
727
|
+
// Changes are waiting for a yes that this run could not get.
|
|
728
|
+
process.exitCode = EXIT_CODES.needsApproval;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
731
|
+
function parseHookNames(value) {
|
|
732
|
+
if (!value)
|
|
733
|
+
return undefined;
|
|
734
|
+
const names = value
|
|
735
|
+
.split(",")
|
|
736
|
+
.map((name) => name.trim())
|
|
737
|
+
.filter(Boolean);
|
|
738
|
+
const unknown = names.filter((name) => !HOOK_NAMES.includes(name));
|
|
739
|
+
if (unknown.length > 0) {
|
|
740
|
+
throw new Error(`Unknown hook: ${unknown.join(", ")}. Choose from ${HOOK_NAMES.join(", ")}.`);
|
|
741
|
+
}
|
|
742
|
+
return names;
|
|
743
|
+
}
|
|
744
|
+
function parseHookManager(value) {
|
|
745
|
+
if (!value)
|
|
746
|
+
return undefined;
|
|
747
|
+
if (!HOOK_MANAGERS.includes(value)) {
|
|
748
|
+
throw new Error(`Unknown hook manager: ${value}. Choose from ${HOOK_MANAGERS.join(", ")}.`);
|
|
749
|
+
}
|
|
750
|
+
return value;
|
|
751
|
+
}
|
|
752
|
+
function describeHooks(result, header) {
|
|
753
|
+
const lines = [header, `Hook manager: ${result.manager} (${result.managerReason})`];
|
|
754
|
+
for (const hook of result.hooks) {
|
|
755
|
+
lines.push(` ${hook.state.padEnd(9)} ${hook.hook.padEnd(10)} ${hook.path} (${hook.detail})`);
|
|
756
|
+
}
|
|
757
|
+
for (const change of result.changes) {
|
|
758
|
+
if (change.action === "conflict")
|
|
759
|
+
lines.push(` conflict ${change.reason}`);
|
|
760
|
+
}
|
|
761
|
+
return lines.join("\n");
|
|
762
|
+
}
|
|
763
|
+
/** `hook install`, `hook uninstall` and `hook status`; same approval rules as `init`. */
|
|
764
|
+
export async function runHook(mode, opts) {
|
|
765
|
+
const base = {
|
|
766
|
+
cwd: opts.cwd,
|
|
767
|
+
hooks: parseHookNames(opts.hooks),
|
|
768
|
+
manager: parseHookManager(opts.manager),
|
|
769
|
+
uninstall: mode === "uninstall",
|
|
770
|
+
allowSharedHooksPath: opts.allowSharedHooksPath === true,
|
|
771
|
+
};
|
|
772
|
+
const check = mode === "status";
|
|
773
|
+
let result = await installHooks({ ...base, check, yes: check ? false : opts.yes });
|
|
774
|
+
const json = opts.outputFormat === "json";
|
|
775
|
+
const interactive = !json && !check && !opts.yes && process.stdin.isTTY && process.stdout.isTTY;
|
|
776
|
+
if (!json) {
|
|
777
|
+
const header = check
|
|
778
|
+
? "Hook status"
|
|
779
|
+
: mode === "uninstall"
|
|
780
|
+
? "Hook removal plan"
|
|
781
|
+
: "Hook install plan";
|
|
782
|
+
process.stdout.write(`${describeHooks(result, header)}\n`);
|
|
783
|
+
if (!result.applied && !check) {
|
|
784
|
+
for (const change of result.changes) {
|
|
785
|
+
if (change.diff)
|
|
786
|
+
process.stdout.write(`\n${change.diff}\n`);
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (interactive && result.drift) {
|
|
791
|
+
if (await confirmInteractively(`\nWrite ${result.changes.filter((c) => c.diff || c.action === "update").length} file(s)? [y/N] `)) {
|
|
792
|
+
result = await installHooks({ ...base, yes: true });
|
|
793
|
+
process.stdout.write("Done.\n");
|
|
794
|
+
for (const step of result.nextSteps)
|
|
795
|
+
process.stdout.write(`Next: ${step}\n`);
|
|
796
|
+
}
|
|
797
|
+
return;
|
|
798
|
+
}
|
|
799
|
+
if (json)
|
|
800
|
+
logJson(result);
|
|
801
|
+
else {
|
|
802
|
+
if (result.applied)
|
|
803
|
+
process.stdout.write("\nWritten.\n");
|
|
804
|
+
else if (!check && result.drift)
|
|
805
|
+
process.stdout.write("\nNothing written. Run again with --yes to apply.\n");
|
|
806
|
+
else if (!result.drift && result.conflicts.length === 0) {
|
|
807
|
+
process.stdout.write(mode === "uninstall"
|
|
808
|
+
? "\nNothing to remove.\n"
|
|
809
|
+
: check
|
|
810
|
+
? "\nAll hooks are installed.\n"
|
|
811
|
+
: "\nAlready installed.\n");
|
|
812
|
+
}
|
|
813
|
+
for (const step of result.nextSteps)
|
|
814
|
+
process.stdout.write(`Next: ${step}\n`);
|
|
815
|
+
}
|
|
816
|
+
if (check) {
|
|
817
|
+
if (result.drift || result.conflicts.length > 0)
|
|
818
|
+
process.exitCode = EXIT_CODES.failed;
|
|
819
|
+
}
|
|
820
|
+
else if (!result.applied && result.drift) {
|
|
821
|
+
// Changes are waiting for a yes that this run could not get.
|
|
822
|
+
process.exitCode = EXIT_CODES.needsApproval;
|
|
823
|
+
}
|
|
824
|
+
else if (result.conflicts.length > 0) {
|
|
825
|
+
process.exitCode = EXIT_CODES.failed;
|
|
826
|
+
}
|
|
827
|
+
}
|
|
828
|
+
function describeGuard(report) {
|
|
829
|
+
const lines = [
|
|
830
|
+
`${report.verdict.toUpperCase().padEnd(5)} ${report.spec}${report.resolvedVersion ? ` (${report.resolvedVersion})` : ""}`,
|
|
831
|
+
];
|
|
832
|
+
for (const finding of report.findings) {
|
|
833
|
+
lines.push(` ${finding.severity.padEnd(5)} ${finding.check}: ${finding.message}`);
|
|
834
|
+
}
|
|
835
|
+
if (report.alternative) {
|
|
836
|
+
const { packageName, version, reason } = report.alternative;
|
|
837
|
+
lines.push(` instead: ${packageName}${version ? `@${version}` : ""} (${reason})`);
|
|
838
|
+
}
|
|
839
|
+
return lines.join("\n");
|
|
840
|
+
}
|
|
841
|
+
export async function runGuard(specs, opts) {
|
|
842
|
+
const options = {
|
|
843
|
+
cwd: opts.cwd,
|
|
844
|
+
...(opts.minAgeHours === undefined ? {} : { minPublishAgeHours: opts.minAgeHours }),
|
|
845
|
+
...(opts.offline ? { offline: true } : {}),
|
|
846
|
+
};
|
|
847
|
+
if (opts.gitDiff) {
|
|
848
|
+
const result = await guardGitDiff({
|
|
849
|
+
...options,
|
|
850
|
+
...(opts.base ? { baseRef: opts.base } : {}),
|
|
851
|
+
...(opts.includeTransitive ? { includeTransitive: true } : {}),
|
|
852
|
+
});
|
|
853
|
+
if (opts.outputFormat === "json")
|
|
854
|
+
logJson(result);
|
|
855
|
+
else {
|
|
856
|
+
const head = `Dependencies added or changed since ${result.baseRef.slice(0, 12)}: ${result.checked} checked, ${result.skipped.length} skipped`;
|
|
857
|
+
const skipped = result.skipped.map((entry) => ` skip ${entry.packageName}@${entry.version}: ${entry.reason}`);
|
|
858
|
+
process.stdout.write(`${[head, ...skipped, ...result.reports.map((entry) => describeGuard(entry))].join("\n")}\n`);
|
|
859
|
+
}
|
|
860
|
+
process.exitCode = guardExitCode(result.reports);
|
|
861
|
+
return;
|
|
862
|
+
}
|
|
863
|
+
if (specs.length === 0) {
|
|
864
|
+
throw new Error("Name at least one package, or use --git-diff to check what changed in the working tree.");
|
|
865
|
+
}
|
|
866
|
+
const reports = await guardPackages(specs, options);
|
|
867
|
+
if (opts.outputFormat === "json")
|
|
868
|
+
logJson(reports.length === 1 ? reports[0] : reports);
|
|
869
|
+
else
|
|
870
|
+
process.stdout.write(`${reports.map((entry) => describeGuard(entry)).join("\n")}\n`);
|
|
871
|
+
process.exitCode = guardExitCode(reports);
|
|
872
|
+
}
|
|
873
|
+
async function readStdin() {
|
|
874
|
+
const chunks = [];
|
|
875
|
+
for await (const chunk of process.stdin)
|
|
876
|
+
chunks.push(Buffer.from(chunk));
|
|
877
|
+
return Buffer.concat(chunks).toString("utf8");
|
|
878
|
+
}
|
|
879
|
+
/** Agent pre-command hook: JSON on stdin, the host's permission decision on stdout, always exit 0. */
|
|
880
|
+
export async function runGuardHook(host = "claude-code") {
|
|
881
|
+
const output = await runHostHook(host, await readStdin());
|
|
882
|
+
if (output)
|
|
883
|
+
process.stdout.write(`${output}\n`);
|
|
884
|
+
}
|
|
885
|
+
const DIET_LIST_LIMIT = 12;
|
|
886
|
+
export function describeDiet(report, verbose = false) {
|
|
887
|
+
const lines = [];
|
|
888
|
+
const { summary, attackSurface } = report;
|
|
889
|
+
lines.push(`Dependency diet for ${report.root}`, `Attack-surface score: ${attackSurface.score}/100 (higher means more code you did not write runs in this project)`);
|
|
890
|
+
for (const component of attackSurface.components) {
|
|
891
|
+
lines.push(` ${component.points.toFixed(1).padStart(5)} / ${String(component.maxPoints).padEnd(2)} ${component.label}: ${component.value} [${component.formula}]`);
|
|
892
|
+
}
|
|
893
|
+
for (const limit of attackSurface.limits)
|
|
894
|
+
lines.push(` note: ${limit}`);
|
|
895
|
+
lines.push("", `Unused: ${summary.certainlyUnused} certainly, ${summary.probablyUnused} probably, ${summary.usedIndirectly} used indirectly. Replaceable: ${summary.replaceable}. Duplicated packages: ${summary.duplicatedPackages}.`);
|
|
896
|
+
for (const pkg of report.packages) {
|
|
897
|
+
const shown = pkg.unused.filter((entry) => verbose || entry.classification !== "used-indirectly");
|
|
898
|
+
if (shown.length === 0 && pkg.replaceable.length === 0)
|
|
899
|
+
continue;
|
|
900
|
+
lines.push("", `${pkg.name} (${pkg.dir})${pkg.node ? ` Node ${pkg.node.range} from ${pkg.node.source}` : " no Node minimum declared"}`);
|
|
901
|
+
for (const entry of shown) {
|
|
902
|
+
lines.push(` ${entry.classification.padEnd(16)} ${entry.name} (${entry.section})`, ` ${entry.reason}`);
|
|
903
|
+
if (entry.evidence?.length)
|
|
904
|
+
lines.push(` evidence: ${entry.evidence.join(", ")}`);
|
|
905
|
+
}
|
|
906
|
+
for (const entry of pkg.replaceable) {
|
|
907
|
+
lines.push(` ${entry.status.padEnd(16)} ${entry.name} -> ${entry.replacement} [${entry.fit}]`, ` ${entry.migration}`, ` ${entry.reason}`);
|
|
908
|
+
if (entry.caveat)
|
|
909
|
+
lines.push(` caveat: ${entry.caveat}`);
|
|
910
|
+
}
|
|
911
|
+
}
|
|
912
|
+
const { duplicates } = report;
|
|
913
|
+
lines.push("");
|
|
914
|
+
if (!duplicates.supported)
|
|
915
|
+
lines.push(`Duplicates: not analysed. ${duplicates.note ?? ""}`);
|
|
916
|
+
else if (duplicates.packages.length === 0)
|
|
917
|
+
lines.push("Duplicates: none.");
|
|
918
|
+
else {
|
|
919
|
+
lines.push(`Duplicates: ${duplicates.packages.length} packages installed at several versions (${duplicates.extraCopies} extra copies).`);
|
|
920
|
+
for (const entry of duplicates.packages.slice(0, verbose ? undefined : DIET_LIST_LIMIT)) {
|
|
921
|
+
lines.push(` ${entry.name} ${entry.versions.map((version) => version.version).join(", ")} [${entry.verdict}]`, ` ${entry.summary}`);
|
|
922
|
+
for (const version of entry.versions) {
|
|
923
|
+
const parents = version.parents
|
|
924
|
+
.slice(0, 4)
|
|
925
|
+
.map((parent) => `${parent.name}${parent.version ? `@${parent.version}` : ""}${parent.range ? ` (${parent.range})` : ""}`);
|
|
926
|
+
const more = version.parents.length > 4 ? ` and ${version.parents.length - 4} more` : "";
|
|
927
|
+
lines.push(` ${version.version} <- ${parents.join(", ")}${more}${version.movableTo ? ` [can move to ${version.movableTo}]` : ""}`);
|
|
928
|
+
}
|
|
929
|
+
}
|
|
930
|
+
if (!verbose && duplicates.packages.length > DIET_LIST_LIMIT) {
|
|
931
|
+
lines.push(` ... ${duplicates.packages.length - DIET_LIST_LIMIT} more (use --verbose or --output-format json)`);
|
|
932
|
+
}
|
|
933
|
+
}
|
|
934
|
+
for (const note of report.notes)
|
|
935
|
+
lines.push("", `note: ${note}`);
|
|
936
|
+
return lines.join("\n");
|
|
937
|
+
}
|
|
938
|
+
function describeDietApply(result) {
|
|
939
|
+
const lines = [result.message];
|
|
940
|
+
for (const removal of result.removals)
|
|
941
|
+
lines.push(` ${result.status === "removed" ? "removed" : "would remove"} ${removal.name} (${removal.section}, ${removal.dir})`);
|
|
942
|
+
for (const check of result.verification?.checks ?? [])
|
|
943
|
+
lines.push(` ${check.status.padEnd(7)} ${check.name}: ${check.message}`);
|
|
944
|
+
return lines.join("\n");
|
|
945
|
+
}
|
|
946
|
+
export async function runDiet(opts) {
|
|
947
|
+
if (opts.apply) {
|
|
948
|
+
const result = await removeUnusedDependencies({
|
|
949
|
+
cwd: opts.cwd,
|
|
950
|
+
...(opts.policy ? { policy: opts.policy } : {}),
|
|
951
|
+
...(opts.packageManager
|
|
952
|
+
? { packageManager: opts.packageManager }
|
|
953
|
+
: {}),
|
|
954
|
+
...(opts.runTests === undefined ? {} : { runTests: opts.runTests }),
|
|
955
|
+
...(opts.typecheck === undefined ? {} : { typecheck: opts.typecheck }),
|
|
956
|
+
});
|
|
957
|
+
if (opts.outputFormat === "json")
|
|
958
|
+
logJson(result);
|
|
959
|
+
else
|
|
960
|
+
process.stdout.write(`${describeDiet(result.report, opts.verbose)}\n\n${describeDietApply(result)}\n`);
|
|
961
|
+
if (result.status === "rolled-back" || result.status === "failed")
|
|
962
|
+
process.exitCode = EXIT_CODES.failed;
|
|
963
|
+
return;
|
|
964
|
+
}
|
|
965
|
+
const report = await analyzeDependencies({ cwd: opts.cwd });
|
|
966
|
+
if (opts.outputFormat === "json")
|
|
967
|
+
logJson(report);
|
|
968
|
+
else
|
|
969
|
+
process.stdout.write(`${describeDiet(report, opts.verbose)}\n`);
|
|
970
|
+
}
|
|
971
|
+
function describeSite(site) {
|
|
972
|
+
return `${site.file}:${site.line}${site.confidence === "name-match" ? " (name match)" : ""} ${site.text}`;
|
|
973
|
+
}
|
|
974
|
+
export async function runAssess(packageName, opts) {
|
|
975
|
+
const result = await assessUpgrade({
|
|
976
|
+
packageName,
|
|
977
|
+
from: opts.from,
|
|
978
|
+
to: opts.to,
|
|
979
|
+
cwd: opts.cwd,
|
|
980
|
+
});
|
|
981
|
+
if (opts.outputFormat === "json") {
|
|
982
|
+
logJson(result);
|
|
983
|
+
return;
|
|
984
|
+
}
|
|
985
|
+
process.stdout.write(`${result.packageName} ${result.fromVersion} -> ${result.toVersion}${result.upgradeLevel ? ` (${result.upgradeLevel})` : ""}\n`);
|
|
986
|
+
process.stdout.write(`Breakability: ${result.breakability.toUpperCase()} (score ${result.score})\n`);
|
|
987
|
+
process.stdout.write(`${result.summary}\n`);
|
|
988
|
+
for (const finding of result.findings) {
|
|
989
|
+
const where = finding.symbol
|
|
990
|
+
? ` ${finding.specifier ?? ""}${finding.symbol === "default" ? "" : `#${finding.symbol}`}${finding.member ? `.${finding.member}` : ""}`
|
|
991
|
+
: "";
|
|
992
|
+
process.stdout.write(`\n[${finding.severity}, ${finding.evidence}, ${finding.points} pts]${where}\n ${finding.reason}\n`);
|
|
993
|
+
if (finding.before !== undefined || finding.after !== undefined) {
|
|
994
|
+
if (finding.before !== undefined)
|
|
995
|
+
process.stdout.write(` before: ${finding.before}\n`);
|
|
996
|
+
if (finding.after !== undefined)
|
|
997
|
+
process.stdout.write(` after: ${finding.after}\n`);
|
|
998
|
+
}
|
|
999
|
+
for (const site of finding.affectedCallSites)
|
|
1000
|
+
process.stdout.write(` - ${describeSite(site)}\n`);
|
|
1001
|
+
if (finding.totalCallSites > finding.affectedCallSites.length) {
|
|
1002
|
+
process.stdout.write(` ... and ${finding.totalCallSites - finding.affectedCallSites.length} more\n`);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
if (result.limitations.length > 0) {
|
|
1006
|
+
process.stdout.write("\nLimitations:\n");
|
|
1007
|
+
for (const limitation of result.limitations)
|
|
1008
|
+
process.stdout.write(` - ${limitation}\n`);
|
|
1009
|
+
}
|
|
1010
|
+
}
|
|
1011
|
+
export async function runSymbols(packageName, opts) {
|
|
1012
|
+
const result = await findVulnerableSymbols({
|
|
1013
|
+
packageName,
|
|
1014
|
+
from: opts.from,
|
|
1015
|
+
to: opts.to,
|
|
1016
|
+
cwd: opts.cwd,
|
|
1017
|
+
advisoryText: opts.advisoryText,
|
|
1018
|
+
cwes: opts.cwe
|
|
1019
|
+
?.split(",")
|
|
1020
|
+
.map((entry) => entry.trim())
|
|
1021
|
+
.filter((entry) => entry !== ""),
|
|
1022
|
+
limit: opts.limit,
|
|
1023
|
+
checkReachability: opts.reachability,
|
|
1024
|
+
});
|
|
1025
|
+
if (opts.outputFormat === "json") {
|
|
1026
|
+
logJson(result);
|
|
1027
|
+
return;
|
|
1028
|
+
}
|
|
1029
|
+
process.stdout.write(`${result.packageName} ${result.fromVersion} -> ${result.toVersion}: candidate vulnerable symbols (HEURISTIC: a changed export is not proof it was the vulnerable one)\n`);
|
|
1030
|
+
process.stdout.write(`${result.candidates.length} of ${result.totalCandidates} candidate${result.totalCandidates === 1 ? "" : "s"} shown${result.reachableCount === undefined ? "" : `, ${result.reachableCount} reachable from this project`}\n`);
|
|
1031
|
+
for (const candidate of result.candidates) {
|
|
1032
|
+
process.stdout.write(`\n${candidate.score} ${candidate.specifier}${candidate.symbol === candidate.exportName ? `#${candidate.symbol}` : ` (${candidate.symbol})`} [${candidate.basis}] ${candidate.file}\n`);
|
|
1033
|
+
for (const reason of candidate.reasons)
|
|
1034
|
+
process.stdout.write(` ${reason}\n`);
|
|
1035
|
+
if (candidate.via.length > 0)
|
|
1036
|
+
process.stdout.write(` via: ${candidate.via.join(", ")}\n`);
|
|
1037
|
+
if (candidate.reachability) {
|
|
1038
|
+
process.stdout.write(` reachability: ${candidate.reachability.status} - ${candidate.reachability.reason}\n`);
|
|
1039
|
+
}
|
|
1040
|
+
}
|
|
1041
|
+
if (result.changedInternals.length > 0) {
|
|
1042
|
+
process.stdout.write(`\nChanged internals not tied to an export: ${result.changedInternals
|
|
1043
|
+
.slice(0, 10)
|
|
1044
|
+
.map((entry) => `${entry.name} (${entry.file})`)
|
|
1045
|
+
.join(", ")}${result.changedInternals.length > 10 ? ", ..." : ""}\n`);
|
|
1046
|
+
}
|
|
1047
|
+
process.stdout.write("\nLimitations:\n");
|
|
1048
|
+
for (const limitation of result.limitations)
|
|
1049
|
+
process.stdout.write(` - ${limitation}\n`);
|
|
1050
|
+
}
|
|
622
1051
|
//# sourceMappingURL=runners.js.map
|