@descryy/mcp 0.11.1 → 0.11.2
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/render.d.ts +7 -11
- package/dist/render.d.ts.map +1 -1
- package/dist/render.js +22 -2
- package/dist/render.js.map +1 -1
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +13 -2
- package/dist/server.js.map +1 -1
- package/dist/tools/alias-kit.d.ts +29 -0
- package/dist/tools/alias-kit.d.ts.map +1 -0
- package/dist/tools/alias-kit.js +21 -0
- package/dist/tools/alias-kit.js.map +1 -0
- package/dist/tools/aliases.d.ts +42 -0
- package/dist/tools/aliases.d.ts.map +1 -0
- package/dist/tools/aliases.js +52 -0
- package/dist/tools/aliases.js.map +1 -0
- package/dist/tools/browser-close-session.d.ts +5 -1
- package/dist/tools/browser-close-session.d.ts.map +1 -1
- package/dist/tools/browser-close-session.js +3 -1
- package/dist/tools/browser-close-session.js.map +1 -1
- package/dist/tools/browser-navigate.d.ts +5 -1
- package/dist/tools/browser-navigate.d.ts.map +1 -1
- package/dist/tools/browser-navigate.js +3 -1
- package/dist/tools/browser-navigate.js.map +1 -1
- package/dist/tools/browser-read.d.ts +33 -0
- package/dist/tools/browser-read.d.ts.map +1 -0
- package/dist/tools/browser-read.js +113 -0
- package/dist/tools/browser-read.js.map +1 -0
- package/dist/tools/browser-snapshot.d.ts +5 -2
- package/dist/tools/browser-snapshot.d.ts.map +1 -1
- package/dist/tools/browser-snapshot.js +3 -1
- package/dist/tools/browser-snapshot.js.map +1 -1
- package/dist/tools/browser-wait-for.d.ts +5 -1
- package/dist/tools/browser-wait-for.d.ts.map +1 -1
- package/dist/tools/browser-wait-for.js +3 -1
- package/dist/tools/browser-wait-for.js.map +1 -1
- package/dist/tools/browser.d.ts +69 -0
- package/dist/tools/browser.d.ts.map +1 -0
- package/dist/tools/browser.js +377 -0
- package/dist/tools/browser.js.map +1 -0
- package/dist/tools/change-scope.d.ts +25 -0
- package/dist/tools/change-scope.d.ts.map +1 -0
- package/dist/tools/change-scope.js +110 -0
- package/dist/tools/change-scope.js.map +1 -0
- package/dist/tools/code-context.d.ts +83 -0
- package/dist/tools/code-context.d.ts.map +1 -0
- package/dist/tools/code-context.js +416 -0
- package/dist/tools/code-context.js.map +1 -0
- package/dist/tools/disclosure.d.ts +75 -0
- package/dist/tools/disclosure.d.ts.map +1 -0
- package/dist/tools/disclosure.js +288 -0
- package/dist/tools/disclosure.js.map +1 -0
- package/dist/tools/draw-conclusion.d.ts +12 -1
- package/dist/tools/draw-conclusion.d.ts.map +1 -1
- package/dist/tools/draw-conclusion.js +11 -2
- package/dist/tools/draw-conclusion.js.map +1 -1
- package/dist/tools/git-context.d.ts +39 -0
- package/dist/tools/git-context.d.ts.map +1 -0
- package/dist/tools/git-context.js +364 -0
- package/dist/tools/git-context.js.map +1 -0
- package/dist/tools/index.d.ts +15 -6
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +41 -67
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/kit.d.ts +3 -2
- package/dist/tools/kit.d.ts.map +1 -1
- package/dist/tools/kit.js.map +1 -1
- package/dist/tools/merged-browser.d.ts +11 -0
- package/dist/tools/merged-browser.d.ts.map +1 -0
- package/dist/tools/merged-browser.js +20 -0
- package/dist/tools/merged-browser.js.map +1 -0
- package/dist/tools/merged-context.d.ts +11 -0
- package/dist/tools/merged-context.d.ts.map +1 -0
- package/dist/tools/merged-context.js +21 -0
- package/dist/tools/merged-context.js.map +1 -0
- package/dist/tools/merged-observe.d.ts +13 -0
- package/dist/tools/merged-observe.d.ts.map +1 -0
- package/dist/tools/merged-observe.js +21 -0
- package/dist/tools/merged-observe.js.map +1 -0
- package/dist/tools/merged-workspace.d.ts +14 -0
- package/dist/tools/merged-workspace.d.ts.map +1 -0
- package/dist/tools/merged-workspace.js +21 -0
- package/dist/tools/merged-workspace.js.map +1 -0
- package/dist/tools/observe-runtime.d.ts +11 -1
- package/dist/tools/observe-runtime.d.ts.map +1 -1
- package/dist/tools/observe-runtime.js +6 -2
- package/dist/tools/observe-runtime.js.map +1 -1
- package/dist/tools/observe-tests.d.ts +12 -1
- package/dist/tools/observe-tests.d.ts.map +1 -1
- package/dist/tools/observe-tests.js +6 -2
- package/dist/tools/observe-tests.js.map +1 -1
- package/dist/tools/observe.d.ts +28 -0
- package/dist/tools/observe.d.ts.map +1 -0
- package/dist/tools/observe.js +285 -0
- package/dist/tools/observe.js.map +1 -0
- package/dist/tools/verb.d.ts +46 -0
- package/dist/tools/verb.d.ts.map +1 -0
- package/dist/tools/verb.js +78 -0
- package/dist/tools/verb.js.map +1 -0
- package/dist/tools/workspace.d.ts +28 -0
- package/dist/tools/workspace.d.ts.map +1 -0
- package/dist/tools/workspace.js +101 -0
- package/dist/tools/workspace.js.map +1 -0
- package/package.json +3 -3
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `browser_read` — merges the four browser tools that read a page without needing consent of
|
|
3
|
+
* their own: `browser_snapshot`, `browser_navigate`, `browser_wait_for`, `browser_close_session`
|
|
4
|
+
* (documents/plans/mcp-surface-consolidation.md, group 2).
|
|
5
|
+
*
|
|
6
|
+
* `class: "stateful-read"` — deliberately not `action`. None of the four mutates the application;
|
|
7
|
+
* the developer's consent for driving it was already given at `browser_start_session`. What they
|
|
8
|
+
* DO change is what a *later* call in the same session sees (each takes a fresh snapshot, which
|
|
9
|
+
* invalidates every ref issued before it) — that is what "stateful" means here, and it is why
|
|
10
|
+
* `browser_snapshot` was never `read`-class to begin with. Declaring `browser_read` as `action`
|
|
11
|
+
* would put a plain read behind a confirmation handshake it has never needed; the other eight
|
|
12
|
+
* `browser_*` verbs (the ones that DO mutate) are a separate merge, owned elsewhere, and are not
|
|
13
|
+
* touched by this file.
|
|
14
|
+
*
|
|
15
|
+
* Dispatches on "verb" to each absorbed tool's exact `run` body — extracted, not reimplemented,
|
|
16
|
+
* so behaviour is unchanged per verb.
|
|
17
|
+
*/
|
|
18
|
+
import type { ToolDefinition } from "./kit.ts";
|
|
19
|
+
import type { BrowserPageData } from "./browser-snapshot.ts";
|
|
20
|
+
import type { BrowserNavigateData } from "./browser-navigate.ts";
|
|
21
|
+
import type { BrowserWaitForData } from "./browser-wait-for.ts";
|
|
22
|
+
import type { BrowserCloseSessionData } from "./browser-close-session.ts";
|
|
23
|
+
/**
|
|
24
|
+
* What this tool answers with: one verb's shape, never a merged one.
|
|
25
|
+
*
|
|
26
|
+
* The merge cost this its single concrete output type, and `unknown` would have
|
|
27
|
+
* silently retired `output-shapes.test.ts`'s check that a declared shape is tied
|
|
28
|
+
* to the code producing it. A union keeps that tie: a verb added without its
|
|
29
|
+
* shape here stops compiling.
|
|
30
|
+
*/
|
|
31
|
+
export type BrowserReadData = BrowserPageData | BrowserNavigateData | BrowserWaitForData | BrowserCloseSessionData;
|
|
32
|
+
export declare const browserReadTool: ToolDefinition;
|
|
33
|
+
//# sourceMappingURL=browser-read.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-read.d.ts","sourceRoot":"","sources":["../../src/tools/browser-read.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAO5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E;;;;;;;GAOG;AACH,MAAM,MAAM,eAAe,GACvB,eAAe,GACf,mBAAmB,GACnB,kBAAkB,GAClB,uBAAuB,CAAC;AAqF5B,eAAO,MAAM,eAAe,EAAE,cAc7B,CAAC"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `browser_read` — merges the four browser tools that read a page without needing consent of
|
|
3
|
+
* their own: `browser_snapshot`, `browser_navigate`, `browser_wait_for`, `browser_close_session`
|
|
4
|
+
* (documents/plans/mcp-surface-consolidation.md, group 2).
|
|
5
|
+
*
|
|
6
|
+
* `class: "stateful-read"` — deliberately not `action`. None of the four mutates the application;
|
|
7
|
+
* the developer's consent for driving it was already given at `browser_start_session`. What they
|
|
8
|
+
* DO change is what a *later* call in the same session sees (each takes a fresh snapshot, which
|
|
9
|
+
* invalidates every ref issued before it) — that is what "stateful" means here, and it is why
|
|
10
|
+
* `browser_snapshot` was never `read`-class to begin with. Declaring `browser_read` as `action`
|
|
11
|
+
* would put a plain read behind a confirmation handshake it has never needed; the other eight
|
|
12
|
+
* `browser_*` verbs (the ones that DO mutate) are a separate merge, owned elsewhere, and are not
|
|
13
|
+
* touched by this file.
|
|
14
|
+
*
|
|
15
|
+
* Dispatches on "verb" to each absorbed tool's exact `run` body — extracted, not reimplemented,
|
|
16
|
+
* so behaviour is unchanged per verb.
|
|
17
|
+
*/
|
|
18
|
+
import { selectVerb } from "./verb.js";
|
|
19
|
+
import { WAIT_TIMEOUT_MAX_MS } from "../browser/wait-target.js";
|
|
20
|
+
import { run as runSnapshot } from "./browser-snapshot.js";
|
|
21
|
+
import { run as runNavigate } from "./browser-navigate.js";
|
|
22
|
+
import { run as runWaitFor } from "./browser-wait-for.js";
|
|
23
|
+
import { run as runClose } from "./browser-close-session.js";
|
|
24
|
+
const VERB_SPECS = [
|
|
25
|
+
{ verb: "snapshot", accepts: ["startAt", "limit", "reveal"] },
|
|
26
|
+
{ verb: "navigate", accepts: ["url"] },
|
|
27
|
+
{ verb: "wait_for", accepts: ["role", "name", "timeoutMs"] },
|
|
28
|
+
{ verb: "close", accepts: [] },
|
|
29
|
+
];
|
|
30
|
+
/** Every verb needs the session it reads — genuinely shared, not one verb's property leaking
|
|
31
|
+
* into another's. */
|
|
32
|
+
const SHARED_PROPS = ["sessionId"];
|
|
33
|
+
const SCHEMA = {
|
|
34
|
+
type: "object",
|
|
35
|
+
properties: {
|
|
36
|
+
verb: {
|
|
37
|
+
type: "string",
|
|
38
|
+
enum: ["snapshot", "navigate", "wait_for", "close"],
|
|
39
|
+
description: 'Which read to perform. "snapshot": the current page. "navigate": move to another page on ' +
|
|
40
|
+
'the same origin, then read it. "wait_for": wait for an element, then read the page. ' +
|
|
41
|
+
'"close": tear the session down and return what it observed.',
|
|
42
|
+
},
|
|
43
|
+
sessionId: {
|
|
44
|
+
type: "string",
|
|
45
|
+
description: "REQUIRED, all verbs. The id returned by browser_start_session.",
|
|
46
|
+
},
|
|
47
|
+
// --- snapshot only ---
|
|
48
|
+
startAt: {
|
|
49
|
+
type: "integer",
|
|
50
|
+
minimum: 0,
|
|
51
|
+
description: "snapshot only. Skip this many elements before listing. Compare what you received against " +
|
|
52
|
+
"totalElements (always the real count) and ask again with startAt past what you have seen.",
|
|
53
|
+
},
|
|
54
|
+
limit: {
|
|
55
|
+
type: "integer",
|
|
56
|
+
minimum: 1,
|
|
57
|
+
description: "snapshot only. At most this many elements. A reply too large for the host is shortened further regardless.",
|
|
58
|
+
},
|
|
59
|
+
reveal: {
|
|
60
|
+
type: "boolean",
|
|
61
|
+
description: "snapshot only. Scroll and re-read the page so rows not yet in the DOM are seen. Off by " +
|
|
62
|
+
"default — it moves the page, and a recycling list will destroy rows it scrolls past.",
|
|
63
|
+
},
|
|
64
|
+
// --- navigate only ---
|
|
65
|
+
url: {
|
|
66
|
+
type: "string",
|
|
67
|
+
description: "navigate only, REQUIRED. Where to go. Must be on the session's consented origin — refused, " +
|
|
68
|
+
"not re-confirmed, if it is not.",
|
|
69
|
+
},
|
|
70
|
+
// --- wait_for only ---
|
|
71
|
+
role: {
|
|
72
|
+
type: "string",
|
|
73
|
+
description: "wait_for only. Role to wait for, as snapshot reports it. role, name, or both — at least one required.",
|
|
74
|
+
},
|
|
75
|
+
name: {
|
|
76
|
+
type: "string",
|
|
77
|
+
description: "wait_for only. Name to wait for, as snapshot reports it. Matched exactly, ignoring case and " +
|
|
78
|
+
"surrounding space, never as a substring.",
|
|
79
|
+
},
|
|
80
|
+
timeoutMs: {
|
|
81
|
+
type: "integer",
|
|
82
|
+
minimum: 0,
|
|
83
|
+
description: `wait_for only. Ceiling in ms. Defaults to 5000, capped at ${WAIT_TIMEOUT_MAX_MS}. Timing out is a normal outcome, not an error.`,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ["verb", "sessionId"],
|
|
87
|
+
additionalProperties: false,
|
|
88
|
+
};
|
|
89
|
+
async function run(args, ctx) {
|
|
90
|
+
const verb = selectVerb(args, "verb", VERB_SPECS, SHARED_PROPS);
|
|
91
|
+
if (verb === "snapshot")
|
|
92
|
+
return runSnapshot(args, ctx);
|
|
93
|
+
if (verb === "navigate")
|
|
94
|
+
return runNavigate(args, ctx);
|
|
95
|
+
if (verb === "wait_for")
|
|
96
|
+
return runWaitFor(args, ctx);
|
|
97
|
+
return runClose(args, ctx);
|
|
98
|
+
}
|
|
99
|
+
export const browserReadTool = {
|
|
100
|
+
name: "browser_read",
|
|
101
|
+
class: "stateful-read",
|
|
102
|
+
tier: "evidence",
|
|
103
|
+
version: "1.0.0",
|
|
104
|
+
title: "Read, navigate, wait on, or close a browser session",
|
|
105
|
+
description: 'Four read-only operations on an open browser session, chosen by "verb": "snapshot" reads the ' +
|
|
106
|
+
'current page; "navigate" moves to another page on the same origin and reads it; "wait_for" ' +
|
|
107
|
+
'waits for an element to appear and reads the page after; "close" tears the session down and ' +
|
|
108
|
+
"returns what it observed. None of these mutates the application, so none takes a " +
|
|
109
|
+
"confirmation — but each takes a fresh snapshot, which invalidates every ref issued before it.",
|
|
110
|
+
inputSchema: SCHEMA,
|
|
111
|
+
run,
|
|
112
|
+
};
|
|
113
|
+
//# sourceMappingURL=browser-read.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser-read.js","sourceRoot":"","sources":["../../src/tools/browser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E,cAAc;IACpB,KAAK,EAAE,eAAe;IACtB,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,KAAK,EAAE,qDAAqD;IAC5D,WAAW,EACT,+FAA+F;QAC/F,6FAA6F;QAC7F,8FAA8F;QAC9F,mFAAmF;QACnF,+FAA+F;IACjG,WAAW,EAAE,MAA4C;IACzD,GAAG;CACJ,CAAC"}
|
|
@@ -5,8 +5,8 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import type { BrowserEvidenceReport } from "../browser/evidence.ts";
|
|
7
7
|
import { type BrowserGraphWrite } from "../browser/graph-write.ts";
|
|
8
|
-
import { type ToolDefinition } from "./kit.ts";
|
|
9
|
-
import type { ReplyFit } from "../render.ts";
|
|
8
|
+
import { type ToolContext, type ToolDefinition } from "./kit.ts";
|
|
9
|
+
import type { ReplyFit, ToolAnswer } from "../render.ts";
|
|
10
10
|
import { type FrameReach, type HiddenReach, type RevealOutcome, type ShadowReach, type SnapshotElement } from "../browser/driver.ts";
|
|
11
11
|
/** What the snapshot could and could not reach, beside what it found. Separate from
|
|
12
12
|
* `totalElements`, which counts only what a ref was issued for: these say which documents were
|
|
@@ -37,6 +37,9 @@ export interface BrowserPageData {
|
|
|
37
37
|
}
|
|
38
38
|
/** What `browser_snapshot` returns — aliased so `browser_navigate` (same question) can't drift from it. */
|
|
39
39
|
export type BrowserSnapshotData = BrowserPageData;
|
|
40
|
+
/** Exported so `browser-read.ts` can dispatch the "snapshot" verb to this exact body — the merge
|
|
41
|
+
* reuses this function rather than reimplementing it (mcp-surface-consolidation.md). */
|
|
42
|
+
export declare function run(args: Record<string, unknown>, ctx: ToolContext): Promise<ToolAnswer<BrowserSnapshotData>>;
|
|
40
43
|
/** Shrinks by dropping elements from the end, never the count or evidence. Evidence can't be re-requested (drained when built); elements can, via `startAt`. */
|
|
41
44
|
export declare function fitSnapshot(data: BrowserSnapshotData, budgetBytes: number): ReplyFit<BrowserSnapshotData>;
|
|
42
45
|
export declare const browserSnapshotTool: ToolDefinition;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-snapshot.d.ts","sourceRoot":"","sources":["../../src/tools/browser-snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,
|
|
1
|
+
{"version":3,"file":"browser-snapshot.d.ts","sourceRoot":"","sources":["../../src/tools/browser-snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAmC,KAAK,WAAW,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AAClG,OAAO,KAAK,EAAE,QAAQ,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AACzD,OAAO,EAIL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,eAAe,EACrB,MAAM,sBAAsB,CAAC;AAE9B;;;4FAG4F;AAC5F,MAAM,WAAW,aAAa;IAC5B,8FAA8F;IAC9F,QAAQ,CAAC,MAAM,EAAE,SAAS,UAAU,EAAE,CAAC;IACvC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,+FAA+F;IAC/F,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,yCAAyC;IACzC,QAAQ,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;CACvC;AAED,+DAA+D;AAC/D,eAAO,MAAM,QAAQ,EAAE,aAA4G,CAAC;AAEpI,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,eAAe,EAAE,CAAC;IAC9C,gHAAgH;IAChH,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,KAAK,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,qBAAqB,CAAC;IACzC,6IAA6I;IAC7I,QAAQ,CAAC,KAAK,EAAE,iBAAiB,CAAC;CACnC;AAED,2GAA2G;AAC3G,MAAM,MAAM,mBAAmB,GAAG,eAAe,CAAC;AAmClD;yFACyF;AACzF,wBAAsB,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,GAAG,EAAE,WAAW,GAAG,OAAO,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,CAkDnH;AAED,gKAAgK;AAChK,wBAAgB,WAAW,CAAC,IAAI,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,GAAG,QAAQ,CAAC,mBAAmB,CAAC,CAwBzG;AAED,eAAO,MAAM,mBAAmB,EAAE,cAcjC,CAAC"}
|
|
@@ -39,7 +39,9 @@ const SCHEMA = {
|
|
|
39
39
|
required: ["sessionId"],
|
|
40
40
|
additionalProperties: false,
|
|
41
41
|
};
|
|
42
|
-
|
|
42
|
+
/** Exported so `browser-read.ts` can dispatch the "snapshot" verb to this exact body — the merge
|
|
43
|
+
* reuses this function rather than reimplementing it (mcp-surface-consolidation.md). */
|
|
44
|
+
export async function run(args, ctx) {
|
|
43
45
|
const sessionId = requiredString(args, "sessionId");
|
|
44
46
|
const startAt = optionalInteger(args, "startAt", 0) ?? 0;
|
|
45
47
|
const limit = optionalInteger(args, "limit", 1);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-snapshot.js","sourceRoot":"","sources":["../../src/tools/browser-snapshot.ts"],"names":[],"mappings":"AAAA;;;;GAIG;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OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;CACJ,CAAC"}
|
|
@@ -19,7 +19,8 @@
|
|
|
19
19
|
import type { BrowserEvidenceReport } from "../browser/evidence.ts";
|
|
20
20
|
import { type BrowserGraphWrite } from "../browser/graph-write.ts";
|
|
21
21
|
import type { SnapshotElement } from "../browser/driver.ts";
|
|
22
|
-
import { type ToolDefinition } from "./kit.ts";
|
|
22
|
+
import { type ToolContext, type ToolDefinition } from "./kit.ts";
|
|
23
|
+
import type { ToolAnswer } from "../render.ts";
|
|
23
24
|
export interface BrowserWaitForData {
|
|
24
25
|
readonly sessionId: string;
|
|
25
26
|
readonly appeared: boolean;
|
|
@@ -37,5 +38,8 @@ export interface BrowserWaitForData {
|
|
|
37
38
|
readonly evidence: BrowserEvidenceReport;
|
|
38
39
|
readonly graph: BrowserGraphWrite;
|
|
39
40
|
}
|
|
41
|
+
/** Exported so `browser-read.ts` can dispatch the "wait_for" verb to this exact body — the merge
|
|
42
|
+
* reuses this function rather than reimplementing it (mcp-surface-consolidation.md). */
|
|
43
|
+
export declare function run(args: Record<string, unknown>, ctx: ToolContext): Promise<ToolAnswer<BrowserWaitForData>>;
|
|
40
44
|
export declare const browserWaitForTool: ToolDefinition;
|
|
41
45
|
//# sourceMappingURL=browser-wait-for.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-wait-for.d.ts","sourceRoot":"","sources":["../../src/tools/browser-wait-for.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAEpE,OAAO,EAAkB,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAE5D,OAAO,
|
|
1
|
+
{"version":3,"file":"browser-wait-for.d.ts","sourceRoot":"","sources":["../../src/tools/browser-wait-for.ts"],"names":[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sessionId"],
|
|
47
47
|
additionalProperties: false,
|
|
48
48
|
};
|
|
49
|
-
|
|
49
|
+
/** Exported so `browser-read.ts` can dispatch the "wait_for" verb to this exact body — the merge
|
|
50
|
+
* reuses this function rather than reimplementing it (mcp-surface-consolidation.md). */
|
|
51
|
+
export async function run(args, ctx) {
|
|
50
52
|
const sessionId = requiredString(args, "sessionId");
|
|
51
53
|
const role = optionalString(args, "role");
|
|
52
54
|
const name = optionalString(args, "name");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser-wait-for.js","sourceRoot":"","sources":["../../src/tools/browser-wait-for.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAGH,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AAC5F,OAAO,EAAE,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AAEnF,OAAO,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,mBAAmB,EAAsB,MAAM,2BAA2B,CAAC;AAC3H,OAAO,EAAE,eAAe,EAAE,cAAc,EAAE,cAAc,EAAyC,MAAM,UAAU,CAAC;AAqBlH,MAAM,MAAM,GAAG;IACb,IAAI,EAAE,QAAQ;IACd,UAAU,EAAE;QACV,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,qDAAqD,EAAE;QACjG,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,sGAAsG;gBACtG,qDAAqD;SACxD;QACD,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EACT,qGAAqG;gBACrG,kGAAkG;gBAClG,mDAAmD;SACtD;QACD,SAAS,EAAE;YACT,IAAI,EAAE,SAAS;YACf,OAAO,EAAE,CAAC;YACV,WAAW,EACT,sEAAsE,mBAAmB,cAAc;gBACvG,qGAAqG;gBACrG,mGAAmG;SACtG;KACF;IACD,QAAQ,EAAE,CAAC,WAAW,CAA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AAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,MAAM;IACnB,GAAG;CACJ,CAAC"}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `browser` — the merged action-class browser tool. §4/§7 step 5 of
|
|
3
|
+
* `documents/plans/mcp-surface-consolidation.md`.
|
|
4
|
+
*
|
|
5
|
+
* Absorbs the eight consent-gated browser verbs — `start_session` `click`
|
|
6
|
+
* `type` `fill` `select` `submit` `save_scenario` `run_scenario` — behind one
|
|
7
|
+
* `verb` argument. The four stateful-read tools (`snapshot`, `navigate`,
|
|
8
|
+
* `wait_for`, `close_session`) are a different class and are not touched
|
|
9
|
+
* here.
|
|
10
|
+
*
|
|
11
|
+
* ## This is the surface merge only
|
|
12
|
+
*
|
|
13
|
+
* §4 names the real design problem: an element ref is issued per snapshot and
|
|
14
|
+
* a stale one refuses rather than resolving elsewhere, so a caller cannot
|
|
15
|
+
* author a multi-step batch up front — step 2's ref does not exist until step
|
|
16
|
+
* 1 has run. The eventual fix is a server-side step loop that takes its own
|
|
17
|
+
* snapshot between steps and resolves targets by role + accessible name, so a
|
|
18
|
+
* ref never leaves the server and an ambiguous target refuses rather than
|
|
19
|
+
* guessing. That is a design change, not a merge, and it is **not** done
|
|
20
|
+
* here. This tool still takes one ref, for one step, per call — exactly
|
|
21
|
+
* today's semantics, including the refusal on a superseded ref — and only
|
|
22
|
+
* changes how the eight verbs are named and dispatched.
|
|
23
|
+
*
|
|
24
|
+
* ## Reuse, not reimplementation
|
|
25
|
+
*
|
|
26
|
+
* Every verb's `run` and `describeAction` is the same function object the
|
|
27
|
+
* standalone tool exported before this file existed — `VERB_TOOLS` below is
|
|
28
|
+
* a dispatch table over those objects, never a rewrite of what they do. The
|
|
29
|
+
* one thing genuinely new is `selectVerb`: with eight verbs' properties
|
|
30
|
+
* unioned into one schema, `additionalProperties: false` can no longer catch
|
|
31
|
+
* `browser({ verb: "click", text: "hi" })` silently ignoring `text` — that is
|
|
32
|
+
* exactly the defect `browser_start_session({ profile })` silently reading
|
|
33
|
+
* `environment` was (UAT phase 5 F12), one level further down. `selectVerb`
|
|
34
|
+
* re-establishes per-verb argument discrimination at runtime; see
|
|
35
|
+
* `verb.ts`'s own header for the full reasoning.
|
|
36
|
+
*
|
|
37
|
+
* ## Consent
|
|
38
|
+
*
|
|
39
|
+
* Only `start_session` mints anything — it is the one call that opens a
|
|
40
|
+
* browser and grants consent for the rest of the session's life
|
|
41
|
+
* (`browser-start-session.ts`, DEC-380). The other seven verbs already
|
|
42
|
+
* declare `describeAction: () => undefined` (nothing left to confirm; a verb
|
|
43
|
+
* cannot mint its own consent), and that is preserved by delegating to each
|
|
44
|
+
* verb's own `describeAction` rather than writing a new one — the one
|
|
45
|
+
* consent sentence this tool produces is `browser_start_session`'s own,
|
|
46
|
+
* unchanged, so it cannot drift from what `start_session` alone still
|
|
47
|
+
* enforces.
|
|
48
|
+
*/
|
|
49
|
+
import type { ToolDefinition } from "./kit.ts";
|
|
50
|
+
import type { BrowserStartSessionData } from "./browser-start-session.ts";
|
|
51
|
+
import type { BrowserClickData } from "./browser-click.ts";
|
|
52
|
+
import type { BrowserTypeData } from "./browser-type.ts";
|
|
53
|
+
import type { BrowserFillData } from "./browser-fill.ts";
|
|
54
|
+
import type { BrowserSelectData } from "./browser-select.ts";
|
|
55
|
+
import type { BrowserSubmitData } from "./browser-submit.ts";
|
|
56
|
+
import type { BrowserSaveScenarioData } from "./browser-save-scenario.ts";
|
|
57
|
+
import type { BrowserRunScenarioData } from "./browser-run-scenario.ts";
|
|
58
|
+
/**
|
|
59
|
+
* What this tool answers with: one verb's shape, never a merged one.
|
|
60
|
+
*
|
|
61
|
+
* The merge cost this its single concrete output type, and `unknown` would have
|
|
62
|
+
* silently retired `output-shapes.test.ts`'s check that a declared shape is tied
|
|
63
|
+
* to the code producing it. A union keeps that tie: a verb added without its
|
|
64
|
+
* shape here stops compiling.
|
|
65
|
+
*/
|
|
66
|
+
export type BrowserData = BrowserStartSessionData | BrowserClickData | BrowserTypeData | BrowserFillData | BrowserSelectData | BrowserSubmitData | BrowserSaveScenarioData | BrowserRunScenarioData;
|
|
67
|
+
export type BrowserVerb = "start_session" | "click" | "type" | "fill" | "select" | "submit" | "save_scenario" | "run_scenario";
|
|
68
|
+
export declare const browserTool: ToolDefinition;
|
|
69
|
+
//# sourceMappingURL=browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/tools/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAYH,OAAO,KAAK,EAAe,cAAc,EAAE,MAAM,UAAU,CAAC;AAC5D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,2BAA2B,CAAC;AAExE;;;;;;;GAOG;AACH,MAAM,MAAM,WAAW,GACnB,uBAAuB,GACvB,gBAAgB,GAChB,eAAe,GACf,eAAe,GACf,iBAAiB,GACjB,iBAAiB,GACjB,uBAAuB,GACvB,sBAAsB,CAAC;AAE3B,MAAM,MAAM,WAAW,GACnB,eAAe,GACf,OAAO,GACP,MAAM,GACN,MAAM,GACN,QAAQ,GACR,QAAQ,GACR,eAAe,GACf,cAAc,CAAC;AAgVnB,eAAO,MAAM,WAAW,EAAE,cAoBzB,CAAC"}
|