@descryy/mcp 0.11.5 → 0.11.6
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 +3 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"credential-store.js","sourceRoot":"","sources":["../src/credential-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,4BAA4B,EAAE,MAAM,sCAAsC,CAAC;AAqBpF;;;uCAGuC;AACvC,MAAM,UAAU,4BAA4B,CAAC,OAAgC;IAC3E,OAAO,IAAI,4BAA4B,CAAC,OAAO,CAAC,CAAC;AACnD,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks disclosures this connection has already seen in full. Measured: the
|
|
3
|
+
* R0/class-C sentence is ~354 chars (~88 tokens), repeated on most of a 30-call
|
|
4
|
+
* session. Only the *argument* shortens — floor/cap stay on every reply (rule 7).
|
|
5
|
+
* Per connection, not per process — a second client can't inherit the first's history. */
|
|
6
|
+
export interface DisclosureLedger {
|
|
7
|
+
/** `true` the first time this key is seen on this connection, `false` after —
|
|
8
|
+
* calling it is what marks the key as disclosed. */
|
|
9
|
+
firstSighting(key: string): boolean;
|
|
10
|
+
/** Keys disclosed in full so far. For tests and diagnostics. */
|
|
11
|
+
disclosed(): readonly string[];
|
|
12
|
+
}
|
|
13
|
+
export declare function createDisclosureLedger(): DisclosureLedger;
|
|
14
|
+
//# sourceMappingURL=disclosure-ledger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disclosure-ledger.d.ts","sourceRoot":"","sources":["../src/disclosure-ledger.ts"],"names":[],"mappings":"AAAA;;;;0FAI0F;AAE1F,MAAM,WAAW,gBAAgB;IAC/B;yDACqD;IACrD,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;IACpC,gEAAgE;IAChE,SAAS,IAAI,SAAS,MAAM,EAAE,CAAC;CAChC;AAED,wBAAgB,sBAAsB,IAAI,gBAAgB,CAUzD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks disclosures this connection has already seen in full. Measured: the
|
|
3
|
+
* R0/class-C sentence is ~354 chars (~88 tokens), repeated on most of a 30-call
|
|
4
|
+
* session. Only the *argument* shortens — floor/cap stay on every reply (rule 7).
|
|
5
|
+
* Per connection, not per process — a second client can't inherit the first's history. */
|
|
6
|
+
export function createDisclosureLedger() {
|
|
7
|
+
const seen = new Set();
|
|
8
|
+
return {
|
|
9
|
+
firstSighting(key) {
|
|
10
|
+
if (seen.has(key))
|
|
11
|
+
return false;
|
|
12
|
+
seen.add(key);
|
|
13
|
+
return true;
|
|
14
|
+
},
|
|
15
|
+
disclosed: () => [...seen],
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=disclosure-ledger.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"disclosure-ledger.js","sourceRoot":"","sources":["../src/disclosure-ledger.ts"],"names":[],"mappings":"AAAA;;;;0FAI0F;AAU1F,MAAM,UAAU,sBAAsB;IACpC,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,OAAO;QACL,aAAa,CAAC,GAAG;YACf,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;gBAAE,OAAO,KAAK,CAAC;YAChC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;YACd,OAAO,IAAI,CAAC;QACd,CAAC;QACD,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC;KAC3B,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reduces raw runtime `Evidence` rows to the `{ method, path, status }` triples
|
|
3
|
+
* `checkObservedRoutes` (`@descryy/core`) reads — the mcp-package half of UAT
|
|
4
|
+
* phase 5 §5 (D2): the language-agnostic check reads only structured fields,
|
|
5
|
+
* never a framework's own log line, so this is the one place that reads a
|
|
6
|
+
* `NETWORK_RESPONSE`/`HTTP_ERROR` payload's shape at all.
|
|
7
|
+
*
|
|
8
|
+
* Two sources feed one triple, because `method` is not always on the same
|
|
9
|
+
* event as `status`:
|
|
10
|
+
*
|
|
11
|
+
* - The browser network collector (`@descryy/runtime-browser`) splits a
|
|
12
|
+
* request into `NETWORK_REQUEST` (carries `method`) and `NETWORK_RESPONSE`/
|
|
13
|
+
* `HTTP_ERROR` (carries `status`), joined by `requestId` or, failing that,
|
|
14
|
+
* `url` — the identical join `playwright-driver.ts`'s own `collect()`
|
|
15
|
+
* performs for the `browser_*` tools' evidence.
|
|
16
|
+
* - A future backend-log promotion (`descry-runtime`'s own per-language
|
|
17
|
+
* adapters — not built; see UAT phase 5 §5's fix plan) is free to carry
|
|
18
|
+
* `method` on the same event as `status`, since an access-log line already
|
|
19
|
+
* has both — read first, before falling back to the join, so that shape
|
|
20
|
+
* costs nothing extra to support once it exists.
|
|
21
|
+
*/
|
|
22
|
+
import type { Evidence } from "@descryy/runtime-contracts";
|
|
23
|
+
import type { ObservedRouteEvidence } from "@descryy/core";
|
|
24
|
+
export declare function extractObservedRouteEvidence(items: readonly Evidence[]): readonly ObservedRouteEvidence[];
|
|
25
|
+
//# sourceMappingURL=observed-route-evidence.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"observed-route-evidence.d.ts","sourceRoot":"","sources":["../../src/evidence/observed-route-evidence.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,4BAA4B,CAAC;AAC3D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAc3D,wBAAgB,4BAA4B,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,GAAG,SAAS,qBAAqB,EAAE,CAqCzG"}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Reduces raw runtime `Evidence` rows to the `{ method, path, status }` triples
|
|
3
|
+
* `checkObservedRoutes` (`@descryy/core`) reads — the mcp-package half of UAT
|
|
4
|
+
* phase 5 §5 (D2): the language-agnostic check reads only structured fields,
|
|
5
|
+
* never a framework's own log line, so this is the one place that reads a
|
|
6
|
+
* `NETWORK_RESPONSE`/`HTTP_ERROR` payload's shape at all.
|
|
7
|
+
*
|
|
8
|
+
* Two sources feed one triple, because `method` is not always on the same
|
|
9
|
+
* event as `status`:
|
|
10
|
+
*
|
|
11
|
+
* - The browser network collector (`@descryy/runtime-browser`) splits a
|
|
12
|
+
* request into `NETWORK_REQUEST` (carries `method`) and `NETWORK_RESPONSE`/
|
|
13
|
+
* `HTTP_ERROR` (carries `status`), joined by `requestId` or, failing that,
|
|
14
|
+
* `url` — the identical join `playwright-driver.ts`'s own `collect()`
|
|
15
|
+
* performs for the `browser_*` tools' evidence.
|
|
16
|
+
* - A future backend-log promotion (`descry-runtime`'s own per-language
|
|
17
|
+
* adapters — not built; see UAT phase 5 §5's fix plan) is free to carry
|
|
18
|
+
* `method` on the same event as `status`, since an access-log line already
|
|
19
|
+
* has both — read first, before falling back to the join, so that shape
|
|
20
|
+
* costs nothing extra to support once it exists.
|
|
21
|
+
*/
|
|
22
|
+
function stringField(payload, key) {
|
|
23
|
+
if (typeof payload !== "object" || payload === null)
|
|
24
|
+
return undefined;
|
|
25
|
+
const value = payload[key];
|
|
26
|
+
return typeof value === "string" ? value : undefined;
|
|
27
|
+
}
|
|
28
|
+
function numberField(payload, key) {
|
|
29
|
+
if (typeof payload !== "object" || payload === null)
|
|
30
|
+
return undefined;
|
|
31
|
+
const value = payload[key];
|
|
32
|
+
return typeof value === "number" ? value : undefined;
|
|
33
|
+
}
|
|
34
|
+
export function extractObservedRouteEvidence(items) {
|
|
35
|
+
const methodByRequestId = new Map();
|
|
36
|
+
const methodByUrl = new Map();
|
|
37
|
+
for (const item of items) {
|
|
38
|
+
if (item.eventType !== "NETWORK_REQUEST")
|
|
39
|
+
continue;
|
|
40
|
+
const method = stringField(item.payload, "method");
|
|
41
|
+
const url = stringField(item.payload, "url");
|
|
42
|
+
if (method === undefined)
|
|
43
|
+
continue;
|
|
44
|
+
if (item.requestId !== null)
|
|
45
|
+
methodByRequestId.set(item.requestId, method);
|
|
46
|
+
if (url !== undefined)
|
|
47
|
+
methodByUrl.set(url, method);
|
|
48
|
+
}
|
|
49
|
+
const results = [];
|
|
50
|
+
for (const item of items) {
|
|
51
|
+
if (item.eventType !== "NETWORK_RESPONSE" && item.eventType !== "HTTP_ERROR")
|
|
52
|
+
continue;
|
|
53
|
+
const status = numberField(item.payload, "status");
|
|
54
|
+
if (status === undefined)
|
|
55
|
+
continue;
|
|
56
|
+
const url = stringField(item.payload, "url");
|
|
57
|
+
if (url === undefined)
|
|
58
|
+
continue;
|
|
59
|
+
const method = stringField(item.payload, "method") ??
|
|
60
|
+
(item.requestId !== null ? methodByRequestId.get(item.requestId) : undefined) ??
|
|
61
|
+
methodByUrl.get(url);
|
|
62
|
+
if (method === undefined)
|
|
63
|
+
continue;
|
|
64
|
+
let path;
|
|
65
|
+
try {
|
|
66
|
+
path = new URL(url).pathname;
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
// Not a URL this check can reason about — never guessed at.
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
results.push({ method, path, status });
|
|
73
|
+
}
|
|
74
|
+
return results;
|
|
75
|
+
}
|
|
76
|
+
//# sourceMappingURL=observed-route-evidence.js.map
|
|
@@ -0,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
|
|
1
|
+
/**
|
|
2
|
+
* P6-B1 — a fence in front of the V8 heap ceiling, because there is no catch behind it.
|
|
3
|
+
*
|
|
4
|
+
* `analyze` on a 7,700-file repository hit `FATAL ERROR: JavaScript heap out
|
|
5
|
+
* of memory` at V8's default ceiling and the MCP client saw a bare
|
|
6
|
+
* `Connection closed`: no state, no disclosure, no hint. A heap-limit abort is
|
|
7
|
+
* not a JavaScript exception — `try`/`catch`, `process.on("uncaughtException")`
|
|
8
|
+
* and `process.on("exit")` all fail to run, because V8 calls `abort()` rather
|
|
9
|
+
* than unwinding. So there is nothing to catch, and "report the OOM" has to
|
|
10
|
+
* mean "notice the wall before hitting it".
|
|
11
|
+
*
|
|
12
|
+
* That is what this module is: a reading of the ceiling actually in force and
|
|
13
|
+
* the bytes actually live, checked at the points where the caller's peak
|
|
14
|
+
* occurs, so an unrecoverable abort becomes a recoverable `failed` reply that
|
|
15
|
+
* names the phase and the remedy.
|
|
16
|
+
*
|
|
17
|
+
* ## Why a ratio, and why this one
|
|
18
|
+
*
|
|
19
|
+
* `heap_size_limit` is V8's hard ceiling; `heapUsed` is what survives the last
|
|
20
|
+
* collection plus whatever has been allocated since. The gap between "the
|
|
21
|
+
* guard could still run" and "the process is already dead" is one allocation,
|
|
22
|
+
* so the threshold has to leave room for the phase about to start, not for the
|
|
23
|
+
* next statement. The default is a starting value in the sense CLAUDE.md means
|
|
24
|
+
* — build against it, tune from data — and deliberately overridable, because a
|
|
25
|
+
* run refused at 90% that would have finished at 97% is a cost this guard
|
|
26
|
+
* imposes rather than prevents.
|
|
27
|
+
*/
|
|
28
|
+
/** Fraction of the heap ceiling past which the next large phase is refused rather than attempted. */
|
|
29
|
+
export declare const HEAP_ABORT_RATIO = 0.9;
|
|
30
|
+
export declare const HEAP_RATIO_ENV_VAR = "DESCRY_HEAP_ABORT_RATIO";
|
|
31
|
+
export interface HeapReading {
|
|
32
|
+
/** Live bytes as of the last collection, plus anything allocated since. */
|
|
33
|
+
readonly usedBytes: number;
|
|
34
|
+
/** V8's hard ceiling — what `--max-old-space-size` sets. */
|
|
35
|
+
readonly limitBytes: number;
|
|
36
|
+
/** `usedBytes / limitBytes`, precomputed so callers cannot derive it two ways. */
|
|
37
|
+
readonly ratio: number;
|
|
38
|
+
}
|
|
39
|
+
/** The ceiling and the usage of the process this is called in. */
|
|
40
|
+
export declare function readHeap(): HeapReading;
|
|
41
|
+
/**
|
|
42
|
+
* The threshold in force, honouring `DESCRY_HEAP_ABORT_RATIO`.
|
|
43
|
+
*
|
|
44
|
+
* An unreadable or out-of-range override falls back to the default rather than
|
|
45
|
+
* disabling the guard: a typo in an env var must not silently restore the
|
|
46
|
+
* bare-`Connection closed` behaviour this module exists to remove. Setting it
|
|
47
|
+
* to `1` is the documented way to turn the guard off, and that is an explicit
|
|
48
|
+
* act rather than a typo.
|
|
49
|
+
*/
|
|
50
|
+
export declare function abortRatio(): number;
|
|
51
|
+
/**
|
|
52
|
+
* `null` when there is headroom; otherwise the sentence to refuse with.
|
|
53
|
+
*
|
|
54
|
+
* The recommendation doubles the ceiling in force rather than adding a fixed
|
|
55
|
+
* margin: the run failed at the current size, so a hint that lands near it
|
|
56
|
+
* sends the operator round the same loop a second time. `phase` is the caller's
|
|
57
|
+
* own name for the step about to start — a heap failure with no phase named is
|
|
58
|
+
* a failure the operator cannot act on differently from the crash it replaced.
|
|
59
|
+
*/
|
|
60
|
+
export declare function heapGuard(reading: HeapReading, phase: string): string | null;
|
|
61
|
+
//# sourceMappingURL=heap.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heap.d.ts","sourceRoot":"","sources":["../src/heap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAIH,qGAAqG;AACrG,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAEpC,eAAO,MAAM,kBAAkB,4BAA4B,CAAC;AAI5D,MAAM,WAAW,WAAW;IAC1B,2EAA2E;IAC3E,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,4DAA4D;IAC5D,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,kFAAkF;IAClF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,kEAAkE;AAClE,wBAAgB,QAAQ,IAAI,WAAW,CAKtC;AAED;;;;;;;;GAQG;AACH,wBAAgB,UAAU,IAAI,MAAM,CAMnC;AAID;;;;;;;;GAQG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,WAAW,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAe5E"}
|
package/dist/heap.js
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P6-B1 — a fence in front of the V8 heap ceiling, because there is no catch behind it.
|
|
3
|
+
*
|
|
4
|
+
* `analyze` on a 7,700-file repository hit `FATAL ERROR: JavaScript heap out
|
|
5
|
+
* of memory` at V8's default ceiling and the MCP client saw a bare
|
|
6
|
+
* `Connection closed`: no state, no disclosure, no hint. A heap-limit abort is
|
|
7
|
+
* not a JavaScript exception — `try`/`catch`, `process.on("uncaughtException")`
|
|
8
|
+
* and `process.on("exit")` all fail to run, because V8 calls `abort()` rather
|
|
9
|
+
* than unwinding. So there is nothing to catch, and "report the OOM" has to
|
|
10
|
+
* mean "notice the wall before hitting it".
|
|
11
|
+
*
|
|
12
|
+
* That is what this module is: a reading of the ceiling actually in force and
|
|
13
|
+
* the bytes actually live, checked at the points where the caller's peak
|
|
14
|
+
* occurs, so an unrecoverable abort becomes a recoverable `failed` reply that
|
|
15
|
+
* names the phase and the remedy.
|
|
16
|
+
*
|
|
17
|
+
* ## Why a ratio, and why this one
|
|
18
|
+
*
|
|
19
|
+
* `heap_size_limit` is V8's hard ceiling; `heapUsed` is what survives the last
|
|
20
|
+
* collection plus whatever has been allocated since. The gap between "the
|
|
21
|
+
* guard could still run" and "the process is already dead" is one allocation,
|
|
22
|
+
* so the threshold has to leave room for the phase about to start, not for the
|
|
23
|
+
* next statement. The default is a starting value in the sense CLAUDE.md means
|
|
24
|
+
* — build against it, tune from data — and deliberately overridable, because a
|
|
25
|
+
* run refused at 90% that would have finished at 97% is a cost this guard
|
|
26
|
+
* imposes rather than prevents.
|
|
27
|
+
*/
|
|
28
|
+
import { getHeapStatistics } from "node:v8";
|
|
29
|
+
/** Fraction of the heap ceiling past which the next large phase is refused rather than attempted. */
|
|
30
|
+
export const HEAP_ABORT_RATIO = 0.9;
|
|
31
|
+
export const HEAP_RATIO_ENV_VAR = "DESCRY_HEAP_ABORT_RATIO";
|
|
32
|
+
const BYTES_PER_MIB = 1024 * 1024;
|
|
33
|
+
/** The ceiling and the usage of the process this is called in. */
|
|
34
|
+
export function readHeap() {
|
|
35
|
+
const stats = getHeapStatistics();
|
|
36
|
+
const limitBytes = stats.heap_size_limit;
|
|
37
|
+
const usedBytes = stats.used_heap_size;
|
|
38
|
+
return { usedBytes, limitBytes, ratio: limitBytes === 0 ? 0 : usedBytes / limitBytes };
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The threshold in force, honouring `DESCRY_HEAP_ABORT_RATIO`.
|
|
42
|
+
*
|
|
43
|
+
* An unreadable or out-of-range override falls back to the default rather than
|
|
44
|
+
* disabling the guard: a typo in an env var must not silently restore the
|
|
45
|
+
* bare-`Connection closed` behaviour this module exists to remove. Setting it
|
|
46
|
+
* to `1` is the documented way to turn the guard off, and that is an explicit
|
|
47
|
+
* act rather than a typo.
|
|
48
|
+
*/
|
|
49
|
+
export function abortRatio() {
|
|
50
|
+
const raw = process.env[HEAP_RATIO_ENV_VAR];
|
|
51
|
+
if (raw === undefined)
|
|
52
|
+
return HEAP_ABORT_RATIO;
|
|
53
|
+
const parsed = Number(raw);
|
|
54
|
+
if (!Number.isFinite(parsed) || parsed <= 0 || parsed > 1)
|
|
55
|
+
return HEAP_ABORT_RATIO;
|
|
56
|
+
return parsed;
|
|
57
|
+
}
|
|
58
|
+
const mib = (bytes) => Math.round(bytes / BYTES_PER_MIB);
|
|
59
|
+
/**
|
|
60
|
+
* `null` when there is headroom; otherwise the sentence to refuse with.
|
|
61
|
+
*
|
|
62
|
+
* The recommendation doubles the ceiling in force rather than adding a fixed
|
|
63
|
+
* margin: the run failed at the current size, so a hint that lands near it
|
|
64
|
+
* sends the operator round the same loop a second time. `phase` is the caller's
|
|
65
|
+
* own name for the step about to start — a heap failure with no phase named is
|
|
66
|
+
* a failure the operator cannot act on differently from the crash it replaced.
|
|
67
|
+
*/
|
|
68
|
+
export function heapGuard(reading, phase) {
|
|
69
|
+
if (reading.ratio < abortRatio())
|
|
70
|
+
return null;
|
|
71
|
+
const inForceMib = mib(reading.limitBytes);
|
|
72
|
+
const recommendedMib = inForceMib * 2;
|
|
73
|
+
return (`${phase} was stopped before it started: ${mib(reading.usedBytes)} MiB of this process's ` +
|
|
74
|
+
`${inForceMib} MiB heap ceiling is already in use (${Math.round(reading.ratio * 100)}%), and ` +
|
|
75
|
+
"this phase allocates more than the remainder. Nothing was written to the graph, and this is " +
|
|
76
|
+
"not a statement about your code — it is this process running out of room to hold it. Raise " +
|
|
77
|
+
`the ceiling and re-run: NODE_OPTIONS="--max-old-space-size=${recommendedMib}" on the Descry ` +
|
|
78
|
+
`server process. To attempt it anyway, set ${HEAP_RATIO_ENV_VAR}=1 — the guard is what turns ` +
|
|
79
|
+
"an unrecoverable abort into this message, so without it the failure surfaces as a closed " +
|
|
80
|
+
"connection with no reason attached.");
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=heap.js.map
|
package/dist/heap.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heap.js","sourceRoot":"","sources":["../src/heap.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAE5C,qGAAqG;AACrG,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,C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,mCAAmC,GAAG,CAAC,OAAO,CAAC,SAAS,CAAC,yBAAyB;QAC1F,GAAG,UAAU,wCAAwC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,GAAG,GAAG,CAAC,UAAU;QAC9F,8FAA8F;QAC9F,6FAA6F;QAC7F,8DAA8D,cAAc,kBAAkB;QAC9F,6CAA6C,kBAAkB,+BAA+B;QAC9F,2FAA2F;QAC3F,qCAAqC,CACtC,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P6-B2 — a periodic progress beat for the duration of one long awaited step.
|
|
3
|
+
*
|
|
4
|
+
* `analyze` on a 7,700-file repository reliably exceeded the calling client's
|
|
5
|
+
* timeout even with the heap ceiling raised, and completed only when driven
|
|
6
|
+
* over stdio with no client-side timeout at all. It was not hung; it emitted
|
|
7
|
+
* one `notifications/progress` frame per *source*, so on a repo with a single
|
|
8
|
+
* language adapter the whole multi-minute read fell between two frames. MCP
|
|
9
|
+
* clients reset a request's timeout when a progress frame arrives for it, so a
|
|
10
|
+
* correct run and a wedged one were indistinguishable from the outside, and
|
|
11
|
+
* the timeout fired on the correct one.
|
|
12
|
+
*
|
|
13
|
+
* ## What this is not
|
|
14
|
+
*
|
|
15
|
+
* It does not make anything faster, and it is not a guarantee: resetting a
|
|
16
|
+
* timeout on progress is a client behaviour, not something the protocol
|
|
17
|
+
* obliges. That is why the elapsed time goes *in* the message rather than the
|
|
18
|
+
* beat being a bare ping — a caller reading the frames can see the step
|
|
19
|
+
* advancing rather than being asserted to. Honest degradation (rule 7) cuts
|
|
20
|
+
* both ways here: this discloses that work is ongoing, it does not claim
|
|
21
|
+
* progress it cannot measure. The adapter is opaque while it runs, so the
|
|
22
|
+
* count of files done is not available to report and none is invented.
|
|
23
|
+
*/
|
|
24
|
+
/** Interval between beats while a step is running. Well inside the 60s default most clients use. */
|
|
25
|
+
export declare const HEARTBEAT_MS = 15000;
|
|
26
|
+
export declare const HEARTBEAT_ENV_VAR = "DESCRY_PROGRESS_HEARTBEAT_MS";
|
|
27
|
+
/**
|
|
28
|
+
* The interval in force, honouring `DESCRY_PROGRESS_HEARTBEAT_MS`.
|
|
29
|
+
*
|
|
30
|
+
* A zero, a negative or an unreadable value falls back to the default rather
|
|
31
|
+
* than being taken literally: zero is a busy loop and not a plausible way to
|
|
32
|
+
* ask for one, so reading it as "the operator meant to disable beats" would
|
|
33
|
+
* turn a typo into the exact silence this module removes.
|
|
34
|
+
*/
|
|
35
|
+
export declare function heartbeatMs(): number;
|
|
36
|
+
/**
|
|
37
|
+
* Run `work`, beating `label` plus elapsed seconds every `intervalMs` until it
|
|
38
|
+
* settles.
|
|
39
|
+
*
|
|
40
|
+
* The timer is cleared in a `finally`, so a step that throws stops beating on
|
|
41
|
+
* the same tick it fails — a beat outliving its step would report a run that
|
|
42
|
+
* has already finished or died. `unref()` keeps a pending beat from holding
|
|
43
|
+
* the process open on its own.
|
|
44
|
+
*/
|
|
45
|
+
export declare function withHeartbeat<T>(label: string, beat: (message: string) => void, work: () => Promise<T>, intervalMs?: number): Promise<T>;
|
|
46
|
+
//# sourceMappingURL=heartbeat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.d.ts","sourceRoot":"","sources":["../src/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oGAAoG;AACpG,eAAO,MAAM,YAAY,QAAS,CAAC;AAEnC,eAAO,MAAM,iBAAiB,iCAAiC,CAAC;AAEhE;;;;;;;GAOG;AACH,wBAAgB,WAAW,IAAI,MAAM,CAMpC;AAED;;;;;;;;GAQG;AACH,wBAAsB,aAAa,CAAC,CAAC,EACnC,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,IAAI,EAC/B,IAAI,EAAE,MAAM,OAAO,CAAC,CAAC,CAAC,EACtB,UAAU,GAAE,MAAsB,GACjC,OAAO,CAAC,CAAC,CAAC,CAWZ"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* P6-B2 — a periodic progress beat for the duration of one long awaited step.
|
|
3
|
+
*
|
|
4
|
+
* `analyze` on a 7,700-file repository reliably exceeded the calling client's
|
|
5
|
+
* timeout even with the heap ceiling raised, and completed only when driven
|
|
6
|
+
* over stdio with no client-side timeout at all. It was not hung; it emitted
|
|
7
|
+
* one `notifications/progress` frame per *source*, so on a repo with a single
|
|
8
|
+
* language adapter the whole multi-minute read fell between two frames. MCP
|
|
9
|
+
* clients reset a request's timeout when a progress frame arrives for it, so a
|
|
10
|
+
* correct run and a wedged one were indistinguishable from the outside, and
|
|
11
|
+
* the timeout fired on the correct one.
|
|
12
|
+
*
|
|
13
|
+
* ## What this is not
|
|
14
|
+
*
|
|
15
|
+
* It does not make anything faster, and it is not a guarantee: resetting a
|
|
16
|
+
* timeout on progress is a client behaviour, not something the protocol
|
|
17
|
+
* obliges. That is why the elapsed time goes *in* the message rather than the
|
|
18
|
+
* beat being a bare ping — a caller reading the frames can see the step
|
|
19
|
+
* advancing rather than being asserted to. Honest degradation (rule 7) cuts
|
|
20
|
+
* both ways here: this discloses that work is ongoing, it does not claim
|
|
21
|
+
* progress it cannot measure. The adapter is opaque while it runs, so the
|
|
22
|
+
* count of files done is not available to report and none is invented.
|
|
23
|
+
*/
|
|
24
|
+
/** Interval between beats while a step is running. Well inside the 60s default most clients use. */
|
|
25
|
+
export const HEARTBEAT_MS = 15_000;
|
|
26
|
+
export const HEARTBEAT_ENV_VAR = "DESCRY_PROGRESS_HEARTBEAT_MS";
|
|
27
|
+
/**
|
|
28
|
+
* The interval in force, honouring `DESCRY_PROGRESS_HEARTBEAT_MS`.
|
|
29
|
+
*
|
|
30
|
+
* A zero, a negative or an unreadable value falls back to the default rather
|
|
31
|
+
* than being taken literally: zero is a busy loop and not a plausible way to
|
|
32
|
+
* ask for one, so reading it as "the operator meant to disable beats" would
|
|
33
|
+
* turn a typo into the exact silence this module removes.
|
|
34
|
+
*/
|
|
35
|
+
export function heartbeatMs() {
|
|
36
|
+
const raw = process.env[HEARTBEAT_ENV_VAR];
|
|
37
|
+
if (raw === undefined)
|
|
38
|
+
return HEARTBEAT_MS;
|
|
39
|
+
const parsed = Number(raw);
|
|
40
|
+
if (!Number.isFinite(parsed) || parsed <= 0)
|
|
41
|
+
return HEARTBEAT_MS;
|
|
42
|
+
return parsed;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Run `work`, beating `label` plus elapsed seconds every `intervalMs` until it
|
|
46
|
+
* settles.
|
|
47
|
+
*
|
|
48
|
+
* The timer is cleared in a `finally`, so a step that throws stops beating on
|
|
49
|
+
* the same tick it fails — a beat outliving its step would report a run that
|
|
50
|
+
* has already finished or died. `unref()` keeps a pending beat from holding
|
|
51
|
+
* the process open on its own.
|
|
52
|
+
*/
|
|
53
|
+
export async function withHeartbeat(label, beat, work, intervalMs = heartbeatMs()) {
|
|
54
|
+
const started = Date.now();
|
|
55
|
+
const timer = setInterval(() => {
|
|
56
|
+
beat(`${label} — still running, ${Math.round((Date.now() - started) / 1000)}s elapsed`);
|
|
57
|
+
}, intervalMs);
|
|
58
|
+
timer.unref?.();
|
|
59
|
+
try {
|
|
60
|
+
return await work();
|
|
61
|
+
}
|
|
62
|
+
finally {
|
|
63
|
+
clearInterval(timer);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
//# sourceMappingURL=heartbeat.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"heartbeat.js","sourceRoot":"","sources":["../src/heartbeat.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AAEH,oGAAoG;AACpG,MAAM,CAAC,MAAM,YAAY,GAAG,MAAM,CAAC;AAEnC,MAAM,CAAC,MAAM,iBAAiB,GAAG,8BAA8B,CAAC;AAEhE;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW;IACzB,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAC;IAC3C,IAAI,GAAG,KAAK,SAAS;QAAE,OAAO,YAAY,CAAC;IAC3C,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;IAC3B,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC;QAAE,OAAO,YAAY,CAAC;IACjE,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,KAAa,EACb,IAA+B,EAC/B,IAAsB,EACtB,aAAqB,WAAW,EAAE;IAElC,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAC3B,MAAM,KAAK,GAAG,WAAW,CAAC,GAAG,EAAE;QAC7B,IAAI,CAAC,GAAG,KAAK,qBAAqB,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,OAAO,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,CAAC;IAC1F,CAAC,EAAE,UAAU,CAAC,CAAC;IACf,KAAK,CAAC,KAAK,EAAE,EAAE,CAAC;IAChB,IAAI,CAAC;QACH,OAAO,MAAM,IAAI,EAAE,CAAC;IACtB,CAAC;YAAS,CAAC;QACT,aAAa,CAAC,KAAK,CAAC,CAAC;IACvB,CAAC;AACH,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** `@descryy/mcp` — the agent-facing front door. A thin wrapper over the query layer
|
|
2
|
+
* (DEC-002): every consumer goes through here and nothing touches storage directly —
|
|
3
|
+
* which is why tools hold a `Session`, not a driver. */
|
|
4
|
+
export { createMcpServer } from "./server.ts";
|
|
5
|
+
export type { McpServer, McpServerOptions } from "./server.ts";
|
|
6
|
+
export { Session, loadConfig, writeConfig, writeSources, ConfigError, CONFIG_RELATIVE_PATH, DEFAULT_GRAPH_RELATIVE_PATH, } from "./session.ts";
|
|
7
|
+
export type { DescryConfig, SessionOptions, ConfigPatch } from "./session.ts";
|
|
8
|
+
export { loadSources, detectSources, normaliseSpec } from "./registry.ts";
|
|
9
|
+
export type { SourceSpec, LoadedSource, SourceLoadFailure, RegistryResult } from "./registry.ts";
|
|
10
|
+
/** The real, at-rest credential store — see the module's own header for why this is the one
|
|
11
|
+
* place `@descryy/cli` reaches this without depending on `@descryy/runtime-environment-profile`
|
|
12
|
+
* itself. */
|
|
13
|
+
export { createDefaultCredentialStore } from "./credential-store.ts";
|
|
14
|
+
export type { CredentialStoreOptions, WritableCredentialStore } from "./credential-store.ts";
|
|
15
|
+
export { renderAnswer, renderFailed, renderHandshake, renderTimedOut, renderToolError, DisclosureError, TOOL_TIERS, } from "./render.ts";
|
|
16
|
+
export type { AnswerEnvelope, CallToolResult, Provenance, ResultState, ToolAnswer, ToolTier, TruncationDetail, } from "./render.ts";
|
|
17
|
+
export { TOOLS, TOOLS_BY_NAME, ToolInputError, resolveOneNode } from "./tools/index.ts";
|
|
18
|
+
export type { BriefNode, NodeCandidates, Progress, ToolContext, ToolDefinition, } from "./tools/index.ts";
|
|
19
|
+
/** The shape each tool puts in `AnswerEnvelope.data`. `data` is `unknown` in the envelope
|
|
20
|
+
* by design, but an AI caller can't rely on an unwritten shape — each type here describes
|
|
21
|
+
* what its tool returns today; genuinely conditional payloads are unions, not `unknown`. */
|
|
22
|
+
export type { AffectedRef, AnalyzeData, BlockedCheck, CoChangedFile, ConfigDependencyReport, ContractPathFinding, ContractShapeMismatchReport, ContractShapeStatus, ContractsData, CrossPrData, CrossPrEmptyDiff, CrossPrGitFailure, CrossPrReport, EnvFindingReport, HiddenDependencyCheck, HiddenDependencyFinding, HistoryData, HistoryFile, HistoryFileResolved, HistoryFileUnresolved, HistoryReport, ImpactData, ImpactReport, ImpactedNode, LinkWorkspaceData, MarkIncidentData, LinkedRepo, OverlapCheck, OverlapReportChecked, PrAnalysisData, PrAnalysisEmptyDiff, PrAnalysisGitFailure, PrAnalysisLists, PrAnalysisRange, PrAnalysisReport, PrAnalysisUnresolved, PropagationData, PropagationReport, QuestionsData, ReachedNode, RelatedNode, ScopeData, ScopeNotSeeded, ScopeReport, ScopeTierCount, ScopedNodeReport, SimilarIncidentReport, SimilarIncidentSignalReport, SimilarIncidentsData, SourceRun, SupersededCheck, TracedPath, ValidateData, } from "./tools/index.ts";
|
|
23
|
+
export { serveStdio, guardStdout, createLineReader } from "./transport.ts";
|
|
24
|
+
export type { Transport, StdioOptions } from "./transport.ts";
|
|
25
|
+
export { PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, negotiateVersion, parseMessage, ProtocolError, } from "./protocol.ts";
|
|
26
|
+
export type { RpcRequest, RpcNotification, RpcResponse, RpcMessage, RpcId } from "./protocol.ts";
|
|
27
|
+
/** The scenario format — storage, schema, refusals. Re-exported here so `descry check`
|
|
28
|
+
* doesn't reach past the package boundary — a second reader importing the relative path
|
|
29
|
+
* could drift from this one the day the schema changes. */
|
|
30
|
+
export { MIN_READABLE_SCHEMA_VERSION, SCENARIO_SCHEMA_VERSION, isSecretRef, isUnverifying, parseScenario, readSecretRef, referencedVariables, resolveSecretText, secretRefFor, serializeScenario, scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, projectScenarioToRunPlan, projectRunPlanToScenario, } from "./scenarios/index.ts";
|
|
31
|
+
export type { CredentialStoreLike, Scenario, SecretEnvironment, SecretRef, SecretResolution, ScenarioStep, ScenarioAssertion, ScenarioAssertionKind, ScenarioActionKind, ScenarioParseResult, TargetDescriptor, ProjectedStep, ProjectedStepKind, ProjectedBrowserRunPlan, ProjectionRefusal, ScenarioProjection, PlanProjection, RawProjectedStep, ScenarioMeta, } from "./scenarios/index.ts";
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.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AAgB,EAChB,YAAY,EACZ,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,mBAAmB,EACnB,gBAAgB,EAChB,aAAa,EACb,iBAAiB,EACjB,uBAAuB,EACvB,iBAAiB,EACjB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,YAAY,GACb,MAAM,sBAAsB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** `@descryy/mcp` — the agent-facing front door. A thin wrapper over the query layer
|
|
2
|
+
* (DEC-002): every consumer goes through here and nothing touches storage directly —
|
|
3
|
+
* which is why tools hold a `Session`, not a driver. */
|
|
4
|
+
export { createMcpServer } from "./server.js";
|
|
5
|
+
export { Session, loadConfig, writeConfig, writeSources, ConfigError, CONFIG_RELATIVE_PATH, DEFAULT_GRAPH_RELATIVE_PATH, } from "./session.js";
|
|
6
|
+
export { loadSources, detectSources, normaliseSpec } from "./registry.js";
|
|
7
|
+
/** The real, at-rest credential store — see the module's own header for why this is the one
|
|
8
|
+
* place `@descryy/cli` reaches this without depending on `@descryy/runtime-environment-profile`
|
|
9
|
+
* itself. */
|
|
10
|
+
export { createDefaultCredentialStore } from "./credential-store.js";
|
|
11
|
+
export { renderAnswer, renderFailed, renderHandshake, renderTimedOut, renderToolError, DisclosureError, TOOL_TIERS, } from "./render.js";
|
|
12
|
+
export { TOOLS, TOOLS_BY_NAME, ToolInputError, resolveOneNode } from "./tools/index.js";
|
|
13
|
+
export { serveStdio, guardStdout, createLineReader } from "./transport.js";
|
|
14
|
+
export { PROTOCOL_VERSION, SUPPORTED_PROTOCOL_VERSIONS, negotiateVersion, parseMessage, ProtocolError, } from "./protocol.js";
|
|
15
|
+
/** The scenario format — storage, schema, refusals. Re-exported here so `descry check`
|
|
16
|
+
* doesn't reach past the package boundary — a second reader importing the relative path
|
|
17
|
+
* could drift from this one the day the schema changes. */
|
|
18
|
+
export { MIN_READABLE_SCHEMA_VERSION, SCENARIO_SCHEMA_VERSION, isSecretRef, isUnverifying, parseScenario, readSecretRef, referencedVariables, resolveSecretText, secretRefFor, serializeScenario, scenariosDirectory, scenarioPath, listScenarios, ScenarioListError, readScenario, writeScenario, projectScenarioToRunPlan, projectRunPlanToScenario, } from "./scenarios/index.js";
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;yDAEyD;AAEzD,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAG9C,OAAO,EACL,OAAO,EACP,UAAU,EACV,WAAW,EACX,YAAY,EACZ,WAAW,EACX,oBAAoB,EACpB,2BAA2B,GAC5B,MAAM,cAAc,CAAC;AAGtB,OAAO,EAAE,WAAW,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAG1E;;cAEc;AACd,OAAO,EAAE,4BAA4B,EAAE,MAAM,uBAAuB,CAAC;AAGrE,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,eAAe,EACf,cAAc,EACd,eAAe,EACf,eAAe,EACf,UAAU,GACX,MAAM,aAAa,CAAC;AAWrB,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAoExF,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAG3E,OAAO,EACL,gBAAgB,EAChB,2BAA2B,EAC3B,gBAAgB,EAChB,YAAY,EACZ,aAAa,GACd,MAAM,eAAe,CAAC;AAGvB;;4DAE4D;AAC5D,OAAO,EACL,2BAA2B,EAC3B,uBAAuB,EACvB,WAAW,EACX,aAAa,EACb,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,iBAAiB,EACjB,kBAAkB,EAClB,YAAY,EACZ,aAAa,EACb,iBAAiB,EACjB,YAAY,EACZ,aAAa,EACb,wBAAwB,EACxB,wBAAwB,GACzB,MAAM,sBAAsB,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gates `import()` of caller-named specifiers (A-F1/A-F2, three ungated call sites). Refuses path-like specifiers (exact bytes, no install step) by default.
|
|
3
|
+
* Also refuses a bare specifier resolved into the scanned repo's own git-tracked `node_modules` (real `npm install` leaves it untracked) — a repo can otherwise ship a payload merely by being cloned.
|
|
4
|
+
* Escape hatches: `DESCRY_ALLOW_PATH_ADAPTER_MODULES=1`, `DESCRY_ALLOW_TRACKED_NODE_MODULES=1` (server env only, never repo-set).
|
|
5
|
+
*/
|
|
6
|
+
export declare const ALLOW_PATH_MODULES_ENV_VAR = "DESCRY_ALLOW_PATH_ADAPTER_MODULES";
|
|
7
|
+
export declare const ALLOW_TRACKED_NODE_MODULES_ENV_VAR = "DESCRY_ALLOW_TRACKED_NODE_MODULES";
|
|
8
|
+
export type ModuleTrustDecision = {
|
|
9
|
+
readonly allowed: true;
|
|
10
|
+
} | {
|
|
11
|
+
readonly allowed: false;
|
|
12
|
+
readonly reason: string;
|
|
13
|
+
};
|
|
14
|
+
/** Path-like: relative/absolute/drive-absolute/home-relative path, or any URL-scheme specifier (`file:`, `http:`, `data:`, …) — names exact bytes, not an installed package. Everything else resolves normally. */
|
|
15
|
+
export declare function isPathLikeSpecifier(specifier: string): boolean;
|
|
16
|
+
/**
|
|
17
|
+
* Whether `resolvedAbsolutePath` sits inside `repoPath` — never true for a path that
|
|
18
|
+
* merely shares a prefix (`/home/user/repo-other` is not inside `/home/user/repo`).
|
|
19
|
+
*
|
|
20
|
+
* UAT phase 5 §1b: `resolveFromRepo` anchors `createRequire` at the repo's own
|
|
21
|
+
* `package.json` and lets Node's ordinary CJS algorithm walk the entire ancestor
|
|
22
|
+
* chain — `repo/node_modules` → `$HOME/node_modules` → `/node_modules`. A stray
|
|
23
|
+
* install anywhere above the repository wins over what the repository (or the
|
|
24
|
+
* server) actually intended, and nothing previously distinguished "found inside
|
|
25
|
+
* the repo" from "found somewhere Node's upward walk happened to land". This is
|
|
26
|
+
* the containment test `resolveRepoAdapterModule` uses to draw that line.
|
|
27
|
+
*/
|
|
28
|
+
export declare function resolvesInsideRepo(repoPath: string, resolvedAbsolutePath: string): boolean;
|
|
29
|
+
/** Decides if `specifier` may be `import()`-ed; never throws — each call site turns a refusal into its own existing failure channel (`SourceLoadFailure`, etc.). */
|
|
30
|
+
export declare function checkModuleTrust(specifier: string): ModuleTrustDecision;
|
|
31
|
+
/** Follow-up to `checkModuleTrust`: refuses a bare specifier resolved into the scanned repo's own git-tracked `node_modules` (real `npm install` leaves it untracked) — closes a payload-via-commit gap. A `null` git-tracked check (no `.git`) is allowed, not refused: the exploit needs a clone, and a non-git directory is a real workflow this check has no history to verify either way. */
|
|
32
|
+
export declare function checkRepoResolvedModuleTrust(options: {
|
|
33
|
+
readonly specifier: string;
|
|
34
|
+
readonly repoPath: string;
|
|
35
|
+
readonly resolvedAbsolutePath: string;
|
|
36
|
+
}): Promise<ModuleTrustDecision>;
|
|
37
|
+
//# sourceMappingURL=module-trust.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module-trust.d.ts","sourceRoot":"","sources":["../src/module-trust.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH,eAAO,MAAM,0BAA0B,sCAAsC,CAAC;AAC9E,eAAO,MAAM,kCAAkC,sCAAsC,CAAC;AAEtF,MAAM,MAAM,mBAAmB,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,IAAI,CAAA;CAAE,GAAG;IAAE,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC;IAAC,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEpH,mNAAmN;AACnN,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAK9D;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,oBAAoB,EAAE,MAAM,GAAG,OAAO,CAG1F;AAOD,oKAAoK;AACpK,wBAAgB,gBAAgB,CAAC,SAAS,EAAE,MAAM,GAAG,mBAAmB,CAYvE;AAOD,kYAAkY;AAClY,wBAAsB,4BAA4B,CAAC,OAAO,EAAE;IAC1D,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,oBAAoB,EAAE,MAAM,CAAC;CACvC,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAiB/B"}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gates `import()` of caller-named specifiers (A-F1/A-F2, three ungated call sites). Refuses path-like specifiers (exact bytes, no install step) by default.
|
|
3
|
+
* Also refuses a bare specifier resolved into the scanned repo's own git-tracked `node_modules` (real `npm install` leaves it untracked) — a repo can otherwise ship a payload merely by being cloned.
|
|
4
|
+
* Escape hatches: `DESCRY_ALLOW_PATH_ADAPTER_MODULES=1`, `DESCRY_ALLOW_TRACKED_NODE_MODULES=1` (server env only, never repo-set).
|
|
5
|
+
*/
|
|
6
|
+
import { sep } from "node:path";
|
|
7
|
+
import { isPathTrackedByGit } from "@descryy/core";
|
|
8
|
+
export const ALLOW_PATH_MODULES_ENV_VAR = "DESCRY_ALLOW_PATH_ADAPTER_MODULES";
|
|
9
|
+
export const ALLOW_TRACKED_NODE_MODULES_ENV_VAR = "DESCRY_ALLOW_TRACKED_NODE_MODULES";
|
|
10
|
+
/** Path-like: relative/absolute/drive-absolute/home-relative path, or any URL-scheme specifier (`file:`, `http:`, `data:`, …) — names exact bytes, not an installed package. Everything else resolves normally. */
|
|
11
|
+
export function isPathLikeSpecifier(specifier) {
|
|
12
|
+
if (specifier.startsWith(".") || specifier.startsWith("/") || specifier.startsWith("~"))
|
|
13
|
+
return true;
|
|
14
|
+
if (/^[a-zA-Z]:[\\/]/.test(specifier))
|
|
15
|
+
return true;
|
|
16
|
+
if (/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(specifier))
|
|
17
|
+
return true;
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Whether `resolvedAbsolutePath` sits inside `repoPath` — never true for a path that
|
|
22
|
+
* merely shares a prefix (`/home/user/repo-other` is not inside `/home/user/repo`).
|
|
23
|
+
*
|
|
24
|
+
* UAT phase 5 §1b: `resolveFromRepo` anchors `createRequire` at the repo's own
|
|
25
|
+
* `package.json` and lets Node's ordinary CJS algorithm walk the entire ancestor
|
|
26
|
+
* chain — `repo/node_modules` → `$HOME/node_modules` → `/node_modules`. A stray
|
|
27
|
+
* install anywhere above the repository wins over what the repository (or the
|
|
28
|
+
* server) actually intended, and nothing previously distinguished "found inside
|
|
29
|
+
* the repo" from "found somewhere Node's upward walk happened to land". This is
|
|
30
|
+
* the containment test `resolveRepoAdapterModule` uses to draw that line.
|
|
31
|
+
*/
|
|
32
|
+
export function resolvesInsideRepo(repoPath, resolvedAbsolutePath) {
|
|
33
|
+
const root = repoPath.endsWith(sep) ? repoPath : `${repoPath}${sep}`;
|
|
34
|
+
return resolvedAbsolutePath.startsWith(root);
|
|
35
|
+
}
|
|
36
|
+
function pathModulesAllowed() {
|
|
37
|
+
const value = process.env[ALLOW_PATH_MODULES_ENV_VAR];
|
|
38
|
+
return value === "1" || value === "true";
|
|
39
|
+
}
|
|
40
|
+
/** Decides if `specifier` may be `import()`-ed; never throws — each call site turns a refusal into its own existing failure channel (`SourceLoadFailure`, etc.). */
|
|
41
|
+
export function checkModuleTrust(specifier) {
|
|
42
|
+
if (!isPathLikeSpecifier(specifier))
|
|
43
|
+
return { allowed: true };
|
|
44
|
+
if (pathModulesAllowed())
|
|
45
|
+
return { allowed: true };
|
|
46
|
+
return {
|
|
47
|
+
allowed: false,
|
|
48
|
+
reason: `"${specifier}" names a file path or URL rather than an installed package. Loading one executes ` +
|
|
49
|
+
"arbitrary code with no further confirmation, and this specifier can come from a scanned repository's " +
|
|
50
|
+
"own configuration or from a tool call — neither is necessarily something the operator running this " +
|
|
51
|
+
`server chose. Refused by default; set ${ALLOW_PATH_MODULES_ENV_VAR}=1 in this server's own environment ` +
|
|
52
|
+
"to allow it, and only do that for adapters and configuration you, the operator, trust.",
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
function trackedNodeModulesAllowed() {
|
|
56
|
+
const value = process.env[ALLOW_TRACKED_NODE_MODULES_ENV_VAR];
|
|
57
|
+
return value === "1" || value === "true";
|
|
58
|
+
}
|
|
59
|
+
/** Follow-up to `checkModuleTrust`: refuses a bare specifier resolved into the scanned repo's own git-tracked `node_modules` (real `npm install` leaves it untracked) — closes a payload-via-commit gap. A `null` git-tracked check (no `.git`) is allowed, not refused: the exploit needs a clone, and a non-git directory is a real workflow this check has no history to verify either way. */
|
|
60
|
+
export async function checkRepoResolvedModuleTrust(options) {
|
|
61
|
+
if (trackedNodeModulesAllowed())
|
|
62
|
+
return { allowed: true };
|
|
63
|
+
const tracked = await isPathTrackedByGit(options.repoPath, options.resolvedAbsolutePath);
|
|
64
|
+
if (tracked !== true)
|
|
65
|
+
return { allowed: true };
|
|
66
|
+
return {
|
|
67
|
+
allowed: false,
|
|
68
|
+
reason: `"${options.specifier}" resolved to ${options.resolvedAbsolutePath}, inside ${options.repoPath}'s own ` +
|
|
69
|
+
"node_modules — but that file is committed to this repository's own git history, not installed by a " +
|
|
70
|
+
"package manager (a real `npm install` leaves node_modules untracked, almost universally). A " +
|
|
71
|
+
"repository that commits its own node_modules can deliver arbitrary code to anyone who merely clones " +
|
|
72
|
+
`it, with no npm install step at all. Refused by default; set ${ALLOW_TRACKED_NODE_MODULES_ENV_VAR}=1 ` +
|
|
73
|
+
"in this server's own environment to allow it, and only do that for a repository whose committed " +
|
|
74
|
+
"node_modules you, the operator, trust.",
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=module-trust.js.map
|