chrome-devtools-frontend 1.0.1733843 → 1.0.1736236

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 (184) hide show
  1. package/.agents/rules/tests/test-view-and-presenter-isolation.md +4 -4
  2. package/.agents/rules/ui-and-widgets/ui-declarative-tree-and-prompt-patterns.md +61 -0
  3. package/.agents/rules/ui-and-widgets/ui-lit-declarative-templates-and-directives.md +11 -7
  4. package/.agents/rules/ui-and-widgets/ui-modern-component-and-encapsulation-standards.md +13 -4
  5. package/.agents/rules/ui-and-widgets/ui-pure-view-and-presenter-separation.md +31 -2
  6. package/.agents/rules/ui-and-widgets/ui-reactive-widget-update-lifecycle.md +23 -4
  7. package/.agents/rules/ui-and-widgets/ui-widget-dom-and-listener-lifecycle.md +34 -3
  8. package/.agents/skills/code-review/SKILL.md +27 -0
  9. package/.agents/skills/devtools-uistrings/SKILL.md +147 -0
  10. package/.agents/skills/ui-eng-vision-local-lit-renderer/SKILL.md +27 -1
  11. package/.agents/skills/ui-eng-vision-orchestrator/SKILL.md +100 -0
  12. package/.agents/skills/ui-eng-vision-test-scaffolder/SKILL.md +16 -0
  13. package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +13 -2
  14. package/.agents/skills/ui-widgets/SKILL.md +25 -25
  15. package/DIR_METADATA +8 -1
  16. package/docs/cookbook/localization.md +1 -1
  17. package/docs/ui_engineering.md +24 -0
  18. package/eslint.config.mjs +0 -1
  19. package/front_end/application_tokens.css +1 -1
  20. package/front_end/core/host/AidaClient.ts +147 -202
  21. package/front_end/core/host/AidaClientTypes.ts +9 -0
  22. package/front_end/core/host/AidaErrors.ts +416 -0
  23. package/front_end/core/host/AidaGcaTranslation.ts +11 -0
  24. package/front_end/core/host/InspectorFrontendHostAPI.ts +9 -2
  25. package/front_end/core/host/UserMetrics.ts +25 -0
  26. package/front_end/core/host/UserMetricsEnums.ts +25 -0
  27. package/front_end/core/host/host.ts +3 -1
  28. package/front_end/core/i18n/collect-ui-strings.js +20 -0
  29. package/front_end/core/root/Runtime.ts +12 -0
  30. package/front_end/core/sdk/CPUThrottlingManager.ts +3 -0
  31. package/front_end/core/sdk/EnhancedTracesParser.ts +8 -4
  32. package/front_end/core/sdk/NetworkManager.ts +0 -6
  33. package/front_end/core/sdk/OverlayModel.ts +0 -6
  34. package/front_end/core/sdk/PreloadingModel.ts +30 -13
  35. package/front_end/core/sdk/PrivateVerificationTokensModel.ts +0 -18
  36. package/front_end/core/sdk/RehydratingConnection.ts +5 -2
  37. package/front_end/core/sdk/ResourceTreeModel.ts +0 -42
  38. package/front_end/core/sdk/ScreenCaptureModel.ts +0 -84
  39. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -15
  40. package/front_end/core/sdk/StorageBucketsModel.ts +0 -15
  41. package/front_end/devtools_compatibility.js +57 -2
  42. package/front_end/entrypoints/formatter_worker/ScopeParser.ts +4 -2
  43. package/front_end/entrypoints/inspector_main/RenderingOptions.ts +203 -127
  44. package/front_end/entrypoints/inspector_main/renderingOptions.css +5 -0
  45. package/front_end/entrypoints/node_app/app/NodeMain.ts +0 -9
  46. package/front_end/entrypoints/node_app/app/nodeConnectionsPanel.css +0 -22
  47. package/front_end/generated/InspectorBackendCommands.ts +1 -1
  48. package/front_end/generated/SupportedCSSProperties.ts +0 -136
  49. package/front_end/generated/protocol-proxy-api.d.ts +231 -231
  50. package/front_end/generated/protocol.ts +1 -0
  51. package/front_end/models/ai_assistance/AiAgent2.ts +4 -1
  52. package/front_end/models/ai_assistance/ChangeManager.ts +3 -1
  53. package/front_end/models/ai_assistance/DOMHelpers.ts +118 -3
  54. package/front_end/models/ai_assistance/ExtensionScope.ts +31 -24
  55. package/front_end/models/ai_assistance/agents/AiAgent.ts +6 -0
  56. package/front_end/models/ai_assistance/agents/PerformanceAgent.snapshot.txt +13 -13
  57. package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +1 -1
  58. package/front_end/models/ai_assistance/ai_assistance.ts +2 -0
  59. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.snapshot.txt +18 -8
  60. package/front_end/models/ai_assistance/data_formatters/PerformanceInsightFormatter.ts +2 -2
  61. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.snapshot.txt +103 -81
  62. package/front_end/models/ai_assistance/data_formatters/PerformanceTraceFormatter.ts +15 -203
  63. package/front_end/models/ai_assistance/injected.ts +6 -1
  64. package/front_end/models/ai_assistance/skills/lighthouse.md +1 -1
  65. package/front_end/models/ai_assistance/skills/styling.md +8 -10
  66. package/front_end/models/ai_assistance/tools/GetTraceEventByKey.ts +1 -1
  67. package/front_end/models/ai_assistance/tools/SetElementStyles.ts +288 -0
  68. package/front_end/models/ai_assistance/tools/Tool.ts +1 -0
  69. package/front_end/models/ai_assistance/tools/ToolRegistry.ts +3 -0
  70. package/front_end/models/bindings/ResourceScriptMapping.ts +64 -16
  71. package/front_end/models/comment_manager/CD4ABridge.ts +12 -2
  72. package/front_end/models/comment_manager/CommentManager.ts +24 -4
  73. package/front_end/models/javascript_metadata/NativeFunctions.ts +41 -1
  74. package/front_end/models/project_settings/ProjectSettingsModel.ts +1 -1
  75. package/front_end/models/trace/handlers/FlowsHandler.ts +10 -0
  76. package/front_end/models/trace/handlers/SamplesHandler.ts +3 -2
  77. package/front_end/models/trace/handlers/ScriptsHandler.ts +25 -26
  78. package/front_end/models/trace/helpers/TreeHelpers.ts +4 -0
  79. package/front_end/models/trace/insights/DuplicatedJavaScript.ts +1 -2
  80. package/front_end/models/trace/types/TraceEvents.ts +21 -22
  81. package/front_end/panels/ai_assistance/components/ChatMessage.ts +9 -1
  82. package/front_end/panels/ai_assistance/components/chatInput.css +4 -4
  83. package/front_end/panels/animation/AnimationTimeline.ts +3 -3
  84. package/front_end/panels/animation/animationTimeline.css +6 -4
  85. package/front_end/panels/application/IndexedDBModel.ts +0 -15
  86. package/front_end/panels/application/appManifestView.css +2 -5
  87. package/front_end/panels/application/components/backForwardCacheView.css +1 -5
  88. package/front_end/panels/application/components/serviceWorkerRouterView.css +2 -2
  89. package/front_end/panels/application/preloading/components/PreloadingString.ts +7 -0
  90. package/front_end/panels/comments/CommentsPane.ts +12 -7
  91. package/front_end/panels/comments/commentsPane.css +16 -2
  92. package/front_end/panels/common/CommentsOverlayWidget.ts +16 -10
  93. package/front_end/panels/common/CommentsStatusBarPill.ts +12 -5
  94. package/front_end/panels/common/commentsOverlay.css +7 -1
  95. package/front_end/panels/common/commentsStatusBarPill.css +30 -0
  96. package/front_end/panels/console/consolePrompt.css +0 -12
  97. package/front_end/panels/console/consoleView.css +2 -2
  98. package/front_end/panels/developer_resources/developerResourcesView.css +4 -3
  99. package/front_end/panels/elements/DOMTreeWidget.ts +29 -9
  100. package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -1
  101. package/front_end/panels/elements/components/CSSHintDetailsView.ts +12 -5
  102. package/front_end/panels/elements/components/cssVariableValueView.css +1 -1
  103. package/front_end/panels/elements/components/elementsBreadcrumbs.css +2 -2
  104. package/front_end/panels/elements/domTreeWidget.css +6 -1
  105. package/front_end/panels/elements/elementsPanel.css +0 -6
  106. package/front_end/panels/elements/layoutPane.css +1 -1
  107. package/front_end/panels/elements/metricsSidebarPane.css +1 -1
  108. package/front_end/panels/elements/platformFontsWidget.css +1 -1
  109. package/front_end/panels/elements/stylesSidebarPane.css +0 -10
  110. package/front_end/panels/emulation/deviceModeView.css +6 -7
  111. package/front_end/panels/explain/components/consoleInsight.css +4 -4
  112. package/front_end/panels/issues/issuesTree.css +1 -26
  113. package/front_end/panels/lighthouse/lighthouseStartView.css +2 -2
  114. package/front_end/panels/linear_memory_inspector/components/linearMemoryInspector.css +1 -1
  115. package/front_end/panels/media/TickingFlameChart.ts +20 -3
  116. package/front_end/panels/media/playerMessagesView.css +2 -2
  117. package/front_end/panels/mobile_throttling/ThrottlingSettingsTab.ts +24 -5
  118. package/front_end/panels/mobile_throttling/throttlingSettingsTab.css +1 -6
  119. package/front_end/panels/network/networkLogView.css +2 -2
  120. package/front_end/panels/network/networkTimingTable.css +1 -1
  121. package/front_end/panels/performance_monitor/performanceMonitor.css +0 -4
  122. package/front_end/panels/protocol_monitor/JSONEditor.css +1 -1
  123. package/front_end/panels/protocol_monitor/JSONEditor.ts +4 -2
  124. package/front_end/panels/recorder/recorderPanel.css +3 -3
  125. package/front_end/panels/recorder/recordingListView.css +1 -1
  126. package/front_end/panels/screencast/screencastView.css +1 -1
  127. package/front_end/panels/search/searchResultsPane.css +1 -1
  128. package/front_end/panels/security/SecurityModel.ts +0 -6
  129. package/front_end/panels/security/SecurityPanel.ts +120 -108
  130. package/front_end/panels/security/originView.css +1 -1
  131. package/front_end/panels/sensors/locationsSettingsTab.css +3 -3
  132. package/front_end/panels/settings/EditFileSystemView.ts +159 -104
  133. package/front_end/panels/settings/editFileSystemView.css +30 -4
  134. package/front_end/panels/settings/emulation/devicesSettingsTab.css +0 -52
  135. package/front_end/panels/settings/settingsScreen.css +0 -7
  136. package/front_end/panels/sources/CallStackSidebarPane.ts +339 -221
  137. package/front_end/panels/sources/NavigatorView.ts +95 -8
  138. package/front_end/panels/sources/ThreadsSidebarPane.ts +8 -4
  139. package/front_end/panels/sources/breakpointsView.css +1 -3
  140. package/front_end/panels/sources/callStackSidebarPane.css +4 -0
  141. package/front_end/panels/sources/components/HeadersView.ts +15 -2
  142. package/front_end/panels/sources/watchExpressionsSidebarPane.css +0 -1
  143. package/front_end/panels/timeline/CountersGraph.ts +0 -4
  144. package/front_end/panels/timeline/TimelineLoader.ts +16 -6
  145. package/front_end/panels/timeline/TimelinePanel.ts +20 -12
  146. package/front_end/panels/timeline/TimelineUIUtils.ts +1 -1
  147. package/front_end/panels/timeline/components/DetailsView.ts +2 -1
  148. package/front_end/panels/timeline/components/cwvMetrics.css +1 -1
  149. package/front_end/panels/timeline/components/metricCard.css +1 -1
  150. package/front_end/panels/timeline/components/sidebarAnnotationsTab.css +4 -4
  151. package/front_end/panels/timeline/timelineFlameChartView.css +1 -1
  152. package/front_end/panels/webauthn/WebauthnPane.ts +13 -14
  153. package/front_end/panels/webauthn/webauthnPane.css +1 -1
  154. package/front_end/third_party/chromium/README.chromium +1 -1
  155. package/front_end/ui/comments/CommentOverlayManager.ts +34 -18
  156. package/front_end/ui/components/icon_button/FileSourceIcon.ts +6 -0
  157. package/front_end/ui/components/input/textInput.css +1 -1
  158. package/front_end/ui/components/panel_introduction_steps/panelIntroductionSteps.css +6 -4
  159. package/front_end/ui/components/suggestion_input/suggestionInput.css +2 -2
  160. package/front_end/ui/components/text_editor/AiCodeGenerationTeaser.ts +14 -2
  161. package/front_end/ui/legacy/DockController.ts +17 -4
  162. package/front_end/ui/legacy/Treeoutline.ts +2 -2
  163. package/front_end/ui/legacy/UIUtils.ts +148 -10
  164. package/front_end/ui/legacy/components/inline_editor/bezierEditor.css +3 -2
  165. package/front_end/ui/legacy/components/perf_ui/chartViewport.css +2 -2
  166. package/front_end/ui/legacy/components/perf_ui/filmStripView.css +2 -2
  167. package/front_end/ui/legacy/components/perf_ui/pieChart.css +1 -1
  168. package/front_end/ui/legacy/components/quick_open/filteredListWidget.css +5 -4
  169. package/front_end/ui/legacy/components/source_frame/imageView.css +1 -1
  170. package/front_end/ui/legacy/components/utils/TargetDetachedDialog.ts +0 -3
  171. package/front_end/ui/legacy/components/utils/imagePreview.css +1 -1
  172. package/front_end/ui/legacy/inspectorCommon.css +1 -14
  173. package/front_end/ui/legacy/inspectorDrawerTabbedPane.css +3 -2
  174. package/front_end/ui/legacy/listWidget.css +0 -18
  175. package/front_end/ui/legacy/theme_support/ThemeSupport.ts +44 -9
  176. package/front_end/ui/lit/strip-whitespace.ts +1 -1
  177. package/front_end/ui/visual_logging/KnownContextValues.ts +1 -0
  178. package/package.json +3 -3
  179. package/front_end/generated/Deprecation.ts +0 -471
  180. package/front_end/panels/accessibility/axBreadcrumbs.css +0 -155
  181. package/front_end/panels/network/requestHeadersTree.css +0 -226
  182. package/front_end/panels/recorder/startView.css +0 -38
  183. package/front_end/panels/security/ipProtectionView.css +0 -141
  184. package/front_end/ui/legacy/components/inline_editor/animationNameSwatch.css +0 -27
@@ -0,0 +1,416 @@
1
+ // Copyright 2026 The Chromium Authors
2
+ // Use of this source code is governed by a BSD-style license that can be
3
+ // found in the LICENSE file.
4
+
5
+ import * as DispatchHttpRequestClient from './DispatchHttpRequestClient.js';
6
+ import * as UserMetrics from './UserMetrics.js';
7
+
8
+ export abstract class AidaClientError extends Error {
9
+ override name = 'AidaClientError';
10
+ }
11
+ export class AidaUnknownError extends AidaClientError {
12
+ override name = 'AidaUnknownError';
13
+ }
14
+ export class AidaAbortError extends AidaClientError {
15
+ override name = 'AidaAbortError';
16
+ }
17
+ export class AidaBlockError extends AidaClientError {
18
+ override name = 'AidaBlockError';
19
+ }
20
+ export class AidaQuotaError extends AidaClientError {
21
+ override name = 'AidaQuotaError';
22
+ }
23
+ export class AidaPayloadTooLargeError extends AidaClientError {
24
+ override name = 'AidaPayloadTooLargeError';
25
+ }
26
+ export class AidaPermissionDeniedError extends AidaClientError {
27
+ override name = 'AidaPermissionDeniedError';
28
+ }
29
+ export class AidaTimeoutError extends AidaClientError {
30
+ override name = 'AidaTimeoutError';
31
+ }
32
+ export class AidaInvalidJsonResponseError extends AidaClientError {
33
+ override name = 'AidaInvalidJsonResponseError';
34
+ }
35
+
36
+ /**
37
+ * Represents a failure to parse a streamed JSON chunk from an AIDA or GCA response.
38
+ */
39
+ export class StreamChunkParseError extends Error {
40
+ override name = 'StreamChunkParseError';
41
+ }
42
+
43
+ /**
44
+ * Checks whether any of the provided error strings indicate a quota or rate-limit failure.
45
+ *
46
+ * AIDA and GCA surface quota errors across different fields (status codes, human-readable
47
+ * messages, and serialized `google.rpc.ErrorInfo` details), so this predicate checks three
48
+ * substrings:
49
+ * - `'quota'`: direct AIDA error messages or details (for example,
50
+ * `"Quota exceeded for quota metric 'AiCodeCompleteService'"` or `"USER_QUOTA_EXCEEDED"`).
51
+ * - `'resource_exhausted'`: the standard `google.rpc.Code` status string (for example,
52
+ * `status: "RESOURCE_EXHAUSTED"` or `"RESOURCE_EXHAUSTED: quota exceeded"`).
53
+ * - `'rate_limit_exceeded'`: the `reason` field inside `google.rpc.ErrorInfo` details when
54
+ * the message itself does not mention `'quota'` (for example, GCA returning
55
+ * `message: "You have exhausted your capacity on this model."` with
56
+ * `details: [{"reason": "RATE_LIMIT_EXCEEDED", "domain": "cloudcode-pa.googleapis.com"}]`).
57
+ */
58
+ export function isQuotaError(...inputs: Array<string|undefined>): boolean {
59
+ return inputs.some(input => {
60
+ const lower = input?.toLowerCase();
61
+ return lower?.includes('quota') || lower?.includes('resource_exhausted') || lower?.includes('rate_limit_exceeded');
62
+ });
63
+ }
64
+
65
+ export function isPayloadTooLargeError(...inputs: Array<string|undefined>): boolean {
66
+ return inputs.some(input => input?.toLowerCase().includes('payload size exceeds the limit'));
67
+ }
68
+
69
+ /**
70
+ * Type guard that narrows an `unknown` error value to a plain key-value object so structured
71
+ * `google.rpc.Status` fields (`code`, `status`, `message`, `details`) can be inspected.
72
+ */
73
+ function isRecord(value: unknown): value is Record<string, unknown> {
74
+ if (typeof value !== 'object' || value === null) {
75
+ return false;
76
+ }
77
+ const proto = Object.getPrototypeOf(value);
78
+ return proto === Object.prototype || proto === null;
79
+ }
80
+
81
+ /**
82
+ * Maps AIDA-specific errors, DispatchHttpRequestErrors, strings, structured
83
+ * error objects, and generic Errors to dedicated AidaClientError subclasses.
84
+ */
85
+ export function mapError(err: unknown, detail?: string): AidaClientError {
86
+ if (err instanceof AidaClientError) {
87
+ return err;
88
+ }
89
+
90
+ if (err instanceof DispatchHttpRequestClient.DispatchHttpRequestError) {
91
+ if (err.type === DispatchHttpRequestClient.ErrorType.ABORT) {
92
+ return new AidaAbortError();
93
+ }
94
+ const response = err.response;
95
+ if (response) {
96
+ if (response.statusCode === 429) {
97
+ return new AidaQuotaError('Server responded: quota exceeded');
98
+ }
99
+ if (response.statusCode === 403) {
100
+ return new AidaPermissionDeniedError('Server responded: permission denied');
101
+ }
102
+ if ('netErrorName' in response && response.netErrorName === 'net::ERR_TIMED_OUT') {
103
+ return new AidaTimeoutError('AIDA request timed out');
104
+ }
105
+ if ('error' in response && response.error) {
106
+ const mapped = mapError(response.error, response.detail);
107
+ // Preserve the original HTTP error when recursive string mapping produces a cause-less AidaUnknownError.
108
+ if (mapped instanceof AidaUnknownError && mapped.cause === undefined) {
109
+ return new AidaUnknownError(mapped.message, {cause: err});
110
+ }
111
+ return mapped;
112
+ }
113
+ // The dispatcher throws HTTP_RESPONSE_UNAVAILABLE with status code 200
114
+ // when it receives the HTTP response but fails to parse its JSON body.
115
+ if (response.statusCode === 200 && err.type === DispatchHttpRequestClient.ErrorType.HTTP_RESPONSE_UNAVAILABLE) {
116
+ return new AidaInvalidJsonResponseError('Server responded with invalid JSON', {cause: err});
117
+ }
118
+ if (response.statusCode !== 200) {
119
+ return new AidaUnknownError(`Request failed: ${JSON.stringify(response)}`, {cause: err});
120
+ }
121
+ }
122
+ }
123
+
124
+ if (typeof err === 'string') {
125
+ if (isQuotaError(err, detail)) {
126
+ return new AidaQuotaError(`Cannot send request: ${err}${detail ? ` ${detail}` : ''}`);
127
+ }
128
+ if (isPayloadTooLargeError(err, detail)) {
129
+ return new AidaPayloadTooLargeError(`Cannot send request: ${err}${detail ? ` ${detail}` : ''}`);
130
+ }
131
+ return new AidaUnknownError(`Cannot send request: ${err}${detail ? ` ${detail}` : ''}`);
132
+ }
133
+
134
+ if (err instanceof Error) {
135
+ return new AidaUnknownError(err.message, {cause: err});
136
+ }
137
+
138
+ if (isRecord(err)) {
139
+ const code = typeof err.code === 'number' ? err.code : undefined;
140
+ const status = typeof err.status === 'string' ? err.status : undefined;
141
+ const message = typeof err.message === 'string' ? err.message : undefined;
142
+ const details = err.details !== undefined ? JSON.stringify(err.details) : undefined;
143
+ if (code === 429 || isQuotaError(status, message, details)) {
144
+ return new AidaQuotaError(message ?? 'Server responded: quota exceeded', {cause: err});
145
+ }
146
+ if (code === 403 || status === 'PERMISSION_DENIED') {
147
+ return new AidaPermissionDeniedError(message ?? 'Server responded: permission denied', {cause: err});
148
+ }
149
+ if (isPayloadTooLargeError(message, details)) {
150
+ return new AidaPayloadTooLargeError(message ?? 'Server responded: payload size exceeds the limit', {cause: err});
151
+ }
152
+ return new AidaUnknownError(message ?? JSON.stringify(err), {cause: err});
153
+ }
154
+
155
+ return new AidaUnknownError(String(err));
156
+ }
157
+
158
+ /**
159
+ * Pre-flight `"error"` strings emitted by Chromium's C++ DevTools bindings
160
+ * (`chrome/browser/devtools/devtools_ui_bindings.cc` and
161
+ * `devtools_embedder_message_dispatcher.cc`) when the browser rejects a request locally:
162
+ * - `'AIDA request was blocked'`: `HandleAidaClientUnavailable()` returns this string on
163
+ * `aidaCodeComplete` when `AidaClient::CanUseAida()` blocks the profile, and the embedder
164
+ * dispatcher returns it when a non-local frontend invokes `aidaCodeComplete`.
165
+ * - `'Disallowed path or method'`: `OnHttpRequestPerformed()` returns this string for
166
+ * `kAccessDenied` when `DevToolsHttpServiceRegistry` rejects the endpoint path or HTTP method.
167
+ * - `'Request validation failed'`: `OnHttpRequestPerformed()` returns this string for
168
+ * `kValidationFailed` when `CanMakeRequest()` rejects the profile (off-the-record, enterprise
169
+ * policy, age, or geo restrictions), and the embedder dispatcher returns it when a non-local
170
+ * frontend invokes `dispatchHttpRequest`.
171
+ * - `'Service not found'`: `OnHttpRequestPerformed()` returns this string for `kServiceNotFound`
172
+ * when `DevToolsHttpServiceRegistry` has no registration for the requested service name.
173
+ */
174
+ const VALIDATION_ERROR_MESSAGES = new Set<string>([
175
+ 'AIDA request was blocked',
176
+ 'Disallowed path or method',
177
+ 'Request validation failed',
178
+ 'Service not found',
179
+ ]);
180
+
181
+ /**
182
+ * OAuth `"error"` strings emitted by Chromium's C++ DevTools bindings when fetching a token
183
+ * from `IdentityManager` fails:
184
+ * - `'Cannot get OAuth credentials'` and `'IdentityManager is not available'`:
185
+ * `AidaClient::PrepareRequestOrFail()` and `AccessTokenFetchFinished()` in
186
+ * `chrome/browser/devtools/aida_client.cc` serialize these strings on legacy AIDA calls
187
+ * (`HandleAidaRequestError()` currently wraps that JSON payload inside
188
+ * `completeCodeResult.response` rather than setting a top-level `completeCodeResult.error`).
189
+ * - `'Token fetch error'`: `OnHttpRequestPerformed()` in
190
+ * `chrome/browser/devtools/devtools_ui_bindings.cc` returns this string for `kTokenFetchFailed`
191
+ * on `dispatchHttpRequest` calls.
192
+ */
193
+ const OAUTH_TOKEN_ERROR_MESSAGES = new Set<string>([
194
+ 'Cannot get OAuth credentials',
195
+ 'IdentityManager is not available',
196
+ 'Token fetch error',
197
+ ]);
198
+
199
+ /**
200
+ * Parses a serialized JSON error body (such as `AidaCodeCompleteResult.detail`) and extracts
201
+ * the inner structured error object when present.
202
+ *
203
+ * Handles three backend response shapes:
204
+ * - Wrapped object: `{"error": {"code": 503, "status": "UNAVAILABLE", ...}}`.
205
+ * - Streamed chunk array: `[{"error": {...}}]` or `[{"code": 429, "status": "RESOURCE_EXHAUSTED", ...}]`.
206
+ * - Direct `google.rpc.Status` object: `{"code": 400, "status": "INVALID_ARGUMENT", ...}`.
207
+ *
208
+ * Returns `null` if `jsonText` is not valid JSON or does not match a structured error shape.
209
+ */
210
+ function extractStructuredError(jsonText: string): Record<string, unknown>|null {
211
+ try {
212
+ const parsed: unknown = JSON.parse(jsonText);
213
+ const candidate = Array.isArray(parsed) && parsed.length > 0 ? parsed[0] : parsed;
214
+ if (isRecord(candidate)) {
215
+ if (isRecord(candidate.error)) {
216
+ return candidate.error;
217
+ }
218
+ if (typeof candidate.code === 'number' || typeof candidate.status === 'string') {
219
+ return candidate;
220
+ }
221
+ }
222
+ } catch {
223
+ return null;
224
+ }
225
+ return null;
226
+ }
227
+
228
+ function safeJsonStringify(value: unknown): string|undefined {
229
+ try {
230
+ return JSON.stringify(value);
231
+ } catch {
232
+ return undefined;
233
+ }
234
+ }
235
+
236
+ /**
237
+ * Maps a structured `google.rpc.Status` or HTTP JSON error record (`code`, `status`,
238
+ * `message`, `details`) to an `AiClientRequestResult` UMA bucket.
239
+ *
240
+ * Evaluates quota and payload-size predicates ahead of generic `400` / `INVALID_ARGUMENT`
241
+ * checks because AIDA and GCA can report quota or payload-limit failures inside 400 responses.
242
+ */
243
+ function classifyStructuredError(err: Record<string, unknown>): UserMetrics.AiClientRequestResult {
244
+ const code = typeof err.code === 'number' ? err.code : undefined;
245
+ const status = typeof err.status === 'string' ? err.status : undefined;
246
+ const message = typeof err.message === 'string' ? err.message : undefined;
247
+ // Guard serialization because `classifyRequestError()` accepts arbitrary `unknown` objects
248
+ // whose `details` property can contain circular references or `BigInt` values.
249
+ const details = err.details !== undefined ? safeJsonStringify(err.details) : undefined;
250
+
251
+ if (code === 429 || isQuotaError(status, message, details)) {
252
+ return UserMetrics.AiClientRequestResult.HTTP_429_QUOTA_EXCEEDED;
253
+ }
254
+ if (isPayloadTooLargeError(message, details)) {
255
+ return UserMetrics.AiClientRequestResult.HTTP_400_PAYLOAD_TOO_LARGE;
256
+ }
257
+ if (code === 400 || status === 'INVALID_ARGUMENT') {
258
+ return UserMetrics.AiClientRequestResult.HTTP_400_INVALID_ARGUMENT;
259
+ }
260
+ if (code === 401 || status === 'UNAUTHENTICATED') {
261
+ return UserMetrics.AiClientRequestResult.HTTP_401_UNAUTHORIZED;
262
+ }
263
+ if (code === 403 || status === 'PERMISSION_DENIED') {
264
+ return UserMetrics.AiClientRequestResult.HTTP_403_PERMISSION_DENIED;
265
+ }
266
+ if (code === 404 || status === 'NOT_FOUND') {
267
+ return UserMetrics.AiClientRequestResult.HTTP_404_NOT_FOUND;
268
+ }
269
+ if ((typeof code === 'number' && code >= 500 && code < 600) || status === 'INTERNAL' || status === 'UNAVAILABLE' ||
270
+ status === 'DEADLINE_EXCEEDED') {
271
+ return UserMetrics.AiClientRequestResult.HTTP_5XX_SERVER_ERROR;
272
+ }
273
+ return UserMetrics.AiClientRequestResult.UNKNOWN_ERROR;
274
+ }
275
+
276
+ /**
277
+ * Maps a failed request error from `doConversation`, `completeCode`, or `generateCode` to a
278
+ * backend-neutral `AiClientRequestResult` UMA bucket.
279
+ *
280
+ * Accepts already-mapped `AidaClientError` instances (unwrapping `AidaUnknownError.cause`),
281
+ * `StreamChunkParseError`, `DispatchHttpRequestError`, host error strings paired with an
282
+ * optional `detail` payload (from `aidaCodeComplete`), or raw structured error objects.
283
+ * Transport-level `netError` failures take precedence over HTTP status codes so mid-stream
284
+ * disconnects after an HTTP 200 header still record as network failures.
285
+ */
286
+ export function classifyRequestError(err: unknown, detail?: string): UserMetrics.AiClientRequestResult {
287
+ return classifyRequestErrorInternal(err, detail, new Set());
288
+ }
289
+
290
+ /**
291
+ * Tracks visited object references across recursive `cause` and `response.error` unwrapping so
292
+ * cyclic error references terminate with `UNKNOWN_ERROR` instead of overflowing the call stack.
293
+ */
294
+ function classifyRequestErrorInternal(err: unknown, detail: string|undefined,
295
+ seen: Set<object>): UserMetrics.AiClientRequestResult {
296
+ if (typeof err === 'object' && err !== null) {
297
+ if (seen.has(err)) {
298
+ return UserMetrics.AiClientRequestResult.UNKNOWN_ERROR;
299
+ }
300
+ seen.add(err);
301
+ }
302
+
303
+ if (err instanceof AidaAbortError) {
304
+ return UserMetrics.AiClientRequestResult.ABORTED;
305
+ }
306
+ if (err instanceof AidaBlockError) {
307
+ return UserMetrics.AiClientRequestResult.BLOCKED_BY_SAFETY_OR_RECITATION;
308
+ }
309
+ if (err instanceof AidaInvalidJsonResponseError) {
310
+ return UserMetrics.AiClientRequestResult.INVALID_JSON_RESPONSE;
311
+ }
312
+ if (err instanceof AidaQuotaError) {
313
+ return UserMetrics.AiClientRequestResult.HTTP_429_QUOTA_EXCEEDED;
314
+ }
315
+ if (err instanceof AidaPermissionDeniedError) {
316
+ return UserMetrics.AiClientRequestResult.HTTP_403_PERMISSION_DENIED;
317
+ }
318
+ if (err instanceof AidaPayloadTooLargeError) {
319
+ return UserMetrics.AiClientRequestResult.HTTP_400_PAYLOAD_TOO_LARGE;
320
+ }
321
+ if (err instanceof AidaTimeoutError) {
322
+ return UserMetrics.AiClientRequestResult.NETWORK_TIMEOUT;
323
+ }
324
+ if (err instanceof AidaUnknownError && err.cause !== undefined) {
325
+ return classifyRequestErrorInternal(err.cause, undefined, seen);
326
+ }
327
+ if (err instanceof StreamChunkParseError) {
328
+ return UserMetrics.AiClientRequestResult.STREAM_CHUNK_PARSE_ERROR;
329
+ }
330
+
331
+ if (err instanceof DispatchHttpRequestClient.DispatchHttpRequestError) {
332
+ if (err.type === DispatchHttpRequestClient.ErrorType.ABORT) {
333
+ return UserMetrics.AiClientRequestResult.ABORTED;
334
+ }
335
+ if (err.type === DispatchHttpRequestClient.ErrorType.NOT_FOUND) {
336
+ return UserMetrics.AiClientRequestResult.HTTP_404_NOT_FOUND;
337
+ }
338
+ const response = err.response;
339
+ if (response) {
340
+ // Check transport errors ahead of HTTP status codes because mid-stream disconnects can still carry statusCode 200.
341
+ if ('netErrorName' in response && response.netErrorName === 'net::ERR_TIMED_OUT') {
342
+ return UserMetrics.AiClientRequestResult.NETWORK_TIMEOUT;
343
+ }
344
+ if (('netError' in response && typeof response.netError === 'number' && response.netError !== 0) ||
345
+ ('netErrorName' in response && Boolean(response.netErrorName) && response.netErrorName !== 'net::OK')) {
346
+ return UserMetrics.AiClientRequestResult.NETWORK_ERROR;
347
+ }
348
+ if (response.statusCode === 200 && err.type === DispatchHttpRequestClient.ErrorType.HTTP_RESPONSE_UNAVAILABLE) {
349
+ return UserMetrics.AiClientRequestResult.INVALID_JSON_RESPONSE;
350
+ }
351
+ if ('error' in response && response.error) {
352
+ const structuredOrStringResult = classifyRequestErrorInternal(response.error, response.detail, seen);
353
+ if (structuredOrStringResult !== UserMetrics.AiClientRequestResult.UNKNOWN_ERROR) {
354
+ return structuredOrStringResult;
355
+ }
356
+ }
357
+ if (response.statusCode === -1) {
358
+ return UserMetrics.AiClientRequestResult.NETWORK_ERROR;
359
+ }
360
+ if (response.statusCode === 400) {
361
+ return UserMetrics.AiClientRequestResult.HTTP_400_INVALID_ARGUMENT;
362
+ }
363
+ if (response.statusCode === 401) {
364
+ return UserMetrics.AiClientRequestResult.HTTP_401_UNAUTHORIZED;
365
+ }
366
+ if (response.statusCode === 403) {
367
+ return UserMetrics.AiClientRequestResult.HTTP_403_PERMISSION_DENIED;
368
+ }
369
+ if (response.statusCode === 404) {
370
+ return UserMetrics.AiClientRequestResult.HTTP_404_NOT_FOUND;
371
+ }
372
+ if (response.statusCode === 429) {
373
+ return UserMetrics.AiClientRequestResult.HTTP_429_QUOTA_EXCEEDED;
374
+ }
375
+ if (typeof response.statusCode === 'number' && response.statusCode >= 500 && response.statusCode < 600) {
376
+ return UserMetrics.AiClientRequestResult.HTTP_5XX_SERVER_ERROR;
377
+ }
378
+ }
379
+ return UserMetrics.AiClientRequestResult.UNKNOWN_ERROR;
380
+ }
381
+
382
+ if (typeof err === 'string') {
383
+ if (VALIDATION_ERROR_MESSAGES.has(err)) {
384
+ return UserMetrics.AiClientRequestResult.VALIDATION_FAILED;
385
+ }
386
+ if (OAUTH_TOKEN_ERROR_MESSAGES.has(err)) {
387
+ return UserMetrics.AiClientRequestResult.OAUTH_TOKEN_ERROR;
388
+ }
389
+ if (isQuotaError(err, detail)) {
390
+ return UserMetrics.AiClientRequestResult.HTTP_429_QUOTA_EXCEEDED;
391
+ }
392
+ if (isPayloadTooLargeError(err, detail)) {
393
+ return UserMetrics.AiClientRequestResult.HTTP_400_PAYLOAD_TOO_LARGE;
394
+ }
395
+ if (detail) {
396
+ const structuredError = extractStructuredError(detail);
397
+ if (structuredError) {
398
+ return classifyStructuredError(structuredError);
399
+ }
400
+ }
401
+ return UserMetrics.AiClientRequestResult.UNKNOWN_ERROR;
402
+ }
403
+
404
+ if (err instanceof Error) {
405
+ if (err.message.startsWith('Unsupported client feature for GCA conversation:')) {
406
+ return UserMetrics.AiClientRequestResult.VALIDATION_FAILED;
407
+ }
408
+ return UserMetrics.AiClientRequestResult.UNKNOWN_ERROR;
409
+ }
410
+
411
+ if (isRecord(err)) {
412
+ return classifyStructuredError(err);
413
+ }
414
+
415
+ return UserMetrics.AiClientRequestResult.UNKNOWN_ERROR;
416
+ }
@@ -512,6 +512,16 @@ export function gcaChunkResponseToAidaChunkResponse(response: GCA.GenerateConten
512
512
  inferenceOptionMetadata: {modelId: response.modelVersion},
513
513
  };
514
514
 
515
+ if (response.usageMetadata) {
516
+ metadata.usageMetadata = {
517
+ promptTokenCount: response.usageMetadata.promptTokenCount,
518
+ candidatesTokenCount: response.usageMetadata.candidatesTokenCount,
519
+ totalTokenCount: response.usageMetadata.totalTokenCount,
520
+ thoughtsTokenCount: response.usageMetadata.thoughtsTokenCount,
521
+ cachedContentTokenCount: response.usageMetadata.cachedContentTokenCount,
522
+ };
523
+ }
524
+
515
525
  if (candidate?.citationMetadata?.citations) {
516
526
  metadata.attributionMetadata = {
517
527
  attributionAction: AIDA.RecitationAction.CITE,
@@ -522,6 +532,7 @@ export function gcaChunkResponseToAidaChunkResponse(response: GCA.GenerateConten
522
532
  })),
523
533
  };
524
534
  }
535
+
525
536
  const chunks: AIDA.AidaChunkResponse[] = parts.map(part => {
526
537
  const aidaChunkResponse: AIDA.AidaChunkResponse = {metadata};
527
538
  if (part.text !== undefined) {
@@ -50,7 +50,7 @@ export enum Events {
50
50
  export const EventDescriptors: ReadonlyArray<readonly[Events, readonly string[], boolean?]> = [
51
51
  [Events.AppendedToURL, ['url']],
52
52
  [Events.CanceledSaveURL, ['url']],
53
- [Events.ColorThemeChanged, []],
53
+ [Events.ColorThemeChanged, ['colorSource']],
54
54
  [Events.ContextMenuCleared, []],
55
55
  [Events.ContextMenuItemSelected, ['id']],
56
56
  [Events.DeviceCountUpdated, ['count']],
@@ -243,7 +243,7 @@ export interface DevicesDiscoveryConfig {
243
243
  export interface EventTypes {
244
244
  [Events.AppendedToURL]: Platform.DevToolsPath.RawPathString|Platform.DevToolsPath.UrlString;
245
245
  [Events.CanceledSaveURL]: Platform.DevToolsPath.UrlString;
246
- [Events.ColorThemeChanged]: void;
246
+ [Events.ColorThemeChanged]: Root.Runtime.UserColorSource|void;
247
247
  [Events.ContextMenuCleared]: void;
248
248
  [Events.ContextMenuItemSelected]: number;
249
249
  [Events.DeviceCountUpdated]: number;
@@ -579,5 +579,12 @@ export const enum EnumeratedHistogram {
579
579
  BuiltInAiAvailability = 'DevTools.BuiltInAiAvailability',
580
580
  ResendRequest = 'DevTools.ResendRequest',
581
581
  EditResendRequest = 'DevTools.EditResendRequest',
582
+ AiClientRequestResult = 'DevTools.AiClient.RequestResult',
583
+ AiClientRequestResultAiAssistance = 'DevTools.AiClient.RequestResult.AiAssistance',
584
+ AiClientRequestResultCodeComplete = 'DevTools.AiClient.RequestResult.CodeComplete',
585
+ AiClientRequestResultCodeGenerate = 'DevTools.AiClient.RequestResult.CodeGenerate',
586
+ AiClientRequestResultConsoleInsights = 'DevTools.AiClient.RequestResult.ConsoleInsights',
587
+ AiClientRequestResultConversationSummary = 'DevTools.AiClient.RequestResult.ConversationSummary',
588
+ AiClientRequestResultPerformanceAnnotations = 'DevTools.AiClient.RequestResult.PerformanceAnnotations',
582
589
  // LINT.ThenChange(/front_end/devtools_compatibility.js:EnumeratedHistogram)
583
590
  }
@@ -294,6 +294,18 @@ export class UserMetrics {
294
294
  commentSize(characters: number): void {
295
295
  InspectorFrontendHostInstance.recordCountHistogram('DevTools.Comments.CommentSize', characters, 1, 100_000, 50);
296
296
  }
297
+
298
+ /**
299
+ * Records the outcome of an AI request to the aggregate histogram and optionally to a surface-specific slice.
300
+ */
301
+ aiClientRequestResult(result: AiClientRequestResult, surfaceHistogram?: AiClientSurfaceHistogram): void {
302
+ InspectorFrontendHostInstance.recordEnumeratedHistogram(EnumeratedHistogram.AiClientRequestResult, result,
303
+ AiClientRequestResult.MAX_VALUE);
304
+ if (surfaceHistogram !== undefined) {
305
+ InspectorFrontendHostInstance.recordEnumeratedHistogram(surfaceHistogram, result,
306
+ AiClientRequestResult.MAX_VALUE);
307
+ }
308
+ }
297
309
  }
298
310
 
299
311
  /**
@@ -500,6 +512,19 @@ export type ResendRequestType = Enums.ResendRequestType;
500
512
  export const ResendRequestType: typeof Enums.ResendRequestType =
501
513
  createDynamicEnumProxy<typeof Enums.ResendRequestType>('ResendRequestType', Enums.ResendRequestType);
502
514
 
515
+ export type AiClientRequestResult = Enums.AiClientRequestResult;
516
+ export const AiClientRequestResult: typeof Enums.AiClientRequestResult =
517
+ createDynamicEnumProxy<typeof Enums.AiClientRequestResult>('AiClientRequestResult', Enums.AiClientRequestResult);
518
+
519
+ export type AiClientSurfaceHistogram = EnumeratedHistogram.AiClientRequestResultAiAssistance|
520
+ EnumeratedHistogram.AiClientRequestResultCodeComplete|
521
+ EnumeratedHistogram.AiClientRequestResultCodeGenerate|
522
+ EnumeratedHistogram.AiClientRequestResultConsoleInsights|
523
+ EnumeratedHistogram.AiClientRequestResultConversationSummary|
524
+ EnumeratedHistogram.AiClientRequestResultPerformanceAnnotations;
525
+
526
+ export const userMetrics: UserMetrics = new UserMetrics();
527
+
503
528
  const resendRequestTypeMap = new Map<Common.ResourceType.ResourceType, keyof typeof Enums.ResendRequestType>([
504
529
  [Common.ResourceType.resourceTypes.XHR, 'XHR'],
505
530
  [Common.ResourceType.resourceTypes.Fetch, 'FETCH'],
@@ -952,4 +952,29 @@ export enum ResendRequestType {
952
952
  MAX_VALUE = 16,
953
953
  }
954
954
 
955
+ /**
956
+ * Maps to the `DevTools.AiClient.RequestResult` UMA histogram.
957
+ * Values are persisted to logs and must remain append-only in sync with `enums.xml`.
958
+ */
959
+ export enum AiClientRequestResult {
960
+ SUCCESS = 0,
961
+ ABORTED = 1,
962
+ VALIDATION_FAILED = 2,
963
+ OAUTH_TOKEN_ERROR = 3,
964
+ NETWORK_TIMEOUT = 4,
965
+ NETWORK_ERROR = 5,
966
+ HTTP_400_PAYLOAD_TOO_LARGE = 6,
967
+ HTTP_400_INVALID_ARGUMENT = 7,
968
+ HTTP_401_UNAUTHORIZED = 8,
969
+ HTTP_403_PERMISSION_DENIED = 9,
970
+ HTTP_404_NOT_FOUND = 10,
971
+ HTTP_429_QUOTA_EXCEEDED = 11,
972
+ HTTP_5XX_SERVER_ERROR = 12,
973
+ STREAM_CHUNK_PARSE_ERROR = 13,
974
+ INVALID_JSON_RESPONSE = 14,
975
+ BLOCKED_BY_SAFETY_OR_RECITATION = 15,
976
+ UNKNOWN_ERROR = 16,
977
+ MAX_VALUE = 17,
978
+ }
979
+
955
980
  // LINT.ThenChange(/front_end/devtools_compatibility.js)
@@ -3,6 +3,7 @@
3
3
  // found in the LICENSE file.
4
4
 
5
5
  import * as AidaClient from './AidaClient.js';
6
+ import * as AidaErrors from './AidaErrors.js';
6
7
  import * as AidaGcaTranslation from './AidaGcaTranslation.js';
7
8
  import * as DispatchHttpRequestClient from './DispatchHttpRequestClient.js';
8
9
  import * as GcaClient from './GcaClient.js';
@@ -16,6 +17,7 @@ import * as UserMetrics from './UserMetrics.js';
16
17
 
17
18
  export {
18
19
  AidaClient,
20
+ AidaErrors,
19
21
  AidaGcaTranslation,
20
22
  DispatchHttpRequestClient,
21
23
  GcaClient,
@@ -28,4 +30,4 @@ export {
28
30
  UserMetrics,
29
31
  };
30
32
 
31
- export const userMetrics: UserMetrics.UserMetrics = new UserMetrics.UserMetrics();
33
+ export const userMetrics: UserMetrics.UserMetrics = UserMetrics.userMetrics;
@@ -24,6 +24,13 @@ const yargsObject = yargs(hideBin(process.argv))
24
24
  type: 'array',
25
25
  demandOption: true,
26
26
  })
27
+ .option('generated-root', {
28
+ type: 'string',
29
+ })
30
+ .option('generated-files', {
31
+ type: 'array',
32
+ implies: 'generated-root',
33
+ })
27
34
  .option('output-directory', {
28
35
  type: 'string',
29
36
  demandOption: true,
@@ -100,6 +107,19 @@ for (const directory of inputDirectories) {
100
107
  };
101
108
  files.push(...directoryFiles.map(f => path.join(directory, f)));
102
109
  }
110
+ // Sources that the build generates live in the gen dir, which mirrors the
111
+ // source tree. The message key of a UIString is the path of its file relative
112
+ // to front_end/, as passed to registerUIStrings(), so the generated files are
113
+ // given relative to front_end/ in the gen dir and collected with it as root.
114
+ const generatedRoot = yargsObject['generated-root'];
115
+ const generatedFiles = yargsObject['generated-files'] ?? [];
116
+ if (generatedFiles.length > 0) {
117
+ collectedStrings = {
118
+ ...collectedStrings,
119
+ ...collectAllStringsInDir(generatedRoot, generatedFiles, cache),
120
+ };
121
+ files.push(...generatedFiles.map(f => path.join(generatedRoot, f)));
122
+ }
103
123
 
104
124
  const tasks = [convertCtcToLhLAndSave(outputDirectory, 'en-US', collectedStrings)];
105
125
  if (yargsObject['include-en-xl']) {
@@ -301,6 +301,13 @@ export interface AidaAvailability {
301
301
 
302
302
  type Channel = 'stable'|'beta'|'dev'|'canary';
303
303
 
304
+ /**
305
+ * The source of the user's Chrome color theme. `baseline-default` and
306
+ * `baseline-grayscale` are Chrome's built-in baseline themes; all other color
307
+ * themes are `dynamic`.
308
+ */
309
+ export type UserColorSource = 'baseline-default'|'baseline-grayscale'|'dynamic';
310
+
304
311
  export interface HostConfigConsoleInsights {
305
312
  modelId: string;
306
313
  temperature: number;
@@ -552,6 +559,11 @@ export type HostConfig = Platform.TypeScriptUtilities.RecursivePartial<{
552
559
  * or guest mode, rather than a "normal" profile.
553
560
  */
554
561
  isOffTheRecord: boolean,
562
+ /**
563
+ * The source of the user's Chrome color theme at startup. Live updates are
564
+ * delivered via the `ColorThemeChanged` host event.
565
+ */
566
+ userColorSource: UserColorSource,
555
567
  devToolsEnableOriginBoundCookies: HostConfigEnableOriginBoundCookies,
556
568
  devToolsAnimationStylesInStylesTab: HostConfigAnimationStylesInStylesTab,
557
569
  devToolsJpegXlImageFormat: HostConfigJpegXlImageFormat,
@@ -237,6 +237,9 @@ export class CPUThrottlingManager extends Common.ObjectWrapper.ObjectWrapper<Eve
237
237
  }
238
238
 
239
239
  setHardwareConcurrency(concurrency: number): void {
240
+ if (concurrency < 1 || Number.isNaN(concurrency)) {
241
+ return;
242
+ }
240
243
  this.#hardwareConcurrency = concurrency;
241
244
  for (const emulationModel of this.#targetManager.models(EmulationModel)) {
242
245
  void emulationModel.setHardwareConcurrency(concurrency);
@@ -36,7 +36,7 @@ export interface RundownScriptCompiled extends EventBase {
36
36
  url: string,
37
37
  /**
38
38
  * Older traces were a number, but this is an unsigned 64 bit value, so that was a bug.
39
- * New traces use string instead. See https://crbug.com/447654178.
39
+ * New traces (since M142, Sep 2025, crrev.com/c/6990800) use string instead. See https://crbug.com/447654178.
40
40
  */
41
41
  isolate: string|number,
42
42
  /** AKA V8ContextToken. https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/inspector/inspector_trace_events.cc;l=1229;drc=3c88f61e18b043e70c225d8d57c77832a85e7f58 */
@@ -61,7 +61,7 @@ export interface RundownScript extends EventBase {
61
61
  data: {
62
62
  /**
63
63
  * Older traces were a number, but this is an unsigned 64 bit value, so that was a bug.
64
- * New traces use string instead. See https://crbug.com/447654178.
64
+ * New traces (since M142, Sep 2025, crrev.com/c/6990800) use string instead. See https://crbug.com/447654178.
65
65
  */
66
66
  isolate: string|number,
67
67
  executionContextId: Protocol.Runtime.ExecutionContextId,
@@ -91,7 +91,11 @@ export interface RundownScriptSource extends EventBase {
91
91
  name: 'ScriptCatchup'|'LargeScriptCatchup'|'TooLargeScriptCatchup';
92
92
  args: {
93
93
  data: {
94
- isolate: number,
94
+ /**
95
+ * Older traces were a number, but this is an unsigned 64 bit value, so that was a bug.
96
+ * New traces (since M142, Sep 2025, crrev.com/c/6990800) use string instead. See https://crbug.com/447654178.
97
+ */
98
+ isolate: string|number,
95
99
  scriptId: number,
96
100
  length?: number,
97
101
  sourceText?: string,
@@ -124,7 +128,7 @@ interface FunctionCall extends EventBase {
124
128
  scriptId: Protocol.Runtime.ScriptId,
125
129
  /**
126
130
  * Older traces were a number, but this is an unsigned 64 bit value, so that was a bug.
127
- * New traces use string instead. See https://crbug.com/447654178.
131
+ * New traces (since M142, Sep 2025, crrev.com/c/6990800) use string instead. See https://crbug.com/447654178.
128
132
  */
129
133
  isolate?: string|number,
130
134
  },