Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
5813 commits
Select commit Hold shift + click to select a range
7b13d85
[AI] README for the performance agent initial context and tool data
AlinaVarkki Apr 13, 2026
9d1b094
Fix bug with how suggestion text was being sliced
samiyac Apr 14, 2026
18a1c68
Update DevTools DEPS (trusted)
Apr 14, 2026
6c3a98c
Allow specifying worker URL
Lightning00Blade Apr 14, 2026
7cd6f77
Small style fixes
Lightning00Blade Apr 14, 2026
146f5b5
Add missing ve logging to Ai features
ktran Apr 14, 2026
6c08c9f
[webmcp] Extend JSON editor for non-CDP commands
pfaffe Apr 14, 2026
ee63ce8
Update DevTools DEPS (trusted)
Apr 15, 2026
842a3f3
AI: ensure users who enable AI with V2 do not see opt in
jackfranklin Apr 14, 2026
b1f51ac
Fix Ai Assistance icon color in opt-in dialog for v2
ktran Apr 15, 2026
791a3ee
[cxx_debugging] Fix deprecated tsconfig options
szuend Apr 14, 2026
49b29c4
[stack_trace]: Add ParsedErrorStackFragment interfaces to StackTrace
szuend Apr 13, 2026
436cc8e
[AI] Add a getMainThreadTrackSummaryByLabel function
AlinaVarkki Apr 14, 2026
d7200e6
TypeScript: add types to front_end/tsconfig.json
jackfranklin Apr 15, 2026
1622420
Revert "[cxx_debugging] Fix deprecated tsconfig options"
pfaffe Apr 15, 2026
ceafbbe
Migrate APCA experiment to a setting
wolfib Apr 15, 2026
52b6377
Roll browser-protocol and CfT
Apr 15, 2026
8ab0904
Revert "[deps] Update typescript to 6.0.2"
pfaffe Apr 15, 2026
8cbff28
Parse tool input schema into JSON parameters
pfaffe Apr 15, 2026
a4c193c
[webmcp] Rename Success state to Completed
pfaffe Apr 15, 2026
9ae74b6
Use Lit rendering to manage widget host element.
danilsomsikov Apr 14, 2026
e2b9072
Create new text area on copy to coding agent tab switch
Apr 15, 2026
6dbc333
Enter keypress (when on "Manage In Settings") navigates to settings
samiyac Apr 15, 2026
2081468
Update DevTools DEPS (trusted)
Apr 16, 2026
fd82caf
AI: fix size of Opt in Dialog header
jackfranklin Apr 14, 2026
ef56a52
Do not regenerate prompt summary when only timestamp changes
Apr 15, 2026
1647a51
Fix context selector not showing execution contexts
indutny-signal Apr 15, 2026
e5d13a6
[stack_trace]: Implement Error.stack parsing for V8 strings
szuend Apr 16, 2026
33679f8
AI: let the AI choose which mode to run Lighthouse in
jackfranklin Apr 15, 2026
f772e79
Add @ts-ignore to Image.js as TS6 forbids untyped side-effect imports
szuend Apr 16, 2026
da564cf
[deps] Add missing dependencies in formatter_worker/BUILD.gn
szuend Apr 16, 2026
08e50fe
[deps] Rename foo.mjs.d.ts -> foo.d.mts in lighthouse/codemirror
szuend Apr 16, 2026
e510e65
Reland "[deps] Update typescript to 6.0.2"
szuend Apr 16, 2026
bea0a33
[docs] Don't mention dtf_check_no_bundle in custom filter docs
szuend Apr 16, 2026
b9b20ea
[stack_trace]: Augment RawFrames with script IDs
szuend Apr 13, 2026
f36d656
Exclude hover button labels from console copy
jackfranklin Apr 16, 2026
f68bcfd
Expose which issue are supported
Lightning00Blade Apr 14, 2026
9c972c7
[GreenDevFloaty]: Fix problems with squished conversation messages.
finnurbreki Apr 16, 2026
4f43615
AI: improve link handling for LH report
jackfranklin Apr 16, 2026
e56df2a
[AI] Show task-specific widgets insted of CWV widget when a task is s…
AlinaVarkki Apr 16, 2026
dfec07e
Reconstruct structured stack traces from Error.stack strings
szuend Apr 16, 2026
a9b9a05
[webmcp] Copyable names and descriptions in the tool list
pfaffe Apr 16, 2026
350bd39
Update DevTools DEPS (trusted)
Apr 16, 2026
176d535
Roll browser-protocol and CfT
Apr 16, 2026
89989b2
Update DevTools DEPS (trusted)
Apr 17, 2026
a62c288
[bindings] Expose createStackTraceFromErrorStackLikeString API
szuend Apr 13, 2026
2f85649
[bindings] Add SymbolizedError
szuend Apr 17, 2026
3b356da
[AI] Show LCP widget if the Performance Agent context is the LCP insight
AlinaVarkki Apr 16, 2026
8daab95
[AI] Change LcpBreakdownAiWidget into PerfInsightAiWidget to be able …
AlinaVarkki Apr 16, 2026
f21f65b
Roll browser-protocol and CfT
Apr 17, 2026
ccc1307
Roll puppeteer-core
Apr 17, 2026
59bd106
[AI] Show TIMELINE_RANGE_SUMMARY widget when getDetailedCallTree is c…
AlinaVarkki Apr 15, 2026
6ed3e27
Revert "[AI] Change LcpBreakdownAiWidget into PerfInsightAiWidget to …
OrKoN Apr 17, 2026
36dd6aa
Fix left-over issues in PropertiesWidget
pfaffe Apr 17, 2026
daca36a
[unit] Throw if karma exits early
pfaffe Apr 17, 2026
7a816cb
Update DevTools DEPS (trusted)
Apr 17, 2026
742141e
Roll browser-protocol and CfT
Apr 17, 2026
e713e59
AI: left align the prompt suggestions with the "Copy to agent" btn
jackfranklin Apr 17, 2026
35251f5
Reland "[AI] Change LcpBreakdownAiWidget into PerfInsightAiWidget to …
AlinaVarkki Apr 16, 2026
193502a
AI: Improve ConversationSummaryAgent preamble and output
jackfranklin Apr 17, 2026
6e0a2fe
[stack_trace] Handle builtin frames correctly
szuend Apr 20, 2026
d5ee367
[webmcp] Invoke tools
pfaffe Apr 20, 2026
ba2dc78
[bindings] Add UPDATE events to SymbolizedError
szuend Apr 20, 2026
a650c14
Add test coverage for WatchExpressionsSidebarPane
pfaffe Apr 17, 2026
3b7a9d1
[webmcp] Deselect unregistered tools
pfaffe Apr 20, 2026
5594565
Fix unit tests
OrKoN Apr 20, 2026
726b59e
AI: Anchor CSS summary to last completed model response
jackfranklin Apr 17, 2026
b596912
[unit] Skip RequestConditionsDrawer tests that fail on CQ and CI
AlinaVarkki Apr 20, 2026
c779ed1
AI: remove GCA migration from default feature flags
jackfranklin Apr 20, 2026
aab66a0
Implement mitigation to reduce code completion requests sent to AIDA
samiyac Apr 20, 2026
cbc6648
[dbsc] Support deleting device bound sessions in DevTools
jdoerrie Apr 20, 2026
d5e2608
Add included files segments to GCA requests
Apr 20, 2026
ef56f4e
Modernize Widget architecture to support "pure" Shadow DOM rendering
danilsomsikov Apr 20, 2026
ed7e303
AI: log client feature & user tier in debug
jackfranklin Apr 20, 2026
abb6b08
Update DevTools DEPS (trusted)
Apr 20, 2026
b638571
Report duplicate test ids as errors
pfaffe Apr 20, 2026
e2b6049
Migrate web_tests/http/tests/devtools/console/console-stack-overflow.…
AlinaVarkki Apr 20, 2026
86693ea
Skip a recorder test that fails of CQ
AlinaVarkki Apr 21, 2026
cd6f4c1
Update What's new content for Chrome 148
matthiasrohmer Apr 20, 2026
0b3a1f1
Update DevTools DEPS (trusted)
Apr 21, 2026
c960f77
Automatically fire CustomEvents for ObjectWrapper widgets
pfaffe Apr 20, 2026
3fcf276
Add more context to 'Reveal' a11y labels
ktran Apr 21, 2026
0d45280
Fix issue highlighting in the Elements panel for hidden issues
thepigrammer Apr 16, 2026
9d39062
Add focus styles for walkthrough steps
ktran Apr 21, 2026
af48b48
TextUtils: Improve image previews with Blob URLs and safety limits
jackfranklin Apr 21, 2026
e90d4c0
Focus first radio button in 'Copy to coding agent' dialog
ktran Apr 21, 2026
377ae2f
Plumb IgnoreListManager and mark fallback URLs as well
szuend Apr 21, 2026
f7e9dc8
[widget] Log errors of failing performUpdate calls
szuend Apr 21, 2026
fae547a
Remove redundant styles for select options and input elements in insp…
ElormCoch Apr 20, 2026
018e42b
Upgrade web-vitals to 5.2.0
tunetheweb Apr 21, 2026
2738b1a
[webmcp] Show a Run tool button instead of the arrow icon
pfaffe Apr 21, 2026
989960d
Resolve the sampling heap timeline profiler experiment
Apr 21, 2026
2e4d9db
Update DevTools DEPS (trusted)
Apr 21, 2026
5e2611c
[AI Assistance] Implement prompt history navigation via ArrowUp/Arrow…
jackfranklin Apr 17, 2026
e065e30
Dialog: remove extra dt-close-button component
jackfranklin Apr 21, 2026
b5804c6
AI: remove extra padding from Perf Summary widget in AI Assistance
jackfranklin Apr 21, 2026
34ba9ce
Fix RequestHeadersView tests.
danilsomsikov Apr 21, 2026
19d0be0
Move the HeapSnapshowWorker test to foundation module
Lightning00Blade Apr 21, 2026
abaac05
emulation: implement dynamic mobile UA heuristic to prevent bit rot
paulirish Apr 21, 2026
acfb208
[A11y] Re-apply lighthouse header heading fix
guangyuexu Apr 20, 2026
97544c1
Update DevTools DEPS (trusted)
Apr 22, 2026
70ac4c7
[AI Assistance] Add accessible labels for walkthrough buttons
jackfranklin Apr 21, 2026
ec38dc4
Trace: deal with missing `metadata` field
jackfranklin Apr 21, 2026
5314a52
[stack_trace] Add parseMessage helper to DetailedErrorStackParser
szuend Apr 22, 2026
6114781
[stack_trace] Make Error.stack parsing more strict
szuend Apr 22, 2026
6b9d682
Support (sub-)widgets as direct children of the shadow root.
danilsomsikov Apr 22, 2026
73f907c
[AI] Remove getMainThreadTrackSummary function
AlinaVarkki Apr 22, 2026
ed7540b
[bindings] Add 'message' and remove 'remoteError' from SymbolizedError
szuend Apr 22, 2026
b953531
Roll puppeteer-core
Apr 22, 2026
9e15202
Configure host in the view function where possible in panels/elements
danilsomsikov Apr 22, 2026
d5ed4de
Configure host in the view function where possible in panels/accessib…
danilsomsikov Apr 22, 2026
78e6436
Fix skipping of heading levels in AI walkthrough
Apr 22, 2026
9bafa62
Bring back full accessibility tree jslog contexts.
danilsomsikov Apr 22, 2026
47c1e16
Configure host in the view function where possible in panels/application
danilsomsikov Apr 22, 2026
11154da
Nit fixes around sampling heap timeline profiler feature
Apr 22, 2026
dbf870d
Add ignore-listing test to JSPresentationUtils.test.ts
szuend Apr 22, 2026
75435a4
Update how AI suggestion ghost value is shown
samiyac Apr 15, 2026
1c0734b
Configure host in the view function where possible in panels/timeline
danilsomsikov Apr 22, 2026
4d7465c
Roll browser-protocol and CfT
AlinaVarkki Apr 22, 2026
bdd18e3
Configure host in the view function where possible in panels/recorder
danilsomsikov Apr 22, 2026
a3cfa40
Add presubmit check to prevent removal of visual logging context values.
danilsomsikov Apr 22, 2026
cb1c16d
AI: add more information to main thread activity text
jackfranklin Apr 22, 2026
19cacfe
Configure host in the view function where possible in panels/network
danilsomsikov Apr 22, 2026
c788efb
Enable full Shadow DOM support for child widgets
danilsomsikov Apr 22, 2026
99d96b2
Configure host in the view function where possible in panels/{console…
danilsomsikov Apr 22, 2026
4f07e55
Skip BreakpointEditDialog tests and change accessibility assertion ex…
AlinaVarkki Apr 22, 2026
ef32ff1
Configure host in the view function where possible in items view
danilsomsikov Apr 22, 2026
1b18f18
Minimized drawer -- update consumers
guangyuexu Apr 21, 2026
936ed82
[bindings] Create SymbolizedError from string RemoteObjects with details
szuend Apr 22, 2026
9139115
[bindings] Include issueSummary in SymbolizedError
szuend Apr 23, 2026
11f330d
[bindings] Rename SymbolizedError to SymbolizedErrorObject
szuend Apr 23, 2026
0410b07
Disable StepEditor tests
AlinaVarkki Apr 23, 2026
3c9cc48
Configure host in the view function where possible in panel root views
danilsomsikov Apr 23, 2026
1e5d1d6
Update DevTools DEPS (trusted)
Apr 23, 2026
ae9c109
Reduce screenshot threshold
pfaffe Apr 23, 2026
d8d7eb8
Configure host in the view function where possible in panels/{changes…
danilsomsikov Apr 23, 2026
7cb047c
Merge NetworkThrottlingSelectWidget into NetworkThrottlingSelect.
danilsomsikov Apr 23, 2026
2f72f40
[bindings] Add SymbolizedSyntaxError
szuend Apr 24, 2026
3dddc6b
Disable BlockingFocusWithoutUserActivation in unit tests
OrKoN Apr 24, 2026
e0b9dde
[bindings] Return SymbolizeSyntaxError in createSymbolizedError
szuend Apr 24, 2026
cd692dd
[webmcp] Use watch icon
pfaffe Apr 23, 2026
951ce06
AI: remove apostrophes from labels in walkthrough buttons
jackfranklin Apr 24, 2026
b17d1d9
Update DevTools DEPS (trusted)
Apr 27, 2026
2a3a6f5
Clarify debuggability in DevTools checklist
mathiasbynens Apr 22, 2026
ef31c8b
Disable flaky tests that fail on Mac arm64
ktran Apr 27, 2026
297fa40
Disable more flaky tests that fail on Mac arm64
ktran Apr 27, 2026
3b4d61b
[webmcp] Address UI nits
pfaffe Apr 27, 2026
0028f28
Elements: remove DOM node translation layer for breadcrumbs
jackfranklin Apr 27, 2026
d305963
Update DevTools DEPS (trusted)
Apr 27, 2026
4dc0ec4
AI: Make agent preambles static
jackfranklin Apr 27, 2026
1f83e9b
AI: add a script to extract preambles from agents
jackfranklin Apr 27, 2026
c6bac84
Allow duplicate test id under repeat and retry options
Apr 27, 2026
3ac6762
Roll browser-protocol and CfT
Apr 23, 2026
ddc446f
Disable WebUIReloadButton to deflake mac64 tests
AlinaVarkki Apr 27, 2026
3b23b0e
[BeyondStyling]: Add basic agent for testing.
finnurbreki Apr 27, 2026
1f8a2bb
Better error messages in Deep asserts
Apr 27, 2026
8a973cd
Fix window access in sdk
OrKoN Apr 24, 2026
506d205
Re-enable tests disabled because of failing tests on Mac arm64
ktran Apr 27, 2026
ef08a6e
AI: De-duplicate widgets at the ModelChatMessage level
jackfranklin Apr 27, 2026
cc44806
[webmcp] Context menu for revealing tools and resending calls
pfaffe Apr 27, 2026
aacb73e
Update DevTools DEPS (trusted)
Apr 27, 2026
8833489
[webmcp] Add an info label for tool details for unregistered tools
pfaffe Apr 27, 2026
c1a6ae9
Roll browser-protocol and CfT
Apr 27, 2026
d4f25be
[webmcp] Fill the tool parameters from json
pfaffe Apr 27, 2026
4d17d70
[Durable Messages] Use Durable Messages only on "Preserve log"
Apr 23, 2026
cb401ba
AI: add ESLint rule to enforce static preambles
jackfranklin Apr 27, 2026
d179164
[stack_trace] Fix Wasm frame matching in DetailedErrorStackParser
szuend Apr 27, 2026
1ce691a
Update DevTools DEPS (trusted)
Apr 28, 2026
4c5bc70
Roll browser-protocol and CfT
Apr 28, 2026
f689f6f
Split 'linkifyStackTraceFrame' into a general 'linkifyUILocation'
szuend Apr 27, 2026
1872c5e
[bindings] Add UnparsableError to SymbolizedError variants
szuend Apr 28, 2026
a8d1fb4
[webmcp] Turn call stat icons into filter shortcuts
pfaffe Apr 27, 2026
f58ca51
Re-enable BlockingFocusWithoutUserActivation
OrKoN Apr 27, 2026
885f4c4
[bindings] Emit UPDATED events from UnparsableError when cause updates
szuend Apr 28, 2026
3fbcd6c
[bindings] Heuristically filter strings in createSymbolizedError
szuend Apr 28, 2026
95f3214
[bindings] Use real RemoteObject in SymoblizedError.test.ts
szuend Apr 28, 2026
5020b10
[webmcp] Add issue descriptions
pfaffe Apr 28, 2026
4d47006
[AI] Refactor PerfInsightAiWidget to easier support more insights and…
AlinaVarkki Apr 27, 2026
477803a
Migrate editing as HTML to lit
OrKoN Apr 28, 2026
d7e88f1
Fix karma-mocha to report uncaught errors
OrKoN Apr 28, 2026
7f8ad87
Add isInsightKey function
AlinaVarkki Apr 28, 2026
e16e003
Update DevTools DEPS (trusted)
Apr 28, 2026
da8d215
Remove fixed debugging port from karma
pfaffe Apr 28, 2026
b26ad40
Fix selection styles of PropertiesWidget
pfaffe Apr 28, 2026
f91bd07
[webmcp] Cancelling in-progress calls
pfaffe Apr 28, 2026
c342428
Roll browser-protocol and CfT
Apr 29, 2026
717212d
Unflake crash-report-context.test.ts
ktran Apr 29, 2026
1e494b5
Update DevTools DEPS (trusted)
ktran Apr 29, 2026
bf402f7
Refactor: Migrate DeviceModeToolbar to use HTML elements
danilsomsikov Apr 23, 2026
149b9b0
[AI] Add support for the LCP request discovery and CLS culprits widgets
AlinaVarkki Apr 28, 2026
06c84ab
Add expansion controller tests for WatchExpressionsPane
pfaffe Apr 29, 2026
4128c70
Replicate layout test for editing disabled style as unit test
jackfranklin Apr 29, 2026
a1c7223
Refactor makePerfInsightWidget
AlinaVarkki Apr 29, 2026
4d31fe9
Add a skill to migrate foundation unit tests
OrKoN Apr 29, 2026
2bfcaf2
[storage-agent] Add DevToolsAiAssistanceStorageAgent feature
ktran Apr 22, 2026
763e1ca
Re-test skipped tests
Apr 28, 2026
952639e
Update DevTools DEPS (trusted)
Apr 29, 2026
0e04a2b
Move dom_extension to ui/
OrKoN Apr 29, 2026
bb339b8
Migrate i18n to foundation
OrKoN Apr 29, 2026
3447483
Migrate root tests to foundation unit tests
OrKoN Apr 29, 2026
4a88f8d
Fix test count checks in the presence of .only
pfaffe Apr 29, 2026
c535f09
[A11y] Fixing ratio contrast on the INP badge
vidorteg Apr 27, 2026
3278ca0
Update DevTools DEPS (trusted)
Apr 30, 2026
0d57553
Roll browser-protocol and CfT
Apr 30, 2026
be11174
[console] Add empty SymbolizedErrorWidget to render SymbolizedErrors
szuend Apr 30, 2026
2ffd9a4
Simplify verification skill
OrKoN Apr 30, 2026
a8a5e09
[AI] Add support for the Network Dependency Tree and Third Parties wi…
AlinaVarkki Apr 29, 2026
5c02ee9
[AI] Add support for Forced Overflow, Cache and INP insights widgets
AlinaVarkki Apr 29, 2026
581d529
Remove "expose internals" checkbox for heap snapshots
Apr 30, 2026
39ab13c
[BeyondStyling] Augment the prototype
finnurbreki Apr 29, 2026
c63204f
Made global throttling conditions and save data select lit-frienly
danilsomsikov Apr 30, 2026
8d8849f
Fold DeviceSizeInputElement into DeviceModeToolbar
danilsomsikov Apr 30, 2026
09342d3
Add support for devtools-button in bindToSetting
danilsomsikov Apr 30, 2026
ead3ed7
Update DevTools DEPS (trusted)
Apr 30, 2026
6775287
AI Assistance: Fix origin mismatch in network request context
jackfranklin Apr 30, 2026
ab9a473
AI: update feedback link to new M149+ bug.
jackfranklin Apr 30, 2026
3230dbb
Update DevTools DEPS (trusted)
May 1, 2026
010e26d
[AI] Add support for Document Latency, Dom Size and Duplicate JS insi…
AlinaVarkki Apr 30, 2026
2e34b84
[AI] Add support for Image Delivery, font display and slow css select…
AlinaVarkki Apr 30, 2026
7ce315a
[AI] Add support for legacy js, viewport, modern http and character s…
AlinaVarkki Apr 30, 2026
b0960bd
[AICodeCompletion] Fix Enter keypress behavior to be similar to Tab
samiyac Apr 30, 2026
3a4877a
[AI] Remove SUPPORTED_INSIGHT_WIDGETS map
AlinaVarkki Apr 30, 2026
3526633
Fix 'Undefined' in Timestamp column for media
tmathmeyer Apr 29, 2026
8abe320
Update DevTools DEPS (trusted)
May 1, 2026
230cc90
Update DevTools DEPS (trusted)
May 2, 2026
8cb7231
Add collapse/expand all toggle button to Console
hjanuschka Apr 17, 2026
bbba9c4
Update DevTools DEPS (trusted)
May 4, 2026
3d87ca1
Fix code completions generated in Styles pane
samiyac May 4, 2026
22e2f66
Roll browser-protocol and CfT
May 4, 2026
5388f69
Fix a11y issue with color contrast
samiyac May 4, 2026
8dce5c3
Check if patches are applied
OrKoN May 4, 2026
424b1bb
Migrate host to foundation unit test
OrKoN Apr 30, 2026
735efc1
Update Puppeteer for tests
Lightning00Blade May 4, 2026
b4ba1f8
AI: use an id to compare messages
jackfranklin May 1, 2026
fd96371
For AI suggestions, do not accept suggestion on stop characters
samiyac May 4, 2026
7d815ec
Roll browser-protocol and CfT
May 4, 2026
48aaeb6
Update DevTools DEPS (trusted)
May 4, 2026
40ddc3a
Fix flakiness in CPUThrottlingManager tests
May 4, 2026
116a17d
[Lighthouse] Roll Lighthouse 13.2.0
May 4, 2026
002f5f0
[M149] Simplify AI completion/generation feature availability checks
samiyac May 5, 2026
300b8a0
[M149] Fix how disable_user_content_logging is being set
samiyac May 4, 2026
d3c674c
[M149] Improve how AI suggestion for value part is handled in StylePr…
samiyac May 7, 2026
dd56644
[M149] Insights: fix broken re-rendering of Insights
jackfranklin May 5, 2026
2ecd7f6
[M149] AI: use ContentData for network request image rendering
jackfranklin May 8, 2026
3d9f0a7
[M149] Update translations
pfaffe May 11, 2026
d48ac67
[M149] Migrate CSS hints to lit
OrKoN May 20, 2026
761d575
[M149] Don't use innerHTML on user controlled data
Lightning00Blade May 19, 2026
42bafcf
Update What's new content for Chrome 149
matthiasrohmer May 26, 2026
33c2f40
[M149] Fix inline editing
OrKoN May 22, 2026
61e939f
Sync fork with chromium/7827
huntie Jun 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.
1 change: 1 addition & 0 deletions .agents/OWNERS
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
file://config/owner/COMMON_OWNERS
13 changes: 13 additions & 0 deletions .agents/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# .agents

This directory contains workspace-specific agent expertise and skills.

## Skills

Workspace skills are located in `.agents/skills/`. These represent on-demand expertise that the AI agent can activate to complete specialized tasks.

To use a skill, the agent will autonomously identify it based on its description and pull in the instructions using the `activate_skill` tool.

## Contributing

Contributions to existing skills or adding new ones are encouraged via CLs.
57 changes: 57 additions & 0 deletions .agents/skills/creating-a-model/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
```
---
name: devtools-model-management
description: Guidelines for creating, migrating, and registering models in front_end/models/. Covers BUILD.gn, devtools_grd_files.gni, and entrypoints.
---

# Creating or Migrating a Model in DevTools

This guide outlines the standard procedure for creating a new model or migrating an existing one to `front_end/models/`.

## 0. Preparation (Before you start)
* **Baseline:** Run existing tests for the code you are moving to ensure they pass *before* you touch anything.
* `npm run test -- front_end/<old_location>`
* **Impact Analysis:** Search for usages of the class/file to understand the scope of refactoring.
* `grep -r "ClassName" front_end/`

## 1. File Structure
* **Location:** `front_end/models/<model_name>/` (must be lowercase).
* **Entrypoint:** Create a barrel file `front_end/models/<model_name>/<model_name>.ts` that exports the model's public API.
* **Implementation:** The actual logic goes in `<ClassName>.ts`.
* **Tests:** Unit tests go in `<ClassName>.test.ts` alongside the implementation.

## 2. Build Configuration (`BUILD.gn`)
Every model requires a `BUILD.gn` file in its directory with three specific targets:

1. **`devtools_module("<model_name>")`**: Lists implementation source files (`sources`) and dependencies (`deps`).
* **Crucial:** Do NOT include the barrel file (`<model_name>.ts`) in `sources`.
2. **`devtools_entrypoint("bundle")`**: Defines the barrel file (`entrypoint = "<model_name>.ts"`).
* **Crucial:** Must depend on the module target: `deps = [ ":<model_name>" ]`.
3. **`ts_library("unittests")`**: Lists test files and test-only dependencies.
* **Crucial:** Must depend on the bundle: `deps = [ ":bundle" ]`.

## 3. Global Registration (Crucial)
The build system does not auto-detect new modules. You must manually register them in **`config/gni/devtools_grd_files.gni`**:

* **Bundled (Release) Build:** Add the new barrel file path (e.g., `front_end/models/<model_name>/<model_name>.js`) to the `grd_files_bundled_sources` list.
* **Unbundled (Debug) Build:** Add all other implementation files (e.g., `front_end/models/<model_name>/<ClassName>.js`) to the `grd_files_unbundled_sources` list.
* **Test Runner:** Add the new model's unittest target (e.g., `models/<model_name>:unittests`) to the `deps` list in **`front_end/BUILD.gn`**.

## 4. Refactoring Imports & Exports
* **Consumers:** Update all files importing the model to use the new entrypoint:
`import * as ModelName from '../../models/<model_name>/<model_name>.js';`
* **Old Barrel File (Migration only):** If moving a file, **remove** its export from the original directory's barrel file (e.g., `front_end/panels/elements/elements.ts`).
* **Internal Imports:** Files *within* the model directory must import each other via relative paths (e.g., `./OtherClass.js`), **never** via the model's own barrel file.

## 5. Verification Checklist
1. **Build:** `autoninja -C out/Default` (Ensures BUILD.gn and GRD files are correct).
2. **Lint:** `npm run lint` (Checks style and formatting).
3. **Test:**
* `npm run test -- front_end/models/<model_name>` (New tests).
* `npm run test -- front_end/<old_location>` (Regression check for previous owner).

## Common Pitfalls
* **Circular Dependencies:** Occur when internal files import from the directory's own barrel file.
* **Missing Tests:** Failing to add the target to `front_end/BUILD.gn` means tests exist but never run.
* **Legacy Exports:** Forgetting to remove the class from the old location's `files` or `exports` allows old patterns to persist.
* **Build Errors:** Including the barrel file in `devtools_module` sources causes duplicate definition errors.
52 changes: 52 additions & 0 deletions .agents/skills/devtools-imports/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
---
name: devtools-imports
description: Conventions for importing code in Devtools to avoid build errors. Covers cross-module imports, internal imports, and the "import * as" requirement.
---

# Imports

This codebase follows a special convention for importing code that must be followed to avoid build errors.

In DevTools each folder of code is considered a *module*:

- `front_end/models/trace` is the *trace module*.
- `front_end/panels/timeline` is the *timeline module*.

Within each module there are multiple TypeScript files. *The file that is named the same as the folder name is called the entrypoint*.

- `front_end/models/trace/trace.ts` is the *trace module's entrypoint*
- `front_end/models/trace/ModelImpl.ts` is part of the implementation of the trace module.

## Importing from another module

When you want to reuse code from other modules, *you must import that module via its entrypoint*. Imagine we are in `front_end/panels/timeline/TimelinePanel.ts`. This import is GOOD:

```ts
import * as Trace from '../models/trace/trace.js'; // import the entrypoint
```

This import is BAD because we import a file that is NOT the entrypoint:

```ts
import * as ModelImpl from '../models/trace/ModelImpl.js' // NEVER ALLOWED
```

Additionally, you **must import using the `import * as` syntax**.

```ts
import {ModelImpl, X, Y} from '../models/trace/trace.js'; // BAD
```

```ts
import * as Trace from '../models/trace/trace.js'; // GOOD
```

## Importing from within the same module

If you are within the same module, it is OK to import from files directly rather than go via the entrypoint. You can also import specifically what you need.

For example, if you are editing `front_end/models/trace/ModelImpl.ts` this would be acceptable:

```ts
import {Foo} from './Foo.js'; // allowed because Foo.ts is in the same directory.
```
171 changes: 171 additions & 0 deletions .agents/skills/foundation-test-migration/SKILL.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
---
name: foundation-test-migration
description: Migrating unit tests to foundation unit tests using TestUniverse and devtools_foundation_module. Use when moving tests away from DOM-heavy helpers like describeWithEnvironment or describeWithMockConnection.
---

# Foundation Test Migration

This skill provides guidance on migrating DevTools unit tests to the "foundation" pattern, which is lighter, avoids global singletons, and is compatible with both Node and Browser runtimes (Isomorphic).

## Core Concepts

### devtools_foundation_module (BUILD.gn)
Use this template for modules that should be platform-agnostic.
- **Enforcement**: It type-checks the code against both Browser and Node APIs.
- **Constraint**: Avoid direct DOM access (like `FileReader` or layout metrics) or heavy DevTools dependencies. Use `Universe` to access services.

### TestUniverse
`TestUniverse` is the preferred way to setup a DevTools-like environment for tests without global singletons.
- **Lazy**: Dependencies (targetManager, settings, workspace, etc.) are only created when accessed via getters.
- **Scoped**: Does not install instances as globals (avoids `Common.Settings.Settings.instance()`).
- **Explicit**: Uses `DevToolsContext` to manage dependencies.

## Migration Guide

### 1. Replace Heavy Helpers
Avoid `describeWithEnvironment` or `describeWithMockConnection`.

Instead, use standard `describe` and initialize environment hooks at the top-level `describe` block. **Crucial:** Without `setupRuntimeHooks`, tests creating SDK models will crash due to uninitialized experiments (e.g. `capture-node-creation-stacks`).

```ts
import {setupLocaleHooks} from '../../testing/LocaleHelpers.js';
import {setupSettingsHooks} from '../../testing/SettingsHelpers.js';
import {setupRuntimeHooks} from '../../testing/RuntimeHelpers.js';
import {TestUniverse} from '../../testing/TestUniverse.js';

describe('MyComponent', () => {
setupLocaleHooks();
setupSettingsHooks();
setupRuntimeHooks();

let universe: TestUniverse;

beforeEach(() => {
universe = new TestUniverse();
});
});
```

### 2. Access Dependencies via Universe
Instead of using `SDK.TargetManager.TargetManager.instance()`, use `universe.targetManager`. Use `universe.createTarget()` instead of the global `createTarget`.

```ts
// OLD
const target = createTarget();
const targetManager = SDK.TargetManager.TargetManager.instance();

// NEW
const target = universe.createTarget({url: urlString`http://example.com/`});
const targetManager = universe.targetManager;
```

#### Mocking CDP Traffic
If the test used `describeWithMockConnection` and global `setMockConnectionResponseHandler` to stub CDP traffic, you can migrate this by passing a `MockCDPConnection` to `universe.createTarget()`. This allows stubbing out CDP traffic scoped to a specific target tree rather than globally.

```ts
import {MockCDPConnection} from '../../testing/MockCDPConnection.js';

const cdpConnection = new MockCDPConnection([
{
method: 'Network.getResponseBody',
response: () => ({body: 'mocked body', base64Encoded: false}),
}
]);

const target = universe.createTarget({connection: cdpConnection});
```

> [!TIP]
> **Legacy Target URLs**: `EnvironmentHelpers.createTarget()` defaults to `http://example.com/`. `TestUniverse.createTarget()` defaults to `about:blank`. If your test asserts against specific URLs, remember to pass the URL explicitly.

### 3. Dealing with Legacy Singletons & Helpers

For large integration tests, you may encounter code that strictly calls `SomeModule.instance()` or uses complex legacy helpers (like `createWorkspaceProject`).

**Do not use `setUpEnvironment()`** as it will create disconnected singletons. Instead, wire the singletons to your `TestUniverse` and stub the globals to bridge legacy helpers:

```ts
beforeEach(async () => {
universe = new TestUniverse();
const {targetManager, workspace, settings} = universe;

// 1. Stub globals so legacy helpers use TestUniverse components
sinon.stub(Workspace.Workspace.WorkspaceImpl, 'instance').returns(workspace);
sinon.stub(SDK.TargetManager.TargetManager, 'instance').returns(targetManager);
sinon.stub(Common.Settings.Settings, 'instance').returns(settings);

// 2. Initialize interdependent singletons in the correct order
SDK.NetworkManager.MultitargetNetworkManager.instance({forceNew: true, targetManager});

// 3. Now safe to use legacy helpers that rely on the above instances
await createWorkspaceProject(urlString`file:///path/to/overrides`, [...]);
});
```

## Pitfalls & Troubleshooting

### Strict Equality in Protocol Responses (`assert.deepEqual`)
Protocol requests/responses dynamically generated by Chrome (like Network conditions) can vary slightly (e.g., adding `connectionType`, `urlPattern`).
- **Problem**: `assert.deepEqual(rules, [{...}])` will flake if unrequested fields are present.
- **Solution**: Use `sinon.spy()` for handlers and assert with `sinon.assert.calledOnceWithMatch`:

```ts
const emulateSpy = sinon.spy();
connection.setHandler('Network.emulateNetworkConditionsByRule', request => {
emulateSpy(request);
return {result: {ruleIds: []}};
});

// Matches only the fields you care about, ignoring extra protocol fields
sinon.assert.calledOnceWithMatch(emulateSpy, {
offline: false,
matchedNetworkConditions: [sinon.match({ downloadThroughput: 1000 })],
});
```

### DOM Globals (`ReferenceError: FileReader is not defined`)
Foundation tests run in Node.js where `window`, `FileReader`, and certain DOM string encodings don't exist.
- **Fix**: Use isomorphic equivalents (e.g. `btoa()`, `Uint8Array`).
- **Fix**: Abstract the APIs that are different between Node.js and Browser via `front_end/core/platform/api/HostRuntime.ts`.

### Initialization Order Lockups
If a test times out (5000ms exceeded), it is usually an unhandled promise caused by a missing singleton. Double-check the constructor of the failing manager to see which `instance()` it listens to, and ensure that dependent singleton was created *first*.

## BUILD.gn Changes

When a module and its tests are ready, update `BUILD.gn`:

1. Change `devtools_module` to `devtools_foundation_module` for both the module and its unittests.
2. Ensure the tests are grouped under a `foundation_unittests` target in the parent `BUILD.gn`.

```gn
# front_end/my_module/BUILD.gn

devtools_foundation_module("my_module") {
sources = [ "MyModule.ts" ]
deps = [ "../../core/common:bundle" ]
}

devtools_foundation_module("unittests") {
testonly = true
sources = [ "MyModule.test.ts" ]
deps = [
":my_module",
"../../testing",
]
}
```

## Verification

Foundation tests must pass in both Node.js and Browser runtimes.

### Run in Node.js
```bash
npm test -- front_end/core/sdk/NetworkManager.test.ts --node-unit-tests
```

### Run in Browser
```bash
npm test -- front_end/core/sdk/NetworkManager.test.ts
```
Loading