@descryy/mcp 0.9.0 → 0.11.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/browser/auth.d.ts +76 -0
- package/dist/browser/auth.d.ts.map +1 -0
- package/dist/browser/auth.js +223 -0
- package/dist/browser/auth.js.map +1 -0
- package/dist/browser/capability-probe.d.ts +109 -0
- package/dist/browser/capability-probe.d.ts.map +1 -0
- package/dist/browser/capability-probe.js +201 -0
- package/dist/browser/capability-probe.js.map +1 -0
- package/dist/browser/driver.d.ts +342 -4
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +79 -1
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +3 -0
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +6 -1
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +65 -8
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +235 -8
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/fault-attribution.d.ts +178 -0
- package/dist/browser/fault-attribution.d.ts.map +1 -0
- package/dist/browser/fault-attribution.js +266 -0
- package/dist/browser/fault-attribution.js.map +1 -0
- package/dist/browser/identity-graph-write.d.ts +55 -0
- package/dist/browser/identity-graph-write.d.ts.map +1 -0
- package/dist/browser/identity-graph-write.js +45 -0
- package/dist/browser/identity-graph-write.js.map +1 -0
- package/dist/browser/page-probe.d.ts +81 -0
- package/dist/browser/page-probe.d.ts.map +1 -0
- package/dist/browser/page-probe.js +202 -0
- package/dist/browser/page-probe.js.map +1 -0
- package/dist/browser/playwright-driver.d.ts +79 -0
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +1138 -180
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/reach-recording-session.d.ts +44 -0
- package/dist/browser/reach-recording-session.d.ts.map +1 -0
- package/dist/browser/reach-recording-session.js +143 -0
- package/dist/browser/reach-recording-session.js.map +1 -0
- package/dist/browser/reachability.d.ts +168 -0
- package/dist/browser/reachability.d.ts.map +1 -0
- package/dist/browser/reachability.js +294 -0
- package/dist/browser/reachability.js.map +1 -0
- package/dist/browser/registry.d.ts +24 -0
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +21 -2
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-provenance.d.ts +1 -1
- package/dist/browser/scenario-provenance.d.ts.map +1 -1
- package/dist/browser/scenario-provenance.js +15 -1
- package/dist/browser/scenario-provenance.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +10 -2
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +77 -9
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/tool-support.d.ts +5 -1
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +80 -4
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/browser/wait-target.d.ts +37 -0
- package/dist/browser/wait-target.d.ts.map +1 -0
- package/dist/browser/wait-target.js +54 -0
- package/dist/browser/wait-target.js.map +1 -0
- package/dist/heap.d.ts +61 -0
- package/dist/heap.d.ts.map +1 -0
- package/dist/heap.js +82 -0
- package/dist/heap.js.map +1 -0
- package/dist/heartbeat.d.ts +46 -0
- package/dist/heartbeat.d.ts.map +1 -0
- package/dist/heartbeat.js +66 -0
- package/dist/heartbeat.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/planner/predict-then-propose.d.ts +101 -0
- package/dist/planner/predict-then-propose.d.ts.map +1 -0
- package/dist/planner/predict-then-propose.js +88 -0
- package/dist/planner/predict-then-propose.js.map +1 -0
- package/dist/planner/propose-journey.d.ts +60 -0
- package/dist/planner/propose-journey.d.ts.map +1 -0
- package/dist/planner/propose-journey.js +96 -0
- package/dist/planner/propose-journey.js.map +1 -0
- package/dist/registry.d.ts +10 -1
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +5 -1
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +4 -4
- package/dist/render.js +3 -3
- package/dist/scenarios/browser-run-plan-projection.d.ts +143 -0
- package/dist/scenarios/browser-run-plan-projection.d.ts.map +1 -0
- package/dist/scenarios/browser-run-plan-projection.js +228 -0
- package/dist/scenarios/browser-run-plan-projection.js.map +1 -0
- package/dist/scenarios/credential-ref.d.ts +102 -0
- package/dist/scenarios/credential-ref.d.ts.map +1 -0
- package/dist/scenarios/credential-ref.js +148 -0
- package/dist/scenarios/credential-ref.js.map +1 -0
- package/dist/scenarios/index.d.ts +4 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +4 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +42 -9
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +39 -5
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +15 -2
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/secret-ref.d.ts +86 -0
- package/dist/scenarios/secret-ref.d.ts.map +1 -0
- package/dist/scenarios/secret-ref.js +125 -0
- package/dist/scenarios/secret-ref.js.map +1 -0
- package/dist/server.d.ts +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +8 -4
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +19 -0
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +36 -0
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze-workspace.d.ts +52 -0
- package/dist/tools/analyze-workspace.d.ts.map +1 -0
- package/dist/tools/analyze-workspace.js +207 -0
- package/dist/tools/analyze-workspace.js.map +1 -0
- package/dist/tools/analyze.d.ts +50 -4
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +225 -5
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +21 -1
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +71 -7
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +1 -1
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +5 -3
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +6 -1
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +84 -4
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-select.d.ts +20 -0
- package/dist/tools/browser-select.d.ts.map +1 -0
- package/dist/tools/browser-select.js +120 -0
- package/dist/tools/browser-select.js.map +1 -0
- package/dist/tools/browser-snapshot.d.ts +17 -1
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +18 -5
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +161 -9
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-submit.d.ts +18 -0
- package/dist/tools/browser-submit.d.ts.map +1 -0
- package/dist/tools/browser-submit.js +106 -0
- package/dist/tools/browser-submit.js.map +1 -0
- package/dist/tools/browser-wait-for.d.ts +41 -0
- package/dist/tools/browser-wait-for.d.ts.map +1 -0
- package/dist/tools/browser-wait-for.js +148 -0
- package/dist/tools/browser-wait-for.js.map +1 -0
- package/dist/tools/chain.d.ts +41 -0
- package/dist/tools/chain.d.ts.map +1 -0
- package/dist/tools/chain.js +105 -0
- package/dist/tools/chain.js.map +1 -0
- package/dist/tools/draw-conclusion.d.ts +44 -0
- package/dist/tools/draw-conclusion.d.ts.map +1 -0
- package/dist/tools/draw-conclusion.js +250 -0
- package/dist/tools/draw-conclusion.js.map +1 -0
- package/dist/tools/index.d.ts +7 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +16 -0
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +17 -0
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +17 -0
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +174 -10
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/predict-reach.d.ts +57 -0
- package/dist/tools/predict-reach.d.ts.map +1 -0
- package/dist/tools/predict-reach.js +159 -0
- package/dist/tools/predict-reach.js.map +1 -0
- package/dist/tools/propagation.d.ts +8 -3
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +16 -9
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/propose-journey.d.ts +16 -0
- package/dist/tools/propose-journey.d.ts.map +1 -0
- package/dist/tools/propose-journey.js +121 -0
- package/dist/tools/propose-journey.js.map +1 -0
- package/dist/tools/runtime-journey-drive.d.ts +102 -0
- package/dist/tools/runtime-journey-drive.d.ts.map +1 -0
- package/dist/tools/runtime-journey-drive.js +247 -0
- package/dist/tools/runtime-journey-drive.js.map +1 -0
- package/dist/tools/scope.d.ts +3 -0
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +33 -6
- package/dist/tools/scope.js.map +1 -1
- package/dist/workspace-index.d.ts +164 -0
- package/dist/workspace-index.d.ts.map +1 -0
- package/dist/workspace-index.js +381 -0
- package/dist/workspace-index.js.map +1 -0
- package/package.json +33 -32
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `predict_reach` — RG-10's predict-then-propose, exposed. Given a node
|
|
3
|
+
* (typically a `DATABASE_COLUMN` a change touches, but any node
|
|
4
|
+
* `reachablePages` can walk from), asks the graph which `PAGE`/`COMPONENT`
|
|
5
|
+
* nodes the data can reach — `@descryy/core`'s `reachablePages`, a walk
|
|
6
|
+
* over `PROPAGATES_TO`/`READS`/`ASSIGNS`/`RETURNS`, crossing `USES_API`
|
|
7
|
+
* backward at an `API_ENDPOINT` — and, when it reaches at least one page,
|
|
8
|
+
* proposes a navigate-only journey via the same planner `propose_journey`
|
|
9
|
+
* uses (`../planner/propose-journey.ts`, unmodified, called through
|
|
10
|
+
* `../planner/predict-then-propose.ts`).
|
|
11
|
+
*
|
|
12
|
+
* **Never drives anything and never writes to a Finding.** The proposal
|
|
13
|
+
* this returns is a value in this reply, not an action: proving or
|
|
14
|
+
* disproving what it predicts is a human (or an agent acting on a human's
|
|
15
|
+
* behalf) driving the application for real — `browser_start_session`, the
|
|
16
|
+
* browser primitives, `browser_save_scenario` to commit what actually
|
|
17
|
+
* happened — and then recording the outcome against the finding that
|
|
18
|
+
* predicted it. That last step needs `packages/ir/src/finding.ts` and the
|
|
19
|
+
* finding funnel, both outside this lane's owned files, and is not
|
|
20
|
+
* performed here; see this tool's own `description` for the same
|
|
21
|
+
* disclosure surfaced to a caller.
|
|
22
|
+
*
|
|
23
|
+
* **`observedNodeIds` — RG-10's join, added by the pipeline-joins lane.**
|
|
24
|
+
* Optional, and still never a drive: when a caller supplies the graph node
|
|
25
|
+
* ids a REAL, already-accepted journey actually reached (read straight off
|
|
26
|
+
* `browser_run_scenario`'s own reply after that scenario was driven — the
|
|
27
|
+
* acceptance gate is `browser_run_scenario`'s own, unchanged and untouched
|
|
28
|
+
* here), this tool additionally reports which predicted pages that real
|
|
29
|
+
* drive proved and which it disproved
|
|
30
|
+
* (`../planner/predict-then-propose.ts#proveOrDisprove`). Omitted (the
|
|
31
|
+
* default), the reply is byte-for-byte what it was before this parameter
|
|
32
|
+
* existed.
|
|
33
|
+
*/
|
|
34
|
+
import { predictThenPropose, proveOrDisprove } from "../planner/predict-then-propose.js";
|
|
35
|
+
import { answer, briefNode, requiredString, optionalString, optionalStringArray, ToolInputError, } from "./kit.js";
|
|
36
|
+
import { resolveOneNode } from "./lookup.js";
|
|
37
|
+
const SCHEMA = {
|
|
38
|
+
type: "object",
|
|
39
|
+
properties: {
|
|
40
|
+
nodeId: { type: "string", description: "Graph node id to predict reach from — typically a DATABASE_COLUMN." },
|
|
41
|
+
symbol: {
|
|
42
|
+
type: "string",
|
|
43
|
+
description: "Symbol name to start from, when you do not have a node id. Ambiguity is reported rather than guessed at — narrow it with \"file\".",
|
|
44
|
+
},
|
|
45
|
+
file: { type: "string", description: "Repository-relative path, to disambiguate \"symbol\" or to start from a file." },
|
|
46
|
+
targetUrl: {
|
|
47
|
+
type: "string",
|
|
48
|
+
description: "REQUIRED. The running application's base URL, exactly as propose_journey takes it. Never inferred " +
|
|
49
|
+
"— the graph has no notion of where an application is currently serving.",
|
|
50
|
+
},
|
|
51
|
+
name: { type: "string", description: "What to call the proposed scenario if it is accepted. Defaults to \"predicted-journey\"." },
|
|
52
|
+
observedNodeIds: {
|
|
53
|
+
type: "array",
|
|
54
|
+
items: { type: "string" },
|
|
55
|
+
description: "Optional. Graph node ids a REAL, already-driven, already-accepted journey actually reached — e.g. " +
|
|
56
|
+
"read off browser_run_scenario's own reply after driving the accepted scenario for real. When given, " +
|
|
57
|
+
"this call additionally reports which predicted pages that real drive proved and which it disproved. " +
|
|
58
|
+
"This tool still never drives anything itself: supplying this argument only compares evidence you " +
|
|
59
|
+
"already collected against what was predicted.",
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
required: ["targetUrl"],
|
|
63
|
+
additionalProperties: false,
|
|
64
|
+
};
|
|
65
|
+
async function run(args, ctx) {
|
|
66
|
+
const nodeIdArg = optionalString(args, "nodeId");
|
|
67
|
+
const symbol = optionalString(args, "symbol");
|
|
68
|
+
const file = optionalString(args, "file");
|
|
69
|
+
const targetUrl = requiredString(args, "targetUrl");
|
|
70
|
+
const name = optionalString(args, "name") ?? "predicted-journey";
|
|
71
|
+
const observedNodeIds = optionalStringArray(args, "observedNodeIds");
|
|
72
|
+
if (nodeIdArg === undefined && symbol === undefined && file === undefined) {
|
|
73
|
+
throw new ToolInputError('give one of "nodeId", "symbol" or "file"');
|
|
74
|
+
}
|
|
75
|
+
const provider = ctx.session.provider();
|
|
76
|
+
const found = resolveOneNode(ctx.session, { nodeId: nodeIdArg, symbol, file });
|
|
77
|
+
const base = provider.baseStamp();
|
|
78
|
+
if (found.node === null) {
|
|
79
|
+
return {
|
|
80
|
+
result: {
|
|
81
|
+
data: { candidates: found.candidates.map(briefNode) },
|
|
82
|
+
stamp: { ...base, resolutionFloor: 0 },
|
|
83
|
+
truncated: false,
|
|
84
|
+
notes: found.notes,
|
|
85
|
+
},
|
|
86
|
+
nameLevel: true,
|
|
87
|
+
state: "refused",
|
|
88
|
+
headline: found.headline,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
ctx.progress(`Predicting which pages ${found.node.name} can reach`);
|
|
92
|
+
const predicted = predictThenPropose(provider, found.node.id, {
|
|
93
|
+
targetUrl,
|
|
94
|
+
name,
|
|
95
|
+
savedAtCommit: base.commitSha ?? "",
|
|
96
|
+
});
|
|
97
|
+
const empty = { from: briefNode(found.node), reachedPages: [], proposal: null, proof: null };
|
|
98
|
+
const notes = [...found.notes, ...predicted.notes];
|
|
99
|
+
if (predicted.proposal === null) {
|
|
100
|
+
return answer({
|
|
101
|
+
headline: `${found.node.name} reaches no PAGE or COMPONENT this graph can walk to. Not a claim it reaches none in the running application — see notes.`,
|
|
102
|
+
state: "empty",
|
|
103
|
+
nameLevel: true,
|
|
104
|
+
resolutionFloor: 0,
|
|
105
|
+
commitSha: base.commitSha,
|
|
106
|
+
graphBuiltAt: base.graphBuiltAt,
|
|
107
|
+
irSchemaVersion: base.irSchemaVersion,
|
|
108
|
+
commitSpread: base.commitSpread,
|
|
109
|
+
repoCount: base.repoCount,
|
|
110
|
+
notes,
|
|
111
|
+
data: empty,
|
|
112
|
+
});
|
|
113
|
+
}
|
|
114
|
+
const proof = observedNodeIds === undefined ? null : proveOrDisprove(predicted, { visitedNodeIds: observedNodeIds });
|
|
115
|
+
return answer({
|
|
116
|
+
headline: `Predicted ${predicted.reachedPages.length} page/component reached from ${found.node.name}. Proposed ` +
|
|
117
|
+
`${predicted.proposal.scenario.steps.length} navigate step(s) — unaccepted, unsaved, undriven. Proving or ` +
|
|
118
|
+
"disproving this prediction is a human act: drive the app for real and save what happened." +
|
|
119
|
+
(proof === null
|
|
120
|
+
? ""
|
|
121
|
+
: ` Against the observed evidence supplied: ${proof.proven.length} proven, ${proof.disproven.length} disproven.`),
|
|
122
|
+
// Name-level throughout: a route path is read off a node's qualified name (propose_journey's own cap),
|
|
123
|
+
// never off a type-checked shape.
|
|
124
|
+
resolutionFloor: 0,
|
|
125
|
+
nameLevel: true,
|
|
126
|
+
commitSha: base.commitSha,
|
|
127
|
+
graphBuiltAt: base.graphBuiltAt,
|
|
128
|
+
irSchemaVersion: base.irSchemaVersion,
|
|
129
|
+
commitSpread: base.commitSpread,
|
|
130
|
+
repoCount: base.repoCount,
|
|
131
|
+
notes,
|
|
132
|
+
data: {
|
|
133
|
+
from: briefNode(found.node),
|
|
134
|
+
reachedPages: predicted.reachedPages.map((n) => ({ id: n.id, type: n.type, name: n.name, resolution: 0 })),
|
|
135
|
+
proposal: { scenario: predicted.proposal.scenario, reachedNotProposed: predicted.proposal.reachedNotProposed },
|
|
136
|
+
proof,
|
|
137
|
+
},
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
export const predictReachTool = {
|
|
141
|
+
name: "predict_reach",
|
|
142
|
+
class: "read",
|
|
143
|
+
tier: "evidence",
|
|
144
|
+
version: "1.0.0",
|
|
145
|
+
title: "Predict which pages a data change reaches, and propose a journey to review it",
|
|
146
|
+
description: "RG-10: given a node — typically a DATABASE_COLUMN — walks PROPAGATES_TO/READS/ASSIGNS/RETURNS, crossing " +
|
|
147
|
+
"USES_API backward at an API_ENDPOINT, to whatever PAGE/COMPONENT nodes the data can reach (the existing " +
|
|
148
|
+
"reachablePages traversal), and proposes a navigate-only journey to them via the same planner " +
|
|
149
|
+
"propose_journey uses. This tool never drives a browser and never writes to a Finding: the proposal is a " +
|
|
150
|
+
"value in this reply, not an action. Proving or disproving the prediction is a human (or an agent acting " +
|
|
151
|
+
"on a human's behalf) driving the application for real and saving what happened with " +
|
|
152
|
+
"browser_save_scenario. Once that real drive has happened, pass its evidence back in as " +
|
|
153
|
+
"observedNodeIds and this same call reports which predicted pages it proved and which it disproved — " +
|
|
154
|
+
"still never driving anything itself. Recording that outcome against the finding that predicted it is a " +
|
|
155
|
+
"further step this tool does not take.",
|
|
156
|
+
inputSchema: SCHEMA,
|
|
157
|
+
run,
|
|
158
|
+
};
|
|
159
|
+
//# sourceMappingURL=predict-reach.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"predict-reach.js","sourceRoot":"","sources":["../../src/tools/predict-reach.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AAEH,OAAO,EAAE,kBAAkB,EAAE,eAAe,EAAoB,MAAM,oCAAoC,CAAC;AAG3G,OAAO,EACL,MAAM,EACN,SAAS,EACT,cAAc,EACd,cAAc,EACd,mBAAmB,EACnB,cAAc,GAKf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAsB7C,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,oEAAoE,EAAE;QAC7G,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oIAAoI;SAClJ;QACD,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,+EAA+E,EAAE;QACtH,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,oGAAoG;gBACpG,yEAA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AAI,EAAE,UAAU,EAAE,CAAC,EAAE,CAAC,CAAC;YAC1G,QAAQ,EAAE,EAAE,QAAQ,EAAE,SAAS,CAAC,QAAQ,CAAC,QAAQ,EAAE,kBAAkB,EAAE,SAAS,CAAC,QAAQ,CAAC,kBAAkB,EAAE;YAC9G,KAAK;SACN;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAmB;IAC9C,IAAI,EAAE,eAAe;IACrB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,+EAA+E;IACtF,WAAW,EACT,0GAA0G;QAC1G,0GAA0G;QAC1G,+FAA+F;QAC/F,0GAA0G;QAC1G,0GAA0G;QAC1G,sFAAsF;QACtF,yFAAyF;QACzF,sGAAsG;QACtG,yGAAyG;QACzG,uCAAuC;IACzC,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `propagation` — §11.9 data-flow query. Field-level answers require R3 (§11A.6:
|
|
3
3
|
* shapes need a type checker); below R3, path-level only, labelled as such.
|
|
4
|
-
* `PROPAGATES_TO` has
|
|
5
|
-
*
|
|
4
|
+
* `PROPAGATES_TO` now has one narrow producer (`adapter-typescript`'s
|
|
5
|
+
* `extractPropagatesTo`, `descry-adapters`) — single call-argument, no
|
|
6
|
+
* cross-function chasing, by its own doc comment. Multi-hop/interprocedural
|
|
7
|
+
* data-flow chasing does not exist in any adapter yet. An empty walk is still
|
|
8
|
+
* attributed (edge types actually present near the node), never reported as
|
|
9
|
+
* "reaches 0 nodes", since most graphs still have nothing on this edge type. */
|
|
6
10
|
import { type BriefNode, type NodeCandidates, type ToolDefinition } from "./kit.ts";
|
|
7
11
|
/** A node the data can reach, with how far along the walk it sits. */
|
|
8
12
|
export interface ReachedNode extends BriefNode {
|
|
@@ -19,7 +23,8 @@ export interface PropagationReport {
|
|
|
19
23
|
readonly fieldLevel: boolean;
|
|
20
24
|
/** False when no edge of any walked type touches the start node. Empty `reached`
|
|
21
25
|
* with `analysed: false` means the walk didn't run, not that nothing propagates —
|
|
22
|
-
* the common case, since `PROPAGATES_TO` has
|
|
26
|
+
* the common case, since `PROPAGATES_TO` has only one narrow single-hop producer
|
|
27
|
+
* (`adapter-typescript`) and most graphs still carry none of it. */
|
|
23
28
|
readonly analysed: boolean;
|
|
24
29
|
readonly edgeTypesWalked: readonly string[];
|
|
25
30
|
/** The subset of `edgeTypesWalked` actually found on an edge touching this node. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.d.ts","sourceRoot":"","sources":["../../src/tools/propagation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"propagation.d.ts","sourceRoot":"","sources":["../../src/tools/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;gFAQgF;AAIhF,OAAO,EAOL,KAAK,SAAS,EACd,KAAK,cAAc,EAEnB,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAGlB,sEAAsE;AACtE,MAAM,WAAW,WAAY,SAAQ,SAAS;IAC5C,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,IAAI,EAAE,SAAS,CAAC;IACzB,+DAA+D;IAC/D,QAAQ,CAAC,OAAO,EAAE,SAAS,WAAW,EAAE,CAAC;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;uEACmE;IACnE,QAAQ,CAAC,UAAU,EAAE,OAAO,CAAC;IAC7B;;;yEAGqE;IACrE,QAAQ,CAAC,QAAQ,EAAE,OAAO,CAAC;IAC3B,QAAQ,CAAC,eAAe,EAAE,SAAS,MAAM,EAAE,CAAC;IAC5C,oFAAoF;IACpF,QAAQ,CAAC,gBAAgB,EAAE,SAAS,MAAM,EAAE,CAAC;CAC9C;AAED;6EAC6E;AAC7E,MAAM,MAAM,eAAe,GAAG,iBAAiB,GAAG,cAAc,CAAC;AAgKjE,eAAO,MAAM,eAAe,EAAE,cAY7B,CAAC"}
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* `propagation` — §11.9 data-flow query. Field-level answers require R3 (§11A.6:
|
|
3
3
|
* shapes need a type checker); below R3, path-level only, labelled as such.
|
|
4
|
-
* `PROPAGATES_TO` has
|
|
5
|
-
*
|
|
4
|
+
* `PROPAGATES_TO` now has one narrow producer (`adapter-typescript`'s
|
|
5
|
+
* `extractPropagatesTo`, `descry-adapters`) — single call-argument, no
|
|
6
|
+
* cross-function chasing, by its own doc comment. Multi-hop/interprocedural
|
|
7
|
+
* data-flow chasing does not exist in any adapter yet. An empty walk is still
|
|
8
|
+
* attributed (edge types actually present near the node), never reported as
|
|
9
|
+
* "reaches 0 nodes", since most graphs still have nothing on this edge type. */
|
|
6
10
|
import { dataFlowFrom, DATA_FLOW_EDGE_TYPES } from "@descryy/core";
|
|
7
11
|
import { answer, briefNode, optionalInteger, optionalString, optionalStringArray, ToolInputError, } from "./kit.js";
|
|
8
12
|
import { resolveOneNode } from "./lookup.js";
|
|
@@ -23,9 +27,11 @@ const SCHEMA = {
|
|
|
23
27
|
type: "array",
|
|
24
28
|
items: { type: "string" },
|
|
25
29
|
description: "Restrict the walk. Defaults to PROPAGATES_TO, READS, ASSIGNS and RETURNS — the four that " +
|
|
26
|
-
"carry data rather than control.
|
|
27
|
-
"
|
|
28
|
-
"
|
|
30
|
+
"carry data rather than control. Only one shipped adapter produces PROPAGATES_TO today, and " +
|
|
31
|
+
"only narrowly (single call-argument, no cross-function chasing); no adapter does " +
|
|
32
|
+
"multi-hop/interprocedural data-flow chasing yet, so in most repos this walk still runs " +
|
|
33
|
+
"over the other three; an empty result is disclosed as such rather than reported as " +
|
|
34
|
+
"\"reaches 0 nodes\".",
|
|
29
35
|
},
|
|
30
36
|
maxDepth: { type: "integer", minimum: 1, description: "Hop limit. Default unbounded." },
|
|
31
37
|
limit: {
|
|
@@ -97,10 +103,11 @@ async function run(args, ctx) {
|
|
|
97
103
|
if (!analysed) {
|
|
98
104
|
notes.push(`None of the requested edge types (${walked.join(", ")}) appear on any edge touching this node, ` +
|
|
99
105
|
"so the walk had nothing to follow. That is not a finding that no data leaves this symbol: " +
|
|
100
|
-
"no
|
|
101
|
-
"
|
|
102
|
-
"
|
|
103
|
-
"
|
|
106
|
+
"no adapter configured here emitting these edge types at all (PROPAGATES_TO's only shipped " +
|
|
107
|
+
"producer today is narrow single-hop and may simply not have fired here), a " +
|
|
108
|
+
"graph built without the source that would carry them, and a symbol that genuinely " +
|
|
109
|
+
"propagates nothing are three different situations. This probe is local to one node and " +
|
|
110
|
+
"cannot tell them apart — it reports that the walk did not run rather than choosing between them.");
|
|
104
111
|
}
|
|
105
112
|
const fieldLevel = flow.stamp.resolutionFloor >= 3;
|
|
106
113
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../src/tools/propagation.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"propagation.js","sourceRoot":"","sources":["../../src/tools/propagation.ts"],"names":[],"mappings":"AAAA;;;;;;;;gFAQgF;AAEhF,OAAO,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC;AAEnE,OAAO,EACL,MAAM,EACN,SAAS,EACT,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,cAAc,GAKf,MAAM,UAAU,CAAC;AA8BlB,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,8BAA8B,EAAE;QACvE,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,W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AE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,SAAkB,EAAE,CAAC;QACzG,6EAA6E;QAC7E,4EAA4E;QAC5E,4EAA4E;QAC5E,SAAS,EAAE,KAAK;QAChB,6EAA6E;QAC7E,gFAAgF;QAChF,4DAA4D;QAC5D,QAAQ,EAAE,CAAC,QAAQ;YACjB,CAAC,CAAC,oBAAoB,KAAK,CAAC,IAAI,CAAC,IAAI,wCAAwC;gBAC3E,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,mEAAmE;YACxF,CAAC,CAAC,UAAU;gBACV,CAAC,CAAC,aAAa,KAAK,CAAC,IAAI,CAAC,IAAI,YAAY,OAAO,CAAC,MAAM,2BAA2B;gBACnF,CAAC,CAAC,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,cAAc,OAAO,CAAC,MAAM,2CAA2C;oBACzF,gDAAgD;KACvD,CAAC;AACJ,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,IAAI,EAAE,aAAa;IACnB,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,8BAA8B;IACrC,WAAW,EACT,2FAA2F;QAC3F,2FAA2F;QAC3F,0CAA0C;IAC5C,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `propose_journey` — the planner, exposed. Lane A1, item 5: proposes a
|
|
3
|
+
* journey from the `PAGE`/`COMPONENT` nodes a diff scope touches; never
|
|
4
|
+
* writes, never drives a browser, never executes anything. See
|
|
5
|
+
* `../planner/propose-journey.ts` for what "propose, never invent" means
|
|
6
|
+
* structurally.
|
|
7
|
+
*/
|
|
8
|
+
import { type JourneyCandidateNode } from "../planner/propose-journey.ts";
|
|
9
|
+
import { type Scenario } from "../scenarios/index.ts";
|
|
10
|
+
import { type ToolDefinition } from "./kit.ts";
|
|
11
|
+
export interface ProposeJourneyData {
|
|
12
|
+
readonly scenario: Scenario;
|
|
13
|
+
readonly reachedNotProposed: readonly JourneyCandidateNode[];
|
|
14
|
+
}
|
|
15
|
+
export declare const proposeJourneyTool: ToolDefinition;
|
|
16
|
+
//# sourceMappingURL=propose-journey.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-journey.d.ts","sourceRoot":"","sources":["../../src/tools/propose-journey.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,OAAO,EAAkB,KAAK,oBAAoB,EAAE,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAA2B,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAML,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAIlB,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC;IAC5B,QAAQ,CAAC,kBAAkB,EAAE,SAAS,oBAAoB,EAAE,CAAC;CAC9D;AA0GD,eAAO,MAAM,kBAAkB,EAAE,cAchC,CAAC"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `propose_journey` — the planner, exposed. Lane A1, item 5: proposes a
|
|
3
|
+
* journey from the `PAGE`/`COMPONENT` nodes a diff scope touches; never
|
|
4
|
+
* writes, never drives a browser, never executes anything. See
|
|
5
|
+
* `../planner/propose-journey.ts` for what "propose, never invent" means
|
|
6
|
+
* structurally.
|
|
7
|
+
*/
|
|
8
|
+
import { nodesInFiles, scopeChange } from "@descryy/core";
|
|
9
|
+
import { proposeJourney } from "../planner/propose-journey.js";
|
|
10
|
+
import { SCENARIO_SCHEMA_VERSION } from "../scenarios/index.js";
|
|
11
|
+
import { optionalString, optionalStringArray, requiredString, ToolInputError, } from "./kit.js";
|
|
12
|
+
import { answer } from "./kit.js";
|
|
13
|
+
const SCHEMA = {
|
|
14
|
+
type: "object",
|
|
15
|
+
properties: {
|
|
16
|
+
files: {
|
|
17
|
+
type: "array",
|
|
18
|
+
items: { type: "string" },
|
|
19
|
+
description: "Repository-relative paths that are changing. Same seeding as the scope tool.",
|
|
20
|
+
},
|
|
21
|
+
nodeIds: {
|
|
22
|
+
type: "array",
|
|
23
|
+
items: { type: "string" },
|
|
24
|
+
description: "Graph node ids to seed with directly, instead of or as well as files.",
|
|
25
|
+
},
|
|
26
|
+
targetUrl: {
|
|
27
|
+
type: "string",
|
|
28
|
+
description: "REQUIRED. The running application's base URL — the same address a run's browser opens. Never " +
|
|
29
|
+
"inferred: the graph has no notion of where an application is currently serving, and guessing one " +
|
|
30
|
+
"would produce a proposal that opens someone else's server.",
|
|
31
|
+
},
|
|
32
|
+
name: {
|
|
33
|
+
type: "string",
|
|
34
|
+
description: "What to call the proposed scenario if it is accepted. Defaults to \"proposed-journey\".",
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
required: ["targetUrl"],
|
|
38
|
+
additionalProperties: false,
|
|
39
|
+
};
|
|
40
|
+
async function run(args, ctx) {
|
|
41
|
+
const targetUrl = requiredString(args, "targetUrl");
|
|
42
|
+
const name = optionalString(args, "name") ?? "proposed-journey";
|
|
43
|
+
const files = optionalStringArray(args, "files") ?? [];
|
|
44
|
+
const seedIds = [...(optionalStringArray(args, "nodeIds") ?? [])];
|
|
45
|
+
if (files.length === 0 && seedIds.length === 0) {
|
|
46
|
+
throw new ToolInputError('give at least one of "files" or "nodeIds" — the planner proposes from a diff scope, and a diff scope needs a seed');
|
|
47
|
+
}
|
|
48
|
+
const session = ctx.session;
|
|
49
|
+
if (files.length > 0) {
|
|
50
|
+
const { nodes } = nodesInFiles(session.store().driver, files);
|
|
51
|
+
for (const node of nodes)
|
|
52
|
+
seedIds.push(node.id);
|
|
53
|
+
}
|
|
54
|
+
const base = session.provider().baseStamp();
|
|
55
|
+
const empty = {
|
|
56
|
+
scenario: {
|
|
57
|
+
schemaVersion: SCENARIO_SCHEMA_VERSION,
|
|
58
|
+
name,
|
|
59
|
+
description: null,
|
|
60
|
+
targetUrl,
|
|
61
|
+
savedAt: new Date().toISOString(),
|
|
62
|
+
savedAtCommit: "",
|
|
63
|
+
steps: [],
|
|
64
|
+
assertions: [],
|
|
65
|
+
},
|
|
66
|
+
reachedNotProposed: [],
|
|
67
|
+
};
|
|
68
|
+
if (seedIds.length === 0) {
|
|
69
|
+
return answer({
|
|
70
|
+
headline: "Nothing in the graph matches what you named, so no journey could be proposed.",
|
|
71
|
+
state: "refused",
|
|
72
|
+
nameLevel: true,
|
|
73
|
+
resolutionFloor: 0,
|
|
74
|
+
commitSha: base.commitSha,
|
|
75
|
+
graphBuiltAt: base.graphBuiltAt,
|
|
76
|
+
irSchemaVersion: base.irSchemaVersion,
|
|
77
|
+
commitSpread: base.commitSpread,
|
|
78
|
+
repoCount: base.repoCount,
|
|
79
|
+
notes: ["This is not a claim that the change touches no pages. No seed node was found, so the scope traversal never ran."],
|
|
80
|
+
data: empty,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
const scoped = scopeChange(session.provider(), [...new Set(seedIds)], { trigger: "pr" });
|
|
84
|
+
const candidates = [...scoped.data.changed, ...scoped.data.affected].map((s) => ({
|
|
85
|
+
id: s.node.id,
|
|
86
|
+
type: s.node.type,
|
|
87
|
+
name: s.node.name,
|
|
88
|
+
}));
|
|
89
|
+
const proposal = proposeJourney(candidates, { targetUrl, name, savedAtCommit: base.commitSha ?? "" });
|
|
90
|
+
return answer({
|
|
91
|
+
headline: proposal.scenario.steps.length === 0
|
|
92
|
+
? "No page-shaped route was found in scope — nothing proposed."
|
|
93
|
+
: `Proposed ${proposal.scenario.steps.length} navigate step(s), unaccepted and unsaved.`,
|
|
94
|
+
// Name-level: a route path is read straight off a node's qualified name, never off a
|
|
95
|
+
// type-checked shape — the same cap `scope.ts` applies to its own reply.
|
|
96
|
+
resolutionFloor: 0,
|
|
97
|
+
nameLevel: true,
|
|
98
|
+
commitSha: base.commitSha,
|
|
99
|
+
graphBuiltAt: base.graphBuiltAt,
|
|
100
|
+
irSchemaVersion: base.irSchemaVersion,
|
|
101
|
+
commitSpread: base.commitSpread,
|
|
102
|
+
repoCount: base.repoCount,
|
|
103
|
+
notes: [...scoped.notes, ...proposal.notes],
|
|
104
|
+
data: { scenario: proposal.scenario, reachedNotProposed: proposal.reachedNotProposed },
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
export const proposeJourneyTool = {
|
|
108
|
+
name: "propose_journey",
|
|
109
|
+
title: "Propose a journey from a diff's affected pages",
|
|
110
|
+
description: "Asks the graph for the PAGE/COMPONENT nodes a change's diff scope touches and proposes a navigate-only " +
|
|
111
|
+
"scenario from the path-shaped routes among them — a value returned in this reply, never written to disk " +
|
|
112
|
+
"and never driven. A human reviews it, drives the rest of the journey for real if they accept it, and " +
|
|
113
|
+
"calls browser_save_scenario to commit what they actually did. This tool never calls that save itself: " +
|
|
114
|
+
"nothing a proposal names becomes replayable until a human's own drive produces it.",
|
|
115
|
+
class: "read",
|
|
116
|
+
tier: "evidence",
|
|
117
|
+
version: "1.0.0",
|
|
118
|
+
inputSchema: SCHEMA,
|
|
119
|
+
run,
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=propose-journey.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"propose-journey.js","sourceRoot":"","sources":["../../src/tools/propose-journey.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE1D,OAAO,EAAE,cAAc,EAA6B,MAAM,+BAA+B,CAAC;AAC1F,OAAO,EAAE,uBAAuB,EAAiB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EACL,cAAc,EACd,mBAAmB,EACnB,cAAc,EACd,cAAc,GAGf,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAOlC,MAAM,MAAM,GAA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G,wGAAwG;QACxG,oFAAoF;IACtF,KAAK,EAAE,MAAM;IACb,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;CACJ,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* RG-4 — both halves in the MCP layer, and RG-6's MCP half (video).
|
|
3
|
+
*
|
|
4
|
+
* `runInstrumentedExecution`'s `onReady` fires after every declared service's
|
|
5
|
+
* readiness has succeeded and before the observation window's sleep — the one
|
|
6
|
+
* moment in a run when the application is provably up and still alive. The
|
|
7
|
+
* desktop already composes exactly this way (`descry-desktop/packages/session/
|
|
8
|
+
* src/pipeline/browser-drive.ts`, invoked from `runtime-execution.ts`'s own
|
|
9
|
+
* `onReady`), so that browser evidence lands in the **same `EvidenceStore`
|
|
10
|
+
* under the same `executionId`** as the backend's. `observe_runtime` here
|
|
11
|
+
* never did: it passed no `onReady` and never drove a browser, so an MCP
|
|
12
|
+
* client got two calls with two lifetimes and nothing to prove they were the
|
|
13
|
+
* same run.
|
|
14
|
+
*
|
|
15
|
+
* This module is the MCP equivalent of the desktop's `browser-drive.ts` —
|
|
16
|
+
* same collectors, same package, same "never fabricate a step" discipline —
|
|
17
|
+
* built as its own file because `packages/mcp/src/browser/driver.ts` and
|
|
18
|
+
* `playwright-driver.ts` are lane identity's (a session-scoped, interactive
|
|
19
|
+
* `BrowserDriver` port for the `browser_*` tools' own lifetime) and this is a
|
|
20
|
+
* different lifetime entirely: one drive, bound to one execution's readiness
|
|
21
|
+
* window, torn down before that execution's observation window even starts.
|
|
22
|
+
* Composing through the identity lane's port would mean threading a whole
|
|
23
|
+
* interactive session through a callback that must complete before
|
|
24
|
+
* `onReady` returns — the wrong shape for what is, structurally, a single
|
|
25
|
+
* batch replay. `@descryy/runtime-browser`'s own collectors compose directly
|
|
26
|
+
* instead, the same way the desktop does it.
|
|
27
|
+
*
|
|
28
|
+
* ## The journey comes from the caller, projected by the ONE shared format
|
|
29
|
+
*
|
|
30
|
+
* `DEC-NEXT-runtime-journey-is-one-declared-format` (Q1) settled this: a
|
|
31
|
+
* saved `Scenario` and a driveable step list are two views of one format,
|
|
32
|
+
* and lane journey built the single projection both directions go through —
|
|
33
|
+
* `../scenarios/browser-run-plan-projection.ts`'s `projectScenarioToRunPlan`.
|
|
34
|
+
* This module calls that function and nothing else invents a second
|
|
35
|
+
* translation of the same scenario. Its own header explains exactly what
|
|
36
|
+
* projects and what refuses (seven shared verbs; `fill`, whole-page
|
|
37
|
+
* assertions and anything outside those seven are refused by name, never
|
|
38
|
+
* silently narrowed), and secret references are resolved inside it before
|
|
39
|
+
* this module ever sees a step — see that module's own doc.
|
|
40
|
+
*
|
|
41
|
+
* A `Scenario` with no steps drives to `startUrl` and observes, same as an
|
|
42
|
+
* empty step list does anywhere else in this codebase. No step is ever
|
|
43
|
+
* synthesized here.
|
|
44
|
+
*
|
|
45
|
+
* `@descryy/runtime-browser`'s `BrowserActionCollector` happens to support
|
|
46
|
+
* more than the shared projection's seven verbs (`assertVisible`/`assertText`
|
|
47
|
+
* included) — this module drives every one of the seven the projection
|
|
48
|
+
* can produce, which is a strict superset of what the desktop's narrower
|
|
49
|
+
* `BrowserStep` union can act on. `fill` is not among them: the shared
|
|
50
|
+
* projection refuses it because `BrowserStep` (the format's other consumer)
|
|
51
|
+
* has no counterpart for it, a decision this module does not own and does
|
|
52
|
+
* not work around — see the projection's own header for why collapsing it
|
|
53
|
+
* into `type` would be exactly the kind of silent narrowing rule 2 forbids.
|
|
54
|
+
*/
|
|
55
|
+
import { type BrowserSession, type BrowserSessionOptions } from "@descryy/runtime-browser";
|
|
56
|
+
import type { ExecutionConfiguration, SourceRootResolver } from "@descryy/runtime-contracts";
|
|
57
|
+
import type { StackTraceParser } from "@descryy/runtime-backend-observation";
|
|
58
|
+
import type { EvidenceStore } from "@descryy/runtime-evidence-store";
|
|
59
|
+
import { projectScenarioToRunPlan, type ProjectedStep, type ScenarioProjection } from "../scenarios/browser-run-plan-projection.ts";
|
|
60
|
+
export type { ProjectedStep, ScenarioProjection };
|
|
61
|
+
export { projectScenarioToRunPlan };
|
|
62
|
+
/** The one shared journey step type — lane journey's `ProjectedStep`, re-exported here so a
|
|
63
|
+
* caller of this module never has to import the projection module directly. */
|
|
64
|
+
export type JourneyStep = ProjectedStep;
|
|
65
|
+
export interface JourneyStepRefusal {
|
|
66
|
+
readonly index: number;
|
|
67
|
+
readonly kind: string;
|
|
68
|
+
readonly reason: string;
|
|
69
|
+
}
|
|
70
|
+
export interface JourneyDriveOutcome {
|
|
71
|
+
/** True once a real page existed and was navigated. False means `disclosure` covers the whole drive. */
|
|
72
|
+
readonly ran: boolean;
|
|
73
|
+
readonly startUrl: string;
|
|
74
|
+
readonly stepsCompleted: number;
|
|
75
|
+
readonly stepsRefused: readonly JourneyStepRefusal[];
|
|
76
|
+
/** Byte length of the captured video, or null when video was not requested / not produced. */
|
|
77
|
+
readonly videoBytes: number | null;
|
|
78
|
+
readonly disclosure: string | null;
|
|
79
|
+
}
|
|
80
|
+
export interface JourneyDriveInput {
|
|
81
|
+
readonly store: EvidenceStore;
|
|
82
|
+
readonly executionId: string;
|
|
83
|
+
readonly configuration: ExecutionConfiguration;
|
|
84
|
+
readonly resolveSourceRoot?: SourceRootResolver;
|
|
85
|
+
readonly stackTraceParser?: StackTraceParser;
|
|
86
|
+
}
|
|
87
|
+
export type DriveJourney = (input: JourneyDriveInput) => Promise<JourneyDriveOutcome>;
|
|
88
|
+
export interface JourneyPlan {
|
|
89
|
+
readonly startUrl: string;
|
|
90
|
+
readonly service?: string;
|
|
91
|
+
readonly steps?: readonly JourneyStep[];
|
|
92
|
+
readonly recordVideo?: boolean;
|
|
93
|
+
readonly headless?: boolean;
|
|
94
|
+
readonly settleForMs?: number;
|
|
95
|
+
/** Test seam only — see this module's header. Production callers must not pass it. */
|
|
96
|
+
readonly launchSession?: (options: BrowserSessionOptions) => Promise<BrowserSession>;
|
|
97
|
+
}
|
|
98
|
+
export declare function createRuntimeJourneyDrive(plan: JourneyPlan): DriveJourney;
|
|
99
|
+
/** This module's own collector version, distinct from `@descryy/runtime-browser`'s — these rows
|
|
100
|
+
* are the composition lane's own harness reports about driving, not the browser package's. */
|
|
101
|
+
export declare const RUNTIME_JOURNEY_DRIVE_VERSION = "descry-mcp-runtime-journey-drive@1";
|
|
102
|
+
//# sourceMappingURL=runtime-journey-drive.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-journey-drive.d.ts","sourceRoot":"","sources":["../../src/tools/runtime-journey-drive.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqDG;AAEH,OAAO,EAML,KAAK,cAAc,EACnB,KAAK,qBAAqB,EAC3B,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAC;AAC7F,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AAC7E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAErE,OAAO,EAAE,wBAAwB,EAAE,KAAK,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,6CAA6C,CAAC;AAEpI,YAAY,EAAE,aAAa,EAAE,kBAAkB,EAAE,CAAC;AAClD,OAAO,EAAE,wBAAwB,EAAE,CAAC;AAEpC;gFACgF;AAChF,MAAM,MAAM,WAAW,GAAG,aAAa,CAAC;AAExC,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,wGAAwG;IACxG,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC;IACtB,QAAQ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