chrome-devtools-frontend 1.0.1587572 → 1.0.1588580
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.
- package/front_end/core/sdk/DOMModel.ts +3 -0
- package/front_end/core/sdk/PreloadingModel.ts +15 -6
- package/front_end/core/sdk/ScopeTreeCache.ts +4 -0
- package/front_end/generated/Deprecation.ts +21 -0
- package/front_end/generated/InspectorBackendCommands.ts +5 -3
- package/front_end/generated/SupportedCSSProperties.js +46 -0
- package/front_end/generated/protocol-mapping.d.ts +4 -0
- package/front_end/generated/protocol-proxy-api.d.ts +5 -0
- package/front_end/generated/protocol.ts +49 -0
- package/front_end/models/ai_assistance/AiConversation.ts +5 -1
- package/front_end/models/ai_assistance/agents/AiAgent.ts +16 -4
- package/front_end/models/ai_assistance/agents/ContextSelectionAgent.ts +7 -1
- package/front_end/models/computed_style/ComputedStyleModel.ts +2 -1
- package/front_end/models/javascript_metadata/NativeFunctions.js +4 -16
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +15 -23
- package/front_end/panels/ai_assistance/components/ChatInput.ts +36 -31
- package/front_end/panels/ai_assistance/components/chatInput.css +6 -9
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +3 -5
- package/front_end/panels/application/preloading/PreloadingView.ts +18 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.css +12 -0
- package/front_end/panels/application/preloading/components/RuleSetDetailsView.ts +3 -3
- package/front_end/panels/browser_debugger/CategorizedBreakpointsSidebarPane.ts +11 -3
- package/front_end/panels/common/DOMLinkifier.ts +6 -1
- package/front_end/panels/console/ConsoleViewMessage.ts +3 -3
- package/front_end/panels/elements/ColorSwatchPopoverIcon.ts +1 -1
- package/front_end/panels/elements/ComputedStyleWidget.ts +27 -18
- package/front_end/panels/elements/ElementsPanel.ts +12 -4
- package/front_end/panels/elements/PropertiesWidget.ts +91 -52
- package/front_end/panels/elements/StylePropertyTreeElement.ts +11 -12
- package/front_end/panels/elements/StylesSidebarPane.ts +51 -8
- package/front_end/panels/elements/elementsPanel.css +6 -2
- package/front_end/panels/network/NetworkDataGridNode.ts +4 -0
- package/front_end/panels/network/NetworkItemView.ts +6 -45
- package/front_end/panels/network/RequestHeadersView.ts +237 -318
- package/front_end/panels/sources/CSSPlugin.ts +1 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/ui/legacy/Toolbar.ts +37 -5
- package/front_end/ui/legacy/UIUtils.ts +35 -5
- package/front_end/ui/legacy/components/inline_editor/ColorSwatch.ts +32 -28
- package/front_end/ui/legacy/components/object_ui/ObjectPropertiesSection.ts +31 -6
- package/front_end/ui/visual_logging/KnownContextValues.ts +7 -0
- package/package.json +1 -1
|
@@ -2054,6 +2054,9 @@ class DOMDispatcher implements ProtocolProxyApi.DOMDispatcher {
|
|
|
2054
2054
|
Protocol.DOM.AffectedByStartingStylesFlagUpdatedEvent): void {
|
|
2055
2055
|
this.#domModel.affectedByStartingStylesFlagUpdated(nodeId, affectedByStartingStyles);
|
|
2056
2056
|
}
|
|
2057
|
+
|
|
2058
|
+
adRelatedStateUpdated(_: Protocol.DOM.AdRelatedStateUpdatedEvent): void {
|
|
2059
|
+
}
|
|
2057
2060
|
}
|
|
2058
2061
|
|
|
2059
2062
|
let domModelUndoStackInstance: DOMModelUndoStack|null = null;
|
|
@@ -64,6 +64,20 @@ export class PreloadingModel extends SDKModel<EventTypes> {
|
|
|
64
64
|
void this.agent.invoke_disable();
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
+
reset(): void {
|
|
68
|
+
this.documents.clear();
|
|
69
|
+
this.loaderIds = [];
|
|
70
|
+
this.targetJustAttached = true;
|
|
71
|
+
this.dispatchEventToListeners(Events.MODEL_UPDATED);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
private maybeInferLoaderId(loaderId: Protocol.Network.LoaderId): void {
|
|
75
|
+
if (this.currentLoaderId() === null) {
|
|
76
|
+
this.loaderIds = [loaderId];
|
|
77
|
+
this.targetJustAttached = false;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
67
81
|
private ensureDocumentPreloadingData(loaderId: Protocol.Network.LoaderId): void {
|
|
68
82
|
if (this.documents.get(loaderId) === undefined) {
|
|
69
83
|
this.documents.set(loaderId, new DocumentPreloadingData());
|
|
@@ -241,12 +255,7 @@ export class PreloadingModel extends SDKModel<EventTypes> {
|
|
|
241
255
|
|
|
242
256
|
const loaderId = ruleSet.loaderId;
|
|
243
257
|
|
|
244
|
-
|
|
245
|
-
if (this.currentLoaderId() === null) {
|
|
246
|
-
this.loaderIds = [loaderId];
|
|
247
|
-
this.targetJustAttached = false;
|
|
248
|
-
}
|
|
249
|
-
|
|
258
|
+
this.maybeInferLoaderId(loaderId);
|
|
250
259
|
this.ensureDocumentPreloadingData(loaderId);
|
|
251
260
|
this.documents.get(loaderId)?.ruleSets.upsert(ruleSet);
|
|
252
261
|
this.dispatchEventToListeners(Events.MODEL_UPDATED);
|
|
@@ -25,6 +25,10 @@ const scopeTrees = new WeakMap<Script, Promise<{scopeTree: ScopeTreeNode, text:
|
|
|
25
25
|
* and the text allows conversion from/to line/column numbers.
|
|
26
26
|
*/
|
|
27
27
|
export function scopeTreeForScript(script: Script): Promise<{scopeTree: ScopeTreeNode, text: Text}|null> {
|
|
28
|
+
if (script.isWasm()) {
|
|
29
|
+
return Promise.resolve(null);
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
let promise = scopeTrees.get(script);
|
|
29
33
|
if (promise === undefined) {
|
|
30
34
|
promise = script.requestContentData().then(content => {
|
|
@@ -94,6 +94,18 @@ export const UIStrings = {
|
|
|
94
94
|
* @description Warning displayed to developers that instead of calling the `Intl.v8BreakIterator` constructor, which is not a standard JavaScript API, use ECMA402 standard API Intl.Segmenter shipped in end of 2020 instead.
|
|
95
95
|
*/
|
|
96
96
|
IntlV8BreakIterator: "`Intl.v8BreakIterator` is deprecated. Please use `Intl.Segmenter` instead.",
|
|
97
|
+
/**
|
|
98
|
+
* @description Warning for using deprecated 'inputQuota' attribute.
|
|
99
|
+
*/
|
|
100
|
+
LanguageModel_InputQuota: "LanguageModel.inputQuota is deprecated. Please use LanguageModel.contextWindow instead. This alias is only available in extensions.",
|
|
101
|
+
/**
|
|
102
|
+
* @description Warning for using deprecated 'inputUsage' attribute.
|
|
103
|
+
*/
|
|
104
|
+
LanguageModel_InputUsage: "LanguageModel.inputUsage is deprecated. Please use LanguageModel.contextUsage instead. This alias is only available in extensions.",
|
|
105
|
+
/**
|
|
106
|
+
* @description Warning for using deprecated 'measureInputUsage' method.
|
|
107
|
+
*/
|
|
108
|
+
LanguageModel_MeasureInputUsage: "LanguageModel.measureInputUsage() is deprecated. Please use LanguageModel.measureContextUsage() instead. This alias is only available in extensions.",
|
|
97
109
|
/**
|
|
98
110
|
* @description Warning message for web developers when they call the deprecated LanguageModel.params() method.
|
|
99
111
|
*/
|
|
@@ -313,6 +325,15 @@ export const DEPRECATIONS_METADATA: Partial<Record<string, DeprecationDescriptor
|
|
|
313
325
|
"LanguageModelTopK": {
|
|
314
326
|
"chromeStatusFeature": 5134603979063296
|
|
315
327
|
},
|
|
328
|
+
"LanguageModel_InputQuota": {
|
|
329
|
+
"chromeStatusFeature": 5134603979063296
|
|
330
|
+
},
|
|
331
|
+
"LanguageModel_InputUsage": {
|
|
332
|
+
"chromeStatusFeature": 5134603979063296
|
|
333
|
+
},
|
|
334
|
+
"LanguageModel_MeasureInputUsage": {
|
|
335
|
+
"chromeStatusFeature": 5134603979063296
|
|
336
|
+
},
|
|
316
337
|
"LocalCSSFileExtensionRejected": {
|
|
317
338
|
"milestone": 64
|
|
318
339
|
},
|
|
@@ -363,6 +363,7 @@ inspectorBackend.registerEvent("DOM.inlineStyleInvalidated", ["nodeIds"]);
|
|
|
363
363
|
inspectorBackend.registerEvent("DOM.pseudoElementAdded", ["parentId", "pseudoElement"]);
|
|
364
364
|
inspectorBackend.registerEvent("DOM.topLayerElementsUpdated", []);
|
|
365
365
|
inspectorBackend.registerEvent("DOM.scrollableFlagUpdated", ["nodeId", "isScrollable"]);
|
|
366
|
+
inspectorBackend.registerEvent("DOM.adRelatedStateUpdated", ["nodeId", "isAdRelated"]);
|
|
366
367
|
inspectorBackend.registerEvent("DOM.affectedByStartingStylesFlagUpdated", ["nodeId", "affectedByStartingStyles"]);
|
|
367
368
|
inspectorBackend.registerEvent("DOM.pseudoElementRemoved", ["parentId", "pseudoElementId"]);
|
|
368
369
|
inspectorBackend.registerEvent("DOM.setChildNodes", ["parentId", "nodes"]);
|
|
@@ -424,7 +425,7 @@ inspectorBackend.registerCommand("DOM.getQueryingDescendantsForContainer", [{"na
|
|
|
424
425
|
inspectorBackend.registerCommand("DOM.getAnchorElement", [{"name": "nodeId", "type": "number", "optional": false, "description": "Id of the positioned element from which to find the anchor.", "typeRef": "DOM.NodeId"}, {"name": "anchorSpecifier", "type": "string", "optional": true, "description": "An optional anchor specifier, as defined in https://www.w3.org/TR/css-anchor-position-1/#anchor-specifier. If not provided, it will return the implicit anchor element for the given positioned element.", "typeRef": null}], ["nodeId"], "Returns the target anchor element of the given anchor query according to https://www.w3.org/TR/css-anchor-position-1/#target.");
|
|
425
426
|
inspectorBackend.registerCommand("DOM.forceShowPopover", [{"name": "nodeId", "type": "number", "optional": false, "description": "Id of the popover HTMLElement", "typeRef": "DOM.NodeId"}, {"name": "enable", "type": "boolean", "optional": false, "description": "If true, opens the popover and keeps it open. If false, closes the popover if it was previously force-opened.", "typeRef": null}], ["nodeIds"], "When enabling, this API force-opens the popover identified by nodeId and keeps it open until disabled.");
|
|
426
427
|
inspectorBackend.registerType("DOM.BackendNode", [{"name": "nodeType", "type": "number", "optional": false, "description": "`Node`'s nodeType.", "typeRef": null}, {"name": "nodeName", "type": "string", "optional": false, "description": "`Node`'s nodeName.", "typeRef": null}, {"name": "backendNodeId", "type": "number", "optional": false, "description": "", "typeRef": "DOM.BackendNodeId"}]);
|
|
427
|
-
inspectorBackend.registerType("DOM.Node", [{"name": "nodeId", "type": "number", "optional": false, "description": "Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client.", "typeRef": "DOM.NodeId"}, {"name": "parentId", "type": "number", "optional": true, "description": "The id of the parent node if any.", "typeRef": "DOM.NodeId"}, {"name": "backendNodeId", "type": "number", "optional": false, "description": "The BackendNodeId for this node.", "typeRef": "DOM.BackendNodeId"}, {"name": "nodeType", "type": "number", "optional": false, "description": "`Node`'s nodeType.", "typeRef": null}, {"name": "nodeName", "type": "string", "optional": false, "description": "`Node`'s nodeName.", "typeRef": null}, {"name": "localName", "type": "string", "optional": false, "description": "`Node`'s localName.", "typeRef": null}, {"name": "nodeValue", "type": "string", "optional": false, "description": "`Node`'s nodeValue.", "typeRef": null}, {"name": "childNodeCount", "type": "number", "optional": true, "description": "Child count for `Container` nodes.", "typeRef": null}, {"name": "children", "type": "array", "optional": true, "description": "Child nodes of this node when requested with children.", "typeRef": "DOM.Node"}, {"name": "attributes", "type": "array", "optional": true, "description": "Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`.", "typeRef": "string"}, {"name": "documentURL", "type": "string", "optional": true, "description": "Document URL that `Document` or `FrameOwner` node points to.", "typeRef": null}, {"name": "baseURL", "type": "string", "optional": true, "description": "Base URL that `Document` or `FrameOwner` node uses for URL completion.", "typeRef": null}, {"name": "publicId", "type": "string", "optional": true, "description": "`DocumentType`'s publicId.", "typeRef": null}, {"name": "systemId", "type": "string", "optional": true, "description": "`DocumentType`'s systemId.", "typeRef": null}, {"name": "internalSubset", "type": "string", "optional": true, "description": "`DocumentType`'s internalSubset.", "typeRef": null}, {"name": "xmlVersion", "type": "string", "optional": true, "description": "`Document`'s XML version in case of XML documents.", "typeRef": null}, {"name": "name", "type": "string", "optional": true, "description": "`Attr`'s name.", "typeRef": null}, {"name": "value", "type": "string", "optional": true, "description": "`Attr`'s value.", "typeRef": null}, {"name": "pseudoType", "type": "string", "optional": true, "description": "Pseudo element type for this node.", "typeRef": "DOM.PseudoType"}, {"name": "pseudoIdentifier", "type": "string", "optional": true, "description": "Pseudo element identifier for this node. Only present if there is a valid pseudoType.", "typeRef": null}, {"name": "shadowRootType", "type": "string", "optional": true, "description": "Shadow root type.", "typeRef": "DOM.ShadowRootType"}, {"name": "frameId", "type": "string", "optional": true, "description": "Frame ID for frame owner elements.", "typeRef": "Page.FrameId"}, {"name": "contentDocument", "type": "object", "optional": true, "description": "Content document for frame owner elements.", "typeRef": "DOM.Node"}, {"name": "shadowRoots", "type": "array", "optional": true, "description": "Shadow root list for given element host.", "typeRef": "DOM.Node"}, {"name": "templateContent", "type": "object", "optional": true, "description": "Content document fragment for template elements.", "typeRef": "DOM.Node"}, {"name": "pseudoElements", "type": "array", "optional": true, "description": "Pseudo elements associated with this node.", "typeRef": "DOM.Node"}, {"name": "importedDocument", "type": "object", "optional": true, "description": "Deprecated, as the HTML Imports API has been removed (crbug.com/937746). This property used to return the imported document for the HTMLImport links. The property is always undefined now.", "typeRef": "DOM.Node"}, {"name": "distributedNodes", "type": "array", "optional": true, "description": "Distributed nodes for given insertion point.", "typeRef": "DOM.BackendNode"}, {"name": "isSVG", "type": "boolean", "optional": true, "description": "Whether the node is SVG.", "typeRef": null}, {"name": "compatibilityMode", "type": "string", "optional": true, "description": "", "typeRef": "DOM.CompatibilityMode"}, {"name": "assignedSlot", "type": "object", "optional": true, "description": "", "typeRef": "DOM.BackendNode"}, {"name": "isScrollable", "type": "boolean", "optional": true, "description": "", "typeRef": null}, {"name": "affectedByStartingStyles", "type": "boolean", "optional": true, "description": "", "typeRef": null}, {"name": "adoptedStyleSheets", "type": "array", "optional": true, "description": "", "typeRef": "DOM.StyleSheetId"}]);
|
|
428
|
+
inspectorBackend.registerType("DOM.Node", [{"name": "nodeId", "type": "number", "optional": false, "description": "Node identifier that is passed into the rest of the DOM messages as the `nodeId`. Backend will only push node with given `id` once. It is aware of all requested nodes and will only fire DOM events for nodes known to the client.", "typeRef": "DOM.NodeId"}, {"name": "parentId", "type": "number", "optional": true, "description": "The id of the parent node if any.", "typeRef": "DOM.NodeId"}, {"name": "backendNodeId", "type": "number", "optional": false, "description": "The BackendNodeId for this node.", "typeRef": "DOM.BackendNodeId"}, {"name": "nodeType", "type": "number", "optional": false, "description": "`Node`'s nodeType.", "typeRef": null}, {"name": "nodeName", "type": "string", "optional": false, "description": "`Node`'s nodeName.", "typeRef": null}, {"name": "localName", "type": "string", "optional": false, "description": "`Node`'s localName.", "typeRef": null}, {"name": "nodeValue", "type": "string", "optional": false, "description": "`Node`'s nodeValue.", "typeRef": null}, {"name": "childNodeCount", "type": "number", "optional": true, "description": "Child count for `Container` nodes.", "typeRef": null}, {"name": "children", "type": "array", "optional": true, "description": "Child nodes of this node when requested with children.", "typeRef": "DOM.Node"}, {"name": "attributes", "type": "array", "optional": true, "description": "Attributes of the `Element` node in the form of flat array `[name1, value1, name2, value2]`.", "typeRef": "string"}, {"name": "documentURL", "type": "string", "optional": true, "description": "Document URL that `Document` or `FrameOwner` node points to.", "typeRef": null}, {"name": "baseURL", "type": "string", "optional": true, "description": "Base URL that `Document` or `FrameOwner` node uses for URL completion.", "typeRef": null}, {"name": "publicId", "type": "string", "optional": true, "description": "`DocumentType`'s publicId.", "typeRef": null}, {"name": "systemId", "type": "string", "optional": true, "description": "`DocumentType`'s systemId.", "typeRef": null}, {"name": "internalSubset", "type": "string", "optional": true, "description": "`DocumentType`'s internalSubset.", "typeRef": null}, {"name": "xmlVersion", "type": "string", "optional": true, "description": "`Document`'s XML version in case of XML documents.", "typeRef": null}, {"name": "name", "type": "string", "optional": true, "description": "`Attr`'s name.", "typeRef": null}, {"name": "value", "type": "string", "optional": true, "description": "`Attr`'s value.", "typeRef": null}, {"name": "pseudoType", "type": "string", "optional": true, "description": "Pseudo element type for this node.", "typeRef": "DOM.PseudoType"}, {"name": "pseudoIdentifier", "type": "string", "optional": true, "description": "Pseudo element identifier for this node. Only present if there is a valid pseudoType.", "typeRef": null}, {"name": "shadowRootType", "type": "string", "optional": true, "description": "Shadow root type.", "typeRef": "DOM.ShadowRootType"}, {"name": "frameId", "type": "string", "optional": true, "description": "Frame ID for frame owner elements.", "typeRef": "Page.FrameId"}, {"name": "contentDocument", "type": "object", "optional": true, "description": "Content document for frame owner elements.", "typeRef": "DOM.Node"}, {"name": "shadowRoots", "type": "array", "optional": true, "description": "Shadow root list for given element host.", "typeRef": "DOM.Node"}, {"name": "templateContent", "type": "object", "optional": true, "description": "Content document fragment for template elements.", "typeRef": "DOM.Node"}, {"name": "pseudoElements", "type": "array", "optional": true, "description": "Pseudo elements associated with this node.", "typeRef": "DOM.Node"}, {"name": "importedDocument", "type": "object", "optional": true, "description": "Deprecated, as the HTML Imports API has been removed (crbug.com/937746). This property used to return the imported document for the HTMLImport links. The property is always undefined now.", "typeRef": "DOM.Node"}, {"name": "distributedNodes", "type": "array", "optional": true, "description": "Distributed nodes for given insertion point.", "typeRef": "DOM.BackendNode"}, {"name": "isSVG", "type": "boolean", "optional": true, "description": "Whether the node is SVG.", "typeRef": null}, {"name": "compatibilityMode", "type": "string", "optional": true, "description": "", "typeRef": "DOM.CompatibilityMode"}, {"name": "assignedSlot", "type": "object", "optional": true, "description": "", "typeRef": "DOM.BackendNode"}, {"name": "isScrollable", "type": "boolean", "optional": true, "description": "", "typeRef": null}, {"name": "affectedByStartingStyles", "type": "boolean", "optional": true, "description": "", "typeRef": null}, {"name": "adoptedStyleSheets", "type": "array", "optional": true, "description": "", "typeRef": "DOM.StyleSheetId"}, {"name": "isAdRelated", "type": "boolean", "optional": true, "description": "", "typeRef": null}]);
|
|
428
429
|
inspectorBackend.registerType("DOM.DetachedElementInfo", [{"name": "treeNode", "type": "object", "optional": false, "description": "", "typeRef": "DOM.Node"}, {"name": "retainedNodeIds", "type": "array", "optional": false, "description": "", "typeRef": "DOM.NodeId"}]);
|
|
429
430
|
inspectorBackend.registerType("DOM.RGBA", [{"name": "r", "type": "number", "optional": false, "description": "The red component, in the [0-255] range.", "typeRef": null}, {"name": "g", "type": "number", "optional": false, "description": "The green component, in the [0-255] range.", "typeRef": null}, {"name": "b", "type": "number", "optional": false, "description": "The blue component, in the [0-255] range.", "typeRef": null}, {"name": "a", "type": "number", "optional": true, "description": "The alpha component, in the [0-1] range (default: 1).", "typeRef": null}]);
|
|
430
431
|
inspectorBackend.registerType("DOM.Quad", [{"name": "Quad", "type": "array", "optional": false, "description": "An array of quad vertices, x immediately followed by y for each point, points clock-wise.", "typeRef": "number"}]);
|
|
@@ -930,8 +931,9 @@ inspectorBackend.registerType("Network.DeviceBoundSessionCookieCraving", [{"name
|
|
|
930
931
|
inspectorBackend.registerType("Network.DeviceBoundSessionUrlRule", [{"name": "ruleType", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::rule_type`.", "typeRef": null}, {"name": "hostPattern", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::host_pattern`.", "typeRef": null}, {"name": "pathPrefix", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::UrlRule::path_prefix`.", "typeRef": null}]);
|
|
931
932
|
inspectorBackend.registerType("Network.DeviceBoundSessionInclusionRules", [{"name": "origin", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::origin_`.", "typeRef": null}, {"name": "includeSite", "type": "boolean", "optional": false, "description": "Whether the whole site is included. See comments on `net::device_bound_sessions::SessionInclusionRules::include_site_` for more details; this boolean is true if that value is populated.", "typeRef": null}, {"name": "urlRules", "type": "array", "optional": false, "description": "See comments on `net::device_bound_sessions::SessionInclusionRules::url_rules_`.", "typeRef": "Network.DeviceBoundSessionUrlRule"}]);
|
|
932
933
|
inspectorBackend.registerType("Network.DeviceBoundSession", [{"name": "key", "type": "object", "optional": false, "description": "The site and session ID of the session.", "typeRef": "Network.DeviceBoundSessionKey"}, {"name": "refreshUrl", "type": "string", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::refresh_url_`.", "typeRef": null}, {"name": "inclusionRules", "type": "object", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::inclusion_rules_`.", "typeRef": "Network.DeviceBoundSessionInclusionRules"}, {"name": "cookieCravings", "type": "array", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::cookie_cravings_`.", "typeRef": "Network.DeviceBoundSessionCookieCraving"}, {"name": "expiryDate", "type": "number", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::expiry_date_`.", "typeRef": "Network.TimeSinceEpoch"}, {"name": "cachedChallenge", "type": "string", "optional": true, "description": "See comments on `net::device_bound_sessions::Session::cached_challenge__`.", "typeRef": null}, {"name": "allowedRefreshInitiators", "type": "array", "optional": false, "description": "See comments on `net::device_bound_sessions::Session::allowed_refresh_initiators_`.", "typeRef": "string"}]);
|
|
933
|
-
inspectorBackend.registerType("Network.
|
|
934
|
-
inspectorBackend.registerType("Network.
|
|
934
|
+
inspectorBackend.registerType("Network.DeviceBoundSessionFailedRequest", [{"name": "requestUrl", "type": "string", "optional": false, "description": "The failed request URL.", "typeRef": null}, {"name": "netError", "type": "string", "optional": true, "description": "The net error of the response if it was not OK.", "typeRef": null}, {"name": "responseError", "type": "number", "optional": true, "description": "The response code if the net error was OK and the response code was not 200.", "typeRef": null}, {"name": "responseErrorBody", "type": "string", "optional": true, "description": "The body of the response if the net error was OK, the response code was not 200, and the response body was not empty.", "typeRef": null}]);
|
|
935
|
+
inspectorBackend.registerType("Network.CreationEventDetails", [{"name": "fetchResult", "type": "string", "optional": false, "description": "The result of the fetch attempt.", "typeRef": "Network.DeviceBoundSessionFetchResult"}, {"name": "newSession", "type": "object", "optional": true, "description": "The session if there was a newly created session. This is populated for all successful creation events.", "typeRef": "Network.DeviceBoundSession"}, {"name": "failedRequest", "type": "object", "optional": true, "description": "Details about a failed device bound session network request if there was one.", "typeRef": "Network.DeviceBoundSessionFailedRequest"}]);
|
|
936
|
+
inspectorBackend.registerType("Network.RefreshEventDetails", [{"name": "refreshResult", "type": "string", "optional": false, "description": "The result of a refresh.", "typeRef": null}, {"name": "fetchResult", "type": "string", "optional": true, "description": "If there was a fetch attempt, the result of that.", "typeRef": "Network.DeviceBoundSessionFetchResult"}, {"name": "newSession", "type": "object", "optional": true, "description": "The session display if there was a newly created session. This is populated for any refresh event that modifies the session config.", "typeRef": "Network.DeviceBoundSession"}, {"name": "wasFullyProactiveRefresh", "type": "boolean", "optional": false, "description": "See comments on `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`.", "typeRef": null}, {"name": "failedRequest", "type": "object", "optional": true, "description": "Details about a failed device bound session network request if there was one.", "typeRef": "Network.DeviceBoundSessionFailedRequest"}]);
|
|
935
937
|
inspectorBackend.registerType("Network.TerminationEventDetails", [{"name": "deletionReason", "type": "string", "optional": false, "description": "The reason for a session being deleted.", "typeRef": null}]);
|
|
936
938
|
inspectorBackend.registerType("Network.ChallengeEventDetails", [{"name": "challengeResult", "type": "string", "optional": false, "description": "The result of a challenge.", "typeRef": null}, {"name": "challenge", "type": "string", "optional": false, "description": "The challenge set.", "typeRef": null}]);
|
|
937
939
|
inspectorBackend.registerType("Network.LoadNetworkResourcePageResult", [{"name": "success", "type": "boolean", "optional": false, "description": "", "typeRef": null}, {"name": "netError", "type": "number", "optional": true, "description": "Optional values used for error reporting.", "typeRef": null}, {"name": "netErrorName", "type": "string", "optional": true, "description": "", "typeRef": null}, {"name": "httpStatusCode", "type": "number", "optional": true, "description": "", "typeRef": null}, {"name": "stream", "type": "string", "optional": true, "description": "If successful, one of the following two fields holds the result.", "typeRef": "IO.StreamHandle"}, {"name": "headers", "type": "object", "optional": true, "description": "Response headers.", "typeRef": "Network.Headers"}]);
|
|
@@ -1761,6 +1761,20 @@ export const generatedProperties = [
|
|
|
1761
1761
|
],
|
|
1762
1762
|
"name": "column-rule-inset"
|
|
1763
1763
|
},
|
|
1764
|
+
{
|
|
1765
|
+
"longhands": [
|
|
1766
|
+
"column-rule-edge-inset-end",
|
|
1767
|
+
"column-rule-interior-inset-end"
|
|
1768
|
+
],
|
|
1769
|
+
"name": "column-rule-inset-end"
|
|
1770
|
+
},
|
|
1771
|
+
{
|
|
1772
|
+
"longhands": [
|
|
1773
|
+
"column-rule-edge-inset-start",
|
|
1774
|
+
"column-rule-interior-inset-start"
|
|
1775
|
+
],
|
|
1776
|
+
"name": "column-rule-inset-start"
|
|
1777
|
+
},
|
|
1764
1778
|
{
|
|
1765
1779
|
"longhands": [
|
|
1766
1780
|
"column-rule-interior-inset-start",
|
|
@@ -3808,6 +3822,20 @@ export const generatedProperties = [
|
|
|
3808
3822
|
],
|
|
3809
3823
|
"name": "row-rule-inset"
|
|
3810
3824
|
},
|
|
3825
|
+
{
|
|
3826
|
+
"longhands": [
|
|
3827
|
+
"row-rule-edge-inset-end",
|
|
3828
|
+
"row-rule-interior-inset-end"
|
|
3829
|
+
],
|
|
3830
|
+
"name": "row-rule-inset-end"
|
|
3831
|
+
},
|
|
3832
|
+
{
|
|
3833
|
+
"longhands": [
|
|
3834
|
+
"row-rule-edge-inset-start",
|
|
3835
|
+
"row-rule-interior-inset-start"
|
|
3836
|
+
],
|
|
3837
|
+
"name": "row-rule-inset-start"
|
|
3838
|
+
},
|
|
3811
3839
|
{
|
|
3812
3840
|
"longhands": [
|
|
3813
3841
|
"row-rule-interior-inset-start",
|
|
@@ -3929,6 +3957,24 @@ export const generatedProperties = [
|
|
|
3929
3957
|
],
|
|
3930
3958
|
"name": "rule-inset"
|
|
3931
3959
|
},
|
|
3960
|
+
{
|
|
3961
|
+
"longhands": [
|
|
3962
|
+
"column-rule-edge-inset-end",
|
|
3963
|
+
"column-rule-interior-inset-end",
|
|
3964
|
+
"row-rule-edge-inset-end",
|
|
3965
|
+
"row-rule-interior-inset-end"
|
|
3966
|
+
],
|
|
3967
|
+
"name": "rule-inset-end"
|
|
3968
|
+
},
|
|
3969
|
+
{
|
|
3970
|
+
"longhands": [
|
|
3971
|
+
"column-rule-edge-inset-start",
|
|
3972
|
+
"column-rule-interior-inset-start",
|
|
3973
|
+
"row-rule-edge-inset-start",
|
|
3974
|
+
"row-rule-interior-inset-start"
|
|
3975
|
+
],
|
|
3976
|
+
"name": "rule-inset-start"
|
|
3977
|
+
},
|
|
3932
3978
|
{
|
|
3933
3979
|
"longhands": [
|
|
3934
3980
|
"row-rule-interior-inset-start",
|
|
@@ -164,6 +164,10 @@ export namespace ProtocolMapping {
|
|
|
164
164
|
* Fired when a node's scrollability state changes.
|
|
165
165
|
*/
|
|
166
166
|
'DOM.scrollableFlagUpdated': [Protocol.DOM.ScrollableFlagUpdatedEvent];
|
|
167
|
+
/**
|
|
168
|
+
* Fired when a node's ad related state changes.
|
|
169
|
+
*/
|
|
170
|
+
'DOM.adRelatedStateUpdated': [Protocol.DOM.AdRelatedStateUpdatedEvent];
|
|
167
171
|
/**
|
|
168
172
|
* Fired when a node's starting styles changes.
|
|
169
173
|
*/
|
|
@@ -1405,6 +1405,11 @@ declare namespace ProtocolProxyApi {
|
|
|
1405
1405
|
*/
|
|
1406
1406
|
scrollableFlagUpdated(params: Protocol.DOM.ScrollableFlagUpdatedEvent): void;
|
|
1407
1407
|
|
|
1408
|
+
/**
|
|
1409
|
+
* Fired when a node's ad related state changes.
|
|
1410
|
+
*/
|
|
1411
|
+
adRelatedStateUpdated(params: Protocol.DOM.AdRelatedStateUpdatedEvent): void;
|
|
1412
|
+
|
|
1408
1413
|
/**
|
|
1409
1414
|
* Fired when a node's starting styles changes.
|
|
1410
1415
|
*/
|
|
@@ -4736,6 +4736,7 @@ export namespace DOM {
|
|
|
4736
4736
|
isScrollable?: boolean;
|
|
4737
4737
|
affectedByStartingStyles?: boolean;
|
|
4738
4738
|
adoptedStyleSheets?: StyleSheetId[];
|
|
4739
|
+
isAdRelated?: boolean;
|
|
4739
4740
|
}
|
|
4740
4741
|
|
|
4741
4742
|
/**
|
|
@@ -5793,6 +5794,20 @@ export namespace DOM {
|
|
|
5793
5794
|
isScrollable: boolean;
|
|
5794
5795
|
}
|
|
5795
5796
|
|
|
5797
|
+
/**
|
|
5798
|
+
* Fired when a node's ad related state changes.
|
|
5799
|
+
*/
|
|
5800
|
+
export interface AdRelatedStateUpdatedEvent {
|
|
5801
|
+
/**
|
|
5802
|
+
* The id of the node.
|
|
5803
|
+
*/
|
|
5804
|
+
nodeId: DOM.NodeId;
|
|
5805
|
+
/**
|
|
5806
|
+
* If the node is ad related.
|
|
5807
|
+
*/
|
|
5808
|
+
isAdRelated: boolean;
|
|
5809
|
+
}
|
|
5810
|
+
|
|
5796
5811
|
/**
|
|
5797
5812
|
* Fired when a node's starting styles changes.
|
|
5798
5813
|
*/
|
|
@@ -11603,6 +11618,30 @@ export namespace Network {
|
|
|
11603
11618
|
SessionDeletedDuringRefresh = 'SessionDeletedDuringRefresh',
|
|
11604
11619
|
}
|
|
11605
11620
|
|
|
11621
|
+
/**
|
|
11622
|
+
* Details about a failed device bound session network request.
|
|
11623
|
+
*/
|
|
11624
|
+
export interface DeviceBoundSessionFailedRequest {
|
|
11625
|
+
/**
|
|
11626
|
+
* The failed request URL.
|
|
11627
|
+
*/
|
|
11628
|
+
requestUrl: string;
|
|
11629
|
+
/**
|
|
11630
|
+
* The net error of the response if it was not OK.
|
|
11631
|
+
*/
|
|
11632
|
+
netError?: string;
|
|
11633
|
+
/**
|
|
11634
|
+
* The response code if the net error was OK and the response code was not
|
|
11635
|
+
* 200.
|
|
11636
|
+
*/
|
|
11637
|
+
responseError?: integer;
|
|
11638
|
+
/**
|
|
11639
|
+
* The body of the response if the net error was OK, the response code was
|
|
11640
|
+
* not 200, and the response body was not empty.
|
|
11641
|
+
*/
|
|
11642
|
+
responseErrorBody?: string;
|
|
11643
|
+
}
|
|
11644
|
+
|
|
11606
11645
|
/**
|
|
11607
11646
|
* Session event details specific to creation.
|
|
11608
11647
|
*/
|
|
@@ -11616,6 +11655,11 @@ export namespace Network {
|
|
|
11616
11655
|
* all successful creation events.
|
|
11617
11656
|
*/
|
|
11618
11657
|
newSession?: DeviceBoundSession;
|
|
11658
|
+
/**
|
|
11659
|
+
* Details about a failed device bound session network request if there was
|
|
11660
|
+
* one.
|
|
11661
|
+
*/
|
|
11662
|
+
failedRequest?: DeviceBoundSessionFailedRequest;
|
|
11619
11663
|
}
|
|
11620
11664
|
|
|
11621
11665
|
export const enum RefreshEventDetailsRefreshResult {
|
|
@@ -11649,6 +11693,11 @@ export namespace Network {
|
|
|
11649
11693
|
* See comments on `net::device_bound_sessions::RefreshEventResult::was_fully_proactive_refresh`.
|
|
11650
11694
|
*/
|
|
11651
11695
|
wasFullyProactiveRefresh: boolean;
|
|
11696
|
+
/**
|
|
11697
|
+
* Details about a failed device bound session network request if there was
|
|
11698
|
+
* one.
|
|
11699
|
+
*/
|
|
11700
|
+
failedRequest?: DeviceBoundSessionFailedRequest;
|
|
11652
11701
|
}
|
|
11653
11702
|
|
|
11654
11703
|
export const enum TerminationEventDetailsDeletionReason {
|
|
@@ -425,6 +425,10 @@ Time: ${micros(time)}`;
|
|
|
425
425
|
yield* this.#runAgent(initialQuery, options);
|
|
426
426
|
}
|
|
427
427
|
|
|
428
|
+
#getQueryAfterSelection(initialQuery: string, selection: string): string {
|
|
429
|
+
return `${selection}\nOriginal user query: ${initialQuery}`;
|
|
430
|
+
}
|
|
431
|
+
|
|
428
432
|
async *
|
|
429
433
|
#runAgent(
|
|
430
434
|
initialQuery: string,
|
|
@@ -467,7 +471,7 @@ Time: ${micros(time)}`;
|
|
|
467
471
|
// requery with the specialized agent.
|
|
468
472
|
if (data.type === ResponseType.CONTEXT_CHANGE) {
|
|
469
473
|
this.setContext(data.context);
|
|
470
|
-
yield* this.#runAgent(initialQuery, options);
|
|
474
|
+
yield* this.#runAgent(this.#getQueryAfterSelection(initialQuery, data.description), options);
|
|
471
475
|
return;
|
|
472
476
|
}
|
|
473
477
|
}
|
|
@@ -88,6 +88,12 @@ export interface SideEffectResponse {
|
|
|
88
88
|
}
|
|
89
89
|
export interface ContextChangeResponse {
|
|
90
90
|
type: ResponseType.CONTEXT_CHANGE;
|
|
91
|
+
/**
|
|
92
|
+
* Information to pass down what was selected
|
|
93
|
+
* Use to make the LLM understand the the user
|
|
94
|
+
* already selected something.
|
|
95
|
+
*/
|
|
96
|
+
description: string;
|
|
91
97
|
context: ConversationContext<unknown>;
|
|
92
98
|
}
|
|
93
99
|
|
|
@@ -212,7 +218,8 @@ export type FunctionCallHandlerResult<Result> = {
|
|
|
212
218
|
}|{
|
|
213
219
|
result: Result,
|
|
214
220
|
}|{
|
|
215
|
-
context: unknown
|
|
221
|
+
context: ConversationContext<unknown>,
|
|
222
|
+
description: string,
|
|
216
223
|
}|{
|
|
217
224
|
error: string,
|
|
218
225
|
};
|
|
@@ -484,7 +491,9 @@ export abstract class AiAgent<T> {
|
|
|
484
491
|
* called with one object with `foo` and `bar` keys.
|
|
485
492
|
*/
|
|
486
493
|
protected declareFunction<Args extends Record<string, unknown>, ReturnType = unknown>(
|
|
487
|
-
name: string,
|
|
494
|
+
name: string,
|
|
495
|
+
declaration: FunctionDeclaration<Args, ReturnType>,
|
|
496
|
+
): void {
|
|
488
497
|
if (this.#functionDeclarations.has(name)) {
|
|
489
498
|
throw new Error(`Duplicate function declaration ${name}`);
|
|
490
499
|
}
|
|
@@ -609,6 +618,7 @@ export abstract class AiAgent<T> {
|
|
|
609
618
|
if ('context' in result) {
|
|
610
619
|
yield {
|
|
611
620
|
type: ResponseType.CONTEXT_CHANGE,
|
|
621
|
+
description: result.description,
|
|
612
622
|
context: result.context,
|
|
613
623
|
};
|
|
614
624
|
|
|
@@ -643,7 +653,9 @@ export abstract class AiAgent<T> {
|
|
|
643
653
|
name: string,
|
|
644
654
|
args: Record<string, unknown>,
|
|
645
655
|
options?: FunctionHandlerOptions&{explanation?: string},
|
|
646
|
-
): AsyncGenerator<FunctionCallResponseData, {
|
|
656
|
+
): AsyncGenerator<FunctionCallResponseData, {
|
|
657
|
+
result: unknown,
|
|
658
|
+
}|{context: ConversationContext<unknown>, description: string}> {
|
|
647
659
|
const call = this.#functionDeclarations.get(name);
|
|
648
660
|
if (!call) {
|
|
649
661
|
throw new Error(`Function ${name} is not found.`);
|
|
@@ -755,7 +767,7 @@ export abstract class AiAgent<T> {
|
|
|
755
767
|
}
|
|
756
768
|
|
|
757
769
|
if ('context' in result) {
|
|
758
|
-
return result
|
|
770
|
+
return result;
|
|
759
771
|
}
|
|
760
772
|
|
|
761
773
|
return result as {result: unknown};
|
|
@@ -169,6 +169,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
169
169
|
const calculator = this.#networkTimeCalculator ?? new NetworkTimeCalculator.NetworkTransferTimeCalculator();
|
|
170
170
|
return {
|
|
171
171
|
context: new RequestContext(request, calculator),
|
|
172
|
+
description: 'User selected a network request',
|
|
172
173
|
};
|
|
173
174
|
}
|
|
174
175
|
|
|
@@ -231,11 +232,14 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
231
232
|
if (file.fullDisplayName() === params.name) {
|
|
232
233
|
return {
|
|
233
234
|
context: new FileContext(file),
|
|
235
|
+
description: 'User selected a source file',
|
|
234
236
|
};
|
|
235
237
|
}
|
|
236
238
|
}
|
|
237
239
|
|
|
238
|
-
return {
|
|
240
|
+
return {
|
|
241
|
+
error: 'Unable to find file.',
|
|
242
|
+
};
|
|
239
243
|
},
|
|
240
244
|
});
|
|
241
245
|
|
|
@@ -264,6 +268,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
264
268
|
|
|
265
269
|
return {
|
|
266
270
|
context: PerformanceTraceContext.fromParsedTrace(result),
|
|
271
|
+
description: 'User recorded a performance trace',
|
|
267
272
|
};
|
|
268
273
|
}
|
|
269
274
|
});
|
|
@@ -292,6 +297,7 @@ export class ContextSelectionAgent extends AiAgent<never> {
|
|
|
292
297
|
if (node) {
|
|
293
298
|
return {
|
|
294
299
|
context: new NodeContext(node),
|
|
300
|
+
description: 'User selected an element',
|
|
295
301
|
};
|
|
296
302
|
}
|
|
297
303
|
return {
|
|
@@ -176,7 +176,8 @@ export const enum Events {
|
|
|
176
176
|
}
|
|
177
177
|
|
|
178
178
|
export type CSSModelChangedEvent = SDK.CSSStyleSheetHeader.CSSStyleSheetHeader|SDK.CSSModel.StyleSheetChangedEvent|
|
|
179
|
-
SDK.CSSModel.PseudoStateForcedEvent|SDK.DOMModel.DOMNode|
|
|
179
|
+
SDK.CSSModel.PseudoStateForcedEvent|SDK.DOMModel.DOMNode|
|
|
180
|
+
SDK.CSSModel.ComputedStyleUpdatedEvent|null|void;
|
|
180
181
|
|
|
181
182
|
export interface EventTypes {
|
|
182
183
|
[Events.CSS_MODEL_CHANGED]: CSSModelChangedEvent;
|
|
@@ -6551,14 +6551,6 @@ export const NativeFunctions = [
|
|
|
6551
6551
|
name: "timeout",
|
|
6552
6552
|
signatures: [["milliseconds"]]
|
|
6553
6553
|
},
|
|
6554
|
-
{
|
|
6555
|
-
name: "AttributePart",
|
|
6556
|
-
signatures: [["root","element","localName","?init"]]
|
|
6557
|
-
},
|
|
6558
|
-
{
|
|
6559
|
-
name: "ChildNodePart",
|
|
6560
|
-
signatures: [["root","previousSibling","nextSibling","?init"]]
|
|
6561
|
-
},
|
|
6562
6554
|
{
|
|
6563
6555
|
name: "Comment",
|
|
6564
6556
|
signatures: [["?data"]]
|
|
@@ -6623,10 +6615,6 @@ export const NativeFunctions = [
|
|
|
6623
6615
|
name: "Event",
|
|
6624
6616
|
signatures: [["type","?eventInitDict"]]
|
|
6625
6617
|
},
|
|
6626
|
-
{
|
|
6627
|
-
name: "getValueRange",
|
|
6628
|
-
signatures: [["start","end"]]
|
|
6629
|
-
},
|
|
6630
6618
|
{
|
|
6631
6619
|
name: "getBoxQuads",
|
|
6632
6620
|
signatures: [["?options"]]
|
|
@@ -6647,10 +6635,6 @@ export const NativeFunctions = [
|
|
|
6647
6635
|
name: "MutationObserver",
|
|
6648
6636
|
signatures: [["callback"]]
|
|
6649
6637
|
},
|
|
6650
|
-
{
|
|
6651
|
-
name: "NodePart",
|
|
6652
|
-
signatures: [["root","node","?init"]]
|
|
6653
|
-
},
|
|
6654
6638
|
{
|
|
6655
6639
|
name: "Observable",
|
|
6656
6640
|
signatures: [["callback"]]
|
|
@@ -6683,6 +6667,10 @@ export const NativeFunctions = [
|
|
|
6683
6667
|
name: "last",
|
|
6684
6668
|
signatures: [["?options"]]
|
|
6685
6669
|
},
|
|
6670
|
+
{
|
|
6671
|
+
name: "getValueRange",
|
|
6672
|
+
signatures: [["start","end"]]
|
|
6673
|
+
},
|
|
6686
6674
|
{
|
|
6687
6675
|
name: "moveBefore",
|
|
6688
6676
|
signatures: [["node","child"]]
|
|
@@ -275,9 +275,9 @@ async function getEmptyStateSuggestions(conversation?: AiAssistanceModel.AiConve
|
|
|
275
275
|
|
|
276
276
|
case AiAssistanceModel.AiHistoryStorage.ConversationType.NONE: {
|
|
277
277
|
return [
|
|
278
|
-
{title: '
|
|
279
|
-
{title: 'What performance issues exist
|
|
280
|
-
{title: 'What are the slowest requests on this page?', jslogContext: 'empty'},
|
|
278
|
+
{title: 'What can you help me with?', jslogContext: 'empty'},
|
|
279
|
+
{title: 'What performance issues exist on the page?', jslogContext: 'empty'},
|
|
280
|
+
{title: 'What are the slowest network requests on this page?', jslogContext: 'empty'},
|
|
281
281
|
];
|
|
282
282
|
}
|
|
283
283
|
|
|
@@ -503,7 +503,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
503
503
|
#selectedRequest: AiAssistanceModel.NetworkAgent.RequestContext|null = null;
|
|
504
504
|
// Messages displayed in the `ChatView` component.
|
|
505
505
|
#messages: Message[] = [];
|
|
506
|
-
#isContextAutoSelectionSuspended = false;
|
|
507
506
|
|
|
508
507
|
// Whether the UI should show loading or not.
|
|
509
508
|
#isLoading = false;
|
|
@@ -703,13 +702,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
703
702
|
// If there already is an agent and if it is not empty,
|
|
704
703
|
// we don't automatically change the agent.
|
|
705
704
|
if (this.#conversation && !this.#conversation.isEmpty) {
|
|
706
|
-
// If the context selection agent is enabled,
|
|
707
|
-
// we update the context of the current agent.
|
|
708
|
-
const context = this.#getConversationContext(this.#getDefaultConversationType());
|
|
709
|
-
if (context && isAiAssistanceContextSelectionAgentEnabled()) {
|
|
710
|
-
this.#conversation?.setContext(context);
|
|
711
|
-
this.requestUpdate();
|
|
712
|
-
}
|
|
713
705
|
return;
|
|
714
706
|
}
|
|
715
707
|
|
|
@@ -758,13 +750,20 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
758
750
|
}
|
|
759
751
|
|
|
760
752
|
this.#conversation = conversation;
|
|
761
|
-
this.#isContextAutoSelectionSuspended = false;
|
|
762
753
|
}
|
|
763
754
|
|
|
764
|
-
if (
|
|
765
|
-
this.#conversation
|
|
766
|
-
|
|
767
|
-
|
|
755
|
+
if (this.#conversation) {
|
|
756
|
+
if (this.#conversation.isEmpty && isAiAssistanceContextSelectionAgentEnabled()) {
|
|
757
|
+
this.#conversation.setContext(this.#getConversationContext(this.#getDefaultConversationType()));
|
|
758
|
+
} else {
|
|
759
|
+
const context = this.#getConversationContext(this.#conversation.type);
|
|
760
|
+
// Don't reset to the context selection agent if
|
|
761
|
+
// we remove context automatically.
|
|
762
|
+
// Require explicit user action.
|
|
763
|
+
if (context || !isAiAssistanceContextSelectionAgentEnabled()) {
|
|
764
|
+
this.#conversation.setContext(context);
|
|
765
|
+
}
|
|
766
|
+
}
|
|
768
767
|
}
|
|
769
768
|
|
|
770
769
|
this.requestUpdate();
|
|
@@ -1132,12 +1131,10 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1132
1131
|
|
|
1133
1132
|
#handleContextRemoved(): void {
|
|
1134
1133
|
this.#conversation?.setContext(null);
|
|
1135
|
-
this.#isContextAutoSelectionSuspended = true;
|
|
1136
1134
|
this.requestUpdate();
|
|
1137
1135
|
}
|
|
1138
1136
|
|
|
1139
1137
|
#handleContextAdd(): void {
|
|
1140
|
-
this.#isContextAutoSelectionSuspended = false;
|
|
1141
1138
|
this.#conversation?.setContext(this.#getConversationContext(this.#getDefaultConversationType()));
|
|
1142
1139
|
this.requestUpdate();
|
|
1143
1140
|
}
|
|
@@ -1159,7 +1156,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1159
1156
|
return;
|
|
1160
1157
|
}
|
|
1161
1158
|
|
|
1162
|
-
this.#isContextAutoSelectionSuspended = false;
|
|
1163
1159
|
let targetConversationType: AiAssistanceModel.AiHistoryStorage.ConversationType|undefined;
|
|
1164
1160
|
switch (actionId) {
|
|
1165
1161
|
case 'freestyler.elements-floating-button': {
|
|
@@ -1354,8 +1350,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1354
1350
|
this.#selectedPerformanceTrace = data;
|
|
1355
1351
|
}
|
|
1356
1352
|
|
|
1357
|
-
this.#isContextAutoSelectionSuspended = false;
|
|
1358
|
-
|
|
1359
1353
|
void VisualLogging.logFunctionCall(`context-change-${this.#conversation?.type}`);
|
|
1360
1354
|
|
|
1361
1355
|
this.requestUpdate();
|
|
@@ -1426,8 +1420,6 @@ export class AiAssistancePanel extends UI.Panel.Panel {
|
|
|
1426
1420
|
// Cancel any previous in-flight conversation.
|
|
1427
1421
|
this.#cancel();
|
|
1428
1422
|
const signal = this.#runAbortController.signal;
|
|
1429
|
-
const context = this.#getConversationContext(this.#conversation.type);
|
|
1430
|
-
this.#conversation.setContext(context);
|
|
1431
1423
|
|
|
1432
1424
|
// If a different context is provided, it must be from the same origin.
|
|
1433
1425
|
if (this.#conversation.isBlockedByOrigin) {
|