chrome-devtools-frontend 1.0.1667564 → 1.0.1669021
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/skills/devtools-ci/SKILL.md +65 -0
- package/.agents/skills/devtools-setting-migration/SKILL.md +290 -0
- package/.agents/skills/gerrit-cli/SKILL.md +59 -0
- package/.agents/skills/gerrit-cli/references/commands.md +93 -0
- package/.agents/skills/gerrit-cli/references/workflows.md +56 -0
- package/.agents/skills/gerrit-cli/scripts/gerrit_client_wrapper.py +47 -0
- package/.agents/skills/gerrit-cli/scripts/import_upstream.py +230 -0
- package/.agents/skills/ui-eng-vision-widget-promoter/SKILL.md +11 -4
- package/.agents/skills/ui-widgets/SKILL.md +25 -1
- package/docs/contributing/infrastructure.md +7 -1
- package/docs/ui_engineering.md +44 -1
- package/front_end/core/common/Settings.ts +11 -4
- package/front_end/core/host/AidaClient.ts +66 -47
- package/front_end/core/host/GcaClient.ts +4 -6
- package/front_end/core/host/ResourceLoader.ts +4 -2
- package/front_end/core/root/Runtime.ts +5 -5
- package/front_end/core/sdk/CSSModel.test.api.ts +102 -0
- package/front_end/core/sdk/CSSModel.ts +3 -2
- package/front_end/core/sdk/ConsoleModel.ts +3 -2
- package/front_end/core/sdk/DebuggerModel.ts +16 -7
- package/front_end/core/sdk/SDKSettings.ts +38 -0
- package/front_end/core/sdk/sdk-meta.ts +0 -120
- package/front_end/core/sdk/sdk.ts +2 -0
- package/front_end/entrypoints/main/MainImpl.ts +10 -3
- package/front_end/foundation/Universe.ts +7 -0
- package/front_end/generated/InspectorBackendCommands.ts +2 -2
- package/front_end/generated/protocol.ts +11 -3
- package/front_end/models/ai_assistance/AiAgent2.ts +1 -1
- package/front_end/models/ai_assistance/AiUtils.ts +67 -4
- package/front_end/models/ai_assistance/BuiltInAi.ts +11 -6
- package/front_end/models/ai_assistance/ChangeManager.ts +17 -1
- package/front_end/models/ai_assistance/StorageItem.ts +26 -5
- package/front_end/models/ai_code_completion/AiCodeCompletion.ts +2 -19
- package/front_end/models/ai_code_generation/AiCodeGeneration.ts +2 -3
- package/front_end/models/javascript_metadata/NativeFunctions.js +22 -9
- package/front_end/models/source_map_scopes/NamesResolver.ts +23 -17
- package/front_end/models/trace/handlers/RendererHandler.ts +20 -4
- package/front_end/models/trace/types/File.ts +1 -0
- package/front_end/models/workspace/UISourceCode.ts +0 -10
- package/front_end/panels/ai_assistance/AiAssistancePanel.ts +61 -182
- package/front_end/panels/ai_assistance/components/ChatInput.ts +25 -8
- package/front_end/panels/ai_assistance/components/ChatMessage.ts +13 -69
- package/front_end/panels/ai_assistance/components/ChatView.ts +14 -8
- package/front_end/panels/ai_assistance/components/chatMessage.css +2 -20
- package/front_end/panels/application/ApplicationPanelSidebar.ts +2 -2
- package/front_end/panels/application/ApplicationPanelTreeElement.ts +41 -3
- package/front_end/panels/application/ServiceWorkerUpdateCycleView.ts +131 -134
- package/front_end/panels/application/ServiceWorkersView.ts +8 -8
- package/front_end/panels/application/application.ts +2 -0
- package/front_end/panels/application/components/AdsView.ts +10 -6
- package/front_end/panels/application/preloading/PreloadingView.ts +53 -45
- package/front_end/panels/application/preloading/components/PreloadingDetailsReportView.ts +111 -119
- package/front_end/panels/application/preloading/components/preloadingDetailsReportView.css +22 -24
- package/front_end/panels/application/serviceWorkerUpdateCycleView.css +105 -102
- package/front_end/panels/common/AiCodeCompletionDisclaimer.ts +107 -96
- package/front_end/panels/common/AiCodeCompletionSummaryToolbar.ts +17 -19
- package/front_end/panels/common/AiCodeCompletionTeaser.ts +6 -6
- package/front_end/panels/common/AiCodeGenerationTeaser.ts +28 -26
- package/front_end/panels/common/common.ts +1 -1
- package/front_end/panels/console/ConsoleInsightTeaser.ts +6 -8
- package/front_end/panels/console/ConsoleView.ts +6 -4
- package/front_end/panels/console/ConsoleViewMessage.ts +1 -1
- package/front_end/panels/console/console-meta.ts +28 -0
- package/front_end/panels/elements/StylesAiCodeCompletionProvider.ts +1 -1
- package/front_end/panels/elements/StylesSidebarPane.ts +3 -2
- package/front_end/panels/emulation/DeviceModeToolbar.ts +2 -2
- package/front_end/panels/emulation/DeviceModeView.ts +63 -104
- package/front_end/panels/emulation/DeviceModeWrapper.ts +18 -4
- package/front_end/panels/explain/components/ConsoleInsight.ts +4 -6
- package/front_end/panels/explain/explain-meta.ts +7 -49
- package/front_end/panels/network/NetworkDataGridNode.ts +1 -1
- package/front_end/panels/network/NetworkLogView.ts +1 -0
- package/front_end/panels/network/OriginalResourceChunkView.ts +340 -0
- package/front_end/panels/network/ResourceChunkView.ts +72 -46
- package/front_end/panels/network/ResourceDirectSocketChunkView.ts +3 -2
- package/front_end/panels/network/ResourceWebSocketFrameView.ts +3 -3
- package/front_end/panels/network/originalResourceChunkView.css +49 -0
- package/front_end/panels/screencast/ScreencastView.ts +401 -260
- package/front_end/panels/screencast/screencastView.css +113 -100
- package/front_end/panels/sensors/LocationsSettingsTab.ts +329 -135
- package/front_end/panels/sensors/locationsSettingsTab.css +78 -4
- package/front_end/panels/settings/AISettingsTab.ts +17 -100
- package/front_end/panels/snippets/ScriptSnippetFileSystem.ts +2 -2
- package/front_end/panels/snippets/SnippetsQuickOpen.ts +4 -4
- package/front_end/panels/sources/AddSourceMapURLDialog.ts +3 -3
- package/front_end/panels/sources/AiCodeCompletionPlugin.ts +4 -3
- package/front_end/panels/sources/BreakpointEditDialog.ts +14 -14
- package/front_end/panels/sources/BreakpointsView.ts +14 -14
- package/front_end/panels/sources/CallStackSidebarPane.ts +6 -6
- package/front_end/panels/sources/CategorizedBreakpointL10n.ts +18 -18
- package/front_end/panels/sources/CoveragePlugin.ts +7 -7
- package/front_end/panels/sources/DebuggerPausedMessage.ts +23 -23
- package/front_end/panels/sources/DebuggerPlugin.ts +31 -31
- package/front_end/panels/sources/FilteredUISourceCodeListProvider.ts +2 -2
- package/front_end/panels/sources/GoToLineQuickOpen.ts +10 -10
- package/front_end/panels/sources/NavigatorView.ts +34 -27
- package/front_end/panels/sources/OutlineQuickOpen.ts +3 -3
- package/front_end/panels/sources/PersistenceActions.ts +9 -9
- package/front_end/panels/sources/ProfilePlugin.ts +1 -1
- package/front_end/panels/sources/ScopeChainSidebarPane.ts +5 -5
- package/front_end/panels/sources/SnippetsPlugin.ts +2 -2
- package/front_end/panels/sources/SourcesNavigator.ts +20 -18
- package/front_end/panels/sources/SourcesPanel.ts +26 -25
- package/front_end/panels/sources/SourcesView.ts +5 -6
- package/front_end/panels/sources/TabbedEditorContainer.ts +3 -3
- package/front_end/panels/sources/ThreadsSidebarPane.ts +1 -1
- package/front_end/panels/sources/UISourceCodeFrame.ts +0 -2
- package/front_end/panels/sources/WatchExpressionsSidebarPane.ts +7 -7
- package/front_end/panels/sources/components/HeadersView.ts +2 -2
- package/front_end/panels/sources/sources-meta.ts +164 -71
- package/front_end/panels/sources/sources.ts +0 -2
- package/front_end/panels/timeline/TimelineHistoryManager.ts +14 -3
- package/front_end/panels/timeline/TimelineLoader.ts +72 -42
- package/front_end/panels/timeline/TimelinePanel.ts +29 -4
- package/front_end/panels/timeline/timelineHistoryManager.css +4 -0
- 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/es5-iife/puppeteer-core-browser.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/lib/es5-iife/puppeteer-core-browser.js +91 -38
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts +145 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/BrowserContext.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts +3 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js +8 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Dialog.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/JSHandle.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts +1 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js +0 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Page.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js +0 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/api/Realm.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/BidiOverCdp.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js +12 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js +4 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/bidi/HTTPResponse.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts +5 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js +49 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/cdp/Browser.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js +0 -6
- package/front_end/third_party/puppeteer/package/lib/puppeteer/common/EventEmitter.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/generated/injected.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js +3 -0
- package/front_end/third_party/puppeteer/package/lib/puppeteer/injected/util.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.d.ts.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js +0 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/node/ScreenRecorder.js.map +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.d.ts +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/revisions.js +3 -3
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.d.ts +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/disposable.js +2 -2
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.d.ts +1 -1
- package/front_end/third_party/puppeteer/package/lib/puppeteer/util/version.js +1 -1
- package/front_end/third_party/puppeteer/package/lib/types.d.ts +187 -1
- package/front_end/third_party/puppeteer/package/package.json +5 -5
- package/front_end/third_party/puppeteer/package/src/api/Browser.ts +155 -2
- package/front_end/third_party/puppeteer/package/src/api/BrowserContext.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Dialog.ts +10 -2
- package/front_end/third_party/puppeteer/package/src/api/JSHandle.ts +0 -2
- package/front_end/third_party/puppeteer/package/src/api/Page.ts +1 -3
- package/front_end/third_party/puppeteer/package/src/api/Realm.ts +0 -1
- package/front_end/third_party/puppeteer/package/src/bidi/BidiOverCdp.ts +4 -2
- package/front_end/third_party/puppeteer/package/src/bidi/Browser.ts +17 -0
- package/front_end/third_party/puppeteer/package/src/bidi/HTTPResponse.ts +5 -4
- package/front_end/third_party/puppeteer/package/src/cdp/Browser.ts +66 -0
- package/front_end/third_party/puppeteer/package/src/common/EventEmitter.ts +0 -6
- package/front_end/third_party/puppeteer/package/src/generated/injected.ts +1 -1
- package/front_end/third_party/puppeteer/package/src/injected/util.ts +4 -1
- package/front_end/third_party/puppeteer/package/src/node/ScreenRecorder.ts +0 -3
- package/front_end/third_party/puppeteer/package/src/revisions.ts +3 -3
- package/front_end/third_party/puppeteer/package/src/util/disposable.ts +2 -2
- package/front_end/third_party/puppeteer/package/src/util/version.ts +1 -1
- package/front_end/ui/components/text_editor/AiCodeCompletionProvider.ts +9 -7
- package/front_end/ui/components/text_editor/AiCodeGenerationProvider.ts +7 -8
- package/front_end/ui/legacy/Dialog.ts +103 -4
- package/front_end/ui/legacy/InspectorView.ts +1 -5
- package/front_end/ui/legacy/PopoverHelper.ts +5 -5
- package/front_end/ui/legacy/TabbedPane.ts +7 -2
- package/front_end/ui/legacy/components/cookie_table/CookiesTable.ts +40 -24
- package/front_end/ui/legacy/components/data_grid/DataGrid.ts +1 -0
- package/front_end/ui/legacy/components/data_grid/DataGridElement.ts +8 -4
- package/front_end/ui/legacy/components/perf_ui/FlameChart.ts +14 -7
- package/front_end/ui/legacy/components/quick_open/CommandMenu.ts +11 -1
- package/front_end/ui/visual_logging/KnownContextValues.ts +3 -0
- package/package.json +1 -1
- package/front_end/panels/sources/AiWarningInfobarPlugin.ts +0 -78
|
@@ -9,7 +9,6 @@ import * as Common from '../../../core/common/common.js';
|
|
|
9
9
|
import * as Host from '../../../core/host/host.js';
|
|
10
10
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
11
11
|
import * as Platform from '../../../core/platform/platform.js';
|
|
12
|
-
import * as Root from '../../../core/root/root.js';
|
|
13
12
|
import * as SDK from '../../../core/sdk/sdk.js';
|
|
14
13
|
import * as TextUtils from '../../../core/text_utils/text_utils.js';
|
|
15
14
|
import type * as Protocol from '../../../generated/protocol.js';
|
|
@@ -105,10 +104,6 @@ const UIStringsNotTranslate = {
|
|
|
105
104
|
* @description The title of the button for scrolling to see previous suggestions
|
|
106
105
|
*/
|
|
107
106
|
scrollToPrevious: 'Scroll to previous suggestions',
|
|
108
|
-
/**
|
|
109
|
-
* @description The title of the button that copies the AI-generated response to the clipboard.
|
|
110
|
-
*/
|
|
111
|
-
copyResponse: 'Copy response',
|
|
112
107
|
/**
|
|
113
108
|
* @description The error message when the request to the LLM failed for some reason.
|
|
114
109
|
*/
|
|
@@ -142,14 +137,6 @@ const UIStringsNotTranslate = {
|
|
|
142
137
|
* @description Button text that cancels code execution that may affect the page.
|
|
143
138
|
*/
|
|
144
139
|
declineActionRequestApproval: 'Cancel',
|
|
145
|
-
/**
|
|
146
|
-
* @description The generic name of the AI agent (do not translate)
|
|
147
|
-
*/
|
|
148
|
-
ai: 'AI',
|
|
149
|
-
/**
|
|
150
|
-
* @description Gemini (do not translate)
|
|
151
|
-
*/
|
|
152
|
-
gemini: 'Gemini',
|
|
153
140
|
/**
|
|
154
141
|
* @description The fallback text when a step has no title yet
|
|
155
142
|
*/
|
|
@@ -561,7 +548,6 @@ export interface MessageInput {
|
|
|
561
548
|
}
|
|
562
549
|
|
|
563
550
|
export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, target: HTMLElement): void => {
|
|
564
|
-
const hasAiV2 = Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceV2?.enabled);
|
|
565
551
|
const message = input.message;
|
|
566
552
|
|
|
567
553
|
if (message.entity === ChatMessageEntity.USER) {
|
|
@@ -574,19 +560,13 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
|
|
|
574
560
|
query: true,
|
|
575
561
|
'is-last-message': input.isLastMessage,
|
|
576
562
|
'is-first-message': input.isFirstMessage,
|
|
577
|
-
'ai-v2': hasAiV2,
|
|
578
563
|
});
|
|
579
564
|
|
|
580
|
-
const userQueryWrapperClasses = Lit.Directives.classMap({
|
|
581
|
-
// Don't need to style at all unless we are on the V2 flag.
|
|
582
|
-
// Once we ship this can be removed entirely.
|
|
583
|
-
'user-query-wrapper': hasAiV2,
|
|
584
|
-
});
|
|
585
565
|
// clang-format off
|
|
586
566
|
Lit.render(html`
|
|
587
567
|
<style>${Input.textInputStyles}</style>
|
|
588
568
|
<style>${chatMessageStyles}</style>
|
|
589
|
-
<div class
|
|
569
|
+
<div class="user-query-wrapper">
|
|
590
570
|
<section class=${messageClasses} jslog=${VisualLogging.section('question')}>
|
|
591
571
|
${imageInput}
|
|
592
572
|
<div class="message-content">${renderTextAsMarkdown(message.text, input.markdownRenderer)}</div>
|
|
@@ -598,28 +578,19 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
|
|
|
598
578
|
}
|
|
599
579
|
|
|
600
580
|
const steps = message.parts.filter(part => part.type === 'step').map(part => part.step);
|
|
601
|
-
const icon = AiAssistanceModel.AiUtils.getIconName();
|
|
602
581
|
|
|
603
582
|
const messageClasses = Lit.Directives.classMap({
|
|
604
583
|
'chat-message': true,
|
|
605
584
|
answer: true,
|
|
606
585
|
'is-last-message': input.isLastMessage,
|
|
607
586
|
'is-first-message': input.isFirstMessage,
|
|
608
|
-
'ai-v2': hasAiV2,
|
|
609
587
|
});
|
|
610
588
|
// clang-format off
|
|
611
589
|
Lit.render(html`
|
|
612
590
|
<style>${Input.textInputStyles}</style>
|
|
613
591
|
<style>${chatMessageStyles}</style>
|
|
614
592
|
<section class=${messageClasses} jslog=${VisualLogging.section('answer')}>
|
|
615
|
-
${
|
|
616
|
-
<div class="message-info">
|
|
617
|
-
<devtools-icon name=${icon}></devtools-icon>
|
|
618
|
-
<div class="message-name">
|
|
619
|
-
<h2>${AiAssistanceModel.AiUtils.isGeminiBranding() ? lockedString(UIStringsNotTranslate.gemini) : lockedString(UIStringsNotTranslate.ai)}</h2>
|
|
620
|
-
</div>
|
|
621
|
-
</div>`}
|
|
622
|
-
${hasAiV2 ? renderWalkthroughUI(input, steps) : Lit.nothing}
|
|
593
|
+
${renderWalkthroughUI(input, steps)}
|
|
623
594
|
<div class="answer-body-wrapper">
|
|
624
595
|
${Lit.Directives.repeat(
|
|
625
596
|
message.parts,
|
|
@@ -632,21 +603,13 @@ export const DEFAULT_VIEW = (input: ChatMessageViewInput, output: ViewOutput, ta
|
|
|
632
603
|
if (part.type === 'widget') {
|
|
633
604
|
return html`${Lit.Directives.until(renderWidgets(part.widgets, {wrapperClass: 'main-widgets-wrapper'}))}`;
|
|
634
605
|
}
|
|
635
|
-
if (!hasAiV2 && part.type === 'step') {
|
|
636
|
-
return renderStep({
|
|
637
|
-
step: part.step,
|
|
638
|
-
isLoading: input.isLoading,
|
|
639
|
-
markdownRenderer: input.markdownRenderer,
|
|
640
|
-
isLast: isLastPart,
|
|
641
|
-
});
|
|
642
|
-
}
|
|
643
606
|
return Lit.nothing;
|
|
644
607
|
},
|
|
645
608
|
)}
|
|
646
609
|
${renderError(message)}
|
|
647
610
|
${input.showActions ? renderActions(input, output) : Lit.nothing}
|
|
648
611
|
</div>
|
|
649
|
-
${
|
|
612
|
+
${renderSideEffectStepsUI(input, steps)}
|
|
650
613
|
</section>
|
|
651
614
|
`, target);
|
|
652
615
|
// clang-format on
|
|
@@ -688,7 +651,7 @@ export function titleForStep(step: Step): string {
|
|
|
688
651
|
}
|
|
689
652
|
|
|
690
653
|
function renderTitle(step: Step): Lit.LitTemplate {
|
|
691
|
-
const paused = step.requestApproval ?
|
|
654
|
+
const paused = step.requestApproval && !step.canceled ?
|
|
692
655
|
html`<span class="paused">${lockedString(UIStringsNotTranslate.paused)}: </span>` :
|
|
693
656
|
Lit.nothing;
|
|
694
657
|
|
|
@@ -916,13 +879,13 @@ function renderStepBadge({step, isLoading, isLast}: {
|
|
|
916
879
|
let iconName = 'checkmark';
|
|
917
880
|
let ariaLabel: string|undefined = lockedString(UIStringsNotTranslate.completed);
|
|
918
881
|
let role: 'button'|undefined = 'button';
|
|
919
|
-
if (
|
|
882
|
+
if (step.canceled) {
|
|
883
|
+
ariaLabel = lockedString(UIStringsNotTranslate.aborted);
|
|
884
|
+
iconName = 'cross';
|
|
885
|
+
} else if (isLast && step.requestApproval) {
|
|
920
886
|
role = undefined;
|
|
921
887
|
ariaLabel = lockedString(UIStringsNotTranslate.paused);
|
|
922
888
|
iconName = 'pause-circle';
|
|
923
|
-
} else if (step.canceled) {
|
|
924
|
-
ariaLabel = lockedString(UIStringsNotTranslate.aborted);
|
|
925
|
-
iconName = 'cross';
|
|
926
889
|
}
|
|
927
890
|
|
|
928
891
|
return html`<devtools-icon
|
|
@@ -942,7 +905,7 @@ export function renderStep({step, isLoading, markdownRenderer, isLast}: {
|
|
|
942
905
|
const stepClasses = Lit.Directives.classMap({
|
|
943
906
|
step: true,
|
|
944
907
|
empty: !step.thought && !step.code && !step.contextDetails && !step.requestApproval,
|
|
945
|
-
paused: Boolean(step.requestApproval),
|
|
908
|
+
paused: Boolean(step.requestApproval && !step.canceled),
|
|
946
909
|
canceled: Boolean(step.canceled),
|
|
947
910
|
});
|
|
948
911
|
// clang-format off
|
|
@@ -1724,7 +1687,7 @@ export function getDeduplicatedWidgetsMessage(message: ModelChatMessage): ModelC
|
|
|
1724
1687
|
|
|
1725
1688
|
async function renderWidgets(
|
|
1726
1689
|
widgets: AiWidget[]|undefined, options: {wrapperClass?: string} = {}): Promise<Lit.LitTemplate> {
|
|
1727
|
-
if (!
|
|
1690
|
+
if (!widgets || widgets.length === 0) {
|
|
1728
1691
|
return Lit.nothing;
|
|
1729
1692
|
}
|
|
1730
1693
|
const ui = await Promise.all(widgets.map(async widgetData => {
|
|
@@ -1792,7 +1755,7 @@ async function renderWidgets(
|
|
|
1792
1755
|
}
|
|
1793
1756
|
|
|
1794
1757
|
function renderSideEffectConfirmationUi(step: Step): Lit.LitTemplate {
|
|
1795
|
-
if (!step.requestApproval) {
|
|
1758
|
+
if (!step.requestApproval || step.canceled) {
|
|
1796
1759
|
return Lit.nothing;
|
|
1797
1760
|
}
|
|
1798
1761
|
|
|
@@ -1882,14 +1845,9 @@ function renderImageChatMessage(inlineData: Host.AidaClient.MediaBlob): Lit.LitT
|
|
|
1882
1845
|
}
|
|
1883
1846
|
|
|
1884
1847
|
function renderActions(input: ChatMessageViewInput, output: ViewOutput): Lit.LitTemplate {
|
|
1885
|
-
const aiAssistanceV2 = Root.Runtime.hostConfig.devToolsAiAssistanceV2?.enabled;
|
|
1886
|
-
const rowClasses = Lit.Directives.classMap({
|
|
1887
|
-
'ai-assistance-feedback-row': true,
|
|
1888
|
-
'not-v2': !aiAssistanceV2,
|
|
1889
|
-
});
|
|
1890
1848
|
// clang-format off
|
|
1891
1849
|
return html`
|
|
1892
|
-
<div class
|
|
1850
|
+
<div class="ai-assistance-feedback-row">
|
|
1893
1851
|
<div class="action-buttons">
|
|
1894
1852
|
${input.showRateButtons ? html`
|
|
1895
1853
|
<devtools-button
|
|
@@ -1918,7 +1876,6 @@ function renderActions(input: ChatMessageViewInput, output: ViewOutput): Lit.Lit
|
|
|
1918
1876
|
} as Buttons.Button.ButtonData}
|
|
1919
1877
|
@click=${() => input.onRatingClick(Host.AidaClient.Rating.NEGATIVE)}
|
|
1920
1878
|
></devtools-button>
|
|
1921
|
-
${aiAssistanceV2 ? Lit.nothing : html`<div class="vertical-separator"></div>`}
|
|
1922
1879
|
`: Lit.nothing}
|
|
1923
1880
|
<devtools-button
|
|
1924
1881
|
.data=${
|
|
@@ -1932,20 +1889,7 @@ function renderActions(input: ChatMessageViewInput, output: ViewOutput): Lit.Lit
|
|
|
1932
1889
|
}
|
|
1933
1890
|
@click=${input.onReportClick}
|
|
1934
1891
|
></devtools-button>
|
|
1935
|
-
${
|
|
1936
|
-
<div class="vertical-separator"></div>
|
|
1937
|
-
<devtools-button
|
|
1938
|
-
.data=${{
|
|
1939
|
-
variant: Buttons.Button.Variant.ICON,
|
|
1940
|
-
size: Buttons.Button.Size.SMALL,
|
|
1941
|
-
title: lockedString(UIStringsNotTranslate.copyResponse),
|
|
1942
|
-
iconName: 'copy',
|
|
1943
|
-
jslogContext: 'copy-ai-response',
|
|
1944
|
-
} as Buttons.Button.ButtonData}
|
|
1945
|
-
aria-label=${lockedString(UIStringsNotTranslate.copyResponse)}
|
|
1946
|
-
@click=${input.onCopyResponseClick}></devtools-button>
|
|
1947
|
-
`}
|
|
1948
|
-
${input.onExportClick && aiAssistanceV2 && input.isLastMessage ? html`
|
|
1892
|
+
${input.onExportClick && input.isLastMessage ? html`
|
|
1949
1893
|
<devtools-button
|
|
1950
1894
|
class="export-for-agents-button"
|
|
1951
1895
|
.jslogContext=${'ai-export-for-agents'}
|
|
@@ -7,7 +7,6 @@ import '../../../ui/components/spinners/spinners.js';
|
|
|
7
7
|
import * as Host from '../../../core/host/host.js';
|
|
8
8
|
import * as i18n from '../../../core/i18n/i18n.js';
|
|
9
9
|
import type * as Platform from '../../../core/platform/platform.js';
|
|
10
|
-
import * as Root from '../../../core/root/root.js';
|
|
11
10
|
import * as AiAssistanceModel from '../../../models/ai_assistance/ai_assistance.js';
|
|
12
11
|
import * as Buttons from '../../../ui/components/buttons/buttons.js';
|
|
13
12
|
import type {MarkdownLitRenderer} from '../../../ui/components/markdown_view/MarkdownView.js';
|
|
@@ -60,11 +59,17 @@ interface ViewOutput {
|
|
|
60
59
|
type View = (input: ChatWidgetInput, output: ViewOutput, target: HTMLElement|ShadowRoot) => void;
|
|
61
60
|
|
|
62
61
|
export interface Props {
|
|
63
|
-
onTextSubmit:
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
onTextSubmit: (
|
|
63
|
+
text: string,
|
|
64
|
+
imageInput?: Host.AidaClient.Part,
|
|
65
|
+
multimodalInputType?: AiAssistanceModel.AiAgent.MultimodalInputType,
|
|
66
|
+
) => void;
|
|
66
67
|
onInspectElementClick: () => void;
|
|
67
|
-
onFeedbackSubmit: (
|
|
68
|
+
onFeedbackSubmit: (
|
|
69
|
+
rpcId: Host.AidaClient.RpcGlobalId,
|
|
70
|
+
rate: Host.AidaClient.Rating,
|
|
71
|
+
feedback?: string,
|
|
72
|
+
) => void;
|
|
68
73
|
onCancelClick: () => void;
|
|
69
74
|
onContextClick: () => void;
|
|
70
75
|
onNewConversation: () => void;
|
|
@@ -87,6 +92,8 @@ export interface Props {
|
|
|
87
92
|
emptyStateSuggestions: AiAssistanceModel.AiAgent.ConversationSuggestion[];
|
|
88
93
|
inputPlaceholder: Platform.UIString.LocalizedString;
|
|
89
94
|
disclaimerText: Platform.UIString.LocalizedString;
|
|
95
|
+
textInputValue: string;
|
|
96
|
+
onTextChange: (text: string) => void;
|
|
90
97
|
uploadImageInputEnabled?: boolean;
|
|
91
98
|
markdownRenderer: MarkdownLitRenderer;
|
|
92
99
|
generateConversationSummary: (markdown: string) => Promise<string>;
|
|
@@ -108,12 +115,9 @@ export interface ChatWidgetInput extends Props {
|
|
|
108
115
|
}
|
|
109
116
|
|
|
110
117
|
const DEFAULT_VIEW: View = (input, output, target) => {
|
|
111
|
-
const hasAiV2 = Boolean(Root.Runtime.hostConfig.devToolsAiAssistanceV2?.enabled);
|
|
112
|
-
|
|
113
118
|
const chatUiClasses = classMap({
|
|
114
119
|
'chat-ui': true,
|
|
115
120
|
gemini: AiAssistanceModel.AiUtils.isGeminiBranding(),
|
|
116
|
-
'ai-v2': hasAiV2,
|
|
117
121
|
});
|
|
118
122
|
|
|
119
123
|
const inputWidgetClasses = classMap({
|
|
@@ -199,6 +203,8 @@ const DEFAULT_VIEW: View = (input, output, target) => {
|
|
|
199
203
|
conversationType: input.conversationType,
|
|
200
204
|
uploadImageInputEnabled: input.uploadImageInputEnabled ?? false,
|
|
201
205
|
isReadOnly: input.isReadOnly,
|
|
206
|
+
textInputValue: input.textInputValue,
|
|
207
|
+
onTextChange: input.onTextChange,
|
|
202
208
|
onContextClick: input.onContextClick,
|
|
203
209
|
onInspectElementClick: input.onInspectElementClick,
|
|
204
210
|
onTextSubmit: input.onTextSubmit,
|
|
@@ -16,11 +16,6 @@
|
|
|
16
16
|
overflow: hidden;
|
|
17
17
|
mask-image: linear-gradient(to right, var(--ref-palette-neutral0) calc(100% - var(--sys-size-15)), transparent 100%);
|
|
18
18
|
|
|
19
|
-
&.not-v2 {
|
|
20
|
-
/* Can be removed when AIv2 ships */
|
|
21
|
-
gap: var(--sys-size-8);
|
|
22
|
-
}
|
|
23
|
-
|
|
24
19
|
.action-buttons {
|
|
25
20
|
display: flex;
|
|
26
21
|
align-items: center;
|
|
@@ -144,10 +139,8 @@
|
|
|
144
139
|
font-size: 12px;
|
|
145
140
|
word-break: normal;
|
|
146
141
|
overflow-wrap: anywhere;
|
|
147
|
-
border-bottom: var(--sys-size-1) solid var(--sys-color-divider);
|
|
148
142
|
|
|
149
|
-
|
|
150
|
-
&.query.ai-v2 {
|
|
143
|
+
&.query {
|
|
151
144
|
width: fit-content;
|
|
152
145
|
max-width: 80%;
|
|
153
146
|
text-align: left;
|
|
@@ -165,22 +158,11 @@
|
|
|
165
158
|
}
|
|
166
159
|
}
|
|
167
160
|
|
|
168
|
-
&.ai-v2 {
|
|
169
|
-
border-bottom: none;
|
|
170
|
-
}
|
|
171
|
-
|
|
172
161
|
.ai-css-change {
|
|
173
162
|
margin: var(--sys-size-6) 0;
|
|
174
163
|
}
|
|
175
164
|
|
|
176
|
-
|
|
177
|
-
display: flex;
|
|
178
|
-
flex-direction: column;
|
|
179
|
-
gap: var(--sys-size-5);
|
|
180
|
-
width: 100%;
|
|
181
|
-
}
|
|
182
|
-
|
|
183
|
-
&.ai-v2 .answer-body-wrapper {
|
|
165
|
+
.answer-body-wrapper {
|
|
184
166
|
@container(min-width: 700px) {
|
|
185
167
|
/* Purposefully not using design system variables, this is a
|
|
186
168
|
* specific size to indent the content in and align it with the
|
|
@@ -1787,7 +1787,7 @@ export class DOMStorageTreeElement extends ApplicationPanelTreeElement {
|
|
|
1787
1787
|
this.listItemElement.addEventListener('contextmenu', this.handleContextMenuEvent.bind(this), true);
|
|
1788
1788
|
const storageItem = this.#getStorageItem();
|
|
1789
1789
|
if (storageItem) {
|
|
1790
|
-
this.createAiButton(
|
|
1790
|
+
this.createAiButton(() => this.#getStorageItem());
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
1793
1793
|
|
|
@@ -1910,7 +1910,7 @@ export class CookieTreeElement extends ApplicationPanelTreeElement {
|
|
|
1910
1910
|
this.listItemElement.addEventListener('contextmenu', this.handleContextMenuEvent.bind(this), true);
|
|
1911
1911
|
const storageItem = this.#getStorageItem();
|
|
1912
1912
|
if (storageItem) {
|
|
1913
|
-
this.createAiButton(
|
|
1913
|
+
this.createAiButton(() => this.#getStorageItem());
|
|
1914
1914
|
}
|
|
1915
1915
|
}
|
|
1916
1916
|
|
|
@@ -8,6 +8,7 @@ import '../../ui/components/buttons/buttons.js';
|
|
|
8
8
|
|
|
9
9
|
import * as Common from '../../core/common/common.js';
|
|
10
10
|
import type * as Platform from '../../core/platform/platform.js';
|
|
11
|
+
import * as SDK from '../../core/sdk/sdk.js';
|
|
11
12
|
import * as AiAssistance from '../../models/ai_assistance/ai_assistance.js';
|
|
12
13
|
import * as UI from '../../ui/legacy/legacy.js';
|
|
13
14
|
import * as Lit from '../../ui/lit/lit.js';
|
|
@@ -66,7 +67,14 @@ export class ApplicationPanelTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
66
67
|
this.resourcesPanel.showView(view);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
|
-
|
|
70
|
+
/**
|
|
71
|
+
* Creates the Ask-AI floating button on this tree element.
|
|
72
|
+
* @param storageItemProvider A provider function returning the StorageItem context.
|
|
73
|
+
* Using a function provider allows dynamic context resolution at click time
|
|
74
|
+
* (e.g. for category headers that aren't recreated (e.g. Local Storage) whose target origin may change), while supporting
|
|
75
|
+
* static contexts for individual leaf items under these general category headers.
|
|
76
|
+
*/
|
|
77
|
+
protected createAiButton(storageItemProvider: () => AiAssistance.StorageItem.StorageItem | null): void {
|
|
70
78
|
const STORAGE_FLOATING_BUTTON_ACTION_ID = 'ai-assistance.storage-floating-button';
|
|
71
79
|
const actionRegistry = UI.ActionRegistry.ActionRegistry.instance();
|
|
72
80
|
if (!actionRegistry.hasAction(STORAGE_FLOATING_BUTTON_ACTION_ID)) {
|
|
@@ -78,11 +86,15 @@ export class ApplicationPanelTreeElement extends UI.TreeOutline.TreeElement {
|
|
|
78
86
|
const icon = AiAssistance.AiUtils.getIconName();
|
|
79
87
|
const onClick = (ev: Event): void => {
|
|
80
88
|
ev.stopPropagation();
|
|
81
|
-
|
|
82
|
-
|
|
89
|
+
const item = storageItemProvider();
|
|
90
|
+
if (item) {
|
|
91
|
+
UI.Context.Context.instance().setFlavor(AiAssistance.StorageItem.StorageItem, item);
|
|
92
|
+
void action.execute();
|
|
93
|
+
}
|
|
83
94
|
};
|
|
84
95
|
|
|
85
96
|
// clang-format off
|
|
97
|
+
|
|
86
98
|
Lit.render(html`
|
|
87
99
|
<devtools-floating-button
|
|
88
100
|
icon-name=${icon}
|
|
@@ -106,11 +118,13 @@ export class ExpandableApplicationPanelTreeElement extends ApplicationPanelTreeE
|
|
|
106
118
|
// in the Application Panel.
|
|
107
119
|
protected emptyCategoryHeadline: string;
|
|
108
120
|
protected categoryDescription: string;
|
|
121
|
+
protected readonly settingsKey: string;
|
|
109
122
|
|
|
110
123
|
constructor(
|
|
111
124
|
resourcesPanel: ResourcesPanel, categoryName: string, emptyCategoryHeadline: string, categoryDescription: string,
|
|
112
125
|
settingsKey: string, settingsDefault = false) {
|
|
113
126
|
super(resourcesPanel, categoryName, false, settingsKey);
|
|
127
|
+
this.settingsKey = settingsKey;
|
|
114
128
|
this.expandedSetting =
|
|
115
129
|
Common.Settings.Settings.instance().createSetting('resources-' + settingsKey + '-expanded', settingsDefault);
|
|
116
130
|
this.categoryName = categoryName;
|
|
@@ -119,6 +133,25 @@ export class ExpandableApplicationPanelTreeElement extends ApplicationPanelTreeE
|
|
|
119
133
|
this.categoryDescription = categoryDescription;
|
|
120
134
|
}
|
|
121
135
|
|
|
136
|
+
protected createGenericStorageAiContext(): AiAssistance.StorageItem.StorageItem|null {
|
|
137
|
+
const target = SDK.TargetManager.TargetManager.instance().primaryPageTarget();
|
|
138
|
+
const mainPageOrigin =
|
|
139
|
+
target?.inspectedURL() ? Common.ParsedURL.ParsedURL.extractOrigin(target.inspectedURL()) : '';
|
|
140
|
+
if (!mainPageOrigin) {
|
|
141
|
+
return null;
|
|
142
|
+
}
|
|
143
|
+
if (this.settingsKey === 'cookies') {
|
|
144
|
+
return AiAssistance.StorageItem.CookieItem.createGenericContext(mainPageOrigin);
|
|
145
|
+
}
|
|
146
|
+
if (this.settingsKey === 'local-storage') {
|
|
147
|
+
return AiAssistance.StorageItem.DOMStorageItem.createGenericContext(mainPageOrigin, 'localStorage');
|
|
148
|
+
}
|
|
149
|
+
if (this.settingsKey === 'session-storage') {
|
|
150
|
+
return AiAssistance.StorageItem.DOMStorageItem.createGenericContext(mainPageOrigin, 'sessionStorage');
|
|
151
|
+
}
|
|
152
|
+
return null;
|
|
153
|
+
}
|
|
154
|
+
|
|
122
155
|
override get itemURL(): Platform.DevToolsPath.UrlString {
|
|
123
156
|
return 'category://' + this.categoryName as Platform.DevToolsPath.UrlString;
|
|
124
157
|
}
|
|
@@ -134,6 +167,8 @@ export class ExpandableApplicationPanelTreeElement extends ApplicationPanelTreeE
|
|
|
134
167
|
override onselect(selectedByUser: boolean|undefined): boolean {
|
|
135
168
|
super.onselect(selectedByUser);
|
|
136
169
|
this.updateCategoryView();
|
|
170
|
+
const item = this.createGenericStorageAiContext();
|
|
171
|
+
UI.Context.Context.instance().setFlavor(AiAssistance.StorageItem.StorageItem, item);
|
|
137
172
|
return false;
|
|
138
173
|
}
|
|
139
174
|
|
|
@@ -165,6 +200,9 @@ export class ExpandableApplicationPanelTreeElement extends ApplicationPanelTreeE
|
|
|
165
200
|
if (this.expandedSetting.get()) {
|
|
166
201
|
this.expand();
|
|
167
202
|
}
|
|
203
|
+
if (this.createGenericStorageAiContext()) {
|
|
204
|
+
this.createAiButton(() => this.createGenericStorageAiContext());
|
|
205
|
+
}
|
|
168
206
|
}
|
|
169
207
|
|
|
170
208
|
override onexpand(): void {
|