@descryy/mcp 0.5.0 → 0.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/action-handshake.d.ts +8 -75
- package/dist/action-handshake.d.ts.map +1 -1
- package/dist/action-handshake.js +9 -79
- package/dist/action-handshake.js.map +1 -1
- package/dist/bin/descry-mcp.d.ts +4 -15
- package/dist/bin/descry-mcp.d.ts.map +1 -1
- package/dist/bin/descry-mcp.js +12 -42
- package/dist/bin/descry-mcp.js.map +1 -1
- package/dist/browser/driver.d.ts +62 -178
- package/dist/browser/driver.d.ts.map +1 -1
- package/dist/browser/driver.js +14 -46
- package/dist/browser/driver.js.map +1 -1
- package/dist/browser/evidence.d.ts +11 -35
- package/dist/browser/evidence.d.ts.map +1 -1
- package/dist/browser/evidence.js +25 -51
- package/dist/browser/evidence.js.map +1 -1
- package/dist/browser/fake-driver.d.ts +12 -16
- package/dist/browser/fake-driver.d.ts.map +1 -1
- package/dist/browser/fake-driver.js +24 -17
- package/dist/browser/fake-driver.js.map +1 -1
- package/dist/browser/graph-write.d.ts +4 -45
- package/dist/browser/graph-write.d.ts.map +1 -1
- package/dist/browser/graph-write.js +8 -53
- package/dist/browser/graph-write.js.map +1 -1
- package/dist/browser/playwright-driver.d.ts +17 -67
- package/dist/browser/playwright-driver.d.ts.map +1 -1
- package/dist/browser/playwright-driver.js +169 -166
- package/dist/browser/playwright-driver.js.map +1 -1
- package/dist/browser/provider.d.ts +5 -34
- package/dist/browser/provider.d.ts.map +1 -1
- package/dist/browser/provider.js +4 -24
- package/dist/browser/provider.js.map +1 -1
- package/dist/browser/registry.d.ts +26 -106
- package/dist/browser/registry.d.ts.map +1 -1
- package/dist/browser/registry.js +20 -77
- package/dist/browser/registry.js.map +1 -1
- package/dist/browser/scenario-resolve.d.ts +10 -44
- package/dist/browser/scenario-resolve.d.ts.map +1 -1
- package/dist/browser/scenario-resolve.js +10 -41
- package/dist/browser/scenario-resolve.js.map +1 -1
- package/dist/browser/scenario-runner.d.ts +12 -70
- package/dist/browser/scenario-runner.d.ts.map +1 -1
- package/dist/browser/scenario-runner.js +33 -91
- package/dist/browser/scenario-runner.js.map +1 -1
- package/dist/browser/stack-parser.d.ts +4 -28
- package/dist/browser/stack-parser.d.ts.map +1 -1
- package/dist/browser/stack-parser.js +12 -39
- package/dist/browser/stack-parser.js.map +1 -1
- package/dist/browser/tool-support.d.ts +20 -67
- package/dist/browser/tool-support.d.ts.map +1 -1
- package/dist/browser/tool-support.js +22 -66
- package/dist/browser/tool-support.js.map +1 -1
- package/dist/browser/url-scheme.d.ts +14 -0
- package/dist/browser/url-scheme.d.ts.map +1 -0
- package/dist/browser/url-scheme.js +38 -0
- package/dist/browser/url-scheme.js.map +1 -0
- package/dist/cancellation.d.ts +11 -46
- package/dist/cancellation.d.ts.map +1 -1
- package/dist/cancellation.js +11 -46
- package/dist/cancellation.js.map +1 -1
- package/dist/capped.d.ts +17 -0
- package/dist/capped.d.ts.map +1 -0
- package/dist/capped.js +15 -0
- package/dist/capped.js.map +1 -0
- package/dist/disclosure-ledger.d.ts +6 -30
- package/dist/disclosure-ledger.d.ts.map +1 -1
- package/dist/disclosure-ledger.js +4 -26
- package/dist/disclosure-ledger.js.map +1 -1
- package/dist/index.d.ts +10 -26
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -17
- package/dist/index.js.map +1 -1
- package/dist/module-trust.d.ts +24 -0
- package/dist/module-trust.d.ts.map +1 -0
- package/dist/module-trust.js +60 -0
- package/dist/module-trust.js.map +1 -0
- package/dist/path-confinement.d.ts +31 -0
- package/dist/path-confinement.d.ts.map +1 -0
- package/dist/path-confinement.js +44 -0
- package/dist/path-confinement.js.map +1 -0
- package/dist/protocol.d.ts +10 -53
- package/dist/protocol.d.ts.map +1 -1
- package/dist/protocol.js +14 -60
- package/dist/protocol.js.map +1 -1
- package/dist/registry.d.ts +10 -58
- package/dist/registry.d.ts.map +1 -1
- package/dist/registry.js +38 -90
- package/dist/registry.js.map +1 -1
- package/dist/render.d.ts +79 -11
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +126 -14
- package/dist/render.js.map +1 -1
- package/dist/runtime-registry.d.ts +8 -49
- package/dist/runtime-registry.d.ts.map +1 -1
- package/dist/runtime-registry.js +72 -63
- package/dist/runtime-registry.js.map +1 -1
- package/dist/scenarios/index.d.ts +1 -1
- package/dist/scenarios/index.d.ts.map +1 -1
- package/dist/scenarios/index.js +1 -1
- package/dist/scenarios/index.js.map +1 -1
- package/dist/scenarios/parse.d.ts +4 -18
- package/dist/scenarios/parse.d.ts.map +1 -1
- package/dist/scenarios/parse.js +14 -34
- package/dist/scenarios/parse.js.map +1 -1
- package/dist/scenarios/scenario.d.ts +18 -74
- package/dist/scenarios/scenario.d.ts.map +1 -1
- package/dist/scenarios/scenario.js +7 -34
- package/dist/scenarios/scenario.js.map +1 -1
- package/dist/scenarios/storage.d.ts +11 -41
- package/dist/scenarios/storage.d.ts.map +1 -1
- package/dist/scenarios/storage.js +57 -47
- package/dist/scenarios/storage.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +55 -13
- package/dist/server.js.map +1 -1
- package/dist/session.d.ts +69 -239
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +76 -231
- package/dist/session.js.map +1 -1
- package/dist/tools/analyze.d.ts +27 -101
- package/dist/tools/analyze.d.ts.map +1 -1
- package/dist/tools/analyze.js +58 -148
- package/dist/tools/analyze.js.map +1 -1
- package/dist/tools/browser-click.d.ts +3 -21
- package/dist/tools/browser-click.d.ts.map +1 -1
- package/dist/tools/browser-click.js +10 -31
- package/dist/tools/browser-click.js.map +1 -1
- package/dist/tools/browser-close-session.d.ts +4 -13
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +4 -13
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-fill.d.ts +5 -36
- package/dist/tools/browser-fill.d.ts.map +1 -1
- package/dist/tools/browser-fill.js +9 -44
- package/dist/tools/browser-fill.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +6 -27
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +6 -23
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-run-scenario.d.ts +5 -31
- package/dist/tools/browser-run-scenario.d.ts.map +1 -1
- package/dist/tools/browser-run-scenario.js +10 -46
- package/dist/tools/browser-run-scenario.js.map +1 -1
- package/dist/tools/browser-save-scenario.d.ts +3 -28
- package/dist/tools/browser-save-scenario.d.ts.map +1 -1
- package/dist/tools/browser-save-scenario.js +102 -55
- package/dist/tools/browser-save-scenario.js.map +1 -1
- package/dist/tools/browser-snapshot.d.ts +6 -39
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +4 -31
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-start-session.d.ts +4 -23
- package/dist/tools/browser-start-session.d.ts.map +1 -1
- package/dist/tools/browser-start-session.js +38 -51
- package/dist/tools/browser-start-session.js.map +1 -1
- package/dist/tools/browser-type.d.ts +5 -35
- package/dist/tools/browser-type.d.ts.map +1 -1
- package/dist/tools/browser-type.js +10 -45
- package/dist/tools/browser-type.js.map +1 -1
- package/dist/tools/contracts.d.ts +17 -63
- package/dist/tools/contracts.d.ts.map +1 -1
- package/dist/tools/contracts.js +91 -47
- package/dist/tools/contracts.js.map +1 -1
- package/dist/tools/cross-pr.d.ts +56 -15
- package/dist/tools/cross-pr.d.ts.map +1 -1
- package/dist/tools/cross-pr.js +141 -38
- package/dist/tools/cross-pr.js.map +1 -1
- package/dist/tools/git-diff.d.ts +18 -2
- package/dist/tools/git-diff.d.ts.map +1 -1
- package/dist/tools/git-diff.js +143 -23
- package/dist/tools/git-diff.js.map +1 -1
- package/dist/tools/git-history.d.ts +5 -16
- package/dist/tools/git-history.d.ts.map +1 -1
- package/dist/tools/git-history.js +3 -10
- package/dist/tools/git-history.js.map +1 -1
- package/dist/tools/history.d.ts +4 -33
- package/dist/tools/history.d.ts.map +1 -1
- package/dist/tools/history.js +6 -31
- package/dist/tools/history.js.map +1 -1
- package/dist/tools/impact.d.ts +7 -51
- package/dist/tools/impact.d.ts.map +1 -1
- package/dist/tools/impact.js +15 -67
- package/dist/tools/impact.js.map +1 -1
- package/dist/tools/index.d.ts +3 -8
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +3 -8
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +66 -113
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js +60 -28
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/link-workspace.d.ts +7 -45
- package/dist/tools/link-workspace.d.ts.map +1 -1
- package/dist/tools/link-workspace.js +10 -48
- package/dist/tools/link-workspace.js.map +1 -1
- package/dist/tools/lookup.d.ts +4 -14
- package/dist/tools/lookup.d.ts.map +1 -1
- package/dist/tools/lookup.js +4 -14
- package/dist/tools/lookup.js.map +1 -1
- package/dist/tools/mark-incident.d.ts +7 -54
- package/dist/tools/mark-incident.d.ts.map +1 -1
- package/dist/tools/mark-incident.js +15 -68
- package/dist/tools/mark-incident.js.map +1 -1
- package/dist/tools/observe-runtime.d.ts +27 -210
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +258 -436
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +9 -88
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +34 -108
- package/dist/tools/observe-tests.js.map +1 -1
- package/dist/tools/pr-analysis.d.ts +18 -2
- package/dist/tools/pr-analysis.d.ts.map +1 -1
- package/dist/tools/pr-analysis.js +73 -23
- package/dist/tools/pr-analysis.js.map +1 -1
- package/dist/tools/pre-push.d.ts +94 -9
- package/dist/tools/pre-push.d.ts.map +1 -1
- package/dist/tools/pre-push.js +139 -34
- package/dist/tools/pre-push.js.map +1 -1
- package/dist/tools/propagation.d.ts +11 -53
- package/dist/tools/propagation.d.ts.map +1 -1
- package/dist/tools/propagation.js +14 -57
- package/dist/tools/propagation.js.map +1 -1
- package/dist/tools/questions.d.ts +13 -63
- package/dist/tools/questions.d.ts.map +1 -1
- package/dist/tools/questions.js +33 -105
- package/dist/tools/questions.js.map +1 -1
- package/dist/tools/refusal-fetch.d.ts +4 -40
- package/dist/tools/refusal-fetch.d.ts.map +1 -1
- package/dist/tools/refusal-fetch.js +4 -40
- package/dist/tools/refusal-fetch.js.map +1 -1
- package/dist/tools/runtime-incident.d.ts +4 -63
- package/dist/tools/runtime-incident.d.ts.map +1 -1
- package/dist/tools/runtime-incident.js +10 -87
- package/dist/tools/runtime-incident.js.map +1 -1
- package/dist/tools/scope.d.ts +7 -25
- package/dist/tools/scope.d.ts.map +1 -1
- package/dist/tools/scope.js +17 -20
- package/dist/tools/scope.js.map +1 -1
- package/dist/tools/similar-incidents.d.ts +11 -86
- package/dist/tools/similar-incidents.d.ts.map +1 -1
- package/dist/tools/similar-incidents.js +7 -71
- package/dist/tools/similar-incidents.js.map +1 -1
- package/dist/tools/validate.d.ts +31 -47
- package/dist/tools/validate.d.ts.map +1 -1
- package/dist/tools/validate.js +133 -61
- package/dist/tools/validate.js.map +1 -1
- package/dist/tools/verification-status.d.ts +9 -64
- package/dist/tools/verification-status.d.ts.map +1 -1
- package/dist/tools/verification-status.js +9 -62
- package/dist/tools/verification-status.js.map +1 -1
- package/dist/tools/verify-claim.d.ts +5 -52
- package/dist/tools/verify-claim.d.ts.map +1 -1
- package/dist/tools/verify-claim.js +6 -56
- package/dist/tools/verify-claim.js.map +1 -1
- package/dist/transport.d.ts +15 -52
- package/dist/transport.d.ts.map +1 -1
- package/dist/transport.js +16 -60
- package/dist/transport.js.map +1 -1
- package/package.json +33 -16
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-start-session.js","sourceRoot":"","sources":["../../src/tools/browser-start-session.ts"],"names":[],"mappings":"A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AK;SACtB;KACF,CAAC,CAAC;AACL,CAAC;AAED,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,IAAI,EAAE,uBAAuB;IAC7B,KAAK,EAAE,wBAAwB;IAC/B,WAAW,EACT,qGAAqG;QACrG,wGAAwG;QACxG,mGAAmG;QACnG,uGAAuG;QACvG,0BAA0B;IAC5B,KAAK,EAAE,QAAQ;IACf,IAAI,EAAE,UAAU;IAChB,OAAO,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;AAYj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-
*
|
|
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.
|
|
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.
|
|
23
5
|
*/
|
|
24
|
-
import type { ContractCheck, ContractFindingKind, EndpointKey, NearMissKind, ShapeDifference, ShapeDirection } from "@descryy/core";
|
|
6
|
+
import type { ContractCheck, ContractClaim, ContractFindingKind, EndpointKey, NearMissKind, ShapeDifference, ShapeDirection } from "@descryy/core";
|
|
25
7
|
import type { ResolutionLevel } from "@descryy/ir";
|
|
26
8
|
import { type BriefNode, type ToolDefinition } from "./kit.ts";
|
|
27
9
|
/** A call that reaches no route, or a route nothing calls. */
|
|
28
10
|
export interface ContractPathFinding {
|
|
29
11
|
readonly kind: ContractFindingKind;
|
|
12
|
+
/** `defect` (provable from this graph alone) or `lead` (needs outside knowledge) — see module header. */
|
|
13
|
+
readonly claim: ContractClaim;
|
|
30
14
|
/** 1-based position in this answer. See {@link ContractPathFinding.prominence} for what orders it. */
|
|
31
15
|
readonly rank: number;
|
|
32
|
-
/**
|
|
33
|
-
* `top` / `notable` / `rest`, ordered by **evidence strength** — the
|
|
34
|
-
* finding's own `resolution`, strongest first — and not by severity.
|
|
35
|
-
*
|
|
36
|
-
* Descry has no severity model for a contract finding and inventing one here
|
|
37
|
-
* would be a judgement dressed as a measurement: a call reaching no route and
|
|
38
|
-
* a route nothing calls are different problems, and which matters more is a
|
|
39
|
-
* fact about the codebase, not about the graph. What the graph does know is
|
|
40
|
-
* how well-resolved each finding is, and a reader triaging a list is better
|
|
41
|
-
* served by "this one rests on the strongest evidence" than by an invented
|
|
42
|
-
* ranking. The tool's own notes say this rather than leaving it inferred.
|
|
43
|
-
*/
|
|
16
|
+
/** `top`/`notable`/`rest`, ordered by evidence strength (own `resolution`), not `claim` — a claim-based ranking would be judgement dressed as measurement. */
|
|
44
17
|
readonly prominence: "top" | "notable" | "rest";
|
|
45
18
|
readonly method: string;
|
|
46
19
|
/** The normalised path template, not the raw literal. */
|
|
@@ -48,12 +21,7 @@ export interface ContractPathFinding {
|
|
|
48
21
|
readonly detail: string;
|
|
49
22
|
/** Lowest resolution among the edges this finding rests on. Caps its class. */
|
|
50
23
|
readonly resolution: ResolutionLevel;
|
|
51
|
-
/**
|
|
52
|
-
* Absent when nothing on the other side resembles this endpoint.
|
|
53
|
-
*
|
|
54
|
-
* Its absence is what separates a typo from a call into a service outside
|
|
55
|
-
* this graph — the second is disclosed as unanalysed, never reported broken.
|
|
56
|
-
*/
|
|
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). */
|
|
57
25
|
readonly nearMiss?: {
|
|
58
26
|
readonly kind: NearMissKind;
|
|
59
27
|
readonly against: EndpointKey;
|
|
@@ -73,17 +41,10 @@ export interface ContractShapeMismatchReport {
|
|
|
73
41
|
readonly writer: BriefNode;
|
|
74
42
|
readonly differences: readonly ShapeDifference[];
|
|
75
43
|
readonly resolution: ResolutionLevel;
|
|
44
|
+
/** Always `"defect"` — see the module header. Carried rather than assumed by a caller. */
|
|
45
|
+
readonly claim: ContractClaim;
|
|
76
46
|
}
|
|
77
|
-
/**
|
|
78
|
-
* The shape half's own status, carried in the payload rather than in the
|
|
79
|
-
* envelope.
|
|
80
|
-
*
|
|
81
|
-
* The call is `ok` when only the path half ran, because the path half produced
|
|
82
|
-
* a real answer over real evidence; marking the whole reply degraded because a
|
|
83
|
-
* second check did not run would hide a genuine finding behind a caveat about
|
|
84
|
-
* a different question. So `ran` is where a reader looks, and `blockers` names
|
|
85
|
-
* exactly what has to be attached before it can be true.
|
|
86
|
-
*/
|
|
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. */
|
|
87
48
|
export interface ContractShapeStatus {
|
|
88
49
|
readonly ran: boolean;
|
|
89
50
|
readonly comparable: number;
|
|
@@ -96,25 +57,18 @@ export interface ContractShapeStatus {
|
|
|
96
57
|
/** Never empty when `ran` is false. */
|
|
97
58
|
readonly blockers: readonly string[];
|
|
98
59
|
}
|
|
99
|
-
/**
|
|
100
|
-
* One shape, always.
|
|
101
|
-
*
|
|
102
|
-
* The counts in `checked` describe the **whole graph** even when `paths` was
|
|
103
|
-
* given: a denominator that shrank with the filter would make a narrow query
|
|
104
|
-
* look like a healthy repository. The two lists describe the filter.
|
|
105
|
-
*/
|
|
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. */
|
|
106
61
|
export interface ContractsData {
|
|
107
62
|
readonly findings: readonly ContractPathFinding[];
|
|
108
63
|
readonly shapeMismatches: readonly ContractShapeMismatchReport[];
|
|
109
64
|
readonly checked: ContractCheck["paths"]["checked"];
|
|
110
65
|
readonly shapes: ContractShapeStatus;
|
|
111
|
-
/**
|
|
112
|
-
* Unmatched callers with nothing on the provider side resembling them.
|
|
113
|
-
*
|
|
114
|
-
* Not findings. This is the size of the region the analysis could not speak
|
|
115
|
-
* about at all.
|
|
116
|
-
*/
|
|
66
|
+
/** Unmatched callers with nothing resembling them on the provider side — not findings, the size of the region this analysis couldn't speak about. */
|
|
117
67
|
readonly unmatchedWithoutNearMiss: number;
|
|
68
|
+
/** `findings` plus `shapeMismatches` with `claim === "defect"`. What a git hook should branch on. */
|
|
69
|
+
readonly defects: number;
|
|
70
|
+
/** `findings` with `claim === "lead"` — worth a look, never counted as blocking. */
|
|
71
|
+
readonly leads: number;
|
|
118
72
|
}
|
|
119
73
|
export declare const contractsTool: ToolDefinition;
|
|
120
74
|
//# sourceMappingURL=contracts.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"contracts.d.ts","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EACV,aAAa,EACb,aAAa,EACb,mBAAmB,EACnB,WAAW,EACX,YAAY,EACZ,eAAe,EACf,cAAc,EACf,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,aAAa,CAAC;AAE3D,OAAO,EAIL,KAAK,SAAS,EAEd,KAAK,cAAc,EACpB,MAAM,UAAU,CAAC;AAGlB,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,QAAQ,CAAC,IAAI,EAAE,mBAAmB,CAAC;IACnC,yGAAyG;IACzG,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,sGAAsG;IACtG,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,8JAA8J;IAC9J,QAAQ,CAAC,UAAU,EAAE,KAAK,GAAG,SAAS,GAAG,MAAM,CAAC;IAChD,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,yDAAyD;IACzD,QAAQ,CAAC,IAAI,EAAE,M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WAAW,aAAa;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,mBAAmB,EAAE,CAAC;IAClD,QAAQ,CAAC,eAAe,EAAE,SAAS,2BAA2B,EAAE,CAAC;IACjE,QAAQ,CAAC,OAAO,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC,SAAS,CAAC,CAAC;IACpD,QAAQ,CAAC,MAAM,EAAE,mBAAmB,CAAC;IACrC,qJAAqJ;IACrJ,QAAQ,CAAC,wBAAwB,EAAE,MAAM,CAAC;IAC1C,qGAAqG;IACrG,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,oFAAoF;IACpF,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB;AAiND,eAAO,MAAM,aAAa,EAAE,cAe3B,CAAC"}
|
package/dist/tools/contracts.js
CHANGED
|
@@ -1,25 +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.
|
|
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.
|
|
23
5
|
*/
|
|
24
6
|
import { checkContracts, withProminence } from "@descryy/core";
|
|
25
7
|
import { briefNode, optionalInteger, optionalStringArray, } from "./kit.js";
|
|
@@ -30,7 +12,14 @@ const SCHEMA = {
|
|
|
30
12
|
type: "array",
|
|
31
13
|
items: { type: "string" },
|
|
32
14
|
description: "Restrict the report to endpoints whose normalised path template contains one of these " +
|
|
33
|
-
"substrings, e.g. \"/orders\".",
|
|
15
|
+
"substrings, e.g. \"/orders\". Matching zero endpoints is reported as empty, not clean.",
|
|
16
|
+
},
|
|
17
|
+
files: {
|
|
18
|
+
type: "array",
|
|
19
|
+
items: { type: "string" },
|
|
20
|
+
description: "Restrict the report to findings touching these repo-relative source files — e.g. what a " +
|
|
21
|
+
"git hook is about to push. A finding is kept when any caller, route, or (for a shape " +
|
|
22
|
+
"mismatch) reader/writer node's file is in this set.",
|
|
34
23
|
},
|
|
35
24
|
pathsOnly: {
|
|
36
25
|
type: "boolean",
|
|
@@ -45,40 +34,71 @@ const SCHEMA = {
|
|
|
45
34
|
},
|
|
46
35
|
additionalProperties: false,
|
|
47
36
|
};
|
|
37
|
+
/** True when at least one of `nodes` has a `file` in `scope`. No scope given means every node passes. */
|
|
38
|
+
function touchesFiles(nodes, scope) {
|
|
39
|
+
return scope === undefined || nodes.some((n) => n.file !== null && scope.includes(n.file));
|
|
40
|
+
}
|
|
48
41
|
async function run(args, ctx) {
|
|
49
42
|
const filters = optionalStringArray(args, "paths");
|
|
43
|
+
const fileScope = optionalStringArray(args, "files");
|
|
50
44
|
const maxFindings = optionalInteger(args, "maxFindings", 1);
|
|
51
45
|
const pathsOnly = args["pathsOnly"] === true;
|
|
46
|
+
const provider = ctx.session.provider();
|
|
52
47
|
ctx.progress("Matching callers against routes");
|
|
53
|
-
const checked = checkContracts(
|
|
48
|
+
const checked = checkContracts(provider, {
|
|
54
49
|
...(maxFindings === undefined ? {} : { maxFindings }),
|
|
55
50
|
...(pathsOnly ? { pathsOnly: true } : {}),
|
|
56
51
|
});
|
|
57
52
|
const { paths, shapes } = checked.data;
|
|
58
53
|
const notes = [...checked.notes];
|
|
59
|
-
// Filtering happens after the check
|
|
60
|
-
//
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
const mismatches = shapes.mismatches.filter((m) => matches(String(m.endpoint.attrs["pathTemplate"] ?? m.endpoint.name)));
|
|
54
|
+
// Filtering happens after the check so the counts describe the whole graph
|
|
55
|
+
// — a shrinking denominator would make a narrow query look healthy.
|
|
56
|
+
const matchesPath = (template) => filters === undefined || filters.some((f) => template.includes(f));
|
|
57
|
+
const findings = paths.findings.filter((f) => matchesPath(f.pathTemplate) && touchesFiles([...f.callers, ...f.routes], fileScope));
|
|
58
|
+
const mismatches = shapes.mismatches.filter((m) => matchesPath(String(m.endpoint.attrs["pathTemplate"] ?? m.endpoint.name)) &&
|
|
59
|
+
touchesFiles([m.reader, m.writer], fileScope));
|
|
66
60
|
if (filters !== undefined) {
|
|
67
61
|
notes.push(`Filtered to endpoints matching ${filters.map((f) => `"${f}"`).join(", ")}. The counts ` +
|
|
68
62
|
"below describe the whole graph; the lists describe the filter.");
|
|
69
63
|
}
|
|
70
|
-
|
|
64
|
+
if (fileScope !== undefined) {
|
|
65
|
+
notes.push(`Filtered to findings touching ${fileScope.length} named file(s). The counts below describe ` +
|
|
66
|
+
"the whole graph; the lists describe the filter.");
|
|
67
|
+
}
|
|
68
|
+
// A `paths` filter matching zero endpoints means it named something never
|
|
69
|
+
// parsed as a route/endpoint — a different claim than "checked, fine."
|
|
70
|
+
// API_ROUTE is checked too: an unmounted route has no API_ENDPOINT at all.
|
|
71
|
+
let pathsMatchedNothing = false;
|
|
72
|
+
if (filters !== undefined) {
|
|
73
|
+
const endpoints = provider.nodesOfType("API_ENDPOINT");
|
|
74
|
+
const routes = provider.nodesOfType("API_ROUTE");
|
|
75
|
+
const matched = (n) => matchesPath(String(n.attrs["pathTemplate"] ?? n.name));
|
|
76
|
+
pathsMatchedNothing = !endpoints.nodes.some(matched) && !routes.nodes.some(matched);
|
|
77
|
+
}
|
|
78
|
+
const defects = findings.filter((f) => f.claim === "defect").length + mismatches.length;
|
|
79
|
+
const leads = findings.filter((f) => f.claim === "lead").length;
|
|
71
80
|
if (findings.length > 0) {
|
|
72
81
|
notes.push("findings are ranked by evidence strength — their own resolution, strongest first — not by " +
|
|
73
|
-
"
|
|
74
|
-
"
|
|
82
|
+
"claim. A call reaching no route and a route nothing calls can each rest on strong or weak " +
|
|
83
|
+
"evidence; which of them is a defect versus a lead is a separate axis (claim), not a ranking.");
|
|
75
84
|
}
|
|
76
|
-
|
|
77
|
-
//
|
|
78
|
-
//
|
|
79
|
-
|
|
80
|
-
//
|
|
81
|
-
|
|
85
|
+
// Zero API_ENDPOINT nodes usually means nothing to check — but not when the
|
|
86
|
+
// mount check found an independent ROUTE_NOT_MOUNTED finding with no
|
|
87
|
+
// endpoint in the graph; refusing then would bury a real finding.
|
|
88
|
+
const nothingToCheck = paths.checked.endpoints === 0 && paths.findingsTotal === 0;
|
|
89
|
+
// MK-7: graded on `claim` — a lead is worth a look; a defect is provable
|
|
90
|
+
// from this graph alone (`nearMiss` keeps a mere typo out of the count).
|
|
91
|
+
const verdict = defects > 0
|
|
92
|
+
? `${defects} defect(s) found`
|
|
93
|
+
: leads > 0
|
|
94
|
+
? `No defects; ${leads} lead(s) to review`
|
|
95
|
+
: "Clean at path level";
|
|
96
|
+
// render.ts refuses a `truncated` answer with no `truncatedDetail`, so this
|
|
97
|
+
// must be supplied whenever `checked.truncated` is set; `total` is the
|
|
98
|
+
// whole unfiltered graph, an honest upper bound on `shown`.
|
|
99
|
+
const truncatedDetail = checked.truncated
|
|
100
|
+
? { shown: findings.length, total: Math.max(paths.findingsTotal, findings.length), more: null }
|
|
101
|
+
: undefined;
|
|
82
102
|
return {
|
|
83
103
|
result: {
|
|
84
104
|
...checked,
|
|
@@ -91,6 +111,9 @@ async function run(args, ctx) {
|
|
|
91
111
|
.sort((a, b) => b.resolution - a.resolution)
|
|
92
112
|
.map((f) => ({
|
|
93
113
|
kind: f.kind,
|
|
114
|
+
// Whether this asserts a fault. Carried as a field because the
|
|
115
|
+
// sentence below already said it and nothing could read prose.
|
|
116
|
+
claim: f.claim,
|
|
94
117
|
method: f.method,
|
|
95
118
|
path: f.pathTemplate,
|
|
96
119
|
detail: f.detail,
|
|
@@ -108,6 +131,11 @@ async function run(args, ctx) {
|
|
|
108
131
|
writer: briefNode(m.writer),
|
|
109
132
|
differences: m.differences,
|
|
110
133
|
resolution: m.resolution,
|
|
134
|
+
// A field the reading side needs and the writing side does not
|
|
135
|
+
// supply. There is no benign reading of that, so every mismatch is a
|
|
136
|
+
// fault claim — unlike an uncalled route, whose usual explanation is
|
|
137
|
+
// a consumer outside the graph.
|
|
138
|
+
claim: m.claim,
|
|
111
139
|
})),
|
|
112
140
|
checked: paths.checked,
|
|
113
141
|
shapes: {
|
|
@@ -119,19 +147,35 @@ async function run(args, ctx) {
|
|
|
119
147
|
blockers: shapes.blockers,
|
|
120
148
|
},
|
|
121
149
|
unmatchedWithoutNearMiss: paths.unmatchedWithoutNearMiss,
|
|
150
|
+
defects,
|
|
151
|
+
leads,
|
|
122
152
|
},
|
|
123
|
-
notes
|
|
153
|
+
notes: pathsMatchedNothing
|
|
154
|
+
? [
|
|
155
|
+
`0 endpoint(s) matched ${(filters ?? []).map((f) => `"${f}"`).join(", ")}. Nothing in ` +
|
|
156
|
+
"this graph was parsed as a route or endpoint under that filter, so there is nothing " +
|
|
157
|
+
"for \"clean\" to describe — this is not a statement about whether the endpoint you " +
|
|
158
|
+
"meant is correct.",
|
|
159
|
+
...notes,
|
|
160
|
+
]
|
|
161
|
+
: notes,
|
|
124
162
|
},
|
|
125
|
-
// A path finding is a claim
|
|
126
|
-
//
|
|
127
|
-
//
|
|
128
|
-
// claim, which is the path half.
|
|
163
|
+
// A path finding is a name-level claim (R2 fully supports); a shape
|
|
164
|
+
// mismatch is not — `engine.ts` caps each individually. This flags the
|
|
165
|
+
// answer's own headline claim, the path half.
|
|
129
166
|
nameLevel: true,
|
|
130
|
-
...(
|
|
167
|
+
...(truncatedDetail === undefined ? {} : { truncatedDetail }),
|
|
168
|
+
...(nothingToCheck
|
|
169
|
+
? { state: "refused" }
|
|
170
|
+
: pathsMatchedNothing
|
|
171
|
+
? { state: "empty" }
|
|
172
|
+
: {}),
|
|
131
173
|
headline: nothingToCheck
|
|
132
174
|
? "No API endpoints are in the graph, so there is no contract to check."
|
|
133
|
-
:
|
|
134
|
-
`
|
|
175
|
+
: pathsMatchedNothing
|
|
176
|
+
? `0 endpoint(s) matched this filter. Not checked, not clean.`
|
|
177
|
+
: `${verdict}. ${paths.checked.joined} of ${paths.checked.endpoints} endpoint(s) have both ` +
|
|
178
|
+
`a caller and a route${shapes.ran ? "" : "; request and response shapes were not compared"}.`,
|
|
135
179
|
};
|
|
136
180
|
}
|
|
137
181
|
export const contractsTool = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"contracts.js","sourceRoot":"","sources":["../../src/tools/contracts.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAY/D,OAAO,EACL,SAAS,EACT,eAAe,EACf,mBAAmB,GAIpB,MAAM,UAAU,CAAC;AAoElB,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,KAAK,EAAE;YACL,IAAI,EAAE,OAAO;YACb,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;YACzB,WAAW,EACT,wFAAwF;gBACxF,wFAAwF;SAC3F;QACD,KAAK,EAAE;YAC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