@te-river/opencode-team-mode 1.5.11 → 1.5.13

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.
Files changed (112) hide show
  1. package/README.md +154 -57
  2. package/README.zh-CN.md +126 -47
  3. package/dist/agents.d.ts +5 -1
  4. package/dist/agents.d.ts.map +1 -1
  5. package/dist/agents.js +37 -11
  6. package/dist/agents.js.map +1 -1
  7. package/dist/approval-gate.d.ts +54 -16
  8. package/dist/approval-gate.d.ts.map +1 -1
  9. package/dist/approval-gate.js +163 -42
  10. package/dist/approval-gate.js.map +1 -1
  11. package/dist/host-hooks.d.ts +115 -0
  12. package/dist/host-hooks.d.ts.map +1 -0
  13. package/dist/host-hooks.js +270 -0
  14. package/dist/host-hooks.js.map +1 -0
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +68 -4
  17. package/dist/index.js.map +1 -1
  18. package/dist/prompts/lead.d.ts +1 -1
  19. package/dist/prompts/lead.d.ts.map +1 -1
  20. package/dist/prompts/lead.js +88 -6
  21. package/dist/prompts/lead.js.map +1 -1
  22. package/dist/prompts/shared.d.ts +1 -1
  23. package/dist/prompts/shared.d.ts.map +1 -1
  24. package/dist/prompts/shared.js +203 -119
  25. package/dist/prompts/shared.js.map +1 -1
  26. package/dist/prompts/specialists.d.ts +2 -2
  27. package/dist/prompts/specialists.d.ts.map +1 -1
  28. package/dist/prompts/specialists.js +73 -23
  29. package/dist/prompts/specialists.js.map +1 -1
  30. package/dist/tm/args-schema.d.ts +31 -1
  31. package/dist/tm/args-schema.d.ts.map +1 -1
  32. package/dist/tm/args-schema.js +155 -39
  33. package/dist/tm/args-schema.js.map +1 -1
  34. package/dist/tm/bash-timeout.d.ts +72 -0
  35. package/dist/tm/bash-timeout.d.ts.map +1 -0
  36. package/dist/tm/bash-timeout.js +100 -0
  37. package/dist/tm/bash-timeout.js.map +1 -0
  38. package/dist/tm/browser.d.ts +250 -20
  39. package/dist/tm/browser.d.ts.map +1 -1
  40. package/dist/tm/browser.js +1200 -143
  41. package/dist/tm/browser.js.map +1 -1
  42. package/dist/tm/config.d.ts +129 -0
  43. package/dist/tm/config.d.ts.map +1 -1
  44. package/dist/tm/config.js +117 -1
  45. package/dist/tm/config.js.map +1 -1
  46. package/dist/tm/dispatch.d.ts +95 -0
  47. package/dist/tm/dispatch.d.ts.map +1 -0
  48. package/dist/tm/dispatch.js +369 -0
  49. package/dist/tm/dispatch.js.map +1 -0
  50. package/dist/tm/index.d.ts +32 -7
  51. package/dist/tm/index.d.ts.map +1 -1
  52. package/dist/tm/index.js +74 -5
  53. package/dist/tm/index.js.map +1 -1
  54. package/dist/tm/memory.d.ts +88 -10
  55. package/dist/tm/memory.d.ts.map +1 -1
  56. package/dist/tm/memory.js +881 -99
  57. package/dist/tm/memory.js.map +1 -1
  58. package/dist/tm/pipelines.d.ts +26 -3
  59. package/dist/tm/pipelines.d.ts.map +1 -1
  60. package/dist/tm/pipelines.js +167 -11
  61. package/dist/tm/pipelines.js.map +1 -1
  62. package/dist/tm/ptc/budgets.d.ts +22 -1
  63. package/dist/tm/ptc/budgets.d.ts.map +1 -1
  64. package/dist/tm/ptc/budgets.js +87 -8
  65. package/dist/tm/ptc/budgets.js.map +1 -1
  66. package/dist/tm/ptc/contract.d.ts +49 -9
  67. package/dist/tm/ptc/contract.d.ts.map +1 -1
  68. package/dist/tm/ptc/contract.js +41 -3
  69. package/dist/tm/ptc/contract.js.map +1 -1
  70. package/dist/tm/ptc/driver.d.ts +5 -2
  71. package/dist/tm/ptc/driver.d.ts.map +1 -1
  72. package/dist/tm/ptc/driver.js +47 -15
  73. package/dist/tm/ptc/driver.js.map +1 -1
  74. package/dist/tm/ptc/engines.d.ts +15 -4
  75. package/dist/tm/ptc/engines.d.ts.map +1 -1
  76. package/dist/tm/ptc/engines.js +281 -28
  77. package/dist/tm/ptc/engines.js.map +1 -1
  78. package/dist/tm/ptc/index.d.ts +4 -4
  79. package/dist/tm/ptc/index.d.ts.map +1 -1
  80. package/dist/tm/ptc/index.js +2 -2
  81. package/dist/tm/ptc/index.js.map +1 -1
  82. package/dist/tm/ptc/pscan.d.ts +20 -1
  83. package/dist/tm/ptc/pscan.d.ts.map +1 -1
  84. package/dist/tm/ptc/pscan.js +328 -14
  85. package/dist/tm/ptc/pscan.js.map +1 -1
  86. package/dist/tm/ptc/summary.d.ts.map +1 -1
  87. package/dist/tm/ptc/summary.js +23 -1
  88. package/dist/tm/ptc/summary.js.map +1 -1
  89. package/dist/tm/ptc/tool.d.ts +34 -3
  90. package/dist/tm/ptc/tool.d.ts.map +1 -1
  91. package/dist/tm/ptc/tool.js +117 -20
  92. package/dist/tm/ptc/tool.js.map +1 -1
  93. package/dist/tm/pty.d.ts +70 -0
  94. package/dist/tm/pty.d.ts.map +1 -0
  95. package/dist/tm/pty.js +242 -0
  96. package/dist/tm/pty.js.map +1 -0
  97. package/dist/tm/search.d.ts +128 -15
  98. package/dist/tm/search.d.ts.map +1 -1
  99. package/dist/tm/search.js +556 -47
  100. package/dist/tm/search.js.map +1 -1
  101. package/dist/tm/shell-bridge.d.ts +14 -1
  102. package/dist/tm/shell-bridge.d.ts.map +1 -1
  103. package/dist/tm/shell-bridge.js +57 -10
  104. package/dist/tm/shell-bridge.js.map +1 -1
  105. package/dist/tm/webfetch.d.ts +29 -7
  106. package/dist/tm/webfetch.d.ts.map +1 -1
  107. package/dist/tm/webfetch.js +117 -15
  108. package/dist/tm/webfetch.js.map +1 -1
  109. package/dist/types.d.ts +16 -0
  110. package/dist/types.d.ts.map +1 -1
  111. package/docs/installation.md +216 -17
  112. package/package.json +5 -2
@@ -0,0 +1,100 @@
1
+ /**
2
+ * Built-in bash TIMEOUT discipline (issue #6 of 2026-09-18).
3
+ *
4
+ * Where the 120 s comes from: the host's shell tool resolves
5
+ * `flags.bashDefaultTimeoutMs ?? 2 * 60 * 1e3` (verified in the shipped
6
+ * desktop bundle) — so when a model omits `timeout`, 120 s is the HOST
7
+ * default, and models that do pass one routinely pass 120000+ for a
8
+ * `Get-ChildItem`. Three serialised probes then cost the user six minutes
9
+ * of dead air, and every one of them was allowed to run for a reason no
10
+ * model ever had.
11
+ *
12
+ * The plugin owns no shell timer, so the ONE non-invasive lever is the
13
+ * official `tool.execute.before` hook, whose `output.args` is explicitly
14
+ * mutable. Two ceilings, both opt-out:
15
+ * - `TM_BASH_TIMEOUT_PROBE_MS` (default 60 000) — only for a command the
16
+ * P3 read-only allowlist already accepts (ls / grep / rg / cat /
17
+ * Get-ChildItem …). A pure probe has no legitimate reason to outlive
18
+ * a minute, and this is where the wasted 120 s actually sits.
19
+ * - `TM_BASH_TIMEOUT_MAX_MS` (default 0 = OFF) — a global cap for
20
+ * everything else. Off by default on purpose: a build/test run may
21
+ * legitimately need minutes, and silently killing one is worse than a
22
+ * slow one. A user who wants the ceiling sets it.
23
+ *
24
+ * This clamps a number the model already volunteered; it never ADDS a
25
+ * timeout where the model supplied none (that would turn the host's default
26
+ * into OUR default, which is not this plugin's call to make).
27
+ */
28
+ import { classifyReadonlyCommand } from "./guard.js";
29
+ /** Parse the model-supplied timeout defensively: the host schema says a
30
+ * positive integer of MILLISECONDS, but an LLM hands us `"120000"`,
31
+ * `120000.0`, or omits it entirely. Anything unreadable means "no
32
+ * timeout was supplied" and is left alone. */
33
+ export function parseTimeoutArg(raw) {
34
+ if (typeof raw === "number" && Number.isFinite(raw) && raw > 0)
35
+ return Math.trunc(raw);
36
+ if (typeof raw === "string") {
37
+ const n = Number(raw.trim());
38
+ if (Number.isFinite(n) && n > 0)
39
+ return Math.trunc(n);
40
+ }
41
+ return null;
42
+ }
43
+ /**
44
+ * Decide the clamped timeout for one bash call.
45
+ * `probeMs`/`maxMs` of 0 disable that ceiling.
46
+ */
47
+ export function resolveBashTimeout(opts) {
48
+ const t = opts.timeoutMs;
49
+ if (t === null)
50
+ return { changed: false, via: "none" };
51
+ const probe = opts.probeMs > 0 && classifyReadonlyCommand(opts.command, opts.readonlyAllowed).ok;
52
+ if (probe && t > opts.probeMs)
53
+ return { changed: true, via: "probe", from: t, to: opts.probeMs };
54
+ if (opts.maxMs > 0 && t > opts.maxMs)
55
+ return { changed: true, via: "max", from: t, to: opts.maxMs };
56
+ if (!probe && opts.maxMs === 0)
57
+ return { changed: false, via: "none" };
58
+ return { changed: false, via: "already-short" };
59
+ }
60
+ /**
61
+ * The hook fragment. Returns true when it mutated `args.timeout` — the
62
+ * caller may log that, and the trajectory keeps a count so a user asking
63
+ * "why did my probe get killed at 60 s?" has an answer.
64
+ *
65
+ * Everything here is defensive by contract: `output.args` is `any` on the
66
+ * host side, a non-bash tool must be untouched, and a malformed payload
67
+ * must never turn into a thrown error inside a permission-adjacent hook.
68
+ */
69
+ export function createBashTimeoutHook(deps) {
70
+ return (input, output) => {
71
+ try {
72
+ const tool = String(input?.tool ?? "").trim().toLowerCase();
73
+ if (tool !== "bash")
74
+ return false;
75
+ const args = output?.args;
76
+ if (!args || typeof args !== "object")
77
+ return false;
78
+ const command = typeof args.command === "string" ? args.command : "";
79
+ if (!command)
80
+ return false;
81
+ const verdict = resolveBashTimeout({
82
+ command,
83
+ timeoutMs: parseTimeoutArg(args.timeout),
84
+ probeMs: deps.probeMs,
85
+ maxMs: deps.maxMs,
86
+ readonlyAllowed: deps.readonlyAllowed,
87
+ });
88
+ if (!verdict.changed)
89
+ return false;
90
+ args.timeout = verdict.to;
91
+ deps.onClamp?.({ via: verdict.via, from: verdict.from, to: verdict.to });
92
+ return true;
93
+ }
94
+ catch {
95
+ /* a timeout clamp must never break the call it is trying to speed up */
96
+ return false;
97
+ }
98
+ };
99
+ }
100
+ //# sourceMappingURL=bash-timeout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bash-timeout.js","sourceRoot":"","sources":["../../src/tm/bash-timeout.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,EAAE,uBAAuB,EAAE,MAAM,YAAY,CAAA;AAMpD;;;+CAG+C;AAC/C,MAA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AAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,EAAE,EAAE,OAAO,CAAC,EAAE,EAAE,CAAC,CAAA;YACxE,OAAO,IAAI,CAAA;QACb,CAAC;QAAC,MAAM,CAAC;YACP,wEAAwE;YACxE,OAAO,KAAK,CAAA;QACd,CAAC;IACH,CAAC,CAAA;AACH,CAAC"}
@@ -1,30 +1,65 @@
1
1
  /**
2
2
  * tm_browser — governed interactive browser (Plan C: the user's own
3
- * Chromium-family browser driven headful over the CDP pipe protocol).
3
+ * Chromium-family browser, headful by default on desktops).
4
4
  *
5
- * Feasibility proven by smoke (Edge + --remote-debugging-pipe + JSON/NUL
6
- * framing over fds 3/4 — zero deps, no WebSocket implementation). Qoder's
7
- * hardening ideas are ported where the plugin can reach them:
8
- * - isolated temp user-data-dir (never the user's real profile);
9
- * - per-navigation allowlist enforced at the NETWORK layer via CDP
10
- * Fetch.requestPaused (non-allowlisted hosts get BlockedByClient —
11
- * the per-hop re-check analog);
12
- * - hardened webPreferences are the spawn's own flags (no-first-run,
13
- * no-extensions, mute);
14
- * - hard per-command timeout + explicit close; dispose kills the child.
5
+ * T5 engine split (design board ② "TM_BROWSER_ENGINE" + R2 verdict):
6
+ * - PRIMARY engine: playwright-core — dynamic import ONLY (the package is
7
+ * declared in dependencies but NOT installed at build time; a static
8
+ * import would break tsc). A failed import or node < 20 degrades the
9
+ * session to the cdp-legacy engine automatically, per plugin instance.
10
+ * - cdp-legacy engine: the original hand-rolled CDP pipe transport
11
+ * (JSON + NUL framing over fds 3/4, zero deps — smoke-proven) kept
12
+ * verbatim as the fallback. On cdp-legacy only the core subset works
13
+ * (open/navigate/read/screenshot/close + navigate_page/take_screenshot/
14
+ * list_pages/evaluate_script aliases); the snapshot-first actions
15
+ * (take_snapshot + uid addressing, 16-verb chrome-devtools-mcp surface)
16
+ * require the playwright engine.
17
+ *
18
+ * Action surface aligns with chrome-devtools-mcp's 16 verbs (R2 mapping):
19
+ * navigate_page · take_snapshot · click · fill · hover · drag ·
20
+ * press_key · select_page · upload_file · wait_for · evaluate_script ·
21
+ * list_console_messages · list_network_requests · list_pages ·
22
+ * take_screenshot · handle_dialog
23
+ * plus the legacy compatibility verbs open / navigate / read /
24
+ * screenshot / close. Snapshot-first discipline: take_snapshot returns
25
+ * the ariaSnapshot YAML with an INJECTED [uid=eN] per node (playwright has
26
+ * no uid concept — SnapshotIndex below is our own snapshot→locator
27
+ * registry); follow-up actions address nodes by that uid (or an explicit
28
+ * selector escape hatch) instead of guessed locators.
29
+ *
30
+ * Hardening (unchanged from the CDP era, ported to both engines):
31
+ * - isolated temp profile (never the user's real browser profile);
32
+ * persistent login is ONLY via an explicit TM_BROWSER_USER_DATA_DIR;
33
+ * - domain allowlist enforced at the NETWORK layer on the NAVIGATION
34
+ * (playwright context.route / CDP Fetch interception), re-checked on
35
+ * every redirect hop; SUBRESOURCES then follow TM_BROWSER_SUBRESOURCE
36
+ * (default same-site: passive types load, an executable resource loads
37
+ * when it belongs to a site this session opened). Gating every request
38
+ * by the content allowlist is what made pages render picture-less — the
39
+ * 21 seeded hosts contain no CDN, so img/css/js died silently;
40
+ * - out-of-allowlist open/navigate routes through the OFFICIAL dialog
41
+ * BEFORE any spawn; approved hosts also pass the network layer;
42
+ * - hardened context: real-Chrome UA + zh-CN Accept-Language,
43
+ * no-first-run / no-extensions / mute launch flags, 3 s default action
44
+ * timeout (the prompt's "3000 ms budget" is the tool's default, not an
45
+ * aspiration), no networkidle waits anywhere;
46
+ * - dispose AWAITS the close, and an idle session reaps itself
47
+ * (TM_BROWSER_IDLE_MS) — an orphaned visible window is a user-facing bug.
15
48
  *
16
49
  * Environment adaptivity (different OpenCode hosts):
17
50
  * - headful by default (Plan C); display-less Linux (no DISPLAY/
18
51
  * WAYLAND_DISPLAY) automatically falls back to headless; TM_BROWSER_
19
52
  * HEADLESS=1|0 forces either way;
20
- * - browser discovery: TM_BROWSER_PATH override, then the USER'S DEFAULT
21
- * browser (Windows registry / Linux xdg-settings) when it is
22
- * Chromium-family — CDP's pipe protocol is Chromium-only, so Firefox as
23
- * default falls through — then per-OS candidate paths (Edge first on
24
- * Windows; Chrome/Chromium elsewhere). No browser → structured error,
25
- * the agent falls back to tm_webfetch / user MCP tools.
53
+ * - browser discovery (SHARED by both engines): TM_BROWSER_PATH
54
+ * override, then the USER'S DEFAULT browser (Windows registry / Linux
55
+ * xdg-settings) when it is Chromium-family — CDP is Chromium-proprietary
56
+ * and playwright channels only speak Chromium too, so a Firefox default
57
+ * falls through — then per-OS candidate paths (Edge first on Windows;
58
+ * Chrome/Chromium elsewhere). No browser → structured error, the agent
59
+ * falls back to tm_webfetch / user MCP tools.
26
60
  *
27
- * Role access mirrors tm_webfetch: network roles (team + researcher) only.
61
+ * Role access mirrors tm_webfetch: network roles (team + researcher) only,
62
+ * tester browser-only (UI verification).
28
63
  */
29
64
  import type { ToolResult } from "../types.js";
30
65
  import type { TmConfig } from "./config.js";
@@ -34,7 +69,9 @@ export type CommandRunner = (cmd: string, args: string[]) => string;
34
69
  export declare function isChromiumFamily(exePath: string): boolean;
35
70
  /** Parse `reg query "...UrlAssociations\http\UserChoice" /v ProgId` output. */
36
71
  export declare function parseProgId(stdout: string): string | null;
37
- /** Parse `reg query "...\shell\open\command" /ve` output → exe path. */
72
+ /** Parse `reg query "...\shell\open\command" /ve` output → exe path.
73
+ * The quoted capture stops at the closing quote, so the `" -- %1"` style
74
+ * URL-template tail never leaks into the returned path. */
38
75
  export declare function parseRegCommand(stdout: string): string | null;
39
76
  /** Parse the Exec= line of an xdg .desktop file. */
40
77
  export declare function parseDesktopExec(text: string): string | null;
@@ -42,6 +79,18 @@ export declare function parseDesktopExec(text: string): string | null;
42
79
  * null → the caller falls back to the per-OS probe list (detection is
43
80
  * best-effort and must never throw into tool discovery). */
44
81
  export declare function defaultBrowserExecutable(env?: Record<string, string | undefined>, run?: CommandRunner): string | null;
82
+ /** Playwright's `channel` launch IGNORES the executable we discovered —
83
+ * `channel:"msedge"` resolves whatever playwright thinks the stable Edge is,
84
+ * so a correct Edge-Beta discovery still opened stable (the decisive half of
85
+ * the 2026-09-18 report). The channel spelling is therefore only correct
86
+ * for the exact stable-channel install dir; everything else (Beta/Dev/
87
+ * Canary, portable, an explicit TM_BROWSER_PATH) rides on executablePath. */
88
+ export declare function playwrightLaunchTarget(executable: string, opts?: {
89
+ explicitOverride?: boolean;
90
+ }): {
91
+ executablePath: string;
92
+ channel?: string;
93
+ };
45
94
  /** Resolve the browser executable: TM_BROWSER_PATH override → the user's
46
95
  * DEFAULT browser (Chromium-family only) → per-OS candidate paths.
47
96
  * %LOCALAPPDATA% style vars are expanded on win32. */
@@ -54,15 +103,196 @@ export declare function findBrowserExecutable(env?: Record<string, string | unde
54
103
  * display possible (Linux without DISPLAY/WAYLAND_DISPLAY).
55
104
  */
56
105
  export declare function resolveHeadless(env?: Record<string, string | undefined>): boolean;
106
+ /** Approximate registrable site (eTLD+1) of a hostname. */
107
+ export declare function siteOf(host: string): string;
108
+ /** playwright and CDP spell resource types differently (`Image` vs `image`,
109
+ * `Stylesheet` vs `stylesheet`) — one normalizer keeps both engines on the
110
+ * same verdict table. */
111
+ export declare function normalizeResourceType(raw: unknown): string;
112
+ export declare function isPassiveResource(raw: unknown): boolean;
113
+ /**
114
+ * One subresource verdict, shared VERBATIM by both engines so playwright and
115
+ * cdp-legacy can never drift. `allowedSites` holds the registrable sites of
116
+ * every host this session actually navigated to (allowlist hit or dialog
117
+ * approval), which is what makes a page's own JS/CSS work without opening
118
+ * the whole internet: the governance boundary moves from "21 content domains"
119
+ * to "the site you approved", and an off-site SCRIPT still needs a dialog.
120
+ */
121
+ export declare function subresourcePass(opts: {
122
+ url: string;
123
+ resourceType: unknown;
124
+ policy: "same-site" | "passive" | "off";
125
+ allowlistHit: boolean;
126
+ approvedHost: boolean;
127
+ allowedSites: ReadonlySet<string>;
128
+ }): {
129
+ pass: boolean;
130
+ via: string;
131
+ };
132
+ /** A navigation (or a host the dialog approved) widens the subresource
133
+ * footprint to its own site. Called for EVERY top-level/document request
134
+ * that passed the allowlist side. */
135
+ export declare function rememberSite(allowedSites: Set<string>, url: string): void;
136
+ export type BrowserEngineKind = "playwright" | "cdp-legacy";
137
+ /** playwright-core 1.63 targets node >= 20; on anything older we refuse the
138
+ * engine up-front and stay on the zero-dependency CDP pipe (the node>=18
139
+ * package floor keeps the plugin itself loadable — only the playwright
140
+ * PRIMARY is gated here, cdp-legacy carries node 18/19 hosts). */
141
+ export declare const PLAYWRIGHT_MIN_NODE_MAJOR = 20;
142
+ /** "v22.3.1" / "20" -> major number; unparseable -> 0 (fail toward the
143
+ * always-available cdp-legacy engine). */
144
+ export declare function nodeMajorOf(version: string): number;
145
+ export interface EngineSelection {
146
+ kind: BrowserEngineKind;
147
+ /** The imported playwright-core namespace (present iff kind=playwright). */
148
+ pw?: PwModule;
149
+ /** Why this kind was chosen (preference / node gate / import failure). */
150
+ reason?: string;
151
+ }
152
+ /** The REAL loader — a VARIABLE specifier so tsc never tries to resolve
153
+ * "playwright-core" at build time (types ship inside the package, which may
154
+ * be absent from node_modules). Under ESM, import(variable) yields the
155
+ * module namespace typed as any. */
156
+ export declare function defaultImportPlaywright(): Promise<unknown>;
157
+ /** Pure engine-selection seam (exported for test-browser.mjs):
158
+ * cdp-legacy preference → legacy WITHOUT ever importing; node < 20 →
159
+ * legacy without importing; playwright preference → import, verify the
160
+ * chromium.launch shape, degrade to legacy on ANY failure. */
161
+ export declare function selectBrowserEngine(opts: {
162
+ preference: string | undefined;
163
+ nodeMajor: number;
164
+ importPlaywright: () => Promise<unknown>;
165
+ }): Promise<EngineSelection>;
166
+ export interface PwModule {
167
+ chromium: {
168
+ launch(opts: Record<string, unknown>): Promise<PwBrowser>;
169
+ launchPersistentContext(userDataDir: string, opts: Record<string, unknown>): Promise<PwBrowserContext>;
170
+ };
171
+ }
172
+ export interface PwBrowser {
173
+ newContext(opts?: Record<string, unknown>): Promise<PwBrowserContext>;
174
+ close(): Promise<void>;
175
+ }
176
+ export interface PwBrowserContext {
177
+ route(pattern: string, handler: (route: PwRoute, request: PwRequestInfo) => Promise<void> | void): Promise<void> | void;
178
+ pages(): PwPage[];
179
+ newPage(): Promise<PwPage>;
180
+ close(): Promise<void>;
181
+ }
182
+ export interface PwPage {
183
+ goto(url: string, opts?: Record<string, unknown>): Promise<unknown>;
184
+ locator(selector: string): PwLocator;
185
+ getByRole(role: string, opts?: Record<string, unknown>): PwLocator;
186
+ getByText(text: string): PwLocator;
187
+ keyboard: {
188
+ press(key: string): Promise<unknown>;
189
+ };
190
+ evaluate(pageFunction: string): Promise<unknown>;
191
+ screenshot(opts?: Record<string, unknown>): Promise<Uint8Array>;
192
+ on(event: string, handler: (...args: any[]) => void): void;
193
+ url(): string;
194
+ title?(): Promise<string>;
195
+ bringToFront?(): Promise<void>;
196
+ }
197
+ export interface PwLocator {
198
+ ariaSnapshot(): Promise<string>;
199
+ click(): Promise<unknown>;
200
+ fill(value: string): Promise<unknown>;
201
+ hover(): Promise<unknown>;
202
+ pressKey(key: string): Promise<unknown>;
203
+ setInputFiles(files: string | string[]): Promise<unknown>;
204
+ waitFor(opts?: Record<string, unknown>): Promise<unknown>;
205
+ nth(index: number): PwLocator;
206
+ dragTo(target: PwLocator): Promise<unknown>;
207
+ }
208
+ export interface PwRoute {
209
+ continue(): Promise<unknown>;
210
+ abort(): Promise<unknown>;
211
+ }
212
+ export interface PwRequestInfo {
213
+ url(): string;
214
+ method?(): string;
215
+ /** playwright resource type ("document"|"script"|"image"|…). Optional on
216
+ * the seam so a stale mock cannot break the gate — an absent type is
217
+ * treated as EXECUTABLE (the strict side of the subresource policy). */
218
+ resourceType?(): string;
219
+ }
220
+ export interface PwConsoleMessage {
221
+ type(): string;
222
+ text(): string;
223
+ }
224
+ export interface PwResponseInfo {
225
+ url(): string;
226
+ status(): number;
227
+ request(): PwRequestInfo;
228
+ }
229
+ export interface PwDialog {
230
+ type(): string;
231
+ message(): string;
232
+ accept(promptText?: string): Promise<unknown>;
233
+ dismiss(): Promise<unknown>;
234
+ }
235
+ export interface SnapshotEntry {
236
+ role: string;
237
+ name?: string;
238
+ nth: number;
239
+ }
240
+ /** ariaSnapshot yields plain YAML with NO addressable id, while the
241
+ * chrome-devtools-mcp muscle memory this tool aligns to is uid-addressed.
242
+ * The missing layer is built here: each take_snapshot re-indexes every YAML
243
+ * node (`- <role> "<name>" …`), injects `[uid=eN]` inline, and remembers
244
+ * (role, name, nth-of-kind); later actions resolve uid →
245
+ * `page.getByRole(role, { name, exact: true }).nth(nth)`. Uids are
246
+ * renumbered on every snapshot (one action, one observation); an
247
+ * unknown/stale uid errors back to take_snapshot instead of falling back
248
+ * to guessed locators. */
249
+ export declare class SnapshotIndex {
250
+ private entries;
251
+ private next;
252
+ get size(): number;
253
+ /** Reset + parse + annotate the ariaSnapshot YAML in one pass. */
254
+ annotate(yaml: string): string;
255
+ get(uid: string): SnapshotEntry | undefined;
256
+ /** uid → playwright locator; null = unknown uid / role the engine cannot
257
+ * address (the caller renders the take_snapshot-first guidance). */
258
+ locatorFor(page: PwPage, uid: string): PwLocator | null;
259
+ }
260
+ /** ariaSnapshot escapes whitespace/quotes inside names (\s \n \t \" \\). */
261
+ export declare function unescapeAriaName(raw: string): string;
262
+ /** The 16 canonical verbs, named byte-identical to chrome-devtools-mcp. */
263
+ export declare const BROWSER_PLAYWRIGHT_ACTIONS: readonly ["navigate_page", "take_snapshot", "click", "fill", "hover", "drag", "press_key", "select_page", "upload_file", "wait_for", "evaluate_script", "list_console_messages", "list_network_requests", "list_pages", "take_screenshot", "handle_dialog"];
264
+ /** Legacy compat verbs that ride on top of the 16 (both engines). */
265
+ export declare const BROWSER_COMPAT_ACTIONS: readonly ["open", "navigate", "read", "screenshot", "close"];
266
+ /** What the cdp-legacy fallback can still do (R2: degradation must keep the
267
+ * §6o behavior; everything snapshot-shaped is playwright-only). */
268
+ export declare const BROWSER_LEGACY_ACTIONS: readonly ["open", "navigate", "navigate_page", "read", "screenshot", "take_screenshot", "list_pages", "evaluate_script", "close"];
57
269
  export declare function buildTmBrowserTool(deps: {
58
270
  pipelines: TmPipelines;
59
271
  cfg: TmConfig;
60
272
  env?: Record<string, string | undefined>;
61
273
  args?: Record<string, unknown>;
274
+ /** Test seam: replace the dynamic playwright-core import. */
275
+ importPlaywright?: () => Promise<unknown>;
276
+ /** Test seam: pretend node major version for the engine gate. */
277
+ nodeMajor?: number;
278
+ /** Best-effort user notification (host toast) — used by the idle reaper,
279
+ * which closes a window the agent forgot and must say so out loud. */
280
+ notify?: (message: string) => void;
281
+ /** Test seam for the DISCOVERY result (not the TM_BROWSER_PATH override —
282
+ * the override is read from env so the channel-substitution rule stays
283
+ * honest in tests too). */
284
+ findExecutable?: (env: Record<string, string | undefined>) => string | null;
62
285
  }): {
63
286
  description: string;
64
287
  args: Record<string, unknown>;
65
288
  execute: (rawArgs: Record<string, unknown>, ctx: unknown) => Promise<ToolResult>;
66
- dispose: () => void;
289
+ /** Async on purpose: the host's `dispose` hook is `() => Promise<void>`,
290
+ * and a fire-and-forget close could exit before the browser child was
291
+ * killed (leaving a visible orphan window). */
292
+ dispose: () => Promise<void>;
293
+ engineInfo: () => {
294
+ kind: BrowserEngineKind | null;
295
+ reason: string | null;
296
+ };
67
297
  };
68
298
  //# sourceMappingURL=browser.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"browser.d.ts","sourceRoot":"","sources":["../../src/tm/browser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAQH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;AAE7C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;AAC3C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAA;AA0BjD,6EAA6E;AAC7E,MAAM,MAAM,aAAa,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,MAAM,CAAA;AAWnE,wBAAgB,gBAAgB,C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