chrome-devtools-frontend 1.0.1596260 → 1.0.1597448
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/agents/prompts/ui-widgets.md +7 -8
- package/docs/ui_engineering.md +10 -11
- package/front_end/core/common/Console.ts +6 -6
- package/front_end/core/common/Settings.ts +12 -8
- package/front_end/core/host/InspectorFrontendHostAPI.ts +1 -0
- package/front_end/core/host/UserMetrics.ts +12 -0
- package/front_end/core/root/DevToolsContext.ts +13 -7
- package/front_end/core/root/Runtime.ts +5 -0
- package/front_end/core/sdk/FrameManager.ts +7 -8
- package/front_end/core/sdk/PageResourceLoader.ts +22 -1
- package/front_end/devtools_compatibility.js +2 -1
- package/front_end/entrypoints/greendev_floaty/FloatyEntrypoint.ts +1 -1
- package/front_end/entrypoints/main/MainImpl.ts +1 -2
- package/front_end/foundation/Universe.ts +22 -11
- package/front_end/generated/InspectorBackendCommands.ts +7 -0
- package/front_end/generated/protocol-mapping.d.ts +16 -0
- package/front_end/generated/protocol-proxy-api.d.ts +25 -0
- package/front_end/generated/protocol.ts +71 -0
- package/front_end/models/ai_assistance/AiConversation.ts +11 -95
- package/front_end/models/ai_assistance/agents/AiAgent.ts +15 -1
- package/front_end/models/ai_assistance/agents/PerformanceAgent.ts +14 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.snapshot.txt +24 -0
- package/front_end/models/ai_assistance/agents/StylingAgent.ts +289 -12
- package/front_end/models/greendev/Prototypes.ts +7 -1
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +36 -33
- package/front_end/panels/ai_assistance/PatchWidget.ts +6 -6
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +28 -32
- package/front_end/panels/ai_assistance/components/ChatView.ts +6 -11
- package/front_end/panels/ai_assistance/components/StylingAgentMarkdownRenderer.ts +200 -0
- package/front_end/panels/ai_assistance/components/WalkthroughView.ts +2 -2
- package/front_end/panels/ai_assistance/components/chatMessage.css +0 -8
- package/front_end/panels/application/ServiceWorkerCacheViews.ts +1 -1
- package/front_end/panels/common/ExtensionServer.ts +15 -0
- package/front_end/panels/elements/ElementsTreeElement.ts +55 -47
- package/front_end/panels/elements/ElementsTreeOutline.ts +149 -28
- package/front_end/panels/elements/StandaloneStylesContainer.ts +48 -12
- package/front_end/panels/elements/StylePropertiesSection.ts +97 -1
- package/front_end/panels/elements/StylePropertyTreeElement.ts +16 -0
- package/front_end/panels/elements/StylesContainer.ts +1 -0
- package/front_end/panels/elements/StylesSidebarPane.ts +48 -32
- package/front_end/panels/elements/stylePropertiesTreeOutline.css +1 -1
- package/front_end/panels/lighthouse/LighthouseController.ts +13 -5
- package/front_end/panels/lighthouse/LighthousePanel.ts +30 -5
- package/front_end/panels/recorder/components/StepView.ts +0 -2
- package/front_end/panels/recorder/components/stepView.css +13 -13
- package/front_end/panels/recorder/components/timelineSection.css +6 -7
- package/front_end/panels/settings/SettingsScreen.ts +3 -2
- package/front_end/panels/timeline/TimelinePanel.ts +18 -0
- package/front_end/panels/timeline/components/CWVMetrics.ts +339 -0
- package/front_end/panels/timeline/components/Sidebar.ts +17 -0
- package/front_end/panels/timeline/components/SidebarInsightsTab.ts +10 -0
- package/front_end/panels/timeline/components/SidebarSingleInsightSet.ts +25 -267
- package/front_end/panels/timeline/components/components.ts +2 -0
- package/front_end/panels/timeline/components/cwvMetrics.css +107 -0
- package/front_end/panels/timeline/components/sidebarSingleInsightSet.css +0 -102
- package/front_end/panels/timeline/timeline-meta.ts +11 -0
- package/front_end/panels/timeline/utils/Helpers.ts +5 -1
- package/front_end/third_party/chromium/README.chromium +1 -1
- package/front_end/third_party/puppeteer/README.chromium +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/injected/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/Mutex.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/cjs/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +14 -3
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/bidi/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js +6 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts +1 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js +5 -0
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/cdp/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/revisions.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/esm/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +7 -0
- package/front_end/third_party/puppeteer/package/package.json +1 -1
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +8 -0
- package/front_end/third_party/puppeteer/package/src/bidi/Page.ts +4 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +7 -0
- package/front_end/third_party/puppeteer/package/src/cdp/Page.ts +6 -0
- package/front_end/third_party/puppeteer/package/src/revisions.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/text_editor/AutocompleteHistory.ts +89 -5
- package/front_end/ui/legacy/UIUtils.ts +5 -5
- package/front_end/ui/legacy/Widget.ts +33 -2
- package/front_end/ui/visual_logging/KnownContextValues.ts +2 -0
- package/package.json +1 -1
|
@@ -20584,6 +20584,77 @@ export namespace WebAuthn {
|
|
|
20584
20584
|
}
|
|
20585
20585
|
}
|
|
20586
20586
|
|
|
20587
|
+
export namespace WebMCP {
|
|
20588
|
+
|
|
20589
|
+
/**
|
|
20590
|
+
* Tool annotations
|
|
20591
|
+
*/
|
|
20592
|
+
export interface Annotation {
|
|
20593
|
+
/**
|
|
20594
|
+
* A hint indicating that the tool does not modify any state.
|
|
20595
|
+
*/
|
|
20596
|
+
readOnly?: boolean;
|
|
20597
|
+
/**
|
|
20598
|
+
* If the declarative tool was declared with the autosubmit attribute.
|
|
20599
|
+
*/
|
|
20600
|
+
autosubmit?: boolean;
|
|
20601
|
+
}
|
|
20602
|
+
|
|
20603
|
+
/**
|
|
20604
|
+
* Definition of a tool that can be invoked.
|
|
20605
|
+
*/
|
|
20606
|
+
export interface Tool {
|
|
20607
|
+
/**
|
|
20608
|
+
* Tool name.
|
|
20609
|
+
*/
|
|
20610
|
+
name: string;
|
|
20611
|
+
/**
|
|
20612
|
+
* Tool description.
|
|
20613
|
+
*/
|
|
20614
|
+
description: string;
|
|
20615
|
+
/**
|
|
20616
|
+
* Schema for the tool's input parameters.
|
|
20617
|
+
*/
|
|
20618
|
+
inputSchema?: any;
|
|
20619
|
+
/**
|
|
20620
|
+
* Optional annotations for the tool.
|
|
20621
|
+
*/
|
|
20622
|
+
annotations?: Annotation;
|
|
20623
|
+
/**
|
|
20624
|
+
* Frame identifier associated with the tool registration.
|
|
20625
|
+
*/
|
|
20626
|
+
frameId: Page.FrameId;
|
|
20627
|
+
/**
|
|
20628
|
+
* Optional node ID for declarative tools.
|
|
20629
|
+
*/
|
|
20630
|
+
backendNodeId?: DOM.BackendNodeId;
|
|
20631
|
+
/**
|
|
20632
|
+
* The stack trace at the time of the registration.
|
|
20633
|
+
*/
|
|
20634
|
+
stackTrace?: Runtime.StackTrace;
|
|
20635
|
+
}
|
|
20636
|
+
|
|
20637
|
+
/**
|
|
20638
|
+
* Event fired when new tools are added.
|
|
20639
|
+
*/
|
|
20640
|
+
export interface ToolsAddedEvent {
|
|
20641
|
+
/**
|
|
20642
|
+
* Array of tools that were added.
|
|
20643
|
+
*/
|
|
20644
|
+
tools: Tool[];
|
|
20645
|
+
}
|
|
20646
|
+
|
|
20647
|
+
/**
|
|
20648
|
+
* Event fired when tools are removed.
|
|
20649
|
+
*/
|
|
20650
|
+
export interface ToolsRemovedEvent {
|
|
20651
|
+
/**
|
|
20652
|
+
* Array of tools that were removed.
|
|
20653
|
+
*/
|
|
20654
|
+
tools: Tool[];
|
|
20655
|
+
}
|
|
20656
|
+
}
|
|
20657
|
+
|
|
20587
20658
|
/**
|
|
20588
20659
|
* Debugger domain exposes JavaScript debugging capabilities. It allows setting and removing
|
|
20589
20660
|
* breakpoints, stepping through execution, exploring stack traces, etc.
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import * as Host from '../../core/host/host.js';
|
|
6
6
|
import * as Root from '../../core/root/root.js';
|
|
7
|
-
import * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
-
import * as Trace from '../../models/trace/trace.js';
|
|
7
|
+
import type * as SDK from '../../core/sdk/sdk.js';
|
|
8
|
+
import type * as Trace from '../../models/trace/trace.js';
|
|
9
9
|
import * as Greendev from '../greendev/greendev.js';
|
|
10
|
-
import * as NetworkTimeCalculator from '../network_time_calculator/network_time_calculator.js';
|
|
10
|
+
import type * as NetworkTimeCalculator from '../network_time_calculator/network_time_calculator.js';
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
type AiAgent,
|
|
@@ -26,10 +26,6 @@ import {PerformanceAgent, PerformanceTraceContext} from './agents/PerformanceAge
|
|
|
26
26
|
import {NodeContext, StylingAgent} from './agents/StylingAgent.js';
|
|
27
27
|
import {AiHistoryStorage, ConversationType, type SerializedConversation} from './AiHistoryStorage.js';
|
|
28
28
|
import type {ChangeManager} from './ChangeManager.js';
|
|
29
|
-
import {NetworkRequestFormatter} from './data_formatters/NetworkRequestFormatter.js';
|
|
30
|
-
import {PerformanceInsightFormatter} from './data_formatters/PerformanceInsightFormatter.js';
|
|
31
|
-
import {micros} from './data_formatters/UnitFormatters.js';
|
|
32
|
-
import {AgentFocus} from './performance/AIContext.js';
|
|
33
29
|
|
|
34
30
|
export const NOT_FOUND_IMAGE_DATA = '';
|
|
35
31
|
const MAX_TITLE_LENGTH = 80;
|
|
@@ -166,6 +162,11 @@ export class AiConversation {
|
|
|
166
162
|
return this.#contexts.at(0);
|
|
167
163
|
}
|
|
168
164
|
|
|
165
|
+
getPendingMultimodalInput(): MultimodalInput|undefined {
|
|
166
|
+
const greenDevEmulationEnabled = Greendev.Prototypes.instance().isEnabled('emulationCapabilities');
|
|
167
|
+
return greenDevEmulationEnabled ? this.#agent.popPendingMultimodalInput() : undefined;
|
|
168
|
+
}
|
|
169
|
+
|
|
169
170
|
#reconstructHistory(historyWithoutImages: ResponseData[]): ResponseData[] {
|
|
170
171
|
const imageHistory = AiHistoryStorage.instance().getImageHistory();
|
|
171
172
|
if (imageHistory && imageHistory.length > 0) {
|
|
@@ -274,6 +275,9 @@ export class AiConversation {
|
|
|
274
275
|
if (item.type === ResponseType.SIDE_EFFECT) {
|
|
275
276
|
return {...item, confirm: undefined};
|
|
276
277
|
}
|
|
278
|
+
if (item.type === ResponseType.CONTEXT && item.widgets) {
|
|
279
|
+
return {...item, widgets: undefined};
|
|
280
|
+
}
|
|
277
281
|
return item;
|
|
278
282
|
})
|
|
279
283
|
.filter(history => !!history),
|
|
@@ -342,88 +346,11 @@ export class AiConversation {
|
|
|
342
346
|
}
|
|
343
347
|
}
|
|
344
348
|
|
|
345
|
-
#factsCache = new Map<ExtraContext, Host.AidaClient.RequestFact>();
|
|
346
|
-
|
|
347
|
-
async #createFactsForExtraContext(contexts: ExtraContext[]): Promise<void> {
|
|
348
|
-
for (const context of contexts) {
|
|
349
|
-
const cached = this.#factsCache.get(context);
|
|
350
|
-
if (cached) {
|
|
351
|
-
this.#agent.addFact(cached);
|
|
352
|
-
continue;
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
if (context instanceof SDK.DOMModel.DOMNode) {
|
|
356
|
-
const desc = await StylingAgent.describeElement(context);
|
|
357
|
-
|
|
358
|
-
const fact = {
|
|
359
|
-
text: `Relevant HTML element:\n${desc}`,
|
|
360
|
-
metadata: {
|
|
361
|
-
source: 'devtools-floaty',
|
|
362
|
-
score: 1,
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
this.#factsCache.set(context, fact);
|
|
366
|
-
this.#agent.addFact(fact);
|
|
367
|
-
} else if (context instanceof SDK.NetworkRequest.NetworkRequest) {
|
|
368
|
-
const calculator = new NetworkTimeCalculator.NetworkTransferTimeCalculator();
|
|
369
|
-
calculator.updateBoundaries(context);
|
|
370
|
-
const formatter = new NetworkRequestFormatter(context, calculator);
|
|
371
|
-
const desc = await formatter.formatNetworkRequest();
|
|
372
|
-
|
|
373
|
-
const fact = {
|
|
374
|
-
text: `Relevant network request:\n${desc}`,
|
|
375
|
-
metadata: {
|
|
376
|
-
source: 'devtools-floaty',
|
|
377
|
-
score: 1,
|
|
378
|
-
}
|
|
379
|
-
};
|
|
380
|
-
this.#factsCache.set(context, fact);
|
|
381
|
-
this.#agent.addFact(fact);
|
|
382
|
-
} else if ('insight' in context) {
|
|
383
|
-
const focus = AgentFocus.fromInsight(context.trace, context.insight);
|
|
384
|
-
const formatter = new PerformanceInsightFormatter(
|
|
385
|
-
focus,
|
|
386
|
-
context.insight,
|
|
387
|
-
);
|
|
388
|
-
|
|
389
|
-
const text = `Relevant Performance Insight:\n${formatter.formatInsight()}`;
|
|
390
|
-
const fact = {
|
|
391
|
-
text,
|
|
392
|
-
metadata: {
|
|
393
|
-
source: 'devtools-floaty',
|
|
394
|
-
score: 1,
|
|
395
|
-
}
|
|
396
|
-
};
|
|
397
|
-
this.#factsCache.set(context, fact);
|
|
398
|
-
this.#agent.addFact(fact);
|
|
399
|
-
} else {
|
|
400
|
-
// Must be a trace event
|
|
401
|
-
const time = Trace.Types.Timing.Micro(
|
|
402
|
-
context.event.ts - context.traceStartTime,
|
|
403
|
-
);
|
|
404
|
-
|
|
405
|
-
const desc = `Trace event: ${context.event.name}
|
|
406
|
-
Time: ${micros(time)}`;
|
|
407
|
-
|
|
408
|
-
const fact = {
|
|
409
|
-
text: `Relevant trace event:\n${desc}`,
|
|
410
|
-
metadata: {
|
|
411
|
-
source: 'devtools-floaty',
|
|
412
|
-
score: 1,
|
|
413
|
-
}
|
|
414
|
-
};
|
|
415
|
-
this.#factsCache.set(context, fact);
|
|
416
|
-
this.#agent.addFact(fact);
|
|
417
|
-
}
|
|
418
|
-
}
|
|
419
|
-
}
|
|
420
|
-
|
|
421
349
|
async *
|
|
422
350
|
run(
|
|
423
351
|
initialQuery: string,
|
|
424
352
|
options: {
|
|
425
353
|
signal?: AbortSignal,
|
|
426
|
-
extraContext?: ExtraContext[],
|
|
427
354
|
multimodalInput?: MultimodalInput,
|
|
428
355
|
} = {},
|
|
429
356
|
): AsyncGenerator<ResponseData, void, void> {
|
|
@@ -442,9 +369,6 @@ Time: ${micros(time)}`;
|
|
|
442
369
|
void this.addHistoryItem(userQuery);
|
|
443
370
|
yield userQuery;
|
|
444
371
|
|
|
445
|
-
if (options.extraContext) {
|
|
446
|
-
await this.#createFactsForExtraContext(options.extraContext);
|
|
447
|
-
}
|
|
448
372
|
this.#setOriginIfEmpty(this.selectedContext?.getOrigin());
|
|
449
373
|
|
|
450
374
|
if (this.isBlockedByOrigin) {
|
|
@@ -463,7 +387,6 @@ Time: ${micros(time)}`;
|
|
|
463
387
|
initialQuery: string,
|
|
464
388
|
options: {
|
|
465
389
|
signal?: AbortSignal,
|
|
466
|
-
extraContext?: ExtraContext[],
|
|
467
390
|
multimodalInput?: MultimodalInput,
|
|
468
391
|
} = {},
|
|
469
392
|
): AsyncGenerator<ResponseData, void, void> {
|
|
@@ -528,13 +451,6 @@ function isAiAssistanceServerSideLoggingEnabled(): boolean {
|
|
|
528
451
|
return !Root.Runtime.hostConfig.aidaAvailability?.disallowLogging;
|
|
529
452
|
}
|
|
530
453
|
|
|
531
|
-
// TODO: this is the same as the type in UI.Floaty but we cannot use UI
|
|
532
|
-
// here. This is fine for prototyping but if we take this further we can
|
|
533
|
-
// rearchitect.
|
|
534
|
-
type ExtraContext = SDK.DOMModel.DOMNode|SDK.NetworkRequest.NetworkRequest|
|
|
535
|
-
{event: Trace.Types.Events.Event, traceStartTime: Trace.Types.Timing.Micro}|
|
|
536
|
-
{insight: Trace.Insights.Types.InsightModel, trace: Trace.TraceModel.ParsedTrace};
|
|
537
|
-
|
|
538
454
|
function isAiAssistanceContextSelectionAgentEnabled(): boolean {
|
|
539
455
|
return Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceContextSelectionAgent?.enabled);
|
|
540
456
|
}
|
|
@@ -7,6 +7,7 @@ import * as Root from '../../../core/root/root.js';
|
|
|
7
7
|
import type * as SDK from '../../../core/sdk/sdk.js';
|
|
8
8
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
9
9
|
import * as Greendev from '../../greendev/greendev.js';
|
|
10
|
+
import type * as Trace from '../../trace/trace.js';
|
|
10
11
|
import {debugLog, isStructuredLogEnabled} from '../debug.js';
|
|
11
12
|
|
|
12
13
|
export const enum ResponseType {
|
|
@@ -69,6 +70,7 @@ export interface ContextResponse {
|
|
|
69
70
|
type: ResponseType.CONTEXT;
|
|
70
71
|
title: string;
|
|
71
72
|
details: [ContextDetail, ...ContextDetail[]];
|
|
73
|
+
widgets?: AiWidget[];
|
|
72
74
|
}
|
|
73
75
|
|
|
74
76
|
export interface TitleResponse {
|
|
@@ -228,8 +230,16 @@ export interface ComputedStyleAiWidget {
|
|
|
228
230
|
properties: string[],
|
|
229
231
|
};
|
|
230
232
|
}
|
|
233
|
+
export interface CoreVitalsAiWidget {
|
|
234
|
+
name: 'CORE_VITALS';
|
|
235
|
+
data: {
|
|
236
|
+
insightSetKey: string,
|
|
237
|
+
parsedTrace: Trace.TraceModel.ParsedTrace,
|
|
238
|
+
};
|
|
239
|
+
}
|
|
240
|
+
|
|
231
241
|
// This type will grow as we add more widgets.
|
|
232
|
-
export type AiWidget = ComputedStyleAiWidget;
|
|
242
|
+
export type AiWidget = ComputedStyleAiWidget|CoreVitalsAiWidget;
|
|
233
243
|
|
|
234
244
|
export type FunctionCallHandlerResult<Result> = {
|
|
235
245
|
requiresApproval: true,
|
|
@@ -384,6 +394,10 @@ export abstract class AiAgent<T> {
|
|
|
384
394
|
this.#facts.clear();
|
|
385
395
|
}
|
|
386
396
|
|
|
397
|
+
popPendingMultimodalInput(): MultimodalInput|undefined {
|
|
398
|
+
return undefined;
|
|
399
|
+
}
|
|
400
|
+
|
|
387
401
|
preambleFeatures(): string[] {
|
|
388
402
|
return [];
|
|
389
403
|
}
|
|
@@ -22,6 +22,7 @@ import {AgentFocus} from '../performance/AIContext.js';
|
|
|
22
22
|
|
|
23
23
|
import {
|
|
24
24
|
AiAgent,
|
|
25
|
+
type AiWidget,
|
|
25
26
|
type ContextResponse,
|
|
26
27
|
ConversationContext,
|
|
27
28
|
type ConversationSuggestions,
|
|
@@ -381,6 +382,18 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
381
382
|
return;
|
|
382
383
|
}
|
|
383
384
|
|
|
385
|
+
const widgets: AiWidget[] = [];
|
|
386
|
+
const primaryInsightSet = context.getItem().primaryInsightSet;
|
|
387
|
+
if (primaryInsightSet) {
|
|
388
|
+
widgets.push({
|
|
389
|
+
name: 'CORE_VITALS',
|
|
390
|
+
data: {
|
|
391
|
+
parsedTrace: context.getItem().parsedTrace,
|
|
392
|
+
insightSetKey: primaryInsightSet.id,
|
|
393
|
+
},
|
|
394
|
+
});
|
|
395
|
+
}
|
|
396
|
+
|
|
384
397
|
yield {
|
|
385
398
|
type: ResponseType.CONTEXT,
|
|
386
399
|
title: lockedString(UIStringsNotTranslated.analyzingTrace),
|
|
@@ -390,6 +403,7 @@ export class PerformanceAgent extends AiAgent<AgentFocus> {
|
|
|
390
403
|
text: this.#formatter?.formatTraceSummary() ?? '',
|
|
391
404
|
},
|
|
392
405
|
],
|
|
406
|
+
widgets,
|
|
393
407
|
};
|
|
394
408
|
|
|
395
409
|
this.#hasShownAnalyzeTraceContext = true;
|
|
@@ -121,6 +121,30 @@ Content:
|
|
|
121
121
|
"title"
|
|
122
122
|
]
|
|
123
123
|
}
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
"name": "activateDeviceEmulation",
|
|
127
|
+
"description": "Sets emulation viewing mode for a specific device and optionally enables vision deficiency emulation.",
|
|
128
|
+
"parameters": {
|
|
129
|
+
"type": 6,
|
|
130
|
+
"description": "",
|
|
131
|
+
"nullable": false,
|
|
132
|
+
"properties": {
|
|
133
|
+
"deviceName": {
|
|
134
|
+
"type": 1,
|
|
135
|
+
"description": "The name of the device to emulate. Allowed values: Pixel 3 XL, Pixel 7, Samsung Galaxy S8+, Samsung Galaxy S20 Ultra, Surface Pro 7, Surface Duo, Galaxy Z Fold 5, Asus Zenbook Fold, Samsung Galaxy A51/71, Nest Hub Max, Nest Hub, iPhone 4, iPhone 5/SE, iPhone 6/7/8, iPhone SE, iPhone XR, iPhone 12 Pro, iPhone 14 Pro Max, iPad Mini, iPad Air, iPad Pro.",
|
|
136
|
+
"nullable": false
|
|
137
|
+
},
|
|
138
|
+
"visionDeficiency": {
|
|
139
|
+
"type": 1,
|
|
140
|
+
"description": "Optional vision deficiency to emulate. Allowed values: blurredVision, reducedContrast, achromatopsia, deuteranopia, protanopia, tritanopia.",
|
|
141
|
+
"nullable": true
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
"required": [
|
|
145
|
+
"deviceName"
|
|
146
|
+
]
|
|
147
|
+
}
|
|
124
148
|
}
|
|
125
149
|
],
|
|
126
150
|
"options": {
|