@descryy/mcp 0.6.0 → 0.7.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 +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 +121 -224
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +9 -55
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +10 -43
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +20 -54
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +12 -19
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +31 -26
- 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 +7 -91
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +59 -197
- 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-provenance.d.ts +23 -0
- package/dist/browser/scenario-provenance.d.ts.map +1 -0
- package/dist/browser/scenario-provenance.js +59 -0
- package/dist/browser/scenario-provenance.js.map +1 -0
- 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 +30 -90
- 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 +21 -65
- 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 +9 -33
- package/dist/capped.d.ts.map +1 -1
- package/dist/capped.js +7 -27
- package/dist/capped.js.map +1 -1
- 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 +37 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +88 -96
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +89 -13
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +111 -16
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +7 -66
- package/dist/runtime-registry.d.ts.map +1 -1
- package/dist/runtime-registry.js +39 -114
- 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 +69 -19
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +90 -259
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +136 -250
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +32 -118
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +65 -186
- 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 +47 -84
- 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 +145 -56
- 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 +9 -86
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +24 -80
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts +42 -30
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +81 -62
- 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 +118 -26
- 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 +273 -434
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +9 -100
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +74 -152
- 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 +74 -16
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +152 -51
- 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 +17 -58
- 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 +10 -29
- 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 +29 -70
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +141 -85
- 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 +40 -22
|
@@ -1,32 +1,14 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `browser_start_session` —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `DEC-380` puts consent here and nowhere
|
|
7
|
-
* else. This is the call where a target URL is named, so it is the only call
|
|
8
|
-
* where the fact a developer actually approves — *Descry may drive a browser
|
|
9
|
-
* against this application* — can be stated. A per-click confirmation would
|
|
10
|
-
* describe "click ref-14", which is a string the caller supplied one call
|
|
11
|
-
* earlier and can neither evaluate nor be surprised by, and it would train
|
|
12
|
-
* callers to confirm reflexively.
|
|
13
|
-
*
|
|
14
|
-
* The grant is bound to this URL's **origin**. `browser_navigate` refuses to
|
|
15
|
-
* leave it. Without that bound, "drive my local app" would silently become
|
|
16
|
-
* "drive anything".
|
|
17
|
-
*
|
|
18
|
-
* ## Class
|
|
19
|
-
*
|
|
20
|
-
* `action`, unambiguously: this launches a process and points it at a running
|
|
21
|
-
* application. It is the only browser tool that mints a token; the verbs it
|
|
22
|
-
* consents for redeem nothing, because the session they run in has already
|
|
23
|
-
* been confirmed.
|
|
24
|
-
*/
|
|
2
|
+
* `browser_start_session` — opens a real browser (DEC-380: consent lives here only,
|
|
3
|
+
* bound to the target URL's origin — `browser_navigate` refuses to leave it). Class
|
|
4
|
+
* `action`: the only browser tool that mints a token; the verbs it consents for
|
|
5
|
+
* redeem nothing, since the session is already confirmed. */
|
|
25
6
|
import { CANCELLED_STATE, cancellationHeadline, cancellationNotes } from "../cancellation.js";
|
|
26
7
|
import { browserAnswer, emptyEvidence, observeAndCorrelate } from "../browser/tool-support.js";
|
|
27
8
|
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
28
9
|
import { isAbsolute, join } from "node:path";
|
|
29
10
|
import { loadStackParser, StackParserLoadError } from "../browser/stack-parser.js";
|
|
11
|
+
import { checkUrlScheme } from "../browser/url-scheme.js";
|
|
30
12
|
import { optionalBoolean, optionalEnum, optionalString, requiredString, ToolInputError } from "./kit.js";
|
|
31
13
|
const SCHEMA = {
|
|
32
14
|
type: "object",
|
|
@@ -84,6 +66,39 @@ const SCHEMA = {
|
|
|
84
66
|
required: ["name", "safetyLevel"],
|
|
85
67
|
additionalProperties: true,
|
|
86
68
|
},
|
|
69
|
+
storageState: {
|
|
70
|
+
type: "object",
|
|
71
|
+
description: "11.4-b: an already-authenticated session to seed before the first navigation. Without this, " +
|
|
72
|
+
"browser_click/type/fill can drive a login form within the consented origin, but cannot reach a " +
|
|
73
|
+
"screen that requires an existing session, and every fresh session re-authenticates from scratch. " +
|
|
74
|
+
"Both fields are scoped to targetUrl's own origin by construction — there is no way to name a " +
|
|
75
|
+
"second origin here, so this cannot widen the session's consent.",
|
|
76
|
+
properties: {
|
|
77
|
+
cookies: {
|
|
78
|
+
type: "array",
|
|
79
|
+
description: "Cookies to set before navigating, scoped to targetUrl's own origin.",
|
|
80
|
+
items: {
|
|
81
|
+
type: "object",
|
|
82
|
+
properties: {
|
|
83
|
+
name: { type: "string" },
|
|
84
|
+
value: { type: "string" },
|
|
85
|
+
path: { type: "string", description: "Defaults to \"/\"." },
|
|
86
|
+
httpOnly: { type: "boolean" },
|
|
87
|
+
secure: { type: "boolean" },
|
|
88
|
+
sameSite: { type: "string", enum: ["Strict", "Lax", "None"] },
|
|
89
|
+
},
|
|
90
|
+
required: ["name", "value"],
|
|
91
|
+
additionalProperties: false,
|
|
92
|
+
},
|
|
93
|
+
},
|
|
94
|
+
localStorage: {
|
|
95
|
+
type: "object",
|
|
96
|
+
description: "localStorage entries to set for targetUrl's own origin before navigating, as string values.",
|
|
97
|
+
additionalProperties: { type: "string" },
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
additionalProperties: false,
|
|
101
|
+
},
|
|
87
102
|
confirmToken: {
|
|
88
103
|
type: "string",
|
|
89
104
|
description: "The token returned by a previous call. Starting a browser session takes two calls: the first " +
|
|
@@ -96,15 +111,9 @@ const SCHEMA = {
|
|
|
96
111
|
additionalProperties: false,
|
|
97
112
|
};
|
|
98
113
|
const SAFETY_LEVELS = ["readOnly", "write", "destructiveWithApproval"];
|
|
99
|
-
/**
|
|
100
|
-
*
|
|
101
|
-
*
|
|
102
|
-
* Only the two fields this surface actually consults are read; everything
|
|
103
|
-
* else a caller sends is carried by the profile it came from and is none of
|
|
104
|
-
* this tool's business. `additionalProperties: true` on the schema is what
|
|
105
|
-
* lets a caller pass the same object it passes `observe_runtime` rather than
|
|
106
|
-
* trimming a second copy of it.
|
|
107
|
-
*/
|
|
114
|
+
/** Reads the profile, doesn't re-derive it — only the 2 fields this surface consults.
|
|
115
|
+
* `additionalProperties: true` lets a caller pass the same object it gives
|
|
116
|
+
* `observe_runtime` without trimming a second copy. */
|
|
108
117
|
function readProfile(args) {
|
|
109
118
|
const raw = args["environment"];
|
|
110
119
|
if (raw === undefined || raw === null)
|
|
@@ -120,6 +129,68 @@ function readProfile(args) {
|
|
|
120
129
|
}
|
|
121
130
|
return { name, safetyLevel };
|
|
122
131
|
}
|
|
132
|
+
const COOKIE_SAME_SITE = ["Strict", "Lax", "None"];
|
|
133
|
+
/**
|
|
134
|
+
* 11.4-b: an already-authenticated session to seed before the first navigation.
|
|
135
|
+
* No "domain" field is read from a cookie — not merely ignored, refused — so a
|
|
136
|
+
* caller cannot silently widen a session's consent to a second origin the way
|
|
137
|
+
* accepting and dropping one would risk if a future reader trusted the field
|
|
138
|
+
* existed. The driver scopes every seeded cookie to `targetUrl`'s own origin.
|
|
139
|
+
*/
|
|
140
|
+
function readStorageState(args) {
|
|
141
|
+
const raw = args["storageState"];
|
|
142
|
+
if (raw === undefined || raw === null)
|
|
143
|
+
return null;
|
|
144
|
+
if (typeof raw !== "object" || Array.isArray(raw))
|
|
145
|
+
throw new ToolInputError('"storageState" must be an object');
|
|
146
|
+
const fields = raw;
|
|
147
|
+
const rawCookies = fields["cookies"];
|
|
148
|
+
let cookies;
|
|
149
|
+
if (rawCookies !== undefined) {
|
|
150
|
+
if (!Array.isArray(rawCookies))
|
|
151
|
+
throw new ToolInputError('"storageState.cookies" must be an array');
|
|
152
|
+
cookies = rawCookies.map((entry, index) => {
|
|
153
|
+
if (typeof entry !== "object" || entry === null || Array.isArray(entry)) {
|
|
154
|
+
throw new ToolInputError(`"storageState.cookies[${index}]" must be an object`);
|
|
155
|
+
}
|
|
156
|
+
const cookie = entry;
|
|
157
|
+
if ("domain" in cookie) {
|
|
158
|
+
throw new ToolInputError(`"storageState.cookies[${index}].domain" is not accepted — a seeded cookie is always scoped to ` +
|
|
159
|
+
"targetUrl's own origin, never a domain the caller names, so a session's consent cannot be " +
|
|
160
|
+
"silently widened to a second origin.");
|
|
161
|
+
}
|
|
162
|
+
const name = requiredString(cookie, "name");
|
|
163
|
+
const value = requiredString(cookie, "value");
|
|
164
|
+
const path = optionalString(cookie, "path");
|
|
165
|
+
const httpOnly = optionalBoolean(cookie, "httpOnly");
|
|
166
|
+
const secure = optionalBoolean(cookie, "secure");
|
|
167
|
+
const sameSite = optionalEnum(cookie, "sameSite", COOKIE_SAME_SITE);
|
|
168
|
+
return {
|
|
169
|
+
name,
|
|
170
|
+
value,
|
|
171
|
+
...(path === undefined ? {} : { path }),
|
|
172
|
+
...(httpOnly === undefined ? {} : { httpOnly }),
|
|
173
|
+
...(secure === undefined ? {} : { secure }),
|
|
174
|
+
...(sameSite === undefined ? {} : { sameSite }),
|
|
175
|
+
};
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
const rawLocalStorage = fields["localStorage"];
|
|
179
|
+
let localStorage;
|
|
180
|
+
if (rawLocalStorage !== undefined) {
|
|
181
|
+
if (typeof rawLocalStorage !== "object" || rawLocalStorage === null || Array.isArray(rawLocalStorage)) {
|
|
182
|
+
throw new ToolInputError('"storageState.localStorage" must be an object of string values');
|
|
183
|
+
}
|
|
184
|
+
for (const [key, value] of Object.entries(rawLocalStorage)) {
|
|
185
|
+
if (typeof value !== "string")
|
|
186
|
+
throw new ToolInputError(`"storageState.localStorage.${key}" must be a string`);
|
|
187
|
+
}
|
|
188
|
+
localStorage = rawLocalStorage;
|
|
189
|
+
}
|
|
190
|
+
if (cookies === undefined && localStorage === undefined)
|
|
191
|
+
return null;
|
|
192
|
+
return { ...(cookies === undefined ? {} : { cookies }), ...(localStorage === undefined ? {} : { localStorage }) };
|
|
193
|
+
}
|
|
123
194
|
function readStackParserSpec(args) {
|
|
124
195
|
const raw = args["stackParser"];
|
|
125
196
|
if (raw === undefined || raw === null)
|
|
@@ -133,13 +204,20 @@ function readStackParserSpec(args) {
|
|
|
133
204
|
}
|
|
134
205
|
function parseTarget(args) {
|
|
135
206
|
const raw = requiredString(args, "targetUrl");
|
|
207
|
+
let url;
|
|
136
208
|
try {
|
|
137
|
-
|
|
209
|
+
url = new URL(raw);
|
|
138
210
|
}
|
|
139
211
|
catch {
|
|
140
212
|
throw new ToolInputError(`"targetUrl" must be an absolute URL including scheme — got "${raw}". A bare host or path cannot be ` +
|
|
141
213
|
"opened, and cannot be turned into the origin this session's consent is bound to.");
|
|
142
214
|
}
|
|
215
|
+
// file:/data: (untrusted schemes) resolve to origin "null", collapsing
|
|
216
|
+
// tool-support.ts's same-origin containment — see url-scheme.ts.
|
|
217
|
+
const scheme = checkUrlScheme(url);
|
|
218
|
+
if (!scheme.allowed)
|
|
219
|
+
throw new ToolInputError(scheme.reason);
|
|
220
|
+
return url;
|
|
143
221
|
}
|
|
144
222
|
function cancelledBeforeLaunch(ctx, target, safetyLevel) {
|
|
145
223
|
return browserAnswer({
|
|
@@ -164,13 +242,13 @@ async function run(args, ctx) {
|
|
|
164
242
|
const target = parseTarget(args);
|
|
165
243
|
const headless = optionalBoolean(args, "headless") ?? true;
|
|
166
244
|
const profile = readProfile(args);
|
|
245
|
+
const storageState = readStorageState(args);
|
|
167
246
|
const parserSpec = readStackParserSpec(args);
|
|
168
247
|
const documentRoot = optionalString(args, "documentRoot");
|
|
169
248
|
const backend = ctx.session.browserBackend();
|
|
170
|
-
// Before anything launches
|
|
171
|
-
//
|
|
172
|
-
// the
|
|
173
|
-
// five-minute idle reaper is the only thing left that would.
|
|
249
|
+
// Before anything launches — a browser opened for a caller who's already gone is
|
|
250
|
+
// one nothing will ever close (its session id never reaches a suppressed reply);
|
|
251
|
+
// only the 5-minute idle reaper would eventually catch it.
|
|
174
252
|
if (ctx.signal.aborted)
|
|
175
253
|
return cancelledBeforeLaunch(ctx, target, null);
|
|
176
254
|
if (!backend.available) {
|
|
@@ -182,10 +260,9 @@ async function run(args, ctx) {
|
|
|
182
260
|
data: { sessionId: "", url: target.href, title: "", consentedOrigin: target.origin, safetyLevel: null, totalElements: 0, evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
183
261
|
});
|
|
184
262
|
}
|
|
185
|
-
//
|
|
186
|
-
//
|
|
187
|
-
//
|
|
188
|
-
// session that quietly cannot write the edge it was opened for.
|
|
263
|
+
// Parser loaded before anything launches — a bad parser is a fixable refusal here;
|
|
264
|
+
// discovering it after a browser is open means tearing it down or running a
|
|
265
|
+
// session that silently can't write the edge it opened for.
|
|
189
266
|
let parser;
|
|
190
267
|
try {
|
|
191
268
|
parser = parserSpec === null ? undefined : await loadStackParser(parserSpec);
|
|
@@ -201,10 +278,9 @@ async function run(args, ctx) {
|
|
|
201
278
|
data: { sessionId: "", url: target.href, title: "", consentedOrigin: target.origin, safetyLevel: null, totalElements: 0, evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
202
279
|
});
|
|
203
280
|
}
|
|
204
|
-
//
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
// `public/` case the schema describes.
|
|
281
|
+
// Closed here rather than left to a caller: the origin driven must map to
|
|
282
|
+
// the directory actually serving its scripts — `documentRoot` overrides the repo
|
|
283
|
+
// root for the `public/` case the schema describes.
|
|
208
284
|
const servedFrom = documentRoot === undefined
|
|
209
285
|
? ctx.session.repoPath
|
|
210
286
|
: isAbsolute(documentRoot)
|
|
@@ -219,12 +295,17 @@ async function run(args, ctx) {
|
|
|
219
295
|
resolveSourceRoot,
|
|
220
296
|
service: ctx.session.config.repo,
|
|
221
297
|
});
|
|
222
|
-
const opened = await ctx.session.browserSessions().open(driver, {
|
|
298
|
+
const opened = await ctx.session.browserSessions().open(driver, {
|
|
299
|
+
targetUrl: target.href,
|
|
300
|
+
headless,
|
|
301
|
+
profile,
|
|
302
|
+
...(storageState === null ? {} : { storageState }),
|
|
303
|
+
});
|
|
223
304
|
if (!opened.opened) {
|
|
224
305
|
const notes = opened.kind === "atCapacity"
|
|
225
306
|
? [opened.reason]
|
|
226
|
-
: //
|
|
227
|
-
//
|
|
307
|
+
: // Remedy travels verbatim — "could not launch" and stopping there is a
|
|
308
|
+
// refusal the developer has to go research themselves.
|
|
228
309
|
[opened.message, `Remedy: ${opened.remedy}`, `Expected the browser at ${opened.expectedExecutablePath}.`];
|
|
229
310
|
return browserAnswer({
|
|
230
311
|
ctx,
|
|
@@ -234,10 +315,9 @@ async function run(args, ctx) {
|
|
|
234
315
|
data: { sessionId: "", url: target.href, title: "", consentedOrigin: target.origin, safetyLevel: profile?.safetyLevel ?? null, totalElements: 0, evidence: emptyEvidence(), graph: NO_GRAPH_WRITE },
|
|
235
316
|
});
|
|
236
317
|
}
|
|
237
|
-
// The race
|
|
238
|
-
//
|
|
239
|
-
//
|
|
240
|
-
// and the only one it may tear down.
|
|
318
|
+
// The race actually lost in practice: caller cancelled while Chromium was
|
|
319
|
+
// starting, so the launch succeeded for nobody. Closes the session just opened
|
|
320
|
+
// — the one resource this call started, the only one it may tear down.
|
|
241
321
|
if (ctx.signal.aborted) {
|
|
242
322
|
await ctx.session.browserSessions().close(opened.entry.sessionId);
|
|
243
323
|
return cancelledBeforeLaunch(ctx, target, profile?.safetyLevel ?? null);
|
|
@@ -253,6 +333,16 @@ async function run(args, ctx) {
|
|
|
253
333
|
`Consent covers ${entry.consentedOrigin} for the life of this session — click, type and fill need no ` +
|
|
254
334
|
"further confirmation, and navigating to another origin will refuse. The session is torn down after " +
|
|
255
335
|
"five idle minutes, when the client disconnects, or when browser_close_session is called.",
|
|
336
|
+
// Names what was seeded, never the values themselves — a cookie or localStorage
|
|
337
|
+
// value is a credential, and this disclosure exists so a caller can tell an
|
|
338
|
+
// authenticated run from an anonymous one without this reply repeating it back.
|
|
339
|
+
...(storageState === null
|
|
340
|
+
? []
|
|
341
|
+
: [
|
|
342
|
+
`Storage state was seeded before the first navigation: ${storageState.cookies?.length ?? 0} ` +
|
|
343
|
+
`cookie(s), ${Object.keys(storageState.localStorage ?? {}).length} localStorage key(s) — both ` +
|
|
344
|
+
`scoped to ${entry.consentedOrigin}.`,
|
|
345
|
+
]),
|
|
256
346
|
...(parserSpec === null
|
|
257
347
|
? [
|
|
258
348
|
"No stackParser was named, so requests will be observed and the endpoints they reach will be " +
|
|
@@ -298,10 +388,9 @@ export const browserStartSessionTool = {
|
|
|
298
388
|
run,
|
|
299
389
|
describeAction(args) {
|
|
300
390
|
const target = parseTarget(args);
|
|
301
|
-
//
|
|
302
|
-
//
|
|
303
|
-
//
|
|
304
|
-
// that is actually enforced cannot say two different things.
|
|
391
|
+
// Same parse the run path uses to enforce the gate (`mutationRefusal` in
|
|
392
|
+
// `tool-support.ts`) — read here, not re-derived, so what's confirmed matches
|
|
393
|
+
// what's enforced.
|
|
305
394
|
const safetyLevel = readProfile(args)?.safetyLevel;
|
|
306
395
|
if (safetyLevel === "readOnly") {
|
|
307
396
|
return (`Descry may navigate and snapshot anywhere on ${target.origin}. Clicking, typing and filling will be ` +
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-start-session.js","sourceRoot":"","sources":["../../src/tools/browser-start-session.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAEH,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9F,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC/F,OAAO,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,CAAC,EAAE,WAAW,CAAC;QACnD,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;YAC/B,OAAO,CACL,gDAAgD,MAAM,CAAC,MAAM,yCAAyC;gBACtG,wCAAwC,CACzC,CAAC;QACJ,CAAC;QACD,OAAO,CACL,6BAA6B,MAAM,CAAC,IAAI,2DAA2D;YACnG,oCAAoC,MAAM,CAAC,MAAM,iDAAiD;YAClG,gEAAgE,CACjE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
1
|
+
{"version":3,"file":"browser-start-session.js","sourceRoot":"","sources":["../../src/tools/browser-start-session.ts"],"names":[],"mappings":"AAAA;;;;6DAI6D;AAE7D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAE9F,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAC/F,OAAO,EAAE,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAM7C,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAwB,MAAM,4BAA4B,CAAC;AACzG,OAAO,EAAE,cAAc,EAAE,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAkBhJ,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,6FAA6F;gBAC7F,6FAA6F;gBAC7F,6FAA6F;SAChG;QACD,QAAQ,EAAE;YACR,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,gFAAgF;SAC9F;QACD,WAAW,EAAE;YACX,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,mGAAmG;gBACnG,qGAAqG;gBACrG,sG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,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;IACH,cAAc,CAAC,IAA6B;QAC1C,MAAM,MAAM,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;QACjC,yEAAyE;QACzE,8EAA8E;QAC9E,mBAAmB;QACnB,MAAM,WAAW,GAAG,WAAW,CAAC,IAAI,CAAC,EAAE,WAAW,CAAC;QACnD,IAAI,WAAW,KAAK,UAAU,EAAE,CAAC;YAC/B,OAAO,CACL,gDAAgD,MAAM,CAAC,MAAM,yCAAyC;gBACtG,wCAAwC,CACzC,CAAC;QACJ,CAAC;QACD,OAAO,CACL,6BAA6B,MAAM,CAAC,IAAI,2DAA2D;YACnG,oCAAoC,MAAM,CAAC,MAAM,iDAAiD;YAClG,gEAAgE,CACjE,CAAC;IACJ,CAAC;CACF,CAAC"}
|
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `DEC-380` grants consent once, at
|
|
7
|
-
* `browser_start_session`, bound to that call's origin. So this tool declares
|
|
8
|
-
* `class: "action"` — it does change a running application, and pretending
|
|
9
|
-
* otherwise would be the lie — while its `describeAction` returns `undefined`,
|
|
10
|
-
* the existing "this particular call has nothing to confirm" path that
|
|
11
|
-
* `questions` uses when asked to read rather than write.
|
|
12
|
-
*
|
|
13
|
-
* The property that makes that safe rather than merely cheap: **a verb cannot
|
|
14
|
-
* mint consent for itself.** Called against a session with no consent record,
|
|
15
|
-
* it refuses. There is deliberately no path from a click to a token.
|
|
16
|
-
*
|
|
17
|
-
* ## A ref, never a selector
|
|
18
|
-
*
|
|
19
|
-
* The element is named by a ref from a snapshot the calling agent actually
|
|
20
|
-
* saw. A raw selector would let an agent act on an element it never looked
|
|
21
|
-
* at, and a ref from a superseded snapshot refuses rather than resolving
|
|
22
|
-
* against whatever now matches — that is the same mistake, arriving later.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* ## Why this is not the same tool as `browser_fill`
|
|
26
|
-
*
|
|
27
|
-
* The visible difference is that this appends and `fill` replaces. The
|
|
28
|
-
* difference that decides which one is correct for a real page is that **this
|
|
29
|
-
* one fires key events and `fill` fires none.** A field that opens an
|
|
30
|
-
* autocomplete on keydown, validates per character, or debounces a search as
|
|
31
|
-
* you type sees nothing at all from a `fill`. An agent that reaches for
|
|
32
|
-
* `fill` on a search box gets a page that was never typed into — a wrong
|
|
33
|
-
* answer produced by entirely correct tool code, which is why the schema
|
|
34
|
-
* prose below says so rather than describing only the tidy half.
|
|
35
|
-
*/
|
|
1
|
+
/** `browser_type` — real keystrokes into a field. Consent is granted once, at
|
|
2
|
+
* `browser_start_session` (DEC-380) — `describeAction` returns undefined since a verb can't
|
|
3
|
+
* mint its own consent; called with none on record, it refuses. Takes a ref from a seen
|
|
4
|
+
* snapshot, never a selector — a stale ref refuses rather than resolving elsewhere. Fires
|
|
5
|
+
* real key events, unlike `browser_fill` (which fires none) — needed for autocomplete/validation/debounce fields fill would silently miss. */
|
|
36
6
|
import type { BrowserEvidenceReport } from "../browser/evidence.ts";
|
|
37
7
|
import { type BrowserGraphWrite } from "../browser/graph-write.ts";
|
|
38
8
|
import { type ToolDefinition } from "./kit.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-type.d.ts","sourceRoot":"","sources":["../../src/tools/browser-type.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-type.d.ts","sourceRoot":"","sources":["../../src/tools/browser-type.ts"],"names":[],"mappings":"AAAA;;;;+IAI+I;AAE/I,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAGnF,OAAO,EAAoC,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAGjF,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,qFAAqF;IACrF,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;CACnC;AAoGD,eAAO,MAAM,eAAe,EAAE,cAe7B,CAAC"}
|
|
@@ -1,38 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
*
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* `DEC-380` grants consent once, at
|
|
7
|
-
* `browser_start_session`, bound to that call's origin. So this tool declares
|
|
8
|
-
* `class: "action"` — it does change a running application, and pretending
|
|
9
|
-
* otherwise would be the lie — while its `describeAction` returns `undefined`,
|
|
10
|
-
* the existing "this particular call has nothing to confirm" path that
|
|
11
|
-
* `questions` uses when asked to read rather than write.
|
|
12
|
-
*
|
|
13
|
-
* The property that makes that safe rather than merely cheap: **a verb cannot
|
|
14
|
-
* mint consent for itself.** Called against a session with no consent record,
|
|
15
|
-
* it refuses. There is deliberately no path from a click to a token.
|
|
16
|
-
*
|
|
17
|
-
* ## A ref, never a selector
|
|
18
|
-
*
|
|
19
|
-
* The element is named by a ref from a snapshot the calling agent actually
|
|
20
|
-
* saw. A raw selector would let an agent act on an element it never looked
|
|
21
|
-
* at, and a ref from a superseded snapshot refuses rather than resolving
|
|
22
|
-
* against whatever now matches — that is the same mistake, arriving later.
|
|
23
|
-
*/
|
|
24
|
-
/**
|
|
25
|
-
* ## Why this is not the same tool as `browser_fill`
|
|
26
|
-
*
|
|
27
|
-
* The visible difference is that this appends and `fill` replaces. The
|
|
28
|
-
* difference that decides which one is correct for a real page is that **this
|
|
29
|
-
* one fires key events and `fill` fires none.** A field that opens an
|
|
30
|
-
* autocomplete on keydown, validates per character, or debounces a search as
|
|
31
|
-
* you type sees nothing at all from a `fill`. An agent that reaches for
|
|
32
|
-
* `fill` on a search box gets a page that was never typed into — a wrong
|
|
33
|
-
* answer produced by entirely correct tool code, which is why the schema
|
|
34
|
-
* prose below says so rather than describing only the tidy half.
|
|
35
|
-
*/
|
|
1
|
+
/** `browser_type` — real keystrokes into a field. Consent is granted once, at
|
|
2
|
+
* `browser_start_session` (DEC-380) — `describeAction` returns undefined since a verb can't
|
|
3
|
+
* mint its own consent; called with none on record, it refuses. Takes a ref from a seen
|
|
4
|
+
* snapshot, never a selector — a stale ref refuses rather than resolving elsewhere. Fires
|
|
5
|
+
* real key events, unlike `browser_fill` (which fires none) — needed for autocomplete/validation/debounce fields fill would silently miss. */
|
|
36
6
|
import { browserAnswer, emptyEvidence, mutationRefusal, observeAndCorrelate, useSession } from "../browser/tool-support.js";
|
|
37
7
|
import { NO_GRAPH_WRITE } from "../browser/graph-write.js";
|
|
38
8
|
import { UnknownElementRefError } from "../browser/driver.js";
|
|
@@ -70,10 +40,8 @@ async function run(args, ctx) {
|
|
|
70
40
|
const sessionId = requiredString(args, "sessionId");
|
|
71
41
|
const ref = requiredString(args, "ref");
|
|
72
42
|
const text = requiredString(args, "text");
|
|
73
|
-
// Checked before the session is touched
|
|
74
|
-
//
|
|
75
|
-
// stop. The session itself is left open — it belongs to
|
|
76
|
-
// `browser_start_session` and its consent, not to this call.
|
|
43
|
+
// Checked before the session is touched — the point is that nothing happens once the
|
|
44
|
+
// caller says stop. The session stays open; it belongs to `browser_start_session`'s consent, not this call.
|
|
77
45
|
if (ctx.signal.aborted) {
|
|
78
46
|
return browserAnswer({
|
|
79
47
|
ctx,
|
|
@@ -94,8 +62,7 @@ async function run(args, ctx) {
|
|
|
94
62
|
});
|
|
95
63
|
}
|
|
96
64
|
const { entry } = found;
|
|
97
|
-
// Consent and safetyLevel are independent and both must pass
|
|
98
|
-
// granted at session start; this is the other half.
|
|
65
|
+
// Consent and safetyLevel are independent and both must pass — consent was granted at session start.
|
|
99
66
|
const refused = mutationRefusal(entry);
|
|
100
67
|
if (refused !== null) {
|
|
101
68
|
return browserAnswer({
|
|
@@ -141,10 +108,8 @@ export const browserTypeTool = {
|
|
|
141
108
|
version: "1.0.0",
|
|
142
109
|
inputSchema: SCHEMA,
|
|
143
110
|
run,
|
|
144
|
-
// Undefined, always
|
|
145
|
-
//
|
|
146
|
-
// mint — its own consent would be a gate that exists only for callers who
|
|
147
|
-
// were not going to abuse it.
|
|
111
|
+
// Undefined, always — consent was confirmed at browser_start_session; a verb that could
|
|
112
|
+
// describe (and thus mint) its own consent is a gate only honest callers would respect.
|
|
148
113
|
describeAction: () => undefined,
|
|
149
114
|
};
|
|
150
115
|
//# sourceMappingURL=browser-type.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-type.js","sourceRoot":"","sources":["../../src/tools/browser-type.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"browser-type.js","sourceRoot":"","sources":["../../src/tools/browser-type.ts"],"names":[],"mappings":"AAAA;;;;+IAI+I;AAG/I,OAAO,EAAE,aAAa,EAAE,aAAa,EAAE,eAAe,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC5H,OAAO,EAAE,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,oBAAoB,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC9F,OAAO,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAYjF,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE;YACT,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,qDAAqD;SACnE;QACD,GAAG,EAAE;YACH,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,+FAA+F;gBAC/F,+FAA+F;gBAC/F,8DAA8D;SACjE;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,Q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,EAAE,aAAa,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE;SACzG,CAAC,CAAC;IACL,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,mBAAmB,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC;IAEvD,OAAO,aAAa,CAAkB;QACpC,GAAG;QACH,QAAQ,EAAE,aAAa,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,GAAG;QACjD,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,IAAI,EAAE,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,UAAU,EAAE,EAAE,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC,KAAK,EAAE;KAC3G,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,IAAI,EAAE,cAAc;IACpB,KAAK,EAAE,wCAAwC;IAC/C,WAAW,EAAE,sGAAsG;QACjH,uGAAuG;QACvG,sGAAsG;QACtG,kGAAkG;IACpG,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;IACH,wFAAwF;IACxF,wFAAwF;IACxF,cAAc,EAAE,GAAG,EAAE,CAAC,SAAS;CAChC,CAAC"}
|
|
@@ -1,45 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* `contracts` —
|
|
3
|
-
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* **The path half runs today.** A call that reaches no route, a route nothing
|
|
7
|
-
* calls. Name-level facts, so R2 evidence supports them at class A.
|
|
8
|
-
*
|
|
9
|
-
* **The shape half needs both producers to attach something they do not attach
|
|
10
|
-
* yet**, and it names exactly what — see `engine.ts`. It reports
|
|
11
|
-
* `refused` with those names rather than an empty mismatch list, because
|
|
12
|
-
* "no contract mismatches found" is a false statement when nothing was compared.
|
|
13
|
-
*
|
|
14
|
-
* ## Why the tool is `ok` when only the path half ran
|
|
15
|
-
*
|
|
16
|
-
* The path half produced a real answer over real evidence. Marking the whole
|
|
17
|
-
* call `refused` because a second check did not run would hide a genuine
|
|
18
|
-
* finding behind a caveat about a different question. The shape half's status is
|
|
19
|
-
* carried in `data.shapes.ran` and in the blockers, where a reader can act on it.
|
|
20
|
-
*
|
|
21
|
-
* The one case that *is* `refused` outright: no endpoints in the graph.
|
|
22
|
-
* Then neither half looked at anything.
|
|
23
|
-
*
|
|
24
|
-
* ## A filter matching nothing is not a clean bill of health
|
|
25
|
-
*
|
|
26
|
-
* UAT round 3, Suggestion 5. `paths: ["/reviews"]` on a repository whose
|
|
27
|
-
* `/reviews` route was never parsed as an `API_ROUTE` at all returned
|
|
28
|
-
* `state: "ok"`, `"Clean at path level."`, `findings: []` — indistinguishable
|
|
29
|
-
* from "checked `/reviews` and it is fine." Zero endpoints matched the filter,
|
|
30
|
-
* not zero problems with the endpoint it named. So a `paths` filter that
|
|
31
|
-
* matches no `API_ENDPOINT` in the graph now reports `state: "empty"` with an
|
|
32
|
-
* explicit count, before the "clean" verdict can be reached at all.
|
|
33
|
-
*
|
|
34
|
-
* ## Claim: defect versus lead
|
|
35
|
-
*
|
|
36
|
-
* UAT round 3, Suggestion 6, following `EnvFinding.claim`'s precedent
|
|
37
|
-
* (`validate`). `CALL_NOT_SERVED` and every shape mismatch are `defect` —
|
|
38
|
-
* provable from this graph (and, for a mismatch, a type checker) alone.
|
|
39
|
-
* `ROUTE_NOT_CALLED` is `lead` — a mobile client, another service, or an
|
|
40
|
-
* external consumer would not appear in this graph, so "nothing calls it" is
|
|
41
|
-
* never provable, only worth a look. This is orthogonal to `prominence`,
|
|
42
|
-
* which still orders by evidence strength alone.
|
|
2
|
+
* `contracts` — path half (name-level, R2→A) runs today; shape half (§13)
|
|
3
|
+
* needs producer-attached shapes, reporting `refused` with named blockers
|
|
4
|
+
* rather than an empty list. `defect` is provable here alone; `lead` is not.
|
|
43
5
|
*/
|
|
44
6
|
import type { ContractCheck, ContractClaim, ContractFindingKind, EndpointKey, NearMissKind, ShapeDifference, ShapeDirection } from "@descryy/core";
|
|
45
7
|
import type { ResolutionLevel } from "@descryy/ir";
|
|
@@ -47,24 +9,11 @@ import { type BriefNode, type ToolDefinition } from "./kit.ts";
|
|
|
47
9
|
/** A call that reaches no route, or a route nothing calls. */
|
|
48
10
|
export interface ContractPathFinding {
|
|
49
11
|
readonly kind: ContractFindingKind;
|
|
50
|
-
/**
|
|
51
|
-
* `defect` (provable from this graph alone) or `lead` (needs knowledge
|
|
52
|
-
* outside it) — see the module header. Orthogonal to `prominence` below.
|
|
53
|
-
*/
|
|
12
|
+
/** `defect` (provable from this graph alone) or `lead` (needs outside knowledge) — see module header. */
|
|
54
13
|
readonly claim: ContractClaim;
|
|
55
14
|
/** 1-based position in this answer. See {@link ContractPathFinding.prominence} for what orders it. */
|
|
56
15
|
readonly rank: number;
|
|
57
|
-
/**
|
|
58
|
-
* `top` / `notable` / `rest`, ordered by **evidence strength** — the
|
|
59
|
-
* finding's own `resolution`, strongest first — and not by `claim`.
|
|
60
|
-
*
|
|
61
|
-
* A call reaching no route and a route nothing calls can each rest on
|
|
62
|
-
* strong or weak evidence, and inventing a ranking from `claim` alone would
|
|
63
|
-
* be a judgement dressed as a measurement. What the graph does know is how
|
|
64
|
-
* well-resolved each finding is, and a reader triaging a list is better
|
|
65
|
-
* served by "this one rests on the strongest evidence" than by an invented
|
|
66
|
-
* ranking. The tool's own notes say this rather than leaving it inferred.
|
|
67
|
-
*/
|
|
16
|
+
/** `top`/`notable`/`rest`, ordered by evidence strength (own `resolution`), not `claim` — a claim-based ranking would be judgement dressed as measurement. */
|
|
68
17
|
readonly prominence: "top" | "notable" | "rest";
|
|
69
18
|
readonly method: string;
|
|
70
19
|
/** The normalised path template, not the raw literal. */
|
|
@@ -72,12 +21,7 @@ export interface ContractPathFinding {
|
|
|
72
21
|
readonly detail: string;
|
|
73
22
|
/** Lowest resolution among the edges this finding rests on. Caps its class. */
|
|
74
23
|
readonly resolution: ResolutionLevel;
|
|
75
|
-
/**
|
|
76
|
-
* Absent when nothing on the other side resembles this endpoint.
|
|
77
|
-
*
|
|
78
|
-
* Its absence is what separates a typo from a call into a service outside
|
|
79
|
-
* this graph — the second is disclosed as unanalysed, never reported broken.
|
|
80
|
-
*/
|
|
24
|
+
/** Absent when nothing resembles this endpoint on the other side — that gap is disclosed as unanalysed, never reported broken (typo vs. an outside service). */
|
|
81
25
|
readonly nearMiss?: {
|
|
82
26
|
readonly kind: NearMissKind;
|
|
83
27
|
readonly against: EndpointKey;
|
|
@@ -100,16 +44,7 @@ export interface ContractShapeMismatchReport {
|
|
|
100
44
|
/** Always `"defect"` — see the module header. Carried rather than assumed by a caller. */
|
|
101
45
|
readonly claim: ContractClaim;
|
|
102
46
|
}
|
|
103
|
-
/**
|
|
104
|
-
* The shape half's own status, carried in the payload rather than in the
|
|
105
|
-
* envelope.
|
|
106
|
-
*
|
|
107
|
-
* The call is `ok` when only the path half ran, because the path half produced
|
|
108
|
-
* a real answer over real evidence; marking the whole reply degraded because a
|
|
109
|
-
* second check did not run would hide a genuine finding behind a caveat about
|
|
110
|
-
* a different question. So `ran` is where a reader looks, and `blockers` names
|
|
111
|
-
* exactly what has to be attached before it can be true.
|
|
112
|
-
*/
|
|
47
|
+
/** Shape half's own status, carried in the payload not the envelope; the reply is `ok` when only the path half ran so a real finding isn't hidden behind a caveat. `ran`/`blockers` carry the status. */
|
|
113
48
|
export interface ContractShapeStatus {
|
|
114
49
|
readonly ran: boolean;
|
|
115
50
|
readonly comparable: number;
|
|
@@ -122,25 +57,13 @@ export interface ContractShapeStatus {
|
|
|
122
57
|
/** Never empty when `ran` is false. */
|
|
123
58
|
readonly blockers: readonly string[];
|
|
124
59
|
}
|
|
125
|
-
/**
|
|
126
|
-
* One shape, always.
|
|
127
|
-
*
|
|
128
|
-
* The counts in `checked` describe the **whole graph** even when `paths` or
|
|
129
|
-
* `files` was given: a denominator that shrank with the filter would make a
|
|
130
|
-
* narrow query look like a healthy repository. The two lists describe the
|
|
131
|
-
* filter.
|
|
132
|
-
*/
|
|
60
|
+
/** One shape, always. `checked` counts describe the whole graph even when filtered — a shrinking denominator would make a narrow query look healthy; the two lists describe the filter. */
|
|
133
61
|
export interface ContractsData {
|
|
134
62
|
readonly findings: readonly ContractPathFinding[];
|
|
135
63
|
readonly shapeMismatches: readonly ContractShapeMismatchReport[];
|
|
136
64
|
readonly checked: ContractCheck["paths"]["checked"];
|
|
137
65
|
readonly shapes: ContractShapeStatus;
|
|
138
|
-
/**
|
|
139
|
-
* Unmatched callers with nothing on the provider side resembling them.
|
|
140
|
-
*
|
|
141
|
-
* Not findings. This is the size of the region the analysis could not speak
|
|
142
|
-
* about at all.
|
|
143
|
-
*/
|
|
66
|
+
/** Unmatched callers with nothing resembling them on the provider side — not findings, the size of the region this analysis couldn't speak about. */
|
|
144
67
|
readonly unmatchedWithoutNearMiss: number;
|
|
145
68
|
/** `findings` plus `shapeMismatches` with `claim === "defect"`. What a git hook should branch on. */
|
|
146
69
|
readonly defects: number;
|