@descryy/mcp 0.11.5 → 0.11.7
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/dist/action-handshake.d.ts +38 -0
- package/dist/action-handshake.d.ts.map +1 -0
- package/dist/action-handshake.js +127 -0
- package/dist/action-handshake.js.map +1 -0
- package/dist/bin/descry-mcp.d.ts +7 -0
- package/dist/bin/descry-mcp.d.ts.map +1 -0
- package/dist/bin/descry-mcp.js +73 -0
- package/dist/bin/descry-mcp.js.map +1 -0
- package/dist/browser/auth.d.ts +84 -0
- package/dist/browser/auth.d.ts.map +1 -0
- package/dist/browser/auth.js +233 -0
- package/dist/browser/auth.js.map +1 -0
- package/dist/browser/capability-probe.d.ts +109 -0
- package/dist/browser/capability-probe.d.ts.map +1 -0
- package/dist/browser/capability-probe.js +201 -0
- package/dist/browser/capability-probe.js.map +1 -0
- package/dist/browser/driver.d.ts +591 -0
- package/dist/browser/driver.d.ts.map +1 -0
- package/dist/browser/driver.js +116 -0
- package/dist/browser/driver.js.map +1 -0
- package/dist/browser/evidence.d.ts +28 -0
- package/dist/browser/evidence.d.ts.map +1 -0
- package/dist/browser/evidence.js +82 -0
- package/dist/browser/evidence.js.map +1 -0
- package/dist/browser/fake-driver.d.ts +116 -0
- package/dist/browser/fake-driver.d.ts.map +1 -0
- package/dist/browser/fake-driver.js +416 -0
- package/dist/browser/fake-driver.js.map +1 -0
- package/dist/browser/fault-attribution.d.ts +178 -0
- package/dist/browser/fault-attribution.d.ts.map +1 -0
- package/dist/browser/fault-attribution.js +266 -0
- package/dist/browser/fault-attribution.js.map +1 -0
- package/dist/browser/graph-write.d.ts +45 -0
- package/dist/browser/graph-write.d.ts.map +1 -0
- package/dist/browser/graph-write.js +103 -0
- package/dist/browser/graph-write.js.map +1 -0
- package/dist/browser/identity-graph-write.d.ts +55 -0
- package/dist/browser/identity-graph-write.d.ts.map +1 -0
- package/dist/browser/identity-graph-write.js +45 -0
- package/dist/browser/identity-graph-write.js.map +1 -0
- package/dist/browser/page-probe.d.ts +81 -0
- package/dist/browser/page-probe.d.ts.map +1 -0
- package/dist/browser/page-probe.js +202 -0
- package/dist/browser/page-probe.js.map +1 -0
- package/dist/browser/playwright-driver.d.ts +115 -0
- package/dist/browser/playwright-driver.d.ts.map +1 -0
- package/dist/browser/playwright-driver.js +1545 -0
- package/dist/browser/playwright-driver.js.map +1 -0
- package/dist/browser/provider.d.ts +26 -0
- package/dist/browser/provider.d.ts.map +1 -0
- package/dist/browser/provider.js +14 -0
- package/dist/browser/provider.js.map +1 -0
- package/dist/browser/reach-recording-session.d.ts +44 -0
- package/dist/browser/reach-recording-session.d.ts.map +1 -0
- package/dist/browser/reach-recording-session.js +151 -0
- package/dist/browser/reach-recording-session.js.map +1 -0
- package/dist/browser/reachability.d.ts +168 -0
- package/dist/browser/reachability.d.ts.map +1 -0
- package/dist/browser/reachability.js +294 -0
- package/dist/browser/reachability.js.map +1 -0
- package/dist/browser/registry.d.ts +126 -0
- package/dist/browser/registry.d.ts.map +1 -0
- package/dist/browser/registry.js +177 -0
- package/dist/browser/registry.js.map +1 -0
- package/dist/browser/scenario-provenance.d.ts +23 -0
- package/dist/browser/scenario-provenance.d.ts.map +1 -0
- package/dist/browser/scenario-provenance.js +73 -0
- package/dist/browser/scenario-provenance.js.map +1 -0
- package/dist/browser/scenario-resolve.d.ts +28 -0
- package/dist/browser/scenario-resolve.d.ts.map +1 -0
- package/dist/browser/scenario-resolve.js +96 -0
- package/dist/browser/scenario-resolve.js.map +1 -0
- package/dist/browser/scenario-runner.d.ts +72 -0
- package/dist/browser/scenario-runner.d.ts.map +1 -0
- package/dist/browser/scenario-runner.js +353 -0
- package/dist/browser/scenario-runner.js.map +1 -0
- package/dist/browser/stack-parser.d.ts +19 -0
- package/dist/browser/stack-parser.d.ts.map +1 -0
- package/dist/browser/stack-parser.js +85 -0
- package/dist/browser/stack-parser.js.map +1 -0
- package/dist/browser/tool-support.d.ts +71 -0
- package/dist/browser/tool-support.d.ts.map +1 -0
- package/dist/browser/tool-support.js +216 -0
- package/dist/browser/tool-support.js.map +1 -0
- package/dist/browser/url-scheme.d.ts +14 -0
- package/dist/browser/url-scheme.d.ts.map +1 -0
- package/dist/browser/url-scheme.js +38 -0
- package/dist/browser/url-scheme.js.map +1 -0
- package/dist/browser/wait-target.d.ts +37 -0
- package/dist/browser/wait-target.d.ts.map +1 -0
- package/dist/browser/wait-target.js +54 -0
- package/dist/browser/wait-target.js.map +1 -0
- package/dist/cancellation.d.ts +20 -0
- package/dist/cancellation.d.ts.map +1 -0
- package/dist/cancellation.js +41 -0
- package/dist/cancellation.js.map +1 -0
- package/dist/capped.d.ts +39 -0
- package/dist/capped.d.ts.map +1 -0
- package/dist/capped.js +43 -0
- package/dist/capped.js.map +1 -0
- package/dist/credential-store.d.ts +22 -0
- package/dist/credential-store.d.ts.map +1 -0
- package/dist/credential-store.js +33 -0
- package/dist/credential-store.js.map +1 -0
- package/dist/disclosure-ledger.d.ts +14 -0
- package/dist/disclosure-ledger.d.ts.map +1 -0
- package/dist/disclosure-ledger.js +18 -0
- package/dist/disclosure-ledger.js.map +1 -0
- package/dist/evidence/observed-route-evidence.d.ts +25 -0
- package/dist/evidence/observed-route-evidence.d.ts.map +1 -0
- package/dist/evidence/observed-route-evidence.js +76 -0
- package/dist/evidence/observed-route-evidence.js.map +1 -0
- package/dist/heap.d.ts +61 -0
- package/dist/heap.d.ts.map +1 -0
- package/dist/heap.js +82 -0
- package/dist/heap.js.map +1 -0
- package/dist/heartbeat.d.ts +46 -0
- package/dist/heartbeat.d.ts.map +1 -0
- package/dist/heartbeat.js +66 -0
- package/dist/heartbeat.js.map +1 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +19 -0
- package/dist/index.js.map +1 -0
- package/dist/module-trust.d.ts +37 -0
- package/dist/module-trust.d.ts.map +1 -0
- package/dist/module-trust.js +77 -0
- package/dist/module-trust.js.map +1 -0
- package/dist/path-confinement.d.ts +31 -0
- package/dist/path-confinement.d.ts.map +1 -0
- package/dist/path-confinement.js +44 -0
- package/dist/path-confinement.js.map +1 -0
- package/dist/planner/predict-then-propose.d.ts +134 -0
- package/dist/planner/predict-then-propose.d.ts.map +1 -0
- package/dist/planner/predict-then-propose.js +138 -0
- package/dist/planner/predict-then-propose.js.map +1 -0
- package/dist/planner/propose-journey.d.ts +75 -0
- package/dist/planner/propose-journey.d.ts.map +1 -0
- package/dist/planner/propose-journey.js +96 -0
- package/dist/planner/propose-journey.js.map +1 -0
- package/dist/protocol.d.ts +57 -0
- package/dist/protocol.d.ts.map +1 -0
- package/dist/protocol.js +90 -0
- package/dist/protocol.js.map +1 -0
- package/dist/ready-checks.d.ts +12 -0
- package/dist/ready-checks.d.ts.map +1 -0
- package/dist/ready-checks.js +43 -0
- package/dist/ready-checks.js.map +1 -0
- package/dist/registry.d.ts +103 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +327 -0
- package/dist/registry.js.map +1 -0
- package/dist/render.d.ts +623 -0
- package/dist/render.d.ts.map +1 -0
- package/dist/render.js +968 -0
- package/dist/render.js.map +1 -0
- package/dist/runtime-registry.d.ts +22 -0
- package/dist/runtime-registry.d.ts.map +1 -0
- package/dist/runtime-registry.js +142 -0
- package/dist/runtime-registry.js.map +1 -0
- package/dist/sandbox-defaults.d.ts +41 -0
- package/dist/sandbox-defaults.d.ts.map +1 -0
- package/dist/sandbox-defaults.js +14 -0
- package/dist/sandbox-defaults.js.map +1 -0
- package/dist/scenarios/browser-run-plan-projection.d.ts +161 -0
- package/dist/scenarios/browser-run-plan-projection.d.ts.map +1 -0
- package/dist/scenarios/browser-run-plan-projection.js +264 -0
- package/dist/scenarios/browser-run-plan-projection.js.map +1 -0
- package/dist/scenarios/credential-ref.d.ts +102 -0
- package/dist/scenarios/credential-ref.d.ts.map +1 -0
- package/dist/scenarios/credential-ref.js +148 -0
- package/dist/scenarios/credential-ref.js.map +1 -0
- package/dist/scenarios/index.d.ts +7 -0
- package/dist/scenarios/index.d.ts.map +1 -0
- package/dist/scenarios/index.js +7 -0
- package/dist/scenarios/index.js.map +1 -0
- package/dist/scenarios/parse.d.ts +18 -0
- package/dist/scenarios/parse.d.ts.map +1 -0
- package/dist/scenarios/parse.js +212 -0
- package/dist/scenarios/parse.js.map +1 -0
- package/dist/scenarios/scenario.d.ts +93 -0
- package/dist/scenarios/scenario.d.ts.map +1 -0
- package/dist/scenarios/scenario.js +27 -0
- package/dist/scenarios/scenario.js.map +1 -0
- package/dist/scenarios/secret-ref.d.ts +86 -0
- package/dist/scenarios/secret-ref.d.ts.map +1 -0
- package/dist/scenarios/secret-ref.js +125 -0
- package/dist/scenarios/secret-ref.js.map +1 -0
- package/dist/scenarios/storage.d.ts +21 -0
- package/dist/scenarios/storage.d.ts.map +1 -0
- package/dist/scenarios/storage.js +103 -0
- package/dist/scenarios/storage.js.map +1 -0
- package/dist/server.d.ts +61 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +642 -0
- package/dist/server.js.map +1 -0
- package/dist/session.d.ts +356 -0
- package/dist/session.d.ts.map +1 -0
- package/dist/session.js +779 -0
- package/dist/session.js.map +1 -0
- package/dist/tools/alias-kit.d.ts +29 -0
- package/dist/tools/alias-kit.d.ts.map +1 -0
- package/dist/tools/alias-kit.js +21 -0
- package/dist/tools/alias-kit.js.map +1 -0
- package/dist/tools/aliases.d.ts +42 -0
- package/dist/tools/aliases.d.ts.map +1 -0
- package/dist/tools/aliases.js +52 -0
- package/dist/tools/aliases.js.map +1 -0
- package/dist/tools/analyze-workspace.d.ts +52 -0
- package/dist/tools/analyze-workspace.d.ts.map +1 -0
- package/dist/tools/analyze-workspace.js +207 -0
- package/dist/tools/analyze-workspace.js.map +1 -0
- package/dist/tools/analyze.d.ts +163 -0
- package/dist/tools/analyze.d.ts.map +1 -0
- package/dist/tools/analyze.js +724 -0
- package/dist/tools/analyze.js.map +1 -0
- package/dist/tools/browser-click.d.ts +18 -0
- package/dist/tools/browser-click.d.ts.map +1 -0
- package/dist/tools/browser-click.js +110 -0
- package/dist/tools/browser-click.js.map +1 -0
- package/dist/tools/browser-close-session.d.ts +39 -0
- package/dist/tools/browser-close-session.d.ts.map +1 -0
- package/dist/tools/browser-close-session.js +120 -0
- package/dist/tools/browser-close-session.js.map +1 -0
- package/dist/tools/browser-fill.d.ts +18 -0
- package/dist/tools/browser-fill.d.ts.map +1 -0
- package/dist/tools/browser-fill.js +117 -0
- package/dist/tools/browser-fill.js.map +1 -0
- package/dist/tools/browser-navigate.d.ts +15 -0
- package/dist/tools/browser-navigate.d.ts.map +1 -0
- package/dist/tools/browser-navigate.js +106 -0
- package/dist/tools/browser-navigate.js.map +1 -0
- package/dist/tools/browser-read.d.ts +33 -0
- package/dist/tools/browser-read.d.ts.map +1 -0
- package/dist/tools/browser-read.js +105 -0
- package/dist/tools/browser-read.js.map +1 -0
- package/dist/tools/browser-run-scenario.d.ts +28 -0
- package/dist/tools/browser-run-scenario.d.ts.map +1 -0
- package/dist/tools/browser-run-scenario.js +238 -0
- package/dist/tools/browser-run-scenario.js.map +1 -0
- package/dist/tools/browser-save-scenario.d.ts +19 -0
- package/dist/tools/browser-save-scenario.d.ts.map +1 -0
- package/dist/tools/browser-save-scenario.js +447 -0
- package/dist/tools/browser-save-scenario.js.map +1 -0
- package/dist/tools/browser-select.d.ts +20 -0
- package/dist/tools/browser-select.d.ts.map +1 -0
- package/dist/tools/browser-select.js +120 -0
- package/dist/tools/browser-select.js.map +1 -0
- package/dist/tools/browser-snapshot.d.ts +46 -0
- package/dist/tools/browser-snapshot.d.ts.map +1 -0
- package/dist/tools/browser-snapshot.js +127 -0
- package/dist/tools/browser-snapshot.js.map +1 -0
- package/dist/tools/browser-start-session.d.ts +24 -0
- package/dist/tools/browser-start-session.d.ts.map +1 -0
- package/dist/tools/browser-start-session.js +653 -0
- package/dist/tools/browser-start-session.js.map +1 -0
- package/dist/tools/browser-submit.d.ts +18 -0
- package/dist/tools/browser-submit.d.ts.map +1 -0
- package/dist/tools/browser-submit.js +106 -0
- package/dist/tools/browser-submit.js.map +1 -0
- package/dist/tools/browser-type.d.ts +18 -0
- package/dist/tools/browser-type.d.ts.map +1 -0
- package/dist/tools/browser-type.js +115 -0
- package/dist/tools/browser-type.js.map +1 -0
- package/dist/tools/browser-wait-for.d.ts +45 -0
- package/dist/tools/browser-wait-for.d.ts.map +1 -0
- package/dist/tools/browser-wait-for.js +164 -0
- package/dist/tools/browser-wait-for.js.map +1 -0
- package/dist/tools/browser.d.ts +69 -0
- package/dist/tools/browser.d.ts.map +1 -0
- package/dist/tools/browser.js +326 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/chain.d.ts +41 -0
- package/dist/tools/chain.d.ts.map +1 -0
- package/dist/tools/chain.js +101 -0
- package/dist/tools/chain.js.map +1 -0
- package/dist/tools/change-scope.d.ts +25 -0
- package/dist/tools/change-scope.d.ts.map +1 -0
- package/dist/tools/change-scope.js +103 -0
- package/dist/tools/change-scope.js.map +1 -0
- package/dist/tools/code-context.d.ts +83 -0
- package/dist/tools/code-context.d.ts.map +1 -0
- package/dist/tools/code-context.js +432 -0
- package/dist/tools/code-context.js.map +1 -0
- package/dist/tools/contracts.d.ts +74 -0
- package/dist/tools/contracts.d.ts.map +1 -0
- package/dist/tools/contracts.js +214 -0
- package/dist/tools/contracts.js.map +1 -0
- package/dist/tools/cross-pr.d.ts +178 -0
- package/dist/tools/cross-pr.d.ts.map +1 -0
- package/dist/tools/cross-pr.js +362 -0
- package/dist/tools/cross-pr.js.map +1 -0
- package/dist/tools/disclosure.d.ts +75 -0
- package/dist/tools/disclosure.d.ts.map +1 -0
- package/dist/tools/disclosure.js +325 -0
- package/dist/tools/disclosure.js.map +1 -0
- package/dist/tools/draw-conclusion.d.ts +55 -0
- package/dist/tools/draw-conclusion.d.ts.map +1 -0
- package/dist/tools/draw-conclusion.js +243 -0
- package/dist/tools/draw-conclusion.js.map +1 -0
- package/dist/tools/git-context.d.ts +39 -0
- package/dist/tools/git-context.d.ts.map +1 -0
- package/dist/tools/git-context.js +374 -0
- package/dist/tools/git-context.js.map +1 -0
- package/dist/tools/git-diff.d.ts +45 -0
- package/dist/tools/git-diff.d.ts.map +1 -0
- package/dist/tools/git-diff.js +338 -0
- package/dist/tools/git-diff.js.map +1 -0
- package/dist/tools/git-history.d.ts +16 -0
- package/dist/tools/git-history.d.ts.map +1 -0
- package/dist/tools/git-history.js +106 -0
- package/dist/tools/git-history.js.map +1 -0
- package/dist/tools/history.d.ts +34 -0
- package/dist/tools/history.d.ts.map +1 -0
- package/dist/tools/history.js +121 -0
- package/dist/tools/history.js.map +1 -0
- package/dist/tools/impact.d.ts +46 -0
- package/dist/tools/impact.d.ts.map +1 -0
- package/dist/tools/impact.js +225 -0
- package/dist/tools/impact.js.map +1 -0
- package/dist/tools/index.d.ts +59 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/tools/index.js +70 -0
- package/dist/tools/index.js.map +1 -0
- package/dist/tools/kit.d.ts +165 -0
- package/dist/tools/kit.d.ts.map +1 -0
- package/dist/tools/kit.js +153 -0
- package/dist/tools/kit.js.map +1 -0
- package/dist/tools/link-workspace.d.ts +24 -0
- package/dist/tools/link-workspace.d.ts.map +1 -0
- package/dist/tools/link-workspace.js +131 -0
- package/dist/tools/link-workspace.js.map +1 -0
- package/dist/tools/lookup.d.ts +19 -0
- package/dist/tools/lookup.d.ts.map +1 -0
- package/dist/tools/lookup.js +63 -0
- package/dist/tools/lookup.js.map +1 -0
- package/dist/tools/mark-incident.d.ts +28 -0
- package/dist/tools/mark-incident.d.ts.map +1 -0
- package/dist/tools/mark-incident.js +171 -0
- package/dist/tools/mark-incident.js.map +1 -0
- package/dist/tools/merged-browser.d.ts +11 -0
- package/dist/tools/merged-browser.d.ts.map +1 -0
- package/dist/tools/merged-browser.js +20 -0
- package/dist/tools/merged-browser.js.map +1 -0
- package/dist/tools/merged-context.d.ts +11 -0
- package/dist/tools/merged-context.d.ts.map +1 -0
- package/dist/tools/merged-context.js +21 -0
- package/dist/tools/merged-context.js.map +1 -0
- package/dist/tools/merged-observe.d.ts +13 -0
- package/dist/tools/merged-observe.d.ts.map +1 -0
- package/dist/tools/merged-observe.js +21 -0
- package/dist/tools/merged-observe.js.map +1 -0
- package/dist/tools/merged-workspace.d.ts +14 -0
- package/dist/tools/merged-workspace.d.ts.map +1 -0
- package/dist/tools/merged-workspace.js +21 -0
- package/dist/tools/merged-workspace.js.map +1 -0
- package/dist/tools/observe-runtime.d.ts +262 -0
- package/dist/tools/observe-runtime.d.ts.map +1 -0
- package/dist/tools/observe-runtime.js +1966 -0
- package/dist/tools/observe-runtime.js.map +1 -0
- package/dist/tools/observe-tests.d.ts +57 -0
- package/dist/tools/observe-tests.d.ts.map +1 -0
- package/dist/tools/observe-tests.js +391 -0
- package/dist/tools/observe-tests.js.map +1 -0
- package/dist/tools/observe.d.ts +28 -0
- package/dist/tools/observe.d.ts.map +1 -0
- package/dist/tools/observe.js +291 -0
- package/dist/tools/observe.js.map +1 -0
- package/dist/tools/pr-analysis.d.ts +189 -0
- package/dist/tools/pr-analysis.d.ts.map +1 -0
- package/dist/tools/pr-analysis.js +365 -0
- package/dist/tools/pr-analysis.js.map +1 -0
- package/dist/tools/pre-push.d.ts +168 -0
- package/dist/tools/pre-push.d.ts.map +1 -0
- package/dist/tools/pre-push.js +416 -0
- package/dist/tools/pre-push.js.map +1 -0
- package/dist/tools/predict-reach.d.ts +57 -0
- package/dist/tools/predict-reach.d.ts.map +1 -0
- package/dist/tools/predict-reach.js +183 -0
- package/dist/tools/predict-reach.js.map +1 -0
- package/dist/tools/propagation.d.ts +37 -0
- package/dist/tools/propagation.d.ts.map +1 -0
- package/dist/tools/propagation.js +162 -0
- package/dist/tools/propagation.js.map +1 -0
- package/dist/tools/propose-journey.d.ts +16 -0
- package/dist/tools/propose-journey.d.ts.map +1 -0
- package/dist/tools/propose-journey.js +132 -0
- package/dist/tools/propose-journey.js.map +1 -0
- package/dist/tools/prove-reach.d.ts +74 -0
- package/dist/tools/prove-reach.d.ts.map +1 -0
- package/dist/tools/prove-reach.js +274 -0
- package/dist/tools/prove-reach.js.map +1 -0
- package/dist/tools/questions.d.ts +30 -0
- package/dist/tools/questions.d.ts.map +1 -0
- package/dist/tools/questions.js +230 -0
- package/dist/tools/questions.js.map +1 -0
- package/dist/tools/refusal-fetch.d.ts +35 -0
- package/dist/tools/refusal-fetch.d.ts.map +1 -0
- package/dist/tools/refusal-fetch.js +123 -0
- package/dist/tools/refusal-fetch.js.map +1 -0
- package/dist/tools/runtime-incident.d.ts +33 -0
- package/dist/tools/runtime-incident.d.ts.map +1 -0
- package/dist/tools/runtime-incident.js +67 -0
- package/dist/tools/runtime-incident.js.map +1 -0
- package/dist/tools/runtime-journey-drive.d.ts +102 -0
- package/dist/tools/runtime-journey-drive.d.ts.map +1 -0
- package/dist/tools/runtime-journey-drive.js +247 -0
- package/dist/tools/runtime-journey-drive.js.map +1 -0
- package/dist/tools/scope.d.ts +45 -0
- package/dist/tools/scope.d.ts.map +1 -0
- package/dist/tools/scope.js +217 -0
- package/dist/tools/scope.js.map +1 -0
- package/dist/tools/similar-incidents.d.ts +43 -0
- package/dist/tools/similar-incidents.d.ts.map +1 -0
- package/dist/tools/similar-incidents.js +190 -0
- package/dist/tools/similar-incidents.js.map +1 -0
- package/dist/tools/validate.d.ts +133 -0
- package/dist/tools/validate.d.ts.map +1 -0
- package/dist/tools/validate.js +488 -0
- package/dist/tools/validate.js.map +1 -0
- package/dist/tools/verb.d.ts +46 -0
- package/dist/tools/verb.d.ts.map +1 -0
- package/dist/tools/verb.js +78 -0
- package/dist/tools/verb.js.map +1 -0
- package/dist/tools/verification-status.d.ts +38 -0
- package/dist/tools/verification-status.d.ts.map +1 -0
- package/dist/tools/verification-status.js +203 -0
- package/dist/tools/verification-status.js.map +1 -0
- package/dist/tools/verify-claim.d.ts +29 -0
- package/dist/tools/verify-claim.d.ts.map +1 -0
- package/dist/tools/verify-claim.js +218 -0
- package/dist/tools/verify-claim.js.map +1 -0
- package/dist/tools/workspace.d.ts +28 -0
- package/dist/tools/workspace.d.ts.map +1 -0
- package/dist/tools/workspace.js +94 -0
- package/dist/tools/workspace.js.map +1 -0
- package/dist/transport.d.ts +32 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +85 -0
- package/dist/transport.js.map +1 -0
- package/dist/workspace-index.d.ts +164 -0
- package/dist/workspace-index.d.ts.map +1 -0
- package/dist/workspace-index.js +381 -0
- package/dist/workspace-index.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,338 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `get_git_diff` — §18's "other useful Git tool": a live textual diff
|
|
3
|
+
* between two refs. P27's disclosed remainder — `ai-layer-plan.md` §3's
|
|
4
|
+
* re-derivation found `history.ts`'s own header already stating why it
|
|
5
|
+
* cannot be stretched into this shape: it is scoped to the stored
|
|
6
|
+
* `CHANGES_WITH` ledger, not a live `git diff`. `changedFiles`
|
|
7
|
+
* (`cross-pr.ts`) answers "which files changed" as a bare path list; this
|
|
8
|
+
* answers "what changed in them" — per-file status and line counts always,
|
|
9
|
+
* plus the unified-diff patch text when it is cheap enough to hand to a
|
|
10
|
+
* model (§4: the client's context window is not this tool's to spend).
|
|
11
|
+
*/
|
|
12
|
+
import { applyReplySizeBudget, changedFiles, gitDiff, gitWorkingTreeChange, TOTAL_PATCH_BUDGET_REASON_PREFIX, } from "@descryy/core";
|
|
13
|
+
import { answer, optionalInteger, descryOwnState, optionalString, ToolInputError, optionalStringArray, } from "./kit.js";
|
|
14
|
+
const DEFAULT_LIMIT = 200;
|
|
15
|
+
/**
|
|
16
|
+
* The stable prefix of `patchOmittedReason` when the *reply's* size ceiling,
|
|
17
|
+
* rather than either patch budget, is what withheld a patch. A third reason a
|
|
18
|
+
* caller can tell apart from the other two — and it calls for the same action
|
|
19
|
+
* as the total patch budget (re-request narrowed), not for raising a limit,
|
|
20
|
+
* because this ceiling is not the caller's to raise.
|
|
21
|
+
*/
|
|
22
|
+
const REPLY_BUDGET_REASON_PREFIX = "the reply's overall size ceiling";
|
|
23
|
+
/** Bytes this file costs in the encoded `files` array — its JSON plus a separator. */
|
|
24
|
+
function fileBytes(file) {
|
|
25
|
+
return Buffer.byteLength(JSON.stringify(file), "utf8") + 1;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* `fitToBudget` — the second half of the fix the aggregate patch budget was
|
|
29
|
+
* only the first half of.
|
|
30
|
+
*
|
|
31
|
+
* `maxTotalPatchBytes` bounds the patches and nothing else, so the same real
|
|
32
|
+
* 48-file diff that motivated it still failed after it shipped: 48 files of
|
|
33
|
+
* status/additions/deletions rows plus disclosures plus the capped patches
|
|
34
|
+
* summed past the host's ceiling and the reply was rejected whole. This bounds
|
|
35
|
+
* what the tool actually returns — patches withheld first, then files dropped
|
|
36
|
+
* from the list if the bare rows alone do not fit — and says which of the two
|
|
37
|
+
* happened, so the caller re-requests narrowed instead of reading a short list
|
|
38
|
+
* as the whole diff.
|
|
39
|
+
*/
|
|
40
|
+
function fitDiff(identity, shown, filesTotal, budgetBytes) {
|
|
41
|
+
const scaffold = Buffer.byteLength(JSON.stringify({ ...identity, files: [], filesTotal }), "utf8");
|
|
42
|
+
const fitted = applyReplySizeBudget(shown, {
|
|
43
|
+
maxTotalBytes: budgetBytes,
|
|
44
|
+
overheadBytes: scaffold,
|
|
45
|
+
sizeOf: fileBytes,
|
|
46
|
+
hasPayload: (f) => f.patch !== null,
|
|
47
|
+
// Deliberately terse, unlike the other two reasons. This one can land on
|
|
48
|
+
// every file in a 200-file reply, and a 200-character sentence repeated
|
|
49
|
+
// 200 times costs more than the patches it is apologising for — the same
|
|
50
|
+
// arithmetic that made the per-call disclosure boilerplate worth deduping.
|
|
51
|
+
// What to do about it is stated once, in the reply-level note below.
|
|
52
|
+
withhold: (f) => ({
|
|
53
|
+
...f,
|
|
54
|
+
patch: null,
|
|
55
|
+
patchOmittedReason: `${REPLY_BUDGET_REASON_PREFIX} left no room for it`,
|
|
56
|
+
}),
|
|
57
|
+
});
|
|
58
|
+
const notes = [];
|
|
59
|
+
if (fitted.withheldCount > 0) {
|
|
60
|
+
notes.push(`${fitted.withheldCount} of the listed file(s) had their patch text withheld to keep this ` +
|
|
61
|
+
"reply inside its overall size ceiling, not by either patch budget — their stats above are " +
|
|
62
|
+
'complete. Re-request them with a narrowed "files" to read their patches.');
|
|
63
|
+
}
|
|
64
|
+
if (fitted.droppedCount > 0) {
|
|
65
|
+
notes.push(`${fitted.droppedCount} further changed file(s) are absent from this reply entirely — the ` +
|
|
66
|
+
"per-file rows for every changed file do not fit inside the reply's size ceiling on their " +
|
|
67
|
+
'own. This is a limit of one reply, not a finding about those files: re-request them with ' +
|
|
68
|
+
'"files" to see them.');
|
|
69
|
+
}
|
|
70
|
+
return {
|
|
71
|
+
data: { ...identity, files: fitted.items, filesTotal },
|
|
72
|
+
notes,
|
|
73
|
+
...(fitted.droppedCount > 0
|
|
74
|
+
? {
|
|
75
|
+
truncatedDetail: {
|
|
76
|
+
shown: fitted.items.length,
|
|
77
|
+
total: filesTotal,
|
|
78
|
+
more: null,
|
|
79
|
+
},
|
|
80
|
+
}
|
|
81
|
+
: {}),
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
const SCHEMA = {
|
|
85
|
+
type: "object",
|
|
86
|
+
properties: {
|
|
87
|
+
base: {
|
|
88
|
+
type: "string",
|
|
89
|
+
description: "The ref to diff against. Required unless \"workingTree\" is given — there is no " +
|
|
90
|
+
"defensible default, and guessing one silently changes which diff the answer describes.",
|
|
91
|
+
},
|
|
92
|
+
workingTree: {
|
|
93
|
+
type: "string",
|
|
94
|
+
enum: ["unstaged", "staged", "all"],
|
|
95
|
+
description: "Diff uncommitted state instead of two refs. \"unstaged\" is the working tree against " +
|
|
96
|
+
"the index, \"staged\" the index against HEAD, \"all\" everything not yet committed. " +
|
|
97
|
+
"Mutually exclusive with \"base\", and never inferred: a working tree and a ref range " +
|
|
98
|
+
"answer different questions, so the caller declares which one they are asking.",
|
|
99
|
+
},
|
|
100
|
+
includeUntracked: {
|
|
101
|
+
type: "boolean",
|
|
102
|
+
description: "With \"workingTree\", also report files git has never seen, as new-file patches. On " +
|
|
103
|
+
"by default, because they are part of the change about to be committed. Pass false to " +
|
|
104
|
+
"restrict the answer to files git already tracks; the narrowing is stated in the reply.",
|
|
105
|
+
},
|
|
106
|
+
head: { type: "string", description: "The tip being diffed. Default HEAD." },
|
|
107
|
+
files: {
|
|
108
|
+
type: "array",
|
|
109
|
+
items: { type: "string" },
|
|
110
|
+
description: "Restrict the diff to these repo-relative paths. Default: the whole diff.",
|
|
111
|
+
},
|
|
112
|
+
maxPatchBytes: {
|
|
113
|
+
type: "integer",
|
|
114
|
+
minimum: 1,
|
|
115
|
+
description: "A file's patch text is omitted (its status/additions/deletions are still reported) above " +
|
|
116
|
+
"this many bytes. Default 20,000 — narrow \"files\" to fetch a large file's patch on its own.",
|
|
117
|
+
},
|
|
118
|
+
maxTotalPatchBytes: {
|
|
119
|
+
type: "integer",
|
|
120
|
+
minimum: 1,
|
|
121
|
+
description: "The cap on the sum of every patch in the reply. Default 40,000. Files past it are still " +
|
|
122
|
+
"listed with their status and line counts; only their patch text is withheld, with the " +
|
|
123
|
+
"budget named as the reason. A per-file cap bounds no total. Note this bounds the patches " +
|
|
124
|
+
"alone: the reply as a whole is separately held under a fixed size ceiling, which can " +
|
|
125
|
+
"withhold further patches, and on a very wide diff drop trailing files from the list — " +
|
|
126
|
+
"both are disclosed and named distinctly from this budget when they happen.",
|
|
127
|
+
},
|
|
128
|
+
limit: { type: "integer", minimum: 1, description: "Cap on files in the reply. Default 200." },
|
|
129
|
+
},
|
|
130
|
+
additionalProperties: false,
|
|
131
|
+
};
|
|
132
|
+
async function run(args, ctx) {
|
|
133
|
+
const workingTree = optionalString(args, "workingTree");
|
|
134
|
+
// Defaults **on**, unlike the core primitive it calls. That one is a library
|
|
135
|
+
// function whose existing callers must not change behaviour by upgrading;
|
|
136
|
+
// this is the product surface, and a caller who asks for "the working tree"
|
|
137
|
+
// and is not shown the file they just created has been answered about
|
|
138
|
+
// something narrower than they asked for.
|
|
139
|
+
const includeUntracked = args["includeUntracked"] !== false;
|
|
140
|
+
const baseArg = optionalString(args, "base");
|
|
141
|
+
if (workingTree === undefined && baseArg === undefined) {
|
|
142
|
+
// The rule survives the new mode rather than being relaxed by it: one of
|
|
143
|
+
// the two questions has to be chosen, and neither has a defensible default.
|
|
144
|
+
throw new ToolInputError('Give either "base" (a ref range) or "workingTree" (uncommitted state). There is no ' +
|
|
145
|
+
"defensible default, and guessing one silently changes which diff the answer describes.");
|
|
146
|
+
}
|
|
147
|
+
if (workingTree !== undefined && baseArg !== undefined) {
|
|
148
|
+
throw new ToolInputError('"base" and "workingTree" are mutually exclusive — they are two different questions. ' +
|
|
149
|
+
"Ask one.");
|
|
150
|
+
}
|
|
151
|
+
if (workingTree !== undefined && !["unstaged", "staged", "all"].includes(workingTree)) {
|
|
152
|
+
throw new ToolInputError(`"workingTree" must be "unstaged", "staged" or "all" — got "${workingTree}".`);
|
|
153
|
+
}
|
|
154
|
+
const base = baseArg ?? null;
|
|
155
|
+
const head = base === null ? null : optionalString(args, "head") ?? "HEAD";
|
|
156
|
+
const files = optionalStringArray(args, "files");
|
|
157
|
+
const maxPatchBytes = optionalInteger(args, "maxPatchBytes", 1);
|
|
158
|
+
const maxTotalPatchBytes = optionalInteger(args, "maxTotalPatchBytes", 1);
|
|
159
|
+
const limit = optionalInteger(args, "limit", 1) ?? DEFAULT_LIMIT;
|
|
160
|
+
const { session } = ctx;
|
|
161
|
+
const stamp = session.provider().baseStamp();
|
|
162
|
+
const envelope = {
|
|
163
|
+
resolutionFloor: 0, // a live filesystem read, not a graph traversal claim — same convention as similar_incidents' R0 floor
|
|
164
|
+
commitSha: stamp.commitSha,
|
|
165
|
+
graphBuiltAt: stamp.graphBuiltAt,
|
|
166
|
+
irSchemaVersion: stamp.irSchemaVersion,
|
|
167
|
+
commitSpread: stamp.commitSpread,
|
|
168
|
+
repoCount: stamp.repoCount,
|
|
169
|
+
// "This file changed, N lines added/removed" is a name-level fact about
|
|
170
|
+
// the diff, not a claim about program shape.
|
|
171
|
+
nameLevel: true,
|
|
172
|
+
};
|
|
173
|
+
const scope = (workingTree ?? "all");
|
|
174
|
+
const subject = base === null ? `the working tree (${scope})` : `${base}...${head}`;
|
|
175
|
+
const mode = base === null ? "working-tree" : "range";
|
|
176
|
+
ctx.progress(`Diffing ${subject}`);
|
|
177
|
+
let all;
|
|
178
|
+
let untrackedTotal = 0;
|
|
179
|
+
let untrackedTruncated = false;
|
|
180
|
+
try {
|
|
181
|
+
if (base === null) {
|
|
182
|
+
const change = await gitWorkingTreeChange(session.repoPath, {
|
|
183
|
+
scope,
|
|
184
|
+
includeUntracked,
|
|
185
|
+
exclude: descryOwnState(session.config.graph),
|
|
186
|
+
...(files === undefined ? {} : { files }),
|
|
187
|
+
...(maxPatchBytes === undefined ? {} : { maxPatchBytes }),
|
|
188
|
+
...(maxTotalPatchBytes === undefined ? {} : { maxTotalPatchBytes }),
|
|
189
|
+
});
|
|
190
|
+
all = change.files;
|
|
191
|
+
untrackedTotal = change.untrackedTotal;
|
|
192
|
+
untrackedTruncated = change.untrackedTruncated;
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
all = await gitDiff(session.repoPath, base, head, {
|
|
196
|
+
...(files === undefined ? {} : { files }),
|
|
197
|
+
...(maxPatchBytes === undefined ? {} : { maxPatchBytes }),
|
|
198
|
+
...(maxTotalPatchBytes === undefined ? {} : { maxTotalPatchBytes }),
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
catch (error) {
|
|
203
|
+
return answer({
|
|
204
|
+
...envelope,
|
|
205
|
+
headline: `Could not diff ${subject}.`,
|
|
206
|
+
state: "refused",
|
|
207
|
+
data: {
|
|
208
|
+
mode,
|
|
209
|
+
base,
|
|
210
|
+
head,
|
|
211
|
+
files: [],
|
|
212
|
+
filesTotal: 0,
|
|
213
|
+
...(base === null
|
|
214
|
+
? { workingTree: { scope, includeUntracked, untrackedTotal: 0, untrackedTruncated: false } }
|
|
215
|
+
: {}),
|
|
216
|
+
},
|
|
217
|
+
notes: [
|
|
218
|
+
`git rejected it: ${error.message.trim()}.`,
|
|
219
|
+
"No diff was read, which is not a finding that nothing changed.",
|
|
220
|
+
],
|
|
221
|
+
});
|
|
222
|
+
}
|
|
223
|
+
// UAT round 3, Suggestion 5, audited into get_git_diff too: `options.files`
|
|
224
|
+
// is passed straight to `git diff -- <pathspec>` (`sources/git/diff.ts`),
|
|
225
|
+
// so a filter naming a path with no change in this diff comes back with
|
|
226
|
+
// zero entries exactly the way a genuinely empty base...head does — the
|
|
227
|
+
// same `all.length === 0` either way. Reporting both as "has no changes"
|
|
228
|
+
// would be the contracts/validate collapse one level down: a false
|
|
229
|
+
// statement about the whole diff when it was really the named files that
|
|
230
|
+
// matched nothing. Checked against the unfiltered file list — cheap,
|
|
231
|
+
// name-only, no patch content — so a real empty diff is not confused with
|
|
232
|
+
// one that has changes the named files simply do not include.
|
|
233
|
+
// Range mode only: working-tree mode has no second ref to re-diff without
|
|
234
|
+
// "files", and `changedFiles` needs both.
|
|
235
|
+
let filesMatchedNothing = false;
|
|
236
|
+
let wholeDiffCount = 0;
|
|
237
|
+
if (base !== null && all.length === 0 && files !== undefined && files.length > 0) {
|
|
238
|
+
ctx.progress(`Checking whether ${base}...${head} has any changes at all`);
|
|
239
|
+
const wholeDiff = await changedFiles(session.repoPath, base, head).catch(() => null);
|
|
240
|
+
if (wholeDiff !== null && wholeDiff.length > 0) {
|
|
241
|
+
filesMatchedNothing = true;
|
|
242
|
+
wholeDiffCount = wholeDiff.length;
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
const shown = all.slice(0, limit);
|
|
246
|
+
const notes = [];
|
|
247
|
+
if (filesMatchedNothing) {
|
|
248
|
+
notes.push(`0 of the ${(files ?? []).length} named file(s) have any change in ${subject}, which ` +
|
|
249
|
+
`changes ${wholeDiffCount} file(s) in total when read without "files". This is not a ` +
|
|
250
|
+
"statement that the diff itself is empty.");
|
|
251
|
+
}
|
|
252
|
+
if (shown.length < all.length) {
|
|
253
|
+
notes.push(`${all.length - shown.length} further changed file(s) exist but are not listed — the reply ` +
|
|
254
|
+
`is capped at ${limit}.`);
|
|
255
|
+
}
|
|
256
|
+
const omittedPatches = shown.filter((f) => f.patchOmittedReason !== null).length;
|
|
257
|
+
if (omittedPatches > 0) {
|
|
258
|
+
notes.push(`${omittedPatches} of the listed file(s) had their patch text withheld — see each file's own ` +
|
|
259
|
+
'"patchOmittedReason".');
|
|
260
|
+
}
|
|
261
|
+
// Named separately from the per-file cap: this one is not a fact about any
|
|
262
|
+
// single file, and the action it calls for is different — re-request a
|
|
263
|
+
// narrowed "files", rather than raise a per-file limit.
|
|
264
|
+
const budgetWithheld = shown.filter((f) => f.patchOmittedReason?.startsWith(TOTAL_PATCH_BUDGET_REASON_PREFIX)).length;
|
|
265
|
+
if (budgetWithheld > 0) {
|
|
266
|
+
notes.push(`${budgetWithheld} of those were withheld by the reply's total patch budget, not by their ` +
|
|
267
|
+
'own size — their stats above are complete. Re-request them with a narrowed "files" to ' +
|
|
268
|
+
"read their patches.");
|
|
269
|
+
}
|
|
270
|
+
if (base === null && !includeUntracked) {
|
|
271
|
+
// The half not looked at, named. A working-tree answer that quietly omitted
|
|
272
|
+
// every never-added file would read as "nothing new here" on exactly the
|
|
273
|
+
// change that is most often entirely new files.
|
|
274
|
+
notes.push("Untracked files were not included — no form of git diff reports them, so a file written " +
|
|
275
|
+
'and not yet added is absent from this answer. Pass "includeUntracked" to see them.');
|
|
276
|
+
}
|
|
277
|
+
if (untrackedTruncated) {
|
|
278
|
+
notes.push(`${untrackedTotal} untracked file(s) exist and only some were diffed. The rest were counted, ` +
|
|
279
|
+
"not examined.");
|
|
280
|
+
}
|
|
281
|
+
return answer({
|
|
282
|
+
...envelope,
|
|
283
|
+
headline: all.length === 0
|
|
284
|
+
? filesMatchedNothing
|
|
285
|
+
? `0 of the ${(files ?? []).length} named file(s) have any change in ${subject}. ` +
|
|
286
|
+
"Not empty, not checked for those files."
|
|
287
|
+
: `${subject} has no changes.`
|
|
288
|
+
: `${subject} changes ${all.length} file(s)` +
|
|
289
|
+
(shown.length < all.length ? `, showing the first ${shown.length}.` : "."),
|
|
290
|
+
...(all.length === 0 ? { state: "empty" } : {}),
|
|
291
|
+
data: {
|
|
292
|
+
mode,
|
|
293
|
+
base,
|
|
294
|
+
head,
|
|
295
|
+
files: shown,
|
|
296
|
+
filesTotal: all.length,
|
|
297
|
+
...(base === null
|
|
298
|
+
? { workingTree: { scope, includeUntracked, untrackedTotal, untrackedTruncated } }
|
|
299
|
+
: {}),
|
|
300
|
+
},
|
|
301
|
+
truncated: shown.length < all.length,
|
|
302
|
+
...(shown.length < all.length
|
|
303
|
+
? { truncatedDetail: { shown: shown.length, total: all.length, more: null } }
|
|
304
|
+
: {}),
|
|
305
|
+
notes,
|
|
306
|
+
fitToBudget: (budgetBytes) => fitDiff({
|
|
307
|
+
mode,
|
|
308
|
+
base,
|
|
309
|
+
head,
|
|
310
|
+
...(base === null
|
|
311
|
+
? { workingTree: { scope, includeUntracked, untrackedTotal, untrackedTruncated } }
|
|
312
|
+
: {}),
|
|
313
|
+
}, shown, all.length, budgetBytes),
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
export const gitDiffTool = {
|
|
317
|
+
name: "get_git_diff",
|
|
318
|
+
class: "read",
|
|
319
|
+
tier: "evidence",
|
|
320
|
+
// 2.0.0: the reply is now held under an overall size ceiling, which can
|
|
321
|
+
// withhold patches the two patch budgets would have allowed and, on a very
|
|
322
|
+
// wide diff, drop trailing files from the list. Both are disclosed, but a
|
|
323
|
+
// caller can receive strictly less than 1.0.0 returned for the same call —
|
|
324
|
+
// a behaviour change, so a version bump, not a patch release.
|
|
325
|
+
version: "2.0.0",
|
|
326
|
+
title: "Live textual diff between two refs",
|
|
327
|
+
description: "A live git diff between two refs — per-file status (added/modified/deleted/renamed), " +
|
|
328
|
+
"additions/deletions, and unified-diff patch text where it is small enough to include. Reads " +
|
|
329
|
+
"the working repository directly, not the stored graph — for the graph's stored co-change " +
|
|
330
|
+
"history use \"history\" instead. A file's patch is withheld above \"maxPatchBytes\", and any " +
|
|
331
|
+
"patch past the reply's \"maxTotalPatchBytes\" budget, each with a named reason; stats are " +
|
|
332
|
+
"still reported either way. The whole reply is additionally held under a fixed size ceiling: " +
|
|
333
|
+
"on a very wide diff that can withhold further patches and, in the extreme, leave trailing " +
|
|
334
|
+
"files out of the list entirely — always disclosed, never silently.",
|
|
335
|
+
inputSchema: SCHEMA,
|
|
336
|
+
run,
|
|
337
|
+
};
|
|
338
|
+
//# sourceMappingURL=git-diff.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-diff.js","sourceRoot":"","sources":["../../src/tools/git-diff.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,OAAO,EACL,oBAAoB,EACpB,YAAY,EACZ,OAAO,EACP,oBAAoB,EACpB,gCAAgC,GACjC,MAAM,eAAe,CAAC;AAGvB,OAAO,EACL,MAAM,EACN,eAAe,EACf,cAAc,EACd,cAAc,EACd,cAAc,EACd,mBAAmB,GAGpB,MAAM,UAAU,CAAC;AAGlB,MAAM,aAAa,GAAG,GAAG,CAAC;AAE1B;;;;;;GAMG;AACH,MAAM,0BAA0B,GAAG,kCAAkC,CAAC;AAEtE,sFAAsF;AACtF,SAAS,SAAS,CAAC,IAAkB;IACnC,OAAO,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;AAC7D,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,SAAS,OAAO,CACd,QAAqE,EACrE,KAA8B,EAC9B,UAAkB,EAClB,WAAmB;IAEnB,MAAM,QAAQ,GAAG,MAAM,CAAC,UAAU,CAChC,IAAI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KAAK,IAAI;gBACf,CAAC,CAAC,EAAE,WAAW,EAAE,EAAE,KAAK,EAAE,gBAAgB,EAAE,cAAc,EAAE,kBAAkB,EAAE,EAAE;gBAClF,CAAC,CAAC,EAAE,CAAC;SACR,EACD,KAAK,EACL,GAAG,CAAC,MAAM,EACV,WAAW,CACZ;KACJ,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,WAAW,GAAmB;IACzC,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,UAAU;IAChB,wEAAwE;IACxE,2EAA2E;IAC3E,0EAA0E;IAC1E,2EAA2E;IAC3E,8DAA8D;IAC9D,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,oCAAoC;IAC3C,WAAW,EACT,uFAAuF;QACvF,8FAA8F;QAC9F,2FAA2F;QAC3F,+FAA+F;QAC/F,4FAA4F;QAC5F,8FAA8F;QAC9F,4FAA4F;QAC5F,oEAAoE;IACtE,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** `get_git_history`, §18. Live `git log --follow` for one file — no graph, no staleness. Distinct
|
|
2
|
+
* from `history`'s stored `CHANGES_WITH` co-change ledger (built once at `analyze` time); this
|
|
3
|
+
* reads the working repository directly. */
|
|
4
|
+
import type { PathLogCommit } from "@descryy/core";
|
|
5
|
+
import { type ToolDefinition } from "./kit.ts";
|
|
6
|
+
export type GitHistoryCommit = PathLogCommit;
|
|
7
|
+
export interface GitHistoryData {
|
|
8
|
+
readonly file: string;
|
|
9
|
+
/** Capped by `maxCommits`, newest-first. */
|
|
10
|
+
readonly commits: readonly GitHistoryCommit[];
|
|
11
|
+
/** Every commit touching this file, independent of `maxCommits` — a separate count, not
|
|
12
|
+
* `commits.length`, so a caller can tell "20 most recent" from "all 3 there are". */
|
|
13
|
+
readonly totalTouching: number;
|
|
14
|
+
}
|
|
15
|
+
export declare const gitHistoryTool: ToolDefinition;
|
|
16
|
+
//# sourceMappingURL=git-history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-history.d.ts","sourceRoot":"","sources":["../../src/tools/git-history.ts"],"names":[],"mappings":"AAAA;;6CAE6C;AAG7C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD,OAAO,EAA6D,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAM1G,MAAM,MAAM,gBAAgB,GAAG,aAAa,CAAC;AAE7C,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,4CAA4C;IAC5C,QAAQ,CAAC,OAAO,EAAE,SAAS,gBAAgB,EAAE,CAAC;IAC9C;0FACsF;IACtF,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;CAChC;AAqGD,eAAO,MAAM,cAAc,EAAE,cAa5B,CAAC"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/** `get_git_history`, §18. Live `git log --follow` for one file — no graph, no staleness. Distinct
|
|
2
|
+
* from `history`'s stored `CHANGES_WITH` co-change ledger (built once at `analyze` time); this
|
|
3
|
+
* reads the working repository directly. */
|
|
4
|
+
import { logForPath } from "@descryy/core";
|
|
5
|
+
import { answer, optionalInteger, requiredString } from "./kit.js";
|
|
6
|
+
import { capBySize, sizeCapNote } from "../capped.js";
|
|
7
|
+
const DEFAULT_MAX_COMMITS = 20;
|
|
8
|
+
const SCHEMA = {
|
|
9
|
+
type: "object",
|
|
10
|
+
properties: {
|
|
11
|
+
file: { type: "string", description: "Repository-relative path to read live commit history for." },
|
|
12
|
+
maxCommits: {
|
|
13
|
+
type: "integer",
|
|
14
|
+
minimum: 1,
|
|
15
|
+
description: "Cap on commits returned, newest-first. Default 20.",
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
required: ["file"],
|
|
19
|
+
additionalProperties: false,
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* `commits` scales with `maxCommits` (caller-controlled, no upper bound) and
|
|
23
|
+
* with how long each commit's own subject/body is — a file with a handful of
|
|
24
|
+
* commits carrying long bodies can still overflow. Rows are self-contained,
|
|
25
|
+
* so shrinking means dropping trailing (older) commits.
|
|
26
|
+
*/
|
|
27
|
+
function fitGitHistory(rest, shownCommits, budgetBytes) {
|
|
28
|
+
const scaffoldBytes = Buffer.byteLength(JSON.stringify({ ...rest, commits: [] }), "utf8");
|
|
29
|
+
const fit = capBySize(shownCommits, budgetBytes, scaffoldBytes);
|
|
30
|
+
const notes = fit.droppedForSize === 0 ? [] : [sizeCapNote("commit", fit.shown.length, shownCommits.length, fit.droppedForSize)];
|
|
31
|
+
return {
|
|
32
|
+
data: { ...rest, commits: fit.shown },
|
|
33
|
+
notes,
|
|
34
|
+
...(fit.droppedForSize === 0
|
|
35
|
+
? {}
|
|
36
|
+
: { truncatedDetail: { shown: fit.shown.length, total: rest.totalTouching, more: null } }),
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
async function run(args, ctx) {
|
|
40
|
+
const file = requiredString(args, "file");
|
|
41
|
+
const maxCommits = optionalInteger(args, "maxCommits", 1) ?? DEFAULT_MAX_COMMITS;
|
|
42
|
+
const { session } = ctx;
|
|
43
|
+
const stamp = session.provider().baseStamp();
|
|
44
|
+
const envelope = {
|
|
45
|
+
resolutionFloor: 0, // a live git log read, not a graph traversal claim
|
|
46
|
+
commitSha: stamp.commitSha,
|
|
47
|
+
graphBuiltAt: stamp.graphBuiltAt,
|
|
48
|
+
irSchemaVersion: stamp.irSchemaVersion,
|
|
49
|
+
commitSpread: stamp.commitSpread,
|
|
50
|
+
repoCount: stamp.repoCount,
|
|
51
|
+
nameLevel: true,
|
|
52
|
+
};
|
|
53
|
+
ctx.progress(`Reading live commit history for ${file}`);
|
|
54
|
+
let result;
|
|
55
|
+
try {
|
|
56
|
+
result = await logForPath(session.repoPath, file, { maxCommits });
|
|
57
|
+
}
|
|
58
|
+
catch (error) {
|
|
59
|
+
return answer({
|
|
60
|
+
...envelope,
|
|
61
|
+
headline: `Could not read history for "${file}".`,
|
|
62
|
+
state: "refused",
|
|
63
|
+
data: { file, commits: [], totalTouching: 0 },
|
|
64
|
+
notes: [
|
|
65
|
+
`git rejected the read: ${error.message.trim()}.`,
|
|
66
|
+
"No history was read, which is not a finding that this file has none.",
|
|
67
|
+
],
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
const notes = [];
|
|
71
|
+
if (result.totalTouching > result.commits.length) {
|
|
72
|
+
notes.push(`${result.totalTouching - result.commits.length} further commit(s) touch this file but are ` +
|
|
73
|
+
`not listed — the reply is capped at ${maxCommits}, newest-first.`);
|
|
74
|
+
}
|
|
75
|
+
return answer({
|
|
76
|
+
...envelope,
|
|
77
|
+
headline: result.totalTouching === 0
|
|
78
|
+
? `No commit reachable from HEAD touches "${file}".`
|
|
79
|
+
: `${result.totalTouching} commit(s) touch "${file}"` +
|
|
80
|
+
(result.commits.length < result.totalTouching
|
|
81
|
+
? `; showing the ${result.commits.length} most recent.`
|
|
82
|
+
: "."),
|
|
83
|
+
...(result.totalTouching === 0 ? { state: "empty" } : {}),
|
|
84
|
+
data: { file, commits: result.commits, totalTouching: result.totalTouching },
|
|
85
|
+
truncated: result.commits.length < result.totalTouching,
|
|
86
|
+
...(result.commits.length < result.totalTouching
|
|
87
|
+
? { truncatedDetail: { shown: result.commits.length, total: result.totalTouching, more: null } }
|
|
88
|
+
: {}),
|
|
89
|
+
notes,
|
|
90
|
+
fitToBudget: (budgetBytes) => fitGitHistory({ file, totalTouching: result.totalTouching }, result.commits, budgetBytes),
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
export const gitHistoryTool = {
|
|
94
|
+
name: "get_git_history",
|
|
95
|
+
class: "read",
|
|
96
|
+
tier: "evidence",
|
|
97
|
+
version: "1.0.0",
|
|
98
|
+
title: "Live commit history for one file",
|
|
99
|
+
description: "Live git log for a repository-relative file path, following it across renames — sha, date, " +
|
|
100
|
+
"subject, body and this commit's status for the file, newest-first. Reads the working " +
|
|
101
|
+
"repository directly, not the stored graph — for the graph's stored file-to-file co-change " +
|
|
102
|
+
"ledger use \"history\" instead.",
|
|
103
|
+
inputSchema: SCHEMA,
|
|
104
|
+
run,
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=git-history.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"git-history.js","sourceRoot":"","sources":["../../src/tools/git-history.ts"],"names":[],"mappings":"AAAA;;6CAE6C;AAE7C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAG3C,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAC1G,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAGtD,MAAM,mBAAmB,GAAG,EAAE,CAAC;AAa/B,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2DAA2D,EAAE;QAClG,UAAU,EAAE;YACV,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,CAAC;YACV,WAAW,EAAE,oDAAoD;SAClE;KACF;IACD,QAAQ,EAAE,CAAC,MAAM,CAAC;IAClB,oBAAoB,EAAE,KAAK;CACnB,CAAC;AAEX;;;;;GAKG;AACH,SAAS,aAAa,CACpB,IAAqC,EACrC,YAAyC,EACzC,WAAmB;IAEnB,MAAM,aAAa,GAAG,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,EAAE,MAAM,CAAC,CAAC;IAC1F,MAAM,GAAG,GAAG,SAAS,CAAC,YAAY,EAAE,WAAW,EAAE,aAAa,CAAC,CAAC;IAChE,MAAM,KAAK,GAAG,GAAG,CAAC,cAAc,KAAK,CAAC,CAAC,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AAI,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE;QAC5E,SAAS,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,aAAa;QACvD,GAAG,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,GAAG,MAAM,CAAC,aAAa;YAC9C,CAAC,CAAC,EAAE,eAAe,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,EAAE;YAChG,CAAC,CAAC,EAAE,CAAC;QACP,KAAK;QACL,WAAW,EAAE,CAAC,WAAW,EAAE,EAAE,CAC3B,aAAa,CAAC,EAAE,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,aAAa,EAAE,EAAE,MAAM,CAAC,OAAO,EAAE,WAAW,CAAC;KAC5F,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,cAAc,GAAmB;IAC5C,IAAI,EAAE,iBAAiB;IACvB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,kCAAkC;IACzC,WAAW,EACT,6FAA6F;QAC7F,uFAAuF;QACvF,4FAA4F;QAC5F,iCAAiC;IACnC,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `history`: co-change (`CHANGES_WITH`) lookup over the stored graph, not a
|
|
3
|
+
* live `git log`/`diff` — §18's `get_git_history`. Resolves the path
|
|
4
|
+
* directly, keeping only `type === "FILE"` — `resolveOneNode` would add noise since `CHANGES_WITH` only ever connects FILE nodes.
|
|
5
|
+
*/
|
|
6
|
+
import { type BriefNode, type ToolDefinition } from "./kit.ts";
|
|
7
|
+
/** A file this one moves with, and how strongly. */
|
|
8
|
+
export interface CoChangedFile extends BriefNode {
|
|
9
|
+
/** Commits in which the two files were touched together. */
|
|
10
|
+
readonly support: number;
|
|
11
|
+
/** `support` over the more-frequently-changed file's own total. */
|
|
12
|
+
readonly confidence: number;
|
|
13
|
+
}
|
|
14
|
+
/** The resolved FILE node. */
|
|
15
|
+
export interface HistoryFileResolved extends BriefNode {
|
|
16
|
+
readonly resolved: true;
|
|
17
|
+
}
|
|
18
|
+
/** No FILE node at the path, so nothing was read — only the path is known. */
|
|
19
|
+
export interface HistoryFileUnresolved {
|
|
20
|
+
readonly resolved: false;
|
|
21
|
+
readonly path: string;
|
|
22
|
+
}
|
|
23
|
+
/** One key, one shape: `resolved` says whether `BriefNode` fields are meaningful — replaces a design where `file` was a bare string on one branch, `undefined` with no error on the other. */
|
|
24
|
+
export type HistoryFile = HistoryFileResolved | HistoryFileUnresolved;
|
|
25
|
+
export interface HistoryReport {
|
|
26
|
+
readonly file: HistoryFile;
|
|
27
|
+
/** Capped by `limit`; `coChangedTotal` is the uncapped count. Always
|
|
28
|
+
* present, including when `file.resolved` is `false` (0, not omitted). */
|
|
29
|
+
readonly coChanged: readonly CoChangedFile[];
|
|
30
|
+
readonly coChangedTotal: number;
|
|
31
|
+
}
|
|
32
|
+
export type HistoryData = HistoryReport;
|
|
33
|
+
export declare const historyTool: ToolDefinition;
|
|
34
|
+
//# sourceMappingURL=history.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"history.d.ts","sourceRoot":"","sources":["../../src/tools/history.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAKL,KAAK,SAAS,EAEd,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAGlB,oDAAoD;AACpD,MAAM,WAAW,aAAc,SAAQ,SAAS;IAC9C,4DAA4D;IAC5D,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,mEAAmE;IACnE,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;CAC7B;AAED,8BAA8B;AAC9B,MAAM,WAAW,mBAAoB,SAAQ,SAAS;IACpD,QAAQ,CAAC,QAAQ,EAAE,IAAI,CAAC;CACzB;AAED,8EAA8E;AAC9E,MAAM,WAAW,qBAAqB;IACpC,QAAQ,CAAC,QAAQ,EAAE,KAAK,CAAC;IACzB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACvB;AAED,8LAA8L;AAC9L,MAAM,MAAM,WAAW,GAAG,mBAAmB,GAAG,qBAAqB,CAAC;AAEtE,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,WAAW,CAAC;IAC3B;+EAC2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,SAAS,aAAa,EAAE,CAAC;IAC7C,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;CACjC;AAED,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC;AAiHxC,eAAO,MAAM,WAAW,EAAE,cAYzB,CAAC"}
|