@codingame/monaco-vscode-chat-service-override 25.1.2 → 26.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 +24 -3
- package/package.json +5 -5
- package/vscode/src/vs/platform/browserElements/common/browserElements.d.ts +23 -3
- package/vscode/src/vs/platform/browserElements/common/browserElements.js +13 -6
- package/vscode/src/vs/platform/domWidget/browser/domWidget.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +42 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +14 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +218 -74
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatTerminalOutputAccessibleView.js +6 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +14 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +165 -168
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +27 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +141 -140
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +189 -121
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +14 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.d.ts +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCustomizationDiagnosticsAction.js +435 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +28 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +10 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatGettingStarted.js +37 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +54 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +73 -34
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +71 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +151 -89
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +12 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +39 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +90 -125
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +263 -143
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatTransfer.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +188 -126
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +37 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +21 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +392 -226
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +31 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +25 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.js +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +83 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +319 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +215 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.d.ts +179 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +951 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agentsessionprojection.css +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +388 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/unifiedQuickAccess.css +195 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.d.ts +120 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +394 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.d.ts +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +95 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsProvider.js +31 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +49 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatVariables.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/media/simpleBrowserOverlay.css +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +188 -151
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +1012 -639
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +256 -151
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +182 -101
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.d.ts +79 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +193 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorAccessibility.js +9 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.d.ts +68 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +253 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +69 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +3 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +52 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +5 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +274 -155
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingOperations.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +2 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +130 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +385 -160
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +53 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +112 -75
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +19 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditorController.css +31 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingModifiedNotebookSnapshot.js +39 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNewNotebookContentEdits.js +10 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookCellEntry.js +25 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +265 -203
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookFileSystemProvider.js +29 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/helpers.js +114 -60
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.js +16 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/overlayToolbarDecorator.js +44 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +119 -45
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +152 -136
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +12 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +51 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +323 -217
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +4 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +653 -401
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +52 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +22 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +43 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +182 -136
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.d.ts +33 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +548 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +222 -138
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +151 -113
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +453 -217
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +162 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/chatSetup.css +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.d.ts +0 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatus.js +1 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +309 -233
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +55 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +109 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +35 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.d.ts +9 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +73 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.d.ts +47 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +333 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +39 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionContribution.js +9 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +23 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileActions.js +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +20 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +65 -57
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +48 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +20 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +52 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +155 -159
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +24 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +521 -246
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +107 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +28 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.js +10 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputStateCache.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatToolOutputStateCache.js +57 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatLayoutService.js +4 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +56 -44
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +0 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +37 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatEditorInputContentProvider.js +5 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +10 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +1284 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +179 -125
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +9 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/editorHoverWrapper.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +96 -78
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +58 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +25 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +484 -292
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.d.ts +1 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +65 -92
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +16 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewTitleControl.css +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +331 -189
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +81 -93
- package/vscode/src/vs/workbench/contrib/chat/common/ignoredFiles.js +1 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.js +6 -7
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.d.ts +36 -8
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatProgressTypes/chatToolInvocation.js +169 -31
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.d.ts +6 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +141 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +6 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +218 -144
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatTransferService.js +20 -10
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +109 -0
- package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +349 -0
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +139 -36
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +3 -6
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptBodyAutocompletion.js +64 -51
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +49 -34
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptDocumentSemanticTokensProvider.js +21 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +125 -97
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +91 -131
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +8 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +488 -222
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +32 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +58 -13
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +717 -200
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +79 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +371 -130
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.d.ts +0 -1
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatTodoListService.js +3 -7
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +79 -61
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +27 -21
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +7 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +26 -32
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibilityHelp.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +8 -60
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +115 -426
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +127 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +1 -37
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.js +21 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +51 -0
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +334 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +424 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +58 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +195 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +368 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +7 -0
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.js +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +23 -25
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/common/remoteCodingAgentsService.js +7 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +34 -38
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +8 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +103 -95
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.js +28 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +4 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +12 -8
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +65 -54
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +86 -60
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/alternativeRecommendation.js +13 -26
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +24 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.d.ts +26 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/sedFileWriteParser.js +142 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +56 -46
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/executeStrategy.js +63 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +35 -30
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +44 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/strategyHelpers.js +3 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +70 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +26 -394
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +85 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +68 -27
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +67 -45
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +106 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/commandLineAutoApprover.js +177 -97
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +136 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAnalyzer.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +128 -112
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +51 -49
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineSandboxAnalyzer.js +25 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/commandLinePresenter.d.ts +41 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/nodeCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/pythonCommandLinePresenter.js +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/rubyCommandLinePresenter.js +44 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLinePresenter/sandboxedCommandLinePresenter.js +21 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineCdPrefixRewriter.js +5 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLinePreventHistoryRewriter.js +2 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineRewriter.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +29 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +30 -31
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +16 -17
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +19 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.d.ts +11 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +58 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +31 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +325 -199
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/types.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +33 -38
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +45 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +746 -456
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +145 -98
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +88 -37
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +120 -51
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +25 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.d.ts +5 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalCommandArtifactCollector.js +58 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/toolIds.js +17 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +47 -28
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.d.ts +0 -58
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsControl.js +0 -213
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.d.ts +0 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsFilter.js +0 -243
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.d.ts +0 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsOpener.js +0 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.d.ts +0 -166
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsViewer.js +0 -607
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/agentsessionsviewer.css +0 -255
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +0 -46
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +0 -396
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +0 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +0 -379
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +0 -117
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.d.ts +0 -141
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution.js +0 -961
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.d.ts +0 -36
- package/vscode/src/vs/workbench/contrib/chat/common/tools/languageModelToolsContribution.js +0 -447
- 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 -251
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatAccessibleView.js +0 -42
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
3
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
4
4
|
import { Disposable, DisposableMap, toDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
5
6
|
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
6
7
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
7
8
|
import { IContextKeyService } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey.service';
|
|
@@ -9,16 +10,22 @@ import { StorageScope, StorageTarget } from '@codingame/monaco-vscode-api/vscode
|
|
|
9
10
|
import { IStorageService } from '@codingame/monaco-vscode-api/vscode/vs/platform/storage/common/storage.service';
|
|
10
11
|
import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
|
|
11
12
|
import { TerminalChatContextKeys } from '@codingame/monaco-vscode-xterm-common/vscode/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
|
|
12
|
-
import { LocalChatSessionUri } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
13
|
+
import { LocalChatSessionUri, chatSessionResourceToId } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/model/chatUri';
|
|
13
14
|
import { isNumber, isString } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types';
|
|
14
15
|
|
|
15
16
|
var StorageKeys;
|
|
16
|
-
(function
|
|
17
|
+
(function(StorageKeys) {
|
|
17
18
|
StorageKeys["ToolSessionMappings"] = "terminalChat.toolSessionMappings";
|
|
18
19
|
StorageKeys["CommandIdMappings"] = "terminalChat.commandIdMappings";
|
|
19
20
|
})(StorageKeys || (StorageKeys = {}));
|
|
20
21
|
let TerminalChatService = class TerminalChatService extends Disposable {
|
|
21
|
-
constructor(
|
|
22
|
+
constructor(
|
|
23
|
+
_logService,
|
|
24
|
+
_terminalService,
|
|
25
|
+
_storageService,
|
|
26
|
+
_contextKeyService,
|
|
27
|
+
_chatService
|
|
28
|
+
) {
|
|
22
29
|
super();
|
|
23
30
|
this._logService = _logService;
|
|
24
31
|
this._terminalService = _terminalService;
|
|
@@ -27,30 +34,32 @@ let TerminalChatService = class TerminalChatService extends Disposable {
|
|
|
27
34
|
this._chatService = _chatService;
|
|
28
35
|
this._terminalInstancesByToolSessionId = ( new Map());
|
|
29
36
|
this._toolSessionIdByTerminalInstance = ( new Map());
|
|
30
|
-
this.
|
|
37
|
+
this._chatSessionResourceByTerminalInstance = ( new Map());
|
|
31
38
|
this._terminalInstanceListenersByToolSessionId = this._register(( new DisposableMap()));
|
|
32
39
|
this._chatSessionListenersByTerminalInstance = this._register(( new DisposableMap()));
|
|
33
|
-
this.
|
|
40
|
+
this._onDidContinueInBackground = this._register(( new Emitter()));
|
|
41
|
+
this.onDidContinueInBackground = this._onDidContinueInBackground.event;
|
|
42
|
+
this._onDidRegisterTerminalInstanceForToolSession = this._register(( new Emitter()));
|
|
34
43
|
this.onDidRegisterTerminalInstanceWithToolSession = this._onDidRegisterTerminalInstanceForToolSession.event;
|
|
35
44
|
this._activeProgressParts = ( new Set());
|
|
36
45
|
this._pendingRestoredMappings = ( new Map());
|
|
37
|
-
this._sessionAutoApprovalEnabled = ( new
|
|
38
|
-
this._sessionAutoApproveRules = ( new
|
|
46
|
+
this._sessionAutoApprovalEnabled = ( new ResourceMap());
|
|
47
|
+
this._sessionAutoApproveRules = ( new ResourceMap());
|
|
39
48
|
this._hasToolTerminalContext = TerminalChatContextKeys.hasChatTerminals.bindTo(this._contextKeyService);
|
|
40
49
|
this._hasHiddenToolTerminalContext = TerminalChatContextKeys.hasHiddenChatTerminals.bindTo(this._contextKeyService);
|
|
41
50
|
this._restoreFromStorage();
|
|
42
51
|
this._register(this._chatService.onDidDisposeSession(e => {
|
|
43
52
|
for (const resource of e.sessionResource) {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this._sessionAutoApproveRules.delete(sessionId);
|
|
47
|
-
}
|
|
53
|
+
this._sessionAutoApproveRules.delete(resource);
|
|
54
|
+
this._sessionAutoApprovalEnabled.delete(resource);
|
|
48
55
|
}
|
|
49
56
|
}));
|
|
50
57
|
}
|
|
51
58
|
registerTerminalInstanceWithToolSession(terminalToolSessionId, instance) {
|
|
52
59
|
if (!terminalToolSessionId) {
|
|
53
|
-
this._logService.warn(
|
|
60
|
+
this._logService.warn(
|
|
61
|
+
"Attempted to register a terminal instance with an undefined tool session ID"
|
|
62
|
+
);
|
|
54
63
|
return;
|
|
55
64
|
}
|
|
56
65
|
this._terminalInstancesByToolSessionId.set(terminalToolSessionId, instance);
|
|
@@ -69,16 +78,15 @@ let TerminalChatService = class TerminalChatService extends Disposable {
|
|
|
69
78
|
this._terminalInstancesByToolSessionId.delete(terminalToolSessionId);
|
|
70
79
|
this._toolSessionIdByTerminalInstance.delete(instance);
|
|
71
80
|
this._terminalInstanceListenersByToolSessionId.deleteAndDispose(terminalToolSessionId);
|
|
72
|
-
|
|
73
|
-
if (sessionId) {
|
|
74
|
-
this._sessionAutoApprovalEnabled.delete(sessionId);
|
|
75
|
-
}
|
|
81
|
+
this._sessionAutoApprovalEnabled.delete(resource);
|
|
76
82
|
this._persistToStorage();
|
|
77
83
|
this._updateHasToolTerminalContextKeys();
|
|
78
84
|
}
|
|
79
85
|
}
|
|
80
86
|
}));
|
|
81
|
-
this._register(
|
|
87
|
+
this._register(
|
|
88
|
+
this._terminalService.onDidChangeInstances(() => this._updateHasToolTerminalContextKeys())
|
|
89
|
+
);
|
|
82
90
|
if (isNumber(instance.shellLaunchConfig?.attachPersistentProcess?.id) || isNumber(instance.persistentProcessId)) {
|
|
83
91
|
this._persistToStorage();
|
|
84
92
|
}
|
|
@@ -90,7 +98,9 @@ let TerminalChatService = class TerminalChatService extends Disposable {
|
|
|
90
98
|
return undefined;
|
|
91
99
|
}
|
|
92
100
|
if (( this._pendingRestoredMappings.has(terminalToolSessionId))) {
|
|
93
|
-
const instance = this._terminalService.instances.find(
|
|
101
|
+
const instance = this._terminalService.instances.find(
|
|
102
|
+
i => i.shellLaunchConfig.attachPersistentProcess?.id === this._pendingRestoredMappings.get(terminalToolSessionId)
|
|
103
|
+
);
|
|
94
104
|
if (instance) {
|
|
95
105
|
this._tryAdoptRestoredMapping(instance);
|
|
96
106
|
return instance;
|
|
@@ -109,20 +119,25 @@ let TerminalChatService = class TerminalChatService extends Disposable {
|
|
|
109
119
|
getToolSessionIdForInstance(instance) {
|
|
110
120
|
return this._toolSessionIdByTerminalInstance.get(instance);
|
|
111
121
|
}
|
|
112
|
-
registerTerminalInstanceWithChatSession(
|
|
113
|
-
|
|
122
|
+
registerTerminalInstanceWithChatSession(chatSessionResource, instance) {
|
|
123
|
+
const existingResource = this._chatSessionResourceByTerminalInstance.get(instance);
|
|
124
|
+
if (existingResource && ( existingResource.toString()) === ( chatSessionResource.toString())) {
|
|
114
125
|
return;
|
|
115
126
|
}
|
|
116
127
|
this._chatSessionListenersByTerminalInstance.deleteAndDispose(instance);
|
|
117
|
-
this.
|
|
128
|
+
this._chatSessionResourceByTerminalInstance.set(instance, chatSessionResource);
|
|
118
129
|
const disposable = instance.onDisposed(() => {
|
|
119
|
-
this.
|
|
130
|
+
this._chatSessionResourceByTerminalInstance.delete(instance);
|
|
120
131
|
this._chatSessionListenersByTerminalInstance.deleteAndDispose(instance);
|
|
121
132
|
});
|
|
122
133
|
this._chatSessionListenersByTerminalInstance.set(instance, disposable);
|
|
123
134
|
}
|
|
135
|
+
getChatSessionResourceForInstance(instance) {
|
|
136
|
+
return this._chatSessionResourceByTerminalInstance.get(instance);
|
|
137
|
+
}
|
|
124
138
|
getChatSessionIdForInstance(instance) {
|
|
125
|
-
|
|
139
|
+
const resource = this._chatSessionResourceByTerminalInstance.get(instance);
|
|
140
|
+
return resource ? chatSessionResourceToId(resource) : undefined;
|
|
126
141
|
}
|
|
127
142
|
isBackgroundTerminal(terminalToolSessionId) {
|
|
128
143
|
if (!terminalToolSessionId) {
|
|
@@ -196,9 +211,8 @@ let TerminalChatService = class TerminalChatService extends Disposable {
|
|
|
196
211
|
this._pendingRestoredMappings.set(toolSessionId, persistentProcessId);
|
|
197
212
|
}
|
|
198
213
|
}
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
this._logService.warn('Failed to restore terminal chat tool session mappings', err);
|
|
214
|
+
} catch (err) {
|
|
215
|
+
this._logService.warn("Failed to restore terminal chat tool session mappings", err);
|
|
202
216
|
}
|
|
203
217
|
}
|
|
204
218
|
_tryAdoptRestoredMapping(instance) {
|
|
@@ -227,23 +241,24 @@ let TerminalChatService = class TerminalChatService extends Disposable {
|
|
|
227
241
|
try {
|
|
228
242
|
const entries = [];
|
|
229
243
|
for (const [toolSessionId, instance] of this._terminalInstancesByToolSessionId.entries()) {
|
|
230
|
-
const persistentId = isNumber(instance.persistentProcessId)
|
|
231
|
-
? instance.persistentProcessId
|
|
232
|
-
: instance.shellLaunchConfig.attachPersistentProcess?.id;
|
|
244
|
+
const persistentId = isNumber(instance.persistentProcessId) ? instance.persistentProcessId : instance.shellLaunchConfig.attachPersistentProcess?.id;
|
|
233
245
|
const shouldPersist = instance.shouldPersist || instance.shellLaunchConfig.forcePersist;
|
|
234
246
|
if (isNumber(persistentId) && shouldPersist) {
|
|
235
247
|
entries.push([toolSessionId, persistentId]);
|
|
236
248
|
}
|
|
237
249
|
}
|
|
238
250
|
if (entries.length > 0) {
|
|
239
|
-
this._storageService.store(
|
|
240
|
-
|
|
241
|
-
|
|
251
|
+
this._storageService.store(
|
|
252
|
+
StorageKeys.ToolSessionMappings,
|
|
253
|
+
JSON.stringify(entries),
|
|
254
|
+
StorageScope.WORKSPACE,
|
|
255
|
+
StorageTarget.MACHINE
|
|
256
|
+
);
|
|
257
|
+
} else {
|
|
242
258
|
this._storageService.remove(StorageKeys.ToolSessionMappings, StorageScope.WORKSPACE);
|
|
243
259
|
}
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
this._logService.warn('Failed to persist terminal chat tool session mappings', err);
|
|
260
|
+
} catch (err) {
|
|
261
|
+
this._logService.warn("Failed to persist terminal chat tool session mappings", err);
|
|
247
262
|
}
|
|
248
263
|
}
|
|
249
264
|
_updateHasToolTerminalContextKeys() {
|
|
@@ -252,35 +267,31 @@ let TerminalChatService = class TerminalChatService extends Disposable {
|
|
|
252
267
|
const hiddenTerminalCount = this.getToolSessionTerminalInstances(true).length;
|
|
253
268
|
this._hasHiddenToolTerminalContext.set(hiddenTerminalCount > 0);
|
|
254
269
|
}
|
|
255
|
-
setChatSessionAutoApproval(
|
|
270
|
+
setChatSessionAutoApproval(chatSessionResource, enabled) {
|
|
256
271
|
if (enabled) {
|
|
257
|
-
this._sessionAutoApprovalEnabled.
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
this._sessionAutoApprovalEnabled.delete(chatSessionId);
|
|
272
|
+
this._sessionAutoApprovalEnabled.set(chatSessionResource, true);
|
|
273
|
+
} else {
|
|
274
|
+
this._sessionAutoApprovalEnabled.delete(chatSessionResource);
|
|
261
275
|
}
|
|
262
276
|
}
|
|
263
|
-
hasChatSessionAutoApproval(
|
|
264
|
-
return ( this._sessionAutoApprovalEnabled.has(
|
|
277
|
+
hasChatSessionAutoApproval(chatSessionResource) {
|
|
278
|
+
return ( this._sessionAutoApprovalEnabled.has(chatSessionResource));
|
|
265
279
|
}
|
|
266
|
-
addSessionAutoApproveRule(
|
|
267
|
-
let sessionRules = this._sessionAutoApproveRules.get(
|
|
280
|
+
addSessionAutoApproveRule(chatSessionResource, key, value) {
|
|
281
|
+
let sessionRules = this._sessionAutoApproveRules.get(chatSessionResource);
|
|
268
282
|
if (!sessionRules) {
|
|
269
283
|
sessionRules = {};
|
|
270
|
-
this._sessionAutoApproveRules.set(
|
|
284
|
+
this._sessionAutoApproveRules.set(chatSessionResource, sessionRules);
|
|
271
285
|
}
|
|
272
286
|
sessionRules[key] = value;
|
|
273
287
|
}
|
|
274
|
-
getSessionAutoApproveRules(
|
|
275
|
-
return this._sessionAutoApproveRules.get(
|
|
288
|
+
getSessionAutoApproveRules(chatSessionResource) {
|
|
289
|
+
return this._sessionAutoApproveRules.get(chatSessionResource) ?? {};
|
|
290
|
+
}
|
|
291
|
+
continueInBackground(terminalToolSessionId) {
|
|
292
|
+
this._onDidContinueInBackground.fire(terminalToolSessionId);
|
|
276
293
|
}
|
|
277
294
|
};
|
|
278
|
-
TerminalChatService = ( __decorate([
|
|
279
|
-
( __param(0, ILogService)),
|
|
280
|
-
( __param(1, ITerminalService)),
|
|
281
|
-
( __param(2, IStorageService)),
|
|
282
|
-
( __param(3, IContextKeyService)),
|
|
283
|
-
( __param(4, IChatService))
|
|
284
|
-
], TerminalChatService));
|
|
295
|
+
TerminalChatService = ( __decorate([( __param(0, ILogService)), ( __param(1, ITerminalService)), ( __param(2, IStorageService)), ( __param(3, IContextKeyService)), ( __param(4, IChatService))], TerminalChatService));
|
|
285
296
|
|
|
286
297
|
export { TerminalChatService };
|
|
@@ -30,7 +30,7 @@ import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/obse
|
|
|
30
30
|
|
|
31
31
|
registerCss(terminalChatWidget);
|
|
32
32
|
var Constants;
|
|
33
|
-
(function
|
|
33
|
+
(function(Constants) {
|
|
34
34
|
Constants[Constants["HorizontalMargin"] = 10] = "HorizontalMargin";
|
|
35
35
|
Constants[Constants["VerticalMargin"] = 30] = "VerticalMargin";
|
|
36
36
|
Constants[Constants["RightPadding"] = 12] = "RightPadding";
|
|
@@ -38,7 +38,7 @@ var Constants;
|
|
|
38
38
|
Constants[Constants["MaxHeightPercentageOfViewport"] = 0.75] = "MaxHeightPercentageOfViewport";
|
|
39
39
|
})(Constants || (Constants = {}));
|
|
40
40
|
var Message;
|
|
41
|
-
(function
|
|
41
|
+
(function(Message) {
|
|
42
42
|
Message[Message["None"] = 0] = "None";
|
|
43
43
|
Message[Message["AcceptSession"] = 1] = "AcceptSession";
|
|
44
44
|
Message[Message["CancelSession"] = 2] = "CancelSession";
|
|
@@ -49,11 +49,23 @@ var Message;
|
|
|
49
49
|
Message[Message["ReturnInput"] = 64] = "ReturnInput";
|
|
50
50
|
})(Message || (Message = {}));
|
|
51
51
|
let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
52
|
-
get inlineChatWidget() {
|
|
52
|
+
get inlineChatWidget() {
|
|
53
|
+
return this._inlineChatWidget;
|
|
54
|
+
}
|
|
53
55
|
get lastResponseContent() {
|
|
54
56
|
return this._lastResponseContent;
|
|
55
57
|
}
|
|
56
|
-
constructor(
|
|
58
|
+
constructor(
|
|
59
|
+
_terminalElement,
|
|
60
|
+
_instance,
|
|
61
|
+
_xterm,
|
|
62
|
+
contextKeyService,
|
|
63
|
+
_chatService,
|
|
64
|
+
_storageService,
|
|
65
|
+
instantiationService,
|
|
66
|
+
_chatAgentService,
|
|
67
|
+
_chatWidgetService
|
|
68
|
+
) {
|
|
57
69
|
super();
|
|
58
70
|
this._terminalElement = _terminalElement;
|
|
59
71
|
this._instance = _instance;
|
|
@@ -65,8 +77,8 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
65
77
|
this._onDidHide = this._register(( new Emitter()));
|
|
66
78
|
this.onDidHide = this._onDidHide.event;
|
|
67
79
|
this._messages = this._store.add(( new Emitter()));
|
|
68
|
-
this._viewStateStorageKey =
|
|
69
|
-
this._terminalAgentName =
|
|
80
|
+
this._viewStateStorageKey = "terminal-inline-chat-view-state";
|
|
81
|
+
this._terminalAgentName = "terminal";
|
|
70
82
|
this._model = this._register(( new MutableDisposable()));
|
|
71
83
|
this._sessionDisposables = this._register(( new MutableDisposable()));
|
|
72
84
|
this._requestInProgress = observableValue(this, false);
|
|
@@ -76,8 +88,8 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
76
88
|
this._requestActiveContextKey = TerminalChatContextKeys.requestActive.bindTo(contextKeyService);
|
|
77
89
|
this._responseContainsCodeBlockContextKey = TerminalChatContextKeys.responseContainsCodeBlock.bindTo(contextKeyService);
|
|
78
90
|
this._responseContainsMulitpleCodeBlocksContextKey = TerminalChatContextKeys.responseContainsMultipleCodeBlocks.bindTo(contextKeyService);
|
|
79
|
-
this._container = createElement(
|
|
80
|
-
this._container.classList.add(
|
|
91
|
+
this._container = createElement("div");
|
|
92
|
+
this._container.classList.add("terminal-inline-chat");
|
|
81
93
|
this._terminalElement.appendChild(this._container);
|
|
82
94
|
this._inlineChatWidget = instantiationService.createInstance(InlineChatWidget, {
|
|
83
95
|
location: ChatAgentLocation.Terminal,
|
|
@@ -98,15 +110,23 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
98
110
|
secondaryMenuId: MENU_INLINE_CHAT_WIDGET_SECONDARY,
|
|
99
111
|
chatWidgetViewOptions: {
|
|
100
112
|
menus: {
|
|
101
|
-
telemetrySource:
|
|
113
|
+
telemetrySource: "terminal-inline-chat",
|
|
102
114
|
executeToolbar: MenuId.ChatExecute,
|
|
103
|
-
inputSideToolbar: MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR
|
|
115
|
+
inputSideToolbar: MENU_TERMINAL_CHAT_WIDGET_INPUT_SIDE_TOOLBAR
|
|
104
116
|
},
|
|
105
117
|
defaultMode: ChatMode.Ask
|
|
106
118
|
}
|
|
107
119
|
});
|
|
108
|
-
this._register(
|
|
109
|
-
|
|
120
|
+
this._register(
|
|
121
|
+
this._inlineChatWidget.chatWidget.onDidChangeViewModel(() => this._saveViewState())
|
|
122
|
+
);
|
|
123
|
+
this._register(Event.any(
|
|
124
|
+
this._inlineChatWidget.onDidChangeHeight,
|
|
125
|
+
this._instance.onDimensionsChanged,
|
|
126
|
+
this._inlineChatWidget.chatWidget.onDidChangeContentHeight,
|
|
127
|
+
Event.fromObservableLight(this._inlineChatWidget.chatWidget.input.selectedLanguageModel),
|
|
128
|
+
Event.debounce(this._xterm.raw.onCursorMove, () => void 0, MicrotaskDelay)
|
|
129
|
+
)(() => this._relayout()));
|
|
110
130
|
const observer = ( new ResizeObserver(() => this._relayout()));
|
|
111
131
|
observer.observe(this._terminalElement);
|
|
112
132
|
this._register(toDisposable(() => observer.disconnect()));
|
|
@@ -117,13 +137,12 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
117
137
|
this._register(this._focusTracker.onDidBlur(() => this._focusedContextKey.set(false)));
|
|
118
138
|
this._register(autorun(r => {
|
|
119
139
|
const isBusy = this._inlineChatWidget.requestInProgress.read(r);
|
|
120
|
-
this._container.classList.toggle(
|
|
140
|
+
this._container.classList.toggle("busy", isBusy);
|
|
121
141
|
this._inlineChatWidget.toggleStatus(!!this._inlineChatWidget.responseContent);
|
|
122
142
|
if (isBusy || !this._inlineChatWidget.responseContent) {
|
|
123
143
|
this._responseContainsCodeBlockContextKey.set(false);
|
|
124
144
|
this._responseContainsMulitpleCodeBlocksContextKey.set(false);
|
|
125
|
-
}
|
|
126
|
-
else {
|
|
145
|
+
} else {
|
|
127
146
|
Promise.all([
|
|
128
147
|
this._inlineChatWidget.getCodeBlockInfo(0),
|
|
129
148
|
this._inlineChatWidget.getCodeBlockInfo(1)
|
|
@@ -154,7 +173,11 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
154
173
|
}
|
|
155
174
|
const terminalViewportHeight = this._getTerminalViewportHeight();
|
|
156
175
|
const widgetAllowedPercentBasedHeight = (terminalViewportHeight ?? 0) * Constants.MaxHeightPercentageOfViewport;
|
|
157
|
-
const height = Math.max(Math.min(
|
|
176
|
+
const height = Math.max(Math.min(
|
|
177
|
+
Constants.MaxHeight,
|
|
178
|
+
this._inlineChatWidget.contentHeight,
|
|
179
|
+
widgetAllowedPercentBasedHeight
|
|
180
|
+
), this._inlineChatWidget.minHeight);
|
|
158
181
|
if (height === 0) {
|
|
159
182
|
return;
|
|
160
183
|
}
|
|
@@ -165,12 +188,12 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
165
188
|
}
|
|
166
189
|
_resetPlaceholder() {
|
|
167
190
|
const defaultAgent = this._chatAgentService.getDefaultAgent(ChatAgentLocation.Terminal);
|
|
168
|
-
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(
|
|
191
|
+
this.inlineChatWidget.placeholder = defaultAgent?.description ?? ( localize(12341, "Ask about commands"));
|
|
169
192
|
}
|
|
170
193
|
async reveal() {
|
|
171
194
|
await this._createSession();
|
|
172
195
|
this._doLayout();
|
|
173
|
-
this._container.classList.remove(
|
|
196
|
+
this._container.classList.remove("hide");
|
|
174
197
|
this._visibleContextKey.set(true);
|
|
175
198
|
this._resetPlaceholder();
|
|
176
199
|
this._inlineChatWidget.focus();
|
|
@@ -198,11 +221,14 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
198
221
|
return;
|
|
199
222
|
}
|
|
200
223
|
const widgetAllowedPercentBasedHeight = terminalViewportHeight * Constants.MaxHeightPercentageOfViewport;
|
|
201
|
-
const height = Math.max(Math.min(
|
|
224
|
+
const height = Math.max(Math.min(
|
|
225
|
+
Constants.MaxHeight,
|
|
226
|
+
this._inlineChatWidget.contentHeight,
|
|
227
|
+
widgetAllowedPercentBasedHeight
|
|
228
|
+
), this._inlineChatWidget.minHeight);
|
|
202
229
|
if (top > terminalViewportHeight - height && terminalViewportHeight - height > 0) {
|
|
203
230
|
this._setTerminalViewportOffset(top - (terminalViewportHeight - height));
|
|
204
|
-
}
|
|
205
|
-
else {
|
|
231
|
+
} else {
|
|
206
232
|
this._setTerminalViewportOffset(undefined);
|
|
207
233
|
}
|
|
208
234
|
}
|
|
@@ -210,24 +236,23 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
210
236
|
return this._terminalElement.clientHeight;
|
|
211
237
|
}
|
|
212
238
|
hide() {
|
|
213
|
-
this._container.classList.add(
|
|
239
|
+
this._container.classList.add("hide");
|
|
214
240
|
this._inlineChatWidget.reset();
|
|
215
241
|
this._resetPlaceholder();
|
|
216
242
|
this._inlineChatWidget.updateToolbar(false);
|
|
217
243
|
this._visibleContextKey.set(false);
|
|
218
|
-
this._inlineChatWidget.value =
|
|
244
|
+
this._inlineChatWidget.value = "";
|
|
219
245
|
this._instance.focus();
|
|
220
246
|
this._setTerminalViewportOffset(undefined);
|
|
221
247
|
this._onDidHide.fire();
|
|
222
248
|
}
|
|
223
249
|
_setTerminalViewportOffset(offset) {
|
|
224
|
-
if (offset === undefined || this._container.classList.contains(
|
|
225
|
-
this._terminalElement.style.position =
|
|
226
|
-
this._terminalElement.style.bottom =
|
|
250
|
+
if (offset === undefined || this._container.classList.contains("hide")) {
|
|
251
|
+
this._terminalElement.style.position = "";
|
|
252
|
+
this._terminalElement.style.bottom = "";
|
|
227
253
|
TerminalStickyScrollContribution.get(this._instance)?.hideUnlock();
|
|
228
|
-
}
|
|
229
|
-
|
|
230
|
-
this._terminalElement.style.position = 'relative';
|
|
254
|
+
} else {
|
|
255
|
+
this._terminalElement.style.position = "relative";
|
|
231
256
|
this._terminalElement.style.bottom = `${offset}px`;
|
|
232
257
|
TerminalStickyScrollContribution.get(this._instance)?.hideLock();
|
|
233
258
|
}
|
|
@@ -239,7 +264,7 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
239
264
|
return this._inlineChatWidget.hasFocus();
|
|
240
265
|
}
|
|
241
266
|
setValue(value) {
|
|
242
|
-
this._inlineChatWidget.value = value ??
|
|
267
|
+
this._inlineChatWidget.value = value ?? "";
|
|
243
268
|
}
|
|
244
269
|
async acceptCommand(shouldExecute) {
|
|
245
270
|
const code = await this.inlineChatWidget.getCodeBlockInfo(0);
|
|
@@ -254,7 +279,7 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
254
279
|
return this._focusTracker;
|
|
255
280
|
}
|
|
256
281
|
async _createSession() {
|
|
257
|
-
this._sessionCtor = createCancelablePromise(async
|
|
282
|
+
this._sessionCtor = createCancelablePromise(async token => {
|
|
258
283
|
if (!this._model.value) {
|
|
259
284
|
const modelRef = this._chatService.startSession(ChatAgentLocation.Terminal);
|
|
260
285
|
this._model.value = modelRef;
|
|
@@ -268,7 +293,12 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
268
293
|
_saveViewState() {
|
|
269
294
|
const viewState = this._inlineChatWidget.chatWidget.getViewState();
|
|
270
295
|
if (viewState) {
|
|
271
|
-
this._storageService.store(
|
|
296
|
+
this._storageService.store(
|
|
297
|
+
this._viewStateStorageKey,
|
|
298
|
+
JSON.stringify(viewState),
|
|
299
|
+
StorageScope.PROFILE,
|
|
300
|
+
StorageTarget.USER
|
|
301
|
+
);
|
|
272
302
|
}
|
|
273
303
|
}
|
|
274
304
|
clear() {
|
|
@@ -292,7 +322,9 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
292
322
|
this._activeRequestCts = ( new CancellationTokenSource());
|
|
293
323
|
const store = ( new DisposableStore());
|
|
294
324
|
this._requestActiveContextKey.set(true);
|
|
295
|
-
const response = await this._inlineChatWidget.chatWidget.acceptInput(lastInput, {
|
|
325
|
+
const response = await this._inlineChatWidget.chatWidget.acceptInput(lastInput, {
|
|
326
|
+
isVoiceInput: options?.isVoiceInput
|
|
327
|
+
});
|
|
296
328
|
this._currentRequestId = response?.requestId;
|
|
297
329
|
const responsePromise = ( new DeferredPromise());
|
|
298
330
|
try {
|
|
@@ -319,12 +351,10 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
319
351
|
await responsePromise.p;
|
|
320
352
|
this._lastResponseContent = response?.response.getMarkdown();
|
|
321
353
|
return response;
|
|
322
|
-
}
|
|
323
|
-
catch {
|
|
354
|
+
} catch {
|
|
324
355
|
this._lastResponseContent = undefined;
|
|
325
356
|
return;
|
|
326
|
-
}
|
|
327
|
-
finally {
|
|
357
|
+
} finally {
|
|
328
358
|
store.dispose();
|
|
329
359
|
}
|
|
330
360
|
}
|
|
@@ -347,53 +377,49 @@ let TerminalChatWidget = class TerminalChatWidget extends Disposable {
|
|
|
347
377
|
}
|
|
348
378
|
const message = [];
|
|
349
379
|
for (const item of currentRequest.response.response.value) {
|
|
350
|
-
if (item.kind ===
|
|
380
|
+
if (item.kind === "textEditGroup") {
|
|
351
381
|
for (const group of item.edits) {
|
|
352
382
|
message.push({
|
|
353
|
-
kind:
|
|
383
|
+
kind: "textEdit",
|
|
354
384
|
edits: group,
|
|
355
385
|
uri: item.uri
|
|
356
386
|
});
|
|
357
387
|
}
|
|
358
|
-
}
|
|
359
|
-
else if (item.kind === 'notebookEditGroup') {
|
|
388
|
+
} else if (item.kind === "notebookEditGroup") {
|
|
360
389
|
for (const group of item.edits) {
|
|
361
390
|
if (isCellTextEditOperationArray(group)) {
|
|
362
391
|
message.push({
|
|
363
|
-
kind:
|
|
392
|
+
kind: "textEdit",
|
|
364
393
|
edits: ( group.map(e => e.edit)),
|
|
365
394
|
uri: group[0].uri
|
|
366
395
|
});
|
|
367
|
-
}
|
|
368
|
-
else {
|
|
396
|
+
} else {
|
|
369
397
|
message.push({
|
|
370
|
-
kind:
|
|
398
|
+
kind: "notebookEdit",
|
|
371
399
|
edits: group,
|
|
372
400
|
uri: item.uri
|
|
373
401
|
});
|
|
374
402
|
}
|
|
375
403
|
}
|
|
376
|
-
}
|
|
377
|
-
else {
|
|
404
|
+
} else {
|
|
378
405
|
message.push(item);
|
|
379
406
|
}
|
|
380
407
|
}
|
|
381
|
-
this._chatService.addCompleteRequest(
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
408
|
+
this._chatService.addCompleteRequest(
|
|
409
|
+
widget.viewModel.sessionResource,
|
|
410
|
+
`@${this._terminalAgentName} ${currentRequest.message.text}`,
|
|
411
|
+
currentRequest.variableData,
|
|
412
|
+
currentRequest.attempt,
|
|
413
|
+
{
|
|
414
|
+
message,
|
|
415
|
+
result: currentRequest.response.result,
|
|
416
|
+
followups: currentRequest.response.followups
|
|
417
|
+
}
|
|
418
|
+
);
|
|
386
419
|
widget.focusResponseItem();
|
|
387
420
|
this.hide();
|
|
388
421
|
}
|
|
389
422
|
};
|
|
390
|
-
TerminalChatWidget = ( __decorate([
|
|
391
|
-
( __param(3, IContextKeyService)),
|
|
392
|
-
( __param(4, IChatService)),
|
|
393
|
-
( __param(5, IStorageService)),
|
|
394
|
-
( __param(6, IInstantiationService)),
|
|
395
|
-
( __param(7, IChatAgentService)),
|
|
396
|
-
( __param(8, IChatWidgetService))
|
|
397
|
-
], TerminalChatWidget));
|
|
423
|
+
TerminalChatWidget = ( __decorate([( __param(3, IContextKeyService)), ( __param(4, IChatService)), ( __param(5, IStorageService)), ( __param(6, IInstantiationService)), ( __param(7, IChatAgentService)), ( __param(8, IChatWidgetService))], TerminalChatWidget));
|
|
398
424
|
|
|
399
425
|
export { TerminalChatWidget };
|
|
@@ -1,43 +1,30 @@
|
|
|
1
1
|
|
|
2
2
|
|
|
3
3
|
let previouslyRecommededInSession = false;
|
|
4
|
-
const terminalCommands = [
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
{
|
|
13
|
-
commands: [
|
|
14
|
-
( new RegExp(/^python3? -m jupyter(\b)/)),
|
|
15
|
-
( new RegExp(/^python3? -m pip install\b.*jupyter\b.*/)),
|
|
16
|
-
( new RegExp(/^pip3? install\b.*jupyter\b.*/)),
|
|
17
|
-
(
|
|
18
|
-
new RegExp(/^jupyter(\b)/)),
|
|
19
|
-
],
|
|
20
|
-
tags: ['python environment', 'jupyter environment'],
|
|
21
|
-
}
|
|
22
|
-
];
|
|
4
|
+
const terminalCommands = [{
|
|
5
|
+
commands: [( new RegExp(/^python3? -m pip install(\b)/)), ( new RegExp(/^pip3? install(\b)/))],
|
|
6
|
+
tags: ["python environment"]
|
|
7
|
+
}, {
|
|
8
|
+
commands: [( new RegExp(/^python3? -m jupyter(\b)/)), ( new RegExp(/^python3? -m pip install\b.*jupyter\b.*/)), ( new RegExp(/^pip3? install\b.*jupyter\b.*/)), (
|
|
9
|
+
new RegExp(/^jupyter(\b)/))],
|
|
10
|
+
tags: ["python environment", "jupyter environment"]
|
|
11
|
+
}];
|
|
23
12
|
function getRecommendedToolsOverRunInTerminal(commandLine, languageModelToolsService) {
|
|
24
|
-
const tools = languageModelToolsService.getTools();
|
|
13
|
+
const tools = languageModelToolsService.getTools(undefined);
|
|
25
14
|
if (!tools || previouslyRecommededInSession) {
|
|
26
15
|
return;
|
|
27
16
|
}
|
|
28
17
|
const recommendedTools = ( new Set());
|
|
29
18
|
const messages = [
|
|
30
19
|
`The terminal command '${commandLine}' was not executed.`,
|
|
31
|
-
`Try using some of the following tools instead of running a Terminal Command (if unable to use one of these tools as an alternative then run the same terminal command again)
|
|
20
|
+
`Try using some of the following tools instead of running a Terminal Command (if unable to use one of these tools as an alternative then run the same terminal command again):`
|
|
32
21
|
];
|
|
33
22
|
for (const terminalCommand of terminalCommands) {
|
|
34
|
-
if (!( terminalCommand.commands.some(
|
|
23
|
+
if (!( terminalCommand.commands.some(condition => condition.test(commandLine)))) {
|
|
35
24
|
continue;
|
|
36
25
|
}
|
|
37
26
|
const tagsToSearchFor = terminalCommand.tags;
|
|
38
|
-
Array.from(tools)
|
|
39
|
-
.filter(t => ( tagsToSearchFor.some(tag => t.tags?.includes(tag))))
|
|
40
|
-
.forEach(tool => {
|
|
27
|
+
Array.from(tools).filter(t => ( tagsToSearchFor.some(tag => t.tags?.includes(tag)))).forEach(tool => {
|
|
41
28
|
recommendedTools.add(tool.id);
|
|
42
29
|
});
|
|
43
30
|
}
|
|
@@ -46,7 +33,7 @@ function getRecommendedToolsOverRunInTerminal(commandLine, languageModelToolsSer
|
|
|
46
33
|
});
|
|
47
34
|
if (recommendedTools.size) {
|
|
48
35
|
previouslyRecommededInSession = true;
|
|
49
|
-
return messages.join(
|
|
36
|
+
return messages.join(" \n");
|
|
50
37
|
}
|
|
51
38
|
return undefined;
|
|
52
39
|
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Interface for command-specific file write parsers.
|
|
3
|
+
* Each parser is responsible for detecting when a specific command will write to files
|
|
4
|
+
* (beyond simple shell redirections which are handled separately via tree-sitter queries).
|
|
5
|
+
*/
|
|
6
|
+
export interface ICommandFileWriteParser {
|
|
7
|
+
/**
|
|
8
|
+
* The name of the command this parser handles (e.g., 'sed', 'tee').
|
|
9
|
+
*/
|
|
10
|
+
readonly commandName: string;
|
|
11
|
+
/**
|
|
12
|
+
* Checks if this parser can handle the given command text.
|
|
13
|
+
* Should return true only if the command would write to files.
|
|
14
|
+
* @param commandText The full text of a single command (not a pipeline).
|
|
15
|
+
*/
|
|
16
|
+
canHandle(commandText: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Extracts the file paths that would be written to by this command.
|
|
19
|
+
* Should only be called if canHandle() returns true.
|
|
20
|
+
* @param commandText The full text of a single command (not a pipeline).
|
|
21
|
+
* @returns Array of file paths that would be modified.
|
|
22
|
+
*/
|
|
23
|
+
extractFileWrites(commandText: string): string[];
|
|
24
|
+
}
|