@codingame/monaco-vscode-chat-service-override 34.1.3 → 35.0.0
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/index.js +38 -0
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.js +40 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +27 -0
- package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +91 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +20 -4
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +148 -15
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +9 -1
- package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +57 -3
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +10 -14
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +29 -8
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +109 -2
- package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +207 -21
- package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +362 -37
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +698 -91
- package/vscode/src/vs/platform/agentHost/common/agentService.js +46 -3
- package/vscode/src/vs/platform/agentHost/common/customAgents.js +1 -0
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.d.ts +1 -0
- package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.js +26 -0
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +5 -5
- package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +17 -17
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +96 -12
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +226 -19
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.d.ts +18 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +89 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +10 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.d.ts +6 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +400 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +129 -446
- package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +2 -2
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +35 -25
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +7 -1
- package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.d.ts +4 -0
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +1 -0
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +0 -6
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.js +5 -18
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +52 -3
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +212 -34
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +3 -4
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +11 -10
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +13 -6
- package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +6 -1
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +399 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +85 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +177 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +898 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +204 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +61 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +338 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +57 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +98 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +149 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +116 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +226 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +138 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +25 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +108 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +63 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +178 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +322 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.js +15 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.js +26 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +132 -0
- package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +237 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +32 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +71 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +6 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +19 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +14 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +66 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +128 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +58 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +15 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +64 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +45 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +25 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +143 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +7 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +163 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +26 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +106 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +16 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +44 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.d.ts +27 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.js +152 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +11 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +9 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +143 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +6 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +107 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +46 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +19 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +244 -190
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +13 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +7 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +47 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +4 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.d.ts +87 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.js +772 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +24 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +3 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.d.ts +42 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +94 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +421 -201
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +1426 -97
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +107 -127
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +331 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +120 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +898 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +581 -336
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +567 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +168 -84
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +183 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +897 -251
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.d.ts +213 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +720 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +33 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +354 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +11 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +55 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +18 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +192 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +37 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +40 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +230 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +23 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +35 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +26 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +56 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +109 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +38 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +175 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +32 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +183 -84
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +20 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.d.ts +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +40 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +169 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.d.ts +125 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.js +399 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +198 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +85 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +504 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.d.ts +321 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.js +2117 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.d.ts +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.js +367 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +16 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +68 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +11 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +13 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +23 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +320 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +80 -4
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automation.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.d.ts +13 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +226 -88
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +8 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +13 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +12 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +177 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -18
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +78 -136
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +1 -16
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +1 -17
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +16 -5
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +31 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +122 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +24 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +113 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +227 -152
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +98 -0
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +7 -6
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +11 -12
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +7 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +32 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +23 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +37 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +7 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.js +71 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +29 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +7 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +10 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +26 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +32 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +416 -252
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +3 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +2 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +5 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +25 -8
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +8 -3
- package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -77
- package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.js +0 -82
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -47
- /package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.js +0 -0
package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js
CHANGED
|
@@ -3,6 +3,7 @@ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib
|
|
|
3
3
|
import { $ as $$1, append, hide, show, clearNode, addDisposableListener, EventType, createTextNode } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
4
4
|
import { Sash, Orientation, SashState } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/sash/sash';
|
|
5
5
|
import { BreadcrumbsWidget } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/breadcrumbs/breadcrumbsWidget';
|
|
6
|
+
import { toAction, Separator } from '@codingame/monaco-vscode-api/vscode/vs/base/common/actions';
|
|
6
7
|
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
7
8
|
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
8
9
|
import { safeIntl } from '@codingame/monaco-vscode-api/vscode/vs/base/common/date';
|
|
@@ -10,12 +11,14 @@ import { equals } from '@codingame/monaco-vscode-api/vscode/vs/base/common/objec
|
|
|
10
11
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
11
12
|
import { Disposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
12
13
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
14
|
+
import { IContextMenuService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextview/browser/contextView.service';
|
|
13
15
|
import { defaultBreadcrumbsWidgetStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
14
16
|
import { linesDiffComputers } from '@codingame/monaco-vscode-api/vscode/vs/editor/common/diff/linesDiffComputers';
|
|
15
17
|
import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
|
|
16
18
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
17
19
|
import { LocalChatSessionUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
18
20
|
import { diffPromptSignature, appendToolsDrift, appendSystemDrift, parseInputMessages, CacheDiffKind } from './chatDebugCacheDiff.js';
|
|
21
|
+
import { primaryInsight, computeCacheInsights, categorizeCacheBreak, buildSessionCacheReport, cacheBreakCategoryLabel, maxInsightSeverity, analyzeStringDivergence, describeStringDivergence, CacheBreakCategory, CacheInsightSeverity } from './chatDebugCacheInsights.js';
|
|
19
22
|
import { setupBreadcrumbKeyboardNavigation, TextBreadcrumbItem } from './chatDebugTypes.js';
|
|
20
23
|
|
|
21
24
|
const $ = $$1;
|
|
@@ -29,22 +32,31 @@ const RAIL_DEFAULT_WIDTH = 280;
|
|
|
29
32
|
const RAIL_MIN_WIDTH = 180;
|
|
30
33
|
const RAIL_MAX_WIDTH = 600;
|
|
31
34
|
const CURRENT_CONTINUATION_DELTA_COMPONENT = "current continuation delta";
|
|
35
|
+
const TTL_GAP_MINUTES = 5;
|
|
36
|
+
const DEFAULT_AGENT_KEY = "panel/editAgent";
|
|
32
37
|
var CacheExplorerNavigation;
|
|
33
38
|
(function(CacheExplorerNavigation) {
|
|
34
39
|
CacheExplorerNavigation["Home"] = "home";
|
|
35
40
|
CacheExplorerNavigation["Overview"] = "overview";
|
|
36
41
|
})(CacheExplorerNavigation || (CacheExplorerNavigation = {}));
|
|
37
42
|
let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Disposable {
|
|
38
|
-
constructor(parent, chatService, chatDebugService) {
|
|
43
|
+
constructor(parent, chatService, chatDebugService, contextMenuService) {
|
|
39
44
|
super();
|
|
40
45
|
this.chatService = chatService;
|
|
41
46
|
this.chatDebugService = chatDebugService;
|
|
47
|
+
this.contextMenuService = contextMenuService;
|
|
42
48
|
this._onNavigate = this._register(( new Emitter()));
|
|
43
49
|
this.onNavigate = this._onNavigate.event;
|
|
44
50
|
this.railWidth = RAIL_DEFAULT_WIDTH;
|
|
45
|
-
this.
|
|
51
|
+
this.railDisposables = this._register(( new DisposableStore()));
|
|
52
|
+
this.contentDisposables = this._register(( new DisposableStore()));
|
|
53
|
+
this.allModelTurns = [];
|
|
46
54
|
this.modelTurns = [];
|
|
47
55
|
this.selectedIndex = -1;
|
|
56
|
+
this.sigBreakdownOpen = false;
|
|
57
|
+
this.railRowsByIndex = ( new Map());
|
|
58
|
+
this.componentElements = ( new Map());
|
|
59
|
+
this.autoOpenedForIndex = -1;
|
|
48
60
|
this.renderToken = 0;
|
|
49
61
|
this.resolvedCache = ( new Map());
|
|
50
62
|
this.openComponents = ( new Set(["system", "tools"]));
|
|
@@ -77,6 +89,7 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
77
89
|
const body = append(this.container, $(".chat-debug-cache-body"));
|
|
78
90
|
this.rail = append(body, $(".chat-debug-cache-rail"));
|
|
79
91
|
this.rail.style.width = `${this.railWidth}px`;
|
|
92
|
+
this.railToolbar = append(this.rail, $(".chat-debug-cache-rail-toolbar"));
|
|
80
93
|
this.railList = append(this.rail, $(".chat-debug-cache-rail-list"));
|
|
81
94
|
this.content = append(body, $(".chat-debug-cache-content"));
|
|
82
95
|
this.sash = this._register(( new Sash(body, {
|
|
@@ -111,6 +124,11 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
111
124
|
this.openComponents.add("system");
|
|
112
125
|
this.openComponents.add("tools");
|
|
113
126
|
this.selectedIndex = -1;
|
|
127
|
+
this.selectedAgents = undefined;
|
|
128
|
+
this.pendingSelectTurn = undefined;
|
|
129
|
+
this.sigBreakdownOpen = false;
|
|
130
|
+
this.autoOpenedForIndex = -1;
|
|
131
|
+
this.sessionReportCache = undefined;
|
|
114
132
|
}
|
|
115
133
|
this.currentSessionResource = sessionResource;
|
|
116
134
|
}
|
|
@@ -132,52 +150,442 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
132
150
|
return;
|
|
133
151
|
}
|
|
134
152
|
const sessionTitle = this.chatService.getSessionTitle(this.currentSessionResource) || LocalChatSessionUri.parseLocalSessionId(this.currentSessionResource) || ( this.currentSessionResource.toString());
|
|
135
|
-
this.breadcrumbWidget.setItems([( new TextBreadcrumbItem(( localize(
|
|
153
|
+
this.breadcrumbWidget.setItems([( new TextBreadcrumbItem(( localize(6556, "Agent Debug Logs")), true)), ( new TextBreadcrumbItem(sessionTitle, true)), ( new TextBreadcrumbItem(( localize(6557, "Cache Explorer"))))]);
|
|
136
154
|
}
|
|
137
155
|
async render() {
|
|
138
156
|
const token = ++this.renderToken;
|
|
139
157
|
const isCurrent = () => token === this.renderToken;
|
|
158
|
+
const railScrollTop = this.railList.scrollTop;
|
|
140
159
|
this.updateBreadcrumb();
|
|
141
|
-
this.
|
|
160
|
+
this.railDisposables.clear();
|
|
161
|
+
clearNode(this.railToolbar);
|
|
142
162
|
clearNode(this.railList);
|
|
143
|
-
|
|
163
|
+
this.railRowsByIndex.clear();
|
|
144
164
|
if (!this.currentSessionResource) {
|
|
165
|
+
this.contentDisposables.clear();
|
|
166
|
+
clearNode(this.content);
|
|
145
167
|
return;
|
|
146
168
|
}
|
|
147
169
|
const events = this.chatDebugService.getEvents(this.currentSessionResource);
|
|
148
|
-
this.
|
|
170
|
+
this.allModelTurns = events.filter(e => e.kind === "modelTurn");
|
|
149
171
|
const userMessages = events.filter(e => e.kind === "userMessage");
|
|
172
|
+
if (this.allModelTurns.length === 0) {
|
|
173
|
+
this.contentDisposables.clear();
|
|
174
|
+
clearNode(this.content);
|
|
175
|
+
const empty = append(this.content, $(".chat-debug-cache-empty"));
|
|
176
|
+
empty.textContent = ( localize(6558, "No model turns recorded for this session yet."));
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
const agentCounts = computeAgentCounts(this.allModelTurns);
|
|
180
|
+
if (this.selectedAgents === undefined) {
|
|
181
|
+
this.selectedAgents = defaultAgentSelection(agentCounts);
|
|
182
|
+
}
|
|
183
|
+
this.renderRailToolbar(agentCounts);
|
|
184
|
+
this.modelTurns = this.allModelTurns.filter(t => ( this.selectedAgents.has(agentKey(t))));
|
|
150
185
|
if (this.modelTurns.length === 0) {
|
|
186
|
+
this.contentDisposables.clear();
|
|
187
|
+
clearNode(this.content);
|
|
151
188
|
const empty = append(this.content, $(".chat-debug-cache-empty"));
|
|
152
|
-
empty.textContent = ( localize(
|
|
189
|
+
empty.textContent = ( localize(6559, "No model turns match the selected agent filter."));
|
|
153
190
|
return;
|
|
154
191
|
}
|
|
192
|
+
if (this.pendingSelectTurn) {
|
|
193
|
+
this.selectedIndex = resolveFilteredSelectionIndex(this.modelTurns, this.pendingSelectTurn);
|
|
194
|
+
this.pendingSelectTurn = undefined;
|
|
195
|
+
}
|
|
155
196
|
if (this.selectedIndex < 0 || this.selectedIndex >= this.modelTurns.length) {
|
|
156
197
|
this.selectedIndex = this.modelTurns.length - 1;
|
|
157
198
|
}
|
|
158
199
|
this.renderRail(buildTurnGroups(this.modelTurns, userMessages));
|
|
159
|
-
this.
|
|
200
|
+
this.railList.scrollTop = railScrollTop;
|
|
201
|
+
await this.renderContentInner(token, isCurrent);
|
|
202
|
+
}
|
|
203
|
+
async renderContentInner(token, isCurrent, preserveScroll = false) {
|
|
204
|
+
const prevScroll = preserveScroll ? this.content.scrollTop : 0;
|
|
160
205
|
const bEvent = this.modelTurns[this.selectedIndex];
|
|
161
206
|
const aEvent = this.selectedIndex > 0 ? this.modelTurns[this.selectedIndex - 1] : undefined;
|
|
207
|
+
const report = await this.ensureSessionReport();
|
|
208
|
+
if (!isCurrent()) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
162
211
|
if (!aEvent) {
|
|
163
212
|
const b = await this.resolveSide(bEvent);
|
|
164
213
|
if (!isCurrent()) {
|
|
165
214
|
return;
|
|
166
215
|
}
|
|
216
|
+
this.contentDisposables.clear();
|
|
217
|
+
clearNode(this.content);
|
|
218
|
+
this.renderTitleRow();
|
|
167
219
|
this.renderSingleSummary(b);
|
|
220
|
+
if (preserveScroll) {
|
|
221
|
+
this.content.scrollTop = prevScroll;
|
|
222
|
+
}
|
|
168
223
|
return;
|
|
169
224
|
}
|
|
170
225
|
const [a, b] = await Promise.all([this.resolveSide(aEvent), this.resolveSide(bEvent)]);
|
|
171
226
|
if (!isCurrent()) {
|
|
172
227
|
return;
|
|
173
228
|
}
|
|
229
|
+
this.contentDisposables.clear();
|
|
230
|
+
clearNode(this.content);
|
|
231
|
+
this.renderTitleRow();
|
|
232
|
+
if (report && report.pairCount > 0) {
|
|
233
|
+
this.renderSessionHealth(append(this.content, $(".chat-debug-cache-session-health")), report);
|
|
234
|
+
}
|
|
174
235
|
const compareInputMessages = shouldCompareInputMessages(a, b);
|
|
175
236
|
const diff = compareInputMessages ? diffPromptSignature(a.inputMessages, b.inputMessages) : diffPromptSignature([], []);
|
|
176
237
|
const drift = appendToolsDrift(appendSystemDrift([...diff.drift], a.system, b.system), a.tools, b.tools);
|
|
177
|
-
|
|
238
|
+
const {
|
|
239
|
+
insights,
|
|
240
|
+
optionsDiff
|
|
241
|
+
} = this.buildInsights(a, b, diff, compareInputMessages);
|
|
242
|
+
if (this.autoOpenedForIndex !== this.selectedIndex) {
|
|
243
|
+
this.autoOpenedForIndex = this.selectedIndex;
|
|
244
|
+
const target = primaryInsight(insights)?.component;
|
|
245
|
+
if (target) {
|
|
246
|
+
this.openComponents.add(target);
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
this.renderSummary(a, b, diff, compareInputMessages, insights, optionsDiff);
|
|
178
250
|
this.renderSignature(a, b, diff, compareInputMessages);
|
|
179
251
|
this.renderRequestOptions(a, b);
|
|
180
|
-
this.renderComponents(drift, a, b, compareInputMessages);
|
|
252
|
+
this.renderComponents(drift, a, b, compareInputMessages, diff.counts.identical);
|
|
253
|
+
if (preserveScroll) {
|
|
254
|
+
this.content.scrollTop = prevScroll;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
buildInsights(a, b, diff, compareInputMessages) {
|
|
258
|
+
const optionsDiff = computeOptionsDiff(a, b);
|
|
259
|
+
const minutesSincePrevious = (b.event.created.getTime() - a.event.created.getTime()) / 60_000;
|
|
260
|
+
const insights = computeCacheInsights({
|
|
261
|
+
aModel: a.event.model,
|
|
262
|
+
bModel: b.event.model,
|
|
263
|
+
aSystem: a.system,
|
|
264
|
+
bSystem: b.system,
|
|
265
|
+
aTools: a.tools,
|
|
266
|
+
bTools: b.tools,
|
|
267
|
+
aMessages: a.inputMessages,
|
|
268
|
+
bMessages: b.inputMessages,
|
|
269
|
+
diff,
|
|
270
|
+
optionsDiff: ( optionsDiff.map(d => ({
|
|
271
|
+
key: d.key,
|
|
272
|
+
previousLabel: formatOptionValue(d.previous),
|
|
273
|
+
currentLabel: formatOptionValue(d.current)
|
|
274
|
+
}))),
|
|
275
|
+
hitPct: computeCacheHit(b.event),
|
|
276
|
+
inputTokens: b.event.inputTokens ?? 0,
|
|
277
|
+
minutesSincePrevious: Number.isFinite(minutesSincePrevious) && minutesSincePrevious >= 0 ? minutesSincePrevious : undefined,
|
|
278
|
+
isContinuation: b.requestShape.isContinuation,
|
|
279
|
+
previousIsContinuation: a.requestShape.isContinuation,
|
|
280
|
+
compareInputMessages
|
|
281
|
+
});
|
|
282
|
+
return {
|
|
283
|
+
insights,
|
|
284
|
+
optionsDiff
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
sessionReportKey() {
|
|
288
|
+
if (!this.currentSessionResource || this.selectedIndex < 1) {
|
|
289
|
+
return undefined;
|
|
290
|
+
}
|
|
291
|
+
const parts = [( this.currentSessionResource.toString()), [...(this.selectedAgents ?? [])].sort().join(",")];
|
|
292
|
+
for (let i = 0; i <= this.selectedIndex; i++) {
|
|
293
|
+
const turn = this.modelTurns[i];
|
|
294
|
+
parts.push(
|
|
295
|
+
`${turn.id ?? turn.created.getTime()}:${turn.inputTokens ?? ""}:${turn.cachedTokens ?? ""}`
|
|
296
|
+
);
|
|
297
|
+
}
|
|
298
|
+
return parts.join("|");
|
|
299
|
+
}
|
|
300
|
+
async ensureSessionReport() {
|
|
301
|
+
const key = this.sessionReportKey();
|
|
302
|
+
if (key === undefined) {
|
|
303
|
+
return undefined;
|
|
304
|
+
}
|
|
305
|
+
const cached = this.sessionReportCache?.key === key ? this.sessionReportCache.report : undefined;
|
|
306
|
+
if (cached) {
|
|
307
|
+
return cached;
|
|
308
|
+
}
|
|
309
|
+
const scopedTurns = this.modelTurns.slice(0, this.selectedIndex + 1);
|
|
310
|
+
const sides = await Promise.all(( scopedTurns.map(t => this.resolveSide(t))));
|
|
311
|
+
const pairs = [];
|
|
312
|
+
for (let i = 1; i < sides.length; i++) {
|
|
313
|
+
const a = sides[i - 1];
|
|
314
|
+
const b = sides[i];
|
|
315
|
+
const compare = shouldCompareInputMessages(a, b);
|
|
316
|
+
const diff = compare ? diffPromptSignature(a.inputMessages, b.inputMessages) : diffPromptSignature([], []);
|
|
317
|
+
const {
|
|
318
|
+
insights
|
|
319
|
+
} = this.buildInsights(a, b, diff, compare);
|
|
320
|
+
const inputTokens = b.event.inputTokens ?? 0;
|
|
321
|
+
const cachedTokens = b.event.cachedTokens ?? 0;
|
|
322
|
+
pairs.push({
|
|
323
|
+
turnIndex: i,
|
|
324
|
+
category: categorizeCacheBreak(insights),
|
|
325
|
+
lostTokens: Math.max(0, inputTokens - cachedTokens)
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
const turnTokens = ( scopedTurns.map(t => ({
|
|
329
|
+
inputTokens: t.inputTokens ?? 0,
|
|
330
|
+
cachedTokens: t.cachedTokens ?? 0
|
|
331
|
+
})));
|
|
332
|
+
const report = buildSessionCacheReport(pairs, turnTokens);
|
|
333
|
+
this.sessionReportCache = {
|
|
334
|
+
key,
|
|
335
|
+
report
|
|
336
|
+
};
|
|
337
|
+
return report;
|
|
338
|
+
}
|
|
339
|
+
renderSessionHealth(container, report) {
|
|
340
|
+
append(container, $(".chat-debug-cache-card-h", undefined, ( localize(6560, "Session cache health"))));
|
|
341
|
+
if (report.overall) {
|
|
342
|
+
const headline = append(container, $(".chat-debug-cache-card-headline"));
|
|
343
|
+
headline.textContent = ( localize(6561, "{0}% overall cache hit", formatCachePct(report.overall.hitPct)));
|
|
344
|
+
const sub = append(container, $(".chat-debug-cache-card-sub"));
|
|
345
|
+
sub.textContent = ( localize(
|
|
346
|
+
6562,
|
|
347
|
+
"{0} of {1} input tokens served from cache across {2} requests (token-weighted)",
|
|
348
|
+
numberFormatter.value.format(report.overall.cachedTokens),
|
|
349
|
+
numberFormatter.value.format(report.overall.inputTokens),
|
|
350
|
+
report.overall.turnCount
|
|
351
|
+
));
|
|
352
|
+
}
|
|
353
|
+
const statsLine = append(container, $(".chat-debug-cache-session-health-stats"));
|
|
354
|
+
statsLine.textContent = report.avoidableLostTokens > 0 ? ( localize(
|
|
355
|
+
6563,
|
|
356
|
+
"{0} of {1} request pairs healthy · ~{2} tokens recomputed avoidably",
|
|
357
|
+
report.healthyCount,
|
|
358
|
+
report.pairCount,
|
|
359
|
+
numberFormatter.value.format(report.avoidableLostTokens)
|
|
360
|
+
)) : ( localize(
|
|
361
|
+
6564,
|
|
362
|
+
"{0} of {1} request pairs healthy",
|
|
363
|
+
report.healthyCount,
|
|
364
|
+
report.pairCount
|
|
365
|
+
));
|
|
366
|
+
if (report.byCategory.length > 0) {
|
|
367
|
+
const chips = append(container, $(".chat-debug-cache-session-health-chips"));
|
|
368
|
+
for (const stat of report.byCategory) {
|
|
369
|
+
const chip = append(
|
|
370
|
+
chips,
|
|
371
|
+
$(`span.chat-debug-cache-session-health-chip.cause-${stat.category}`)
|
|
372
|
+
);
|
|
373
|
+
append(chip, $(`span.codicon.codicon-${categoryIcon(stat.category)}`, {
|
|
374
|
+
"aria-hidden": "true"
|
|
375
|
+
}));
|
|
376
|
+
append(chip, $("span", undefined, ( localize(
|
|
377
|
+
6565,
|
|
378
|
+
"{0} ×{1} · {2} tok",
|
|
379
|
+
cacheBreakCategoryLabel(stat.category),
|
|
380
|
+
stat.count,
|
|
381
|
+
numberFormatter.value.format(stat.lostTokens)
|
|
382
|
+
))));
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
if (report.findings.length > 0) {
|
|
386
|
+
const list = append(container, $(".chat-debug-cache-findings"));
|
|
387
|
+
for (const finding of report.findings) {
|
|
388
|
+
this.renderFinding(list, finding);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
selectTurn(index, focusOptions) {
|
|
393
|
+
if (index < 0 || index >= this.modelTurns.length || index === this.selectedIndex) {
|
|
394
|
+
return;
|
|
395
|
+
}
|
|
396
|
+
const prevRow = this.railRowsByIndex.get(this.selectedIndex);
|
|
397
|
+
if (prevRow) {
|
|
398
|
+
prevRow.classList.remove("is-selected");
|
|
399
|
+
prevRow.removeAttribute("aria-current");
|
|
400
|
+
}
|
|
401
|
+
this.selectedIndex = index;
|
|
402
|
+
const nextRow = this.railRowsByIndex.get(index);
|
|
403
|
+
if (nextRow) {
|
|
404
|
+
nextRow.classList.add("is-selected");
|
|
405
|
+
nextRow.setAttribute("aria-current", "true");
|
|
406
|
+
if (focusOptions) {
|
|
407
|
+
nextRow.focus(focusOptions);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
const token = ++this.renderToken;
|
|
411
|
+
void this.renderContentInner(token, () => token === this.renderToken);
|
|
412
|
+
}
|
|
413
|
+
moveSelection(delta) {
|
|
414
|
+
const indices = [...( this.railRowsByIndex.keys())];
|
|
415
|
+
if (indices.length === 0) {
|
|
416
|
+
return;
|
|
417
|
+
}
|
|
418
|
+
const pos = indices.indexOf(this.selectedIndex);
|
|
419
|
+
const nextPos = pos === -1 ? (delta > 0 ? 0 : indices.length - 1) : Math.min(indices.length - 1, Math.max(0, pos + delta));
|
|
420
|
+
this.selectTurn(indices[nextPos], {
|
|
421
|
+
preventScroll: false
|
|
422
|
+
});
|
|
423
|
+
}
|
|
424
|
+
renderRailToolbar(agentCounts) {
|
|
425
|
+
const agents = [...( agentCounts.keys())];
|
|
426
|
+
if (agents.length <= 1) {
|
|
427
|
+
hide(this.railToolbar);
|
|
428
|
+
return;
|
|
429
|
+
}
|
|
430
|
+
show(this.railToolbar);
|
|
431
|
+
const selected = this.selectedAgents ?? ( new Set(agents));
|
|
432
|
+
const selectedCount = agents.filter(a => ( selected.has(a))).length;
|
|
433
|
+
const label = append(this.railToolbar, $("span.chat-debug-cache-filter-label"));
|
|
434
|
+
label.textContent = ( localize(6566, "Agent"));
|
|
435
|
+
const button = append(this.railToolbar, $("button.chat-debug-cache-filter-button"));
|
|
436
|
+
button.setAttribute("aria-haspopup", "menu");
|
|
437
|
+
const summary = selectedCount === agents.length ? ( localize(6567, "All agents ({0})", agents.length)) : selectedCount === 1 ? agents.find(a => ( selected.has(a))) ?? "" : ( localize(6568, "{0} of {1} agents", selectedCount, agents.length));
|
|
438
|
+
const text = append(button, $("span.chat-debug-cache-filter-button-text"));
|
|
439
|
+
text.textContent = summary;
|
|
440
|
+
text.title = summary;
|
|
441
|
+
append(
|
|
442
|
+
button,
|
|
443
|
+
$("span.codicon.codicon-chevron-down.chat-debug-cache-filter-chevron", {
|
|
444
|
+
"aria-hidden": "true"
|
|
445
|
+
})
|
|
446
|
+
);
|
|
447
|
+
this.railDisposables.add(addDisposableListener(
|
|
448
|
+
button,
|
|
449
|
+
EventType.CLICK,
|
|
450
|
+
() => this.showAgentFilterMenu(button, agentCounts)
|
|
451
|
+
));
|
|
452
|
+
}
|
|
453
|
+
showAgentFilterMenu(anchor, agentCounts) {
|
|
454
|
+
const agents = [...( agentCounts.keys())].sort((a, b) => a.localeCompare(b));
|
|
455
|
+
const selected = this.selectedAgents ?? ( new Set(agents));
|
|
456
|
+
const agentActions = ( agents.map(agent => toAction({
|
|
457
|
+
id: `chatDebug.cache.agent.${agent}`,
|
|
458
|
+
label: ( localize(6569, "{0} ({1})", agent, agentCounts.get(agent) ?? 0)),
|
|
459
|
+
checked: ( selected.has(agent)),
|
|
460
|
+
run: () => this.toggleAgent(agent)
|
|
461
|
+
})));
|
|
462
|
+
const selectAll = toAction({
|
|
463
|
+
id: "chatDebug.cache.agentSelectAll",
|
|
464
|
+
label: ( localize(6570, "Show All Agents")),
|
|
465
|
+
run: () => this.setAgentSelection(( new Set(agents)))
|
|
466
|
+
});
|
|
467
|
+
this.contextMenuService.showContextMenu({
|
|
468
|
+
getAnchor: () => anchor,
|
|
469
|
+
getActions: () => [selectAll, ( new Separator()), ...agentActions]
|
|
470
|
+
});
|
|
471
|
+
}
|
|
472
|
+
toggleAgent(agent) {
|
|
473
|
+
const agents = [...( computeAgentCounts(this.allModelTurns).keys())];
|
|
474
|
+
const next = ( new Set(this.selectedAgents ?? agents));
|
|
475
|
+
if (( next.has(agent))) {
|
|
476
|
+
next.delete(agent);
|
|
477
|
+
} else {
|
|
478
|
+
next.add(agent);
|
|
479
|
+
}
|
|
480
|
+
this.setAgentSelection(next.size === 0 ? ( new Set(agents)) : next);
|
|
481
|
+
}
|
|
482
|
+
setAgentSelection(agents) {
|
|
483
|
+
this.pendingSelectTurn = this.modelTurns[this.selectedIndex];
|
|
484
|
+
this.selectedAgents = agents;
|
|
485
|
+
this.render();
|
|
486
|
+
}
|
|
487
|
+
renderChunkBreakdown(section, rows, totalA, totalB, bTokensPerChar) {
|
|
488
|
+
const wrap = append(section, $(".chat-debug-cache-sig-breakdown"));
|
|
489
|
+
if (this.sigBreakdownOpen) {
|
|
490
|
+
wrap.classList.add("open");
|
|
491
|
+
}
|
|
492
|
+
const toggle = append(wrap, $("button.chat-debug-cache-sig-breakdown-toggle"));
|
|
493
|
+
toggle.setAttribute("aria-expanded", this.sigBreakdownOpen ? "true" : "false");
|
|
494
|
+
append(toggle, $(
|
|
495
|
+
"span.codicon.codicon-chevron-right.chat-debug-cache-sig-breakdown-chev",
|
|
496
|
+
{
|
|
497
|
+
"aria-hidden": "true"
|
|
498
|
+
}
|
|
499
|
+
));
|
|
500
|
+
append(toggle, $("span", undefined, ( localize(6571, "Chunk breakdown"))));
|
|
501
|
+
this.contentDisposables.add(addDisposableListener(toggle, EventType.CLICK, () => {
|
|
502
|
+
this.sigBreakdownOpen = !this.sigBreakdownOpen;
|
|
503
|
+
const token = ++this.renderToken;
|
|
504
|
+
void this.renderContentInner(token, () => token === this.renderToken, true);
|
|
505
|
+
}));
|
|
506
|
+
if (!this.sigBreakdownOpen) {
|
|
507
|
+
return;
|
|
508
|
+
}
|
|
509
|
+
const table = append(wrap, $(".chat-debug-cache-sig-breakdown-table", {
|
|
510
|
+
role: "table"
|
|
511
|
+
}));
|
|
512
|
+
const head = append(table, $(".chat-debug-cache-sig-breakdown-row.head", {
|
|
513
|
+
role: "row"
|
|
514
|
+
}));
|
|
515
|
+
append(head, $(".cell.idx", {
|
|
516
|
+
role: "columnheader"
|
|
517
|
+
}, ( localize(6572, "#"))));
|
|
518
|
+
append(head, $(".cell.chunk", {
|
|
519
|
+
role: "columnheader"
|
|
520
|
+
}, ( localize(6573, "Chunk"))));
|
|
521
|
+
append(head, $(".cell.num", {
|
|
522
|
+
role: "columnheader"
|
|
523
|
+
}, ( localize(6574, "Previous"))));
|
|
524
|
+
append(head, $(".cell.num", {
|
|
525
|
+
role: "columnheader"
|
|
526
|
+
}, ( localize(6575, "Current"))));
|
|
527
|
+
append(head, $(".cell.num", {
|
|
528
|
+
role: "columnheader"
|
|
529
|
+
}, ( localize(6576, "≈ tok"))));
|
|
530
|
+
append(head, $(".cell.num", {
|
|
531
|
+
role: "columnheader"
|
|
532
|
+
}, ( localize(6577, "% of current"))));
|
|
533
|
+
rows.forEach((r, i) => {
|
|
534
|
+
const row = append(table, $(".chat-debug-cache-sig-breakdown-row", {
|
|
535
|
+
role: "row"
|
|
536
|
+
}));
|
|
537
|
+
if (r.drift) {
|
|
538
|
+
row.classList.add("is-drift");
|
|
539
|
+
}
|
|
540
|
+
append(row, $(".cell.idx", {
|
|
541
|
+
role: "cell"
|
|
542
|
+
}, String(i)));
|
|
543
|
+
const chunk = append(row, $(".cell.chunk", {
|
|
544
|
+
role: "cell"
|
|
545
|
+
}));
|
|
546
|
+
append(chunk, $(`span.chat-debug-cache-sig-swatch.role-${roleClass(r.role)}`, {
|
|
547
|
+
"aria-hidden": "true"
|
|
548
|
+
}));
|
|
549
|
+
append(
|
|
550
|
+
chunk,
|
|
551
|
+
$("span.chat-debug-cache-sig-breakdown-chunk-label", undefined, r.label)
|
|
552
|
+
);
|
|
553
|
+
append(row, $(".cell.num", {
|
|
554
|
+
role: "cell"
|
|
555
|
+
}, r.aChars !== undefined ? numberFormatter.value.format(r.aChars) : "—"));
|
|
556
|
+
append(row, $(".cell.num", {
|
|
557
|
+
role: "cell"
|
|
558
|
+
}, r.bChars !== undefined ? numberFormatter.value.format(r.bChars) : "—"));
|
|
559
|
+
const tok = r.bChars !== undefined && bTokensPerChar !== undefined ? Math.round(r.bChars * bTokensPerChar) : undefined;
|
|
560
|
+
append(row, $(".cell.num", {
|
|
561
|
+
role: "cell"
|
|
562
|
+
}, tok !== undefined ? numberFormatter.value.format(tok) : "—"));
|
|
563
|
+
const pct = r.bChars !== undefined && totalB > 0 ? (r.bChars / totalB) * 100 : undefined;
|
|
564
|
+
append(row, $(".cell.num", {
|
|
565
|
+
role: "cell"
|
|
566
|
+
}, pct !== undefined ? ( localize(6578, "{0}%", pct.toFixed(1))) : "—"));
|
|
567
|
+
});
|
|
568
|
+
const totals = append(table, $(".chat-debug-cache-sig-breakdown-row.total", {
|
|
569
|
+
role: "row"
|
|
570
|
+
}));
|
|
571
|
+
append(totals, $(".cell.idx", {
|
|
572
|
+
role: "cell"
|
|
573
|
+
}, ""));
|
|
574
|
+
append(totals, $(".cell.chunk", {
|
|
575
|
+
role: "cell"
|
|
576
|
+
}, ( localize(6579, "Total"))));
|
|
577
|
+
append(totals, $(".cell.num", {
|
|
578
|
+
role: "cell"
|
|
579
|
+
}, numberFormatter.value.format(totalA)));
|
|
580
|
+
append(totals, $(".cell.num", {
|
|
581
|
+
role: "cell"
|
|
582
|
+
}, numberFormatter.value.format(totalB)));
|
|
583
|
+
append(totals, $(".cell.num", {
|
|
584
|
+
role: "cell"
|
|
585
|
+
}, bTokensPerChar !== undefined ? numberFormatter.value.format(Math.round(totalB * bTokensPerChar)) : "—"));
|
|
586
|
+
append(totals, $(".cell.num", {
|
|
587
|
+
role: "cell"
|
|
588
|
+
}, ( localize(6578, "{0}%", "100"))));
|
|
181
589
|
}
|
|
182
590
|
async resolveSide(event) {
|
|
183
591
|
let content;
|
|
@@ -212,8 +620,29 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
212
620
|
};
|
|
213
621
|
}
|
|
214
622
|
renderRail(groups) {
|
|
623
|
+
const gapBefore = turnIndex => {
|
|
624
|
+
if (turnIndex <= 0) {
|
|
625
|
+
return undefined;
|
|
626
|
+
}
|
|
627
|
+
const prev = this.modelTurns[turnIndex - 1];
|
|
628
|
+
const curr = this.modelTurns[turnIndex];
|
|
629
|
+
const prevEnd = prev.created.getTime() + (prev.durationInMillis ?? 0);
|
|
630
|
+
const gapMinutes = (curr.created.getTime() - prevEnd) / 60_000;
|
|
631
|
+
return gapMinutes >= TTL_GAP_MINUTES ? gapMinutes : undefined;
|
|
632
|
+
};
|
|
633
|
+
const appendGapMarker = gapMinutes => {
|
|
634
|
+
const gap = append(this.railList, $(".chat-debug-cache-rail-gap"));
|
|
635
|
+
append(gap, $("span.codicon.codicon-clock", {
|
|
636
|
+
"aria-hidden": "true"
|
|
637
|
+
}));
|
|
638
|
+
append(gap, $("span", undefined, ( localize(6580, "{0} min idle · cache likely expired", gapMinutes.toFixed(1)))));
|
|
639
|
+
};
|
|
215
640
|
for (const group of groups) {
|
|
216
641
|
const collapsed = ( this.collapsedGroups.has(group.key));
|
|
642
|
+
const groupGap = group.turns.length > 0 ? gapBefore(group.turns[0].index) : undefined;
|
|
643
|
+
if (groupGap !== undefined) {
|
|
644
|
+
appendGapMarker(groupGap);
|
|
645
|
+
}
|
|
217
646
|
const header = append(this.railList, $(".chat-debug-cache-group-header"));
|
|
218
647
|
if (collapsed) {
|
|
219
648
|
header.classList.add("is-collapsed");
|
|
@@ -221,16 +650,16 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
221
650
|
header.tabIndex = 0;
|
|
222
651
|
header.setAttribute("role", "button");
|
|
223
652
|
header.setAttribute("aria-expanded", collapsed ? "false" : "true");
|
|
224
|
-
header.title = ( localize(
|
|
653
|
+
header.title = ( localize(6581, "Toggle group"));
|
|
225
654
|
const topLine = append(header, $(".chat-debug-cache-group-top"));
|
|
226
655
|
append(topLine, $("span.chat-debug-cache-group-chev"));
|
|
227
656
|
const headerLine = append(topLine, $(".chat-debug-cache-group-prompt"));
|
|
228
|
-
headerLine.textContent = group.userMessage?.message?.trim() || ( localize(
|
|
657
|
+
headerLine.textContent = group.userMessage?.message?.trim() || ( localize(6582, "(no prompt captured)"));
|
|
229
658
|
const countBadge = append(topLine, $("span.chat-debug-cache-group-count"));
|
|
230
659
|
countBadge.textContent = String(group.turns.length);
|
|
231
660
|
const headerMeta = append(header, $(".chat-debug-cache-group-meta"));
|
|
232
661
|
headerMeta.textContent = group.key;
|
|
233
|
-
headerMeta.title = ( localize(
|
|
662
|
+
headerMeta.title = ( localize(6583, "Request id: {0}", group.key));
|
|
234
663
|
const toggle = () => {
|
|
235
664
|
if (( this.collapsedGroups.has(group.key))) {
|
|
236
665
|
this.collapsedGroups.delete(group.key);
|
|
@@ -239,8 +668,8 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
239
668
|
}
|
|
240
669
|
this.refresh();
|
|
241
670
|
};
|
|
242
|
-
this.
|
|
243
|
-
this.
|
|
671
|
+
this.railDisposables.add(addDisposableListener(header, EventType.CLICK, toggle));
|
|
672
|
+
this.railDisposables.add(addDisposableListener(header, EventType.KEY_DOWN, e => {
|
|
244
673
|
if (e.key === "Enter" || e.key === " ") {
|
|
245
674
|
e.preventDefault();
|
|
246
675
|
toggle();
|
|
@@ -249,11 +678,18 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
249
678
|
if (collapsed) {
|
|
250
679
|
continue;
|
|
251
680
|
}
|
|
252
|
-
for (const {
|
|
681
|
+
for (const [posInGroup, {
|
|
253
682
|
turn: evt,
|
|
254
683
|
index: i
|
|
255
|
-
} of group.turns) {
|
|
684
|
+
}] of group.turns.entries()) {
|
|
685
|
+
if (posInGroup > 0) {
|
|
686
|
+
const gap = gapBefore(i);
|
|
687
|
+
if (gap !== undefined) {
|
|
688
|
+
appendGapMarker(gap);
|
|
689
|
+
}
|
|
690
|
+
}
|
|
256
691
|
const row = append(this.railList, $(".chat-debug-cache-turn"));
|
|
692
|
+
this.railRowsByIndex.set(i, row);
|
|
257
693
|
if (i === this.selectedIndex) {
|
|
258
694
|
row.classList.add("is-selected");
|
|
259
695
|
}
|
|
@@ -262,13 +698,13 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
262
698
|
const main = append(row, $(".chat-debug-cache-turn-main"));
|
|
263
699
|
const top = append(main, $(".chat-debug-cache-turn-top"));
|
|
264
700
|
const source = append(top, $("span.chat-debug-cache-turn-source"));
|
|
265
|
-
source.textContent = evt.requestName || ( localize(
|
|
266
|
-
if (evt.
|
|
701
|
+
source.textContent = evt.requestName || ( localize(6584, "Model Turn"));
|
|
702
|
+
if (evt.inputTokens) {
|
|
267
703
|
const hit = computeCacheHit(evt);
|
|
268
704
|
const hitChip = append(top, $(
|
|
269
705
|
"span.chat-debug-cache-turn-chip.chat-debug-cache-turn-hit",
|
|
270
706
|
undefined,
|
|
271
|
-
( localize(
|
|
707
|
+
( localize(6585, "[cache {0}%]", formatCachePctInt(hit)))
|
|
272
708
|
));
|
|
273
709
|
if (hit < 90) {
|
|
274
710
|
hitChip.classList.add("is-bad");
|
|
@@ -276,7 +712,7 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
276
712
|
}
|
|
277
713
|
if (evt.durationInMillis !== undefined) {
|
|
278
714
|
append(top, $("span.chat-debug-cache-turn-chip", undefined, ( localize(
|
|
279
|
-
|
|
715
|
+
6586,
|
|
280
716
|
"[{0}ms]",
|
|
281
717
|
numberFormatter.value.format(Math.round(evt.durationInMillis))
|
|
282
718
|
))));
|
|
@@ -290,27 +726,35 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
290
726
|
const sub = append(main, $(".chat-debug-cache-turn-sub"));
|
|
291
727
|
sub.textContent = evt.model;
|
|
292
728
|
}
|
|
293
|
-
row.title = ( localize(
|
|
729
|
+
row.title = ( localize(6587, "Click to compare this request against the previous one"));
|
|
294
730
|
row.tabIndex = 0;
|
|
295
731
|
row.setAttribute("role", "button");
|
|
296
|
-
|
|
732
|
+
if (i === this.selectedIndex) {
|
|
733
|
+
row.setAttribute("aria-current", "true");
|
|
734
|
+
}
|
|
297
735
|
row.setAttribute("aria-label", ( localize(
|
|
298
|
-
|
|
736
|
+
6588,
|
|
299
737
|
"Turn {0}: {1}",
|
|
300
738
|
i,
|
|
301
|
-
evt.requestName ?? evt.model ?? ( localize(
|
|
739
|
+
evt.requestName ?? evt.model ?? ( localize(6584, "Model Turn"))
|
|
302
740
|
)));
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
this.loadDisposables.add(addDisposableListener(row, EventType.CLICK, select));
|
|
310
|
-
this.loadDisposables.add(addDisposableListener(row, EventType.KEY_DOWN, e => {
|
|
741
|
+
this.railDisposables.add(
|
|
742
|
+
addDisposableListener(row, EventType.CLICK, () => this.selectTurn(i, {
|
|
743
|
+
preventScroll: true
|
|
744
|
+
}))
|
|
745
|
+
);
|
|
746
|
+
this.railDisposables.add(addDisposableListener(row, EventType.KEY_DOWN, e => {
|
|
311
747
|
if (e.key === "Enter" || e.key === " ") {
|
|
312
748
|
e.preventDefault();
|
|
313
|
-
|
|
749
|
+
this.selectTurn(i, {
|
|
750
|
+
preventScroll: true
|
|
751
|
+
});
|
|
752
|
+
} else if (e.key === "ArrowDown") {
|
|
753
|
+
e.preventDefault();
|
|
754
|
+
this.moveSelection(1);
|
|
755
|
+
} else if (e.key === "ArrowUp") {
|
|
756
|
+
e.preventDefault();
|
|
757
|
+
this.moveSelection(-1);
|
|
314
758
|
}
|
|
315
759
|
}));
|
|
316
760
|
}
|
|
@@ -319,32 +763,32 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
319
763
|
renderTitleRow() {
|
|
320
764
|
const titleRow = append(this.content, $(".chat-debug-cache-title-row"));
|
|
321
765
|
const title = append(titleRow, $("h2.chat-debug-cache-title"));
|
|
322
|
-
title.textContent = ( localize(
|
|
766
|
+
title.textContent = ( localize(6589, "Cache Explorer — Prefix Diff"));
|
|
323
767
|
}
|
|
324
|
-
renderSummary(a, b, diff) {
|
|
768
|
+
renderSummary(a, b, diff, compareInputMessages, insights, optionsDiff) {
|
|
325
769
|
const row = append(this.content, $(".chat-debug-cache-summary"));
|
|
326
|
-
row.appendChild(this.renderSideCard(a, ( localize(
|
|
327
|
-
row.appendChild(this.renderSideCard(b, ( localize(
|
|
328
|
-
const breakCard = append(row, $(".chat-debug-cache-card.break"));
|
|
329
|
-
append(breakCard, $(".chat-debug-cache-card-h", undefined, ( localize(6170, "Cache performance"))));
|
|
770
|
+
row.appendChild(this.renderSideCard(a, ( localize(6590, "Previous request"))));
|
|
771
|
+
row.appendChild(this.renderSideCard(b, ( localize(6591, "Request"))));
|
|
330
772
|
const hit = computeCacheHit(b.event);
|
|
331
773
|
const inputTokens = b.event.inputTokens ?? 0;
|
|
332
774
|
const cachedTokens = b.event.cachedTokens ?? 0;
|
|
333
775
|
const lostTokens = Math.max(0, inputTokens - cachedTokens);
|
|
334
|
-
const
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
const
|
|
338
|
-
const expiration = !continuationComparison && isLikelyCacheExpiration(hit, diff, optionsDiff, systemChanged, toolsChanged);
|
|
776
|
+
const breakCard = append(row, $(".chat-debug-cache-card.break"));
|
|
777
|
+
breakCard.classList.add(`is-${maxInsightSeverity(insights)}`);
|
|
778
|
+
append(breakCard, $(".chat-debug-cache-card-h", undefined, ( localize(6592, "Cache performance"))));
|
|
779
|
+
const primary = primaryInsight(insights);
|
|
339
780
|
const headline = append(breakCard, $(".chat-debug-cache-card-headline"));
|
|
340
|
-
|
|
341
|
-
headline.textContent = ( localize(6171, "{0}% cache hit — likely cache expiration", formatCachePct(hit)));
|
|
342
|
-
} else {
|
|
343
|
-
headline.textContent = ( localize(6172, "{0}% cache hit", formatCachePct(hit)));
|
|
344
|
-
}
|
|
781
|
+
headline.textContent = primary ? ( localize(6593, "{0}% cache hit — {1}", formatCachePct(hit), primary.title)) : ( localize(6594, "{0}% cache hit", formatCachePct(hit)));
|
|
345
782
|
const counts = append(breakCard, $(".chat-debug-cache-card-sub"));
|
|
346
|
-
counts.textContent = ( localize(
|
|
347
|
-
|
|
783
|
+
counts.textContent = lostTokens > 0 && inputTokens > 0 ? ( localize(
|
|
784
|
+
6595,
|
|
785
|
+
"{0} of {1} input tokens reused · {2} uncached ({3}%)",
|
|
786
|
+
numberFormatter.value.format(cachedTokens),
|
|
787
|
+
numberFormatter.value.format(inputTokens),
|
|
788
|
+
numberFormatter.value.format(lostTokens),
|
|
789
|
+
formatCachePct((lostTokens / inputTokens) * 100)
|
|
790
|
+
)) : ( localize(
|
|
791
|
+
6596,
|
|
348
792
|
"{0} of {1} input tokens reused",
|
|
349
793
|
numberFormatter.value.format(cachedTokens),
|
|
350
794
|
numberFormatter.value.format(inputTokens)
|
|
@@ -357,145 +801,126 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
357
801
|
shapeLine.textContent = b.requestShape.description;
|
|
358
802
|
}
|
|
359
803
|
append(breakCard, $(".chat-debug-cache-perf-rule"));
|
|
360
|
-
append(breakCard, $(
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
const
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
));
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
));
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
6178,
|
|
379
|
-
"Tool definitions changed — the catalog of available tools differs between requests, which invalidates the cache even though the message prefix matches."
|
|
380
|
-
));
|
|
381
|
-
if (continuationComparison && diff.break) {
|
|
382
|
-
const deltaName = diff.break.index === 0 ? ( localize(6179, "the first message")) : `messages[${diff.break.index}]`;
|
|
383
|
-
const deltaLine = append(breakCard, $(".chat-debug-cache-perf-line"));
|
|
384
|
-
deltaLine.textContent = ( localize(
|
|
385
|
-
6180,
|
|
386
|
-
"The visible wire delta also changed at {0}. That is expected when comparing consecutive continuation requests of different kinds, such as tool_search_output followed by a new user input.",
|
|
387
|
-
deltaName
|
|
388
|
-
));
|
|
389
|
-
}
|
|
390
|
-
} else if (continuationComparison && diff.break) {
|
|
391
|
-
const componentName = diff.break.index === 0 ? ( localize(6179, "the first message")) : `messages[${diff.break.index}]`;
|
|
392
|
-
breakLine.textContent = ( localize(
|
|
393
|
-
6181,
|
|
394
|
-
"The captured wire delta changed at {0} — {1}. This is a delta-to-delta comparison between consecutive Responses API requests, not the full reconstructed prompt prefix.",
|
|
395
|
-
componentName,
|
|
396
|
-
describeBreakKind(diff.break.kind, diff, b)
|
|
397
|
-
));
|
|
398
|
-
if (lostTokens > 0 && inputTokens > 0) {
|
|
399
|
-
const lostPct = (lostTokens / inputTokens) * 100;
|
|
400
|
-
const lossLine = append(breakCard, $(".chat-debug-cache-perf-line"));
|
|
401
|
-
lossLine.textContent = ( localize(
|
|
402
|
-
6182,
|
|
403
|
-
"Uncached in this request: {0} tokens ({1}% of this request)",
|
|
404
|
-
numberFormatter.value.format(lostTokens),
|
|
405
|
-
formatCachePct(lostPct)
|
|
406
|
-
));
|
|
804
|
+
append(breakCard, $(".chat-debug-cache-perf-section-h", undefined, ( localize(6597, "Findings"))));
|
|
805
|
+
const list = append(breakCard, $(".chat-debug-cache-findings"));
|
|
806
|
+
if (insights.length === 0) {
|
|
807
|
+
append(list, $(".chat-debug-cache-finding-detail", undefined, ( localize(6598, "No findings for this request pair."))));
|
|
808
|
+
}
|
|
809
|
+
for (const insight of insights) {
|
|
810
|
+
this.renderFinding(list, insight);
|
|
811
|
+
}
|
|
812
|
+
if (compareInputMessages) {
|
|
813
|
+
append(breakCard, $(".chat-debug-cache-perf-rule"));
|
|
814
|
+
append(breakCard, $(".chat-debug-cache-perf-section-h", undefined, ( localize(6599, "Diff summary"))));
|
|
815
|
+
const summaryLine = append(breakCard, $(".chat-debug-cache-perf-line"));
|
|
816
|
+
const inPlaceChanged = diff.counts.contentDrift + diff.counts.lengthChange;
|
|
817
|
+
const addedInB = diff.counts.onlyInB;
|
|
818
|
+
const droppedFromA = diff.counts.onlyInA;
|
|
819
|
+
const parts = [( localize(6600, "{0} identical", diff.counts.identical)), ( localize(6601, "{0} in-place changed", inPlaceChanged))];
|
|
820
|
+
if (addedInB > 0) {
|
|
821
|
+
parts.push(( localize(6602, "{0} added in this request", addedInB)));
|
|
407
822
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
breakLine.textContent = ( localize(
|
|
411
|
-
6183,
|
|
412
|
-
"At {0} — {1}",
|
|
413
|
-
componentName,
|
|
414
|
-
describeBreakKind(diff.break.kind, diff, b)
|
|
415
|
-
));
|
|
416
|
-
if (lostTokens > 0 && inputTokens > 0) {
|
|
417
|
-
const lostPct = (lostTokens / inputTokens) * 100;
|
|
418
|
-
const lossLine = append(breakCard, $(".chat-debug-cache-perf-line"));
|
|
419
|
-
lossLine.textContent = ( localize(
|
|
420
|
-
6184,
|
|
421
|
-
"Lost: {0} tokens ({1}% of this request)",
|
|
422
|
-
numberFormatter.value.format(lostTokens),
|
|
423
|
-
formatCachePct(lostPct)
|
|
424
|
-
));
|
|
823
|
+
if (droppedFromA > 0) {
|
|
824
|
+
parts.push(( localize(6603, "{0} dropped from previous", droppedFromA)));
|
|
425
825
|
}
|
|
426
|
-
|
|
427
|
-
breakLine.textContent = ( localize(
|
|
428
|
-
6185,
|
|
429
|
-
"Request options changed — the cache was invalidated even though the message prefix matches."
|
|
430
|
-
));
|
|
431
|
-
} else if (continuationComparison) {
|
|
432
|
-
breakLine.textContent = ( localize(
|
|
433
|
-
6186,
|
|
434
|
-
"No divergence detected in the captured wire delta. The full reconstructed prompt prefix is provider-side for this continuation request."
|
|
435
|
-
));
|
|
436
|
-
} else {
|
|
437
|
-
breakLine.textContent = ( localize(6187, "No prefix divergence detected."));
|
|
826
|
+
summaryLine.textContent = parts.join(" · ");
|
|
438
827
|
}
|
|
439
|
-
append(breakCard, $(".chat-debug-cache-perf-rule"));
|
|
440
|
-
append(breakCard, $(".chat-debug-cache-perf-section-h", undefined, ( localize(6188, "Diff summary"))));
|
|
441
|
-
const summaryLine = append(breakCard, $(".chat-debug-cache-perf-line"));
|
|
442
|
-
const inPlaceChanged = diff.counts.contentDrift + diff.counts.lengthChange;
|
|
443
|
-
const addedInB = diff.counts.onlyInB;
|
|
444
|
-
const droppedFromA = diff.counts.onlyInA;
|
|
445
|
-
const parts = [( localize(6189, "{0} identical", diff.counts.identical)), ( localize(6190, "{0} in-place changed", inPlaceChanged))];
|
|
446
|
-
if (addedInB > 0) {
|
|
447
|
-
parts.push(( localize(6191, "{0} added in this request", addedInB)));
|
|
448
|
-
}
|
|
449
|
-
if (droppedFromA > 0) {
|
|
450
|
-
parts.push(( localize(6192, "{0} dropped from previous", droppedFromA)));
|
|
451
|
-
}
|
|
452
|
-
summaryLine.textContent = parts.join(" · ");
|
|
453
828
|
if (optionsDiff.length > 0) {
|
|
454
829
|
const optsLine = append(this.content, $(".chat-debug-cache-options-banner"));
|
|
455
|
-
optsLine.textContent = ( localize(
|
|
830
|
+
optsLine.textContent = ( localize(6604, "Options changed: {0}", ( optionsDiff.map(
|
|
456
831
|
d => `${d.key} (${formatOptionValue(d.previous)} \u2192 ${formatOptionValue(d.current)})`
|
|
457
832
|
)).join(", ")));
|
|
458
833
|
}
|
|
459
834
|
}
|
|
835
|
+
renderFinding(list, insight) {
|
|
836
|
+
const isLink = !!insight.component;
|
|
837
|
+
const row = append(list, isLink ? $("button.chat-debug-cache-finding.is-clickable", {
|
|
838
|
+
type: "button"
|
|
839
|
+
}) : $(".chat-debug-cache-finding"));
|
|
840
|
+
append(row, $(
|
|
841
|
+
`span.codicon.codicon-${findingIcon(insight.severity)}.chat-debug-cache-finding-icon.is-${insight.severity}`,
|
|
842
|
+
{
|
|
843
|
+
"aria-hidden": "true"
|
|
844
|
+
}
|
|
845
|
+
));
|
|
846
|
+
const body = append(row, $(".chat-debug-cache-finding-body"));
|
|
847
|
+
append(body, $(".chat-debug-cache-finding-title", undefined, insight.title));
|
|
848
|
+
if (insight.detail) {
|
|
849
|
+
append(body, $(".chat-debug-cache-finding-detail", undefined, insight.detail));
|
|
850
|
+
}
|
|
851
|
+
if (insight.hint) {
|
|
852
|
+
append(body, $(".chat-debug-cache-finding-hint", undefined, insight.hint));
|
|
853
|
+
}
|
|
854
|
+
if (isLink) {
|
|
855
|
+
row.title = ( localize(6605, "Reveal {0} in Components", insight.component));
|
|
856
|
+
this.contentDisposables.add(
|
|
857
|
+
addDisposableListener(row, EventType.CLICK, () => this.revealComponent(insight.component))
|
|
858
|
+
);
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
revealComponent(name) {
|
|
862
|
+
const entry = this.componentElements.get(name);
|
|
863
|
+
if (!entry) {
|
|
864
|
+
return;
|
|
865
|
+
}
|
|
866
|
+
const {
|
|
867
|
+
item,
|
|
868
|
+
head
|
|
869
|
+
} = entry;
|
|
870
|
+
if (!( this.openComponents.has(name))) {
|
|
871
|
+
this.openComponents.add(name);
|
|
872
|
+
item.classList.add("open");
|
|
873
|
+
head.setAttribute("aria-expanded", "true");
|
|
874
|
+
}
|
|
875
|
+
item.scrollIntoView({
|
|
876
|
+
behavior: "smooth",
|
|
877
|
+
block: "start"
|
|
878
|
+
});
|
|
879
|
+
item.classList.remove("flash");
|
|
880
|
+
item.classList.add("flash");
|
|
881
|
+
head.focus({
|
|
882
|
+
preventScroll: true
|
|
883
|
+
});
|
|
884
|
+
}
|
|
460
885
|
renderSideCard(data, title) {
|
|
461
886
|
const card = $(".chat-debug-cache-card");
|
|
462
887
|
if (title) {
|
|
463
888
|
append(card, $(".chat-debug-cache-card-h", undefined, title));
|
|
464
889
|
}
|
|
465
|
-
this.appendKv(card, ( localize(
|
|
466
|
-
this.appendKv(card, ( localize(
|
|
467
|
-
this.appendKv(card, ( localize(
|
|
468
|
-
this.appendKv(card, ( localize(
|
|
469
|
-
this.appendKv(card, ( localize(
|
|
890
|
+
this.appendKv(card, ( localize(6606, "model")), data.event.model ?? "—");
|
|
891
|
+
this.appendKv(card, ( localize(6607, "input tok")), formatTokens(data.event.inputTokens));
|
|
892
|
+
this.appendKv(card, ( localize(6608, "cached tok")), formatTokens(data.event.cachedTokens));
|
|
893
|
+
this.appendKv(card, ( localize(6609, "cache hit")), `${formatCachePct(computeCacheHit(data.event))}%`);
|
|
894
|
+
this.appendKv(card, ( localize(6610, "shape")), data.requestShape.label);
|
|
470
895
|
const startTime = data.event.created;
|
|
471
896
|
const endTime = data.event.durationInMillis !== undefined ? ( new Date(startTime.getTime() + data.event.durationInMillis)) : undefined;
|
|
472
|
-
this.appendKv(card, ( localize(
|
|
897
|
+
this.appendKv(card, ( localize(6611, "startTime")), startTime.toISOString(), true);
|
|
473
898
|
if (endTime) {
|
|
474
|
-
this.appendKv(card, ( localize(
|
|
899
|
+
this.appendKv(card, ( localize(6612, "endTime")), endTime.toISOString(), true);
|
|
475
900
|
}
|
|
476
901
|
if (data.event.durationInMillis !== undefined) {
|
|
477
|
-
this.appendKv(card, ( localize(
|
|
902
|
+
this.appendKv(card, ( localize(6613, "duration")), `${numberFormatter.value.format(Math.round(data.event.durationInMillis))}ms`);
|
|
478
903
|
}
|
|
479
904
|
const ttft = data.content?.timeToFirstTokenInMillis;
|
|
480
905
|
if (ttft !== undefined) {
|
|
481
|
-
this.appendKv(card, ( localize(
|
|
906
|
+
this.appendKv(card, ( localize(6614, "timeToFirstToken")), `${numberFormatter.value.format(Math.round(ttft))}ms`);
|
|
482
907
|
}
|
|
483
908
|
const requestId = data.content?.requestId ?? data.event.parentEventId ?? data.event.id;
|
|
484
909
|
if (requestId) {
|
|
485
|
-
this.appendKv(card, ( localize(
|
|
910
|
+
this.appendKv(card, ( localize(6615, "requestId")), requestId, true);
|
|
486
911
|
}
|
|
487
912
|
return card;
|
|
488
913
|
}
|
|
489
914
|
renderSingleSummary(b) {
|
|
490
915
|
const row = append(this.content, $(".chat-debug-cache-summary"));
|
|
491
|
-
row.appendChild(this.renderSideCard(b, ( localize(
|
|
916
|
+
row.appendChild(this.renderSideCard(b, ( localize(6591, "Request"))));
|
|
492
917
|
const note = append(row, $(".chat-debug-cache-card.break"));
|
|
493
|
-
append(note, $(".chat-debug-cache-card-h", undefined, ( localize(
|
|
918
|
+
append(note, $(".chat-debug-cache-card-h", undefined, ( localize(6616, "First request in session"))));
|
|
494
919
|
const headline = append(note, $(".chat-debug-cache-card-headline"));
|
|
495
920
|
headline.textContent = `${formatCachePct(computeCacheHit(b.event))}%`;
|
|
496
921
|
const sub = append(note, $(".chat-debug-cache-card-sub"));
|
|
497
922
|
sub.textContent = ( localize(
|
|
498
|
-
|
|
923
|
+
6617,
|
|
499
924
|
"OTel-reported cache hit. Nothing earlier in this session to diff against — the system prompt and tools may still match a previous session's cache."
|
|
500
925
|
));
|
|
501
926
|
if (b.requestShape.description) {
|
|
@@ -516,14 +941,14 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
516
941
|
const continuationComparison = b.requestShape.isContinuation;
|
|
517
942
|
const section = append(this.content, $(".chat-debug-cache-section"));
|
|
518
943
|
const heading = append(section, $("h3.chat-debug-cache-section-h"));
|
|
519
|
-
heading.textContent = continuationComparison ? ( localize(
|
|
944
|
+
heading.textContent = continuationComparison ? ( localize(6618, "Visible Request Signature")) : ( localize(6619, "Prompt Signature"));
|
|
520
945
|
if (continuationComparison) {
|
|
521
946
|
const note = append(
|
|
522
947
|
section,
|
|
523
948
|
$(".chat-debug-cache-sig-summary.chat-debug-cache-request-shape-note")
|
|
524
949
|
);
|
|
525
950
|
note.textContent = ( localize(
|
|
526
|
-
|
|
951
|
+
6620,
|
|
527
952
|
"For Responses API continuations, this shows the captured request inputs: system instructions, tools sent on this request, and the visible input delta. Earlier conversation state is referenced by previous response id and is not expanded here."
|
|
528
953
|
));
|
|
529
954
|
}
|
|
@@ -531,11 +956,14 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
531
956
|
for (const role of ["system", "user", "assistant", "tool", "tool_search", "tools"]) {
|
|
532
957
|
const entry = append(legend, $("span.chat-debug-cache-sig-legend-entry"));
|
|
533
958
|
append(entry, $(`span.chat-debug-cache-sig-swatch.role-${roleClass(role)}`));
|
|
534
|
-
append(entry, $$1("span", undefined, role === "tools" ? ( localize(
|
|
959
|
+
append(entry, $$1("span", undefined, role === "tools" ? ( localize(6621, "tools (catalog)")) : role === "tool_search" ? ( localize(6622, "tool search")) : role));
|
|
535
960
|
}
|
|
536
961
|
const driftEntry = append(legend, $("span.chat-debug-cache-sig-legend-entry"));
|
|
537
962
|
append(driftEntry, $("span.chat-debug-cache-sig-swatch.role-drift"));
|
|
538
|
-
append(driftEntry, $$1("span", undefined, ( localize(
|
|
963
|
+
append(driftEntry, $$1("span", undefined, ( localize(6623, "drift"))));
|
|
964
|
+
const groupEntry = append(legend, $("span.chat-debug-cache-sig-legend-entry"));
|
|
965
|
+
append(groupEntry, $("span.chat-debug-cache-sig-swatch.role-coalesced"));
|
|
966
|
+
append(groupEntry, $$1("span", undefined, ( localize(6624, "small messages (grouped)"))));
|
|
539
967
|
const toSegments = (side, isA) => {
|
|
540
968
|
const segs = [];
|
|
541
969
|
const sys = side.system;
|
|
@@ -546,7 +974,8 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
546
974
|
chars: sys.length,
|
|
547
975
|
drift: sys !== (other ?? ""),
|
|
548
976
|
label: "system",
|
|
549
|
-
synthetic: true
|
|
977
|
+
synthetic: true,
|
|
978
|
+
component: "system"
|
|
550
979
|
});
|
|
551
980
|
}
|
|
552
981
|
const tools = side.tools;
|
|
@@ -557,7 +986,8 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
557
986
|
chars: tools.length,
|
|
558
987
|
drift: tools !== (other ?? ""),
|
|
559
988
|
label: "tools",
|
|
560
|
-
synthetic: true
|
|
989
|
+
synthetic: true,
|
|
990
|
+
component: "tools"
|
|
561
991
|
});
|
|
562
992
|
}
|
|
563
993
|
side.inputMessages.forEach((m, i) => {
|
|
@@ -569,7 +999,8 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
569
999
|
chars: m.charLength,
|
|
570
1000
|
drift,
|
|
571
1001
|
label: m.name ? `${m.role}-${m.name}` : m.role,
|
|
572
|
-
synthetic: false
|
|
1002
|
+
synthetic: false,
|
|
1003
|
+
component: `messages[${i}]`
|
|
573
1004
|
});
|
|
574
1005
|
});
|
|
575
1006
|
return segs;
|
|
@@ -598,27 +1029,85 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
598
1029
|
}
|
|
599
1030
|
return undefined;
|
|
600
1031
|
};
|
|
601
|
-
const
|
|
1032
|
+
const aTokensPerChar = a.event.inputTokens && totalA > 0 ? a.event.inputTokens / totalA : undefined;
|
|
1033
|
+
const bTokensPerChar = b.event.inputTokens && totalB > 0 ? b.event.inputTokens / totalB : undefined;
|
|
1034
|
+
const buildLane = (label, segs, breakPos, tokensPerChar) => {
|
|
602
1035
|
const row = $(".chat-debug-cache-sig-lane-row");
|
|
603
1036
|
append(row, $(".chat-debug-cache-sig-lane-label", undefined, label));
|
|
604
1037
|
const bar = append(row, $(".chat-debug-cache-sig-bar"));
|
|
605
|
-
|
|
1038
|
+
const sideTotal = segs.reduce((sum, s) => sum + s.chars, 0);
|
|
1039
|
+
const sizeText = chars => tokensPerChar !== undefined ? ( localize(
|
|
1040
|
+
6625,
|
|
1041
|
+
"{0} chars (≈ {1} tok)",
|
|
1042
|
+
numberFormatter.value.format(chars),
|
|
1043
|
+
numberFormatter.value.format(Math.round(chars * tokensPerChar))
|
|
1044
|
+
)) : ( localize(6626, "{0} chars", numberFormatter.value.format(chars)));
|
|
1045
|
+
const renderSegment = s => {
|
|
1046
|
+
const seg = append(bar, $(`span.chat-debug-cache-sig-seg.role-${roleClass(s.role)}`));
|
|
1047
|
+
if (s.drift) {
|
|
1048
|
+
seg.classList.add("is-drift");
|
|
1049
|
+
seg.classList.add("is-clickable");
|
|
1050
|
+
seg.setAttribute("role", "button");
|
|
1051
|
+
seg.tabIndex = 0;
|
|
1052
|
+
const reveal = () => this.revealComponent(s.component);
|
|
1053
|
+
this.contentDisposables.add(addDisposableListener(seg, EventType.CLICK, reveal));
|
|
1054
|
+
this.contentDisposables.add(addDisposableListener(seg, EventType.KEY_DOWN, e => {
|
|
1055
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1056
|
+
e.preventDefault();
|
|
1057
|
+
reveal();
|
|
1058
|
+
}
|
|
1059
|
+
}));
|
|
1060
|
+
}
|
|
1061
|
+
seg.style.width = `${(s.chars / max) * 100}%`;
|
|
1062
|
+
seg.title = s.drift ? ( localize(
|
|
1063
|
+
6627,
|
|
1064
|
+
"{0} ({1}): {2} — drifted. Click to inspect.",
|
|
1065
|
+
s.component,
|
|
1066
|
+
s.label,
|
|
1067
|
+
sizeText(s.chars)
|
|
1068
|
+
)) : ( localize(6628, "{0} ({1}): {2}", s.component, s.label, sizeText(s.chars)));
|
|
1069
|
+
if (s.drift) {
|
|
1070
|
+
seg.setAttribute("aria-label", seg.title);
|
|
1071
|
+
}
|
|
1072
|
+
if (s.chars > max * 0.06) {
|
|
1073
|
+
seg.textContent = numberFormatter.value.format(s.chars);
|
|
1074
|
+
}
|
|
1075
|
+
};
|
|
1076
|
+
const renderGroup = group => {
|
|
1077
|
+
if (group.length === 1) {
|
|
1078
|
+
renderSegment(group[0]);
|
|
1079
|
+
return;
|
|
1080
|
+
}
|
|
1081
|
+
const chars = group.reduce((sum, s) => sum + s.chars, 0);
|
|
1082
|
+
const seg = append(bar, $("span.chat-debug-cache-sig-seg.role-coalesced"));
|
|
1083
|
+
seg.style.width = `${(chars / max) * 100}%`;
|
|
1084
|
+
seg.title = ( localize(
|
|
1085
|
+
6629,
|
|
1086
|
+
"{0} … {1}: {2} small messages, {3}",
|
|
1087
|
+
group[0].component,
|
|
1088
|
+
group[group.length - 1].component,
|
|
1089
|
+
group.length,
|
|
1090
|
+
sizeText(chars)
|
|
1091
|
+
));
|
|
1092
|
+
};
|
|
1093
|
+
const COALESCE_THRESHOLD = max * 0.015;
|
|
1094
|
+
let pending = [];
|
|
606
1095
|
for (const s of segs) {
|
|
607
1096
|
if (s.chars <= 0) {
|
|
608
|
-
sideTotal += s.chars;
|
|
609
1097
|
continue;
|
|
610
1098
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
seg.classList.add("is-drift");
|
|
1099
|
+
if (!s.synthetic && !s.drift && s.chars < COALESCE_THRESHOLD) {
|
|
1100
|
+
pending.push(s);
|
|
1101
|
+
continue;
|
|
615
1102
|
}
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
seg.textContent = `${s.label}:${numberFormatter.value.format(s.chars)}`;
|
|
1103
|
+
if (pending.length) {
|
|
1104
|
+
renderGroup(pending);
|
|
1105
|
+
pending = [];
|
|
620
1106
|
}
|
|
621
|
-
|
|
1107
|
+
renderSegment(s);
|
|
1108
|
+
}
|
|
1109
|
+
if (pending.length) {
|
|
1110
|
+
renderGroup(pending);
|
|
622
1111
|
}
|
|
623
1112
|
if (sideTotal < max) {
|
|
624
1113
|
const pad = append(bar, $("span.chat-debug-cache-sig-seg.role-empty"));
|
|
@@ -627,28 +1116,71 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
627
1116
|
if (breakPos !== undefined && diff.break) {
|
|
628
1117
|
const line = append(bar, $(".chat-debug-cache-sig-break"));
|
|
629
1118
|
line.style.left = `${(breakPos / max) * 100}%`;
|
|
630
|
-
line.title = ( localize(
|
|
1119
|
+
line.title = ( localize(6630, "Cache break at messages[{0}]", diff.break.index));
|
|
631
1120
|
}
|
|
632
|
-
append(row, $(".chat-debug-cache-sig-lane-total", undefined, ( localize(
|
|
1121
|
+
append(row, $(".chat-debug-cache-sig-lane-total", undefined, ( localize(6631, "{0} chars", numberFormatter.value.format(sideTotal)))));
|
|
633
1122
|
return row;
|
|
634
1123
|
};
|
|
635
1124
|
const lanes = append(section, $(".chat-debug-cache-sig-lanes"));
|
|
636
|
-
lanes.appendChild(buildLane(( localize(
|
|
637
|
-
lanes.appendChild(buildLane(( localize(
|
|
1125
|
+
lanes.appendChild(buildLane(( localize(6632, "Previous")), aSegs, breakCharPos(aSegs), aTokensPerChar));
|
|
1126
|
+
lanes.appendChild(buildLane(( localize(6633, "Current")), bSegs, breakCharPos(bSegs), bTokensPerChar));
|
|
1127
|
+
if (compareInputMessages && totalB > 0) {
|
|
1128
|
+
let reused = 0;
|
|
1129
|
+
let sawDrift = false;
|
|
1130
|
+
for (const s of bSegs) {
|
|
1131
|
+
if (s.drift) {
|
|
1132
|
+
sawDrift = true;
|
|
1133
|
+
break;
|
|
1134
|
+
}
|
|
1135
|
+
reused += s.chars;
|
|
1136
|
+
}
|
|
1137
|
+
if (!sawDrift) {
|
|
1138
|
+
reused = totalB;
|
|
1139
|
+
}
|
|
1140
|
+
const railRow = append(lanes, $(".chat-debug-cache-sig-lane-row.reuse"));
|
|
1141
|
+
append(railRow, $(".chat-debug-cache-sig-lane-label", undefined, ( localize(6634, "Match"))));
|
|
1142
|
+
const rail = append(railRow, $(".chat-debug-cache-sig-reuse-rail"));
|
|
1143
|
+
if (reused > 0) {
|
|
1144
|
+
const ok = append(rail, $("span.chat-debug-cache-sig-reuse-seg.is-reused"));
|
|
1145
|
+
ok.style.width = `${(reused / max) * 100}%`;
|
|
1146
|
+
ok.title = ( localize(
|
|
1147
|
+
6635,
|
|
1148
|
+
"Byte-identical to the previous request: {0} chars can be served from cache",
|
|
1149
|
+
numberFormatter.value.format(reused)
|
|
1150
|
+
));
|
|
1151
|
+
}
|
|
1152
|
+
if (totalB - reused > 0) {
|
|
1153
|
+
const bad = append(rail, $("span.chat-debug-cache-sig-reuse-seg.is-recomputed"));
|
|
1154
|
+
bad.style.width = `${((totalB - reused) / max) * 100}%`;
|
|
1155
|
+
bad.title = ( localize(
|
|
1156
|
+
6636,
|
|
1157
|
+
"Diverges from the previous request: {0} chars are recomputed",
|
|
1158
|
+
numberFormatter.value.format(totalB - reused)
|
|
1159
|
+
));
|
|
1160
|
+
}
|
|
1161
|
+
append(railRow, $(".chat-debug-cache-sig-lane-total", undefined, ( localize(6637, "{0}% match", String(Math.floor((reused / totalB) * 100))))));
|
|
1162
|
+
}
|
|
1163
|
+
this.renderChunkBreakdown(
|
|
1164
|
+
section,
|
|
1165
|
+
alignSignatureChunks(aSegs, bSegs),
|
|
1166
|
+
totalA,
|
|
1167
|
+
totalB,
|
|
1168
|
+
bTokensPerChar
|
|
1169
|
+
);
|
|
638
1170
|
let shared = 0;
|
|
639
1171
|
let firstDrift;
|
|
640
1172
|
if (a.system || b.system) {
|
|
641
1173
|
if ((a.system ?? "") === (b.system ?? "")) {
|
|
642
1174
|
shared += b.system?.length ?? 0;
|
|
643
1175
|
} else {
|
|
644
|
-
firstDrift = ( localize(
|
|
1176
|
+
firstDrift = ( localize(6638, "system"));
|
|
645
1177
|
}
|
|
646
1178
|
}
|
|
647
1179
|
if (!firstDrift && (a.tools || b.tools)) {
|
|
648
1180
|
if ((a.tools ?? "") === (b.tools ?? "")) {
|
|
649
1181
|
shared += b.tools?.length ?? 0;
|
|
650
1182
|
} else {
|
|
651
|
-
firstDrift = ( localize(
|
|
1183
|
+
firstDrift = ( localize(6639, "tools catalog"));
|
|
652
1184
|
}
|
|
653
1185
|
}
|
|
654
1186
|
if (!firstDrift) {
|
|
@@ -664,13 +1196,13 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
664
1196
|
const summary = append(section, $(".chat-debug-cache-sig-summary"));
|
|
665
1197
|
if (firstDrift) {
|
|
666
1198
|
summary.textContent = continuationComparison ? ( localize(
|
|
667
|
-
|
|
1199
|
+
6640,
|
|
668
1200
|
"{0} of {1} captured request chars match before first captured drift: {2}",
|
|
669
1201
|
numberFormatter.value.format(shared),
|
|
670
1202
|
numberFormatter.value.format(totalB),
|
|
671
1203
|
firstDrift
|
|
672
1204
|
)) : ( localize(
|
|
673
|
-
|
|
1205
|
+
6641,
|
|
674
1206
|
"{0} of {1} chars reused · break at {2}",
|
|
675
1207
|
numberFormatter.value.format(shared),
|
|
676
1208
|
numberFormatter.value.format(totalB),
|
|
@@ -678,12 +1210,12 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
678
1210
|
));
|
|
679
1211
|
} else {
|
|
680
1212
|
summary.textContent = continuationComparison ? ( localize(
|
|
681
|
-
|
|
1213
|
+
6642,
|
|
682
1214
|
"{0} of {1} captured request chars match · no captured divergence detected",
|
|
683
1215
|
numberFormatter.value.format(shared),
|
|
684
1216
|
numberFormatter.value.format(totalB)
|
|
685
1217
|
)) : ( localize(
|
|
686
|
-
|
|
1218
|
+
6643,
|
|
687
1219
|
"{0} of {1} chars reused · no divergence detected",
|
|
688
1220
|
numberFormatter.value.format(shared),
|
|
689
1221
|
numberFormatter.value.format(totalB)
|
|
@@ -698,12 +1230,12 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
698
1230
|
return;
|
|
699
1231
|
}
|
|
700
1232
|
const section = append(this.content, $(".chat-debug-cache-section"));
|
|
701
|
-
append(section, $("h3.chat-debug-cache-section-h", undefined, ( localize(
|
|
1233
|
+
append(section, $("h3.chat-debug-cache-section-h", undefined, ( localize(6644, "Request Options"))));
|
|
702
1234
|
const table = append(section, $(".chat-debug-cache-options-table"));
|
|
703
1235
|
const head = append(table, $(".chat-debug-cache-options-row.head"));
|
|
704
|
-
append(head, $(".chat-debug-cache-options-cell.key", undefined, ( localize(
|
|
705
|
-
append(head, $(".chat-debug-cache-options-cell", undefined, ( localize(
|
|
706
|
-
append(head, $(".chat-debug-cache-options-cell", undefined, ( localize(
|
|
1236
|
+
append(head, $(".chat-debug-cache-options-cell.key", undefined, ( localize(6645, "Option"))));
|
|
1237
|
+
append(head, $(".chat-debug-cache-options-cell", undefined, ( localize(6646, "Previous"))));
|
|
1238
|
+
append(head, $(".chat-debug-cache-options-cell", undefined, ( localize(6647, "Current"))));
|
|
707
1239
|
const sortedKeys = [...keys].sort((x, y) => x.localeCompare(y));
|
|
708
1240
|
for (const key of sortedKeys) {
|
|
709
1241
|
const row = append(table, $(".chat-debug-cache-options-row"));
|
|
@@ -718,16 +1250,17 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
718
1250
|
append(row, $(".chat-debug-cache-options-cell", undefined, formatOptionValue(bv)));
|
|
719
1251
|
}
|
|
720
1252
|
}
|
|
721
|
-
renderComponents(drift, a, b, compareInputMessages) {
|
|
1253
|
+
renderComponents(drift, a, b, compareInputMessages, identicalCount) {
|
|
1254
|
+
this.componentElements.clear();
|
|
722
1255
|
const section = append(this.content, $(".chat-debug-cache-section"));
|
|
723
|
-
append(section, $("h3.chat-debug-cache-section-h", undefined, ( localize(
|
|
1256
|
+
append(section, $("h3.chat-debug-cache-section-h", undefined, ( localize(6648, "Components"))));
|
|
724
1257
|
if (!compareInputMessages && b.requestShape.isContinuation) {
|
|
725
1258
|
const note = append(
|
|
726
1259
|
section,
|
|
727
1260
|
$(".chat-debug-cache-sig-summary.chat-debug-cache-request-shape-note")
|
|
728
1261
|
);
|
|
729
1262
|
note.textContent = ( localize(
|
|
730
|
-
|
|
1263
|
+
6649,
|
|
731
1264
|
"This request uses previous_response_id, so input messages are not positionally diffed against the previous request. Components below show cache-key shape changes; the current continuation delta is shown separately."
|
|
732
1265
|
));
|
|
733
1266
|
}
|
|
@@ -735,18 +1268,35 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
735
1268
|
const effectiveDrift = !compareInputMessages && b.requestShape.isContinuation && b.inputMessages.length > 0 ? [...drift, currentDeltaComponent(b)] : drift;
|
|
736
1269
|
if (effectiveDrift.length === 0) {
|
|
737
1270
|
const empty = append(acc, $(".chat-debug-cache-acc-empty"));
|
|
738
|
-
empty.textContent = ( localize(
|
|
1271
|
+
empty.textContent = ( localize(6650, "All components are identical between A and B."));
|
|
739
1272
|
return;
|
|
740
1273
|
}
|
|
741
1274
|
for (const c of effectiveDrift) {
|
|
742
1275
|
const item = append(acc, $(".chat-debug-cache-acc-item"));
|
|
743
1276
|
item.classList.add(c.status);
|
|
744
|
-
|
|
1277
|
+
const isOpen = ( this.openComponents.has(c.name));
|
|
1278
|
+
if (isOpen) {
|
|
745
1279
|
item.classList.add("open");
|
|
746
1280
|
}
|
|
747
1281
|
const head = append(item, $(".chat-debug-cache-acc-head"));
|
|
1282
|
+
this.componentElements.set(c.name, {
|
|
1283
|
+
item,
|
|
1284
|
+
head
|
|
1285
|
+
});
|
|
1286
|
+
head.tabIndex = 0;
|
|
1287
|
+
head.setAttribute("role", "button");
|
|
1288
|
+
head.setAttribute("aria-expanded", isOpen ? "true" : "false");
|
|
748
1289
|
append(head, $("span.chat-debug-cache-chev"));
|
|
749
1290
|
const name = append(head, $(".chat-debug-cache-acc-name"));
|
|
1291
|
+
const swatchRole = c.role ?? (c.name === "system" || c.name === "tools" ? c.name : undefined);
|
|
1292
|
+
if (swatchRole) {
|
|
1293
|
+
append(
|
|
1294
|
+
name,
|
|
1295
|
+
$(`span.chat-debug-cache-sig-swatch.role-${roleClass(swatchRole)}`, {
|
|
1296
|
+
"aria-hidden": "true"
|
|
1297
|
+
})
|
|
1298
|
+
);
|
|
1299
|
+
}
|
|
750
1300
|
if (c.role) {
|
|
751
1301
|
append(name, $("span.role", undefined, c.role));
|
|
752
1302
|
}
|
|
@@ -754,7 +1304,7 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
754
1304
|
const badge = append(head, $(`span.chat-debug-cache-acc-badge.${c.status}`));
|
|
755
1305
|
badge.textContent = badgeLabel(c.status);
|
|
756
1306
|
const sizes = append(head, $("span.chat-debug-cache-acc-sizes"));
|
|
757
|
-
sizes.textContent = ( localize(
|
|
1307
|
+
sizes.textContent = ( localize(6651, "{0} → {1} chars", formatTokens(c.aSize), formatTokens(c.bSize)));
|
|
758
1308
|
const body = append(item, $(".chat-debug-cache-acc-body"));
|
|
759
1309
|
const aText = c.name === CURRENT_CONTINUATION_DELTA_COMPONENT ? "" : textForComponent(c, a);
|
|
760
1310
|
const bText = c.name === CURRENT_CONTINUATION_DELTA_COMPONENT ? continuationDeltaText(b) : textForComponent(c, b);
|
|
@@ -765,36 +1315,60 @@ let ChatDebugCacheExplorerView = class ChatDebugCacheExplorerView extends Dispos
|
|
|
765
1315
|
note.title = truncationNote;
|
|
766
1316
|
head.title = truncationNote;
|
|
767
1317
|
}
|
|
1318
|
+
if (aText && bText && aText !== bText) {
|
|
1319
|
+
const dv = analyzeStringDivergence(aText, bText);
|
|
1320
|
+
if (dv) {
|
|
1321
|
+
const changeNote = append(body, $(".chat-debug-cache-acc-change-note"));
|
|
1322
|
+
changeNote.textContent = ( localize(6652, "What changed: {0}", describeStringDivergence(dv)));
|
|
1323
|
+
}
|
|
1324
|
+
}
|
|
768
1325
|
body.appendChild(this.renderComponentDiff(aText, bText, c.aSize, c.bSize));
|
|
769
|
-
|
|
1326
|
+
const toggle = () => {
|
|
770
1327
|
if (( this.openComponents.has(c.name))) {
|
|
771
1328
|
this.openComponents.delete(c.name);
|
|
772
1329
|
item.classList.remove("open");
|
|
1330
|
+
head.setAttribute("aria-expanded", "false");
|
|
773
1331
|
} else {
|
|
774
1332
|
this.openComponents.add(c.name);
|
|
775
1333
|
item.classList.add("open");
|
|
1334
|
+
head.setAttribute("aria-expanded", "true");
|
|
1335
|
+
}
|
|
1336
|
+
};
|
|
1337
|
+
this.contentDisposables.add(addDisposableListener(head, EventType.CLICK, toggle));
|
|
1338
|
+
this.contentDisposables.add(addDisposableListener(head, EventType.KEY_DOWN, e => {
|
|
1339
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
1340
|
+
e.preventDefault();
|
|
1341
|
+
toggle();
|
|
776
1342
|
}
|
|
777
1343
|
}));
|
|
778
1344
|
}
|
|
1345
|
+
if (compareInputMessages && identicalCount > 0) {
|
|
1346
|
+
const note = append(section, $(".chat-debug-cache-acc-identical-note"));
|
|
1347
|
+
note.textContent = ( localize(
|
|
1348
|
+
6653,
|
|
1349
|
+
"{0} identical message(s) not shown — they extend the shared, cache-servable prefix.",
|
|
1350
|
+
identicalCount
|
|
1351
|
+
));
|
|
1352
|
+
}
|
|
779
1353
|
}
|
|
780
1354
|
renderComponentDiff(aText, bText, aSize, bSize) {
|
|
781
1355
|
const grid = $(".chat-debug-cache-diff");
|
|
782
1356
|
const colA = append(grid, $(".chat-debug-cache-diff-col"));
|
|
783
|
-
append(colA, $("h4", undefined, ( localize(
|
|
1357
|
+
append(colA, $("h4", undefined, ( localize(6654, "Previous · {0} chars", numberFormatter.value.format(aSize)))));
|
|
784
1358
|
const aBody = append(colA, $(".chat-debug-cache-diff-body"));
|
|
785
1359
|
const colB = append(grid, $(".chat-debug-cache-diff-col"));
|
|
786
|
-
append(colB, $("h4", undefined, ( localize(
|
|
1360
|
+
append(colB, $("h4", undefined, ( localize(6655, "Current · {0} chars", numberFormatter.value.format(bSize)))));
|
|
787
1361
|
const bBody = append(colB, $(".chat-debug-cache-diff-body"));
|
|
788
1362
|
if (!aText && !bText) {
|
|
789
|
-
aBody.textContent = ( localize(
|
|
790
|
-
bBody.textContent = ( localize(
|
|
1363
|
+
aBody.textContent = ( localize(6656, "(not present)"));
|
|
1364
|
+
bBody.textContent = ( localize(6656, "(not present)"));
|
|
791
1365
|
return grid;
|
|
792
1366
|
}
|
|
793
1367
|
renderInlineDiff(aBody, bBody, aText, bText);
|
|
794
1368
|
return grid;
|
|
795
1369
|
}
|
|
796
1370
|
};
|
|
797
|
-
ChatDebugCacheExplorerView = ( __decorate([( __param(1, IChatService)), ( __param(2, IChatDebugService))], ChatDebugCacheExplorerView));
|
|
1371
|
+
ChatDebugCacheExplorerView = ( __decorate([( __param(1, IChatService)), ( __param(2, IChatDebugService)), ( __param(3, IContextMenuService))], ChatDebugCacheExplorerView));
|
|
798
1372
|
function findSection(sections, name) {
|
|
799
1373
|
if (!sections) {
|
|
800
1374
|
return undefined;
|
|
@@ -806,6 +1380,72 @@ function findSection(sections, name) {
|
|
|
806
1380
|
}
|
|
807
1381
|
return undefined;
|
|
808
1382
|
}
|
|
1383
|
+
function alignSignatureChunks(aSegs, bSegs) {
|
|
1384
|
+
const rows = [];
|
|
1385
|
+
const toRow = (aS, bS) => {
|
|
1386
|
+
const ref = bS ?? aS;
|
|
1387
|
+
return {
|
|
1388
|
+
role: ref.role,
|
|
1389
|
+
label: ref.label,
|
|
1390
|
+
aChars: aS?.chars,
|
|
1391
|
+
bChars: bS?.chars,
|
|
1392
|
+
drift: (aS?.drift ?? false) || (bS?.drift ?? false) || (!!aS !== !!bS)
|
|
1393
|
+
};
|
|
1394
|
+
};
|
|
1395
|
+
for (const role of ["system", "tools"]) {
|
|
1396
|
+
const aS = aSegs.find(s => s.synthetic && s.role === role);
|
|
1397
|
+
const bS = bSegs.find(s => s.synthetic && s.role === role);
|
|
1398
|
+
if (aS || bS) {
|
|
1399
|
+
rows.push(toRow(aS, bS));
|
|
1400
|
+
}
|
|
1401
|
+
}
|
|
1402
|
+
const aMsgs = aSegs.filter(s => !s.synthetic);
|
|
1403
|
+
const bMsgs = bSegs.filter(s => !s.synthetic);
|
|
1404
|
+
const count = Math.max(aMsgs.length, bMsgs.length);
|
|
1405
|
+
for (let i = 0; i < count; i++) {
|
|
1406
|
+
rows.push(toRow(aMsgs[i], bMsgs[i]));
|
|
1407
|
+
}
|
|
1408
|
+
return rows;
|
|
1409
|
+
}
|
|
1410
|
+
function agentKey(turn) {
|
|
1411
|
+
return turn.requestName?.trim() || ( localize(6657, "(unnamed)"));
|
|
1412
|
+
}
|
|
1413
|
+
function computeAgentCounts(turns) {
|
|
1414
|
+
const counts = ( new Map());
|
|
1415
|
+
for (const turn of turns) {
|
|
1416
|
+
const key = agentKey(turn);
|
|
1417
|
+
counts.set(key, (counts.get(key) ?? 0) + 1);
|
|
1418
|
+
}
|
|
1419
|
+
return counts;
|
|
1420
|
+
}
|
|
1421
|
+
function defaultAgentSelection(agentCounts) {
|
|
1422
|
+
if (( agentCounts.has(DEFAULT_AGENT_KEY))) {
|
|
1423
|
+
return ( new Set([DEFAULT_AGENT_KEY]));
|
|
1424
|
+
}
|
|
1425
|
+
return ( new Set(( agentCounts.keys())));
|
|
1426
|
+
}
|
|
1427
|
+
function isSameModelTurn(a, b) {
|
|
1428
|
+
if (a === b) {
|
|
1429
|
+
return true;
|
|
1430
|
+
}
|
|
1431
|
+
return a.id !== undefined && b.id !== undefined && a.id === b.id;
|
|
1432
|
+
}
|
|
1433
|
+
function isSimilarNoIdModelTurn(a, b) {
|
|
1434
|
+
return a.id === undefined && b.id === undefined && a.created.getTime() === b.created.getTime() && a.parentEventId === b.parentEventId && a.requestName === b.requestName && a.model === b.model;
|
|
1435
|
+
}
|
|
1436
|
+
function resolveFilteredSelectionIndex(turns, previous) {
|
|
1437
|
+
if (previous) {
|
|
1438
|
+
const exact = turns.findIndex(t => isSameModelTurn(t, previous));
|
|
1439
|
+
if (exact >= 0) {
|
|
1440
|
+
return exact;
|
|
1441
|
+
}
|
|
1442
|
+
const similar = turns.findIndex(t => isSimilarNoIdModelTurn(t, previous));
|
|
1443
|
+
if (similar >= 0) {
|
|
1444
|
+
return similar;
|
|
1445
|
+
}
|
|
1446
|
+
}
|
|
1447
|
+
return turns.length - 1;
|
|
1448
|
+
}
|
|
809
1449
|
function buildTurnGroups(turns, userMessages) {
|
|
810
1450
|
const userById = ( new Map());
|
|
811
1451
|
for (const um of userMessages) {
|
|
@@ -870,18 +1510,50 @@ function currentDeltaComponent(side) {
|
|
|
870
1510
|
bSize: size
|
|
871
1511
|
};
|
|
872
1512
|
}
|
|
1513
|
+
function categoryIcon(category) {
|
|
1514
|
+
switch (category) {
|
|
1515
|
+
case CacheBreakCategory.Healthy:
|
|
1516
|
+
return "check";
|
|
1517
|
+
case CacheBreakCategory.Expiration:
|
|
1518
|
+
return "clock";
|
|
1519
|
+
case CacheBreakCategory.Model:
|
|
1520
|
+
return "hubot";
|
|
1521
|
+
case CacheBreakCategory.Tools:
|
|
1522
|
+
return "tools";
|
|
1523
|
+
case CacheBreakCategory.System:
|
|
1524
|
+
return "gear";
|
|
1525
|
+
case CacheBreakCategory.Options:
|
|
1526
|
+
return "symbol-parameter";
|
|
1527
|
+
case CacheBreakCategory.History:
|
|
1528
|
+
return "history";
|
|
1529
|
+
case CacheBreakCategory.Unknown:
|
|
1530
|
+
return "question";
|
|
1531
|
+
}
|
|
1532
|
+
}
|
|
1533
|
+
function findingIcon(severity) {
|
|
1534
|
+
switch (severity) {
|
|
1535
|
+
case CacheInsightSeverity.Ok:
|
|
1536
|
+
return "check";
|
|
1537
|
+
case CacheInsightSeverity.Info:
|
|
1538
|
+
return "info";
|
|
1539
|
+
case CacheInsightSeverity.Warning:
|
|
1540
|
+
return "warning";
|
|
1541
|
+
case CacheInsightSeverity.Critical:
|
|
1542
|
+
return "error";
|
|
1543
|
+
}
|
|
1544
|
+
}
|
|
873
1545
|
function badgeLabel(status) {
|
|
874
1546
|
switch (status) {
|
|
875
1547
|
case CacheDiffKind.Identical:
|
|
876
|
-
return localize(
|
|
1548
|
+
return localize(6658, "identical");
|
|
877
1549
|
case CacheDiffKind.ContentDrift:
|
|
878
|
-
return localize(
|
|
1550
|
+
return localize(6659, "content drift");
|
|
879
1551
|
case CacheDiffKind.LengthChange:
|
|
880
|
-
return localize(
|
|
1552
|
+
return localize(6660, "length change");
|
|
881
1553
|
case CacheDiffKind.OnlyInA:
|
|
882
|
-
return localize(
|
|
1554
|
+
return localize(6661, "only in A");
|
|
883
1555
|
case CacheDiffKind.OnlyInB:
|
|
884
|
-
return localize(
|
|
1556
|
+
return localize(6662, "only in B");
|
|
885
1557
|
}
|
|
886
1558
|
}
|
|
887
1559
|
function describeTruncation(aText, bText) {
|
|
@@ -893,37 +1565,21 @@ function describeTruncation(aText, bText) {
|
|
|
893
1565
|
}
|
|
894
1566
|
if (aMatch && bMatch) {
|
|
895
1567
|
return localize(
|
|
896
|
-
|
|
1568
|
+
6663,
|
|
897
1569
|
"Both sides truncated by the OTel attribute cap (originals were {0} and {1} chars) — diff may be partial.",
|
|
898
1570
|
numberFormatter.value.format(parseInt(aMatch[1], 10)),
|
|
899
1571
|
numberFormatter.value.format(parseInt(bMatch[1], 10))
|
|
900
1572
|
);
|
|
901
1573
|
}
|
|
902
1574
|
const match = (aMatch ?? bMatch);
|
|
903
|
-
const side = aMatch ? ( localize(
|
|
1575
|
+
const side = aMatch ? ( localize(6664, "Previous")) : ( localize(6665, "Current"));
|
|
904
1576
|
return localize(
|
|
905
|
-
|
|
1577
|
+
6666,
|
|
906
1578
|
"{0} side truncated by the OTel attribute cap (original was {1} chars) — diff may be partial.",
|
|
907
1579
|
side,
|
|
908
1580
|
numberFormatter.value.format(parseInt(match[1], 10))
|
|
909
1581
|
);
|
|
910
1582
|
}
|
|
911
|
-
function describeBreakKind(kind, diff, b) {
|
|
912
|
-
const tok = diff.signature.find(t => t.index === diff.break?.index);
|
|
913
|
-
const role = tok?.bRole ?? tok?.aRole ?? "message";
|
|
914
|
-
const bMsg = b.inputMessages[diff.break?.index ?? -1];
|
|
915
|
-
const charsB = bMsg ? numberFormatter.value.format(bMsg.charLength) : undefined;
|
|
916
|
-
switch (kind) {
|
|
917
|
-
case CacheDiffKind.OnlyInB:
|
|
918
|
-
return charsB ? ( localize(6242, "added {0} message ({1} chars)", role, charsB)) : ( localize(6243, "added {0} message", role));
|
|
919
|
-
case CacheDiffKind.OnlyInA:
|
|
920
|
-
return localize(6244, "previous {0} message dropped", role);
|
|
921
|
-
case CacheDiffKind.ContentDrift:
|
|
922
|
-
return charsB ? ( localize(6245, "{0} message body changed ({1} chars)", role, charsB)) : ( localize(6246, "{0} message body changed", role));
|
|
923
|
-
case CacheDiffKind.LengthChange:
|
|
924
|
-
return charsB ? ( localize(6247, "{0} message resized to {1} chars", role, charsB)) : ( localize(6248, "{0} message size changed", role));
|
|
925
|
-
}
|
|
926
|
-
}
|
|
927
1583
|
function computeCacheHit(event) {
|
|
928
1584
|
if (!event.inputTokens || event.cachedTokens === undefined) {
|
|
929
1585
|
return 0;
|
|
@@ -945,9 +1601,9 @@ function describeRequestShape(inputMessages, requestShapeJson) {
|
|
|
945
1601
|
const hasOnlyToolOutput = inputMessages.length > 0 && inputMessages.every(m => m.role === "tool");
|
|
946
1602
|
if (hasPreviousResponseId && hasToolSearchOutput) {
|
|
947
1603
|
return {
|
|
948
|
-
label: ( localize(
|
|
1604
|
+
label: ( localize(6667, "tool_search_output continuation")),
|
|
949
1605
|
description: ( localize(
|
|
950
|
-
|
|
1606
|
+
6668,
|
|
951
1607
|
"Responses API continuation: the displayed input is only the tool-search delta sent over the wire. The provider reconstructs prior context from the previous response id."
|
|
952
1608
|
)),
|
|
953
1609
|
isContinuation: true,
|
|
@@ -956,9 +1612,9 @@ function describeRequestShape(inputMessages, requestShapeJson) {
|
|
|
956
1612
|
}
|
|
957
1613
|
if (hasPreviousResponseId && hasOnlyToolOutput) {
|
|
958
1614
|
return {
|
|
959
|
-
label: ( localize(
|
|
1615
|
+
label: ( localize(6669, "tool output continuation")),
|
|
960
1616
|
description: ( localize(
|
|
961
|
-
|
|
1617
|
+
6670,
|
|
962
1618
|
"Responses API continuation: the displayed input is only the tool-output delta sent over the wire. The provider reconstructs prior context from the previous response id."
|
|
963
1619
|
)),
|
|
964
1620
|
isContinuation: true,
|
|
@@ -967,9 +1623,9 @@ function describeRequestShape(inputMessages, requestShapeJson) {
|
|
|
967
1623
|
}
|
|
968
1624
|
if (hasPreviousResponseId) {
|
|
969
1625
|
return {
|
|
970
|
-
label: ( localize(
|
|
1626
|
+
label: ( localize(6671, "Responses API continuation")),
|
|
971
1627
|
description: ( localize(
|
|
972
|
-
|
|
1628
|
+
6672,
|
|
973
1629
|
"Responses API continuation: the displayed input is only the delta sent over the wire. The provider reconstructs prior context from the previous response id."
|
|
974
1630
|
)),
|
|
975
1631
|
isContinuation: true,
|
|
@@ -978,9 +1634,9 @@ function describeRequestShape(inputMessages, requestShapeJson) {
|
|
|
978
1634
|
}
|
|
979
1635
|
if (hasToolSearchOutput) {
|
|
980
1636
|
return {
|
|
981
|
-
label: ( localize(
|
|
1637
|
+
label: ( localize(6673, "tool_search_output request")),
|
|
982
1638
|
description: ( localize(
|
|
983
|
-
|
|
1639
|
+
6674,
|
|
984
1640
|
"This request contains a Responses API tool_search_output item. No previous-response continuation marker was captured, so the displayed input may be a full or history-sliced request rather than only a continuation delta."
|
|
985
1641
|
)),
|
|
986
1642
|
isContinuation: false,
|
|
@@ -989,14 +1645,14 @@ function describeRequestShape(inputMessages, requestShapeJson) {
|
|
|
989
1645
|
}
|
|
990
1646
|
if (hasOnlyToolOutput) {
|
|
991
1647
|
return {
|
|
992
|
-
label: ( localize(
|
|
1648
|
+
label: ( localize(6675, "tool output request")),
|
|
993
1649
|
description: undefined,
|
|
994
1650
|
isContinuation: false,
|
|
995
1651
|
...common
|
|
996
1652
|
};
|
|
997
1653
|
}
|
|
998
1654
|
return {
|
|
999
|
-
label: ( localize(
|
|
1655
|
+
label: ( localize(6676, "full input request")),
|
|
1000
1656
|
description: undefined,
|
|
1001
1657
|
isContinuation: false,
|
|
1002
1658
|
...common
|
|
@@ -1047,6 +1703,11 @@ function sideOptions(side) {
|
|
|
1047
1703
|
out.model = side.event.model;
|
|
1048
1704
|
}
|
|
1049
1705
|
Object.assign(out, parseOptions(side.content?.requestOptions));
|
|
1706
|
+
const hasEffort = out["output_config.effort"] !== undefined || out["reasoning.effort"] !== undefined || out["reasoning_effort"] !== undefined;
|
|
1707
|
+
const hasThinking = ( ( Object.keys(out)).some(k => k === "thinking" || k.startsWith("thinking.")));
|
|
1708
|
+
if (!hasEffort && hasThinking) {
|
|
1709
|
+
out["output_config.effort"] = ( localize(6677, "(not sent — provider default)"));
|
|
1710
|
+
}
|
|
1050
1711
|
return out;
|
|
1051
1712
|
}
|
|
1052
1713
|
function computeOptionsDiff(a, b) {
|
|
@@ -1112,21 +1773,6 @@ function formatOptionValue(value) {
|
|
|
1112
1773
|
return String(value);
|
|
1113
1774
|
}
|
|
1114
1775
|
}
|
|
1115
|
-
function isLikelyCacheExpiration(hitPct, diff, optionsDiff, systemChanged, toolsChanged) {
|
|
1116
|
-
if (hitPct >= 1) {
|
|
1117
|
-
return false;
|
|
1118
|
-
}
|
|
1119
|
-
if (diff.break) {
|
|
1120
|
-
return false;
|
|
1121
|
-
}
|
|
1122
|
-
if (optionsDiff.length > 0) {
|
|
1123
|
-
return false;
|
|
1124
|
-
}
|
|
1125
|
-
if (systemChanged || toolsChanged) {
|
|
1126
|
-
return false;
|
|
1127
|
-
}
|
|
1128
|
-
return true;
|
|
1129
|
-
}
|
|
1130
1776
|
const DIFF_OPTIONS = {
|
|
1131
1777
|
ignoreTrimWhitespace: false,
|
|
1132
1778
|
maxComputationTimeMs: 200,
|
|
@@ -1213,4 +1859,4 @@ function groupInnerChangesByLine(innerChanges, useOriginal) {
|
|
|
1213
1859
|
return out;
|
|
1214
1860
|
}
|
|
1215
1861
|
|
|
1216
|
-
export { CacheExplorerNavigation, ChatDebugCacheExplorerView };
|
|
1862
|
+
export { CacheExplorerNavigation, ChatDebugCacheExplorerView, agentKey, alignSignatureChunks, computeAgentCounts, defaultAgentSelection, isSameModelTurn, resolveFilteredSelectionIndex };
|