@descryy/mcp 0.11.3 → 0.11.5
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/package.json +20 -20
- package/dist/action-handshake.d.ts +0 -38
- package/dist/action-handshake.d.ts.map +0 -1
- package/dist/action-handshake.js +0 -127
- package/dist/action-handshake.js.map +0 -1
- package/dist/bin/descry-mcp.d.ts +0 -7
- package/dist/bin/descry-mcp.d.ts.map +0 -1
- package/dist/bin/descry-mcp.js +0 -72
- package/dist/bin/descry-mcp.js.map +0 -1
- package/dist/browser/auth.d.ts +0 -84
- package/dist/browser/auth.d.ts.map +0 -1
- package/dist/browser/auth.js +0 -233
- package/dist/browser/auth.js.map +0 -1
- package/dist/browser/capability-probe.d.ts +0 -109
- package/dist/browser/capability-probe.d.ts.map +0 -1
- package/dist/browser/capability-probe.js +0 -201
- package/dist/browser/capability-probe.js.map +0 -1
- package/dist/browser/driver.d.ts +0 -570
- package/dist/browser/driver.d.ts.map +0 -1
- package/dist/browser/driver.js +0 -116
- package/dist/browser/driver.js.map +0 -1
- package/dist/browser/evidence.d.ts +0 -28
- package/dist/browser/evidence.d.ts.map +0 -1
- package/dist/browser/evidence.js +0 -82
- package/dist/browser/evidence.js.map +0 -1
- package/dist/browser/fake-driver.d.ts +0 -116
- package/dist/browser/fake-driver.d.ts.map +0 -1
- package/dist/browser/fake-driver.js +0 -416
- package/dist/browser/fake-driver.js.map +0 -1
- package/dist/browser/fault-attribution.d.ts +0 -178
- package/dist/browser/fault-attribution.d.ts.map +0 -1
- package/dist/browser/fault-attribution.js +0 -266
- package/dist/browser/fault-attribution.js.map +0 -1
- package/dist/browser/graph-write.d.ts +0 -45
- package/dist/browser/graph-write.d.ts.map +0 -1
- package/dist/browser/graph-write.js +0 -103
- package/dist/browser/graph-write.js.map +0 -1
- package/dist/browser/identity-graph-write.d.ts +0 -55
- package/dist/browser/identity-graph-write.d.ts.map +0 -1
- package/dist/browser/identity-graph-write.js +0 -45
- package/dist/browser/identity-graph-write.js.map +0 -1
- package/dist/browser/page-probe.d.ts +0 -81
- package/dist/browser/page-probe.d.ts.map +0 -1
- package/dist/browser/page-probe.js +0 -202
- package/dist/browser/page-probe.js.map +0 -1
- package/dist/browser/playwright-driver.d.ts +0 -114
- package/dist/browser/playwright-driver.d.ts.map +0 -1
- package/dist/browser/playwright-driver.js +0 -1479
- package/dist/browser/playwright-driver.js.map +0 -1
- package/dist/browser/provider.d.ts +0 -26
- package/dist/browser/provider.d.ts.map +0 -1
- package/dist/browser/provider.js +0 -14
- package/dist/browser/provider.js.map +0 -1
- package/dist/browser/reach-recording-session.d.ts +0 -44
- package/dist/browser/reach-recording-session.d.ts.map +0 -1
- package/dist/browser/reach-recording-session.js +0 -143
- package/dist/browser/reach-recording-session.js.map +0 -1
- package/dist/browser/reachability.d.ts +0 -168
- package/dist/browser/reachability.d.ts.map +0 -1
- package/dist/browser/reachability.js +0 -294
- package/dist/browser/reachability.js.map +0 -1
- package/dist/browser/registry.d.ts +0 -126
- package/dist/browser/registry.d.ts.map +0 -1
- package/dist/browser/registry.js +0 -177
- package/dist/browser/registry.js.map +0 -1
- package/dist/browser/scenario-provenance.d.ts +0 -23
- package/dist/browser/scenario-provenance.d.ts.map +0 -1
- package/dist/browser/scenario-provenance.js +0 -73
- package/dist/browser/scenario-provenance.js.map +0 -1
- package/dist/browser/scenario-resolve.d.ts +0 -28
- package/dist/browser/scenario-resolve.d.ts.map +0 -1
- package/dist/browser/scenario-resolve.js +0 -96
- package/dist/browser/scenario-resolve.js.map +0 -1
- package/dist/browser/scenario-runner.d.ts +0 -72
- package/dist/browser/scenario-runner.d.ts.map +0 -1
- package/dist/browser/scenario-runner.js +0 -353
- package/dist/browser/scenario-runner.js.map +0 -1
- package/dist/browser/stack-parser.d.ts +0 -19
- package/dist/browser/stack-parser.d.ts.map +0 -1
- package/dist/browser/stack-parser.js +0 -85
- package/dist/browser/stack-parser.js.map +0 -1
- package/dist/browser/tool-support.d.ts +0 -71
- package/dist/browser/tool-support.d.ts.map +0 -1
- package/dist/browser/tool-support.js +0 -216
- package/dist/browser/tool-support.js.map +0 -1
- package/dist/browser/url-scheme.d.ts +0 -14
- package/dist/browser/url-scheme.d.ts.map +0 -1
- package/dist/browser/url-scheme.js +0 -38
- package/dist/browser/url-scheme.js.map +0 -1
- package/dist/browser/wait-target.d.ts +0 -37
- package/dist/browser/wait-target.d.ts.map +0 -1
- package/dist/browser/wait-target.js +0 -54
- package/dist/browser/wait-target.js.map +0 -1
- package/dist/cancellation.d.ts +0 -20
- package/dist/cancellation.d.ts.map +0 -1
- package/dist/cancellation.js +0 -41
- package/dist/cancellation.js.map +0 -1
- package/dist/capped.d.ts +0 -17
- package/dist/capped.d.ts.map +0 -1
- package/dist/capped.js +0 -15
- package/dist/capped.js.map +0 -1
- package/dist/credential-store.d.ts +0 -22
- package/dist/credential-store.d.ts.map +0 -1
- package/dist/credential-store.js +0 -33
- package/dist/credential-store.js.map +0 -1
- package/dist/disclosure-ledger.d.ts +0 -14
- package/dist/disclosure-ledger.d.ts.map +0 -1
- package/dist/disclosure-ledger.js +0 -18
- package/dist/disclosure-ledger.js.map +0 -1
- package/dist/evidence/observed-route-evidence.d.ts +0 -25
- package/dist/evidence/observed-route-evidence.d.ts.map +0 -1
- package/dist/evidence/observed-route-evidence.js +0 -76
- package/dist/evidence/observed-route-evidence.js.map +0 -1
- package/dist/heap.d.ts +0 -61
- package/dist/heap.d.ts.map +0 -1
- package/dist/heap.js +0 -82
- package/dist/heap.js.map +0 -1
- package/dist/heartbeat.d.ts +0 -46
- package/dist/heartbeat.d.ts.map +0 -1
- package/dist/heartbeat.js +0 -66
- package/dist/heartbeat.js.map +0 -1
- package/dist/index.d.ts +0 -32
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -19
- package/dist/index.js.map +0 -1
- package/dist/module-trust.d.ts +0 -37
- package/dist/module-trust.d.ts.map +0 -1
- package/dist/module-trust.js +0 -77
- package/dist/module-trust.js.map +0 -1
- package/dist/path-confinement.d.ts +0 -31
- package/dist/path-confinement.d.ts.map +0 -1
- package/dist/path-confinement.js +0 -44
- package/dist/path-confinement.js.map +0 -1
- package/dist/planner/predict-then-propose.d.ts +0 -134
- package/dist/planner/predict-then-propose.d.ts.map +0 -1
- package/dist/planner/predict-then-propose.js +0 -138
- package/dist/planner/predict-then-propose.js.map +0 -1
- package/dist/planner/propose-journey.d.ts +0 -75
- package/dist/planner/propose-journey.d.ts.map +0 -1
- package/dist/planner/propose-journey.js +0 -96
- package/dist/planner/propose-journey.js.map +0 -1
- package/dist/protocol.d.ts +0 -57
- package/dist/protocol.d.ts.map +0 -1
- package/dist/protocol.js +0 -90
- package/dist/protocol.js.map +0 -1
- package/dist/registry.d.ts +0 -103
- package/dist/registry.d.ts.map +0 -1
- package/dist/registry.js +0 -319
- package/dist/registry.js.map +0 -1
- package/dist/render.d.ts +0 -580
- package/dist/render.d.ts.map +0 -1
- package/dist/render.js +0 -867
- package/dist/render.js.map +0 -1
- package/dist/runtime-registry.d.ts +0 -22
- package/dist/runtime-registry.d.ts.map +0 -1
- package/dist/runtime-registry.js +0 -142
- package/dist/runtime-registry.js.map +0 -1
- package/dist/sandbox-defaults.d.ts +0 -41
- package/dist/sandbox-defaults.d.ts.map +0 -1
- package/dist/sandbox-defaults.js +0 -14
- package/dist/sandbox-defaults.js.map +0 -1
- package/dist/scenarios/browser-run-plan-projection.d.ts +0 -161
- package/dist/scenarios/browser-run-plan-projection.d.ts.map +0 -1
- package/dist/scenarios/browser-run-plan-projection.js +0 -264
- package/dist/scenarios/browser-run-plan-projection.js.map +0 -1
- package/dist/scenarios/credential-ref.d.ts +0 -102
- package/dist/scenarios/credential-ref.d.ts.map +0 -1
- package/dist/scenarios/credential-ref.js +0 -148
- package/dist/scenarios/credential-ref.js.map +0 -1
- package/dist/scenarios/index.d.ts +0 -7
- package/dist/scenarios/index.d.ts.map +0 -1
- package/dist/scenarios/index.js +0 -7
- package/dist/scenarios/index.js.map +0 -1
- package/dist/scenarios/parse.d.ts +0 -18
- package/dist/scenarios/parse.d.ts.map +0 -1
- package/dist/scenarios/parse.js +0 -212
- package/dist/scenarios/parse.js.map +0 -1
- package/dist/scenarios/scenario.d.ts +0 -93
- package/dist/scenarios/scenario.d.ts.map +0 -1
- package/dist/scenarios/scenario.js +0 -27
- package/dist/scenarios/scenario.js.map +0 -1
- package/dist/scenarios/secret-ref.d.ts +0 -86
- package/dist/scenarios/secret-ref.d.ts.map +0 -1
- package/dist/scenarios/secret-ref.js +0 -125
- package/dist/scenarios/secret-ref.js.map +0 -1
- package/dist/scenarios/storage.d.ts +0 -21
- package/dist/scenarios/storage.d.ts.map +0 -1
- package/dist/scenarios/storage.js +0 -103
- package/dist/scenarios/storage.js.map +0 -1
- package/dist/server.d.ts +0 -61
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -541
- package/dist/server.js.map +0 -1
- package/dist/session.d.ts +0 -243
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -602
- package/dist/session.js.map +0 -1
- package/dist/tools/alias-kit.d.ts +0 -29
- package/dist/tools/alias-kit.d.ts.map +0 -1
- package/dist/tools/alias-kit.js +0 -21
- package/dist/tools/alias-kit.js.map +0 -1
- package/dist/tools/aliases.d.ts +0 -42
- package/dist/tools/aliases.d.ts.map +0 -1
- package/dist/tools/aliases.js +0 -52
- package/dist/tools/aliases.js.map +0 -1
- package/dist/tools/analyze-workspace.d.ts +0 -52
- package/dist/tools/analyze-workspace.d.ts.map +0 -1
- package/dist/tools/analyze-workspace.js +0 -207
- package/dist/tools/analyze-workspace.js.map +0 -1
- package/dist/tools/analyze.d.ts +0 -163
- package/dist/tools/analyze.d.ts.map +0 -1
- package/dist/tools/analyze.js +0 -724
- package/dist/tools/analyze.js.map +0 -1
- package/dist/tools/browser-click.d.ts +0 -18
- package/dist/tools/browser-click.d.ts.map +0 -1
- package/dist/tools/browser-click.js +0 -110
- package/dist/tools/browser-click.js.map +0 -1
- package/dist/tools/browser-close-session.d.ts +0 -39
- package/dist/tools/browser-close-session.d.ts.map +0 -1
- package/dist/tools/browser-close-session.js +0 -120
- package/dist/tools/browser-close-session.js.map +0 -1
- package/dist/tools/browser-fill.d.ts +0 -18
- package/dist/tools/browser-fill.d.ts.map +0 -1
- package/dist/tools/browser-fill.js +0 -117
- package/dist/tools/browser-fill.js.map +0 -1
- package/dist/tools/browser-navigate.d.ts +0 -15
- package/dist/tools/browser-navigate.d.ts.map +0 -1
- package/dist/tools/browser-navigate.js +0 -104
- package/dist/tools/browser-navigate.js.map +0 -1
- package/dist/tools/browser-read.d.ts +0 -33
- package/dist/tools/browser-read.d.ts.map +0 -1
- package/dist/tools/browser-read.js +0 -113
- package/dist/tools/browser-read.js.map +0 -1
- package/dist/tools/browser-run-scenario.d.ts +0 -28
- package/dist/tools/browser-run-scenario.d.ts.map +0 -1
- package/dist/tools/browser-run-scenario.js +0 -206
- package/dist/tools/browser-run-scenario.js.map +0 -1
- package/dist/tools/browser-save-scenario.d.ts +0 -19
- package/dist/tools/browser-save-scenario.d.ts.map +0 -1
- package/dist/tools/browser-save-scenario.js +0 -447
- package/dist/tools/browser-save-scenario.js.map +0 -1
- package/dist/tools/browser-select.d.ts +0 -20
- package/dist/tools/browser-select.d.ts.map +0 -1
- package/dist/tools/browser-select.js +0 -120
- package/dist/tools/browser-select.js.map +0 -1
- package/dist/tools/browser-snapshot.d.ts +0 -46
- package/dist/tools/browser-snapshot.d.ts.map +0 -1
- package/dist/tools/browser-snapshot.js +0 -127
- package/dist/tools/browser-snapshot.js.map +0 -1
- package/dist/tools/browser-start-session.d.ts +0 -24
- package/dist/tools/browser-start-session.d.ts.map +0 -1
- package/dist/tools/browser-start-session.js +0 -622
- package/dist/tools/browser-start-session.js.map +0 -1
- package/dist/tools/browser-submit.d.ts +0 -18
- package/dist/tools/browser-submit.d.ts.map +0 -1
- package/dist/tools/browser-submit.js +0 -106
- package/dist/tools/browser-submit.js.map +0 -1
- package/dist/tools/browser-type.d.ts +0 -18
- package/dist/tools/browser-type.d.ts.map +0 -1
- package/dist/tools/browser-type.js +0 -115
- package/dist/tools/browser-type.js.map +0 -1
- package/dist/tools/browser-wait-for.d.ts +0 -45
- package/dist/tools/browser-wait-for.d.ts.map +0 -1
- package/dist/tools/browser-wait-for.js +0 -150
- package/dist/tools/browser-wait-for.js.map +0 -1
- package/dist/tools/browser.d.ts +0 -69
- package/dist/tools/browser.d.ts.map +0 -1
- package/dist/tools/browser.js +0 -386
- package/dist/tools/browser.js.map +0 -1
- package/dist/tools/chain.d.ts +0 -41
- package/dist/tools/chain.d.ts.map +0 -1
- package/dist/tools/chain.js +0 -105
- package/dist/tools/chain.js.map +0 -1
- package/dist/tools/change-scope.d.ts +0 -25
- package/dist/tools/change-scope.d.ts.map +0 -1
- package/dist/tools/change-scope.js +0 -110
- package/dist/tools/change-scope.js.map +0 -1
- package/dist/tools/code-context.d.ts +0 -83
- package/dist/tools/code-context.d.ts.map +0 -1
- package/dist/tools/code-context.js +0 -416
- package/dist/tools/code-context.js.map +0 -1
- package/dist/tools/contracts.d.ts +0 -74
- package/dist/tools/contracts.d.ts.map +0 -1
- package/dist/tools/contracts.js +0 -196
- package/dist/tools/contracts.js.map +0 -1
- package/dist/tools/cross-pr.d.ts +0 -178
- package/dist/tools/cross-pr.d.ts.map +0 -1
- package/dist/tools/cross-pr.js +0 -321
- package/dist/tools/cross-pr.js.map +0 -1
- package/dist/tools/disclosure.d.ts +0 -75
- package/dist/tools/disclosure.d.ts.map +0 -1
- package/dist/tools/disclosure.js +0 -288
- package/dist/tools/disclosure.js.map +0 -1
- package/dist/tools/draw-conclusion.d.ts +0 -55
- package/dist/tools/draw-conclusion.d.ts.map +0 -1
- package/dist/tools/draw-conclusion.js +0 -259
- package/dist/tools/draw-conclusion.js.map +0 -1
- package/dist/tools/git-context.d.ts +0 -39
- package/dist/tools/git-context.d.ts.map +0 -1
- package/dist/tools/git-context.js +0 -364
- package/dist/tools/git-context.js.map +0 -1
- package/dist/tools/git-diff.d.ts +0 -45
- package/dist/tools/git-diff.d.ts.map +0 -1
- package/dist/tools/git-diff.js +0 -338
- package/dist/tools/git-diff.js.map +0 -1
- package/dist/tools/git-history.d.ts +0 -16
- package/dist/tools/git-history.d.ts.map +0 -1
- package/dist/tools/git-history.js +0 -86
- package/dist/tools/git-history.js.map +0 -1
- package/dist/tools/history.d.ts +0 -34
- package/dist/tools/history.d.ts.map +0 -1
- package/dist/tools/history.js +0 -121
- package/dist/tools/history.js.map +0 -1
- package/dist/tools/impact.d.ts +0 -46
- package/dist/tools/impact.d.ts.map +0 -1
- package/dist/tools/impact.js +0 -225
- package/dist/tools/impact.js.map +0 -1
- package/dist/tools/index.d.ts +0 -59
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -70
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/kit.d.ts +0 -165
- package/dist/tools/kit.d.ts.map +0 -1
- package/dist/tools/kit.js +0 -153
- package/dist/tools/kit.js.map +0 -1
- package/dist/tools/link-workspace.d.ts +0 -24
- package/dist/tools/link-workspace.d.ts.map +0 -1
- package/dist/tools/link-workspace.js +0 -131
- package/dist/tools/link-workspace.js.map +0 -1
- package/dist/tools/lookup.d.ts +0 -19
- package/dist/tools/lookup.d.ts.map +0 -1
- package/dist/tools/lookup.js +0 -63
- package/dist/tools/lookup.js.map +0 -1
- package/dist/tools/mark-incident.d.ts +0 -28
- package/dist/tools/mark-incident.d.ts.map +0 -1
- package/dist/tools/mark-incident.js +0 -188
- package/dist/tools/mark-incident.js.map +0 -1
- package/dist/tools/merged-browser.d.ts +0 -11
- package/dist/tools/merged-browser.d.ts.map +0 -1
- package/dist/tools/merged-browser.js +0 -20
- package/dist/tools/merged-browser.js.map +0 -1
- package/dist/tools/merged-context.d.ts +0 -11
- package/dist/tools/merged-context.d.ts.map +0 -1
- package/dist/tools/merged-context.js +0 -21
- package/dist/tools/merged-context.js.map +0 -1
- package/dist/tools/merged-observe.d.ts +0 -13
- package/dist/tools/merged-observe.d.ts.map +0 -1
- package/dist/tools/merged-observe.js +0 -21
- package/dist/tools/merged-observe.js.map +0 -1
- package/dist/tools/merged-workspace.d.ts +0 -14
- package/dist/tools/merged-workspace.d.ts.map +0 -1
- package/dist/tools/merged-workspace.js +0 -21
- package/dist/tools/merged-workspace.js.map +0 -1
- package/dist/tools/observe-runtime.d.ts +0 -250
- package/dist/tools/observe-runtime.d.ts.map +0 -1
- package/dist/tools/observe-runtime.js +0 -1753
- package/dist/tools/observe-runtime.js.map +0 -1
- package/dist/tools/observe-tests.d.ts +0 -57
- package/dist/tools/observe-tests.d.ts.map +0 -1
- package/dist/tools/observe-tests.js +0 -368
- package/dist/tools/observe-tests.js.map +0 -1
- package/dist/tools/observe.d.ts +0 -28
- package/dist/tools/observe.d.ts.map +0 -1
- package/dist/tools/observe.js +0 -330
- package/dist/tools/observe.js.map +0 -1
- package/dist/tools/pr-analysis.d.ts +0 -189
- package/dist/tools/pr-analysis.d.ts.map +0 -1
- package/dist/tools/pr-analysis.js +0 -299
- package/dist/tools/pr-analysis.js.map +0 -1
- package/dist/tools/pre-push.d.ts +0 -168
- package/dist/tools/pre-push.d.ts.map +0 -1
- package/dist/tools/pre-push.js +0 -416
- package/dist/tools/pre-push.js.map +0 -1
- package/dist/tools/predict-reach.d.ts +0 -57
- package/dist/tools/predict-reach.d.ts.map +0 -1
- package/dist/tools/predict-reach.js +0 -159
- package/dist/tools/predict-reach.js.map +0 -1
- package/dist/tools/propagation.d.ts +0 -37
- package/dist/tools/propagation.d.ts.map +0 -1
- package/dist/tools/propagation.js +0 -162
- package/dist/tools/propagation.js.map +0 -1
- package/dist/tools/propose-journey.d.ts +0 -16
- package/dist/tools/propose-journey.d.ts.map +0 -1
- package/dist/tools/propose-journey.js +0 -121
- package/dist/tools/propose-journey.js.map +0 -1
- package/dist/tools/prove-reach.d.ts +0 -74
- package/dist/tools/prove-reach.d.ts.map +0 -1
- package/dist/tools/prove-reach.js +0 -286
- package/dist/tools/prove-reach.js.map +0 -1
- package/dist/tools/questions.d.ts +0 -30
- package/dist/tools/questions.d.ts.map +0 -1
- package/dist/tools/questions.js +0 -232
- package/dist/tools/questions.js.map +0 -1
- package/dist/tools/refusal-fetch.d.ts +0 -35
- package/dist/tools/refusal-fetch.d.ts.map +0 -1
- package/dist/tools/refusal-fetch.js +0 -103
- package/dist/tools/refusal-fetch.js.map +0 -1
- package/dist/tools/runtime-incident.d.ts +0 -33
- package/dist/tools/runtime-incident.d.ts.map +0 -1
- package/dist/tools/runtime-incident.js +0 -67
- package/dist/tools/runtime-incident.js.map +0 -1
- package/dist/tools/runtime-journey-drive.d.ts +0 -102
- package/dist/tools/runtime-journey-drive.d.ts.map +0 -1
- package/dist/tools/runtime-journey-drive.js +0 -247
- package/dist/tools/runtime-journey-drive.js.map +0 -1
- package/dist/tools/scope.d.ts +0 -45
- package/dist/tools/scope.d.ts.map +0 -1
- package/dist/tools/scope.js +0 -186
- package/dist/tools/scope.js.map +0 -1
- package/dist/tools/similar-incidents.d.ts +0 -43
- package/dist/tools/similar-incidents.d.ts.map +0 -1
- package/dist/tools/similar-incidents.js +0 -179
- package/dist/tools/similar-incidents.js.map +0 -1
- package/dist/tools/validate.d.ts +0 -133
- package/dist/tools/validate.d.ts.map +0 -1
- package/dist/tools/validate.js +0 -442
- package/dist/tools/validate.js.map +0 -1
- package/dist/tools/verb.d.ts +0 -46
- package/dist/tools/verb.d.ts.map +0 -1
- package/dist/tools/verb.js +0 -78
- package/dist/tools/verb.js.map +0 -1
- package/dist/tools/verification-status.d.ts +0 -38
- package/dist/tools/verification-status.d.ts.map +0 -1
- package/dist/tools/verification-status.js +0 -203
- package/dist/tools/verification-status.js.map +0 -1
- package/dist/tools/verify-claim.d.ts +0 -29
- package/dist/tools/verify-claim.d.ts.map +0 -1
- package/dist/tools/verify-claim.js +0 -220
- package/dist/tools/verify-claim.js.map +0 -1
- package/dist/tools/workspace.d.ts +0 -28
- package/dist/tools/workspace.d.ts.map +0 -1
- package/dist/tools/workspace.js +0 -101
- package/dist/tools/workspace.js.map +0 -1
- package/dist/transport.d.ts +0 -32
- package/dist/transport.d.ts.map +0 -1
- package/dist/transport.js +0 -85
- package/dist/transport.js.map +0 -1
- package/dist/workspace-index.d.ts +0 -164
- package/dist/workspace-index.d.ts.map +0 -1
- package/dist/workspace-index.js +0 -381
- package/dist/workspace-index.js.map +0 -1
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* What a browser session actually reached, and what it did not. §4.1.
|
|
3
|
-
*
|
|
4
|
-
* ## The claim this module exists to make possible
|
|
5
|
-
*
|
|
6
|
-
* *"I reached 40% of your application, and here is the 60% I could not."*
|
|
7
|
-
*
|
|
8
|
-
* Everything else here serves that sentence. The browser path already reports
|
|
9
|
-
* what it saw; what it has never reported is what it **missed**, and a testing
|
|
10
|
-
* agent that cannot say that is not merely incomplete — it is misleading,
|
|
11
|
-
* because "no failures found" and "nothing was driven" render identically.
|
|
12
|
-
* `fixtures/hostile-apps/` app 11 reproduces exactly that: a CAPTCHA screen
|
|
13
|
-
* reports two interactive elements and no failures, which is true and useless.
|
|
14
|
-
*
|
|
15
|
-
* ## Coverage is not one of the five report categories
|
|
16
|
-
*
|
|
17
|
-
* Rule 6 is explicit: untested scope is a **separate axis**, reported as
|
|
18
|
-
* verification status, not folded into confirmed/strongly-supported/
|
|
19
|
-
* unconfirmed/not-analysable/unsupported. This module is on that separate axis.
|
|
20
|
-
* So every rendering of it says, in words, that it is not a verdict — and the
|
|
21
|
-
* tests assert that it still says so at 100% reach, which is the one case where
|
|
22
|
-
* a reader is most likely to hear "all clear".
|
|
23
|
-
*
|
|
24
|
-
* ## Why counting is per screen and not per snapshot
|
|
25
|
-
*
|
|
26
|
-
* Two snapshots of one screen are not twice the coverage, and a reply that was
|
|
27
|
-
* trimmed to fit a budget is not a screen that shrank. So screens are keyed by
|
|
28
|
-
* URL and the largest observation of each wins. The alternative — summing
|
|
29
|
-
* snapshots — would let an agent inflate its own coverage by asking twice.
|
|
30
|
-
*
|
|
31
|
-
* Rule 1: nothing here names a language or a framework.
|
|
32
|
-
*/
|
|
33
|
-
import { evidenceInWindow, refineAttribution, assertEveryFailureAttributed, } from "./fault-attribution.js";
|
|
34
|
-
/** Roles the port has a verb for. Anything else is enumerated and undrivable —
|
|
35
|
-
* §1.3, and a fact about the port rather than about the page.
|
|
36
|
-
*
|
|
37
|
-
* `combobox` is here because the port grew `select`. It has to be added in the
|
|
38
|
-
* same change as the verb or the gap stays reported after it is closed, which
|
|
39
|
-
* is worse than either state on its own: a caller reading "no verb for this
|
|
40
|
-
* role" would go and build the verb that already exists. The hostile corpus's
|
|
41
|
-
* harness carries the same list and moves with this one. */
|
|
42
|
-
const ROLES_WITH_A_VERB = new Set(["button", "link", "textbox", "searchbox", "combobox"]);
|
|
43
|
-
/**
|
|
44
|
-
* The risk kinds that mean **a region with controls in it was not entered at
|
|
45
|
-
* all** — as opposed to reached with something lost on the way.
|
|
46
|
-
*
|
|
47
|
-
* The line is drawn by what a caller would do about it, not by severity. A
|
|
48
|
-
* shadow root is reached and unsaveable; a same-origin frame is entered and
|
|
49
|
-
* enumerated (`fixtures/hostile-apps/` app 05 measured both of its targets
|
|
50
|
-
* driven); a tall document is unvisited until someone asks for a reveal pass.
|
|
51
|
-
* None of those is a region nobody got into, so none of them is a gate.
|
|
52
|
-
*
|
|
53
|
-
* What is: a challenge and a sign-in, which put the whole application on the
|
|
54
|
-
* far side; a cross-origin frame, which this session's consent does not cover;
|
|
55
|
-
* an overlay or an inert subtree, under which every control is enumerable,
|
|
56
|
-
* counted and impossible to operate; a canvas, whose controls have no elements
|
|
57
|
-
* to enumerate at all; and a windowed region, which no single snapshot can ever
|
|
58
|
-
* hold all of.
|
|
59
|
-
*
|
|
60
|
-
* Promoting them here rather than at each call site is deliberate: a disclosure
|
|
61
|
-
* that depends on a caller remembering to file it is a disclosure that goes
|
|
62
|
-
* missing on the path nobody tested.
|
|
63
|
-
*/
|
|
64
|
-
const GATING_RISKS = new Set([
|
|
65
|
-
"challenge",
|
|
66
|
-
"authWall",
|
|
67
|
-
"crossOriginFrame",
|
|
68
|
-
"overlay",
|
|
69
|
-
"inertSubtree",
|
|
70
|
-
"canvasRendered",
|
|
71
|
-
"virtualizedRegion",
|
|
72
|
-
]);
|
|
73
|
-
export function createReachabilityTracker() {
|
|
74
|
-
const screens = new Map();
|
|
75
|
-
const actions = [];
|
|
76
|
-
const gates = [];
|
|
77
|
-
const skipped = [];
|
|
78
|
-
let estimate = null;
|
|
79
|
-
return {
|
|
80
|
-
recordScreen(snapshot) {
|
|
81
|
-
let actionable = 0;
|
|
82
|
-
let savable = 0;
|
|
83
|
-
let noVerb = 0;
|
|
84
|
-
for (const el of snapshot.elements) {
|
|
85
|
-
if (ROLES_WITH_A_VERB.has(el.role.trim().toLowerCase()))
|
|
86
|
-
actionable += 1;
|
|
87
|
-
else
|
|
88
|
-
noVerb += 1;
|
|
89
|
-
if (el.selector !== null)
|
|
90
|
-
savable += 1;
|
|
91
|
-
}
|
|
92
|
-
// `totalElements`, never `elements.length`: a budget-trimmed reply is a
|
|
93
|
-
// shorter list, not a smaller page, and coverage measured off the list
|
|
94
|
-
// would improve every time a reply got tighter.
|
|
95
|
-
const unlisted = Math.max(0, snapshot.totalElements - snapshot.elements.length);
|
|
96
|
-
const next = {
|
|
97
|
-
seen: snapshot.totalElements,
|
|
98
|
-
actionable,
|
|
99
|
-
savable,
|
|
100
|
-
// Elements that did not fit in the reply were never classified. They
|
|
101
|
-
// are counted as seen and as having no known verb, because claiming
|
|
102
|
-
// them as actionable would be claiming something nothing looked at.
|
|
103
|
-
noVerb: noVerb + unlisted,
|
|
104
|
-
};
|
|
105
|
-
const existing = screens.get(snapshot.url);
|
|
106
|
-
if (existing === undefined || next.seen > existing.seen)
|
|
107
|
-
screens.set(snapshot.url, next);
|
|
108
|
-
},
|
|
109
|
-
recordEstimate(next) {
|
|
110
|
-
estimate = next;
|
|
111
|
-
},
|
|
112
|
-
recordAction(action) {
|
|
113
|
-
actions.push(action);
|
|
114
|
-
},
|
|
115
|
-
recordGate(gate) {
|
|
116
|
-
if (gate.reason.trim() === "") {
|
|
117
|
-
throw new Error("A gated region must carry a reason. A region recorded as unreachable with no reason is the silence " +
|
|
118
|
-
"reachability reporting exists to remove.");
|
|
119
|
-
}
|
|
120
|
-
gates.push(gate);
|
|
121
|
-
},
|
|
122
|
-
recordSkip(item) {
|
|
123
|
-
skipped.push(item);
|
|
124
|
-
},
|
|
125
|
-
refineFailures(drained, applicationOrigin) {
|
|
126
|
-
for (let index = 0; index < actions.length; index += 1) {
|
|
127
|
-
const action = actions[index];
|
|
128
|
-
if (action.succeeded)
|
|
129
|
-
continue;
|
|
130
|
-
// Only `undetermined` is open to revision — see `refineAttribution`.
|
|
131
|
-
// Checked here as well as there so a failure that already has a domain
|
|
132
|
-
// costs nothing to walk past on every later drain.
|
|
133
|
-
if (action.attribution.owner !== "undetermined")
|
|
134
|
-
continue;
|
|
135
|
-
if (action.failure === undefined || action.window === undefined)
|
|
136
|
-
continue;
|
|
137
|
-
const later = evidenceInWindow(drained, action.window, applicationOrigin);
|
|
138
|
-
if (later.pageErrors === 0 && later.failedRequests === 0)
|
|
139
|
-
continue;
|
|
140
|
-
actions[index] = { ...action, attribution: refineAttribution(action.attribution, action.failure, later) };
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
report() {
|
|
144
|
-
const perScreen = [...screens.entries()].map(([url, acc]) => ({
|
|
145
|
-
url,
|
|
146
|
-
elementsSeen: acc.seen,
|
|
147
|
-
elementsActionable: acc.actionable,
|
|
148
|
-
elementsSavable: acc.savable,
|
|
149
|
-
}));
|
|
150
|
-
const elementsSeen = perScreen.reduce((sum, s) => sum + s.elementsSeen, 0);
|
|
151
|
-
const elementsActionable = perScreen.reduce((sum, s) => sum + s.elementsActionable, 0);
|
|
152
|
-
const elementsSavable = perScreen.reduce((sum, s) => sum + s.elementsSavable, 0);
|
|
153
|
-
const noVerb = [...screens.values()].reduce((sum, s) => sum + s.noVerb, 0);
|
|
154
|
-
const blocked = noVerb === 0
|
|
155
|
-
? []
|
|
156
|
-
: [
|
|
157
|
-
{
|
|
158
|
-
reason: "noVerbForRole",
|
|
159
|
-
count: noVerb,
|
|
160
|
-
detail: "Enumerated on the page, but Descry has no verb for their role, so they were listed and never " +
|
|
161
|
-
"operated. This is a gap in Descry's browser port, not something wrong with the page.",
|
|
162
|
-
},
|
|
163
|
-
];
|
|
164
|
-
// A risk named before the run that nothing later contradicted is still a
|
|
165
|
-
// region nobody reached. Promoting it to a gate here means the disclosure
|
|
166
|
-
// does not depend on some caller remembering to file it.
|
|
167
|
-
const gatedFromEstimate = estimate === null
|
|
168
|
-
? []
|
|
169
|
-
: estimate.risks
|
|
170
|
-
.filter((risk) => GATING_RISKS.has(risk.kind))
|
|
171
|
-
.map((risk) => ({ region: risk.detail, reason: risk.effect, kind: risk.kind }));
|
|
172
|
-
const gated = [...gatedFromEstimate, ...gates];
|
|
173
|
-
// RG-12(c): every failed action in `actions` is, by the type above,
|
|
174
|
-
// already carrying a real attribution — nothing to filter, nothing
|
|
175
|
-
// that can silently fall out of the report unseen. Asserted, not just
|
|
176
|
-
// typed: a cast or a future widening of the type could still produce
|
|
177
|
-
// one from outside this module, and this is the belt for that.
|
|
178
|
-
assertEveryFailureAttributed(actions);
|
|
179
|
-
const failures = actions
|
|
180
|
-
.filter((a) => !a.succeeded)
|
|
181
|
-
.map((a) => ({ verb: a.verb, ref: a.ref, attribution: a.attribution }));
|
|
182
|
-
const wall = wallFor(estimate, perScreen.length);
|
|
183
|
-
return {
|
|
184
|
-
screens: perScreen,
|
|
185
|
-
elementsSeen,
|
|
186
|
-
elementsActionable,
|
|
187
|
-
elementsSavable,
|
|
188
|
-
blocked,
|
|
189
|
-
actionsAttempted: actions.length,
|
|
190
|
-
actionsSucceeded: actions.filter((a) => a.succeeded).length,
|
|
191
|
-
failures,
|
|
192
|
-
gated,
|
|
193
|
-
skipped,
|
|
194
|
-
estimate,
|
|
195
|
-
wall,
|
|
196
|
-
statement: statementFor(wall, perScreen.length, elementsSeen, elementsActionable, gated.length, skipped.length),
|
|
197
|
-
};
|
|
198
|
-
},
|
|
199
|
-
};
|
|
200
|
-
}
|
|
201
|
-
/**
|
|
202
|
-
* Is the session behind a wall, and which one?
|
|
203
|
-
*
|
|
204
|
-
* A challenge is unconditional. Descry does not pass one, so however many
|
|
205
|
-
* screens a session went on to see, it did not legitimately get past that.
|
|
206
|
-
*
|
|
207
|
-
* A sign-in is conditional on the session having stayed on one screen. The
|
|
208
|
-
* evidence for the wall is a password field on the probed screen, and a session
|
|
209
|
-
* that went on to read a second screen demonstrably moved — claiming it never
|
|
210
|
-
* got in would be a false statement made from a true observation, which is the
|
|
211
|
-
* precise failure rule 2 exists to prevent. It keeps its gated region either
|
|
212
|
-
* way.
|
|
213
|
-
*
|
|
214
|
-
* An overlay is deliberately **not** a wall. The application underneath one is
|
|
215
|
-
* present and enumerated, and one dismissal reaches it; "this session did not
|
|
216
|
-
* reach the application" would overstate what a fixed banner proves. The gated
|
|
217
|
-
* region carries it instead.
|
|
218
|
-
*/
|
|
219
|
-
function wallFor(estimate, screens) {
|
|
220
|
-
if (estimate === null)
|
|
221
|
-
return null;
|
|
222
|
-
const challenge = estimate.risks.find((risk) => risk.kind === "challenge");
|
|
223
|
-
if (challenge !== undefined) {
|
|
224
|
-
return {
|
|
225
|
-
kind: "challenge",
|
|
226
|
-
detail: challenge.detail,
|
|
227
|
-
reason: "Descry does not attempt to pass a human-verification challenge, by design. Everything behind it is not " +
|
|
228
|
-
"analysable, which is a different statement from finding nothing wrong with it.",
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
const auth = estimate.risks.find((risk) => risk.kind === "authWall");
|
|
232
|
-
if (auth !== undefined && screens <= 1) {
|
|
233
|
-
return {
|
|
234
|
-
kind: "authWall",
|
|
235
|
-
detail: auth.detail,
|
|
236
|
-
reason: "The only screen this session saw is the logged-out surface. Nothing behind the sign-in was seen, so " +
|
|
237
|
-
"nothing behind it was tested. Seed an authenticated session — browser_start_session takes a " +
|
|
238
|
-
"storageState or a storageStatePath — to drive the application itself.",
|
|
239
|
-
};
|
|
240
|
-
}
|
|
241
|
-
return null;
|
|
242
|
-
}
|
|
243
|
-
/** The wall's own sentence. Written out per kind rather than assembled, because
|
|
244
|
-
* this is the one sentence in the reply that must not read as boilerplate. */
|
|
245
|
-
function wallStatement(wall, seen, screenNoun) {
|
|
246
|
-
const counted = seen === 0
|
|
247
|
-
? ""
|
|
248
|
-
: ` The ${seen} interactive element${seen === 1 ? "" : "s"} counted below are the ${screenNoun}'s own, not the application's.`;
|
|
249
|
-
return `This session did not reach the application: ${wall.reason}${counted}`;
|
|
250
|
-
}
|
|
251
|
-
function statementFor(wall, screens, seen, actionable, gates, skips) {
|
|
252
|
-
if (wall !== null) {
|
|
253
|
-
return wallStatement(wall, seen, wall.kind === "challenge" ? "challenge screen" : "sign-in screen");
|
|
254
|
-
}
|
|
255
|
-
if (screens === 0) {
|
|
256
|
-
return ("This session read no screen, so it reached none of the application. That is a statement about coverage " +
|
|
257
|
-
"and not about the application.");
|
|
258
|
-
}
|
|
259
|
-
const plural = (n, word) => `${n} ${word}${n === 1 ? "" : "s"}`;
|
|
260
|
-
const tail = [];
|
|
261
|
-
if (gates > 0)
|
|
262
|
-
tail.push(`${plural(gates, "region")} could not be entered at all`);
|
|
263
|
-
if (skips > 0)
|
|
264
|
-
tail.push(`${plural(skips, "thing")} was deliberately skipped`);
|
|
265
|
-
const suffix = tail.length === 0 ? "" : `, and ${tail.join(", ")}`;
|
|
266
|
-
return `Reached ${actionable} of ${seen} interactive elements across ${plural(screens, "screen")}${suffix}.`;
|
|
267
|
-
}
|
|
268
|
-
/** The disclosure lines. Every one of them is on the coverage axis, and the
|
|
269
|
-
* last one says so explicitly at every level of reach — including total. */
|
|
270
|
-
export function reachabilityNotes(report) {
|
|
271
|
-
const notes = [report.statement];
|
|
272
|
-
for (const blocked of report.blocked) {
|
|
273
|
-
notes.push(`${blocked.count} element${blocked.count === 1 ? " was" : "s were"} seen but not usable. ${blocked.detail}`);
|
|
274
|
-
}
|
|
275
|
-
const unsavable = report.elementsSeen - report.elementsSavable;
|
|
276
|
-
if (unsavable > 0) {
|
|
277
|
-
notes.push(`${unsavable} of the ${report.elementsSeen} elements seen have no stable selector. They can be driven in this ` +
|
|
278
|
-
"session and can never be saved to a scenario, so a flow through them cannot be replayed.");
|
|
279
|
-
}
|
|
280
|
-
for (const gate of report.gated) {
|
|
281
|
-
notes.push(`Not reached — ${gate.region}: ${gate.reason}`);
|
|
282
|
-
}
|
|
283
|
-
for (const skip of report.skipped) {
|
|
284
|
-
notes.push(`Skipped — ${skip.what}: ${skip.why}`);
|
|
285
|
-
}
|
|
286
|
-
for (const failure of report.failures) {
|
|
287
|
-
notes.push(`A ${failure.verb} failed${failure.ref === null ? "" : ` on ${failure.ref}`}. Fault: ${failure.attribution.owner}. ` +
|
|
288
|
-
`${failure.attribution.reason} ${failure.attribution.evidence}`);
|
|
289
|
-
}
|
|
290
|
-
notes.push("Reachability is coverage, not a verdict — it is a separate axis from the five report categories. Nothing here " +
|
|
291
|
-
"says the parts that were reached are correct, and nothing here says the parts that were not are broken.");
|
|
292
|
-
return notes;
|
|
293
|
-
}
|
|
294
|
-
//# sourceMappingURL=reachability.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reachability.js","sourceRoot":"","sources":["../../src/browser/reachability.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAGH,OAAO,EACL,gBAAgB,EAChB,iBAAiB,EACjB,4BAA4B,GAI7B,MAAM,wBAAwB,CAAC;AAGhC;;;;;;;6DAO6D;AAC7D,MAAM,iBAAiB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC,CAAC;AAE1F;;;;;;;;;;;;;;;;;;;;G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AC;IACD,KAAK,MAAM,OAAO,IAAI,MAAM,CAAC,QAAQ,EAAE,CAAC;QACtC,KAAK,CAAC,IAAI,CACR,KAAK,OAAO,CAAC,IAAI,UAAU,OAAO,CAAC,GAAG,KAAK,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,OAAO,CAAC,GAAG,EAAE,YAAY,OAAO,CAAC,WAAW,CAAC,KAAK,IAAI;YAClH,GAAG,OAAO,CAAC,WAAW,CAAC,MAAM,IAAI,OAAO,CAAC,WAAW,CAAC,QAAQ,EAAE,CAClE,CAAC;IACJ,CAAC;IAED,KAAK,CAAC,IAAI,CACR,gHAAgH;QAC9G,yGAAyG,CAC5G,CAAC;IACF,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
/** Live browser sessions belonging to one connection — `mcp-browser-tools.md` §4. Four
|
|
2
|
-
* teardown paths (idle timeout, disconnect, crash, close) converge on one `reap` so a
|
|
3
|
-
* session never stops being tracked without its browser closing and evidence being
|
|
4
|
-
* flushed (kept, never dropped — rule 7). Per-connection, never global — a global
|
|
5
|
-
* registry would let one client guess another's browser by session id. */
|
|
6
|
-
import type { BrowserDriver, BrowserLaunchOptions, BrowserObservation, BrowserPageSession, ChromiumRefusal } from "./driver.ts";
|
|
7
|
-
import type { ReachabilityReport, ReachabilityTracker } from "./reachability.ts";
|
|
8
|
-
/** How long a session may go untouched before torn down. Starting value, not a
|
|
9
|
-
* measurement — 5 min balances agent-thinking time against leak size; matches the
|
|
10
|
-
* action handshake's token TTL deliberately. */
|
|
11
|
-
export declare const BROWSER_IDLE_TIMEOUT_MS: number;
|
|
12
|
-
/** Max sessions per connection. Small on purpose — each is a real Chromium process;
|
|
13
|
-
* 3 leaves room for comparing two states plus one opening, without a loop with a
|
|
14
|
-
* missing `browser_close_session` filling the machine. */
|
|
15
|
-
export declare const MAX_BROWSER_SESSIONS = 3;
|
|
16
|
-
export type ReapReason = "idleTimeout" | "clientDisconnect" | "crashed" | "closed";
|
|
17
|
-
/** DEC-270's vocabulary. Reuses `observe_runtime`'s environment-profile field rather
|
|
18
|
-
* than a browser-only notion of "safe" (item 27: two definitions could disagree).
|
|
19
|
-
* Null means no profile — session consent alone governs. */
|
|
20
|
-
export type BrowserSafetyLevel = "readOnly" | "write" | "destructiveWithApproval";
|
|
21
|
-
export interface BrowserSessionEntry {
|
|
22
|
-
readonly sessionId: string;
|
|
23
|
-
/** Run id every R4 edge this session witnesses is stamped with. One per session, not
|
|
24
|
-
* per call — a run changing identity between a click and the request it caused would
|
|
25
|
-
* make `observedByRun` meaningless. */
|
|
26
|
-
readonly runId: string;
|
|
27
|
-
readonly page: BrowserPageSession;
|
|
28
|
-
/** The profile this session was opened under, or null when none was declared. */
|
|
29
|
-
readonly profile: {
|
|
30
|
-
readonly name: string;
|
|
31
|
-
readonly safetyLevel: BrowserSafetyLevel;
|
|
32
|
-
} | null;
|
|
33
|
-
/** Origin `browser_start_session` was consented for, recorded at open time — a page
|
|
34
|
-
* that navigated since would let re-deriving it launder a cross-origin move into an
|
|
35
|
-
* approved one. */
|
|
36
|
-
readonly consentedOrigin: string;
|
|
37
|
-
readonly openedAt: number;
|
|
38
|
-
readonly lastUsedAt: number;
|
|
39
|
-
/** What this session has reached so far. Accumulated by the port wrapper, not
|
|
40
|
-
* by the tools — see `reach-recording-session.ts` for why that is not a
|
|
41
|
-
* convenience. */
|
|
42
|
-
readonly reach: ReachabilityTracker;
|
|
43
|
-
}
|
|
44
|
-
export interface ReapedSession {
|
|
45
|
-
readonly sessionId: string;
|
|
46
|
-
readonly reason: ReapReason;
|
|
47
|
-
readonly observation: BrowserObservation;
|
|
48
|
-
readonly at: number;
|
|
49
|
-
/**
|
|
50
|
-
* Why this session's `saveStorageStateTo` write did not happen, or null —
|
|
51
|
-
* B1.
|
|
52
|
-
*
|
|
53
|
-
* Recorded on the reap record for the same reason the final observation is:
|
|
54
|
-
* three of the four teardown paths have no reply to attach it to, and a
|
|
55
|
-
* caller who asked for a state and silently got none would only find out on
|
|
56
|
-
* the next run, when a session seeded from an absent file quietly drove the
|
|
57
|
-
* logged-out surface.
|
|
58
|
-
*/
|
|
59
|
-
readonly storageStateSaveFailure: string | null;
|
|
60
|
-
/** The session's final reachability report, taken at teardown.
|
|
61
|
-
*
|
|
62
|
-
* It rides on the reap record for the same reason `observation` does: all
|
|
63
|
-
* four teardown paths converge here, and a report that only `close()`
|
|
64
|
-
* produced would be missing from the three ways a session ends that nobody
|
|
65
|
-
* asked for. A session reaped on an idle timeout still has to be able to say
|
|
66
|
-
* what it reached. */
|
|
67
|
-
readonly reachability: ReachabilityReport;
|
|
68
|
-
}
|
|
69
|
-
export type OpenResult = {
|
|
70
|
-
readonly opened: true;
|
|
71
|
-
readonly entry: BrowserSessionEntry;
|
|
72
|
-
} | {
|
|
73
|
-
readonly opened: false;
|
|
74
|
-
readonly kind: "atCapacity";
|
|
75
|
-
readonly reason: string;
|
|
76
|
-
} | ({
|
|
77
|
-
readonly opened: false;
|
|
78
|
-
readonly kind: "chromiumNotInstalled";
|
|
79
|
-
} & ChromiumRefusal);
|
|
80
|
-
export type UseResult = {
|
|
81
|
-
readonly ok: true;
|
|
82
|
-
readonly entry: BrowserSessionEntry;
|
|
83
|
-
} | {
|
|
84
|
-
readonly ok: false;
|
|
85
|
-
readonly kind: "unknown";
|
|
86
|
-
readonly reason: string;
|
|
87
|
-
} | {
|
|
88
|
-
readonly ok: false;
|
|
89
|
-
readonly kind: "crashed" | "reaped";
|
|
90
|
-
readonly reason: string;
|
|
91
|
-
readonly reaped: ReapedSession;
|
|
92
|
-
};
|
|
93
|
-
export interface BrowserOpenOptions extends BrowserLaunchOptions {
|
|
94
|
-
/** The environment profile this session runs under. Read, never invented — see `BrowserSafetyLevel`. */
|
|
95
|
-
readonly profile?: {
|
|
96
|
-
readonly name: string;
|
|
97
|
-
readonly safetyLevel: BrowserSafetyLevel;
|
|
98
|
-
} | null;
|
|
99
|
-
}
|
|
100
|
-
export interface BrowserSessionRegistryOptions {
|
|
101
|
-
readonly now?: () => number;
|
|
102
|
-
readonly maxSessions?: number;
|
|
103
|
-
readonly idleTimeoutMs?: number;
|
|
104
|
-
/** Runs the background idle sweep. True in production — an idle session needs a
|
|
105
|
-
* timer since it will never trigger a lazy sweep on its own; timer is `unref`'d.
|
|
106
|
-
* False in tests, which drive `sweepIdle()` against an injected clock. */
|
|
107
|
-
readonly startSweeper?: boolean;
|
|
108
|
-
}
|
|
109
|
-
export interface BrowserSessionRegistry {
|
|
110
|
-
readonly idleTimeoutMs: number;
|
|
111
|
-
readonly maxSessions: number;
|
|
112
|
-
open(driver: BrowserDriver, options: BrowserOpenOptions): Promise<OpenResult>;
|
|
113
|
-
/** Looks up a session, touching its idle clock; detects a crash before returning.
|
|
114
|
-
* Async because the crash path is a teardown, not a lookup — a sync version would
|
|
115
|
-
* drop the dead page's evidence or (as the first draft did) flush it too late. */
|
|
116
|
-
use(sessionId: string): Promise<UseResult>;
|
|
117
|
-
close(sessionId: string): Promise<BrowserObservation>;
|
|
118
|
-
sweepIdle(): Promise<readonly ReapedSession[]>;
|
|
119
|
-
reapAll(reason: ReapReason): Promise<readonly ReapedSession[]>;
|
|
120
|
-
reaped(sessionId: string): ReapedSession | undefined;
|
|
121
|
-
openCount(): number;
|
|
122
|
-
/** Stop the background sweeper. Called when the connection's `Session` is disposed. */
|
|
123
|
-
stop(): void;
|
|
124
|
-
}
|
|
125
|
-
export declare function createBrowserSessionRegistry(options?: BrowserSessionRegistryOptions): BrowserSessionRegistry;
|
|
126
|
-
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../../src/browser/registry.ts"],"names":[],"mappings":"AAAA;;;;2EAI2E;AAE3E,OAAO,KAAK,EACV,aAAa,EACb,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,eAAe,EAChB,MAAM,aAAa,CAAC;AAGr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AE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC;;+EAE2E;IAC3E,QAAQ,CAAC,YAAY,CAAC,EAAE,OAAO,CAAC;CACjC;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,kBAAkB,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;IAC9E;;uFAEmF;IACnF,GAAG,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC;IAC3C,KAAK,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IACtD,SAAS,IAAI,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IAC/C,OAAO,CAAC,MAAM,EAAE,UAAU,GAAG,OAAO,CAAC,SAAS,aAAa,EAAE,CAAC,CAAC;IAC/D,MAAM,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,GAAG,SAAS,CAAC;IACrD,SAAS,IAAI,MAAM,CAAC;IACpB,uFAAuF;IACvF,IAAI,IAAI,IAAI,CAAC;CACd;AAsBD,wBAAgB,4BAA4B,CAAC,OAAO,GAAE,6BAAkC,GAAG,sBAAsB,CAqIhH"}
|
package/dist/browser/registry.js
DELETED
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
/** Live browser sessions belonging to one connection — `mcp-browser-tools.md` §4. Four
|
|
2
|
-
* teardown paths (idle timeout, disconnect, crash, close) converge on one `reap` so a
|
|
3
|
-
* session never stops being tracked without its browser closing and evidence being
|
|
4
|
-
* flushed (kept, never dropped — rule 7). Per-connection, never global — a global
|
|
5
|
-
* registry would let one client guess another's browser by session id. */
|
|
6
|
-
import { EMPTY_OBSERVATION } from "./driver.js";
|
|
7
|
-
import { withReachRecording } from "./reach-recording-session.js";
|
|
8
|
-
/** How long a session may go untouched before torn down. Starting value, not a
|
|
9
|
-
* measurement — 5 min balances agent-thinking time against leak size; matches the
|
|
10
|
-
* action handshake's token TTL deliberately. */
|
|
11
|
-
export const BROWSER_IDLE_TIMEOUT_MS = 5 * 60 * 1000;
|
|
12
|
-
/** Max sessions per connection. Small on purpose — each is a real Chromium process;
|
|
13
|
-
* 3 leaves room for comparing two states plus one opening, without a loop with a
|
|
14
|
-
* missing `browser_close_session` filling the machine. */
|
|
15
|
-
export const MAX_BROWSER_SESSIONS = 3;
|
|
16
|
-
const SWEEP_INTERVAL_MS = 30_000;
|
|
17
|
-
function originOf(url) {
|
|
18
|
-
try {
|
|
19
|
-
return new URL(url).origin;
|
|
20
|
-
}
|
|
21
|
-
catch {
|
|
22
|
-
// Unparseable target already refused at the schema; return the raw string so
|
|
23
|
-
// consent comparison stays total instead of throwing from a bookkeeping call.
|
|
24
|
-
return url;
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
export function createBrowserSessionRegistry(options = {}) {
|
|
28
|
-
const now = options.now ?? Date.now;
|
|
29
|
-
const maxSessions = options.maxSessions ?? MAX_BROWSER_SESSIONS;
|
|
30
|
-
const idleTimeoutMs = options.idleTimeoutMs ?? BROWSER_IDLE_TIMEOUT_MS;
|
|
31
|
-
const live = new Map();
|
|
32
|
-
const reapedSessions = new Map();
|
|
33
|
-
/** The one teardown; every path routes through here so "closed" and "evidence kept"
|
|
34
|
-
* cannot come apart. `close()` on the port is idempotent, so even a crashed session
|
|
35
|
-
* yields its last buffered evidence. */
|
|
36
|
-
async function reap(sessionId, session, reason) {
|
|
37
|
-
live.delete(sessionId);
|
|
38
|
-
let observation = EMPTY_OBSERVATION;
|
|
39
|
-
try {
|
|
40
|
-
observation = await session.page.close();
|
|
41
|
-
}
|
|
42
|
-
catch {
|
|
43
|
-
// Teardown that throws must not leave the session tracked or lose the record —
|
|
44
|
-
// the browser may be gone already; this id is now unusable and says why.
|
|
45
|
-
}
|
|
46
|
-
// Read after `close()`, which is when the driver performs the write.
|
|
47
|
-
const storageStateSaveFailure = session.page.storageStateSaveFailure?.() ?? null;
|
|
48
|
-
// C3. The tail no tool call ever sees: everything produced after the last
|
|
49
|
-
// drain arrives in this final observation, and three of the four teardown
|
|
50
|
-
// paths have no reply to attach it to. A failure that the page explained
|
|
51
|
-
// only in its last moments would otherwise stay `undetermined` in the one
|
|
52
|
-
// report that gets read — `reachability` below is taken immediately after.
|
|
53
|
-
session.reach.refineFailures(observation, session.consentedOrigin);
|
|
54
|
-
const record = {
|
|
55
|
-
sessionId,
|
|
56
|
-
reason,
|
|
57
|
-
observation,
|
|
58
|
-
at: now(),
|
|
59
|
-
storageStateSaveFailure,
|
|
60
|
-
reachability: session.reach.report(),
|
|
61
|
-
};
|
|
62
|
-
reapedSessions.set(sessionId, record);
|
|
63
|
-
return record;
|
|
64
|
-
}
|
|
65
|
-
const sweeper = options.startSweeper === false ? null : setInterval(() => void sweepIdle(), SWEEP_INTERVAL_MS);
|
|
66
|
-
sweeper?.unref();
|
|
67
|
-
async function sweepIdle() {
|
|
68
|
-
const deadline = now() - idleTimeoutMs;
|
|
69
|
-
const expired = [...live.entries()].filter(([, session]) => session.lastUsedAt < deadline);
|
|
70
|
-
return Promise.all(expired.map(([sessionId, session]) => reap(sessionId, session, "idleTimeout")));
|
|
71
|
-
}
|
|
72
|
-
return {
|
|
73
|
-
idleTimeoutMs,
|
|
74
|
-
maxSessions,
|
|
75
|
-
async open(driver, launchOptions) {
|
|
76
|
-
if (live.size >= maxSessions) {
|
|
77
|
-
return {
|
|
78
|
-
opened: false,
|
|
79
|
-
kind: "atCapacity",
|
|
80
|
-
// Both numbers so the caller knows whether to close one or stop opening in a loop.
|
|
81
|
-
reason: `This connection already has ${live.size} of ${maxSessions} browser sessions open. Close one with ` +
|
|
82
|
-
"browser_close_session before starting another. The cap is per connection and exists because each " +
|
|
83
|
-
"session is a real browser process.",
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
const launch = await driver.launch(launchOptions);
|
|
87
|
-
if (!launch.launched) {
|
|
88
|
-
const { launched: _launched, ...refusal } = launch;
|
|
89
|
-
return { opened: false, kind: "chromiumNotInstalled", ...refusal };
|
|
90
|
-
}
|
|
91
|
-
const at = now();
|
|
92
|
-
const recorded = withReachRecording(launch.session);
|
|
93
|
-
const session = {
|
|
94
|
-
runId: `browser-${launch.session.sessionId}`,
|
|
95
|
-
page: recorded.page,
|
|
96
|
-
reach: recorded.reach,
|
|
97
|
-
profile: launchOptions.profile ?? null,
|
|
98
|
-
consentedOrigin: originOf(launchOptions.targetUrl),
|
|
99
|
-
openedAt: at,
|
|
100
|
-
lastUsedAt: at,
|
|
101
|
-
};
|
|
102
|
-
live.set(launch.session.sessionId, session);
|
|
103
|
-
return { opened: true, entry: entryOf(launch.session.sessionId, session) };
|
|
104
|
-
},
|
|
105
|
-
async use(sessionId) {
|
|
106
|
-
const session = live.get(sessionId);
|
|
107
|
-
if (session === undefined) {
|
|
108
|
-
const record = reapedSessions.get(sessionId);
|
|
109
|
-
if (record !== undefined) {
|
|
110
|
-
return { ok: false, kind: "reaped", reason: reasonFor(record), reaped: record };
|
|
111
|
-
}
|
|
112
|
-
return {
|
|
113
|
-
ok: false,
|
|
114
|
-
kind: "unknown",
|
|
115
|
-
reason: `No browser session "${sessionId}" on this connection. Sessions are per connection and do not ` +
|
|
116
|
-
"survive a reconnect; start one with browser_start_session.",
|
|
117
|
-
};
|
|
118
|
-
}
|
|
119
|
-
if (!session.page.isUsable()) {
|
|
120
|
-
// Same teardown as every other path, so the crash case can't skip the flush.
|
|
121
|
-
const record = await reap(sessionId, session, "crashed");
|
|
122
|
-
return { ok: false, kind: "crashed", reason: crashReason(sessionId), reaped: record };
|
|
123
|
-
}
|
|
124
|
-
session.lastUsedAt = now();
|
|
125
|
-
return { ok: true, entry: entryOf(sessionId, session) };
|
|
126
|
-
},
|
|
127
|
-
async close(sessionId) {
|
|
128
|
-
const session = live.get(sessionId);
|
|
129
|
-
if (session === undefined)
|
|
130
|
-
return reapedSessions.get(sessionId)?.observation ?? EMPTY_OBSERVATION;
|
|
131
|
-
const record = await reap(sessionId, session, "closed");
|
|
132
|
-
return record.observation;
|
|
133
|
-
},
|
|
134
|
-
sweepIdle,
|
|
135
|
-
async reapAll(reason) {
|
|
136
|
-
const all = [...live.entries()];
|
|
137
|
-
return Promise.all(all.map(([sessionId, session]) => reap(sessionId, session, reason)));
|
|
138
|
-
},
|
|
139
|
-
reaped: (sessionId) => reapedSessions.get(sessionId),
|
|
140
|
-
openCount: () => live.size,
|
|
141
|
-
stop() {
|
|
142
|
-
if (sweeper !== null)
|
|
143
|
-
clearInterval(sweeper);
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function entryOf(sessionId, session) {
|
|
148
|
-
return {
|
|
149
|
-
sessionId,
|
|
150
|
-
runId: session.runId,
|
|
151
|
-
page: session.page,
|
|
152
|
-
reach: session.reach,
|
|
153
|
-
profile: session.profile,
|
|
154
|
-
consentedOrigin: session.consentedOrigin,
|
|
155
|
-
openedAt: session.openedAt,
|
|
156
|
-
lastUsedAt: session.lastUsedAt,
|
|
157
|
-
};
|
|
158
|
-
}
|
|
159
|
-
function crashReason(sessionId) {
|
|
160
|
-
return (`Browser session ${sessionId} crashed or its page closed. The session id is invalidated rather than ` +
|
|
161
|
-
"reopened against a different browser, which would silently change what later evidence refers to. " +
|
|
162
|
-
"Anything the page reported before it died is included here.");
|
|
163
|
-
}
|
|
164
|
-
function reasonFor(record) {
|
|
165
|
-
switch (record.reason) {
|
|
166
|
-
case "idleTimeout":
|
|
167
|
-
return (`Browser session ${record.sessionId} was torn down after being idle. Its evidence was kept and is ` +
|
|
168
|
-
"included here. Start a new session to continue.");
|
|
169
|
-
case "clientDisconnect":
|
|
170
|
-
return `Browser session ${record.sessionId} was reaped when the client disconnected.`;
|
|
171
|
-
case "crashed":
|
|
172
|
-
return crashReason(record.sessionId);
|
|
173
|
-
case "closed":
|
|
174
|
-
return `Browser session ${record.sessionId} was closed by browser_close_session.`;
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
//# sourceMappingURL=registry.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../../src/browser/registry.ts"],"names":[],"mappings":"AAAA;;;;2EAI2E;AAS3E,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAChD,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAGlE;;iDAEiD;AACjD,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAErD;;2DAE2D;AAC3D,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,CAAC;AAEtC,MAAM,iBAAiB,GAAG,MAAM,CAAC;AA6GjC,SAAS,QAAQ,CAAC,GAAW;IAC3B,IAAI,CAAC;QACH,OAAO,IAAI,GAAG,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC;IAC7B,CAAC;IAAC,MAAM,CAAC;QACP,6EAA6E;QAC7E,8EAA8E;QAC9E,OAAO,GAAG,CAAC;IACb,CAAC;AACH,CAAC;AAED,MAAM,UAAU,4BAA4B,CAAC,UAAyC,EAAE;IACtF,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC;IACpC,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,oBAAoB,CAAC;IAChE,MAAM,aAAa,GAAG,OAAO,CAAC,aAAa,IAAI,uBAAuB,CAAC;IAEvE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAuB,CAAC;IAC5C,MAAM,cAAc,GAAG,IAAI,GAAG,EAAyB,CAAC;IAExD;;6CAEyC;IACzC,KAAK,UAAU,IAAI,CAAC,SAAiB,EAAE,OAAoB,EAAE,MAAkB;QAC7E,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACvB,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,UAAU,EAAE,OAAO,CAAC,UAAU;KAC/B,CAAC;AACJ,CAAC;AAED,SAAS,WAAW,CAAC,SAAiB;IACpC,OAAO,CACL,mBAAmB,SAAS,yEAAyE;QACrG,mGAAmG;QACnG,6DAA6D,CAC9D,CAAC;AACJ,CAAC;AAED,SAAS,SAAS,CAAC,MAAqB;IACtC,QAAQ,MAAM,CAAC,MAAM,EAAE,CAAC;QACtB,KAAK,aAAa;YAChB,OAAO,CACL,mBAAmB,MAAM,CAAC,SAAS,gEAAgE;gBACnG,iDAAiD,CAClD,CAAC;QACJ,KAAK,kBAAkB;YACrB,OAAO,mBAAmB,MAAM,CAAC,SAAS,2CAA2C,CAAC;QACxF,KAAK,SAAS;YACZ,OAAO,WAAW,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QACvC,KAAK,QAAQ;YACX,OAAO,mBAAmB,MAAM,CAAC,SAAS,uCAAuC,CAAC;IACtF,CAAC;AACH,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/** Provenance matching for `browser_save_scenario` — DEC-NEXT (Part 13 of the UAT audit). A step
|
|
2
|
-
* the session actually performed, in order, was necessarily resolvable at the moment it ran; that
|
|
3
|
-
* is stronger evidence than re-resolving the same step against a LATER static snapshot, which is
|
|
4
|
-
* exactly what fails for a UI that reveals controls progressively (the earlier steps' own targets
|
|
5
|
-
* can mutate — a "Try it out" button that renames itself to "Cancel" — or the later steps' targets
|
|
6
|
-
* can vanish again by the time save() looks, even though every one of them was just performed live,
|
|
7
|
-
* successfully, moments before). This module answers one question only: for each step in a
|
|
8
|
-
* scenario, does it match something this session's own action log says actually happened, in the
|
|
9
|
-
* same relative order? It does not decide what to do with that answer — the caller
|
|
10
|
-
* (`browser-save-scenario.ts`) still runs today's single-snapshot check for anything this says no
|
|
11
|
-
* to, which is the fallback that still catches a fabricated or hand-edited scenario. */
|
|
12
|
-
import type { PerformedStep } from "./driver.ts";
|
|
13
|
-
import { type ScenarioStep } from "../scenarios/index.ts";
|
|
14
|
-
/** For each of `steps`, in order: does it match an entry in `log`, without matching an earlier
|
|
15
|
-
* step to a later log entry than a later step already claimed? A greedy in-order subsequence
|
|
16
|
-
* match — each match consumes the log up to and including itself, so a match can never come
|
|
17
|
-
* from *before* the previous step's own match, even though extra performed actions in between
|
|
18
|
-
* (an explored dead end, a step the scenario doesn't include) are skipped over freely rather
|
|
19
|
-
* than required to appear. `log` from a different or closed session, or a hand-constructed
|
|
20
|
-
* scenario naming something that was never actually performed, matches nothing here — every
|
|
21
|
-
* entry in `result` for it comes back `false`, leaving the fallback snapshot check to run. */
|
|
22
|
-
export declare function matchByProvenance(steps: readonly ScenarioStep[], log: readonly PerformedStep[]): readonly boolean[];
|
|
23
|
-
//# sourceMappingURL=scenario-provenance.d.ts.map
|