@descryy/mcp 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-handshake.d.ts +8 -75
- package/dist/action-handshake.d.ts.map +1 -1
- package/dist/action-handshake.js +9 -79
- package/dist/action-handshake.js.map +1 -1
- package/dist/bin/descry-mcp.d.ts +4 -15
- package/dist/bin/descry-mcp.d.ts.map +1 -1
- package/dist/bin/descry-mcp.js +12 -42
- package/dist/bin/descry-mcp.js.map +1 -1
- package/dist/browser/driver.d.ts +62 -178
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +14 -46
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +11 -35
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +25 -51
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +12 -16
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +24 -17
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/graph-write.d.ts +4 -45
- package/dist/browser/graph-write.d.ts.map +1 -1
- package/dist/browser/graph-write.js +8 -53
- package/dist/browser/graph-write.js.map +1 -1
- package/dist/browser/playwright-driver.d.ts +17 -67
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +169 -166
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/provider.d.ts +5 -34
- package/dist/browser/provider.d.ts.map +1 -1
- package/dist/browser/provider.js +4 -24
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/registry.d.ts +26 -106
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +20 -77
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-resolve.d.ts +10 -44
- package/dist/browser/scenario-resolve.d.ts.map +1 -1
- package/dist/browser/scenario-resolve.js +10 -41
- package/dist/browser/scenario-resolve.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +12 -70
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +33 -91
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/stack-parser.d.ts +4 -28
- package/dist/browser/stack-parser.d.ts.map +1 -1
- package/dist/browser/stack-parser.js +12 -39
- package/dist/browser/stack-parser.js.map +1 -1
- package/dist/browser/tool-support.d.ts +20 -67
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +22 -66
- package/dist/browser/tool-support.js.map +1 -1
- 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/cancellation.d.ts +11 -46
- package/dist/cancellation.d.ts.map +1 -1
- package/dist/cancellation.js +11 -46
- package/dist/cancellation.js.map +1 -1
- package/dist/capped.d.ts +17 -0
- package/dist/capped.d.ts.map +1 -0
- package/dist/capped.js +15 -0
- package/dist/capped.js.map +1 -0
- package/dist/disclosure-ledger.d.ts +6 -30
- package/dist/disclosure-ledger.d.ts.map +1 -1
- package/dist/disclosure-ledger.js +4 -26
- package/dist/disclosure-ledger.js.map +1 -1
- package/dist/index.d.ts +10 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/module-trust.d.ts +24 -0
- package/dist/module-trust.d.ts.map +1 -0
- package/dist/module-trust.js +60 -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/protocol.d.ts +10 -53
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -60
- package/dist/protocol.js.map +1 -1
- package/dist/registry.d.ts +10 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +38 -90
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +79 -11
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +126 -14
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +8 -49
- package/dist/runtime-registry.d.ts.map +1 -1
- package/dist/runtime-registry.js +72 -63
- package/dist/runtime-registry.js.map +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +1 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts +4 -18
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +14 -34
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +18 -74
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +7 -34
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/storage.d.ts +11 -41
- package/dist/scenarios/storage.d.ts.map +1 -1
- package/dist/scenarios/storage.js +57 -47
- package/dist/scenarios/storage.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +55 -13
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +69 -239
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +76 -231
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +27 -101
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +58 -148
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-click.d.ts +3 -21
- package/dist/tools/browser-click.d.ts.map +1 -1
- package/dist/tools/browser-click.js +10 -31
- package/dist/tools/browser-click.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +4 -13
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +4 -13
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-fill.d.ts +5 -36
- package/dist/tools/browser-fill.d.ts.map +1 -1
- package/dist/tools/browser-fill.js +9 -44
- package/dist/tools/browser-fill.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +6 -27
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +6 -23
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts +5 -31
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +10 -46
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts +3 -28
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +102 -55
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-snapshot.d.ts +6 -39
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +4 -31
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts +4 -23
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +38 -51
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-type.d.ts +5 -35
- package/dist/tools/browser-type.d.ts.map +1 -1
- package/dist/tools/browser-type.js +10 -45
- package/dist/tools/browser-type.js.map +1 -1
- package/dist/tools/contracts.d.ts +17 -63
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +91 -47
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts +56 -15
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +141 -38
- package/dist/tools/cross-pr.js.map +1 -1
- package/dist/tools/git-diff.d.ts +18 -2
- package/dist/tools/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +143 -23
- package/dist/tools/git-diff.js.map +1 -1
- package/dist/tools/git-history.d.ts +5 -16
- package/dist/tools/git-history.d.ts.map +1 -1
- package/dist/tools/git-history.js +3 -10
- package/dist/tools/git-history.js.map +1 -1
- package/dist/tools/history.d.ts +4 -33
- package/dist/tools/history.d.ts.map +1 -1
- package/dist/tools/history.js +6 -31
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/impact.d.ts +7 -51
- package/dist/tools/impact.d.ts.map +1 -1
- package/dist/tools/impact.js +15 -67
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +3 -8
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +66 -113
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +60 -28
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/link-workspace.d.ts +7 -45
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +10 -48
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/lookup.d.ts +4 -14
- package/dist/tools/lookup.d.ts.map +1 -1
- package/dist/tools/lookup.js +4 -14
- package/dist/tools/lookup.js.map +1 -1
- package/dist/tools/mark-incident.d.ts +7 -54
- package/dist/tools/mark-incident.d.ts.map +1 -1
- package/dist/tools/mark-incident.js +15 -68
- package/dist/tools/mark-incident.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +27 -210
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +258 -436
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +9 -88
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +34 -108
- package/dist/tools/observe-tests.js.map +1 -1
- package/dist/tools/pr-analysis.d.ts +18 -2
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +73 -23
- package/dist/tools/pr-analysis.js.map +1 -1
- package/dist/tools/pre-push.d.ts +94 -9
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +139 -34
- package/dist/tools/pre-push.js.map +1 -1
- package/dist/tools/propagation.d.ts +11 -53
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +14 -57
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/questions.d.ts +13 -63
- package/dist/tools/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +33 -105
- package/dist/tools/questions.js.map +1 -1
- package/dist/tools/refusal-fetch.d.ts +4 -40
- package/dist/tools/refusal-fetch.d.ts.map +1 -1
- package/dist/tools/refusal-fetch.js +4 -40
- package/dist/tools/refusal-fetch.js.map +1 -1
- package/dist/tools/runtime-incident.d.ts +4 -63
- package/dist/tools/runtime-incident.d.ts.map +1 -1
- package/dist/tools/runtime-incident.js +10 -87
- package/dist/tools/runtime-incident.js.map +1 -1
- package/dist/tools/scope.d.ts +7 -25
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +17 -20
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/similar-incidents.d.ts +11 -86
- package/dist/tools/similar-incidents.d.ts.map +1 -1
- package/dist/tools/similar-incidents.js +7 -71
- package/dist/tools/similar-incidents.js.map +1 -1
- package/dist/tools/validate.d.ts +31 -47
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +133 -61
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/verification-status.d.ts +9 -64
- package/dist/tools/verification-status.d.ts.map +1 -1
- package/dist/tools/verification-status.js +9 -62
- package/dist/tools/verification-status.js.map +1 -1
- package/dist/tools/verify-claim.d.ts +5 -52
- package/dist/tools/verify-claim.d.ts.map +1 -1
- package/dist/tools/verify-claim.js +6 -56
- package/dist/tools/verify-claim.js.map +1 -1
- package/dist/transport.d.ts +15 -52
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +16 -60
- package/dist/transport.js.map +1 -1
- package/package.json +33 -16
|
@@ -1,19 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* invalidation, drain-not-peek, crash invalidation, idempotent close that
|
|
6
|
-
* still flushes — and `browser-driver-contract.test.ts` runs the same
|
|
7
|
-
* assertions against it that the real driver will have to pass. Its purpose
|
|
8
|
-
* is to make those rules *checkable in milliseconds*, so the session
|
|
9
|
-
* lifecycle in §4 is tested against timeouts, disconnects and crashes that
|
|
10
|
-
* would otherwise each need a real Chromium.
|
|
11
|
-
*
|
|
12
|
-
* Two deliberate non-goals. It does not simulate a page — pages are declared
|
|
13
|
-
* with `setPage`, because a fake DOM would be a second, wrong browser. And it
|
|
14
|
-
* does not classify anything, for the same structural reason the port does
|
|
15
|
-
* not: there is nowhere to put a verdict.
|
|
16
|
-
*/
|
|
1
|
+
/** A `BrowserDriver` with no browser behind it — not a stub. Implements every port rule (ref
|
|
2
|
+
* issuance/invalidation, drain-not-peek, crash invalidation, flushing close), and
|
|
3
|
+
* `browser-driver-contract.test.ts` runs the same assertions against it as the real driver.
|
|
4
|
+
* Non-goals: no simulated DOM (pages are declared via `setPage`), no classification. */
|
|
17
5
|
import { type BrowserDriver, type ObservedRequest } from "./driver.ts";
|
|
18
6
|
/** A page as a test declares it. `ref` is issued by the fake, not written here. */
|
|
19
7
|
export interface FakePage {
|
|
@@ -41,6 +29,8 @@ export interface FakeBrowserDriver extends BrowserDriver {
|
|
|
41
29
|
readonly status: number | null;
|
|
42
30
|
readonly stackText: string | null;
|
|
43
31
|
readonly stackTrace?: ObservedRequest["stackTrace"];
|
|
32
|
+
/** Omit to leave this request's outcome unreported, the way an older `descry-runtime` build would. */
|
|
33
|
+
readonly outcome?: ObservedRequest["outcome"];
|
|
44
34
|
}): void;
|
|
45
35
|
/** Sugar for `emitRequest` with a failing status. */
|
|
46
36
|
emitFailedRequest(sessionId: string, request: {
|
|
@@ -49,6 +39,12 @@ export interface FakeBrowserDriver extends BrowserDriver {
|
|
|
49
39
|
readonly status: number | null;
|
|
50
40
|
readonly stackText: string | null;
|
|
51
41
|
}): void;
|
|
42
|
+
/** Sugar for `emitRequest` still in flight when the window closed — `outcome: "pending"`, `status: null`. */
|
|
43
|
+
emitPendingRequest(sessionId: string, request: {
|
|
44
|
+
readonly method: string;
|
|
45
|
+
readonly url: string;
|
|
46
|
+
readonly stackText: string | null;
|
|
47
|
+
}): void;
|
|
52
48
|
/** Kill the browser behind a session, the way a real crash does — usable goes false, the id stays invalid. */
|
|
53
49
|
crash(sessionId: string): void;
|
|
54
50
|
/** Every session this driver has opened and not closed. What the registry's orphan-cleanup tests assert against. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-driver.d.ts","sourceRoot":"","sources":["../../src/browser/fake-driver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fake-driver.d.ts","sourceRoot":"","sources":["../../src/browser/fake-driver.ts"],"names":[],"mappings":"AAAA;;;yFAGyF;AAIzF,OAAO,EAGL,KAAK,aAAa,EAOlB,KAAK,eAAe,EAGrB,MAAM,aAAa,CAAC;AAErB,mFAAmF;AACnF,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CAC3G;AAED,MAAM,WAAW,iBAAkB,SAAQ,aAAa;IACtD,0JAA0J;IAC1J,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,IAAI,CAAC;IAC3C,kFAAkF;IAClF,kBAAkB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAC1C,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE;QAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;QAAC,QAA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19 +1,7 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
* invalidation, drain-not-peek, crash invalidation, idempotent close that
|
|
6
|
-
* still flushes — and `browser-driver-contract.test.ts` runs the same
|
|
7
|
-
* assertions against it that the real driver will have to pass. Its purpose
|
|
8
|
-
* is to make those rules *checkable in milliseconds*, so the session
|
|
9
|
-
* lifecycle in §4 is tested against timeouts, disconnects and crashes that
|
|
10
|
-
* would otherwise each need a real Chromium.
|
|
11
|
-
*
|
|
12
|
-
* Two deliberate non-goals. It does not simulate a page — pages are declared
|
|
13
|
-
* with `setPage`, because a fake DOM would be a second, wrong browser. And it
|
|
14
|
-
* does not classify anything, for the same structural reason the port does
|
|
15
|
-
* not: there is nowhere to put a verdict.
|
|
16
|
-
*/
|
|
1
|
+
/** A `BrowserDriver` with no browser behind it — not a stub. Implements every port rule (ref
|
|
2
|
+
* issuance/invalidation, drain-not-peek, crash invalidation, flushing close), and
|
|
3
|
+
* `browser-driver-contract.test.ts` runs the same assertions against it as the real driver.
|
|
4
|
+
* Non-goals: no simulated DOM (pages are declared via `setPage`), no classification. */
|
|
17
5
|
import { randomUUID } from "node:crypto";
|
|
18
6
|
import { BrowserSessionCrashedError, UnknownElementRefError, } from "./driver.js";
|
|
19
7
|
const EMPTY_PAGE = (url) => ({ url, title: "", elements: [] });
|
|
@@ -147,11 +135,30 @@ export function createFakeBrowserDriver() {
|
|
|
147
135
|
stateOf(sessionId).buffer.consoleErrors.push({ scriptUrlMapping: [], ...error, at: new Date().toISOString() });
|
|
148
136
|
},
|
|
149
137
|
emitRequest(sessionId, request) {
|
|
150
|
-
|
|
138
|
+
// outcome destructured out, re-added only when present: exactOptionalPropertyTypes rejects
|
|
139
|
+
// a spread that could set it to `undefined` explicitly.
|
|
140
|
+
const { outcome, ...rest } = request;
|
|
141
|
+
stateOf(sessionId).buffer.requests.push({
|
|
142
|
+
stackTrace: null,
|
|
143
|
+
scriptUrlMapping: [],
|
|
144
|
+
...rest,
|
|
145
|
+
...(outcome === undefined ? {} : { outcome }),
|
|
146
|
+
at: new Date().toISOString(),
|
|
147
|
+
});
|
|
151
148
|
},
|
|
152
149
|
emitFailedRequest(sessionId, request) {
|
|
153
150
|
stateOf(sessionId).buffer.requests.push({ scriptUrlMapping: [], ...request, stackTrace: null, at: new Date().toISOString() });
|
|
154
151
|
},
|
|
152
|
+
emitPendingRequest(sessionId, request) {
|
|
153
|
+
stateOf(sessionId).buffer.requests.push({
|
|
154
|
+
scriptUrlMapping: [],
|
|
155
|
+
stackTrace: null,
|
|
156
|
+
...request,
|
|
157
|
+
status: null,
|
|
158
|
+
outcome: "pending",
|
|
159
|
+
at: new Date().toISOString(),
|
|
160
|
+
});
|
|
161
|
+
},
|
|
155
162
|
crash(sessionId) {
|
|
156
163
|
stateOf(sessionId).crashed = true;
|
|
157
164
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fake-driver.js","sourceRoot":"","sources":["../../src/browser/fake-driver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"fake-driver.js","sourceRoot":"","sources":["../../src/browser/fake-driver.ts"],"names":[],"mappings":"AAAA;;;yFAGyF;AAEzF,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EACL,0BAA0B,EAC1B,sBAAsB,GAWvB,MAAM,aAAa,CAAC;AAoDrB,MAAM,UAAU,GAAG,CAAC,GAAW,EAAY,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,KAAK,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,CAAC,CAAC;AAEjF,MAAM,UAAU,uBAAuB;IACrC,MAAM,KAAK,GAAG,IAAI,GAAG,EAAoB,CAAC;IAC1C,MAAM,MAAM,GAAG,IAAI,GAAG,EAA4B,CAAC;IACnD,IAAI,eAAe,GAA8B,IAAI,CAAC;IACtD,2EAA2E;IAC3E,sEAAsE;IACtE,IAAI,kBA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,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,EAAE,CAAC,CAAC;QACtF,CAAC;KACF,CAAC;AACJ,CAAC"}
|
|
@@ -1,41 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* §5.4
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* The UAT's verdict on runtime evidence was that it proves *"this line
|
|
7
|
-
* touched this function"* and never *"this frontend action reached this
|
|
8
|
-
* backend route"* — the cross-boundary confirmation the product's own
|
|
9
|
-
* description leads with. Everything needed for the second claim was built
|
|
10
|
-
* and none of it was joined: the browser package captures a real `fetch()`
|
|
11
|
-
* call-site stack, `confirmObservedFrontendCaller` writes R4 from one, and
|
|
12
|
-
* `applyRuntimeObservations` is the write path. This module is the join,
|
|
13
|
-
* reached from an MCP tool call.
|
|
14
|
-
*
|
|
15
|
-
* ## Why the edge matters more than the reply
|
|
16
|
-
*
|
|
17
|
-
* `impact` and `propagation` already join a frontend caller to a backend
|
|
18
|
-
* route by **comparing `"GET /business-info"` as a string on both sides**.
|
|
19
|
-
* That is an R1 name match: it is right often and it cannot know when it is
|
|
20
|
-
* wrong. What this writes is the same edge *witnessed* — a real click, a real
|
|
21
|
-
* request, a real call-site stack resolved to a real file — at `resolution:
|
|
22
|
-
* 4` carrying the run that saw it. No new query tool is needed and none is
|
|
23
|
-
* added: `impact` and the rest already read `resolution` and pick these up.
|
|
24
|
-
*
|
|
25
|
-
* ## Precision over recall, enforced by omission
|
|
26
|
-
*
|
|
27
|
-
* Every step that cannot be established drops the observation entirely rather
|
|
28
|
-
* than weakening it. No parsed stack, no endpoint resolved, an ambiguous
|
|
29
|
-
* match — each produces **no edge**, not a low-confidence one. A wrong edge
|
|
30
|
-
* corrupts diff scoping, impact scores and root-cause traversal on every
|
|
31
|
-
* later run; a missing one is a disclosed gap, and the disclosures below are
|
|
32
|
-
* how it gets disclosed.
|
|
33
|
-
*
|
|
34
|
-
* Note also what is *not* here: no denial. A run establishes that a call
|
|
35
|
-
* happened and can never establish that one did not — a page visit exercises
|
|
36
|
-
* one path, and the absence of a stack for some other function is absence of
|
|
37
|
-
* evidence. `confirmObservedFrontendCaller` refuses to mint denials for the
|
|
38
|
-
* same reason; this caller must not reintroduce one by another route.
|
|
2
|
+
* §5.4: joins a real browser action to a real R4 edge — witnessed, not the
|
|
3
|
+
* R1 string-match `impact`/`propagation` already do. Precision over recall:
|
|
4
|
+
* anything unresolvable (no stack, no endpoint, ambiguous) drops the observation entirely rather than writing a weak edge. Never mints a denial.
|
|
39
5
|
*/
|
|
40
6
|
import type { SqlDriver } from "@descryy/core";
|
|
41
7
|
import { type ObservedRequest } from "./driver.ts";
|
|
@@ -72,14 +38,7 @@ export interface BrowserGraphWriteInput {
|
|
|
72
38
|
readonly repoRoot: string;
|
|
73
39
|
readonly requests: readonly ObservedRequest[];
|
|
74
40
|
}
|
|
75
|
-
/**
|
|
76
|
-
* Correlate what the page did against the graph, and record what was
|
|
77
|
-
* genuinely witnessed.
|
|
78
|
-
*
|
|
79
|
-
* Runs over **every** request, not only the failures. A successful call is
|
|
80
|
-
* the thing that proves the arrow; narrowing to failures here would mean the
|
|
81
|
-
* feature only ever confirmed edges on broken pages.
|
|
82
|
-
*/
|
|
41
|
+
/** Correlates what the page did against the graph, recording only what was genuinely witnessed. Runs over every request, not just failures — a successful call is what proves the arrow. */
|
|
83
42
|
export declare function writeBrowserObservations(input: BrowserGraphWriteInput): BrowserGraphWrite;
|
|
84
43
|
/** What a reply says about a write. Empty when nothing was reached — silence about nothing is not a disclosure gap. */
|
|
85
44
|
export declare function graphWriteNotes(write: BrowserGraphWrite, requests: readonly ObservedRequest[]): string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-write.d.ts","sourceRoot":"","sources":["../../src/browser/graph-write.ts"],"names":[],"mappings":"AAAA
|
|
1
|
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AQ,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;CAC/C;AAED,4LAA4L;AAC5L,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,sBAAsB,GAAG,iBAAiB,CA6DzF;AAED,uHAAuH;AACvH,wBAAgB,eAAe,CAAC,KAAK,EAAE,iBAAiB,EAAE,QAAQ,EAAE,SAAS,eAAe,EAAE,GAAG,MAAM,EAAE,CAiCxG"}
|
|
@@ -1,53 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* §5.4
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* The UAT's verdict on runtime evidence was that it proves *"this line
|
|
7
|
-
* touched this function"* and never *"this frontend action reached this
|
|
8
|
-
* backend route"* — the cross-boundary confirmation the product's own
|
|
9
|
-
* description leads with. Everything needed for the second claim was built
|
|
10
|
-
* and none of it was joined: the browser package captures a real `fetch()`
|
|
11
|
-
* call-site stack, `confirmObservedFrontendCaller` writes R4 from one, and
|
|
12
|
-
* `applyRuntimeObservations` is the write path. This module is the join,
|
|
13
|
-
* reached from an MCP tool call.
|
|
14
|
-
*
|
|
15
|
-
* ## Why the edge matters more than the reply
|
|
16
|
-
*
|
|
17
|
-
* `impact` and `propagation` already join a frontend caller to a backend
|
|
18
|
-
* route by **comparing `"GET /business-info"` as a string on both sides**.
|
|
19
|
-
* That is an R1 name match: it is right often and it cannot know when it is
|
|
20
|
-
* wrong. What this writes is the same edge *witnessed* — a real click, a real
|
|
21
|
-
* request, a real call-site stack resolved to a real file — at `resolution:
|
|
22
|
-
* 4` carrying the run that saw it. No new query tool is needed and none is
|
|
23
|
-
* added: `impact` and the rest already read `resolution` and pick these up.
|
|
24
|
-
*
|
|
25
|
-
* ## Precision over recall, enforced by omission
|
|
26
|
-
*
|
|
27
|
-
* Every step that cannot be established drops the observation entirely rather
|
|
28
|
-
* than weakening it. No parsed stack, no endpoint resolved, an ambiguous
|
|
29
|
-
* match — each produces **no edge**, not a low-confidence one. A wrong edge
|
|
30
|
-
* corrupts diff scoping, impact scores and root-cause traversal on every
|
|
31
|
-
* later run; a missing one is a disclosed gap, and the disclosures below are
|
|
32
|
-
* how it gets disclosed.
|
|
33
|
-
*
|
|
34
|
-
* Note also what is *not* here: no denial. A run establishes that a call
|
|
35
|
-
* happened and can never establish that one did not — a page visit exercises
|
|
36
|
-
* one path, and the absence of a stack for some other function is absence of
|
|
37
|
-
* evidence. `confirmObservedFrontendCaller` refuses to mint denials for the
|
|
38
|
-
* same reason; this caller must not reintroduce one by another route.
|
|
2
|
+
* §5.4: joins a real browser action to a real R4 edge — witnessed, not the
|
|
3
|
+
* R1 string-match `impact`/`propagation` already do. Precision over recall:
|
|
4
|
+
* anything unresolvable (no stack, no endpoint, ambiguous) drops the observation entirely rather than writing a weak edge. Never mints a denial.
|
|
39
5
|
*/
|
|
40
6
|
import { confirmObservedFrontendCaller, resolveEndpointNode } from "@descryy/runtime-graph-correlator";
|
|
41
7
|
import { isFailedRequest } from "./driver.js";
|
|
42
8
|
export const NO_GRAPH_WRITE = { reached: [], promoted: [], created: [], refused: [], contradictions: [] };
|
|
43
|
-
/**
|
|
44
|
-
* Correlate what the page did against the graph, and record what was
|
|
45
|
-
* genuinely witnessed.
|
|
46
|
-
*
|
|
47
|
-
* Runs over **every** request, not only the failures. A successful call is
|
|
48
|
-
* the thing that proves the arrow; narrowing to failures here would mean the
|
|
49
|
-
* feature only ever confirmed edges on broken pages.
|
|
50
|
-
*/
|
|
9
|
+
/** Correlates what the page did against the graph, recording only what was genuinely witnessed. Runs over every request, not just failures — a successful call is what proves the arrow. */
|
|
51
10
|
export function writeBrowserObservations(input) {
|
|
52
11
|
const reached = [];
|
|
53
12
|
const promoted = [];
|
|
@@ -65,10 +24,9 @@ export function writeBrowserObservations(input) {
|
|
|
65
24
|
}
|
|
66
25
|
const resolution = resolveEndpointNode(input.driver, request.method, path);
|
|
67
26
|
if (resolution.outcome !== "resolved") {
|
|
68
|
-
// Not
|
|
69
|
-
// stylesheets, images and third-party origins,
|
|
70
|
-
//
|
|
71
|
-
// bury the real ones.
|
|
27
|
+
// Not worth reporting per request: a page issues requests for
|
|
28
|
+
// stylesheets, images and third-party origins, none meant to be an
|
|
29
|
+
// endpoint here — reporting each miss would bury the real ones.
|
|
72
30
|
continue;
|
|
73
31
|
}
|
|
74
32
|
const endpoint = resolution.node;
|
|
@@ -83,10 +41,7 @@ export function writeBrowserObservations(input) {
|
|
|
83
41
|
});
|
|
84
42
|
}
|
|
85
43
|
if (request.stackTrace === null) {
|
|
86
|
-
//
|
|
87
|
-
// parsed stack and there is none. Disclosed rather than dropped,
|
|
88
|
-
// because "we saw this route get hit but could not tell you from where"
|
|
89
|
-
// is a real, useful, incomplete answer.
|
|
44
|
+
// Endpoint reached, but no parsed stack means no caller edge — disclosed rather than dropped ("saw the hit, not the source" is still useful).
|
|
90
45
|
refused.push(`${request.method} ${path} reached ${endpoint.name}, but no parsed call-site stack was captured, so no ` +
|
|
91
46
|
"caller edge was written. Name a stackParser on browser_start_session to capture one.");
|
|
92
47
|
continue;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-write.js","sourceRoot":"","sources":["../../src/browser/graph-write.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"graph-write.js","sourceRoot":"","sources":["../../src/browser/graph-write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAE,6BAA6B,EAAE,mBAAmB,EAAE,MAAM,mCAAmC,CAAC;AAEvG,OAAO,EAAE,eAAe,EAAwB,MAAM,aAAa,CAAC;AAwBpE,MAAM,CAAC,MAAM,cAAc,GAAsB,EAAE,OAAO,EAAE,EAAE,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE,cAAc,EAAE,EAAE,EAAE,CAAC;AAW7H,4LAA4L;AAC5L,MAAM,UAAU,wBAAwB,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ime-browser`.
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `@descryy/runtime-browser` is now a declared dependency of `@descryy/mcp`
|
|
7
|
-
* (`mcp-browser-tools.md` §3.1's publish landed) — so the reason this module
|
|
8
|
-
* used to give for a call-time specifier import, "not on the registry yet,"
|
|
9
|
-
* no longer holds. It stays dynamic anyway, for a reason that outgrew that
|
|
10
|
-
* one: `loadRuntimeModule` (`PlaywrightDriverOptions`, below) is a real
|
|
11
|
-
* injection seam that `browser-action-settle.test.ts` uses today to drive
|
|
12
|
-
* this file's settle logic against a fake module shaped like this one,
|
|
13
|
-
* deterministically, with no real browser involved. A static
|
|
14
|
-
* `import … from "@descryy/runtime-browser"` at the top of this file would
|
|
15
|
-
* remove that seam along with the indirection, and nothing here needs
|
|
16
|
-
* removing it — the package being on the registry made the *dependency*
|
|
17
|
-
* declarable, not the import path mandatory. Absence (package missing,
|
|
18
|
-
* import throws, or Chromium missing) is still a **named refusal with a
|
|
19
|
-
* remedy**, exactly as before — see `provider.ts`.
|
|
20
|
-
*
|
|
21
|
-
* ## What this adds over the runtime package, and what it deliberately does not
|
|
22
|
-
*
|
|
23
|
-
* It adds exactly one thing the runtime has no API for: **element refs.** The
|
|
24
|
-
* port's contract is that an action names an element the agent has seen, and
|
|
25
|
-
* `BrowserActionCollector` acts on raw selectors. So this module enumerates
|
|
26
|
-
* the page's interactive elements, holds a Playwright `ElementHandle` per ref,
|
|
27
|
-
* and drops the whole map on navigation. Handles rather than injected `data-`
|
|
28
|
-
* attributes on purpose: stamping the DOM would make the act of observing
|
|
29
|
-
* change the page being observed, and a detached element then fails naturally
|
|
30
|
-
* instead of resolving to whatever took its place.
|
|
31
|
-
*
|
|
32
|
-
* Everything else is composition. Launch, click, type, fill, console capture,
|
|
33
|
-
* network capture, the `fetch()` initiator stack and its source-map rewrite
|
|
34
|
-
* are all the runtime package's, called rather than reimplemented.
|
|
35
|
-
*
|
|
36
|
-
* ## Rule 1
|
|
37
|
-
*
|
|
38
|
-
* No language is named here. The stack-trace parser that turns a raw browser
|
|
39
|
-
* stack into resolved frames is handed in by the caller as a module specifier
|
|
40
|
-
* — the same mechanism `runtime-registry.ts` uses for runtime adapters, for
|
|
41
|
-
* the same reason. Without one, requests are still observed and no caller
|
|
42
|
-
* edge is written; the reply says so.
|
|
2
|
+
* The real `BrowserDriver`, over `@descryy/runtime-browser`. Import stays
|
|
3
|
+
* dynamic — `loadRuntimeModule` is a test injection seam (fake module, no
|
|
4
|
+
* browser needed). Adds only element refs over the runtime; stack-trace parsing is caller-supplied (rule 1: no language named here).
|
|
43
5
|
*/
|
|
44
|
-
import type { ServiceRootLookup } from "@descryy/runtime-contracts";
|
|
6
|
+
import type { StackTrace, ServiceRootLookup } from "@descryy/runtime-contracts";
|
|
45
7
|
import type { StackTraceParser } from "@descryy/runtime-backend-observation";
|
|
46
|
-
import type { BrowserDriver } from "./driver.ts";
|
|
8
|
+
import type { BrowserDriver, BrowserObservation, ObservedAction, UnsettledAction } from "./driver.ts";
|
|
47
9
|
export interface PlaywrightDriverOptions {
|
|
48
|
-
/**
|
|
49
|
-
* Turns a raw browser stack into resolved frames. Supplied by the caller;
|
|
50
|
-
* this package cannot construct one without naming a language.
|
|
51
|
-
*
|
|
52
|
-
* Absent, the initiator capture is not installed at all — the runtime's own
|
|
53
|
-
* two-halves-or-neither rule — so no request carries a call site and no R4
|
|
54
|
-
* caller edge can be written.
|
|
55
|
-
*/
|
|
10
|
+
/** Turns a raw stack into resolved frames; caller-supplied (rule 1: no language named here). Absent, initiator capture isn't installed and no R4 caller edge is written. */
|
|
56
11
|
readonly stackParser?: StackTraceParser;
|
|
57
12
|
/** Maps a page origin to the on-disk root that served it. Absent means script URLs stay unresolved. */
|
|
58
13
|
readonly resolveSourceRoot?: SourceRootResolver;
|
|
59
14
|
/** Which service the evidence is attributed to. */
|
|
60
15
|
readonly service?: string;
|
|
61
|
-
/**
|
|
62
|
-
* How the runtime browser module is loaded. Defaults to importing
|
|
63
|
-
* `@descryy/runtime-browser` by specifier.
|
|
64
|
-
*
|
|
65
|
-
* It exists because the settle logic below is timing-dependent and this
|
|
66
|
-
* build has no browser backend to run it against — the conformance test
|
|
67
|
-
* that would exercise it skips on every machine without
|
|
68
|
-
* `@descryy/runtime-browser` and Chromium. A driver-level fake page is the
|
|
69
|
-
* only way that logic is executable at all here — and a sleep that dropped
|
|
70
|
-
* evidence shipped in this file with no executable test over it at all,
|
|
71
|
-
* which is the argument for the seam rather than against it.
|
|
72
|
-
*
|
|
73
|
-
* Keep it. Ruled on when it was introduced: exporting `openSession` instead
|
|
74
|
-
* would widen the public surface to an internal lifecycle, where this
|
|
75
|
-
* narrows to one injection point with a stated purpose.
|
|
76
|
-
*/
|
|
16
|
+
/** Loads the runtime browser module; overridable because the settle logic below is timing-dependent and this build has no browser backend to test it against otherwise. Keep narrow — do not export `openSession` instead. */
|
|
77
17
|
readonly loadRuntimeModule?: () => Promise<unknown>;
|
|
78
18
|
}
|
|
79
19
|
type SourceRootResolver = (origin: string) => ServiceRootLookup;
|
|
80
20
|
export declare class BrowserBackendMissingError extends Error {
|
|
81
21
|
constructor(cause: unknown);
|
|
82
22
|
}
|
|
23
|
+
/** `Evidence`-shaped record (typed structurally; only 4 fields are read). Exported for `browser-request-outcome-mapping.test.ts` — regression test for B3, where `outcome` shipped never populated despite passing tests. */
|
|
24
|
+
export interface EmittedEvidence {
|
|
25
|
+
readonly eventType: string;
|
|
26
|
+
readonly payload: Record<string, unknown>;
|
|
27
|
+
readonly stackTrace: StackTrace | null;
|
|
28
|
+
readonly requestId: string | null;
|
|
29
|
+
readonly timestamp: string;
|
|
30
|
+
}
|
|
83
31
|
export declare function createPlaywrightBrowserDriver(options?: PlaywrightDriverOptions): Promise<BrowserDriver>;
|
|
32
|
+
/** Turns collector evidence into the port's vocabulary. Joins request/response on `requestId`, keeping `status: null` (not guessed) when unanswered. Exported for `browser-request-outcome-mapping.test.ts`. */
|
|
33
|
+
export declare function collect(emitted: readonly EmittedEvidence[], actions: readonly ObservedAction[], unsettled: readonly UnsettledAction[]): BrowserObservation;
|
|
84
34
|
export {};
|
|
85
35
|
//# sourceMappingURL=playwright-driver.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"playwright-driver.d.ts","sourceRoot":"","sources":["../../src/browser/playwright-driver.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"playwright-driver.d.ts","sourceRoot":"","sources":["../../src/browser/playwright-driver.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAChF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAgB7E,OAAO,KAAK,EACV,aAAa,EAGb,kBAAkB,EAElB,cAAc,EAOd,eAAe,EAChB,MAAM,aAAa,CAAC;AAuBrB,MAAM,WAAW,uBAAuB;IACtC,4KAA4K;IAC5K,QAAQ,CAAC,WAAW,CAAC,EAAE,gBAAgB,CAAC;IACxC,uGAAuG;IACvG,QAAQ,CAAC,iBAAiB,CAAC,EAAE,kBAAkB,CAAC;IAChD,mDAAmD;IACnD,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,8NAA8N;IAC9N,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;CACrD;AAED,KAAK,kBAAkB,GAAG,CAAC,MAAM,EAAE,MAAM,KAAK,iBAAiB,CAAC;AAgDhE,qBAAa,0BAA2B,SAAQ,KAAK;gBACvC,KAAK,EAAE,OAAO;CAO3B;AAED,6NAA6N;AAC7N,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAC1C,QAAQ,CAAC,UAAU,EAAE,UAAU,G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