chrome-devtools-frontend 1.0.1682249 → 1.0.1684555

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 (103) hide show
  1. package/AUTHORS +1 -0
  2. package/front_end/core/sdk/ServiceWorkerCacheModel.ts +0 -7
  3. package/front_end/core/sdk/StorageBucketsModel.ts +0 -6
  4. package/front_end/entrypoints/inspector_main/InspectorMain.ts +2 -1
  5. package/front_end/entrypoints/inspector_main/inspector_main-meta.ts +1 -5
  6. package/front_end/entrypoints/main/MainImpl.ts +6 -4
  7. package/front_end/entrypoints/main/main-meta.ts +9 -51
  8. package/front_end/foundation/Universe.ts +7 -0
  9. package/front_end/generated/InspectorBackendCommands.ts +12 -22
  10. package/front_end/generated/protocol-mapping.d.ts +9 -59
  11. package/front_end/generated/protocol-proxy-api.d.ts +7 -47
  12. package/front_end/generated/protocol.ts +105 -330
  13. package/front_end/models/ai_assistance/AiAgent2.ts +12 -4
  14. package/front_end/models/ai_assistance/AiConversation.ts +25 -7
  15. package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -19
  16. package/front_end/models/ai_assistance/agents/StorageAgent.ts +6 -6
  17. package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
  18. package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +12 -6
  19. package/front_end/models/ai_assistance/tools/GetStorageValues.ts +1 -1
  20. package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +1 -1
  21. package/front_end/models/ai_assistance/tools/RunLighthouse.ts +5 -8
  22. package/front_end/models/ai_assistance/tools/Tool.ts +19 -6
  23. package/front_end/models/issues_manager/DOMIssuesManager.ts +144 -0
  24. package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +13 -1
  25. package/front_end/models/issues_manager/GenericIssue.ts +14 -2
  26. package/front_end/models/issues_manager/IssuesManager.ts +0 -1
  27. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  28. package/front_end/models/javascript_metadata/NativeFunctions.js +8 -0
  29. package/front_end/models/trace/Processor.ts +1 -0
  30. package/front_end/panels/ai_assistance/ExternalHandler.ts +89 -0
  31. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  32. package/front_end/panels/application/BackgroundServiceModel.ts +4 -3
  33. package/front_end/panels/application/IndexedDBModel.ts +0 -7
  34. package/front_end/panels/console/ConsoleView.ts +17 -16
  35. package/front_end/panels/console/ConsoleViewMessage.ts +4 -1
  36. package/front_end/panels/console/console-meta.ts +4 -19
  37. package/front_end/panels/elements/ElementIssueUtils.ts +10 -2
  38. package/front_end/panels/elements/ElementsPanel.ts +8 -3
  39. package/front_end/panels/elements/ElementsTreeElement.ts +82 -161
  40. package/front_end/panels/elements/ElementsTreeOutline.ts +26 -105
  41. package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -11
  42. package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -0
  43. package/front_end/panels/elements/StylesContainer.ts +1 -0
  44. package/front_end/panels/elements/StylesSidebarPane.ts +174 -151
  45. package/front_end/panels/network/RequestPayloadView.ts +5 -2
  46. package/front_end/panels/security/SecurityPanelSidebar.ts +0 -32
  47. package/front_end/panels/settings/KeybindsSettingsTab.ts +5 -2
  48. package/front_end/panels/sources/SourcesPanel.ts +6 -3
  49. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +2 -6
  50. package/front_end/panels/timeline/components/CWVMetrics.ts +9 -10
  51. package/front_end/panels/timeline/components/DetailsView.ts +12 -16
  52. package/front_end/panels/timeline/components/ExportTraceOptions.ts +13 -13
  53. package/front_end/panels/timeline/components/FieldSettingsDialog.ts +19 -19
  54. package/front_end/panels/timeline/components/IgnoreListSetting.ts +7 -9
  55. package/front_end/panels/timeline/components/InteractionBreakdown.ts +3 -3
  56. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +13 -13
  57. package/front_end/panels/timeline/components/LiveMetricsView.ts +64 -64
  58. package/front_end/panels/timeline/components/MetricCard.ts +25 -25
  59. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +22 -22
  60. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +9 -9
  61. package/front_end/panels/timeline/components/OriginMap.ts +7 -7
  62. package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
  63. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +19 -20
  64. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
  65. package/front_end/panels/timeline/components/TimelineSummary.ts +2 -2
  66. package/front_end/panels/timeline/components/Utils.ts +2 -6
  67. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +6 -9
  68. package/front_end/panels/timeline/components/insights/Checklist.ts +2 -2
  69. package/front_end/panels/timeline/components/insights/Table.ts +1 -1
  70. package/front_end/third_party/chromium/README.chromium +1 -1
  71. package/front_end/ui/comments/CommentAnchorResolver.ts +94 -0
  72. package/front_end/ui/comments/CommentOverlayManager.ts +16 -32
  73. package/front_end/ui/components/text_editor/config.ts +2 -1
  74. package/front_end/ui/legacy/DockController.ts +4 -1
  75. package/front_end/ui/legacy/InspectorView.ts +3 -1
  76. package/front_end/ui/legacy/KeyboardShortcut.ts +4 -7
  77. package/front_end/ui/legacy/SearchableView.ts +2 -1
  78. package/front_end/ui/legacy/ShortcutRegistry.ts +6 -3
  79. package/front_end/ui/legacy/UIUtils.ts +10 -6
  80. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +23 -24
  81. package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +2 -2
  82. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +6 -6
  83. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +14 -15
  84. package/front_end/ui/legacy/components/perf_ui/GCActionDelegate.ts +1 -1
  85. package/front_end/ui/legacy/components/perf_ui/NetworkPriorities.ts +5 -5
  86. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +5 -5
  87. package/front_end/ui/legacy/components/perf_ui/PieChart.ts +1 -1
  88. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +4 -6
  89. package/front_end/ui/legacy/components/source_frame/FontView.ts +2 -2
  90. package/front_end/ui/legacy/components/source_frame/ImageView.ts +13 -13
  91. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
  92. package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
  93. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
  94. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +15 -18
  95. package/front_end/ui/legacy/components/source_frame/XMLView.ts +1 -1
  96. package/front_end/ui/legacy/components/source_frame/source_frame-meta.ts +10 -10
  97. package/front_end/ui/legacy/theme_support/ThemeSupport.ts +5 -2
  98. package/front_end/ui/settings/ConsoleSettings.ts +32 -0
  99. package/front_end/ui/settings/InspectorMainSettings.ts +7 -0
  100. package/front_end/ui/settings/MainSettings.ts +80 -0
  101. package/front_end/ui/settings/settings.ts +4 -0
  102. package/front_end/ui/visual_logging/KnownContextValues.ts +8 -0
  103. package/package.json +1 -1
@@ -504,9 +504,32 @@ export namespace Ads {
504
504
  removeAdFrames: Page.FrameId[];
505
505
  }
506
506
 
507
+ /**
508
+ * An ad script.
509
+ * Note: when the script is a transitive ad script, we only fill in the
510
+ * immediate ancestor script in the provenance's adScriptAncestry field (as its
511
+ * first entry), rather than filling in the full ancestry. This saves work for
512
+ * the backend, and the frontend can reconstruct the full ancestry if
513
+ * necessary.
514
+ */
515
+ export interface AdScript {
516
+ /**
517
+ * The script ID.
518
+ */
519
+ scriptId: Runtime.ScriptId;
520
+ /**
521
+ * The ad provenance.
522
+ */
523
+ provenance: Network.AdProvenance;
524
+ }
525
+
507
526
  export interface GetAdMetricsResponse extends ProtocolResponseWithError {
508
527
  metrics: AdMetrics;
509
528
  }
529
+
530
+ export interface GetAdScriptsResponse extends ProtocolResponseWithError {
531
+ newScripts: AdScript[];
532
+ }
510
533
  }
511
534
 
512
535
  export namespace Animation {
@@ -11760,6 +11783,9 @@ export namespace Network {
11760
11783
  filterlistRule?: string;
11761
11784
  /**
11762
11785
  * The script ancestry that created the ad, if any.
11786
+ * Note: depending on the context, this may represent the full ancestry up
11787
+ * to the root script, or it may contain only one script representing the
11788
+ * immediate ancestor.
11763
11789
  */
11764
11790
  adScriptAncestry?: AdAncestry;
11765
11791
  }
@@ -16299,9 +16325,21 @@ export namespace Page {
16299
16325
  */
16300
16326
  maxHeight?: integer;
16301
16327
  /**
16302
- * Send every n-th frame.
16328
+ * Send every n-th frame. Must be a positive integer.
16303
16329
  */
16304
16330
  everyNthFrame?: integer;
16331
+ /**
16332
+ * Maximum number of frames sent until screencastFrameAck is required.
16333
+ * Defaults to 3. Must be a positive integer.
16334
+ */
16335
+ maxFramesInFlight?: integer;
16336
+ /**
16337
+ * By default, after screencastFrameAck arrives, the next produced frame is sent.
16338
+ * Passing this flag enables storing the last produced frame in memory, which is
16339
+ * immediately sent upon screencastFrameAck. This way, overall performance is
16340
+ * traded for a better latency.
16341
+ */
16342
+ sendLastFrame?: boolean;
16305
16343
  }
16306
16344
 
16307
16345
  export interface StartScreenRecordingRequest {
@@ -17700,6 +17738,62 @@ export namespace ServiceWorker {
17700
17738
  Redundant = 'redundant',
17701
17739
  }
17702
17740
 
17741
+ /**
17742
+ * Mostly corresponds to `RouterCondition` in ServiceWorker spec
17743
+ * (https://www.w3.org/TR/service-workers/#dictdef-routercondition) while this
17744
+ * currently lacks support for the nested conditions ("or" and "not").
17745
+ * TODO(crbug.com/540469610): Support recursive conditions.
17746
+ */
17747
+ export interface ServiceWorkerRouterCondition {
17748
+ /**
17749
+ * Plain text, or JSON serialization of URLPatternInit or URLPattern
17750
+ */
17751
+ urlPattern?: string;
17752
+ requestMethod?: string;
17753
+ requestMode?: string;
17754
+ requestDestination?: string;
17755
+ runningStatus?: ServiceWorkerVersionRunningStatus;
17756
+ }
17757
+
17758
+ export const enum ServiceWorkerRouterSourceType {
17759
+ Cache = 'cache',
17760
+ FetchEvent = 'fetchEvent',
17761
+ Network = 'network',
17762
+ RaceNetworkAndFetchHandler = 'raceNetworkAndFetchHandler',
17763
+ RaceNetworkAndCache = 'raceNetworkAndCache',
17764
+ SourceDict = 'sourceDict',
17765
+ }
17766
+
17767
+ /**
17768
+ * https://www.w3.org/TR/service-workers/#dictdef-routersourcedict
17769
+ */
17770
+ export interface ServiceWorkerRouterSourceDict {
17771
+ cacheName: string;
17772
+ }
17773
+
17774
+ /**
17775
+ * Corresponds to `RouterSource` in the spec while the representation is different as follows.
17776
+ * (https://www.w3.org/TR/service-workers/#typedefdef-routersource)
17777
+ * - `RouterSourceEnum`: `type` equals `cache`, `sourceDict` is null.
17778
+ * - `RouterSourceDict`: `type` equals `sourceDict`, `sourceDict` has valid value.
17779
+ */
17780
+ export interface ServiceWorkerRouterSource {
17781
+ type: ServiceWorkerRouterSourceType;
17782
+ /**
17783
+ * Non-empty iff `type` equals "sourceDict".
17784
+ */
17785
+ sourceDict?: ServiceWorkerRouterSourceDict;
17786
+ }
17787
+
17788
+ export interface ServiceWorkerRouterRule {
17789
+ condition: ServiceWorkerRouterCondition;
17790
+ source: ServiceWorkerRouterSource;
17791
+ /**
17792
+ * Rule ID assigned by the browser. Unique within each ServiceWorkerVersion.
17793
+ */
17794
+ id: integer;
17795
+ }
17796
+
17703
17797
  /**
17704
17798
  * ServiceWorker version.
17705
17799
  */
@@ -17720,7 +17814,13 @@ export namespace ServiceWorker {
17720
17814
  scriptResponseTime?: number;
17721
17815
  controlledClients?: Target.TargetID[];
17722
17816
  targetId?: Target.TargetID;
17817
+ /**
17818
+ * Migration to `typedRouterRules` is in progress. The browser sends either
17819
+ * `routerRules` or `typedRouterRules`.
17820
+ * TODO(crbug.com/540469610): Remove `routerRules` after the migration.
17821
+ */
17723
17822
  routerRules?: string;
17823
+ typedRouterRules?: ServiceWorkerRouterRule[];
17724
17824
  }
17725
17825
 
17726
17826
  /**
@@ -18167,7 +18267,6 @@ export namespace Storage {
18167
18267
  Websql = 'websql',
18168
18268
  Service_workers = 'service_workers',
18169
18269
  Cache_storage = 'cache_storage',
18170
- Shared_storage = 'shared_storage',
18171
18270
  Storage_buckets = 'storage_buckets',
18172
18271
  All = 'all',
18173
18272
  Other = 'other',
@@ -18196,217 +18295,6 @@ export namespace Storage {
18196
18295
  count: number;
18197
18296
  }
18198
18297
 
18199
- /**
18200
- * Enum of shared storage access scopes.
18201
- */
18202
- export const enum SharedStorageAccessScope {
18203
- Window = 'window',
18204
- SharedStorageWorklet = 'sharedStorageWorklet',
18205
- Header = 'header',
18206
- }
18207
-
18208
- /**
18209
- * Enum of shared storage access methods.
18210
- */
18211
- export const enum SharedStorageAccessMethod {
18212
- AddModule = 'addModule',
18213
- CreateWorklet = 'createWorklet',
18214
- SelectURL = 'selectURL',
18215
- Run = 'run',
18216
- BatchUpdate = 'batchUpdate',
18217
- Set = 'set',
18218
- Append = 'append',
18219
- Delete = 'delete',
18220
- Clear = 'clear',
18221
- Get = 'get',
18222
- Keys = 'keys',
18223
- Values = 'values',
18224
- Entries = 'entries',
18225
- Length = 'length',
18226
- RemainingBudget = 'remainingBudget',
18227
- }
18228
-
18229
- /**
18230
- * Struct for a single key-value pair in an origin's shared storage.
18231
- */
18232
- export interface SharedStorageEntry {
18233
- key: string;
18234
- value: string;
18235
- }
18236
-
18237
- /**
18238
- * Details for an origin's shared storage.
18239
- */
18240
- export interface SharedStorageMetadata {
18241
- /**
18242
- * Time when the origin's shared storage was last created.
18243
- */
18244
- creationTime: Network.TimeSinceEpoch;
18245
- /**
18246
- * Number of key-value pairs stored in origin's shared storage.
18247
- */
18248
- length: integer;
18249
- /**
18250
- * Current amount of bits of entropy remaining in the navigation budget.
18251
- */
18252
- remainingBudget: number;
18253
- /**
18254
- * Total number of bytes stored as key-value pairs in origin's shared
18255
- * storage.
18256
- */
18257
- bytesUsed: integer;
18258
- }
18259
-
18260
- /**
18261
- * Represents a dictionary object passed in as privateAggregationConfig to
18262
- * run or selectURL.
18263
- */
18264
- export interface SharedStoragePrivateAggregationConfig {
18265
- /**
18266
- * The chosen aggregation service deployment.
18267
- */
18268
- aggregationCoordinatorOrigin?: string;
18269
- /**
18270
- * The context ID provided.
18271
- */
18272
- contextId?: string;
18273
- /**
18274
- * Configures the maximum size allowed for filtering IDs.
18275
- */
18276
- filteringIdMaxBytes: integer;
18277
- /**
18278
- * The limit on the number of contributions in the final report.
18279
- */
18280
- maxContributions?: integer;
18281
- }
18282
-
18283
- /**
18284
- * Pair of reporting metadata details for a candidate URL for `selectURL()`.
18285
- */
18286
- export interface SharedStorageReportingMetadata {
18287
- eventType: string;
18288
- reportingUrl: string;
18289
- }
18290
-
18291
- /**
18292
- * Bundles a candidate URL with its reporting metadata.
18293
- */
18294
- export interface SharedStorageUrlWithMetadata {
18295
- /**
18296
- * Spec of candidate URL.
18297
- */
18298
- url: string;
18299
- /**
18300
- * Any associated reporting metadata.
18301
- */
18302
- reportingMetadata: SharedStorageReportingMetadata[];
18303
- }
18304
-
18305
- /**
18306
- * Bundles the parameters for shared storage access events whose
18307
- * presence/absence can vary according to SharedStorageAccessType.
18308
- */
18309
- export interface SharedStorageAccessParams {
18310
- /**
18311
- * Spec of the module script URL.
18312
- * Present only for SharedStorageAccessMethods: addModule and
18313
- * createWorklet.
18314
- */
18315
- scriptSourceUrl?: string;
18316
- /**
18317
- * String denoting "context-origin", "script-origin", or a custom
18318
- * origin to be used as the worklet's data origin.
18319
- * Present only for SharedStorageAccessMethod: createWorklet.
18320
- */
18321
- dataOrigin?: string;
18322
- /**
18323
- * Name of the registered operation to be run.
18324
- * Present only for SharedStorageAccessMethods: run and selectURL.
18325
- */
18326
- operationName?: string;
18327
- /**
18328
- * ID of the operation call.
18329
- * Present only for SharedStorageAccessMethods: run and selectURL.
18330
- */
18331
- operationId?: string;
18332
- /**
18333
- * Whether or not to keep the worket alive for future run or selectURL
18334
- * calls.
18335
- * Present only for SharedStorageAccessMethods: run and selectURL.
18336
- */
18337
- keepAlive?: boolean;
18338
- /**
18339
- * Configures the private aggregation options.
18340
- * Present only for SharedStorageAccessMethods: run and selectURL.
18341
- */
18342
- privateAggregationConfig?: SharedStoragePrivateAggregationConfig;
18343
- /**
18344
- * The operation's serialized data in bytes (converted to a string).
18345
- * Present only for SharedStorageAccessMethods: run and selectURL.
18346
- * TODO(crbug.com/401011862): Consider updating this parameter to binary.
18347
- */
18348
- serializedData?: string;
18349
- /**
18350
- * Array of candidate URLs' specs, along with any associated metadata.
18351
- * Present only for SharedStorageAccessMethod: selectURL.
18352
- */
18353
- urlsWithMetadata?: SharedStorageUrlWithMetadata[];
18354
- /**
18355
- * Spec of the URN:UUID generated for a selectURL call.
18356
- * Present only for SharedStorageAccessMethod: selectURL.
18357
- */
18358
- urnUuid?: string;
18359
- /**
18360
- * Key for a specific entry in an origin's shared storage.
18361
- * Present only for SharedStorageAccessMethods: set, append, delete, and
18362
- * get.
18363
- */
18364
- key?: string;
18365
- /**
18366
- * Value for a specific entry in an origin's shared storage.
18367
- * Present only for SharedStorageAccessMethods: set and append.
18368
- */
18369
- value?: string;
18370
- /**
18371
- * Whether or not to set an entry for a key if that key is already present.
18372
- * Present only for SharedStorageAccessMethod: set.
18373
- */
18374
- ignoreIfPresent?: boolean;
18375
- /**
18376
- * A number denoting the (0-based) order of the worklet's
18377
- * creation relative to all other shared storage worklets created by
18378
- * documents using the current storage partition.
18379
- * Present only for SharedStorageAccessMethods: addModule, createWorklet.
18380
- */
18381
- workletOrdinal?: integer;
18382
- /**
18383
- * Hex representation of the DevTools token used as the TargetID for the
18384
- * associated shared storage worklet.
18385
- * Present only for SharedStorageAccessMethods: addModule, createWorklet,
18386
- * run, selectURL, and any other SharedStorageAccessMethod when the
18387
- * SharedStorageAccessScope is sharedStorageWorklet.
18388
- */
18389
- workletTargetId?: Target.TargetID;
18390
- /**
18391
- * Name of the lock to be acquired, if present.
18392
- * Optionally present only for SharedStorageAccessMethods: batchUpdate,
18393
- * set, append, delete, and clear.
18394
- */
18395
- withLock?: string;
18396
- /**
18397
- * If the method has been called as part of a batchUpdate, then this
18398
- * number identifies the batch to which it belongs.
18399
- * Optionally present only for SharedStorageAccessMethods:
18400
- * batchUpdate (required), set, append, delete, and clear.
18401
- */
18402
- batchUpdateId?: string;
18403
- /**
18404
- * Number of modifier methods sent in batch.
18405
- * Present only for SharedStorageAccessMethod: batchUpdate.
18406
- */
18407
- batchSize?: integer;
18408
- }
18409
-
18410
18298
  export const enum StorageBucketsDurability {
18411
18299
  Relaxed = 'relaxed',
18412
18300
  Strict = 'strict',
@@ -18634,50 +18522,6 @@ export namespace Storage {
18634
18522
  didDeleteTokens: boolean;
18635
18523
  }
18636
18524
 
18637
- export interface GetSharedStorageMetadataRequest {
18638
- ownerOrigin: string;
18639
- }
18640
-
18641
- export interface GetSharedStorageMetadataResponse extends ProtocolResponseWithError {
18642
- metadata: SharedStorageMetadata;
18643
- }
18644
-
18645
- export interface GetSharedStorageEntriesRequest {
18646
- ownerOrigin: string;
18647
- }
18648
-
18649
- export interface GetSharedStorageEntriesResponse extends ProtocolResponseWithError {
18650
- entries: SharedStorageEntry[];
18651
- }
18652
-
18653
- export interface SetSharedStorageEntryRequest {
18654
- ownerOrigin: string;
18655
- key: string;
18656
- value: string;
18657
- /**
18658
- * If `ignoreIfPresent` is included and true, then only sets the entry if
18659
- * `key` doesn't already exist.
18660
- */
18661
- ignoreIfPresent?: boolean;
18662
- }
18663
-
18664
- export interface DeleteSharedStorageEntryRequest {
18665
- ownerOrigin: string;
18666
- key: string;
18667
- }
18668
-
18669
- export interface ClearSharedStorageEntriesRequest {
18670
- ownerOrigin: string;
18671
- }
18672
-
18673
- export interface ResetSharedStorageBudgetRequest {
18674
- ownerOrigin: string;
18675
- }
18676
-
18677
- export interface SetSharedStorageTrackingRequest {
18678
- enable: boolean;
18679
- }
18680
-
18681
18525
  export interface SetStorageBucketTrackingRequest {
18682
18526
  storageKey: string;
18683
18527
  enable: boolean;
@@ -18779,79 +18623,6 @@ export namespace Storage {
18779
18623
  bucketId: string;
18780
18624
  }
18781
18625
 
18782
- /**
18783
- * Shared storage was accessed by the associated page.
18784
- * The following parameters are included in all events.
18785
- */
18786
- export interface SharedStorageAccessedEvent {
18787
- /**
18788
- * Time of the access.
18789
- */
18790
- accessTime: Network.TimeSinceEpoch;
18791
- /**
18792
- * Enum value indicating the access scope.
18793
- */
18794
- scope: SharedStorageAccessScope;
18795
- /**
18796
- * Enum value indicating the Shared Storage API method invoked.
18797
- */
18798
- method: SharedStorageAccessMethod;
18799
- /**
18800
- * DevTools Frame Token for the primary frame tree's root.
18801
- */
18802
- mainFrameId: Page.FrameId;
18803
- /**
18804
- * Serialization of the origin owning the Shared Storage data.
18805
- */
18806
- ownerOrigin: string;
18807
- /**
18808
- * Serialization of the site owning the Shared Storage data.
18809
- */
18810
- ownerSite: string;
18811
- /**
18812
- * The sub-parameters wrapped by `params` are all optional and their
18813
- * presence/absence depends on `type`.
18814
- */
18815
- params: SharedStorageAccessParams;
18816
- }
18817
-
18818
- /**
18819
- * A shared storage run or selectURL operation finished its execution.
18820
- * The following parameters are included in all events.
18821
- */
18822
- export interface SharedStorageWorkletOperationExecutionFinishedEvent {
18823
- /**
18824
- * Time that the operation finished.
18825
- */
18826
- finishedTime: Network.TimeSinceEpoch;
18827
- /**
18828
- * Time, in microseconds, from start of shared storage JS API call until
18829
- * end of operation execution in the worklet.
18830
- */
18831
- executionTime: integer;
18832
- /**
18833
- * Enum value indicating the Shared Storage API method invoked.
18834
- */
18835
- method: SharedStorageAccessMethod;
18836
- /**
18837
- * ID of the operation call.
18838
- */
18839
- operationId: string;
18840
- /**
18841
- * Hex representation of the DevTools token used as the TargetID for the
18842
- * associated shared storage worklet.
18843
- */
18844
- workletTargetId: Target.TargetID;
18845
- /**
18846
- * DevTools Frame Token for the primary frame tree's root.
18847
- */
18848
- mainFrameId: Page.FrameId;
18849
- /**
18850
- * Serialization of the origin owning the Shared Storage data.
18851
- */
18852
- ownerOrigin: string;
18853
- }
18854
-
18855
18626
  export interface StorageBucketCreatedOrUpdatedEvent {
18856
18627
  bucketInfo: StorageBucketInfo;
18857
18628
  }
@@ -20426,6 +20197,10 @@ export namespace WebMCP {
20426
20197
  * A hint indicating that the tool output may contain untrusted content, ex: UGC, 3rd party data.
20427
20198
  */
20428
20199
  untrustedContent?: boolean;
20200
+ /**
20201
+ * A hint indicating that executing the tool will result in consequential actions, ex: booking a flight, transferring money.
20202
+ */
20203
+ consequential?: boolean;
20429
20204
  /**
20430
20205
  * If the declarative tool was declared with the autosubmit attribute.
20431
20206
  */
@@ -18,6 +18,7 @@ import {
18
18
  } from './agents/AiAgent.js';
19
19
  import {type ExecuteJsAgentOptions, executeJsCode} from './agents/ExecuteJavascript.js';
20
20
  import {ChangeManager} from './ChangeManager.js';
21
+ import {AccessibilityContext} from './contexts/AccessibilityContext.js';
21
22
  import {DOMNodeContext} from './contexts/DOMNodeContext.js';
22
23
  import {debugLog} from './debug.js';
23
24
  import {ExtensionScope} from './ExtensionScope.js';
@@ -85,9 +86,12 @@ export class AiAgent2 extends AiAgent<unknown> {
85
86
  }
86
87
 
87
88
  protected override async preRun(): Promise<void> {
89
+ // One-way latch: once sensitive data enters the conversation history,
90
+ // logging must remain disabled for the lifetime of this agent instance.
88
91
  if (this.context && !this.context.isLoggingEnabled()) {
89
- this.setServerSideLoggingActive(false);
92
+ this.disableServerSideLogging();
90
93
  }
94
+
91
95
  const target = this.targetManager.primaryPageTarget();
92
96
  const domModel = target?.model(SDK.DOMModel.DOMModel);
93
97
  // Ensure the DOM document is requested and cached in DOMModel so that
@@ -183,6 +187,9 @@ QUERY: ${query}`;
183
187
  return enhancedQuery;
184
188
  }
185
189
 
190
+ // Note: Test assertion helpers in front_end/testing/AiAssistanceHelpers.ts (assertSkillLoaded,
191
+ // assertSkillNotLoaded) rely on this formatting (`Available skills that are not yet loaded:`
192
+ // and `- ${name}: ${skill.description}`). If this format is updated, update those helpers too.
186
193
  const skillsManifest = unloadedSkills.map(([name, skill]) => `- ${name}: ${skill.description}`).join('\n');
187
194
  return `Available skills that are not yet loaded:
188
195
  ${skillsManifest}
@@ -274,10 +281,11 @@ User query: ${enhancedQuery}`;
274
281
  (this.context instanceof DOMNodeContext ? this.context.getItem() : this.#getDocumentBodyNode()),
275
282
  getTarget: () => this.targetManager.primaryPageTarget(),
276
283
  getEstablishedOrigin: () => this.#getConversationOrigin(),
277
- lighthouseRecording: this.#lighthouseRecording,
284
+ getLighthouseReport: () => (this.context instanceof AccessibilityContext ? this.context.getItem() : null),
285
+ runLighthouse: async overrides => await (this.#lighthouseRecording?.(overrides) ?? null),
278
286
  performanceRecordAndReload: this.#performanceRecordAndReload,
279
- setLoggingEnabled: (enabled: boolean) => {
280
- this.setServerSideLoggingActive(enabled);
287
+ disableLogging: () => {
288
+ this.disableServerSideLogging();
281
289
  },
282
290
  };
283
291
  return tool.handler(args, context, options);
@@ -189,7 +189,7 @@ export class AiConversation {
189
189
  setContext(updateContext: ConversationContext<unknown>|null): void {
190
190
  if (!updateContext) {
191
191
  this.#contexts = [];
192
- if (isAiAssistanceContextSelectionAgentEnabled()) {
192
+ if (isAiAssistanceContextSelectionEnabled()) {
193
193
  this.#updateAgent(ConversationType.NONE);
194
194
  }
195
195
 
@@ -198,7 +198,7 @@ export class AiConversation {
198
198
 
199
199
  this.#contexts = [updateContext];
200
200
 
201
- if (isAiAssistanceContextSelectionAgentEnabled()) {
201
+ if (isAiAssistanceContextSelectionEnabled()) {
202
202
  if (updateContext instanceof FileContext) {
203
203
  this.#updateAgent(ConversationType.FILE);
204
204
  } else if (updateContext instanceof DOMNodeContext) {
@@ -365,11 +365,23 @@ export class AiConversation {
365
365
  return;
366
366
  }
367
367
 
368
- const isTransitioningFromStorage = this.#type === ConversationType.STORAGE && type !== ConversationType.STORAGE;
369
- const history = isTransitioningFromStorage ? [] : this.#filterHistoryForNewAgent();
370
-
368
+ const previousType = this.#type;
371
369
  this.#type = type;
372
370
 
371
+ // In AI Architecture V2, DevTools uses a single unified agent (AiAgent2) that
372
+ // dynamically loads skills on demand. Reusing the existing agent instance across
373
+ // context changes preserves its loaded activeSkills and declared tools so the model
374
+ // does not need to re-learn skills it already acquired earlier in the conversation.
375
+ if (Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled && this.#agent instanceof AiAgent2) {
376
+ return;
377
+ }
378
+
379
+ // In legacy V1 architecture, agents are recreated when switching conversation types.
380
+ // Discard conversation history when transitioning away from Storage to prevent
381
+ // sensitive data (e.g. cookies or storage items) from leaking into subsequent agent queries.
382
+ const isTransitioningFromStorage = previousType === ConversationType.STORAGE && type !== ConversationType.STORAGE;
383
+ const history = isTransitioningFromStorage ? [] : this.#filterHistoryForNewAgent();
384
+
373
385
  const options = {
374
386
  aidaClient: this.#aidaClient,
375
387
  serverSideLoggingAllowed: isAiAssistanceServerSideLoggingAllowed(),
@@ -561,8 +573,14 @@ function isAiAssistanceServerSideLoggingAllowed(): boolean {
561
573
  return !Root.Runtime.hostConfig.aidaAvailability?.disallowLogging;
562
574
  }
563
575
 
564
- function isAiAssistanceContextSelectionAgentEnabled(): boolean {
565
- return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled);
576
+ /**
577
+ * Returns true if context changes should dynamically update the conversation's
578
+ * agent/type state. Enabled for both the legacy V1 selection agent and the
579
+ * unified V2 architecture.
580
+ */
581
+ function isAiAssistanceContextSelectionEnabled(): boolean {
582
+ return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled) ||
583
+ Boolean(Root.Runtime.hostConfig.devToolsAiV2Architecture?.enabled);
566
584
  }
567
585
 
568
586
  function getPrimaryPageOrigin(
@@ -505,14 +505,9 @@ export abstract class AiAgent<T> {
505
505
 
506
506
  readonly #sessionId: string;
507
507
  readonly #aidaClient: Host.AidaClient.AidaClient;
508
- /**
509
- * Whether server-side logging is permitted by the system policy (based on
510
- * user preferences, feature flags, or branding configurations).
511
- */
512
- readonly #serverSideLoggingAllowed: boolean;
513
508
  /**
514
509
  * Tracks the dynamic runtime state of logging. Even if logging is allowed
515
- * by policy, tools can temporarily deactivate this to avoid logging sensitive data.
510
+ * by policy, tools or sensitive contexts can deactivate this to avoid logging sensitive data.
516
511
  */
517
512
  #serverSideLoggingActive: boolean;
518
513
  readonly confirmSideEffect: typeof Promise.withResolvers;
@@ -548,7 +543,6 @@ export abstract class AiAgent<T> {
548
543
  if (Root.Runtime.hostConfig.devToolsGeminiRebranding?.enabled) {
549
544
  serverSideLoggingAllowed = false;
550
545
  }
551
- this.#serverSideLoggingAllowed = serverSideLoggingAllowed;
552
546
  this.#serverSideLoggingActive = serverSideLoggingAllowed;
553
547
  this.#sessionId = opts.sessionId ?? crypto.randomUUID();
554
548
  this.confirmSideEffect = opts.confirmSideEffectForTest ?? (() => Promise.withResolvers());
@@ -603,16 +597,14 @@ export abstract class AiAgent<T> {
603
597
  }
604
598
 
605
599
  /**
606
- * Toggles whether server-side logging is active.
607
- * Note that logging can only be activated if it was allowed by policy/configuration
608
- * at startup (i.e., `#serverSideLoggingAllowed` is true).
600
+ * Disables server-side logging for the remainder of this agent instance's lifetime.
601
+ *
602
+ * Logging deactivation is irreversible for the session. Conversation history
603
+ * accumulates across turns; re-enabling logging later would leak sensitive
604
+ * data from prior turns to AIDA.
609
605
  */
610
- protected setServerSideLoggingActive(active: boolean): void {
611
- if (active && this.#serverSideLoggingAllowed) {
612
- this.#serverSideLoggingActive = true;
613
- } else {
614
- this.#serverSideLoggingActive = false;
615
- }
606
+ protected disableServerSideLogging(): void {
607
+ this.#serverSideLoggingActive = false;
616
608
  }
617
609
 
618
610
  popPendingMultimodalInput(): MultimodalInput|undefined {
@@ -794,9 +786,9 @@ export abstract class AiAgent<T> {
794
786
  multimodalInput?: MultimodalInput,
795
787
  ): AsyncGenerator<ResponseData, void, void> {
796
788
  await options.selected?.refresh();
797
- if (options.selected) {
798
- this.context = options.selected;
799
- }
789
+ // Reset context on each run so cleared selections (`null`) do not leave
790
+ // stale context references on long-lived agent instances (e.g. `AiAgent2`).
791
+ this.context = options.selected ?? undefined;
800
792
  await this.preRun();
801
793
 
802
794
  const enhancedQuery = await this.enhanceQuery(initialQuery, options.selected, multimodalInput?.type);