@descryy/mcp 0.11.8 → 0.12.1
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.map +1 -1
- package/dist/action-handshake.js +5 -1
- package/dist/action-handshake.js.map +1 -1
- package/dist/browser/driver.d.ts +74 -0
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +48 -0
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +39 -0
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +123 -5
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/fault-attribution.d.ts +75 -39
- package/dist/browser/fault-attribution.d.ts.map +1 -1
- package/dist/browser/fault-attribution.js +100 -89
- package/dist/browser/fault-attribution.js.map +1 -1
- package/dist/browser/graph-write.d.ts +22 -2
- package/dist/browser/graph-write.d.ts.map +1 -1
- package/dist/browser/graph-write.js +60 -2
- package/dist/browser/graph-write.js.map +1 -1
- package/dist/browser/identity-graph-write.d.ts +26 -2
- package/dist/browser/identity-graph-write.d.ts.map +1 -1
- package/dist/browser/identity-graph-write.js +44 -2
- package/dist/browser/identity-graph-write.js.map +1 -1
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +63 -8
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/provider.d.ts +5 -0
- package/dist/browser/provider.d.ts.map +1 -1
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/reach-recording-session.d.ts.map +1 -1
- package/dist/browser/reach-recording-session.js +10 -0
- package/dist/browser/reach-recording-session.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +2 -0
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +6 -1
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/findings/index.d.ts +2 -0
- package/dist/findings/index.d.ts.map +1 -0
- package/dist/findings/index.js +2 -0
- package/dist/findings/index.js.map +1 -0
- package/dist/findings/store.d.ts +81 -0
- package/dist/findings/store.d.ts.map +1 -0
- package/dist/findings/store.js +148 -0
- package/dist/findings/store.js.map +1 -0
- package/dist/fs-gateway.d.ts +57 -0
- package/dist/fs-gateway.d.ts.map +1 -0
- package/dist/fs-gateway.js +86 -0
- package/dist/fs-gateway.js.map +1 -0
- package/dist/scenarios/storage.d.ts.map +1 -1
- package/dist/scenarios/storage.js +3 -3
- package/dist/scenarios/storage.js.map +1 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +8 -13
- package/dist/session.js.map +1 -1
- package/dist/tools/browser-read.d.ts +19 -12
- package/dist/tools/browser-read.d.ts.map +1 -1
- package/dist/tools/browser-read.js +34 -18
- package/dist/tools/browser-read.js.map +1 -1
- package/dist/tools/browser-record-start.d.ts +20 -0
- package/dist/tools/browser-record-start.d.ts.map +1 -0
- package/dist/tools/browser-record-start.js +97 -0
- package/dist/tools/browser-record-start.js.map +1 -0
- package/dist/tools/browser-record-stop.d.ts +25 -0
- package/dist/tools/browser-record-stop.d.ts.map +1 -0
- package/dist/tools/browser-record-stop.js +102 -0
- package/dist/tools/browser-record-stop.js.map +1 -0
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +12 -0
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser.d.ts.map +1 -1
- package/dist/tools/browser.js +6 -0
- package/dist/tools/browser.js.map +1 -1
- package/dist/tools/chain.d.ts +5 -0
- package/dist/tools/chain.d.ts.map +1 -1
- package/dist/tools/chain.js +5 -2
- package/dist/tools/chain.js.map +1 -1
- package/dist/tools/draw-conclusion.d.ts +18 -2
- package/dist/tools/draw-conclusion.d.ts.map +1 -1
- package/dist/tools/draw-conclusion.js +69 -11
- package/dist/tools/draw-conclusion.js.map +1 -1
- package/dist/tools/finding-lookup.d.ts +58 -0
- package/dist/tools/finding-lookup.d.ts.map +1 -0
- package/dist/tools/finding-lookup.js +261 -0
- package/dist/tools/finding-lookup.js.map +1 -0
- package/dist/tools/kit.d.ts +1 -1
- package/dist/tools/link-workspace.d.ts +7 -0
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +20 -0
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/propagation.d.ts +14 -8
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +23 -15
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/prove-reach.d.ts +8 -0
- package/dist/tools/prove-reach.d.ts.map +1 -1
- package/dist/tools/prove-reach.js +80 -2
- package/dist/tools/prove-reach.js.map +1 -1
- package/dist/tools/workspace.d.ts.map +1 -1
- package/dist/tools/workspace.js +10 -2
- package/dist/tools/workspace.js.map +1 -1
- package/package.json +21 -21
|
@@ -3,9 +3,35 @@
|
|
|
3
3
|
* R1 string-match `impact`/`propagation` already do. Precision over recall:
|
|
4
4
|
* anything unresolvable (no stack, no endpoint, ambiguous) drops the observation entirely rather than writing a weak edge. Never mints a denial.
|
|
5
5
|
*/
|
|
6
|
+
import { applyObservedInteractions } from "@descryy/core";
|
|
6
7
|
import { confirmObservedFrontendCaller, resolveEndpointNode } from "@descryy/runtime-graph-correlator";
|
|
7
8
|
import { isFailedRequest } from "./driver.js";
|
|
8
|
-
|
|
9
|
+
import { resolveActionIdentityGraphNode } from "./identity-graph-write.js";
|
|
10
|
+
export const NO_GRAPH_WRITE = {
|
|
11
|
+
reached: [],
|
|
12
|
+
promoted: [],
|
|
13
|
+
created: [],
|
|
14
|
+
refused: [],
|
|
15
|
+
contradictions: [],
|
|
16
|
+
interactions: [],
|
|
17
|
+
};
|
|
18
|
+
/** `ObservedAction`'s five element-targeting kinds, mapped to `observed_interactions`'s own
|
|
19
|
+
* two-way vocabulary — `chain`'s witnessed-click reader does not need the DOM-level
|
|
20
|
+
* distinction between typing, filling, selecting or submitting. `navigate` is excluded: it
|
|
21
|
+
* acts on the page, not an element, and carries no identity to resolve. */
|
|
22
|
+
function interactionActionOf(action) {
|
|
23
|
+
switch (action) {
|
|
24
|
+
case "click":
|
|
25
|
+
case "submit":
|
|
26
|
+
return "click";
|
|
27
|
+
case "type":
|
|
28
|
+
case "fill":
|
|
29
|
+
case "select":
|
|
30
|
+
return "input";
|
|
31
|
+
case "navigate":
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
9
35
|
/** 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. */
|
|
10
36
|
export function writeBrowserObservations(input) {
|
|
11
37
|
const reached = [];
|
|
@@ -59,7 +85,34 @@ export function writeBrowserObservations(input) {
|
|
|
59
85
|
refused.push(...outcome.confirmation.refused.map((r) => r.reason));
|
|
60
86
|
contradictions.push(...outcome.confirmation.contradictions.map((c) => c.detail));
|
|
61
87
|
}
|
|
62
|
-
|
|
88
|
+
const interactions = [];
|
|
89
|
+
for (const action of input.actions ?? []) {
|
|
90
|
+
if (action.identity === null)
|
|
91
|
+
continue;
|
|
92
|
+
const kind = interactionActionOf(action.action);
|
|
93
|
+
if (kind === null)
|
|
94
|
+
continue;
|
|
95
|
+
const resolution = resolveActionIdentityGraphNode(input.driver, action.identity, input.repo, { repoRoot: input.repoRoot });
|
|
96
|
+
if (resolution.outcome !== "resolved") {
|
|
97
|
+
// `withheld` (no authored file/symbol, e.g. a refused or component-only identity) is
|
|
98
|
+
// the ordinary case for most clicks and not worth reporting per action — same reasoning
|
|
99
|
+
// as the endpoint-miss `continue` above. `not-found`/`ambiguous`/`line-mismatch` are a
|
|
100
|
+
// real graph-join gap and are disclosed.
|
|
101
|
+
if (resolution.outcome !== "withheld") {
|
|
102
|
+
refused.push(`${action.action} on ${action.ref ?? "an element"} named component "${action.identity.component ?? "?"}", ` +
|
|
103
|
+
`but the graph join ${resolution.outcome}: ${resolution.reason}`);
|
|
104
|
+
}
|
|
105
|
+
continue;
|
|
106
|
+
}
|
|
107
|
+
interactions.push({ nodeId: resolution.node.nodeId, name: resolution.node.name, type: resolution.node.type, via: { action: kind, ref: action.ref } });
|
|
108
|
+
const written = applyObservedInteractions(input.driver, {
|
|
109
|
+
runId: input.runId,
|
|
110
|
+
commitSha: input.commitSha,
|
|
111
|
+
observations: [{ nodeId: resolution.node.nodeId, action: kind }],
|
|
112
|
+
});
|
|
113
|
+
refused.push(...written.refused.map((r) => r.reason));
|
|
114
|
+
}
|
|
115
|
+
return { reached, promoted, created, refused, contradictions, interactions };
|
|
63
116
|
}
|
|
64
117
|
/** What a reply says about a write. Empty when nothing was reached — silence about nothing is not a disclosure gap. */
|
|
65
118
|
export function graphWriteNotes(write, requests) {
|
|
@@ -75,6 +128,11 @@ export function graphWriteNotes(write, requests) {
|
|
|
75
128
|
notes.push(`${write.reached.length} endpoint(s) in the graph were reached by this page, but no caller edge was ` +
|
|
76
129
|
"written — see data.graph.refused for why. The endpoints are named so the gap is visible rather than absent.");
|
|
77
130
|
}
|
|
131
|
+
if (write.interactions.length > 0) {
|
|
132
|
+
notes.push(`${write.interactions.length} click/input action(s) resolved to a real graph node (B1 identity ` +
|
|
133
|
+
`grounding) and were recorded as witnessed — ${write.interactions.map((i) => i.name).join(", ")}. chain's ` +
|
|
134
|
+
'"click" stage reads this for these exact nodes.');
|
|
135
|
+
}
|
|
78
136
|
// Always stated, not only when non-empty (F7, UAT Phase 5): `contradictions`
|
|
79
137
|
// covers one narrow thing — an observation disagreeing with an existing R4
|
|
80
138
|
// edge — and an empty array reads as "nothing disagreed" unless the scope is
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph-write.js","sourceRoot":"","sources":["../../src/browser/graph-write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"graph-write.js","sourceRoot":"","sources":["../../src/browser/graph-write.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,yBAAyB,E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QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,UAAU,KAAK,IAAI,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC;IAChG,IAAI,WAAW,GAAG,CAAC,IAAI,SAAS,KAAK,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACrE,KAAK,CAAC,IAAI,CACR,GAAG,QAAQ,CAAC,MAAM,mFAAmF;YACnG,sGAAsG;YACtG,gBAAgB,CACnB,CAAC;IACJ,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
|
@@ -7,11 +7,14 @@
|
|
|
7
7
|
* `resolveSymbolNode`'s ambiguity refusal, line-mismatch reporting or path translation — it
|
|
8
8
|
* calls it and restates the outcome in this package's own node shape.
|
|
9
9
|
*
|
|
10
|
-
* No new node type, no new edge type: this resolves to a `FUNCTION`/`CLASS` node an
|
|
11
|
-
* already produced
|
|
10
|
+
* No new node type, no new edge type: this resolves to a `FUNCTION`/`CLASS`/`COMPONENT` node an
|
|
11
|
+
* adapter already produced (`@descryy/runtime-graph-correlator`'s `resolveSymbolNode` accepts
|
|
12
|
+
* `COMPONENT` alongside `FUNCTION`/`CLASS` as of this session). `descry-core`'s frozen 15/15
|
|
13
|
+
* vocabulary is untouched.
|
|
12
14
|
*/
|
|
13
15
|
import type { SqlDriver } from "@descryy/core";
|
|
14
16
|
import { type ElementIdentity } from "@descryy/runtime-identity-grounding";
|
|
17
|
+
import type { ElementComponentIdentity } from "./driver.ts";
|
|
15
18
|
/** The graph node an identity resolved to — only what a caller needs to name it, never the
|
|
16
19
|
* full `IRNode` (this package does not depend on `@descryy/ir`'s node shape beyond id/name/type). */
|
|
17
20
|
export interface IdentityGraphNode {
|
|
@@ -52,4 +55,25 @@ export declare function resolveIdentityGraphNode(driver: SqlDriver, identity: El
|
|
|
52
55
|
readonly repoRoot?: string;
|
|
53
56
|
readonly cwd?: string;
|
|
54
57
|
}): IdentityGraphOutcome;
|
|
58
|
+
/**
|
|
59
|
+
* The same join, for a `click`/`type`/`fill`/`select`/`submit` action's own `ElementComponentIdentity`
|
|
60
|
+
* (`driver.ts`) rather than the raw `ElementIdentity` a snapshot's grounder call returns.
|
|
61
|
+
*
|
|
62
|
+
* A deliberately separate entry point, not a second resolver: the two identity shapes really
|
|
63
|
+
* are different objects at this point in the pipeline. `ElementIdentity` only ever exists
|
|
64
|
+
* inside `playwright-driver.ts`, which restates it *structurally* rather than importing
|
|
65
|
+
* `@descryy/runtime-identity-grounding` (that file's own header explains why — it must stay
|
|
66
|
+
* buildable with no identity-grounding build present). By the time an action's evidence
|
|
67
|
+
* reaches this package's tool layer, all it carries is the already-flattened
|
|
68
|
+
* `ElementComponentIdentity` the port exposes — the same reduction `SnapshotElement.identity`
|
|
69
|
+
* carries. `symbolLocationForGraph`'s own three checks (grounded, authored, file present) are
|
|
70
|
+
* restated here against that narrower shape rather than reused, because there is no
|
|
71
|
+
* `ElementIdentity` value in hand to hand it — `resolveSymbolNode` underneath is the one thing
|
|
72
|
+
* actually reused, which is where the real graph-join logic (ambiguity, line check, path
|
|
73
|
+
* translation) lives. See DEC-NEXT-witnessed-click-is-a-node-ledger-not-an-edge.md.
|
|
74
|
+
*/
|
|
75
|
+
export declare function resolveActionIdentityGraphNode(driver: SqlDriver, identity: ElementComponentIdentity, repo: string, options?: {
|
|
76
|
+
readonly repoRoot?: string;
|
|
77
|
+
readonly cwd?: string;
|
|
78
|
+
}): IdentityGraphOutcome;
|
|
55
79
|
//# sourceMappingURL=identity-graph-write.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-graph-write.d.ts","sourceRoot":"","sources":["../../src/browser/identity-graph-write.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identity-graph-write.d.ts","sourceRoot":"","sources":["../../src/browser/identity-graph-write.ts"],"names":[],"mappings":"AAAA;;;;;;;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;;;;;;;GAgBG;AACH,wBAAgB,8BAA8B,CAC5C,MAAM,EAAE,SAAS,EACjB,QAAQ,EAAE,wBAAwB,EAClC,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE;IAAE,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAA;CAAO,GAClE,oBAAoB,CA0BtB"}
|
|
@@ -7,8 +7,10 @@
|
|
|
7
7
|
* `resolveSymbolNode`'s ambiguity refusal, line-mismatch reporting or path translation — it
|
|
8
8
|
* calls it and restates the outcome in this package's own node shape.
|
|
9
9
|
*
|
|
10
|
-
* No new node type, no new edge type: this resolves to a `FUNCTION`/`CLASS` node an
|
|
11
|
-
* already produced
|
|
10
|
+
* No new node type, no new edge type: this resolves to a `FUNCTION`/`CLASS`/`COMPONENT` node an
|
|
11
|
+
* adapter already produced (`@descryy/runtime-graph-correlator`'s `resolveSymbolNode` accepts
|
|
12
|
+
* `COMPONENT` alongside `FUNCTION`/`CLASS` as of this session). `descry-core`'s frozen 15/15
|
|
13
|
+
* vocabulary is untouched.
|
|
12
14
|
*/
|
|
13
15
|
import { resolveSymbolNode } from "@descryy/runtime-graph-correlator";
|
|
14
16
|
import { symbolLocationForGraph } from "@descryy/runtime-identity-grounding";
|
|
@@ -42,4 +44,44 @@ export function resolveIdentityGraphNode(driver, identity, repo, options = {}) {
|
|
|
42
44
|
function toGraphNode(node) {
|
|
43
45
|
return { nodeId: node.id, name: node.name, type: node.type };
|
|
44
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* The same join, for a `click`/`type`/`fill`/`select`/`submit` action's own `ElementComponentIdentity`
|
|
49
|
+
* (`driver.ts`) rather than the raw `ElementIdentity` a snapshot's grounder call returns.
|
|
50
|
+
*
|
|
51
|
+
* A deliberately separate entry point, not a second resolver: the two identity shapes really
|
|
52
|
+
* are different objects at this point in the pipeline. `ElementIdentity` only ever exists
|
|
53
|
+
* inside `playwright-driver.ts`, which restates it *structurally* rather than importing
|
|
54
|
+
* `@descryy/runtime-identity-grounding` (that file's own header explains why — it must stay
|
|
55
|
+
* buildable with no identity-grounding build present). By the time an action's evidence
|
|
56
|
+
* reaches this package's tool layer, all it carries is the already-flattened
|
|
57
|
+
* `ElementComponentIdentity` the port exposes — the same reduction `SnapshotElement.identity`
|
|
58
|
+
* carries. `symbolLocationForGraph`'s own three checks (grounded, authored, file present) are
|
|
59
|
+
* restated here against that narrower shape rather than reused, because there is no
|
|
60
|
+
* `ElementIdentity` value in hand to hand it — `resolveSymbolNode` underneath is the one thing
|
|
61
|
+
* actually reused, which is where the real graph-join logic (ambiguity, line check, path
|
|
62
|
+
* translation) lives. See DEC-NEXT-witnessed-click-is-a-node-ledger-not-an-edge.md.
|
|
63
|
+
*/
|
|
64
|
+
export function resolveActionIdentityGraphNode(driver, identity, repo, options = {}) {
|
|
65
|
+
if (identity.outcome !== "grounded" || !identity.authoredSource || identity.file === null || identity.component === null) {
|
|
66
|
+
return {
|
|
67
|
+
outcome: "withheld",
|
|
68
|
+
reason: "identity grounding did not produce an authored file, component and symbol for this action's target " +
|
|
69
|
+
"element — see the element's own identity outcome (grounded/component-only/refused) for why.",
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
const location = identity.line === null
|
|
73
|
+
? { file: identity.file, symbolName: identity.component }
|
|
74
|
+
: { file: identity.file, symbolName: identity.component, line: identity.line };
|
|
75
|
+
const resolution = resolveSymbolNode(driver, location, repo, options);
|
|
76
|
+
switch (resolution.outcome) {
|
|
77
|
+
case "resolved":
|
|
78
|
+
return { outcome: "resolved", node: toGraphNode(resolution.node) };
|
|
79
|
+
case "line-mismatch":
|
|
80
|
+
return { outcome: "line-mismatch", node: toGraphNode(resolution.node), reason: resolution.reason };
|
|
81
|
+
case "not-found":
|
|
82
|
+
return { outcome: "not-found", reason: resolution.reason };
|
|
83
|
+
case "ambiguous":
|
|
84
|
+
return { outcome: "ambiguous", reason: resolution.reason };
|
|
85
|
+
}
|
|
86
|
+
}
|
|
45
87
|
//# sourceMappingURL=identity-graph-write.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"identity-graph-write.js","sourceRoot":"","sources":["../../src/browser/identity-graph-write.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"identity-graph-write.js","sourceRoot":"","sources":["../../src/browser/identity-graph-write.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAE,sBAAsB,EAAwB,MAAM,qCAAqC,CAAC;AAwBnG;;;;;GAKG;AACH,MAAM,UAAU,wBAAwB,CACtC,MAAiB,EACjB,QAAyB,EACzB,IAAY,EACZ,UAAiE,EAAE;IAEnE,MAAM,QAAQ,GAAG,sBAAsB,CAAC,QAAQ,CAAC,CAAC;IAClD,IAAI,QAAQ,KAAK,IAAI,EAAE,CAAC;QACtB,OAAO;YACL,OAAO,EAAE,UAAU;YACnB,MAAM,EACJ,4FAA4F;gBAC5F,2EAA2E;SAC9E,CAAC;IACJ,CAAC;IAED,MAAM,UAAU,GAAG,iBAAiB,CAAC,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;IACtE,QAAQ,UAAU,CAAC,OAAO,EAAE,CAAC;QAC3B,KAAK,UAAU;YACb,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACrE,KAAK,eAAe;YAClB,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,IAAI,EAAE,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;QACrG,KAAK,WAAW;YACd,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,UAAU,CAAC,MAAM,EAAE,CAAC;QAC7D,KAAK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AAQ,CAAC,YAAY,EAAE,OAAO,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAAC;CACnC;AAED;;;;4FAI4F;AAC5F,wBAAgB,eAAe,CAAC,EAAE,EAAE,WAAW,GAAG,gBAAgB,CAqOjE;AAuHD,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,GAAG,IAAI,CAAC;IACvC,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AA2CD,wBAAgB,6BAA6B,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAEtE;AAED,wBAAsB,+BAA+B,IAAI,OAAO,CAAC,IAAI,CAAC,CAIrE;AAED,wBAAsB,6BAA6B,CAAC,OAAO,GAAE,uBAA4B,GAAG,OAAO,CAAC,aAAa,CAAC,CA+CjH;AAmxBD,gNAAgN;AAChN,wBAAgB,OAAO,CACrB,OAAO,EAAE,SAAS,eAAe,EAAE,EACnC,OAAO,EAAE,SAAS,cAAc,EAAE,EAClC,SAAS,EAAE,SAAS,eAAe,EAAE,GACpC,kBAAkB,CA+NpB"}
|
|
@@ -16,7 +16,7 @@ var __rewriteRelativeImportExtension = (this && this.__rewriteRelativeImportExte
|
|
|
16
16
|
// backend is installed. Currently blocked on a runtime release: @descryy/mcp pins
|
|
17
17
|
// @descryy/runtime-controller at 0.3.5, which predates preflight.ts.
|
|
18
18
|
import { runPreflight, portAnswersCheck } from "@descryy/runtime-controller";
|
|
19
|
-
import { BrowserSessionCrashedError, NoSuchOptionError, NotOperableError, NotSelectableError, NotSubmittableError, UnknownElementRefError, } from "./driver.js";
|
|
19
|
+
import { BrowserSessionCrashedError, NoActiveRecordingError, NoSuchOptionError, NotOperableError, NotSelectableError, NotSubmittableError, RecordingAlreadyActiveError, UnknownElementRefError, recordedSecretCredentialName, recordedSecretPlaceholder, } from "./driver.js";
|
|
20
20
|
import { clampWaitTimeout, describeWaitTarget, isEmptyWaitTarget, matchesWaitTarget, WAIT_POLL_INTERVAL_MS, } from "./wait-target.js";
|
|
21
21
|
import { PROBE_CONSTANTS, probeInPage } from "./page-probe.js";
|
|
22
22
|
/** The module the driver composes. Named once, imported at call time. */
|
|
@@ -582,6 +582,32 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
582
582
|
* (§B1's `identity: null` distinction — see `driver.ts`). */
|
|
583
583
|
let grounder = null;
|
|
584
584
|
const sessionWarnings = [...launchNotes];
|
|
585
|
+
// Decided once, at open time, from whether the installed runtime exports the collector at
|
|
586
|
+
// all — never from anything about the page, the same discipline the fake driver's own
|
|
587
|
+
// `recordingDisabled` flag follows: a driver either can record or it cannot, and that must
|
|
588
|
+
// not flicker mid-session. `null` is this build's honest "cannot record" — `startRecording`/
|
|
589
|
+
// `stopRecording` are added to `api` below only when this is non-null, and are otherwise
|
|
590
|
+
// simply absent (rule 7).
|
|
591
|
+
const recordingCollector = typeof runtime.createBrowserRecordingCollector === "function" ? runtime.createBrowserRecordingCollector({ session }) : null;
|
|
592
|
+
let recordingActive = false;
|
|
593
|
+
// This session's own running count of secrets redacted so far — ordinal-suffixed even when
|
|
594
|
+
// an element's name would slug cleanly alone, so two distinct password fields recorded in one
|
|
595
|
+
// pass never collide onto the same credential name (`recordedSecretCredentialName`'s own doc).
|
|
596
|
+
let recordingSecretOrdinal = 0;
|
|
597
|
+
/** `RuntimeRecordedInteraction` -> `PerformedStep`, the one place the two vocabularies join —
|
|
598
|
+
* mirrors `mapIdentity` above in spirit. A secret interaction's `text` is never the literal
|
|
599
|
+
* value (the collector never sent one); it becomes this session's next credential placeholder. */
|
|
600
|
+
function mapRecordedInteraction(interaction) {
|
|
601
|
+
const target = interaction.target === null
|
|
602
|
+
? null
|
|
603
|
+
: { role: interaction.target.role, name: interaction.target.name, selector: interaction.target.selector };
|
|
604
|
+
let text = interaction.text;
|
|
605
|
+
if (interaction.secret) {
|
|
606
|
+
recordingSecretOrdinal += 1;
|
|
607
|
+
text = recordedSecretPlaceholder(recordedSecretCredentialName(interaction.target?.name ?? "", recordingSecretOrdinal));
|
|
608
|
+
}
|
|
609
|
+
return { action: interaction.action, target, url: interaction.url, text, at: interaction.at };
|
|
610
|
+
}
|
|
585
611
|
const context = {
|
|
586
612
|
executionId: `mcp-browser-${session.sessionId}`,
|
|
587
613
|
configuration: { environmentTier: "tier-2-container", fidelityLevel: 2, timeoutMs: 30_000, services: {} },
|
|
@@ -641,8 +667,8 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
641
667
|
throw new UnknownElementRefError(ref);
|
|
642
668
|
return found;
|
|
643
669
|
}
|
|
644
|
-
function recordAction(action, ref, mode) {
|
|
645
|
-
actions.push({ action, ref, mode, url: session.page.url(), at: new Date().toISOString() });
|
|
670
|
+
function recordAction(action, ref, mode, identity = null) {
|
|
671
|
+
actions.push({ action, ref, mode, url: session.page.url(), at: new Date().toISOString(), identity });
|
|
646
672
|
}
|
|
647
673
|
function recordPerformed(action, target, url, text) {
|
|
648
674
|
performed.push({ action, target, url, text, at: new Date().toISOString() });
|
|
@@ -1003,7 +1029,7 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
1003
1029
|
assertUsable();
|
|
1004
1030
|
const { element, handle } = resolve(ref);
|
|
1005
1031
|
await handle.click();
|
|
1006
|
-
recordAction("click", ref, null);
|
|
1032
|
+
recordAction("click", ref, null, element.identity);
|
|
1007
1033
|
recordPerformed("click", { role: element.role, name: element.name, selector: element.selector }, null, null);
|
|
1008
1034
|
// requestfinished fires after the page's handler resolves; draining immediately would miss the very request being watched for.
|
|
1009
1035
|
await settleAfterAction("click", ref);
|
|
@@ -1017,7 +1043,7 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
1017
1043
|
await handle.type(text);
|
|
1018
1044
|
else
|
|
1019
1045
|
throw new Error("this Playwright build exposes no keystroke-level typing method");
|
|
1020
|
-
recordAction("type", ref, "append");
|
|
1046
|
+
recordAction("type", ref, "append", element.identity);
|
|
1021
1047
|
recordPerformed("type", { role: element.role, name: element.name, selector: element.selector }, null, text);
|
|
1022
1048
|
await settleAfterAction("type", ref);
|
|
1023
1049
|
},
|
|
@@ -1025,7 +1051,7 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
1025
1051
|
assertUsable();
|
|
1026
1052
|
const { element, handle } = resolve(ref);
|
|
1027
1053
|
await handle.fill(text);
|
|
1028
|
-
recordAction("fill", ref, "replace");
|
|
1054
|
+
recordAction("fill", ref, "replace", element.identity);
|
|
1029
1055
|
recordPerformed("fill", { role: element.role, name: element.name, selector: element.selector }, null, text);
|
|
1030
1056
|
await settleAfterAction("fill", ref);
|
|
1031
1057
|
},
|
|
@@ -1059,7 +1085,7 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
1059
1085
|
if (handle.selectOption === undefined)
|
|
1060
1086
|
throw new Error("this Playwright build exposes no option-selecting method");
|
|
1061
1087
|
await handle.selectOption(matched.value);
|
|
1062
|
-
recordAction("select", ref, "replace");
|
|
1088
|
+
recordAction("select", ref, "replace", element.identity);
|
|
1063
1089
|
recordPerformed("select", { role: element.role, name: element.name, selector: element.selector }, null, matched.value);
|
|
1064
1090
|
await settleAfterAction("select", ref);
|
|
1065
1091
|
},
|
|
@@ -1083,7 +1109,7 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
1083
1109
|
});
|
|
1084
1110
|
if (outcome !== "submitted")
|
|
1085
1111
|
throw new NotSubmittableError(ref, outcome);
|
|
1086
|
-
recordAction("submit", ref, null);
|
|
1112
|
+
recordAction("submit", ref, null, element.identity);
|
|
1087
1113
|
recordPerformed("submit", { role: element.role, name: element.name, selector: element.selector }, null, null);
|
|
1088
1114
|
await settleAfterAction("submit", ref);
|
|
1089
1115
|
},
|
|
@@ -1143,6 +1169,35 @@ async function openSession(runtime, session, launchOptions, options, launchNotes
|
|
|
1143
1169
|
return [...performed];
|
|
1144
1170
|
},
|
|
1145
1171
|
storageStateSaveFailure: () => storageStateSaveError,
|
|
1172
|
+
// `startRecording`/`stopRecording` (driver.ts) land here as real methods only when the
|
|
1173
|
+
// installed `@descryy/runtime-browser` exports the collector (`recordingCollector !== null`,
|
|
1174
|
+
// decided once above, at open time). Otherwise the two members are genuinely absent, never
|
|
1175
|
+
// present with a body that silently captures nothing (rule 7): `record_start` reads the
|
|
1176
|
+
// absence and refuses by name. See
|
|
1177
|
+
// `documents/decisions-inbox/DEC-NEXT-browser-recording-primitive.md` for the cross-repo
|
|
1178
|
+
// history and what `@descryy/runtime-browser` had to add for this to light up.
|
|
1179
|
+
...(recordingCollector === null
|
|
1180
|
+
? {}
|
|
1181
|
+
: {
|
|
1182
|
+
async startRecording() {
|
|
1183
|
+
assertUsable();
|
|
1184
|
+
if (recordingActive)
|
|
1185
|
+
throw new RecordingAlreadyActiveError(session.sessionId);
|
|
1186
|
+
await recordingCollector.start();
|
|
1187
|
+
recordingActive = true;
|
|
1188
|
+
},
|
|
1189
|
+
async stopRecording() {
|
|
1190
|
+
assertUsable();
|
|
1191
|
+
if (!recordingActive)
|
|
1192
|
+
throw new NoActiveRecordingError(session.sessionId);
|
|
1193
|
+
recordingActive = false;
|
|
1194
|
+
const interactions = await recordingCollector.stop();
|
|
1195
|
+
const steps = interactions.map(mapRecordedInteraction);
|
|
1196
|
+
for (const step of steps)
|
|
1197
|
+
performed.push(step);
|
|
1198
|
+
return steps;
|
|
1199
|
+
},
|
|
1200
|
+
}),
|
|
1146
1201
|
/**
|
|
1147
1202
|
* §4.2's probe. Reads the page and counts; decides nothing — `estimateReach`
|
|
1148
1203
|
* is the only thing that turns these counts into a claim, so a change of
|