@codingame/monaco-vscode-api 37.1.0 → 37.2.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/missing-services.js +6 -26
- package/package.json +8 -8
- package/services.d.ts +1 -1
- package/services.js +3 -3
- package/tools.d.ts +4 -0
- package/tools.js +24 -1
- package/vscode/src/vs/platform/product/common/product.js +1 -1
- package/vscode/src/vs/platform/webWorker/browser/webWorkerServiceImpl.js +2 -2
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.d.ts +63 -0
- package/vscode/src/vs/workbench/api/browser/mainThreadDocuments.js +305 -0
- package/vscode/src/vs/workbench/api/common/extHost.protocol.d.ts +2 -2
- package/vscode/src/vs/workbench/api/common/extHostLanguageModelTools.js +1 -2
- package/vscode/src/vs/workbench/api/common/extHostTypeConverters.js +1 -1
- package/vscode/src/vs/workbench/browser/media/code-icon.svg +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatConstants.js +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsBanner.js +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariableEntries.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageBuffer.js +29 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatService.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginInstallService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginSource.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatParserTypes.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.d.ts +3 -0
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.js +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookBrowser.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/notebook/browser/services/notebookEditorService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookCommon.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorInput.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookService.service.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/AISearch/aiSearchModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModel.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/notebookSearch/notebookSearchModelBase.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/folderMatch.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchTreeModel/searchTreeCommon.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/search/browser/searchView.js +4 -3
- package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.d.ts +34 -0
- package/vscode/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.js +72 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.d.ts +44 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedInput.js +96 -0
- package/vscode/src/vs/workbench/contrib/welcomeGettingStarted/browser/media/gettingStarted.css +1148 -0
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.d.ts +81 -0
- package/vscode/src/vs/workbench/contrib/welcomeOnboarding/common/onboardingTypes.js +97 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.d.ts +32 -0
- package/vscode/src/vs/workbench/services/extensions/common/extHostCustomers.js +45 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.d.ts +0 -7
- package/vscode/src/vs/platform/agentHost/common/agentHostEnablementService.js +0 -92
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.d.ts +0 -12
- package/vscode/src/vs/platform/layout/browser/zIndexRegistry.js +0 -64
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.d.ts +0 -262
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel.js +0 -865
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatDynamicVariables.js +0 -311
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +0 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessionDescription.js +0 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -231
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -1850
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.d.ts +0 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +0 -85
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.d.ts +0 -140
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.js +0 -186
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatDynamicVariablesConstant.js +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/common/attachments/chatVariables.js +0 -17
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.d.ts +0 -253
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugService.js +0 -20
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.d.ts +0 -34
- package/vscode/src/vs/workbench/contrib/chat/common/chatImageExtraction.js +0 -194
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -87
- package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -69
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.d.ts +0 -300
- package/vscode/src/vs/workbench/contrib/chat/common/customizationHarnessService.js +0 -272
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -178
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -78
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -51
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -67
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -294
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -212
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -955
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/computeAutomaticInstructions.js +0 -697
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.d.ts +0 -150
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/config/config.js +0 -142
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -77
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.d.ts +0 -92
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/extensionPromptFileService.js +0 -335
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -235
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1673
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -202
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -872
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.d.ts +0 -35
- package/vscode/src/vs/workbench/contrib/chat/common/requestParser/chatRequestParser.js +0 -289
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.d.ts +0 -72
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/askQuestionsTool.js +0 -600
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/confirmationTool.js +0 -239
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.js +0 -143
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/manageTodoListTool.js +0 -298
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.d.ts +0 -25
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/reviewPlanTool.js +0 -177
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.d.ts +0 -73
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/runSubagentTool.js +0 -577
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactRulesTool.js +0 -90
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.d.ts +0 -16
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/setArtifactsTool.js +0 -130
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.d.ts +0 -12
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/taskCompleteTool.js +0 -53
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolHelpers.js +0 -12
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.js +0 -92
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -38
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -518
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsParametersSchema.js +0 -231
- package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/chat/common/tools/terminalToolIds.js +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/cellOutputActions.js +0 -283
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.d.ts +0 -91
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/coreActions.js +0 -340
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/foldingController.js +0 -272
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebook.css +0 -686
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellChat.css +0 -348
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellEditorHint.css +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellInsertToolbar.css +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellOutput.css +0 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellStatusBar.css +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookCellTitleToolbar.css +0 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditController.css +0 -55
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookChatEditorOverlay.css +0 -63
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookDnd.css +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookEditorStickyScroll.css +0 -63
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFocusIndicator.css +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookFolding.css +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookKernelActionViewItem.css +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookOutline.css +0 -61
- package/vscode/src/vs/workbench/contrib/notebook/browser/media/notebookToolbar.css +0 -102
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookAccessibilityProvider.js +0 -131
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookCellLayoutManager.js +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.d.ts +0 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditor.js +0 -673
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorExtensions.js +0 -37
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.d.ts +0 -354
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookEditorWidget.js +0 -2926
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.d.ts +0 -29
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookIcons.js +0 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookLogger.js +0 -19
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.d.ts +0 -200
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookOptions.js +0 -591
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.d.ts +0 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/notebookViewEvents.js +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.d.ts +0 -99
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellPart.js +0 -131
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellActionView.js +0 -115
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellComments.js +0 -158
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.d.ts +0 -40
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellContextKeys.js +0 -183
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDecorations.js +0 -66
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.d.ts +0 -52
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDnd.js +0 -429
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellDragRenderer.js +0 -108
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellEditorOptions.js +0 -221
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.d.ts +0 -17
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellExecution.js +0 -142
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.d.ts +0 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocus.js +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellFocusIndicator.js +0 -104
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.d.ts +0 -92
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellOutput.js +0 -762
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.d.ts +0 -15
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellProgressBar.js +0 -58
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.js +0 -357
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbarStickyScroll.js +0 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.d.ts +0 -47
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellToolbars.js +0 -260
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/cellWidgets.js +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/chat/cellChatPart.js +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.d.ts +0 -182
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCell.js +0 -796
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellExecutionIcon.js +0 -79
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/codeCellRunToolbar.js +0 -126
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.d.ts +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellInput.js +0 -32
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/collapsedCellOutput.js +0 -50
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/foldedCellHint.js +0 -119
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.d.ts +0 -57
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/cellParts/markupCell.js +0 -443
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellAnchor.js +0 -56
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellEditorPool.js +0 -121
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.d.ts +0 -152
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellList.js +0 -1288
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.d.ts +0 -59
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookCellListView.js +0 -287
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.d.ts +0 -117
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/notebookRenderingCommon.js +0 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.d.ts +0 -222
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/backLayerWebView.js +0 -1840
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.d.ts +0 -63
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/cellRenderer.js +0 -449
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewMessages.d.ts +0 -432
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.d.ts +0 -18
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewPreloads.js +0 -2546
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.d.ts +0 -8
- package/vscode/src/vs/workbench/contrib/notebook/browser/view/renderers/webviewThemeMapping.js +0 -105
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.d.ts +0 -137
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/baseCellViewModel.js +0 -646
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.d.ts +0 -21
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellEditorOptions.js +0 -101
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputTextHelper.js +0 -111
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellOutputViewModel.js +0 -65
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.d.ts +0 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/cellSelectionCollection.js +0 -49
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.d.ts +0 -89
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/codeCellViewModel.js +0 -472
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/eventDispatcher.js +0 -34
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/foldingModel.js +0 -275
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.d.ts +0 -69
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/markupCellViewModel.js +0 -269
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.d.ts +0 -125
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/notebookViewModelImpl.js +0 -958
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewModel/viewContext.js +0 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookCellOverlays.js +0 -101
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.d.ts +0 -65
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorStickyScroll.js +0 -458
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.d.ts +0 -80
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorToolbar.js +0 -708
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.d.ts +0 -37
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookEditorWidgetContextKeys.js +0 -193
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookHorizontalTracker.js +0 -62
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.d.ts +0 -108
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelQuickPickStrategy.js +0 -717
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookKernelView.js +0 -183
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.d.ts +0 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookOverviewRuler.js +0 -134
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.d.ts +0 -20
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookTopCellToolbar.js +0 -135
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/browser/viewParts/notebookViewZones.js +0 -213
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.d.ts +0 -27
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellOutputTextModel.js +0 -104
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.d.ts +0 -115
- package/vscode/src/vs/workbench/contrib/notebook/common/model/notebookCellTextModel.js +0 -480
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.d.ts +0 -87
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookEditorModel.js +0 -352
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.d.ts +0 -81
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookExecutionStateService.js +0 -9
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/notebook/common/notebookPerformance.js +0 -19
|
@@ -1,865 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { __decorate, __param } from '../../../../../../../../external/tslib/tslib.es6.js';
|
|
3
|
-
import { ThrottledDelayer } from '../../../../../base/common/async.js';
|
|
4
|
-
import { CancellationToken } from '../../../../../base/common/cancellation.js';
|
|
5
|
-
import { Codicon } from '../../../../../base/common/codicons.js';
|
|
6
|
-
import { Emitter } from '../../../../../base/common/event.js';
|
|
7
|
-
import { Disposable, DisposableMap } from '../../../../../base/common/lifecycle.js';
|
|
8
|
-
import { ResourceMap, ResourceSet } from '../../../../../base/common/map.js';
|
|
9
|
-
import { MarshalledId } from '../../../../../base/common/marshallingIds.js';
|
|
10
|
-
import { safeStringify } from '../../../../../base/common/objects.js';
|
|
11
|
-
import '../../../../../base/common/observableInternal/index.js';
|
|
12
|
-
import { ThemeIcon } from '../../../../../base/common/themables.js';
|
|
13
|
-
import { URI } from '../../../../../base/common/uri.js';
|
|
14
|
-
import { localize } from '../../../../../nls.js';
|
|
15
|
-
import { IInstantiationService } from '../../../../../platform/instantiation/common/instantiation.js';
|
|
16
|
-
import { LogLevel } from '../../../../../platform/log/common/log.js';
|
|
17
|
-
import { ILogService } from '../../../../../platform/log/common/log.service.js';
|
|
18
|
-
import { IProductService } from '../../../../../platform/product/common/productService.service.js';
|
|
19
|
-
import { Registry } from '../../../../../platform/registry/common/platform.js';
|
|
20
|
-
import { StorageScope, StorageTarget } from '../../../../../platform/storage/common/storage.js';
|
|
21
|
-
import { IStorageService } from '../../../../../platform/storage/common/storage.service.js';
|
|
22
|
-
import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.service.js';
|
|
23
|
-
import { IWorkspaceTrustManagementService } from '../../../../../platform/workspace/common/workspaceTrust.service.js';
|
|
24
|
-
import { IChatEntitlementService } from '../../../../services/chat/common/chatEntitlementService.service.js';
|
|
25
|
-
import { ILifecycleService } from '../../../../services/lifecycle/common/lifecycle.service.js';
|
|
26
|
-
import { Extensions } from '../../../../services/output/common/output.js';
|
|
27
|
-
import { IOutputService } from '../../../../services/output/common/output.service.js';
|
|
28
|
-
import { isAgentHostTarget, ChatSessionStatus, isSessionInProgressStatus } from '../../common/chatSessionsService.js';
|
|
29
|
-
import { IChatSessionsService } from '../../common/chatSessionsService.service.js';
|
|
30
|
-
import { getChatSessionType } from '../../common/model/chatUri.js';
|
|
31
|
-
import { IChatWidgetService } from '../chat.service.js';
|
|
32
|
-
import { dedupeMigratedCopilotCliSessions } from '../copilotCliEventsUri.js';
|
|
33
|
-
import { AgentSessionProviders, getAgentSessionProvider, getAgentSessionProviderName, getAgentSessionProviderIcon, isBuiltInAgentSessionProvider } from './agentSessions.js';
|
|
34
|
-
import { observableSignalFromEvent } from '../../../../../base/common/observableInternal/observables/observableSignalFromEvent.js';
|
|
35
|
-
import { derived } from '../../../../../base/common/observableInternal/observables/derived.js';
|
|
36
|
-
|
|
37
|
-
var AgentSessionsModel_1, AgentSessionsCache_1;
|
|
38
|
-
function hasValidDiff(changes) {
|
|
39
|
-
if (!changes) {
|
|
40
|
-
return false;
|
|
41
|
-
}
|
|
42
|
-
if (changes instanceof Array) {
|
|
43
|
-
return changes.length > 0;
|
|
44
|
-
}
|
|
45
|
-
return changes.files > 0 || changes.insertions > 0 || changes.deletions > 0;
|
|
46
|
-
}
|
|
47
|
-
function getAgentChangesSummary(changes) {
|
|
48
|
-
if (!changes) {
|
|
49
|
-
return;
|
|
50
|
-
}
|
|
51
|
-
if (!(changes instanceof Array)) {
|
|
52
|
-
return changes;
|
|
53
|
-
}
|
|
54
|
-
let insertions = 0;
|
|
55
|
-
let deletions = 0;
|
|
56
|
-
for (const change of changes) {
|
|
57
|
-
insertions += change.insertions;
|
|
58
|
-
deletions += change.deletions;
|
|
59
|
-
}
|
|
60
|
-
return {
|
|
61
|
-
files: changes.length,
|
|
62
|
-
insertions,
|
|
63
|
-
deletions
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
function isLocalAgentSessionItem(session) {
|
|
67
|
-
return session.providerType === AgentSessionProviders.Local;
|
|
68
|
-
}
|
|
69
|
-
function getAgentSessionPullRequestUri(session) {
|
|
70
|
-
const metadata = session.metadata;
|
|
71
|
-
if (!metadata) {
|
|
72
|
-
return undefined;
|
|
73
|
-
}
|
|
74
|
-
const url = metadata.pullRequestUrl;
|
|
75
|
-
if (typeof url === "string" && url) {
|
|
76
|
-
try {
|
|
77
|
-
return ( URI.parse(url));
|
|
78
|
-
} catch {}
|
|
79
|
-
}
|
|
80
|
-
const prNumber = metadata.pullRequestNumber;
|
|
81
|
-
const owner = metadata.owner;
|
|
82
|
-
const name = metadata.name;
|
|
83
|
-
if (typeof prNumber === "number" && typeof owner === "string" && owner && typeof name === "string" && name) {
|
|
84
|
-
return ( URI.parse(`https://github.com/${owner}/${name}/pull/${prNumber}`));
|
|
85
|
-
}
|
|
86
|
-
return undefined;
|
|
87
|
-
}
|
|
88
|
-
function getAgentSessionPullRequestContextValue(session) {
|
|
89
|
-
return getAgentSessionPullRequestUri(session) ? "available" : "none";
|
|
90
|
-
}
|
|
91
|
-
function isAgentHostAgentSessionItem(session) {
|
|
92
|
-
return isAgentHostTarget(session.providerType);
|
|
93
|
-
}
|
|
94
|
-
function isAgentSession(obj) {
|
|
95
|
-
const session = obj;
|
|
96
|
-
return URI.isUri(session?.resource) && typeof session.isArchived === "function" && typeof session.setArchived === "function" && typeof session.isPinned === "function" && typeof session.setPinned === "function" && typeof session.isRead === "function" && typeof session.isMarkedUnread === "function" && typeof session.setRead === "function";
|
|
97
|
-
}
|
|
98
|
-
function isAgentSessionsModel(obj) {
|
|
99
|
-
const sessionsModel = obj;
|
|
100
|
-
return Array.isArray(sessionsModel?.sessions) && typeof sessionsModel?.getSession === "function";
|
|
101
|
-
}
|
|
102
|
-
var AgentSessionSection;
|
|
103
|
-
(function(AgentSessionSection) {
|
|
104
|
-
AgentSessionSection["Pinned"] = "pinned";
|
|
105
|
-
AgentSessionSection["Today"] = "today";
|
|
106
|
-
AgentSessionSection["Yesterday"] = "yesterday";
|
|
107
|
-
AgentSessionSection["Week"] = "week";
|
|
108
|
-
AgentSessionSection["Older"] = "older";
|
|
109
|
-
AgentSessionSection["Archived"] = "archived";
|
|
110
|
-
AgentSessionSection["More"] = "more";
|
|
111
|
-
AgentSessionSection["Repository"] = "repository";
|
|
112
|
-
})(AgentSessionSection || (AgentSessionSection = {}));
|
|
113
|
-
function isAgentSessionSection(obj) {
|
|
114
|
-
const candidate = obj;
|
|
115
|
-
return typeof candidate.section === "string" && Array.isArray(candidate.sessions);
|
|
116
|
-
}
|
|
117
|
-
function isAgentSessionShowMore(obj) {
|
|
118
|
-
return obj?.showMore === true;
|
|
119
|
-
}
|
|
120
|
-
function isAgentSessionShowLess(obj) {
|
|
121
|
-
return obj?.showLess === true;
|
|
122
|
-
}
|
|
123
|
-
function isMarshalledAgentSessionContext(thing) {
|
|
124
|
-
if (typeof thing === "object" && thing !== null) {
|
|
125
|
-
const candidate = thing;
|
|
126
|
-
return candidate.$mid === MarshalledId.AgentSessionContext && typeof candidate.session === "object" && candidate.session !== null;
|
|
127
|
-
}
|
|
128
|
-
return false;
|
|
129
|
-
}
|
|
130
|
-
const agentSessionsOutputChannelId = "agentSessionsOutput";
|
|
131
|
-
const agentSessionsOutputChannelLabel = ( localize(6235, "Agent Sessions"));
|
|
132
|
-
function statusToString(status) {
|
|
133
|
-
switch (status) {
|
|
134
|
-
case ChatSessionStatus.Failed:
|
|
135
|
-
return "Failed";
|
|
136
|
-
case ChatSessionStatus.Completed:
|
|
137
|
-
return "Completed";
|
|
138
|
-
case ChatSessionStatus.InProgress:
|
|
139
|
-
return "InProgress";
|
|
140
|
-
case ChatSessionStatus.NeedsInput:
|
|
141
|
-
return "NeedsInput";
|
|
142
|
-
default:
|
|
143
|
-
return `Unknown(${status})`;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
let AgentSessionsLogger = class AgentSessionsLogger extends Disposable {
|
|
147
|
-
constructor(getSessionsData, logService, outputService, chatEntitlementService) {
|
|
148
|
-
super();
|
|
149
|
-
this.getSessionsData = getSessionsData;
|
|
150
|
-
this.logService = logService;
|
|
151
|
-
this.outputService = outputService;
|
|
152
|
-
this.chatEntitlementService = chatEntitlementService;
|
|
153
|
-
this.isChannelRegistered = false;
|
|
154
|
-
this.updateChannelRegistration();
|
|
155
|
-
this.registerListeners();
|
|
156
|
-
}
|
|
157
|
-
updateChannelRegistration() {
|
|
158
|
-
const chatDisabled = this.chatEntitlementService.sentiment.hidden;
|
|
159
|
-
if (chatDisabled && this.isChannelRegistered) {
|
|
160
|
-
( Registry.as(Extensions.OutputChannels)).removeChannel(agentSessionsOutputChannelId);
|
|
161
|
-
this.isChannelRegistered = false;
|
|
162
|
-
} else if (!chatDisabled && !this.isChannelRegistered) {
|
|
163
|
-
( Registry.as(Extensions.OutputChannels)).registerChannel({
|
|
164
|
-
id: agentSessionsOutputChannelId,
|
|
165
|
-
label: agentSessionsOutputChannelLabel,
|
|
166
|
-
log: false
|
|
167
|
-
});
|
|
168
|
-
this.isChannelRegistered = true;
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
registerListeners() {
|
|
172
|
-
this._register(this.logService.onDidChangeLogLevel(level => {
|
|
173
|
-
if (level === LogLevel.Trace) {
|
|
174
|
-
this.logAllStatsIfTrace("Log level changed to trace");
|
|
175
|
-
}
|
|
176
|
-
}));
|
|
177
|
-
this._register(this.chatEntitlementService.onDidChangeSentiment(() => {
|
|
178
|
-
this.updateChannelRegistration();
|
|
179
|
-
}));
|
|
180
|
-
}
|
|
181
|
-
logIfTrace(msg) {
|
|
182
|
-
if (this.logService.getLevel() !== LogLevel.Trace) {
|
|
183
|
-
return;
|
|
184
|
-
}
|
|
185
|
-
this.trace(`[Agent Sessions] ${msg}`);
|
|
186
|
-
}
|
|
187
|
-
logAllStatsIfTrace(reason) {
|
|
188
|
-
if (this.logService.getLevel() !== LogLevel.Trace) {
|
|
189
|
-
return;
|
|
190
|
-
}
|
|
191
|
-
this.logAllSessions(reason);
|
|
192
|
-
this.logSessionStates();
|
|
193
|
-
}
|
|
194
|
-
logAllSessions(reason) {
|
|
195
|
-
const {
|
|
196
|
-
sessions,
|
|
197
|
-
sessionStates
|
|
198
|
-
} = this.getSessionsData();
|
|
199
|
-
const lines = [];
|
|
200
|
-
lines.push(`=== Agent Sessions (${reason}) ===`);
|
|
201
|
-
let count = 0;
|
|
202
|
-
for (const session of sessions) {
|
|
203
|
-
count++;
|
|
204
|
-
const state = sessionStates.get(session.resource);
|
|
205
|
-
lines.push(`--- Session: ${session.label} ---`);
|
|
206
|
-
lines.push(` Resource: ${( session.resource.toString())}`);
|
|
207
|
-
lines.push(` Provider Type: ${session.providerType}`);
|
|
208
|
-
lines.push(` Provider Label: ${session.providerLabel}`);
|
|
209
|
-
lines.push(` Status: ${statusToString(session.status)}`);
|
|
210
|
-
lines.push(` Icon: ${session.icon.id}`);
|
|
211
|
-
if (session.description) {
|
|
212
|
-
lines.push(
|
|
213
|
-
` Description: ${typeof session.description === "string" ? session.description : session.description.value}`
|
|
214
|
-
);
|
|
215
|
-
}
|
|
216
|
-
if (session.badge) {
|
|
217
|
-
lines.push(
|
|
218
|
-
` Badge: ${typeof session.badge === "string" ? session.badge : session.badge.value}`
|
|
219
|
-
);
|
|
220
|
-
}
|
|
221
|
-
if (session.tooltip) {
|
|
222
|
-
lines.push(
|
|
223
|
-
` Tooltip: ${typeof session.tooltip === "string" ? session.tooltip : session.tooltip.value}`
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
lines.push(` Timing:`);
|
|
227
|
-
lines.push(` Created: ${session.timing.created ? ( new Date(session.timing.created)).toISOString() : "N/A"}`);
|
|
228
|
-
lines.push(
|
|
229
|
-
` Last Request Started: ${session.timing.lastRequestStarted ? ( new Date(session.timing.lastRequestStarted)).toISOString() : "N/A"}`
|
|
230
|
-
);
|
|
231
|
-
lines.push(
|
|
232
|
-
` Last Request Ended: ${session.timing.lastRequestEnded ? ( new Date(session.timing.lastRequestEnded)).toISOString() : "N/A"}`
|
|
233
|
-
);
|
|
234
|
-
if (session.changes) {
|
|
235
|
-
const summary = getAgentChangesSummary(session.changes);
|
|
236
|
-
if (summary) {
|
|
237
|
-
lines.push(
|
|
238
|
-
` Changes: ${summary.files} files, +${summary.insertions} -${summary.deletions}`
|
|
239
|
-
);
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
if (session.metadata && ( Object.keys(session.metadata)).length > 0) {
|
|
243
|
-
lines.push(` Metadata:`);
|
|
244
|
-
for (const [key, value] of Object.entries(session.metadata)) {
|
|
245
|
-
const renderedValue = typeof value === "string" ? value : safeStringify(value);
|
|
246
|
-
lines.push(` ${key}: ${renderedValue}`);
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
lines.push(` State:`);
|
|
250
|
-
lines.push(` Archived (provider): ${session.archived ?? "N/A"}`);
|
|
251
|
-
lines.push(` Archived (computed): ${session.isArchived()}`);
|
|
252
|
-
lines.push(` Archived (stored): ${state?.archived ?? "N/A"}`);
|
|
253
|
-
lines.push(` Pinned: ${session.isPinned()}`);
|
|
254
|
-
lines.push(` Pinned (stored): ${state?.pinned ?? "N/A"}`);
|
|
255
|
-
lines.push(` Read: ${session.isRead()}`);
|
|
256
|
-
lines.push(` Read date (stored): ${state?.read ? ( new Date(state.read)).toISOString() : "N/A"}`);
|
|
257
|
-
lines.push("");
|
|
258
|
-
}
|
|
259
|
-
lines.unshift(`Total sessions: ${count}`, "");
|
|
260
|
-
lines.push(`=== End Agent Sessions ===`);
|
|
261
|
-
this.trace(lines.join("\n"));
|
|
262
|
-
}
|
|
263
|
-
logSessionStates() {
|
|
264
|
-
const {
|
|
265
|
-
sessionStates
|
|
266
|
-
} = this.getSessionsData();
|
|
267
|
-
const lines = [];
|
|
268
|
-
lines.push(`=== Session States ===`);
|
|
269
|
-
lines.push(`Total stored states: ${sessionStates.size}`);
|
|
270
|
-
lines.push("");
|
|
271
|
-
for (const [resource, state] of sessionStates) {
|
|
272
|
-
lines.push(`URI: ${( resource.toString())}`);
|
|
273
|
-
lines.push(` Archived: ${state.archived}`);
|
|
274
|
-
lines.push(` Pinned: ${state.pinned}`);
|
|
275
|
-
lines.push(` Read: ${state.read ? ( new Date(state.read)).toISOString() : "0 (unread)"}`);
|
|
276
|
-
lines.push("");
|
|
277
|
-
}
|
|
278
|
-
lines.push(`=== End Session States ===`);
|
|
279
|
-
this.trace(lines.join("\n"));
|
|
280
|
-
}
|
|
281
|
-
trace(msg) {
|
|
282
|
-
const channel = this.outputService.getChannel(agentSessionsOutputChannelId);
|
|
283
|
-
if (!channel) {
|
|
284
|
-
return;
|
|
285
|
-
}
|
|
286
|
-
channel.append(`${msg}\n`);
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
AgentSessionsLogger = ( __decorate([( __param(1, ILogService)), ( __param(2, IOutputService)), ( __param(3, IChatEntitlementService))], AgentSessionsLogger));
|
|
290
|
-
let AgentSessionsModel = class AgentSessionsModel extends Disposable {
|
|
291
|
-
static {
|
|
292
|
-
AgentSessionsModel_1 = this;
|
|
293
|
-
}
|
|
294
|
-
get resolved() {
|
|
295
|
-
return this._resolved;
|
|
296
|
-
}
|
|
297
|
-
get sessions() {
|
|
298
|
-
return this._dedupeMigratedCopilotCliSessions(Array.from(( this._sessions.values())));
|
|
299
|
-
}
|
|
300
|
-
constructor(
|
|
301
|
-
chatSessionsService,
|
|
302
|
-
lifecycleService,
|
|
303
|
-
instantiationService,
|
|
304
|
-
storageService,
|
|
305
|
-
productService,
|
|
306
|
-
chatWidgetService,
|
|
307
|
-
workspaceContextService,
|
|
308
|
-
workspaceTrustManagementService,
|
|
309
|
-
chatEntitlementService
|
|
310
|
-
) {
|
|
311
|
-
super();
|
|
312
|
-
this.chatSessionsService = chatSessionsService;
|
|
313
|
-
this.lifecycleService = lifecycleService;
|
|
314
|
-
this.instantiationService = instantiationService;
|
|
315
|
-
this.storageService = storageService;
|
|
316
|
-
this.productService = productService;
|
|
317
|
-
this.chatWidgetService = chatWidgetService;
|
|
318
|
-
this.workspaceContextService = workspaceContextService;
|
|
319
|
-
this.workspaceTrustManagementService = workspaceTrustManagementService;
|
|
320
|
-
this.chatEntitlementService = chatEntitlementService;
|
|
321
|
-
this._onWillResolve = this._register(( new Emitter()));
|
|
322
|
-
this.onWillResolve = this._onWillResolve.event;
|
|
323
|
-
this._onDidResolve = this._register(( new Emitter()));
|
|
324
|
-
this.onDidResolve = this._onDidResolve.event;
|
|
325
|
-
this._onDidChangeSessions = this._register(( new Emitter()));
|
|
326
|
-
this.onDidChangeSessions = this._onDidChangeSessions.event;
|
|
327
|
-
this._onDidChangeSessionArchivedState = this._register(( new Emitter()));
|
|
328
|
-
this.onDidChangeSessionArchivedState = this._onDidChangeSessionArchivedState.event;
|
|
329
|
-
this._resolved = false;
|
|
330
|
-
this.resolvers = this._register(( new DisposableMap()));
|
|
331
|
-
this._sessionObservables = ( new ResourceMap());
|
|
332
|
-
this._resolvedResources = ( new ResourceSet());
|
|
333
|
-
this.explicitlyMarkedUnreadSessions = ( new ResourceSet());
|
|
334
|
-
this.migratedReadResources = ( new ResourceSet());
|
|
335
|
-
this._sessions = ( new ResourceMap());
|
|
336
|
-
this.cache = this.instantiationService.createInstance(AgentSessionsCache);
|
|
337
|
-
for (const data of this.cache.loadCachedSessions()) {
|
|
338
|
-
const session = this.toAgentSession(data);
|
|
339
|
-
this._sessions.set(session.resource, session);
|
|
340
|
-
}
|
|
341
|
-
this.sessionStates = this.cache.loadSessionStates();
|
|
342
|
-
this.logger = this._register(this.instantiationService.createInstance(AgentSessionsLogger, () => ({
|
|
343
|
-
sessions: ( this._sessions.values()),
|
|
344
|
-
sessionStates: this.sessionStates
|
|
345
|
-
})));
|
|
346
|
-
this.logger.logAllStatsIfTrace("Loaded cached sessions");
|
|
347
|
-
this.readDateBaseline = this.resolveReadDateBaseline();
|
|
348
|
-
this.loadMigratedReadResources();
|
|
349
|
-
this.registerListeners();
|
|
350
|
-
}
|
|
351
|
-
registerListeners() {
|
|
352
|
-
this._register(this.chatSessionsService.onDidChangeItemsProviders((
|
|
353
|
-
{
|
|
354
|
-
chatSessionType
|
|
355
|
-
}
|
|
356
|
-
) => this.resolve(chatSessionType)));
|
|
357
|
-
this._register(
|
|
358
|
-
this.chatSessionsService.onDidChangeAvailability(() => this.resolve(undefined))
|
|
359
|
-
);
|
|
360
|
-
this._register(this.chatSessionsService.onDidChangeSessionItems(delta => {
|
|
361
|
-
const changedChatSessionTypes = ( new Set());
|
|
362
|
-
for (const resource of delta.addedOrUpdated ?? []) {
|
|
363
|
-
changedChatSessionTypes.add(getChatSessionType(resource.resource));
|
|
364
|
-
}
|
|
365
|
-
for (const resource of delta.removed ?? []) {
|
|
366
|
-
changedChatSessionTypes.add(getChatSessionType(resource));
|
|
367
|
-
}
|
|
368
|
-
for (const chatSessionType of changedChatSessionTypes) {
|
|
369
|
-
this.resolveProvider(chatSessionType, {
|
|
370
|
-
refreshProvider: false
|
|
371
|
-
});
|
|
372
|
-
}
|
|
373
|
-
}));
|
|
374
|
-
this._register(
|
|
375
|
-
this.workspaceContextService.onDidChangeWorkspaceFolders(() => this.resolve(undefined))
|
|
376
|
-
);
|
|
377
|
-
this._register(
|
|
378
|
-
this.workspaceTrustManagementService.onDidChangeTrust(() => this.resolve(undefined))
|
|
379
|
-
);
|
|
380
|
-
this._register(this.storageService.onWillSaveState(() => {
|
|
381
|
-
this.cache.saveCachedSessions(Array.from(( this._sessions.values())));
|
|
382
|
-
this.cache.saveSessionStates(this.sessionStates);
|
|
383
|
-
}));
|
|
384
|
-
}
|
|
385
|
-
getSession(resource) {
|
|
386
|
-
return this._sessions.get(resource);
|
|
387
|
-
}
|
|
388
|
-
_dedupeMigratedCopilotCliSessions(sessions) {
|
|
389
|
-
return dedupeMigratedCopilotCliSessions(sessions, session => session.resource);
|
|
390
|
-
}
|
|
391
|
-
observeSession(resource) {
|
|
392
|
-
if (!( this._resolvedResources.has(resource))) {
|
|
393
|
-
this._resolvedResources.add(resource);
|
|
394
|
-
const sessionType = getChatSessionType(resource);
|
|
395
|
-
this.chatSessionsService.resolveChatSessionItem(sessionType, resource, CancellationToken.None).catch(
|
|
396
|
-
error => this.logger.logIfTrace(`observeSession: resolve failed for ${( resource.toString())}: ${error instanceof Error ? error.message : String(error)}`)
|
|
397
|
-
);
|
|
398
|
-
}
|
|
399
|
-
let observable = this._sessionObservables.get(resource);
|
|
400
|
-
if (!observable) {
|
|
401
|
-
this._changedSignal ??= observableSignalFromEvent("agentSessionsChanged", this.onDidChangeSessions);
|
|
402
|
-
const signal = this._changedSignal;
|
|
403
|
-
observable = derived(reader => {
|
|
404
|
-
signal.read(reader);
|
|
405
|
-
return this._sessions.get(resource);
|
|
406
|
-
});
|
|
407
|
-
this._sessionObservables.set(resource, observable);
|
|
408
|
-
}
|
|
409
|
-
return observable;
|
|
410
|
-
}
|
|
411
|
-
async resolve(provider) {
|
|
412
|
-
const providers = Array.isArray(provider) ? provider : provider !== undefined ? [provider] : this.chatSessionsService.getRegisteredChatSessionItemProviders();
|
|
413
|
-
await Promise.all(( providers.map(provider => this.resolveProvider(provider, {
|
|
414
|
-
refreshProvider: true
|
|
415
|
-
}))));
|
|
416
|
-
}
|
|
417
|
-
resolveProvider(provider, options) {
|
|
418
|
-
if (this.chatEntitlementService.sentiment.hidden) {
|
|
419
|
-
return Promise.resolve();
|
|
420
|
-
}
|
|
421
|
-
let resolver = this.resolvers.get(provider);
|
|
422
|
-
if (!resolver) {
|
|
423
|
-
resolver = ( new ThrottledDelayer(500));
|
|
424
|
-
this.resolvers.set(provider, resolver);
|
|
425
|
-
}
|
|
426
|
-
return resolver.trigger(async token => {
|
|
427
|
-
if (token.isCancellationRequested || this.lifecycleService.willShutdown) {
|
|
428
|
-
return;
|
|
429
|
-
}
|
|
430
|
-
try {
|
|
431
|
-
this._onWillResolve.fire(provider);
|
|
432
|
-
return await this.doResolveProvider(provider, options, token);
|
|
433
|
-
} catch (error) {
|
|
434
|
-
this.logger.logIfTrace(
|
|
435
|
-
`Error resolving sessions for provider ${provider}: ${error instanceof Error ? error.stack : String(error)}`
|
|
436
|
-
);
|
|
437
|
-
} finally {
|
|
438
|
-
this._onDidResolve.fire(provider);
|
|
439
|
-
}
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
async doResolveProvider(provider, options, token) {
|
|
443
|
-
if (options.refreshProvider) {
|
|
444
|
-
await this.chatSessionsService.refreshChatSessionItems([provider], token);
|
|
445
|
-
for (const resource of [...this._resolvedResources]) {
|
|
446
|
-
if (getChatSessionType(resource) === provider) {
|
|
447
|
-
this._resolvedResources.delete(resource);
|
|
448
|
-
if (( this._sessionObservables.has(resource))) {
|
|
449
|
-
this.observeSession(resource);
|
|
450
|
-
}
|
|
451
|
-
}
|
|
452
|
-
}
|
|
453
|
-
}
|
|
454
|
-
const mapSessionContributionToType = ( new Map());
|
|
455
|
-
for (const contribution of this.chatSessionsService.getAllChatSessionContributions()) {
|
|
456
|
-
mapSessionContributionToType.set(contribution.type, contribution);
|
|
457
|
-
}
|
|
458
|
-
const registeredProviders = ( new Set(this.chatSessionsService.getRegisteredChatSessionItemProviders()));
|
|
459
|
-
const sessions = ( new ResourceMap());
|
|
460
|
-
for await (const {
|
|
461
|
-
chatSessionType,
|
|
462
|
-
items: providerSessions
|
|
463
|
-
} of this.chatSessionsService.getChatSessionItems([provider], token)) {
|
|
464
|
-
if (token.isCancellationRequested) {
|
|
465
|
-
return;
|
|
466
|
-
}
|
|
467
|
-
for (const session of providerSessions) {
|
|
468
|
-
let icon;
|
|
469
|
-
let providerLabel;
|
|
470
|
-
const agentSessionProvider = getAgentSessionProvider(chatSessionType);
|
|
471
|
-
if (agentSessionProvider !== undefined) {
|
|
472
|
-
providerLabel = getAgentSessionProviderName(agentSessionProvider);
|
|
473
|
-
icon = getAgentSessionProviderIcon(agentSessionProvider);
|
|
474
|
-
} else {
|
|
475
|
-
providerLabel = mapSessionContributionToType.get(chatSessionType)?.name ?? chatSessionType;
|
|
476
|
-
icon = session.iconPath ?? Codicon.terminal;
|
|
477
|
-
}
|
|
478
|
-
const changes = session.changes ?? getAgentChangesSummary(this._sessions.get(session.resource)?.changes);
|
|
479
|
-
const normalizedChanges = changes && !(changes instanceof Array) ? {
|
|
480
|
-
files: changes.files,
|
|
481
|
-
insertions: changes.insertions,
|
|
482
|
-
deletions: changes.deletions
|
|
483
|
-
} : changes;
|
|
484
|
-
const shouldKeepOpenSessionRead = session.isRead === false && this.chatSessionsService.canSetChatSessionItemRead(session.resource) && !( this.explicitlyMarkedUnreadSessions.has(session.resource)) && !!this.chatWidgetService.getWidgetBySessionResource(session.resource);
|
|
485
|
-
if (shouldKeepOpenSessionRead) {
|
|
486
|
-
this.chatSessionsService.setChatSessionItemRead(session.resource, true);
|
|
487
|
-
}
|
|
488
|
-
if (session.isRead) {
|
|
489
|
-
this.explicitlyMarkedUnreadSessions.delete(session.resource);
|
|
490
|
-
}
|
|
491
|
-
sessions.set(session.resource, this.toAgentSession({
|
|
492
|
-
providerType: chatSessionType,
|
|
493
|
-
providerLabel,
|
|
494
|
-
resource: session.resource,
|
|
495
|
-
label: session.label.split("\n")[0],
|
|
496
|
-
description: session.description,
|
|
497
|
-
icon,
|
|
498
|
-
badge: session.badge,
|
|
499
|
-
tooltip: session.tooltip,
|
|
500
|
-
status: session.status ?? ChatSessionStatus.Completed,
|
|
501
|
-
archived: session.archived,
|
|
502
|
-
providerIsRead: shouldKeepOpenSessionRead ? true : session.isRead,
|
|
503
|
-
timing: session.timing,
|
|
504
|
-
changes: normalizedChanges,
|
|
505
|
-
metadata: session.metadata,
|
|
506
|
-
legacyResource: session.legacyResource
|
|
507
|
-
}));
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
let preservedViaRegistration = 0;
|
|
511
|
-
for (const [, session] of this._sessions) {
|
|
512
|
-
if (session.providerType !== provider && !( sessions.has(session.resource))) {
|
|
513
|
-
const knownProvider = isBuiltInAgentSessionProvider(session.providerType) || ( mapSessionContributionToType.has(session.providerType));
|
|
514
|
-
if (knownProvider || ( registeredProviders.has(session.providerType))) {
|
|
515
|
-
sessions.set(session.resource, session);
|
|
516
|
-
if (!knownProvider) {
|
|
517
|
-
preservedViaRegistration++;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
}
|
|
521
|
-
}
|
|
522
|
-
if (preservedViaRegistration > 0) {
|
|
523
|
-
this.logger.logIfTrace(
|
|
524
|
-
`doResolveProvider(${provider}): preserved ${preservedViaRegistration} live-registered session(s) across a sibling refresh (would have dropped before the preservation fix)`
|
|
525
|
-
);
|
|
526
|
-
}
|
|
527
|
-
for (const resource of this.explicitlyMarkedUnreadSessions) {
|
|
528
|
-
if (!( sessions.has(resource))) {
|
|
529
|
-
this.explicitlyMarkedUnreadSessions.delete(resource);
|
|
530
|
-
}
|
|
531
|
-
}
|
|
532
|
-
const sessionsWithChangedArchivedState = [];
|
|
533
|
-
for (const [, session] of sessions) {
|
|
534
|
-
const previousSession = this._sessions.get(session.resource);
|
|
535
|
-
if (previousSession && this.isArchived(previousSession) !== this.isArchived(session)) {
|
|
536
|
-
sessionsWithChangedArchivedState.push(session);
|
|
537
|
-
}
|
|
538
|
-
}
|
|
539
|
-
this._sessions = sessions;
|
|
540
|
-
this._resolved = true;
|
|
541
|
-
this.migrateReadStateToProvider(( sessions.values()));
|
|
542
|
-
this.logger.logAllStatsIfTrace("Sessions resolved from providers");
|
|
543
|
-
for (const session of sessionsWithChangedArchivedState) {
|
|
544
|
-
this._onDidChangeSessionArchivedState.fire(session);
|
|
545
|
-
}
|
|
546
|
-
this._onDidChangeSessions.fire();
|
|
547
|
-
}
|
|
548
|
-
toAgentSession(data) {
|
|
549
|
-
return {
|
|
550
|
-
...data,
|
|
551
|
-
isArchived: () => this.isArchived(data),
|
|
552
|
-
setArchived: archived => this.setArchived(data, archived),
|
|
553
|
-
isPinned: () => this.isPinned(data),
|
|
554
|
-
setPinned: pinned => this.setPinned(data, pinned),
|
|
555
|
-
isRead: () => this.isRead(data),
|
|
556
|
-
isMarkedUnread: () => this.isMarkedUnread(data),
|
|
557
|
-
setRead: read => this.setRead(data, read)
|
|
558
|
-
};
|
|
559
|
-
}
|
|
560
|
-
static {
|
|
561
|
-
this.UNREAD_MARKER = -1;
|
|
562
|
-
}
|
|
563
|
-
resolveStateEntry(session) {
|
|
564
|
-
const own = this.sessionStates.get(session.resource);
|
|
565
|
-
if (own !== undefined) {
|
|
566
|
-
return own;
|
|
567
|
-
}
|
|
568
|
-
const legacy = session.legacyResource;
|
|
569
|
-
if (!legacy) {
|
|
570
|
-
return undefined;
|
|
571
|
-
}
|
|
572
|
-
if (legacy.scheme !== session.resource.scheme || ( legacy.toString()) === ( session.resource.toString())) {
|
|
573
|
-
return undefined;
|
|
574
|
-
}
|
|
575
|
-
const prev = this.sessionStates.get(legacy);
|
|
576
|
-
if (prev === undefined) {
|
|
577
|
-
return undefined;
|
|
578
|
-
}
|
|
579
|
-
this.sessionStates.set(session.resource, {
|
|
580
|
-
...prev
|
|
581
|
-
});
|
|
582
|
-
this.sessionStates.delete(legacy);
|
|
583
|
-
return this.sessionStates.get(session.resource);
|
|
584
|
-
}
|
|
585
|
-
isArchived(session) {
|
|
586
|
-
if (this.chatSessionsService.canSetChatSessionItemArchived(session.resource)) {
|
|
587
|
-
return Boolean(session.archived);
|
|
588
|
-
}
|
|
589
|
-
return this.resolveStateEntry(session)?.archived ?? Boolean(session.archived);
|
|
590
|
-
}
|
|
591
|
-
setArchived(session, archived) {
|
|
592
|
-
if (archived) {
|
|
593
|
-
this.setRead(session, true);
|
|
594
|
-
}
|
|
595
|
-
if (archived === this.isArchived(session)) {
|
|
596
|
-
return;
|
|
597
|
-
}
|
|
598
|
-
if (this.chatSessionsService.canSetChatSessionItemArchived(session.resource)) {
|
|
599
|
-
this.chatSessionsService.setChatSessionItemArchived(session.resource, archived);
|
|
600
|
-
return;
|
|
601
|
-
}
|
|
602
|
-
const state = this.resolveStateEntry(session) ?? {};
|
|
603
|
-
this.sessionStates.set(session.resource, {
|
|
604
|
-
...state,
|
|
605
|
-
archived
|
|
606
|
-
});
|
|
607
|
-
const agentSession = this._sessions.get(session.resource);
|
|
608
|
-
if (agentSession) {
|
|
609
|
-
this._onDidChangeSessionArchivedState.fire(agentSession);
|
|
610
|
-
}
|
|
611
|
-
this._onDidChangeSessions.fire();
|
|
612
|
-
}
|
|
613
|
-
isPinned(session) {
|
|
614
|
-
return this.resolveStateEntry(session)?.pinned ?? false;
|
|
615
|
-
}
|
|
616
|
-
setPinned(session, pinned) {
|
|
617
|
-
if (pinned === this.isPinned(session)) {
|
|
618
|
-
return;
|
|
619
|
-
}
|
|
620
|
-
const state = this.resolveStateEntry(session) ?? {};
|
|
621
|
-
this.sessionStates.set(session.resource, {
|
|
622
|
-
...state,
|
|
623
|
-
pinned
|
|
624
|
-
});
|
|
625
|
-
this._onDidChangeSessions.fire();
|
|
626
|
-
}
|
|
627
|
-
isMarkedUnread(session) {
|
|
628
|
-
if (this.ownsReadState(session)) {
|
|
629
|
-
return !this.isRead(session);
|
|
630
|
-
}
|
|
631
|
-
return this.resolveStateEntry(session)?.read === AgentSessionsModel_1.UNREAD_MARKER;
|
|
632
|
-
}
|
|
633
|
-
ownsReadState(session) {
|
|
634
|
-
return this.chatSessionsService.canSetChatSessionItemRead(session.resource);
|
|
635
|
-
}
|
|
636
|
-
isRead(session) {
|
|
637
|
-
if (this.isArchived(session)) {
|
|
638
|
-
return true;
|
|
639
|
-
}
|
|
640
|
-
if (this.ownsReadState(session)) {
|
|
641
|
-
return session.providerIsRead ?? true;
|
|
642
|
-
}
|
|
643
|
-
const storedReadDate = this.resolveStateEntry(session)?.read;
|
|
644
|
-
if (storedReadDate === AgentSessionsModel_1.UNREAD_MARKER) {
|
|
645
|
-
return false;
|
|
646
|
-
}
|
|
647
|
-
if (this.localReadDateCoversActivity(session, storedReadDate)) {
|
|
648
|
-
return true;
|
|
649
|
-
}
|
|
650
|
-
return !!this.chatWidgetService.getWidgetBySessionResource(session.resource);
|
|
651
|
-
}
|
|
652
|
-
static {
|
|
653
|
-
this.READ_GRACE_WINDOW = 2000;
|
|
654
|
-
}
|
|
655
|
-
localReadDateCoversActivity(session, storedReadDate) {
|
|
656
|
-
const readDate = Math.max(storedReadDate ?? 0, this.readDateBaseline);
|
|
657
|
-
return readDate >= this.sessionTimeForReadStateTracking(session) - AgentSessionsModel_1.READ_GRACE_WINDOW;
|
|
658
|
-
}
|
|
659
|
-
sessionTimeForReadStateTracking(session) {
|
|
660
|
-
return session.timing.lastRequestEnded ?? session.timing.created;
|
|
661
|
-
}
|
|
662
|
-
setRead(session, read, skipEvent) {
|
|
663
|
-
if (this.ownsReadState(session)) {
|
|
664
|
-
if (read) {
|
|
665
|
-
this.explicitlyMarkedUnreadSessions.delete(session.resource);
|
|
666
|
-
} else {
|
|
667
|
-
this.explicitlyMarkedUnreadSessions.add(session.resource);
|
|
668
|
-
}
|
|
669
|
-
if (read === (session.providerIsRead ?? true)) {
|
|
670
|
-
return;
|
|
671
|
-
}
|
|
672
|
-
this.chatSessionsService.setChatSessionItemRead(session.resource, read);
|
|
673
|
-
return;
|
|
674
|
-
}
|
|
675
|
-
const state = this.resolveStateEntry(session) ?? {};
|
|
676
|
-
let newRead;
|
|
677
|
-
if (read) {
|
|
678
|
-
newRead = Math.max(Date.now(), this.sessionTimeForReadStateTracking(session));
|
|
679
|
-
if (typeof state.read === "number" && state.read >= newRead) {
|
|
680
|
-
return;
|
|
681
|
-
}
|
|
682
|
-
} else {
|
|
683
|
-
newRead = AgentSessionsModel_1.UNREAD_MARKER;
|
|
684
|
-
if (state.read === AgentSessionsModel_1.UNREAD_MARKER) {
|
|
685
|
-
return;
|
|
686
|
-
}
|
|
687
|
-
}
|
|
688
|
-
this.sessionStates.set(session.resource, {
|
|
689
|
-
...state,
|
|
690
|
-
read: newRead
|
|
691
|
-
});
|
|
692
|
-
if (!skipEvent) {
|
|
693
|
-
this._onDidChangeSessions.fire();
|
|
694
|
-
}
|
|
695
|
-
}
|
|
696
|
-
static {
|
|
697
|
-
this.READ_MIGRATION_DONE_KEY = "agentSessions.providerReadMigration";
|
|
698
|
-
}
|
|
699
|
-
migrateReadStateToProvider(sessions) {
|
|
700
|
-
let changed = false;
|
|
701
|
-
for (const session of sessions) {
|
|
702
|
-
if (( this.migratedReadResources.has(session.resource)) || !this.ownsReadState(session)) {
|
|
703
|
-
continue;
|
|
704
|
-
}
|
|
705
|
-
if (session.providerIsRead === undefined) {
|
|
706
|
-
continue;
|
|
707
|
-
}
|
|
708
|
-
this.migratedReadResources.add(session.resource);
|
|
709
|
-
changed = true;
|
|
710
|
-
if (session.providerIsRead) {
|
|
711
|
-
continue;
|
|
712
|
-
}
|
|
713
|
-
const storedReadDate = this.resolveStateEntry(session)?.read;
|
|
714
|
-
if (storedReadDate === AgentSessionsModel_1.UNREAD_MARKER) {
|
|
715
|
-
continue;
|
|
716
|
-
}
|
|
717
|
-
if (this.localReadDateCoversActivity(session, storedReadDate)) {
|
|
718
|
-
this.chatSessionsService.setChatSessionItemRead(session.resource, true);
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
if (changed) {
|
|
722
|
-
this.storageService.store(
|
|
723
|
-
AgentSessionsModel_1.READ_MIGRATION_DONE_KEY,
|
|
724
|
-
JSON.stringify(( Array.from(this.migratedReadResources).map(resource => ( resource.toString())))),
|
|
725
|
-
StorageScope.APPLICATION,
|
|
726
|
-
StorageTarget.MACHINE
|
|
727
|
-
);
|
|
728
|
-
}
|
|
729
|
-
}
|
|
730
|
-
loadMigratedReadResources() {
|
|
731
|
-
const raw = this.storageService.get(AgentSessionsModel_1.READ_MIGRATION_DONE_KEY, StorageScope.APPLICATION);
|
|
732
|
-
if (!raw) {
|
|
733
|
-
return;
|
|
734
|
-
}
|
|
735
|
-
try {
|
|
736
|
-
for (const entry of JSON.parse(raw)) {
|
|
737
|
-
this.migratedReadResources.add(( URI.parse(entry)));
|
|
738
|
-
}
|
|
739
|
-
} catch {}
|
|
740
|
-
}
|
|
741
|
-
static {
|
|
742
|
-
this.READ_DATE_BASELINE_KEY = "agentSessions.readDateBaseline2";
|
|
743
|
-
}
|
|
744
|
-
resolveReadDateBaseline() {
|
|
745
|
-
let readDateBaseline = this.storageService.getNumber(AgentSessionsModel_1.READ_DATE_BASELINE_KEY, StorageScope.WORKSPACE, 0);
|
|
746
|
-
if (readDateBaseline > 0) {
|
|
747
|
-
return readDateBaseline;
|
|
748
|
-
}
|
|
749
|
-
readDateBaseline = this.productService.quality === "stable" ? Date.now() - (7 * 24 * 60 * 60 * 1000) : Date.now();
|
|
750
|
-
this.storageService.store(
|
|
751
|
-
AgentSessionsModel_1.READ_DATE_BASELINE_KEY,
|
|
752
|
-
readDateBaseline,
|
|
753
|
-
StorageScope.WORKSPACE,
|
|
754
|
-
StorageTarget.MACHINE
|
|
755
|
-
);
|
|
756
|
-
return readDateBaseline;
|
|
757
|
-
}
|
|
758
|
-
};
|
|
759
|
-
AgentSessionsModel = AgentSessionsModel_1 = ( __decorate([( __param(0, IChatSessionsService)), ( __param(1, ILifecycleService)), ( __param(2, IInstantiationService)), ( __param(3, IStorageService)), ( __param(4, IProductService)), ( __param(5, IChatWidgetService)), ( __param(6, IWorkspaceContextService)), ( __param(7, IWorkspaceTrustManagementService)), ( __param(8, IChatEntitlementService))], AgentSessionsModel));
|
|
760
|
-
let AgentSessionsCache = class AgentSessionsCache {
|
|
761
|
-
static {
|
|
762
|
-
AgentSessionsCache_1 = this;
|
|
763
|
-
}
|
|
764
|
-
static {
|
|
765
|
-
this.SESSIONS_STORAGE_KEY = "agentSessions.model.cache";
|
|
766
|
-
}
|
|
767
|
-
static {
|
|
768
|
-
this.STATE_STORAGE_KEY = "agentSessions.state.cache";
|
|
769
|
-
}
|
|
770
|
-
constructor(storageService) {
|
|
771
|
-
this.storageService = storageService;
|
|
772
|
-
}
|
|
773
|
-
saveCachedSessions(sessions) {
|
|
774
|
-
const serialized = ( sessions.map(session => ({
|
|
775
|
-
providerType: session.providerType,
|
|
776
|
-
providerLabel: session.providerLabel,
|
|
777
|
-
resource: ( session.resource.toString()),
|
|
778
|
-
icon: session.icon.id,
|
|
779
|
-
label: session.label,
|
|
780
|
-
description: session.description,
|
|
781
|
-
badge: session.badge,
|
|
782
|
-
tooltip: session.tooltip,
|
|
783
|
-
status: isSessionInProgressStatus(session.status) ? ChatSessionStatus.Completed : session.status,
|
|
784
|
-
archived: session.archived,
|
|
785
|
-
isRead: session.providerIsRead,
|
|
786
|
-
timing: session.timing,
|
|
787
|
-
changes: getAgentChangesSummary(session.changes),
|
|
788
|
-
metadata: session.metadata,
|
|
789
|
-
legacyResource: session.legacyResource?.toString()
|
|
790
|
-
})));
|
|
791
|
-
this.storageService.store(
|
|
792
|
-
AgentSessionsCache_1.SESSIONS_STORAGE_KEY,
|
|
793
|
-
safeStringify(serialized),
|
|
794
|
-
StorageScope.WORKSPACE,
|
|
795
|
-
StorageTarget.MACHINE
|
|
796
|
-
);
|
|
797
|
-
}
|
|
798
|
-
loadCachedSessions() {
|
|
799
|
-
const sessionsCache = this.storageService.get(AgentSessionsCache_1.SESSIONS_STORAGE_KEY, StorageScope.WORKSPACE);
|
|
800
|
-
if (!sessionsCache) {
|
|
801
|
-
return [];
|
|
802
|
-
}
|
|
803
|
-
try {
|
|
804
|
-
const cached = JSON.parse(sessionsCache);
|
|
805
|
-
return ( cached.map(session => ({
|
|
806
|
-
providerType: session.providerType,
|
|
807
|
-
providerLabel: session.providerLabel,
|
|
808
|
-
resource: typeof session.resource === "string" ? ( URI.parse(session.resource)) : URI.revive(session.resource),
|
|
809
|
-
icon: ThemeIcon.fromId(session.icon),
|
|
810
|
-
label: session.label,
|
|
811
|
-
description: session.description,
|
|
812
|
-
badge: session.badge,
|
|
813
|
-
tooltip: session.tooltip,
|
|
814
|
-
status: session.status,
|
|
815
|
-
archived: session.archived,
|
|
816
|
-
providerIsRead: session.isRead,
|
|
817
|
-
timing: {
|
|
818
|
-
created: session.timing.created ?? 0,
|
|
819
|
-
lastRequestStarted: session.timing.lastRequestStarted,
|
|
820
|
-
lastRequestEnded: session.timing.lastRequestEnded
|
|
821
|
-
},
|
|
822
|
-
changes: getAgentChangesSummary(session.changes),
|
|
823
|
-
metadata: session.metadata,
|
|
824
|
-
legacyResource: session.legacyResource ? ( URI.parse(session.legacyResource)) : undefined
|
|
825
|
-
})));
|
|
826
|
-
} catch {
|
|
827
|
-
return [];
|
|
828
|
-
}
|
|
829
|
-
}
|
|
830
|
-
saveSessionStates(states) {
|
|
831
|
-
const serialized = ( Array.from(states.entries()).map(([resource, state]) => ({
|
|
832
|
-
resource: ( resource.toString()),
|
|
833
|
-
archived: state.archived,
|
|
834
|
-
pinned: state.pinned,
|
|
835
|
-
read: state.read
|
|
836
|
-
})));
|
|
837
|
-
this.storageService.store(
|
|
838
|
-
AgentSessionsCache_1.STATE_STORAGE_KEY,
|
|
839
|
-
JSON.stringify(serialized),
|
|
840
|
-
StorageScope.WORKSPACE,
|
|
841
|
-
StorageTarget.MACHINE
|
|
842
|
-
);
|
|
843
|
-
}
|
|
844
|
-
loadSessionStates() {
|
|
845
|
-
const states = ( new ResourceMap());
|
|
846
|
-
const statesCache = this.storageService.get(AgentSessionsCache_1.STATE_STORAGE_KEY, StorageScope.WORKSPACE);
|
|
847
|
-
if (!statesCache) {
|
|
848
|
-
return states;
|
|
849
|
-
}
|
|
850
|
-
try {
|
|
851
|
-
const cached = JSON.parse(statesCache);
|
|
852
|
-
for (const entry of cached) {
|
|
853
|
-
states.set(typeof entry.resource === "string" ? ( URI.parse(entry.resource)) : URI.revive(entry.resource), {
|
|
854
|
-
archived: entry.archived,
|
|
855
|
-
pinned: entry.pinned,
|
|
856
|
-
read: entry.read
|
|
857
|
-
});
|
|
858
|
-
}
|
|
859
|
-
} catch {}
|
|
860
|
-
return states;
|
|
861
|
-
}
|
|
862
|
-
};
|
|
863
|
-
AgentSessionsCache = AgentSessionsCache_1 = ( __decorate([( __param(0, IStorageService))], AgentSessionsCache));
|
|
864
|
-
|
|
865
|
-
export { AgentSessionSection, ChatSessionStatus as AgentSessionStatus, AgentSessionsCache, AgentSessionsModel, getAgentChangesSummary, getAgentSessionPullRequestContextValue, getAgentSessionPullRequestUri, hasValidDiff, isAgentHostAgentSessionItem, isAgentSession, isAgentSessionSection, isAgentSessionShowLess, isAgentSessionShowMore, isAgentSessionsModel, isLocalAgentSessionItem, isMarshalledAgentSessionContext, isSessionInProgressStatus };
|