@narumitw/pi-chrome-devtools 0.53.4 → 0.54.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +109 -0
  2. package/README.md +34 -16
  3. package/dist/chunks/{browser-settings-menu-FVMCCUPM.ts → browser-settings-menu-7M3VM7QN.ts} +25 -3
  4. package/dist/chunks/browser-settings-menu-7M3VM7QN.ts.map +7 -0
  5. package/dist/chunks/{chunk-V7N3WI5B.ts → chunk-JKPJYUVG.ts} +340 -108
  6. package/dist/chunks/chunk-JKPJYUVG.ts.map +7 -0
  7. package/dist/chunks/{chunk-4B3EQHOH.ts → chunk-JLEJ6WFO.ts} +2 -2
  8. package/dist/chunks/{chunk-LSJSDY2M.ts → chunk-WTMZID3G.ts} +382 -246
  9. package/dist/chunks/chunk-WTMZID3G.ts.map +7 -0
  10. package/dist/chunks/{menu-MTPSLDHZ.ts → menu-HGG26E3X.ts} +7 -7
  11. package/dist/chunks/{menu-MTPSLDHZ.ts.map → menu-HGG26E3X.ts.map} +1 -1
  12. package/dist/chunks/{tools-OVNH45IJ.ts → tools-O5N4KIAK.ts} +3 -3
  13. package/dist/index.ts +45 -21
  14. package/dist/index.ts.map +2 -2
  15. package/docs/browser-setup.md +7 -1
  16. package/package.json +6 -5
  17. package/src/browser-candidates.ts +184 -0
  18. package/src/browser-manager.ts +93 -276
  19. package/src/browser-settings-menu.ts +23 -0
  20. package/src/browser-startup.ts +122 -0
  21. package/src/chrome-devtools.ts +48 -15
  22. package/src/lazy-tools.ts +358 -48
  23. package/src/menu.ts +3 -3
  24. package/src/runtime.ts +2 -2
  25. package/src/settings.ts +65 -1
  26. package/src/tool-selector.ts +95 -40
  27. package/dist/chunks/browser-settings-menu-FVMCCUPM.ts.map +0 -7
  28. package/dist/chunks/chunk-LSJSDY2M.ts.map +0 -7
  29. package/dist/chunks/chunk-V7N3WI5B.ts.map +0 -7
  30. /package/dist/chunks/{chunk-4B3EQHOH.ts.map → chunk-JLEJ6WFO.ts.map} +0 -0
  31. /package/dist/chunks/{tools-OVNH45IJ.ts.map → tools-O5N4KIAK.ts.map} +0 -0
package/CHANGELOG.md ADDED
@@ -0,0 +1,109 @@
1
+ # @narumitw/pi-chrome-devtools
2
+
3
+ ## 0.54.1
4
+
5
+ ### Patch Changes
6
+
7
+ - ae521ac: Select an available nonzero port for default managed browser launches instead of enabling Chrome's port-0 automation signal. Validate startup against the owned browser's DevTools announcement and browser identity, including attach probes that finish after a launch completes, while preserving explicit endpoints, attach-first behavior, and temporary profiles.
8
+ - 956f531: Restore the Chrome DevTools and Firecrawl extensions as maintained packages, update runtime compatibility, and include package changelogs in published files.
9
+
10
+ ## 0.54.0
11
+
12
+ ### Minor Changes
13
+
14
+ - 192857c: Default browser capabilities to codemode discovery without a loader. Add user toolMode settings for codemode, lazy, and direct exposure; mode edits take effect after reload or session replacement. Older settings without toolMode now use codemode; select lazy to restore the previous loader behavior. Disabled capabilities and gated WebMCP tools are hidden in every mode.
15
+
16
+ ## 0.53.4
17
+
18
+ ### Patch Changes
19
+
20
+ - 8abd5b7: Keep generated extension runtime graphs inside Pi's Jiti-loaded TypeScript path to avoid duplicate peer-runtime evaluation during startup. Add measured generated runtimes for Context Management, Herdr, and TypeSafe Search.
21
+
22
+ ## 0.53.3
23
+
24
+ ### Patch Changes
25
+
26
+ - 67a3049: Adapt provider, transcript, usage, deferred-tool, and telemetry behavior to Pi's current runtime contracts, including accurate cache-warming accounting and exclusion from ordinary generation traces.
27
+
28
+ ## 0.53.2
29
+
30
+ ### Patch Changes
31
+
32
+ - 961f004: Keep expanded tool output bounded for wide, malformed, or zero-width Unicode text and sanitize untrusted terminal controls without blocking rendering.
33
+ - Updated dependencies [4485b49]
34
+ - Updated dependencies [6b1e009]
35
+ - @narumitw/pi-tui-kit@0.62.0
36
+
37
+ ## 0.53.1
38
+
39
+ ### Patch Changes
40
+
41
+ - 3430142: Scope effective browser settings to each Pi session so concurrent sessions cannot mix CDP hosts, launch policy, browser executables, or extension paths.
42
+
43
+ ## 0.53.0
44
+
45
+ ### Minor Changes
46
+
47
+ - 9f44143: Add opt-in experimental WebMCP discovery and confirmed page-tool invocation through fixed Pi gateway tools.
48
+
49
+ ### Patch Changes
50
+
51
+ - Updated dependencies [40182e5]
52
+ - @narumitw/pi-tui-kit@0.59.0
53
+
54
+ ## 0.52.3
55
+
56
+ ### Patch Changes
57
+
58
+ - 3effdd1: Use native deferred tool loading only on supported models and eagerly expose configured tools otherwise.
59
+
60
+ ## 0.52.2
61
+
62
+ ### Patch Changes
63
+
64
+ - 3346683: Publish generated lazy chunks at the JavaScript paths referenced by each extension runtime so deferred menus and implementations load correctly through Pi's Jiti loader.
65
+ - Updated dependencies [b9eba3a]
66
+ - @narumitw/pi-tui-kit@0.58.0
67
+
68
+ ## 0.52.1
69
+
70
+ ### Patch Changes
71
+
72
+ - 30bc076: Load each extension from a generated TypeScript runtime to reduce Jiti package startup work while preserving existing first-use boundaries.
73
+
74
+ ## 0.52.0
75
+
76
+ ### Minor Changes
77
+
78
+ - eae42b5: Add validated JSON and `/chrome-devtools settings` controls for the DevTools endpoint, auto-launch policy, and browser executable.
79
+
80
+ Keep existing `PI_CHROME_DEVTOOLS_*` overrides temporarily, but warn that they are deprecated and should be migrated to `pi-chrome-devtools.json`.
81
+
82
+ ## 0.51.0
83
+
84
+ ### Minor Changes
85
+
86
+ - 34d3576: Load Chrome DevTools capability tools on demand through a persistent `chrome_devtools_load` tool.
87
+
88
+ Treat the saved tool selection as the allowed lazy-load catalog and keep deferred capability metadata out of the stable system prompt prefix.
89
+
90
+ ## 0.50.1
91
+
92
+ ### Patch Changes
93
+
94
+ - f9a33ed: Require pi-tui-kit 0.51 so disabled menu actions and their explanations render consistently.
95
+ - Updated dependencies [736ca9e]
96
+ - @narumitw/pi-tui-kit@0.52.0
97
+
98
+ ## 0.50.0
99
+
100
+ ### Minor Changes
101
+
102
+ - c434669: Add trusted user and project settings for loading unpacked Chrome extensions into an isolated managed Chrome for Testing or Chromium browser.
103
+ - 4d77811: Redesign the Chrome DevTools manager around visible runtime state, staged tool selection with exact review, shallow status/setup/help navigation, and explicit cross-mode behavior.
104
+
105
+ ## 0.49.4
106
+
107
+ ### Patch Changes
108
+
109
+ - 1b64919: Pass `--do-not-de-elevate` when auto-launching the managed browser so Chrome no longer relaunches de-elevated and exits when Pi runs in an elevated Windows terminal, which the launch watchdog misread as "Auto-launched browser exited before DevTools became available."
package/README.md CHANGED
@@ -12,7 +12,7 @@ The design is inspired by [`chrome-devtools-mcp`](https://github.com/ChromeDevTo
12
12
  - Reuses an existing CDP endpoint or launches an isolated Chromium-family browser on first use.
13
13
  - Recovers from stale page selections and explains browser startup or endpoint failures.
14
14
  - Loads explicitly approved unpacked extensions only in an extension-owned Chrome for Testing or Chromium process.
15
- - Uses native deferred browser tools when supported and exposes allowed tools eagerly otherwise.
15
+ - Defaults to codemode-discoverable browser capabilities, with optional lazy and direct exposure.
16
16
  - Provides availability controls, setup guidance, status, and help through `/chrome-devtools`.
17
17
  - Shows compact expandable results and activity only while browser tools are running.
18
18
  - Persists reviewed tool availability while keeping browser connection settings machine-owned.
@@ -46,14 +46,23 @@ Review third-party extension source before installing it.
46
46
 
47
47
  ## 🚀 Quick start
48
48
 
49
- Start Pi and ask the agent to load the browser capability needed for the task.
49
+ If `codemode` is already in your active tool list, no additional Pi setting is needed. Startup warns when enabled capabilities require codemode but the host tool is inactive; empty catalogs and fully explicit host selections do not produce this warning.
50
+ Otherwise, enable Pi's built-in codemode in Pi's `settings.json`:
51
+
52
+ ```json
53
+ { "defaultTools": ["+codemode"] }
54
+ ```
55
+
56
+ Start Pi and ask the agent to inspect a browser page. Codemode can discover `chrome_devtools_*` with `searchTools`, inspect schemas with `describeTool`, and call them through `tools`.
57
+ A CLI `--tools` list is an allowlist for extension tools too; prefer the additive `defaultTools` setting above.
50
58
  By default, the extension tries `http://127.0.0.1:9222` and launches an isolated local Chromium-family browser if that endpoint is unavailable.
51
59
  Run `/chrome-devtools` to review status, settings, help, and available tools.
52
60
  WebMCP remains disabled until you explicitly enable it.
53
61
 
54
62
  ## 🌐 Browser setup
55
63
 
56
- By default, the extension attaches to `http://127.0.0.1:9222` or launches an isolated local browser on first use.
64
+ By default, the extension attaches to `http://127.0.0.1:9222` or launches an isolated local browser on an automatically selected nonzero port on first use.
65
+ This avoids Chrome's port-`0` automation signal, but does not guarantee access to bot-protected sites.
57
66
  It never closes an external browser.
58
67
  Use `/chrome-devtools` → **Browser settings** to change the endpoint, auto-launch policy, or executable.
59
68
 
@@ -77,7 +86,7 @@ See [WebMCP setup and troubleshooting](./docs/browser-setup.md#experimental-webm
77
86
 
78
87
  ## 🛠️ Tools
79
88
 
80
- - `chrome_devtools_load` — find and load browser capabilities relevant to a task.
89
+ - `chrome_devtools_load` — find and load browser capabilities relevant to a task (lazy mode only).
81
90
  - `chrome_devtools_list_pages` — list inspectable Chrome tabs/pages.
82
91
  - `chrome_devtools_select_page` — select the active page for later tool calls.
83
92
  - `chrome_devtools_navigate` — navigate a page to a URL; if no page exists, create one first.
@@ -88,15 +97,19 @@ See [WebMCP setup and troubleshooting](./docs/browser-setup.md#experimental-webm
88
97
 
89
98
  ### Tool exposure
90
99
 
91
- The extension registers eight tools: one loader, five stable DevTools capabilities, and two fixed experimental WebMCP gateways.
92
- With native deferred-tool support, only `chrome_devtools_load` starts active.
100
+ The default `codemode` mode registers five stable capabilities and two fixed experimental WebMCP gateways without a loader. Enabled capabilities are callable through codemode discovery without adding their definitions to the ordinary model request. Explicit host activation of an enabled capability is preserved.
101
+ Disabled capabilities are hidden from discovery and calls in every mode, including the WebMCP gateways while their gate is off.
102
+
103
+ Choose `lazy` or `direct` under **Browser settings → Tool mode** to use another exposure policy; changes require `/reload` or session replacement. Direct mode declares all enabled capabilities without a loader.
104
+
105
+ In lazy mode, with native deferred-tool support, only `chrome_devtools_load` starts active.
93
106
  The loader accepts a task-oriented `query`, matches it against the five stable capabilities plus enabled WebMCP gateways, and adds matching available tools without removing any active Pi tool.
94
107
  Loaded capability tools remain active for the rest of the session unless the user makes them unavailable through `/chrome-devtools`.
95
108
 
96
- Pi uses native deferred tool references on compatible Anthropic models, native additional-tools or tool-search loading on compatible OpenAI and Codex Responses models, and native Kimi loading on compatible OpenAI Chat Completions models.
97
- Kimi-compatible models declare `compat.deferredToolsMode: "kimi"` in Pi's model metadata.
98
- `azure-openai-responses` remains eager because Pi's Azure adapter does not implement native deferred tool-search serialization.
99
- Fireworks Messages models also remain eager because their native protocol requires the canonical `ToolSearch` or `tool_search` loader name, while this independently installable package keeps the collision-safe `chrome_devtools_load` name.
109
+ Native lazy loading requires `compat.supportsMidConvoSystemMessages: true` in Pi's registered model metadata.
110
+ Anthropic Messages also requires `supportsMidConvoToolChanges`; OpenAI Chat Completions requires `supportsMidConvoToolAdditions`.
111
+ OpenAI Responses, Codex Responses, and Azure Responses require `supportsAdditionalTools` or `supportsToolSearch`.
112
+ The extension uses these explicit capabilities, not provider names or model-ID guesses.
100
113
 
101
114
  When the selected model/provider lacks native deferred support, the extension activates every capability allowed by settings before the next model request instead of using Pi's cache-invalidating lazy-loading fallback.
102
115
  After a session enters eager exposure, it stays eager across later model switches to avoid removing tool definitions within that session.
@@ -105,7 +118,7 @@ The capability tools omit active-only prompt snippets so native deferred loading
105
118
  The saved `tools` array controls which capabilities the extension may expose.
106
119
  The `webmcp.enabled` gate takes precedence, so persisted WebMCP names cannot bypass a disabled gate.
107
120
  Page-provided tool definitions appear only in list results and never alter Pi's provider-visible tool definitions.
108
- An empty array leaves the loader active but makes every browser capability unavailable.
121
+ An empty array makes every browser capability unavailable; only lazy mode retains the loader.
109
122
 
110
123
  ### Screenshot files
111
124
 
@@ -141,14 +154,14 @@ If the model cannot inspect the inline image, ask it to read the saved path, for
141
154
  | `/chrome-devtools help` | Show command usage. |
142
155
  | `/chrome-devtools quickstart` | Show the CDP endpoint, launch candidates, and setup hints. |
143
156
  | `/chrome-devtools status` | Inspect tools, settings sources, and the last browser launch without probing or starting Chrome. |
144
- | `/chrome-devtools settings` | Change browser settings; successful edits save immediately. |
157
+ | `/chrome-devtools settings` | Change browser settings and tool mode; successful edits save immediately. |
145
158
  | `/chrome-devtools tools` (aliases: `toggle`, `select`) | Stage tool availability, review the result, and apply it. |
146
159
  | `/chrome-devtools enable` (alias: `on`) | Immediately make all currently gated capabilities available and save the selection. |
147
160
  | `/chrome-devtools disable` (alias: `off`) | Immediately make all capabilities unavailable and save the empty selection. |
148
161
 
149
162
  All routes support TUI and RPC and reject unknown or trailing arguments.
150
163
  Only `enable` and `disable` also support print and JSON modes.
151
- Disabling capabilities leaves the slash command and `chrome_devtools_load` available; see [Tool exposure](#tool-exposure).
164
+ Disabling capabilities leaves the slash command available and retains `chrome_devtools_load` only in lazy mode; see [Tool exposure](#tool-exposure).
152
165
 
153
166
  Menu tool changes require **Apply tool changes**; cancellation discards the unconfirmed draft.
154
167
  Failed apply leaves previous tool availability and settings intact and retains the draft for retry.
@@ -180,11 +193,16 @@ Browser connection fields and `webmcp.enabled` are machine-owned user settings;
180
193
  Confirmed menu changes apply before the next browser connection and close only an extension-owned managed browser.
181
194
  Manual JSON edits and unpacked-extension changes apply after `/reload` or session replacement.
182
195
 
183
- When the file is missing or invalid, the extension preserves Pi's current Chrome DevTools availability policy instead of replacing it.
184
- A valid saved catalog is restored on Pi startup and `/reload`, with capability definitions exposed natively deferred or eagerly according to model/provider support.
196
+ `toolMode` accepts `codemode` (default), `lazy`, or `direct` and is user-only. It applies at session start, including `/reload`; availability edits apply immediately without overwriting a pending mode change.
197
+ Missing settings and valid older files without `toolMode` now use codemode. To restore the previous loader behavior, save `"toolMode": "lazy"` and reload. Without an explicit catalog, all modes make the stable capabilities available; the active declaration list does not determine configured availability.
198
+ A first `/reload` from the previous loader implementation clears carried-over Chrome declarations when applying codemode; enabled capabilities remain callable through codemode. Pi exposes no activation-origin API, so an active loader plus Chrome capabilities without known session provenance is treated as the predecessor's cohort. Capability-only host selections and known explicit activations are preserved. This is an intentional reload-time model-visible prefix transition, not an ordinary-turn change.
199
+ Activation provenance is stored as versioned, non-model session metadata and restored from the current branch on session start; a branch without valid provenance drops abandoned-branch caches, so transcript-restoring resume/fork paths can apply codemode without carrying extension-owned declarations forward. Recordless sessions retain the legacy loader-cohort migration policy; unknown capability-only selections remain conservative host selections. Observed host deactivation clears an explicit selection, while extension-caused hiding is not treated as host withdrawal. Re-enabling availability restores retained explicit declarations only when the capability and its WebMCP gate allow it.
200
+ A successful lazy activation remains additive if its ownership metadata cannot be saved: the loader reports the loaded tools with a warning rather than removing them or reporting a failed load. Startup and model-switch exposure also remain applied when only metadata persistence fails; lifecycle handlers warn and continue instead of reporting a failed setup. A later loader call or lifecycle update retries pending metadata, including when matching tools are already loaded or the same policy is restored on reload; durable ownership may be incomplete until persistence succeeds. Availability and WebMCP settings saves retain their transactional failure recovery.
201
+ A valid saved catalog is restored on Pi startup and `/reload`. An invalid user settings file retains the known effective availability and running mode with a warning, even when valid trusted-project browser settings make the combined load succeed; without a recoverable catalog, only already active capabilities are retained and no new capability is enabled. A fresh invalid configuration therefore leaves browser capabilities disabled until the file is repaired. Invalid settings cannot be overwritten by a save.
185
202
  A missing file is created by the first confirmed browser or tool setting.
186
203
  Within one Pi process, all browser and tool saves run in invocation order, reread the latest valid document, publish by temporary-file rename, and preserve unknown fields.
187
- Malformed JSON or invalid recognized fields make menu mutation unavailable and block direct saves without replacement; a failed save restores the prior displayed and effective state.
204
+ Malformed JSON or invalid recognized fields make menu mutation unavailable and block direct saves without replacement.
205
+ Availability saves precede runtime publication. A failed disk write leaves runtime tools unchanged, including host edits made during the save. If runtime publication fails after saving, recovery restores the previous runtime policy and saved catalog before releasing dependent reads or session replacement. Recovery changes only the tool catalog fields, preserves unrelated settings, and refuses to overwrite invalid or newer catalog data; any recovery failure is reported explicitly.
188
206
 
189
207
  Compatibility: older versions used `pi-chrome-devtools-settings.json`.
190
208
  A legacy-only file remains readable with a warning and is never modified automatically; rename it to `pi-chrome-devtools.json`.
@@ -5,20 +5,22 @@ import {
5
5
  configuredChromeDevtoolsTools,
6
6
  sanitizeChromeDevtoolsDisplay,
7
7
  setChromeDevtoolsSessionOwner
8
- } from "./chunk-V7N3WI5B.ts";
8
+ } from "./chunk-JKPJYUVG.ts";
9
9
  import {
10
10
  applyRuntimeBrowserSettings,
11
11
  applyRuntimeWebMcpSetting,
12
12
  invalidateWebMcpOperations,
13
+ isChromeDevtoolsToolMode,
13
14
  loadSettings,
14
15
  parseBrowserEndpoint,
15
16
  saveBrowserSettings,
17
+ saveToolMode,
16
18
  saveWebMcpSettings,
17
19
  shutdownManagedBrowser,
18
20
  state,
19
21
  syncManagedBrowserSettings,
20
22
  webMcpEnabled
21
- } from "./chunk-LSJSDY2M.ts";
23
+ } from "./chunk-WTMZID3G.ts";
22
24
 
23
25
  // src/browser-settings-menu.ts
24
26
  import { isAbsolute } from "node:path";
@@ -75,6 +77,14 @@ async function showChromeDevtoolsBrowserSettings(pi, ctx, generation) {
75
77
  description: "Inspect trusted extension paths configured in user or project JSON.",
76
78
  currentValue: `${browser.extensionPaths.length} configured`,
77
79
  action: "show-extensions"
80
+ },
81
+ {
82
+ id: "tool-mode",
83
+ label: "Tool mode",
84
+ description: "codemode discovery, lazy loading, or direct declarations. Saved changes require /reload.",
85
+ currentValue: current.load.kind === "loaded" ? current.load.settings.toolMode : "codemode",
86
+ values: ["codemode", "lazy", "direct"],
87
+ action: "set-tool-mode"
78
88
  }
79
89
  ]
80
90
  };
@@ -111,6 +121,18 @@ async function showChromeDevtoolsBrowserSettings(pi, ctx, generation) {
111
121
  })
112
122
  },
113
123
  actions: {
124
+ "set-tool-mode": async ({ value }) => {
125
+ if (!isChromeDevtoolsToolMode(value) || !isCurrent2()) return { kind: "rejected" };
126
+ try {
127
+ await saveToolMode(value);
128
+ if (!isCurrent2()) return { kind: "rejected" };
129
+ ctx.ui.notify("Chrome DevTools tool mode saved; /reload required. Running exposure is unchanged.", "info");
130
+ return { kind: "stay" };
131
+ } catch (error) {
132
+ if (isCurrent2()) notifySaveFailure(ctx, error);
133
+ return { kind: "rejected" };
134
+ }
135
+ },
114
136
  "open-endpoint": () => ({ kind: "to", screen: "endpoint" }),
115
137
  "save-endpoint": async ({ value, signal }) => {
116
138
  if (value === void 0) return { kind: "rejected" };
@@ -313,4 +335,4 @@ function formatError(error) {
313
335
  export {
314
336
  showChromeDevtoolsBrowserSettings
315
337
  };
316
- //# sourceMappingURL=browser-settings-menu-FVMCCUPM.ts.map
338
+ //# sourceMappingURL=browser-settings-menu-7M3VM7QN.ts.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/browser-settings-menu.ts"],
4
+ "sourcesContent": ["import { isAbsolute } from \"node:path\";\nimport type { ExtensionAPI, ExtensionCommandContext } from \"@earendil-works/pi-coding-agent\";\nimport { defineMenu, runMenu } from \"@narumitw/pi-tui-kit\";\nimport { shutdownManagedBrowser, syncManagedBrowserSettings } from \"./browser-manager.js\";\nimport {\n applyAvailableChromeDevtoolsTools,\n configuredChromeDevtoolsTools,\n setChromeDevtoolsSessionOwner,\n} from \"./lazy-tools.js\";\nimport {\n applyRuntimeBrowserSettings,\n applyRuntimeWebMcpSetting,\n invalidateWebMcpOperations,\n state,\n webMcpEnabled,\n} from \"./runtime.js\";\nimport {\n type BrowserSettingsPatch,\n type BrowserSettingsSource,\n isChromeDevtoolsToolMode,\n loadSettings,\n parseBrowserEndpoint,\n type SettingsLoadResult,\n saveBrowserSettings,\n saveToolMode,\n saveWebMcpSettings,\n} from \"./settings.js\";\nimport { sanitizeChromeDevtoolsDisplay } from \"./tool-selector.js\";\n\ntype BrowserSettingsScreen = \"settings\" | \"endpoint\" | \"executable\" | \"extensions\";\ntype BrowserSettingsAction =\n | \"set-tool-mode\"\n | \"open-endpoint\"\n | \"save-endpoint\"\n | \"set-auto-launch\"\n | \"set-webmcp\"\n | \"open-executable\"\n | \"save-executable\"\n | \"show-extensions\";\n\ninterface BrowserSettingsMenuState {\n load: SettingsLoadResult;\n}\n\ntype CommandContext = ExtensionCommandContext;\n\nexport async function showChromeDevtoolsBrowserSettings(\n pi: ExtensionAPI,\n ctx: CommandContext,\n generation: number,\n): Promise<{ closeParent: boolean }> {\n setChromeDevtoolsSessionOwner(pi, ctx.sessionManager);\n const ownerSignal = state.sessionController.signal;\n const isCurrent = () => generation === state.sessionGeneration && !ownerSignal.aborted;\n const projectTrusted = ctx.isProjectTrusted();\n const menu = defineMenu<BrowserSettingsMenuState, BrowserSettingsScreen, BrowserSettingsAction>({\n start: \"settings\",\n screens: {\n settings: ({ state: current }) => {\n if (current.load.userFile.kind === \"invalid\") return invalidSettingsScreen(current.load);\n const browser = current.load.effectiveBrowser;\n return {\n kind: \"settings\",\n title: \"Chrome DevTools Browser settings\",\n lines: settingsContextLines(current.load),\n items: [\n {\n id: \"endpoint\",\n label: \"DevTools endpoint\",\n description: 'HTTP origin with an explicit port; enter \"default\" to restore 127.0.0.1:9222.',\n currentValue: sanitizeChromeDevtoolsDisplay(browser.endpoint),\n action: \"open-endpoint\",\n },\n {\n id: \"auto-launch\",\n label: \"Auto-launch\",\n description: \"Launch an isolated managed browser when a local endpoint is unavailable.\",\n currentValue: browser.autoLaunchEnabled ? \"On\" : \"Off\",\n values: [\"On\", \"Off\"],\n action: \"set-auto-launch\",\n },\n {\n id: \"executable\",\n label: \"Browser executable\",\n description: 'Absolute executable path; enter \"automatic\" to restore browser discovery.',\n currentValue: sanitizeChromeDevtoolsDisplay(browser.executablePath ?? \"Automatic\"),\n action: \"open-executable\",\n },\n {\n id: \"webmcp\",\n label: \"WebMCP \u00B7 Experimental\",\n description: \"Allow user-confirmed calls to page-provided WebMCP tools in this browser session.\",\n currentValue: current.load.effectiveWebMcpEnabled ? \"On\" : \"Off\",\n values: [\"On\", \"Off\"],\n action: \"set-webmcp\",\n },\n {\n id: \"extensions\",\n label: \"Unpacked extensions\",\n description: \"Inspect trusted extension paths configured in user or project JSON.\",\n currentValue: `${browser.extensionPaths.length} configured`,\n action: \"show-extensions\",\n },\n {\n id: \"tool-mode\",\n label: \"Tool mode\",\n description: \"codemode discovery, lazy loading, or direct declarations. Saved changes require /reload.\",\n currentValue: current.load.kind === \"loaded\" ? current.load.settings.toolMode : \"codemode\",\n values: [\"codemode\", \"lazy\", \"direct\"],\n action: \"set-tool-mode\",\n },\n ],\n };\n },\n endpoint: ({ state: current }) => ({\n kind: \"input\",\n title: \"DevTools endpoint\",\n lines: [\n sanitizeChromeDevtoolsDisplay(`Current effective endpoint: ${current.load.effectiveBrowser.endpoint}`),\n 'Enter an HTTP origin with an explicit port, or \"default\".',\n ],\n placeholder: \"http://127.0.0.1:9222\",\n action: \"save-endpoint\",\n hint: \"back\",\n }),\n executable: ({ state: current }) => ({\n kind: \"input\",\n title: \"Browser executable\",\n lines: [\n sanitizeChromeDevtoolsDisplay(\n `Current effective executable: ${current.load.effectiveBrowser.executablePath ?? \"automatic discovery\"}`,\n ),\n 'Enter an absolute path, or \"automatic\".',\n ],\n placeholder: \"absolute browser executable path\",\n action: \"save-executable\",\n hint: \"back\",\n }),\n extensions: ({ state: current }) => ({\n kind: \"detail\",\n title: \"Unpacked extensions\",\n lines: extensionDetailLines(current.load),\n hint: \"back\",\n }),\n },\n actions: {\n \"set-tool-mode\": async ({ value }) => {\n if (!isChromeDevtoolsToolMode(value) || !isCurrent()) return { kind: \"rejected\" };\n try {\n await saveToolMode(value);\n if (!isCurrent()) return { kind: \"rejected\" };\n ctx.ui.notify(\"Chrome DevTools tool mode saved; /reload required. Running exposure is unchanged.\", \"info\");\n return { kind: \"stay\" };\n } catch (error) {\n if (isCurrent()) notifySaveFailure(ctx, error);\n return { kind: \"rejected\" };\n }\n },\n \"open-endpoint\": () => ({ kind: \"to\", screen: \"endpoint\" }),\n \"save-endpoint\": async ({ value, signal }) => {\n if (value === undefined) return { kind: \"rejected\" };\n let endpoint: string | null;\n try {\n const trimmed = value.trim();\n endpoint = trimmed.toLowerCase() === \"default\" ? null : parseBrowserEndpoint(trimmed).endpoint;\n } catch (error) {\n notifySaveFailure(ctx, error);\n return { kind: \"rejected\" };\n }\n const saved = await saveAndApplyBrowserPatch(ctx, generation, ownerSignal, signal, projectTrusted, {\n endpoint,\n });\n if (!saved) return { kind: \"rejected\" };\n notifyEffectiveSave(ctx, \"endpoint\", saved.effectiveBrowser.endpoint, saved.effectiveBrowser.endpointSource);\n return { kind: \"back\" };\n },\n \"set-auto-launch\": async ({ value, signal }) => {\n if (value !== \"On\" && value !== \"Off\") return { kind: \"rejected\" };\n const saved = await saveAndApplyBrowserPatch(ctx, generation, ownerSignal, signal, projectTrusted, {\n autoLaunch: value === \"On\",\n });\n if (!saved) return { kind: \"rejected\" };\n notifyEffectiveSave(\n ctx,\n \"auto-launch\",\n saved.effectiveBrowser.autoLaunchEnabled ? \"On\" : \"Off\",\n saved.effectiveBrowser.autoLaunchSource,\n );\n return { kind: \"stay\" };\n },\n \"set-webmcp\": async ({ value, signal }) => {\n if (value !== \"On\" && value !== \"Off\") return { kind: \"rejected\" };\n const saved = await saveAndApplyWebMcpSetting(\n pi,\n ctx,\n generation,\n ownerSignal,\n signal,\n projectTrusted,\n value === \"On\",\n );\n if (!saved) return { kind: \"rejected\" };\n ctx.ui.notify(\n saved.effectiveWebMcpEnabled\n ? \"Experimental WebMCP enabled. Every page-provided tool call requires confirmation. Choose gateway availability under Browser tools.\"\n : \"Experimental WebMCP disabled. Active WebMCP work was aborted and both gateway tools are unavailable.\",\n \"warning\",\n );\n return { kind: \"stay\" };\n },\n \"open-executable\": () => ({ kind: \"to\", screen: \"executable\" }),\n \"save-executable\": async ({ value, signal }) => {\n if (value === undefined) return { kind: \"rejected\" };\n const trimmed = value.trim();\n const reset = [\"automatic\", \"default\", \"none\"].includes(trimmed.toLowerCase());\n if (!reset && (!trimmed || !isAbsolute(trimmed))) {\n notifySaveFailure(ctx, new Error('Enter an absolute path or \"automatic\".'));\n return { kind: \"rejected\" };\n }\n const executablePath = reset ? null : trimmed;\n const saved = await saveAndApplyBrowserPatch(ctx, generation, ownerSignal, signal, projectTrusted, {\n executablePath,\n });\n if (!saved) return { kind: \"rejected\" };\n notifyEffectiveSave(\n ctx,\n \"browser executable\",\n saved.effectiveBrowser.executablePath ?? \"automatic discovery\",\n saved.effectiveBrowser.executablePathSource,\n );\n return { kind: \"back\" };\n },\n \"show-extensions\": () => ({ kind: \"to\", screen: \"extensions\" }),\n },\n });\n const result = await runMenu(ctx, menu, {\n getState: async ({ signal }) => {\n signal.throwIfAborted();\n const load = await loadSettings({ cwd: ctx.cwd, projectTrusted });\n signal.throwIfAborted();\n return { load };\n },\n signal: ownerSignal,\n isCurrent,\n onError: (currentCtx, error) =>\n currentCtx.ui.notify(\n sanitizeChromeDevtoolsDisplay(`Chrome DevTools browser settings failed: ${formatError(error)}`),\n \"error\",\n ),\n });\n return { closeParent: result.kind === \"closed\" && result.reason === \"close\" };\n}\n\nasync function saveAndApplyBrowserPatch(\n ctx: CommandContext,\n generation: number,\n ownerSignal: AbortSignal,\n actionSignal: AbortSignal,\n projectTrusted: boolean,\n patch: BrowserSettingsPatch,\n) {\n try {\n await ctx.waitForIdle();\n if (!isCurrent(generation, ownerSignal, actionSignal)) return false;\n await saveBrowserSettings(patch);\n if (!isCurrent(generation, ownerSignal, actionSignal)) return false;\n invalidateWebMcpOperations(ctx.sessionManager, \"Chrome DevTools browser configuration changed\");\n await shutdownManagedBrowser(undefined, { owner: ctx.sessionManager });\n if (!isCurrent(generation, ownerSignal, actionSignal)) return false;\n const loaded = await loadSettings({ cwd: ctx.cwd, projectTrusted });\n if (!isCurrent(generation, ownerSignal, actionSignal)) return false;\n applyRuntimeBrowserSettings(loaded.effectiveBrowser, loaded.paths, projectTrusted);\n syncManagedBrowserSettings(ctx.sessionManager, loaded.effectiveBrowser);\n state.settingsNotice = loaded.notice;\n return loaded;\n } catch (error) {\n if (isCurrent(generation, ownerSignal, actionSignal)) notifySaveFailure(ctx, error);\n return false;\n }\n}\n\nasync function saveAndApplyWebMcpSetting(\n pi: ExtensionAPI,\n ctx: CommandContext,\n generation: number,\n ownerSignal: AbortSignal,\n actionSignal: AbortSignal,\n projectTrusted: boolean,\n enabled: boolean,\n) {\n const previousEnabled = webMcpEnabled(ctx.sessionManager);\n const previousTools = configuredChromeDevtoolsTools(pi);\n try {\n await ctx.waitForIdle();\n if (!isCurrent(generation, ownerSignal, actionSignal)) return false;\n applyRuntimeWebMcpSetting(enabled, ctx.sessionManager);\n applyAvailableChromeDevtoolsTools(pi, previousTools);\n await saveWebMcpSettings(enabled);\n if (!isOwnerCurrent(generation, ownerSignal)) return false;\n const loaded = await loadSettings({ cwd: ctx.cwd, projectTrusted });\n if (!isOwnerCurrent(generation, ownerSignal)) return false;\n state.settingsNotice = loaded.notice;\n return loaded;\n } catch (error) {\n if (!isOwnerCurrent(generation, ownerSignal)) return false;\n let rollbackError: unknown;\n try {\n applyRuntimeWebMcpSetting(previousEnabled, ctx.sessionManager);\n applyAvailableChromeDevtoolsTools(pi, previousTools);\n } catch (caught) {\n rollbackError = caught;\n }\n if (isCurrent(generation, ownerSignal, actionSignal)) {\n notifySaveFailure(\n ctx,\n rollbackError\n ? new Error(`${formatError(error)}; WebMCP rollback failed: ${formatError(rollbackError)}`)\n : error,\n );\n }\n return false;\n }\n}\n\nfunction isOwnerCurrent(generation: number, ownerSignal: AbortSignal) {\n return generation === state.sessionGeneration && !ownerSignal.aborted;\n}\n\nfunction isCurrent(generation: number, ownerSignal: AbortSignal, actionSignal: AbortSignal) {\n return isOwnerCurrent(generation, ownerSignal) && !actionSignal.aborted;\n}\n\nfunction invalidSettingsScreen(load: SettingsLoadResult) {\n const reason = load.userFile.kind === \"invalid\" ? load.userFile.reason : \"The user settings file is unavailable.\";\n return {\n kind: \"detail\" as const,\n title: \"Chrome DevTools Browser settings \u00B7 Read only\",\n lines: [\n sanitizeChromeDevtoolsDisplay(\n `Fix the active user settings before saving; the file will not be overwritten. ${reason}`,\n ),\n ],\n hint: \"back\" as const,\n };\n}\n\nfunction settingsContextLines(load: SettingsLoadResult) {\n const browser = load.effectiveBrowser;\n return [\n `User settings \u00B7 ${load.paths.user}`,\n `Effective sources: endpoint ${browser.endpointSource} \u00B7 auto-launch ${browser.autoLaunchSource} \u00B7 executable ${browser.executablePathSource}`,\n ...(load.notice ? [`Warning: ${load.notice}`] : []),\n ].map((line) => sanitizeChromeDevtoolsDisplay(line));\n}\n\nfunction extensionDetailLines(load: SettingsLoadResult) {\n const browser = load.effectiveBrowser;\n return [\n `Effective source: ${browser.extensionPathsSource}`,\n ...(browser.extensionPaths.length > 0\n ? browser.extensionPaths.map((extensionPath) => `- ${extensionPath}`)\n : [\"No unpacked extensions are configured.\"]),\n \"Edit browser.extensionPaths in the user JSON or a trusted project JSON, then run /reload.\",\n \"Unpacked extensions execute privileged browser code; load only paths you trust.\",\n ].map((line) => sanitizeChromeDevtoolsDisplay(line));\n}\n\nfunction notifyEffectiveSave(\n ctx: CommandContext,\n setting: string,\n effectiveValue: string,\n source: BrowserSettingsSource,\n) {\n const overrideNotice = source === \"environment\" ? \" The deprecated environment override remains effective.\" : \"\";\n ctx.ui.notify(\n sanitizeChromeDevtoolsDisplay(\n `Chrome DevTools ${setting} saved. Effective ${setting}: ${effectiveValue} (${source}).${overrideNotice}`,\n ),\n \"info\",\n );\n}\n\nfunction notifySaveFailure(ctx: CommandContext, error: unknown) {\n ctx.ui.notify(\n sanitizeChromeDevtoolsDisplay(\n `Chrome DevTools browser settings save failed; previous settings remain active: ${formatError(error)}`,\n ),\n \"warning\",\n );\n}\n\nfunction formatError(error: unknown) {\n return error instanceof Error ? error.message : String(error);\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,kBAAkB;AAE3B,SAAS,YAAY,eAAe;AA4CpC,eAAsB,kCACpB,IACA,KACA,YACmC;AACnC,gCAA8B,IAAI,IAAI,cAAc;AACpD,QAAM,cAAc,MAAM,kBAAkB;AAC5C,QAAMA,aAAY,MAAM,eAAe,MAAM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