chrome-devtools-frontend 1.0.1683520 → 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 (94) 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/main/MainImpl.ts +2 -1
  5. package/front_end/entrypoints/main/main-meta.ts +5 -31
  6. package/front_end/foundation/Universe.ts +7 -0
  7. package/front_end/generated/InspectorBackendCommands.ts +11 -21
  8. package/front_end/generated/protocol-mapping.d.ts +9 -59
  9. package/front_end/generated/protocol-proxy-api.d.ts +7 -47
  10. package/front_end/generated/protocol.ts +92 -329
  11. package/front_end/models/ai_assistance/AiAgent2.ts +12 -4
  12. package/front_end/models/ai_assistance/AiConversation.ts +25 -7
  13. package/front_end/models/ai_assistance/agents/AiAgent.ts +11 -19
  14. package/front_end/models/ai_assistance/agents/StorageAgent.ts +6 -6
  15. package/front_end/models/ai_assistance/ai_assistance.ts +4 -0
  16. package/front_end/models/ai_assistance/tools/GetLighthouseAudits.ts +12 -6
  17. package/front_end/models/ai_assistance/tools/GetStorageValues.ts +1 -1
  18. package/front_end/models/ai_assistance/tools/ListStorageKeys.ts +1 -1
  19. package/front_end/models/ai_assistance/tools/RunLighthouse.ts +5 -8
  20. package/front_end/models/ai_assistance/tools/Tool.ts +19 -6
  21. package/front_end/models/issues_manager/DOMIssuesManager.ts +144 -0
  22. package/front_end/models/issues_manager/ElementAccessibilityIssue.ts +13 -1
  23. package/front_end/models/issues_manager/GenericIssue.ts +14 -2
  24. package/front_end/models/issues_manager/IssuesManager.ts +0 -1
  25. package/front_end/models/issues_manager/issues_manager.ts +2 -0
  26. package/front_end/models/javascript_metadata/NativeFunctions.js +4 -0
  27. package/front_end/panels/ai_assistance/ExternalHandler.ts +89 -0
  28. package/front_end/panels/ai_assistance/ai_assistance.ts +1 -0
  29. package/front_end/panels/application/BackgroundServiceModel.ts +4 -3
  30. package/front_end/panels/application/IndexedDBModel.ts +0 -7
  31. package/front_end/panels/console/ConsoleView.ts +17 -16
  32. package/front_end/panels/console/ConsoleViewMessage.ts +4 -1
  33. package/front_end/panels/console/console-meta.ts +4 -19
  34. package/front_end/panels/elements/ElementIssueUtils.ts +10 -2
  35. package/front_end/panels/elements/ElementsPanel.ts +4 -1
  36. package/front_end/panels/elements/ElementsTreeElement.ts +82 -161
  37. package/front_end/panels/elements/ElementsTreeOutline.ts +26 -105
  38. package/front_end/panels/elements/StandaloneStylesContainer.ts +5 -11
  39. package/front_end/panels/elements/StylePropertyTreeElement.ts +2 -0
  40. package/front_end/panels/elements/StylesContainer.ts +1 -0
  41. package/front_end/panels/elements/StylesSidebarPane.ts +174 -151
  42. package/front_end/panels/security/SecurityPanelSidebar.ts +0 -32
  43. package/front_end/panels/settings/KeybindsSettingsTab.ts +5 -2
  44. package/front_end/panels/timeline/components/BreadcrumbsUI.ts +2 -6
  45. package/front_end/panels/timeline/components/CWVMetrics.ts +9 -10
  46. package/front_end/panels/timeline/components/DetailsView.ts +12 -16
  47. package/front_end/panels/timeline/components/ExportTraceOptions.ts +13 -13
  48. package/front_end/panels/timeline/components/FieldSettingsDialog.ts +19 -19
  49. package/front_end/panels/timeline/components/IgnoreListSetting.ts +7 -9
  50. package/front_end/panels/timeline/components/InteractionBreakdown.ts +3 -3
  51. package/front_end/panels/timeline/components/LayoutShiftDetails.ts +13 -13
  52. package/front_end/panels/timeline/components/LiveMetricsView.ts +64 -64
  53. package/front_end/panels/timeline/components/MetricCard.ts +25 -25
  54. package/front_end/panels/timeline/components/NetworkRequestDetails.ts +22 -22
  55. package/front_end/panels/timeline/components/NetworkRequestTooltip.ts +9 -9
  56. package/front_end/panels/timeline/components/OriginMap.ts +7 -7
  57. package/front_end/panels/timeline/components/RelatedInsightChips.ts +2 -2
  58. package/front_end/panels/timeline/components/SidebarAnnotationsTab.ts +19 -20
  59. package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +1 -1
  60. package/front_end/panels/timeline/components/TimelineSummary.ts +2 -2
  61. package/front_end/panels/timeline/components/Utils.ts +2 -6
  62. package/front_end/panels/timeline/components/insights/BaseInsightComponent.ts +6 -9
  63. package/front_end/panels/timeline/components/insights/Checklist.ts +2 -2
  64. package/front_end/panels/timeline/components/insights/Table.ts +1 -1
  65. package/front_end/third_party/chromium/README.chromium +1 -1
  66. package/front_end/ui/comments/CommentAnchorResolver.ts +94 -0
  67. package/front_end/ui/comments/CommentOverlayManager.ts +16 -32
  68. package/front_end/ui/legacy/DockController.ts +4 -1
  69. package/front_end/ui/legacy/InspectorView.ts +3 -1
  70. package/front_end/ui/legacy/KeyboardShortcut.ts +4 -7
  71. package/front_end/ui/legacy/SearchableView.ts +2 -1
  72. package/front_end/ui/legacy/ShortcutRegistry.ts +6 -3
  73. package/front_end/ui/legacy/UIUtils.ts +10 -6
  74. package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +23 -24
  75. package/front_end/ui/legacy/components/perf_ui/BrickBreaker.ts +2 -2
  76. package/front_end/ui/legacy/components/perf_ui/FilmStripView.ts +6 -6
  77. package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +14 -15
  78. package/front_end/ui/legacy/components/perf_ui/GCActionDelegate.ts +1 -1
  79. package/front_end/ui/legacy/components/perf_ui/NetworkPriorities.ts +5 -5
  80. package/front_end/ui/legacy/components/perf_ui/OverviewGrid.ts +5 -5
  81. package/front_end/ui/legacy/components/perf_ui/PieChart.ts +1 -1
  82. package/front_end/ui/legacy/components/perf_ui/perf_ui-meta.ts +4 -6
  83. package/front_end/ui/legacy/components/source_frame/FontView.ts +2 -2
  84. package/front_end/ui/legacy/components/source_frame/ImageView.ts +13 -13
  85. package/front_end/ui/legacy/components/source_frame/JSONView.ts +1 -1
  86. package/front_end/ui/legacy/components/source_frame/PreviewFactory.ts +2 -2
  87. package/front_end/ui/legacy/components/source_frame/ResourceSourceFrame.ts +1 -1
  88. package/front_end/ui/legacy/components/source_frame/SourceFrame.ts +15 -18
  89. package/front_end/ui/legacy/components/source_frame/XMLView.ts +1 -1
  90. package/front_end/ui/legacy/components/source_frame/source_frame-meta.ts +10 -10
  91. package/front_end/ui/settings/ConsoleSettings.ts +32 -0
  92. package/front_end/ui/settings/MainSettings.ts +47 -0
  93. package/front_end/ui/settings/settings.ts +2 -0
  94. 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
  }
@@ -17712,6 +17738,62 @@ export namespace ServiceWorker {
17712
17738
  Redundant = 'redundant',
17713
17739
  }
17714
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
+
17715
17797
  /**
17716
17798
  * ServiceWorker version.
17717
17799
  */
@@ -17732,7 +17814,13 @@ export namespace ServiceWorker {
17732
17814
  scriptResponseTime?: number;
17733
17815
  controlledClients?: Target.TargetID[];
17734
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
+ */
17735
17822
  routerRules?: string;
17823
+ typedRouterRules?: ServiceWorkerRouterRule[];
17736
17824
  }
17737
17825
 
17738
17826
  /**
@@ -18179,7 +18267,6 @@ export namespace Storage {
18179
18267
  Websql = 'websql',
18180
18268
  Service_workers = 'service_workers',
18181
18269
  Cache_storage = 'cache_storage',
18182
- Shared_storage = 'shared_storage',
18183
18270
  Storage_buckets = 'storage_buckets',
18184
18271
  All = 'all',
18185
18272
  Other = 'other',
@@ -18208,217 +18295,6 @@ export namespace Storage {
18208
18295
  count: number;
18209
18296
  }
18210
18297
 
18211
- /**
18212
- * Enum of shared storage access scopes.
18213
- */
18214
- export const enum SharedStorageAccessScope {
18215
- Window = 'window',
18216
- SharedStorageWorklet = 'sharedStorageWorklet',
18217
- Header = 'header',
18218
- }
18219
-
18220
- /**
18221
- * Enum of shared storage access methods.
18222
- */
18223
- export const enum SharedStorageAccessMethod {
18224
- AddModule = 'addModule',
18225
- CreateWorklet = 'createWorklet',
18226
- SelectURL = 'selectURL',
18227
- Run = 'run',
18228
- BatchUpdate = 'batchUpdate',
18229
- Set = 'set',
18230
- Append = 'append',
18231
- Delete = 'delete',
18232
- Clear = 'clear',
18233
- Get = 'get',
18234
- Keys = 'keys',
18235
- Values = 'values',
18236
- Entries = 'entries',
18237
- Length = 'length',
18238
- RemainingBudget = 'remainingBudget',
18239
- }
18240
-
18241
- /**
18242
- * Struct for a single key-value pair in an origin's shared storage.
18243
- */
18244
- export interface SharedStorageEntry {
18245
- key: string;
18246
- value: string;
18247
- }
18248
-
18249
- /**
18250
- * Details for an origin's shared storage.
18251
- */
18252
- export interface SharedStorageMetadata {
18253
- /**
18254
- * Time when the origin's shared storage was last created.
18255
- */
18256
- creationTime: Network.TimeSinceEpoch;
18257
- /**
18258
- * Number of key-value pairs stored in origin's shared storage.
18259
- */
18260
- length: integer;
18261
- /**
18262
- * Current amount of bits of entropy remaining in the navigation budget.
18263
- */
18264
- remainingBudget: number;
18265
- /**
18266
- * Total number of bytes stored as key-value pairs in origin's shared
18267
- * storage.
18268
- */
18269
- bytesUsed: integer;
18270
- }
18271
-
18272
- /**
18273
- * Represents a dictionary object passed in as privateAggregationConfig to
18274
- * run or selectURL.
18275
- */
18276
- export interface SharedStoragePrivateAggregationConfig {
18277
- /**
18278
- * The chosen aggregation service deployment.
18279
- */
18280
- aggregationCoordinatorOrigin?: string;
18281
- /**
18282
- * The context ID provided.
18283
- */
18284
- contextId?: string;
18285
- /**
18286
- * Configures the maximum size allowed for filtering IDs.
18287
- */
18288
- filteringIdMaxBytes: integer;
18289
- /**
18290
- * The limit on the number of contributions in the final report.
18291
- */
18292
- maxContributions?: integer;
18293
- }
18294
-
18295
- /**
18296
- * Pair of reporting metadata details for a candidate URL for `selectURL()`.
18297
- */
18298
- export interface SharedStorageReportingMetadata {
18299
- eventType: string;
18300
- reportingUrl: string;
18301
- }
18302
-
18303
- /**
18304
- * Bundles a candidate URL with its reporting metadata.
18305
- */
18306
- export interface SharedStorageUrlWithMetadata {
18307
- /**
18308
- * Spec of candidate URL.
18309
- */
18310
- url: string;
18311
- /**
18312
- * Any associated reporting metadata.
18313
- */
18314
- reportingMetadata: SharedStorageReportingMetadata[];
18315
- }
18316
-
18317
- /**
18318
- * Bundles the parameters for shared storage access events whose
18319
- * presence/absence can vary according to SharedStorageAccessType.
18320
- */
18321
- export interface SharedStorageAccessParams {
18322
- /**
18323
- * Spec of the module script URL.
18324
- * Present only for SharedStorageAccessMethods: addModule and
18325
- * createWorklet.
18326
- */
18327
- scriptSourceUrl?: string;
18328
- /**
18329
- * String denoting "context-origin", "script-origin", or a custom
18330
- * origin to be used as the worklet's data origin.
18331
- * Present only for SharedStorageAccessMethod: createWorklet.
18332
- */
18333
- dataOrigin?: string;
18334
- /**
18335
- * Name of the registered operation to be run.
18336
- * Present only for SharedStorageAccessMethods: run and selectURL.
18337
- */
18338
- operationName?: string;
18339
- /**
18340
- * ID of the operation call.
18341
- * Present only for SharedStorageAccessMethods: run and selectURL.
18342
- */
18343
- operationId?: string;
18344
- /**
18345
- * Whether or not to keep the worket alive for future run or selectURL
18346
- * calls.
18347
- * Present only for SharedStorageAccessMethods: run and selectURL.
18348
- */
18349
- keepAlive?: boolean;
18350
- /**
18351
- * Configures the private aggregation options.
18352
- * Present only for SharedStorageAccessMethods: run and selectURL.
18353
- */
18354
- privateAggregationConfig?: SharedStoragePrivateAggregationConfig;
18355
- /**
18356
- * The operation's serialized data in bytes (converted to a string).
18357
- * Present only for SharedStorageAccessMethods: run and selectURL.
18358
- * TODO(crbug.com/401011862): Consider updating this parameter to binary.
18359
- */
18360
- serializedData?: string;
18361
- /**
18362
- * Array of candidate URLs' specs, along with any associated metadata.
18363
- * Present only for SharedStorageAccessMethod: selectURL.
18364
- */
18365
- urlsWithMetadata?: SharedStorageUrlWithMetadata[];
18366
- /**
18367
- * Spec of the URN:UUID generated for a selectURL call.
18368
- * Present only for SharedStorageAccessMethod: selectURL.
18369
- */
18370
- urnUuid?: string;
18371
- /**
18372
- * Key for a specific entry in an origin's shared storage.
18373
- * Present only for SharedStorageAccessMethods: set, append, delete, and
18374
- * get.
18375
- */
18376
- key?: string;
18377
- /**
18378
- * Value for a specific entry in an origin's shared storage.
18379
- * Present only for SharedStorageAccessMethods: set and append.
18380
- */
18381
- value?: string;
18382
- /**
18383
- * Whether or not to set an entry for a key if that key is already present.
18384
- * Present only for SharedStorageAccessMethod: set.
18385
- */
18386
- ignoreIfPresent?: boolean;
18387
- /**
18388
- * A number denoting the (0-based) order of the worklet's
18389
- * creation relative to all other shared storage worklets created by
18390
- * documents using the current storage partition.
18391
- * Present only for SharedStorageAccessMethods: addModule, createWorklet.
18392
- */
18393
- workletOrdinal?: integer;
18394
- /**
18395
- * Hex representation of the DevTools token used as the TargetID for the
18396
- * associated shared storage worklet.
18397
- * Present only for SharedStorageAccessMethods: addModule, createWorklet,
18398
- * run, selectURL, and any other SharedStorageAccessMethod when the
18399
- * SharedStorageAccessScope is sharedStorageWorklet.
18400
- */
18401
- workletTargetId?: Target.TargetID;
18402
- /**
18403
- * Name of the lock to be acquired, if present.
18404
- * Optionally present only for SharedStorageAccessMethods: batchUpdate,
18405
- * set, append, delete, and clear.
18406
- */
18407
- withLock?: string;
18408
- /**
18409
- * If the method has been called as part of a batchUpdate, then this
18410
- * number identifies the batch to which it belongs.
18411
- * Optionally present only for SharedStorageAccessMethods:
18412
- * batchUpdate (required), set, append, delete, and clear.
18413
- */
18414
- batchUpdateId?: string;
18415
- /**
18416
- * Number of modifier methods sent in batch.
18417
- * Present only for SharedStorageAccessMethod: batchUpdate.
18418
- */
18419
- batchSize?: integer;
18420
- }
18421
-
18422
18298
  export const enum StorageBucketsDurability {
18423
18299
  Relaxed = 'relaxed',
18424
18300
  Strict = 'strict',
@@ -18646,50 +18522,6 @@ export namespace Storage {
18646
18522
  didDeleteTokens: boolean;
18647
18523
  }
18648
18524
 
18649
- export interface GetSharedStorageMetadataRequest {
18650
- ownerOrigin: string;
18651
- }
18652
-
18653
- export interface GetSharedStorageMetadataResponse extends ProtocolResponseWithError {
18654
- metadata: SharedStorageMetadata;
18655
- }
18656
-
18657
- export interface GetSharedStorageEntriesRequest {
18658
- ownerOrigin: string;
18659
- }
18660
-
18661
- export interface GetSharedStorageEntriesResponse extends ProtocolResponseWithError {
18662
- entries: SharedStorageEntry[];
18663
- }
18664
-
18665
- export interface SetSharedStorageEntryRequest {
18666
- ownerOrigin: string;
18667
- key: string;
18668
- value: string;
18669
- /**
18670
- * If `ignoreIfPresent` is included and true, then only sets the entry if
18671
- * `key` doesn't already exist.
18672
- */
18673
- ignoreIfPresent?: boolean;
18674
- }
18675
-
18676
- export interface DeleteSharedStorageEntryRequest {
18677
- ownerOrigin: string;
18678
- key: string;
18679
- }
18680
-
18681
- export interface ClearSharedStorageEntriesRequest {
18682
- ownerOrigin: string;
18683
- }
18684
-
18685
- export interface ResetSharedStorageBudgetRequest {
18686
- ownerOrigin: string;
18687
- }
18688
-
18689
- export interface SetSharedStorageTrackingRequest {
18690
- enable: boolean;
18691
- }
18692
-
18693
18525
  export interface SetStorageBucketTrackingRequest {
18694
18526
  storageKey: string;
18695
18527
  enable: boolean;
@@ -18791,79 +18623,6 @@ export namespace Storage {
18791
18623
  bucketId: string;
18792
18624
  }
18793
18625
 
18794
- /**
18795
- * Shared storage was accessed by the associated page.
18796
- * The following parameters are included in all events.
18797
- */
18798
- export interface SharedStorageAccessedEvent {
18799
- /**
18800
- * Time of the access.
18801
- */
18802
- accessTime: Network.TimeSinceEpoch;
18803
- /**
18804
- * Enum value indicating the access scope.
18805
- */
18806
- scope: SharedStorageAccessScope;
18807
- /**
18808
- * Enum value indicating the Shared Storage API method invoked.
18809
- */
18810
- method: SharedStorageAccessMethod;
18811
- /**
18812
- * DevTools Frame Token for the primary frame tree's root.
18813
- */
18814
- mainFrameId: Page.FrameId;
18815
- /**
18816
- * Serialization of the origin owning the Shared Storage data.
18817
- */
18818
- ownerOrigin: string;
18819
- /**
18820
- * Serialization of the site owning the Shared Storage data.
18821
- */
18822
- ownerSite: string;
18823
- /**
18824
- * The sub-parameters wrapped by `params` are all optional and their
18825
- * presence/absence depends on `type`.
18826
- */
18827
- params: SharedStorageAccessParams;
18828
- }
18829
-
18830
- /**
18831
- * A shared storage run or selectURL operation finished its execution.
18832
- * The following parameters are included in all events.
18833
- */
18834
- export interface SharedStorageWorkletOperationExecutionFinishedEvent {
18835
- /**
18836
- * Time that the operation finished.
18837
- */
18838
- finishedTime: Network.TimeSinceEpoch;
18839
- /**
18840
- * Time, in microseconds, from start of shared storage JS API call until
18841
- * end of operation execution in the worklet.
18842
- */
18843
- executionTime: integer;
18844
- /**
18845
- * Enum value indicating the Shared Storage API method invoked.
18846
- */
18847
- method: SharedStorageAccessMethod;
18848
- /**
18849
- * ID of the operation call.
18850
- */
18851
- operationId: string;
18852
- /**
18853
- * Hex representation of the DevTools token used as the TargetID for the
18854
- * associated shared storage worklet.
18855
- */
18856
- workletTargetId: Target.TargetID;
18857
- /**
18858
- * DevTools Frame Token for the primary frame tree's root.
18859
- */
18860
- mainFrameId: Page.FrameId;
18861
- /**
18862
- * Serialization of the origin owning the Shared Storage data.
18863
- */
18864
- ownerOrigin: string;
18865
- }
18866
-
18867
18626
  export interface StorageBucketCreatedOrUpdatedEvent {
18868
18627
  bucketInfo: StorageBucketInfo;
18869
18628
  }
@@ -20438,6 +20197,10 @@ export namespace WebMCP {
20438
20197
  * A hint indicating that the tool output may contain untrusted content, ex: UGC, 3rd party data.
20439
20198
  */
20440
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;
20441
20204
  /**
20442
20205
  * If the declarative tool was declared with the autosubmit attribute.
20443
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);