@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
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { MaybePromise } from "@codingame/monaco-vscode-api/vscode/vs/base/common/async";
|
|
2
|
+
import type { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
3
|
+
export interface ICommandLinePresenter {
|
|
4
|
+
/**
|
|
5
|
+
* Attempts to create a presentation for the given command line.
|
|
6
|
+
* Command line presenters allow displaying an extracted/transformed version
|
|
7
|
+
* of a command (e.g., Python code from `python -c "..."`) with appropriate
|
|
8
|
+
* syntax highlighting, while the actual command remains unchanged.
|
|
9
|
+
*
|
|
10
|
+
* @returns The presentation result if this presenter handles the command, undefined otherwise.
|
|
11
|
+
*/
|
|
12
|
+
present(options: ICommandLinePresenterOptions): MaybePromise<ICommandLinePresenterResult | undefined>;
|
|
13
|
+
}
|
|
14
|
+
export interface ICommandLinePresenterOptions {
|
|
15
|
+
commandLine: ICommandLinePresentationInput;
|
|
16
|
+
shell: string;
|
|
17
|
+
os: OperatingSystem;
|
|
18
|
+
}
|
|
19
|
+
export interface ICommandLinePresentationInput {
|
|
20
|
+
original?: string;
|
|
21
|
+
forDisplay: string;
|
|
22
|
+
}
|
|
23
|
+
export interface ICommandLinePresenterResult {
|
|
24
|
+
/**
|
|
25
|
+
* The extracted/transformed command to display (e.g., the Python code).
|
|
26
|
+
*/
|
|
27
|
+
commandLine: string;
|
|
28
|
+
/**
|
|
29
|
+
* The language ID for syntax highlighting (e.g., 'python').
|
|
30
|
+
*/
|
|
31
|
+
language?: string;
|
|
32
|
+
/**
|
|
33
|
+
* A human-readable name for the language (e.g., 'Python') used in UI labels.
|
|
34
|
+
*/
|
|
35
|
+
languageDisplayName?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Whether other presenters should still process the command line.
|
|
38
|
+
* Defaults to false - once a presenter handles a command, no further processing is done.
|
|
39
|
+
*/
|
|
40
|
+
processOtherPresenters?: boolean;
|
|
41
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
2
|
+
import type { ICommandLinePresenter, ICommandLinePresenterOptions, ICommandLinePresenterResult } from "./commandLinePresenter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Command line presenter for Node.js inline commands (`node -e "..."`).
|
|
5
|
+
* Extracts the JavaScript code and sets up JavaScript syntax highlighting.
|
|
6
|
+
*/
|
|
7
|
+
export declare class NodeCommandLinePresenter implements ICommandLinePresenter {
|
|
8
|
+
present(options: ICommandLinePresenterOptions): ICommandLinePresenterResult | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the JavaScript code from a `node -e "..."` or `node -e '...'` command,
|
|
12
|
+
* returning the code with properly unescaped quotes.
|
|
13
|
+
*
|
|
14
|
+
* @param commandLine The full command line to parse
|
|
15
|
+
* @param shell The shell path (to determine quote escaping style)
|
|
16
|
+
* @param os The operating system
|
|
17
|
+
* @returns The extracted JavaScript code, or undefined if not a node -e/--eval command
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractNodeCommand(commandLine: string, shell: string, os: OperatingSystem): string | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
import { isPowerShell } from '../../runInTerminalHelpers.js';
|
|
3
|
+
|
|
4
|
+
class NodeCommandLinePresenter {
|
|
5
|
+
present(options) {
|
|
6
|
+
const commandLine = options.commandLine.forDisplay;
|
|
7
|
+
const extractedNode = extractNodeCommand(commandLine, options.shell, options.os);
|
|
8
|
+
if (extractedNode) {
|
|
9
|
+
return {
|
|
10
|
+
commandLine: extractedNode,
|
|
11
|
+
language: 'javascript',
|
|
12
|
+
languageDisplayName: 'Node.js',
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function extractNodeCommand(commandLine, shell, os) {
|
|
19
|
+
const doubleQuoteMatch = commandLine.match(/^node(?:js)?\s+(?:-e|--eval)\s+"(?<code>.+)"$/s);
|
|
20
|
+
if (doubleQuoteMatch?.groups?.code) {
|
|
21
|
+
let jsCode = doubleQuoteMatch.groups.code.trim();
|
|
22
|
+
if (isPowerShell(shell, os)) {
|
|
23
|
+
jsCode = jsCode.replace(/`"/g, '"');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
jsCode = jsCode.replace(/\\"/g, '"');
|
|
27
|
+
}
|
|
28
|
+
return jsCode;
|
|
29
|
+
}
|
|
30
|
+
const singleQuoteMatch = commandLine.match(/^node(?:js)?\s+(?:-e|--eval)\s+'(?<code>.+)'$/s);
|
|
31
|
+
if (singleQuoteMatch?.groups?.code) {
|
|
32
|
+
return singleQuoteMatch.groups.code.trim();
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { NodeCommandLinePresenter, extractNodeCommand };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
2
|
+
import type { ICommandLinePresenter, ICommandLinePresenterOptions, ICommandLinePresenterResult } from "./commandLinePresenter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Command line presenter for Python inline commands (`python -c "..."`).
|
|
5
|
+
* Extracts the Python code and sets up Python syntax highlighting.
|
|
6
|
+
*/
|
|
7
|
+
export declare class PythonCommandLinePresenter implements ICommandLinePresenter {
|
|
8
|
+
present(options: ICommandLinePresenterOptions): ICommandLinePresenterResult | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the Python code from a `python -c "..."` or `python -c '...'` command,
|
|
12
|
+
* returning the code with properly unescaped quotes.
|
|
13
|
+
*
|
|
14
|
+
* @param commandLine The full command line to parse
|
|
15
|
+
* @param shell The shell path (to determine quote escaping style)
|
|
16
|
+
* @param os The operating system
|
|
17
|
+
* @returns The extracted Python code, or undefined if not a python -c command
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractPythonCommand(commandLine: string, shell: string, os: OperatingSystem): string | undefined;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
import { isPowerShell } from '../../runInTerminalHelpers.js';
|
|
3
|
+
|
|
4
|
+
class PythonCommandLinePresenter {
|
|
5
|
+
present(options) {
|
|
6
|
+
const commandLine = options.commandLine.forDisplay;
|
|
7
|
+
const extractedPython = extractPythonCommand(commandLine, options.shell, options.os);
|
|
8
|
+
if (extractedPython) {
|
|
9
|
+
return {
|
|
10
|
+
commandLine: extractedPython,
|
|
11
|
+
language: 'python',
|
|
12
|
+
languageDisplayName: 'Python',
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function extractPythonCommand(commandLine, shell, os) {
|
|
19
|
+
const doubleQuoteMatch = commandLine.match(/^python(?:3)?\s+-c\s+"(?<python>.+)"$/s);
|
|
20
|
+
if (doubleQuoteMatch?.groups?.python) {
|
|
21
|
+
let pythonCode = doubleQuoteMatch.groups.python.trim();
|
|
22
|
+
if (isPowerShell(shell, os)) {
|
|
23
|
+
pythonCode = pythonCode.replace(/`"/g, '"');
|
|
24
|
+
}
|
|
25
|
+
else {
|
|
26
|
+
pythonCode = pythonCode.replace(/\\"/g, '"');
|
|
27
|
+
}
|
|
28
|
+
return pythonCode;
|
|
29
|
+
}
|
|
30
|
+
const singleQuoteMatch = commandLine.match(/^python(?:3)?\s+-c\s+'(?<python>.+)'$/s);
|
|
31
|
+
if (singleQuoteMatch?.groups?.python) {
|
|
32
|
+
return singleQuoteMatch.groups.python.trim();
|
|
33
|
+
}
|
|
34
|
+
return undefined;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { PythonCommandLinePresenter, extractPythonCommand };
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { OperatingSystem } from "@codingame/monaco-vscode-api/vscode/vs/base/common/platform";
|
|
2
|
+
import type { ICommandLinePresenter, ICommandLinePresenterOptions, ICommandLinePresenterResult } from "./commandLinePresenter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Command line presenter for Ruby inline commands (`ruby -e "..."`).
|
|
5
|
+
* Extracts the Ruby code and sets up Ruby syntax highlighting.
|
|
6
|
+
*/
|
|
7
|
+
export declare class RubyCommandLinePresenter implements ICommandLinePresenter {
|
|
8
|
+
present(options: ICommandLinePresenterOptions): ICommandLinePresenterResult | undefined;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Extracts the Ruby code from a `ruby -e "..."` or `ruby -e '...'` command,
|
|
12
|
+
* returning the code with properly unescaped quotes.
|
|
13
|
+
*
|
|
14
|
+
* @param commandLine The full command line to parse
|
|
15
|
+
* @param shell The shell path (to determine quote escaping style)
|
|
16
|
+
* @param os The operating system
|
|
17
|
+
* @returns The extracted Ruby code, or undefined if not a ruby -e command
|
|
18
|
+
*/
|
|
19
|
+
export declare function extractRubyCommand(commandLine: string, shell: string, os: OperatingSystem): string | undefined;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
|
|
2
|
+
import { isPowerShell } from '../../runInTerminalHelpers.js';
|
|
3
|
+
|
|
4
|
+
class RubyCommandLinePresenter {
|
|
5
|
+
present(options) {
|
|
6
|
+
const commandLine = options.commandLine.forDisplay;
|
|
7
|
+
const extractedRuby = extractRubyCommand(commandLine, options.shell, options.os);
|
|
8
|
+
if (extractedRuby) {
|
|
9
|
+
return {
|
|
10
|
+
commandLine: extractedRuby,
|
|
11
|
+
language: 'ruby',
|
|
12
|
+
languageDisplayName: 'Ruby',
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
return undefined;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
function extractRubyCommand(commandLine, shell, os) {
|
|
19
|
+
const doubleQuoteMatch = commandLine.match(/^ruby\s+-e\s+"(?<code>.+)"$/s);
|
|
20
|
+
if (doubleQuoteMatch?.groups?.code) {
|
|
21
|
+
let rubyCode = doubleQuoteMatch.groups.code.trim();
|
|
22
|
+
if (!rubyCode) {
|
|
23
|
+
return undefined;
|
|
24
|
+
}
|
|
25
|
+
if (isPowerShell(shell, os)) {
|
|
26
|
+
rubyCode = rubyCode.replace(/`"/g, '"');
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
rubyCode = rubyCode.replace(/\\"/g, '"');
|
|
30
|
+
}
|
|
31
|
+
return rubyCode;
|
|
32
|
+
}
|
|
33
|
+
const singleQuoteMatch = commandLine.match(/^ruby\s+-e\s+'(?<code>.+)'$/s);
|
|
34
|
+
if (singleQuoteMatch?.groups?.code) {
|
|
35
|
+
const rubyCode = singleQuoteMatch.groups.code.trim();
|
|
36
|
+
if (!rubyCode) {
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
return rubyCode;
|
|
40
|
+
}
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { RubyCommandLinePresenter, extractRubyCommand };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ITerminalSandboxService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service";
|
|
2
|
+
import type { ICommandLinePresenter, ICommandLinePresenterOptions, ICommandLinePresenterResult } from "./commandLinePresenter.js";
|
|
3
|
+
/**
|
|
4
|
+
* Command line presenter for sandboxed commands.
|
|
5
|
+
* Extracts the original command from the sandbox wrapper for cleaner display,
|
|
6
|
+
* while the actual sandboxed command runs unchanged.
|
|
7
|
+
*/
|
|
8
|
+
export declare class SandboxedCommandLinePresenter implements ICommandLinePresenter {
|
|
9
|
+
private readonly _sandboxService;
|
|
10
|
+
constructor(_sandboxService: ITerminalSandboxService);
|
|
11
|
+
present(options: ICommandLinePresenterOptions): Promise<ICommandLinePresenterResult | undefined>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service';
|
|
4
|
+
|
|
5
|
+
let SandboxedCommandLinePresenter = class SandboxedCommandLinePresenter {
|
|
6
|
+
constructor(_sandboxService) {
|
|
7
|
+
this._sandboxService = _sandboxService;
|
|
8
|
+
}
|
|
9
|
+
async present(options) {
|
|
10
|
+
if (!(await this._sandboxService.isEnabled())) {
|
|
11
|
+
return undefined;
|
|
12
|
+
}
|
|
13
|
+
return {
|
|
14
|
+
commandLine: options.commandLine.original ?? options.commandLine.forDisplay,
|
|
15
|
+
processOtherPresenters: true
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
SandboxedCommandLinePresenter = ( __decorate([( __param(0, ITerminalSandboxService))], SandboxedCommandLinePresenter));
|
|
20
|
+
|
|
21
|
+
export { SandboxedCommandLinePresenter };
|
|
@@ -1,32 +1,23 @@
|
|
|
1
1
|
|
|
2
2
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
3
3
|
import { OperatingSystem } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
4
|
-
import {
|
|
4
|
+
import { extractCdPrefix } from '../../runInTerminalHelpers.js';
|
|
5
5
|
|
|
6
6
|
class CommandLineCdPrefixRewriter extends Disposable {
|
|
7
7
|
rewrite(options) {
|
|
8
8
|
if (!options.cwd) {
|
|
9
9
|
return undefined;
|
|
10
10
|
}
|
|
11
|
-
const
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
: /^cd (?<dir>[^\s]+) &&\s+(?<suffix>.+)$/);
|
|
15
|
-
const cdDir = cdPrefixMatch?.groups?.dir;
|
|
16
|
-
const cdSuffix = cdPrefixMatch?.groups?.suffix;
|
|
17
|
-
if (cdDir && cdSuffix) {
|
|
18
|
-
let cdDirPath = cdDir;
|
|
19
|
-
if (cdDirPath.startsWith('"') && cdDirPath.endsWith('"')) {
|
|
20
|
-
cdDirPath = cdDirPath.slice(1, -1);
|
|
21
|
-
}
|
|
22
|
-
cdDirPath = cdDirPath.replace(/(?:[\\\/])$/, '');
|
|
11
|
+
const extracted = extractCdPrefix(options.commandLine, options.shell, options.os);
|
|
12
|
+
if (extracted) {
|
|
13
|
+
let cdDirPath = extracted.directory.replace(/(?:[\\\/])$/, '');
|
|
23
14
|
let cwdFsPath = options.cwd.fsPath.replace(/(?:[\\\/])$/, '');
|
|
24
15
|
if (options.os === OperatingSystem.Windows) {
|
|
25
16
|
cdDirPath = cdDirPath.toLowerCase();
|
|
26
17
|
cwdFsPath = cwdFsPath.toLowerCase();
|
|
27
18
|
}
|
|
28
19
|
if (cdDirPath === cwdFsPath) {
|
|
29
|
-
return { rewritten:
|
|
20
|
+
return { rewritten: extracted.command, reasoning: 'Removed redundant cd command' };
|
|
30
21
|
}
|
|
31
22
|
}
|
|
32
23
|
return undefined;
|
|
@@ -18,14 +18,12 @@ let CommandLinePreventHistoryRewriter = class CommandLinePreventHistoryRewriter
|
|
|
18
18
|
if (isBash(options.shell, options.os) || isZsh(options.shell, options.os)) {
|
|
19
19
|
return {
|
|
20
20
|
rewritten: ` ${options.commandLine}`,
|
|
21
|
-
reasoning:
|
|
21
|
+
reasoning: "Prepended with a space to exclude from shell history"
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
return undefined;
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
CommandLinePreventHistoryRewriter = ( __decorate([
|
|
28
|
-
( __param(0, IConfigurationService))
|
|
29
|
-
], CommandLinePreventHistoryRewriter));
|
|
27
|
+
CommandLinePreventHistoryRewriter = ( __decorate([( __param(0, IConfigurationService))], CommandLinePreventHistoryRewriter));
|
|
30
28
|
|
|
31
29
|
export { CommandLinePreventHistoryRewriter };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { ITerminalSandboxService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service";
|
|
3
|
+
import type { ICommandLineRewriter, ICommandLineRewriterOptions, ICommandLineRewriterResult } from "./commandLineRewriter.js";
|
|
4
|
+
export declare class CommandLineSandboxRewriter extends Disposable implements ICommandLineRewriter {
|
|
5
|
+
private readonly _sandboxService;
|
|
6
|
+
constructor(_sandboxService: ITerminalSandboxService);
|
|
7
|
+
rewrite(options: ICommandLineRewriterOptions): Promise<ICommandLineRewriterResult | undefined>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
|
+
import { ITerminalSandboxService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.service';
|
|
5
|
+
|
|
6
|
+
let CommandLineSandboxRewriter = class CommandLineSandboxRewriter extends Disposable {
|
|
7
|
+
constructor(_sandboxService) {
|
|
8
|
+
super();
|
|
9
|
+
this._sandboxService = _sandboxService;
|
|
10
|
+
}
|
|
11
|
+
async rewrite(options) {
|
|
12
|
+
if (!(await this._sandboxService.isEnabled())) {
|
|
13
|
+
return undefined;
|
|
14
|
+
}
|
|
15
|
+
const sandboxConfigPath = await this._sandboxService.getSandboxConfigPath();
|
|
16
|
+
if (!sandboxConfigPath) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
const wrappedCommand = this._sandboxService.wrapCommand(options.commandLine);
|
|
20
|
+
return {
|
|
21
|
+
rewritten: wrappedCommand,
|
|
22
|
+
reasoning: "Wrapped command for sandbox execution",
|
|
23
|
+
forDisplay: options.commandLine
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
CommandLineSandboxRewriter = ( __decorate([( __param(0, ITerminalSandboxService))], CommandLineSandboxRewriter));
|
|
28
|
+
|
|
29
|
+
export { CommandLineSandboxRewriter };
|
|
@@ -6,15 +6,16 @@ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
|
6
6
|
import { TerminalCapability } from '@codingame/monaco-vscode-api/vscode/vs/platform/terminal/common/capabilities/capabilities';
|
|
7
7
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
8
8
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
9
|
+
import { TerminalToolId } from './toolIds.js';
|
|
9
10
|
|
|
10
11
|
const GetTerminalLastCommandToolData = {
|
|
11
|
-
id:
|
|
12
|
-
toolReferenceName:
|
|
13
|
-
legacyToolReferenceFullNames: [
|
|
14
|
-
displayName: ( localize(
|
|
15
|
-
modelDescription:
|
|
12
|
+
id: TerminalToolId.TerminalLastCommand,
|
|
13
|
+
toolReferenceName: "terminalLastCommand",
|
|
14
|
+
legacyToolReferenceFullNames: ["runCommands/terminalLastCommand"],
|
|
15
|
+
displayName: ( localize(12367, "Get Terminal Last Command")),
|
|
16
|
+
modelDescription: "Get the last command run in the active terminal.",
|
|
16
17
|
source: ToolDataSource.Internal,
|
|
17
|
-
icon: Codicon.terminal
|
|
18
|
+
icon: Codicon.terminal
|
|
18
19
|
};
|
|
19
20
|
let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Disposable {
|
|
20
21
|
constructor(_terminalService) {
|
|
@@ -23,8 +24,8 @@ let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Dispos
|
|
|
23
24
|
}
|
|
24
25
|
async prepareToolInvocation(context, token) {
|
|
25
26
|
return {
|
|
26
|
-
invocationMessage: ( localize(
|
|
27
|
-
pastTenseMessage: ( localize(
|
|
27
|
+
invocationMessage: ( localize(12368, "Getting last terminal command")),
|
|
28
|
+
pastTenseMessage: ( localize(12369, "Got last terminal command"))
|
|
28
29
|
};
|
|
29
30
|
}
|
|
30
31
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -32,54 +33,54 @@ let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Dispos
|
|
|
32
33
|
if (!activeInstance) {
|
|
33
34
|
return {
|
|
34
35
|
content: [{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
kind: "text",
|
|
37
|
+
value: "No active terminal instance found."
|
|
38
|
+
}]
|
|
38
39
|
};
|
|
39
40
|
}
|
|
40
41
|
const commandDetection = activeInstance.capabilities.get(TerminalCapability.CommandDetection);
|
|
41
42
|
if (!commandDetection) {
|
|
42
43
|
return {
|
|
43
44
|
content: [{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
kind: "text",
|
|
46
|
+
value: "No command detection capability available in the active terminal."
|
|
47
|
+
}]
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
const executingCommand = commandDetection.executingCommand;
|
|
50
51
|
if (executingCommand) {
|
|
51
52
|
const userPrompt = [];
|
|
52
|
-
userPrompt.push(
|
|
53
|
+
userPrompt.push("The following command is currently executing in the terminal:");
|
|
53
54
|
userPrompt.push(executingCommand);
|
|
54
55
|
const cwd = commandDetection.cwd;
|
|
55
56
|
if (cwd) {
|
|
56
|
-
userPrompt.push(
|
|
57
|
+
userPrompt.push("It is running in the directory:");
|
|
57
58
|
userPrompt.push(cwd);
|
|
58
59
|
}
|
|
59
60
|
return {
|
|
60
61
|
content: [{
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
62
|
+
kind: "text",
|
|
63
|
+
value: userPrompt.join("\n")
|
|
64
|
+
}]
|
|
64
65
|
};
|
|
65
66
|
}
|
|
66
67
|
const commands = commandDetection.commands;
|
|
67
68
|
if (!commands || commands.length === 0) {
|
|
68
69
|
return {
|
|
69
70
|
content: [{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
71
|
+
kind: "text",
|
|
72
|
+
value: "No command has been run in the active terminal."
|
|
73
|
+
}]
|
|
73
74
|
};
|
|
74
75
|
}
|
|
75
76
|
const lastCommand = commands[commands.length - 1];
|
|
76
77
|
const userPrompt = [];
|
|
77
78
|
if (lastCommand.command) {
|
|
78
|
-
userPrompt.push(
|
|
79
|
+
userPrompt.push("The following is the last command run in the terminal:");
|
|
79
80
|
userPrompt.push(lastCommand.command);
|
|
80
81
|
}
|
|
81
82
|
if (lastCommand.cwd) {
|
|
82
|
-
userPrompt.push(
|
|
83
|
+
userPrompt.push("It was run in the directory:");
|
|
83
84
|
userPrompt.push(lastCommand.cwd);
|
|
84
85
|
}
|
|
85
86
|
if (lastCommand.exitCode !== undefined) {
|
|
@@ -88,20 +89,18 @@ let GetTerminalLastCommandTool = class GetTerminalLastCommandTool extends Dispos
|
|
|
88
89
|
if (lastCommand.hasOutput() && lastCommand.getOutput) {
|
|
89
90
|
const output = lastCommand.getOutput();
|
|
90
91
|
if (output && output.trim().length > 0) {
|
|
91
|
-
userPrompt.push(
|
|
92
|
+
userPrompt.push("It has the following output:");
|
|
92
93
|
userPrompt.push(output);
|
|
93
94
|
}
|
|
94
95
|
}
|
|
95
96
|
return {
|
|
96
97
|
content: [{
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
98
|
+
kind: "text",
|
|
99
|
+
value: userPrompt.join("\n")
|
|
100
|
+
}]
|
|
100
101
|
};
|
|
101
102
|
}
|
|
102
103
|
};
|
|
103
|
-
GetTerminalLastCommandTool = ( __decorate([
|
|
104
|
-
( __param(0, ITerminalService))
|
|
105
|
-
], GetTerminalLastCommandTool));
|
|
104
|
+
GetTerminalLastCommandTool = ( __decorate([( __param(0, ITerminalService))], GetTerminalLastCommandTool));
|
|
106
105
|
|
|
107
106
|
export { GetTerminalLastCommandTool, GetTerminalLastCommandToolData };
|
|
@@ -4,42 +4,41 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
4
4
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
5
5
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
6
6
|
import { RunInTerminalTool } from './runInTerminalTool.js';
|
|
7
|
+
import { TerminalToolId } from './toolIds.js';
|
|
7
8
|
|
|
8
9
|
const GetTerminalOutputToolData = {
|
|
9
|
-
id:
|
|
10
|
-
toolReferenceName:
|
|
11
|
-
legacyToolReferenceFullNames: [
|
|
12
|
-
displayName: ( localize(
|
|
13
|
-
modelDescription:
|
|
10
|
+
id: TerminalToolId.GetTerminalOutput,
|
|
11
|
+
toolReferenceName: "getTerminalOutput",
|
|
12
|
+
legacyToolReferenceFullNames: ["runCommands/getTerminalOutput"],
|
|
13
|
+
displayName: ( localize(12370, "Get Terminal Output")),
|
|
14
|
+
modelDescription: `Get the output of a terminal command previously started with ${TerminalToolId.RunInTerminal}`,
|
|
14
15
|
icon: Codicon.terminal,
|
|
15
16
|
source: ToolDataSource.Internal,
|
|
16
17
|
inputSchema: {
|
|
17
|
-
type:
|
|
18
|
+
type: "object",
|
|
18
19
|
properties: {
|
|
19
20
|
id: {
|
|
20
|
-
type:
|
|
21
|
-
description:
|
|
22
|
-
}
|
|
21
|
+
type: "string",
|
|
22
|
+
description: "The ID of the terminal to check."
|
|
23
|
+
}
|
|
23
24
|
},
|
|
24
|
-
required: [
|
|
25
|
-
'id',
|
|
26
|
-
]
|
|
25
|
+
required: ["id"]
|
|
27
26
|
}
|
|
28
27
|
};
|
|
29
28
|
class GetTerminalOutputTool extends Disposable {
|
|
30
29
|
async prepareToolInvocation(context, token) {
|
|
31
30
|
return {
|
|
32
|
-
invocationMessage: ( localize(
|
|
33
|
-
pastTenseMessage: ( localize(
|
|
31
|
+
invocationMessage: ( localize(12371, "Checking background terminal output")),
|
|
32
|
+
pastTenseMessage: ( localize(12372, "Checked background terminal output"))
|
|
34
33
|
};
|
|
35
34
|
}
|
|
36
35
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
37
36
|
const args = invocation.parameters;
|
|
38
37
|
return {
|
|
39
38
|
content: [{
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
39
|
+
kind: "text",
|
|
40
|
+
value: `Output of terminal ${args.id}:\n${RunInTerminalTool.getBackgroundOutput(args.id)}`
|
|
41
|
+
}]
|
|
43
42
|
};
|
|
44
43
|
}
|
|
45
44
|
}
|
|
@@ -5,15 +5,16 @@ import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/l
|
|
|
5
5
|
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
6
|
import { ToolDataSource } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService';
|
|
7
7
|
import { ITerminalService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/terminal/browser/terminal.service';
|
|
8
|
+
import { TerminalToolId } from './toolIds.js';
|
|
8
9
|
|
|
9
10
|
const GetTerminalSelectionToolData = {
|
|
10
|
-
id:
|
|
11
|
-
toolReferenceName:
|
|
12
|
-
legacyToolReferenceFullNames: [
|
|
13
|
-
displayName: ( localize(
|
|
14
|
-
modelDescription:
|
|
11
|
+
id: TerminalToolId.TerminalSelection,
|
|
12
|
+
toolReferenceName: "terminalSelection",
|
|
13
|
+
legacyToolReferenceFullNames: ["runCommands/terminalSelection"],
|
|
14
|
+
displayName: ( localize(12373, "Get Terminal Selection")),
|
|
15
|
+
modelDescription: "Get the current selection in the active terminal.",
|
|
15
16
|
source: ToolDataSource.Internal,
|
|
16
|
-
icon: Codicon.terminal
|
|
17
|
+
icon: Codicon.terminal
|
|
17
18
|
};
|
|
18
19
|
let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable {
|
|
19
20
|
constructor(_terminalService) {
|
|
@@ -22,8 +23,8 @@ let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable
|
|
|
22
23
|
}
|
|
23
24
|
async prepareToolInvocation(context, token) {
|
|
24
25
|
return {
|
|
25
|
-
invocationMessage: ( localize(
|
|
26
|
-
pastTenseMessage: ( localize(
|
|
26
|
+
invocationMessage: ( localize(12374, "Reading terminal selection")),
|
|
27
|
+
pastTenseMessage: ( localize(12375, "Read terminal selection"))
|
|
27
28
|
};
|
|
28
29
|
}
|
|
29
30
|
async invoke(invocation, _countTokens, _progress, token) {
|
|
@@ -31,30 +32,28 @@ let GetTerminalSelectionTool = class GetTerminalSelectionTool extends Disposable
|
|
|
31
32
|
if (!activeInstance) {
|
|
32
33
|
return {
|
|
33
34
|
content: [{
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
kind: "text",
|
|
36
|
+
value: "No active terminal instance found."
|
|
37
|
+
}]
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
40
|
const selection = activeInstance.selection;
|
|
40
41
|
if (!selection) {
|
|
41
42
|
return {
|
|
42
43
|
content: [{
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
kind: "text",
|
|
45
|
+
value: "No text is currently selected in the active terminal."
|
|
46
|
+
}]
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
return {
|
|
49
50
|
content: [{
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
51
|
+
kind: "text",
|
|
52
|
+
value: `The active terminal's selection:\n${selection}`
|
|
53
|
+
}]
|
|
53
54
|
};
|
|
54
55
|
}
|
|
55
56
|
};
|
|
56
|
-
GetTerminalSelectionTool = ( __decorate([
|
|
57
|
-
( __param(0, ITerminalService))
|
|
58
|
-
], GetTerminalSelectionTool));
|
|
57
|
+
GetTerminalSelectionTool = ( __decorate([( __param(0, ITerminalService))], GetTerminalSelectionTool));
|
|
59
58
|
|
|
60
59
|
export { GetTerminalSelectionTool, GetTerminalSelectionToolData };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { CancellationToken } from "@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation";
|
|
2
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { type CountTokensCallback, type IPreparedToolInvocation, type IToolData, type IToolImpl, type IToolInvocation, type IToolInvocationPreparationContext, type IToolResult, type ToolProgress } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/tools/languageModelToolsService";
|
|
4
|
+
export declare const KillTerminalToolData: IToolData;
|
|
5
|
+
export interface IKillTerminalInputParams {
|
|
6
|
+
id: string;
|
|
7
|
+
}
|
|
8
|
+
export declare class KillTerminalTool extends Disposable implements IToolImpl {
|
|
9
|
+
prepareToolInvocation(_context: IToolInvocationPreparationContext, _token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
|
|
10
|
+
invoke(invocation: IToolInvocation, _countTokens: CountTokensCallback, _progress: ToolProgress, _token: CancellationToken): Promise<IToolResult>;
|
|
11
|
+
}
|