@codingame/monaco-vscode-chat-service-override 29.1.0 → 30.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 +5 -2
- package/package.json +5 -5
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +37 -39
- package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
- package/vscode/src/vs/platform/agentHost/common/agentService.service.d.ts +11 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/action-origin.generated.d.ts +4 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/actions.d.ts +132 -42
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +54 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +15 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/messages.d.ts +5 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/state.d.ts +188 -51
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +7 -6
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +1 -1
- package/vscode/src/vs/platform/agentHost/common/state/sessionState.d.ts +7 -2
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.d.ts +6 -0
- package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +14 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.d.ts +18 -0
- package/vscode/src/vs/platform/sandbox/common/sandboxHelperIpc.js +13 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +37 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +59 -59
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +10 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +37 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +20 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +18 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +482 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +10 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +43 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +74 -76
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +27 -35
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.d.ts +5 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +86 -80
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +38 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +38 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +427 -167
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +37 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +15 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +108 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +8 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +28 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +11 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +3 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +4 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +65 -68
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +64 -51
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/simpleBrowserEditorOverlay.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +288 -195
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +21 -21
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +28 -28
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +3 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +10 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +19 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +54 -12
- 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 +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +9 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditor.js +14 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +50 -50
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatUsageWidget.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetup.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +86 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +29 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +65 -65
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +24 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +3 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +54 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +24 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +72 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +26 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +181 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +8 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +37 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +28 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +9 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +62 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.d.ts +1 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +148 -88
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +16 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.d.ts +8 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatArtifactExtraction.js +158 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +8 -3
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +155 -76
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +1 -2
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +5 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +7 -6
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +31 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +228 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +66 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +190 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +25 -3
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +130 -107
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +19 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +2 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +169 -266
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +12 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +149 -206
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +3 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +27 -22
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.d.ts +20 -8
- package/vscode/src/vs/workbench/contrib/chat/common/tools/chatArtifactsService.js +183 -43
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +1 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +4 -4
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +21 -21
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +11 -11
- package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
- package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +6 -6
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/notebook/browser/diff/inlineDiff/notebookModifiedCellDecorator.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +3 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +4 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +3 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +6 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +1 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +26 -23
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/awaitTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineRewriter/commandLineSandboxRewriter.js +4 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +16 -6
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +9 -9
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +150 -50
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +66 -5
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +239 -48
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolActions.js +0 -208
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.d.ts +0 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatToolPicker.js +0 -637
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolSetsContribution.js +0 -384
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.d.ts +0 -33
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalCustomizations.js +0 -47
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/internalCustomizations/internalSkill.d.ts +0 -30
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/promptFileContributions.js +0 -55
- /package/vscode/src/vs/workbench/contrib/chat/{common → browser}/promptSyntax/promptFileContributions.d.ts +0 -0
|
@@ -0,0 +1,482 @@
|
|
|
1
|
+
|
|
2
|
+
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
3
|
+
import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
|
|
4
|
+
import { Codicon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/codicons';
|
|
5
|
+
import { parse } from '@codingame/monaco-vscode-api/vscode/vs/base/common/jsonc';
|
|
6
|
+
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
7
|
+
import { basename, dirname, joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
8
|
+
import { ThemeIcon } from '@codingame/monaco-vscode-api/vscode/vs/base/common/themables';
|
|
9
|
+
import { isUriComponents, URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
10
|
+
import { localize, localize2 } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
11
|
+
import { Action2, MenuId, registerAction2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
12
|
+
import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
|
|
13
|
+
import { IFileDialogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/dialogs/common/dialogs.service';
|
|
14
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
15
|
+
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
16
|
+
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
17
|
+
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
18
|
+
import { InstalledAgentPluginsViewId } from '../agentPluginsView.js';
|
|
19
|
+
import { ChatContextKeys } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/actions/chatContextKeys';
|
|
20
|
+
import { PromptsType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
|
|
21
|
+
import { PromptsStorage } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService';
|
|
22
|
+
import { IPromptsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service';
|
|
23
|
+
import { IMcpRegistry } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpRegistryTypes.service';
|
|
24
|
+
import { McpCollectionSortOrder, McpServerTransportType } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/mcp/common/mcpTypes';
|
|
25
|
+
import { CHAT_CATEGORY } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/actions/chatActions';
|
|
26
|
+
|
|
27
|
+
const VALID_PLUGIN_NAME = /^[a-z0-9]([a-z0-9\-.]*[a-z0-9])?$/;
|
|
28
|
+
const INVALID_CONSECUTIVE = /--|[.][.]/;
|
|
29
|
+
function validatePluginName(name) {
|
|
30
|
+
if (!name) {
|
|
31
|
+
return localize(5052, "Plugin name is required.");
|
|
32
|
+
}
|
|
33
|
+
if (name.length > 64) {
|
|
34
|
+
return localize(5053, "Plugin name must be at most 64 characters.");
|
|
35
|
+
}
|
|
36
|
+
if (!VALID_PLUGIN_NAME.test(name)) {
|
|
37
|
+
return localize(
|
|
38
|
+
5054,
|
|
39
|
+
"Plugin name must contain only lowercase alphanumeric characters, hyphens, and periods, and must start and end with an alphanumeric character."
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
if (INVALID_CONSECUTIVE.test(name)) {
|
|
43
|
+
return localize(5055, "Plugin name must not contain consecutive hyphens or periods.");
|
|
44
|
+
}
|
|
45
|
+
return undefined;
|
|
46
|
+
}
|
|
47
|
+
function isUserDefined(storage) {
|
|
48
|
+
return storage === PromptsStorage.local || storage === PromptsStorage.user;
|
|
49
|
+
}
|
|
50
|
+
function isUserDefinedMcpCollection(collection) {
|
|
51
|
+
const order = collection.presentation?.order;
|
|
52
|
+
return order === McpCollectionSortOrder.User || order === McpCollectionSortOrder.WorkspaceFolder || order === McpCollectionSortOrder.Workspace;
|
|
53
|
+
}
|
|
54
|
+
function getResourceLabel(r) {
|
|
55
|
+
if (r.name) {
|
|
56
|
+
return r.name;
|
|
57
|
+
}
|
|
58
|
+
if (r.type === PromptsType.skill && basename(r.uri).toLowerCase() === "skill.md") {
|
|
59
|
+
return basename(dirname(r.uri));
|
|
60
|
+
}
|
|
61
|
+
return basename(r.uri);
|
|
62
|
+
}
|
|
63
|
+
function getResourceFileName(r) {
|
|
64
|
+
const label = getResourceLabel(r);
|
|
65
|
+
const colonIndex = label.indexOf(":");
|
|
66
|
+
return colonIndex >= 0 ? label.substring(colonIndex + 1) : label;
|
|
67
|
+
}
|
|
68
|
+
class CreatePluginAction extends Action2 {
|
|
69
|
+
static {
|
|
70
|
+
this.ID = "workbench.action.chat.createPlugin";
|
|
71
|
+
}
|
|
72
|
+
constructor() {
|
|
73
|
+
super({
|
|
74
|
+
id: CreatePluginAction.ID,
|
|
75
|
+
title: ( localize2(5056, "Create Plugin")),
|
|
76
|
+
category: CHAT_CATEGORY,
|
|
77
|
+
f1: true,
|
|
78
|
+
precondition: ChatContextKeys.enabled,
|
|
79
|
+
icon: Codicon.save,
|
|
80
|
+
menu: [{
|
|
81
|
+
id: MenuId.ViewTitle,
|
|
82
|
+
when: ( ContextKeyExpr.and(( ContextKeyExpr.equals("view", InstalledAgentPluginsViewId)), ( ChatContextKeys.Setup.hidden.negate()))),
|
|
83
|
+
group: "navigation",
|
|
84
|
+
order: 2
|
|
85
|
+
}]
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
async run(accessor) {
|
|
89
|
+
const quickInputService = accessor.get(IQuickInputService);
|
|
90
|
+
const promptsService = accessor.get(IPromptsService);
|
|
91
|
+
const mcpRegistry = accessor.get(IMcpRegistry);
|
|
92
|
+
const fileDialogService = accessor.get(IFileDialogService);
|
|
93
|
+
const fileService = accessor.get(IFileService);
|
|
94
|
+
const commandService = accessor.get(ICommandService);
|
|
95
|
+
const notificationService = accessor.get(INotificationService);
|
|
96
|
+
const [instructions, prompts, agents, skills, hooks] = await (async () => {
|
|
97
|
+
const cts = ( new CancellationTokenSource());
|
|
98
|
+
try {
|
|
99
|
+
return await Promise.all([
|
|
100
|
+
promptsService.listPromptFiles(PromptsType.instructions, cts.token),
|
|
101
|
+
promptsService.listPromptFiles(PromptsType.prompt, cts.token),
|
|
102
|
+
promptsService.listPromptFiles(PromptsType.agent, cts.token),
|
|
103
|
+
promptsService.listPromptFiles(PromptsType.skill, cts.token),
|
|
104
|
+
promptsService.listPromptFiles(PromptsType.hook, cts.token)
|
|
105
|
+
]);
|
|
106
|
+
} finally {
|
|
107
|
+
cts.dispose(true);
|
|
108
|
+
}
|
|
109
|
+
})();
|
|
110
|
+
const mcpCollections = mcpRegistry.collections.get();
|
|
111
|
+
let showAll = false;
|
|
112
|
+
const buildTree = () => {
|
|
113
|
+
const groups = [];
|
|
114
|
+
const addGroup = (resources, resourceType, groupLabel, icon) => {
|
|
115
|
+
const filtered = showAll ? resources : resources.filter(r => isUserDefined(r.storage));
|
|
116
|
+
if (filtered.length === 0) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
const children = ( filtered.map(r => ({
|
|
120
|
+
label: getResourceLabel(r),
|
|
121
|
+
description: r.storage,
|
|
122
|
+
resourceType,
|
|
123
|
+
promptPath: r,
|
|
124
|
+
checked: false
|
|
125
|
+
})));
|
|
126
|
+
groups.push({
|
|
127
|
+
label: groupLabel,
|
|
128
|
+
iconClass: ThemeIcon.asClassName(icon),
|
|
129
|
+
checked: undefined,
|
|
130
|
+
collapsed: false,
|
|
131
|
+
pickable: false,
|
|
132
|
+
children
|
|
133
|
+
});
|
|
134
|
+
};
|
|
135
|
+
addGroup(instructions, "instruction", ( localize(5057, "Instructions")), Codicon.book);
|
|
136
|
+
addGroup(prompts, "prompt", ( localize(5058, "Prompts")), Codicon.comment);
|
|
137
|
+
addGroup(agents, "agent", ( localize(5059, "Agents")), Codicon.copilot);
|
|
138
|
+
addGroup(skills, "skill", ( localize(5060, "Skills")), Codicon.lightbulb);
|
|
139
|
+
addGroup(hooks, "hook", ( localize(5061, "Hooks")), Codicon.zap);
|
|
140
|
+
const mcpChildren = [];
|
|
141
|
+
for (const collection of mcpCollections) {
|
|
142
|
+
if (!showAll && !isUserDefinedMcpCollection(collection)) {
|
|
143
|
+
continue;
|
|
144
|
+
}
|
|
145
|
+
const defs = collection.serverDefinitions.get();
|
|
146
|
+
for (const def of defs) {
|
|
147
|
+
mcpChildren.push({
|
|
148
|
+
label: def.label,
|
|
149
|
+
description: collection.label,
|
|
150
|
+
resourceType: "mcp",
|
|
151
|
+
mcpServer: {
|
|
152
|
+
collection,
|
|
153
|
+
definition: def
|
|
154
|
+
},
|
|
155
|
+
checked: false
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
if (mcpChildren.length > 0) {
|
|
160
|
+
groups.push({
|
|
161
|
+
label: ( localize(5062, "MCP Servers")),
|
|
162
|
+
iconClass: ThemeIcon.asClassName(Codicon.mcp),
|
|
163
|
+
checked: undefined,
|
|
164
|
+
collapsed: false,
|
|
165
|
+
pickable: false,
|
|
166
|
+
children: mcpChildren
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return groups;
|
|
170
|
+
};
|
|
171
|
+
const disposables = ( new DisposableStore());
|
|
172
|
+
const tree = disposables.add(quickInputService.createQuickTree());
|
|
173
|
+
tree.placeholder = ( localize(5063, "Select resources to include in the plugin"));
|
|
174
|
+
tree.matchOnDescription = true;
|
|
175
|
+
tree.matchOnLabel = true;
|
|
176
|
+
tree.sortByLabel = false;
|
|
177
|
+
tree.title = ( localize(5064, "Create Plugin"));
|
|
178
|
+
tree.setItemTree(buildTree());
|
|
179
|
+
const toggleButton = {
|
|
180
|
+
iconClass: ThemeIcon.asClassName(Codicon.filter),
|
|
181
|
+
tooltip: ( localize(5065, "Show Built-in, Extension, and Plugin Resources"))
|
|
182
|
+
};
|
|
183
|
+
tree.buttons = [toggleButton];
|
|
184
|
+
disposables.add(tree.onDidTriggerButton(button => {
|
|
185
|
+
if (button === toggleButton) {
|
|
186
|
+
showAll = !showAll;
|
|
187
|
+
tree.setItemTree(buildTree());
|
|
188
|
+
}
|
|
189
|
+
}));
|
|
190
|
+
const selectedItems = await ( new Promise(resolve => {
|
|
191
|
+
disposables.add(tree.onDidAccept(() => {
|
|
192
|
+
resolve(tree.checkedLeafItems);
|
|
193
|
+
tree.hide();
|
|
194
|
+
}));
|
|
195
|
+
disposables.add(tree.onDidHide(() => {
|
|
196
|
+
resolve(undefined);
|
|
197
|
+
}));
|
|
198
|
+
tree.show();
|
|
199
|
+
}));
|
|
200
|
+
disposables.dispose();
|
|
201
|
+
if (!selectedItems || selectedItems.length === 0) {
|
|
202
|
+
return;
|
|
203
|
+
}
|
|
204
|
+
const selected = selectedItems.filter(i => !!i.resourceType);
|
|
205
|
+
const pluginName = await quickInputService.input({
|
|
206
|
+
prompt: ( localize(5066, "Enter a name for the plugin")),
|
|
207
|
+
placeHolder: "my-plugin",
|
|
208
|
+
validateInput: async value => validatePluginName(value)
|
|
209
|
+
});
|
|
210
|
+
if (!pluginName) {
|
|
211
|
+
return;
|
|
212
|
+
}
|
|
213
|
+
const folderUris = await fileDialogService.showOpenDialog({
|
|
214
|
+
canSelectFiles: false,
|
|
215
|
+
canSelectFolders: true,
|
|
216
|
+
canSelectMany: false,
|
|
217
|
+
title: ( localize(5067, "Select Plugin Save Location")),
|
|
218
|
+
openLabel: ( localize(5068, "Select Folder"))
|
|
219
|
+
});
|
|
220
|
+
if (!folderUris || folderUris.length === 0) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const targetDir = folderUris[0];
|
|
224
|
+
const pluginRoot = joinPath(targetDir, pluginName);
|
|
225
|
+
if (await fileService.exists(pluginRoot)) {
|
|
226
|
+
notificationService.error(( localize(
|
|
227
|
+
5069,
|
|
228
|
+
"A directory named '{0}' already exists at this location. Please choose a different name or location.",
|
|
229
|
+
pluginName
|
|
230
|
+
)));
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
try {
|
|
234
|
+
await writePluginToDisk(fileService, pluginRoot, pluginName, selected);
|
|
235
|
+
await updateMarketplaceIfNeeded(fileService, targetDir, pluginName);
|
|
236
|
+
try {
|
|
237
|
+
await commandService.executeCommand("revealFileInOS", pluginRoot);
|
|
238
|
+
} catch {}
|
|
239
|
+
notificationService.info(( localize(5070, "Plugin '{0}' created successfully.", pluginName)));
|
|
240
|
+
} catch (err) {
|
|
241
|
+
notificationService.error(( localize(5071, "Failed to create plugin: {0}", String(err))));
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
async function writePluginToDisk(fileService, pluginRoot, pluginName, selected) {
|
|
246
|
+
await fileService.createFolder(pluginRoot);
|
|
247
|
+
const manifestDir = joinPath(pluginRoot, ".plugin");
|
|
248
|
+
await fileService.createFolder(manifestDir);
|
|
249
|
+
const manifest = {
|
|
250
|
+
name: pluginName,
|
|
251
|
+
version: "1.0.0",
|
|
252
|
+
description: ""
|
|
253
|
+
};
|
|
254
|
+
await fileService.writeFile(
|
|
255
|
+
joinPath(manifestDir, "plugin.json"),
|
|
256
|
+
VSBuffer.fromString(JSON.stringify(manifest, null, "\t"))
|
|
257
|
+
);
|
|
258
|
+
const byType = {
|
|
259
|
+
instruction: selected.filter(i => i.resourceType === "instruction"),
|
|
260
|
+
prompt: selected.filter(i => i.resourceType === "prompt"),
|
|
261
|
+
agent: selected.filter(i => i.resourceType === "agent"),
|
|
262
|
+
skill: selected.filter(i => i.resourceType === "skill"),
|
|
263
|
+
hook: selected.filter(i => i.resourceType === "hook"),
|
|
264
|
+
mcp: selected.filter(i => i.resourceType === "mcp")
|
|
265
|
+
};
|
|
266
|
+
if (byType.instruction.length > 0) {
|
|
267
|
+
const rulesDir = joinPath(pluginRoot, "rules");
|
|
268
|
+
await fileService.createFolder(rulesDir);
|
|
269
|
+
for (const item of byType.instruction) {
|
|
270
|
+
if (!item.promptPath) {
|
|
271
|
+
continue;
|
|
272
|
+
}
|
|
273
|
+
const name = getResourceFileName(item.promptPath);
|
|
274
|
+
const fileName = name.endsWith(".instructions.md") || name.endsWith(".mdc") || name.endsWith(".md") ? name : name + ".instructions.md";
|
|
275
|
+
const content = await fileService.readFile(item.promptPath.uri);
|
|
276
|
+
await fileService.writeFile(joinPath(rulesDir, fileName), content.value);
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
if (byType.prompt.length > 0) {
|
|
280
|
+
const commandsDir = joinPath(pluginRoot, "commands");
|
|
281
|
+
await fileService.createFolder(commandsDir);
|
|
282
|
+
for (const item of byType.prompt) {
|
|
283
|
+
if (!item.promptPath) {
|
|
284
|
+
continue;
|
|
285
|
+
}
|
|
286
|
+
const name = getResourceFileName(item.promptPath);
|
|
287
|
+
const fileName = name.endsWith(".md") ? name : name + ".md";
|
|
288
|
+
const content = await fileService.readFile(item.promptPath.uri);
|
|
289
|
+
await fileService.writeFile(joinPath(commandsDir, fileName), content.value);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (byType.agent.length > 0) {
|
|
293
|
+
const agentsDir = joinPath(pluginRoot, "agents");
|
|
294
|
+
await fileService.createFolder(agentsDir);
|
|
295
|
+
for (const item of byType.agent) {
|
|
296
|
+
if (!item.promptPath) {
|
|
297
|
+
continue;
|
|
298
|
+
}
|
|
299
|
+
const name = getResourceFileName(item.promptPath);
|
|
300
|
+
const fileName = name.endsWith(".md") ? name : name + ".md";
|
|
301
|
+
const content = await fileService.readFile(item.promptPath.uri);
|
|
302
|
+
await fileService.writeFile(joinPath(agentsDir, fileName), content.value);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
if (byType.skill.length > 0) {
|
|
306
|
+
const skillsDir = joinPath(pluginRoot, "skills");
|
|
307
|
+
await fileService.createFolder(skillsDir);
|
|
308
|
+
for (const item of byType.skill) {
|
|
309
|
+
if (!item.promptPath) {
|
|
310
|
+
continue;
|
|
311
|
+
}
|
|
312
|
+
const sourceUri = item.promptPath.uri;
|
|
313
|
+
const skillName = getResourceFileName(item.promptPath);
|
|
314
|
+
const sourceName = basename(sourceUri);
|
|
315
|
+
const isFile = sourceName.toLowerCase() === "skill.md";
|
|
316
|
+
const skillSourceDir = isFile ? joinPath(sourceUri, "..") : sourceUri;
|
|
317
|
+
const destSkillDir = joinPath(skillsDir, skillName);
|
|
318
|
+
await copyDirectory(fileService, skillSourceDir, destSkillDir);
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (byType.hook.length > 0) {
|
|
322
|
+
const hooksDir = joinPath(pluginRoot, "hooks");
|
|
323
|
+
await fileService.createFolder(hooksDir);
|
|
324
|
+
const mergedHooks = {};
|
|
325
|
+
for (const item of byType.hook) {
|
|
326
|
+
if (!item.promptPath) {
|
|
327
|
+
continue;
|
|
328
|
+
}
|
|
329
|
+
try {
|
|
330
|
+
const content = await fileService.readFile(item.promptPath.uri);
|
|
331
|
+
const parsed = parse(( content.value.toString()));
|
|
332
|
+
const hooksObj = (parsed?.hooks ?? parsed);
|
|
333
|
+
if (hooksObj && typeof hooksObj === "object") {
|
|
334
|
+
for (const [hookType, commands] of Object.entries(hooksObj)) {
|
|
335
|
+
if (Array.isArray(commands)) {
|
|
336
|
+
if (!mergedHooks[hookType]) {
|
|
337
|
+
mergedHooks[hookType] = [];
|
|
338
|
+
}
|
|
339
|
+
for (const cmd of commands) {
|
|
340
|
+
mergedHooks[hookType].push(serializeHookCommand(cmd));
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
} catch {}
|
|
346
|
+
}
|
|
347
|
+
const hooksJson = {
|
|
348
|
+
hooks: mergedHooks
|
|
349
|
+
};
|
|
350
|
+
await fileService.writeFile(
|
|
351
|
+
joinPath(hooksDir, "hooks.json"),
|
|
352
|
+
VSBuffer.fromString(JSON.stringify(hooksJson, null, "\t"))
|
|
353
|
+
);
|
|
354
|
+
}
|
|
355
|
+
if (byType.mcp.length > 0) {
|
|
356
|
+
const mcpServers = {};
|
|
357
|
+
for (const item of byType.mcp) {
|
|
358
|
+
if (!item.mcpServer) {
|
|
359
|
+
continue;
|
|
360
|
+
}
|
|
361
|
+
const def = item.mcpServer.definition;
|
|
362
|
+
mcpServers[def.label] = serializeMcpLaunch(def.launch);
|
|
363
|
+
}
|
|
364
|
+
const mcpJson = {
|
|
365
|
+
mcpServers
|
|
366
|
+
};
|
|
367
|
+
await fileService.writeFile(
|
|
368
|
+
joinPath(pluginRoot, ".mcp.json"),
|
|
369
|
+
VSBuffer.fromString(JSON.stringify(mcpJson, null, "\t"))
|
|
370
|
+
);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
function serializeHookCommand(cmd) {
|
|
374
|
+
const result = {
|
|
375
|
+
type: "command"
|
|
376
|
+
};
|
|
377
|
+
if (typeof cmd.command === "string") {
|
|
378
|
+
result["command"] = cmd.command;
|
|
379
|
+
}
|
|
380
|
+
if (typeof cmd.windows === "string") {
|
|
381
|
+
result["windows"] = cmd.windows;
|
|
382
|
+
}
|
|
383
|
+
if (typeof cmd.linux === "string") {
|
|
384
|
+
result["linux"] = cmd.linux;
|
|
385
|
+
}
|
|
386
|
+
if (typeof cmd.osx === "string") {
|
|
387
|
+
result["osx"] = cmd.osx;
|
|
388
|
+
}
|
|
389
|
+
if (cmd.cwd !== undefined) {
|
|
390
|
+
result["cwd"] = isUriComponents(cmd.cwd) ? URI.revive(cmd.cwd).fsPath : String(cmd.cwd);
|
|
391
|
+
}
|
|
392
|
+
if (cmd.env && typeof cmd.env === "object" && ( Object.keys(cmd.env)).length > 0) {
|
|
393
|
+
result["env"] = cmd.env;
|
|
394
|
+
}
|
|
395
|
+
if (typeof cmd.timeout === "number") {
|
|
396
|
+
result["timeout"] = cmd.timeout;
|
|
397
|
+
}
|
|
398
|
+
return result;
|
|
399
|
+
}
|
|
400
|
+
function serializeMcpLaunch(launch) {
|
|
401
|
+
if (launch.type === McpServerTransportType.Stdio) {
|
|
402
|
+
const result = {
|
|
403
|
+
type: "stdio",
|
|
404
|
+
command: launch.command
|
|
405
|
+
};
|
|
406
|
+
if (launch.args.length > 0) {
|
|
407
|
+
result["args"] = [...launch.args];
|
|
408
|
+
}
|
|
409
|
+
if (launch.cwd) {
|
|
410
|
+
result["cwd"] = launch.cwd;
|
|
411
|
+
}
|
|
412
|
+
if (( Object.keys(launch.env)).length > 0) {
|
|
413
|
+
result["env"] = {
|
|
414
|
+
...launch.env
|
|
415
|
+
};
|
|
416
|
+
}
|
|
417
|
+
return result;
|
|
418
|
+
} else {
|
|
419
|
+
const result = {
|
|
420
|
+
type: "http",
|
|
421
|
+
url: ( launch.uri.toString())
|
|
422
|
+
};
|
|
423
|
+
if (launch.headers.length > 0) {
|
|
424
|
+
const headers = {};
|
|
425
|
+
for (const [key, value] of launch.headers) {
|
|
426
|
+
headers[key] = value;
|
|
427
|
+
}
|
|
428
|
+
result["headers"] = headers;
|
|
429
|
+
}
|
|
430
|
+
return result;
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
async function copyDirectory(fileService, source, target) {
|
|
434
|
+
const stat = await fileService.resolve(source);
|
|
435
|
+
if (stat.isDirectory) {
|
|
436
|
+
await fileService.createFolder(target);
|
|
437
|
+
if (stat.children) {
|
|
438
|
+
for (const child of stat.children) {
|
|
439
|
+
const childName = basename(child.resource);
|
|
440
|
+
await copyDirectory(fileService, child.resource, joinPath(target, childName));
|
|
441
|
+
}
|
|
442
|
+
}
|
|
443
|
+
} else {
|
|
444
|
+
const content = await fileService.readFile(source);
|
|
445
|
+
await fileService.writeFile(target, content.value);
|
|
446
|
+
}
|
|
447
|
+
}
|
|
448
|
+
const MARKETPLACE_PATHS = ["marketplace.json", ".plugin/marketplace.json"];
|
|
449
|
+
async function updateMarketplaceIfNeeded(fileService, targetDir, pluginName) {
|
|
450
|
+
for (const relPath of MARKETPLACE_PATHS) {
|
|
451
|
+
const marketplaceUri = joinPath(targetDir, relPath);
|
|
452
|
+
if (await fileService.exists(marketplaceUri)) {
|
|
453
|
+
try {
|
|
454
|
+
const content = await fileService.readFile(marketplaceUri);
|
|
455
|
+
const marketplace = parse(( content.value.toString()));
|
|
456
|
+
if (marketplace && typeof marketplace === "object") {
|
|
457
|
+
if (!Array.isArray(marketplace["plugins"])) {
|
|
458
|
+
marketplace["plugins"] = [];
|
|
459
|
+
}
|
|
460
|
+
const plugins = marketplace["plugins"];
|
|
461
|
+
if (( plugins.some(p => p.name === pluginName))) {
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
plugins.push({
|
|
465
|
+
name: pluginName,
|
|
466
|
+
source: `./${pluginName}/`
|
|
467
|
+
});
|
|
468
|
+
await fileService.writeFile(
|
|
469
|
+
marketplaceUri,
|
|
470
|
+
VSBuffer.fromString(JSON.stringify(marketplace, null, "\t"))
|
|
471
|
+
);
|
|
472
|
+
}
|
|
473
|
+
} catch {}
|
|
474
|
+
return;
|
|
475
|
+
}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
function registerCreatePluginAction() {
|
|
479
|
+
registerAction2(CreatePluginAction);
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
export { copyDirectory, getResourceFileName, getResourceLabel, registerCreatePluginAction, serializeHookCommand, serializeMcpLaunch, updateMarketplaceIfNeeded, validatePluginName, writePluginToDisk };
|
|
@@ -17,7 +17,7 @@ import { hasKey } from '@codingame/monaco-vscode-api/vscode/vs/base/common/types
|
|
|
17
17
|
|
|
18
18
|
let InstallPluginAction = class InstallPluginAction extends Action {
|
|
19
19
|
constructor(item, pluginInstallService) {
|
|
20
|
-
super("agentPlugin.install", ( localize(
|
|
20
|
+
super("agentPlugin.install", ( localize(5072, "Install")), "extension-action label prominent install", true, () => pluginInstallService.installPlugin({
|
|
21
21
|
name: item.name,
|
|
22
22
|
description: item.description,
|
|
23
23
|
version: "",
|
|
@@ -33,7 +33,7 @@ let InstallPluginAction = class InstallPluginAction extends Action {
|
|
|
33
33
|
InstallPluginAction = ( __decorate([( __param(1, IPluginInstallService))], InstallPluginAction));
|
|
34
34
|
class UninstallPluginAction extends Action {
|
|
35
35
|
constructor(plugin) {
|
|
36
|
-
super("agentPlugin.uninstall", ( localize(
|
|
36
|
+
super("agentPlugin.uninstall", ( localize(5073, "Uninstall")), "extension-action label uninstall", true, () => {
|
|
37
37
|
plugin.remove();
|
|
38
38
|
return Promise.resolve();
|
|
39
39
|
});
|
|
@@ -41,7 +41,7 @@ class UninstallPluginAction extends Action {
|
|
|
41
41
|
}
|
|
42
42
|
let OpenPluginFolderAction = class OpenPluginFolderAction extends Action {
|
|
43
43
|
constructor(plugin, commandService, openerService) {
|
|
44
|
-
super("agentPlugin.openFolder", ( localize(
|
|
44
|
+
super("agentPlugin.openFolder", ( localize(5074, "Open Plugin Folder")), undefined, true, async () => {
|
|
45
45
|
try {
|
|
46
46
|
await commandService.executeCommand("revealFileInOS", plugin.uri);
|
|
47
47
|
} catch {
|
|
@@ -53,7 +53,7 @@ let OpenPluginFolderAction = class OpenPluginFolderAction extends Action {
|
|
|
53
53
|
OpenPluginFolderAction = ( __decorate([( __param(1, ICommandService)), ( __param(2, IOpenerService))], OpenPluginFolderAction));
|
|
54
54
|
let OpenPluginReadmeAction = class OpenPluginReadmeAction extends Action {
|
|
55
55
|
constructor(readmeUri, openerService) {
|
|
56
|
-
super("agentPlugin.openReadme", ( localize(
|
|
56
|
+
super("agentPlugin.openReadme", ( localize(5075, "Open README")), undefined, true, () => openerService.open(readmeUri));
|
|
57
57
|
}
|
|
58
58
|
};
|
|
59
59
|
OpenPluginReadmeAction = ( __decorate([( __param(1, IOpenerService))], OpenPluginReadmeAction));
|
|
@@ -168,11 +168,11 @@ class EnablementDropdownActionViewItem extends ActionWithDropdownActionViewItem
|
|
|
168
168
|
function createEnablePluginDropDown(plugin, enablementModel, workspaceContextService) {
|
|
169
169
|
const key = ( plugin.uri.toString());
|
|
170
170
|
const hasWorkspace = workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY;
|
|
171
|
-
const enable = ( new EnablementSubAction("agentPlugin.enable", ( localize(
|
|
171
|
+
const enable = ( new EnablementSubAction("agentPlugin.enable", ( localize(5076, "Enable")), "extension-action label prominent", isContributionDisabled(plugin.enablement.get()), () => {
|
|
172
172
|
enablementModel.setEnabled(key, ContributionEnablementState.EnabledProfile);
|
|
173
173
|
return Promise.resolve();
|
|
174
174
|
}));
|
|
175
|
-
const enableWorkspace = ( new EnablementSubAction("agentPlugin.enableForWorkspace", ( localize(
|
|
175
|
+
const enableWorkspace = ( new EnablementSubAction("agentPlugin.enableForWorkspace", ( localize(5077, "Enable (Workspace)")), "extension-action label", isContributionDisabled(plugin.enablement.get()) && hasWorkspace, () => {
|
|
176
176
|
enablementModel.setEnabled(key, ContributionEnablementState.EnabledWorkspace);
|
|
177
177
|
return Promise.resolve();
|
|
178
178
|
}));
|
|
@@ -181,11 +181,11 @@ function createEnablePluginDropDown(plugin, enablementModel, workspaceContextSer
|
|
|
181
181
|
function createDisablePluginDropDown(plugin, enablementModel, workspaceContextService) {
|
|
182
182
|
const key = ( plugin.uri.toString());
|
|
183
183
|
const hasWorkspace = workspaceContextService.getWorkbenchState() !== WorkbenchState.EMPTY;
|
|
184
|
-
const disable = ( new EnablementSubAction("agentPlugin.disable", ( localize(
|
|
184
|
+
const disable = ( new EnablementSubAction("agentPlugin.disable", ( localize(5078, "Disable")), "extension-action label disable", isContributionEnabled(plugin.enablement.get()), () => {
|
|
185
185
|
enablementModel.setEnabled(key, ContributionEnablementState.DisabledProfile);
|
|
186
186
|
return Promise.resolve();
|
|
187
187
|
}));
|
|
188
|
-
const disableWorkspace = ( new EnablementSubAction("agentPlugin.disableForWorkspace", ( localize(
|
|
188
|
+
const disableWorkspace = ( new EnablementSubAction("agentPlugin.disableForWorkspace", ( localize(5079, "Disable (Workspace)")), "extension-action label disable", isContributionEnabled(plugin.enablement.get()) && hasWorkspace, () => {
|
|
189
189
|
enablementModel.setEnabled(key, ContributionEnablementState.DisabledWorkspace);
|
|
190
190
|
return Promise.resolve();
|
|
191
191
|
}));
|
|
@@ -357,7 +357,7 @@ let AgentPluginEditor = class AgentPluginEditor extends EditorPane {
|
|
|
357
357
|
this.contentDisposables.add(toDisposable(insert(this.layoutParticipants, {
|
|
358
358
|
layout
|
|
359
359
|
})));
|
|
360
|
-
return this.openMarkdown(this.pluginReadme.get(), ( localize(
|
|
360
|
+
return this.openMarkdown(this.pluginReadme.get(), ( localize(5080, "No README available.")), readmeContainer, WebviewIndex.Readme, ( localize(5081, "Readme")), token);
|
|
361
361
|
}
|
|
362
362
|
async openMarkdown(cacheResult, noContentCopy, container, webviewIndex, title, token) {
|
|
363
363
|
try {
|
|
@@ -529,7 +529,7 @@ let UpdatePluginEditorAction = class UpdatePluginEditorAction extends Action {
|
|
|
529
529
|
pluginInstallService,
|
|
530
530
|
pluginMarketplaceService
|
|
531
531
|
) {
|
|
532
|
-
super(UpdatePluginEditorAction_1.ID, ( localize(
|
|
532
|
+
super(UpdatePluginEditorAction_1.ID, ( localize(5082, "Update")), "extension-action label prominent install");
|
|
533
533
|
this.plugin = plugin;
|
|
534
534
|
this.liveMarketplacePlugin = liveMarketplacePlugin;
|
|
535
535
|
this.pluginInstallService = pluginInstallService;
|
package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js
CHANGED
|
@@ -8,7 +8,7 @@ import { EditorInputCapabilities } from '@codingame/monaco-vscode-api/vscode/vs/
|
|
|
8
8
|
import { EditorInput } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/editor/editorInput';
|
|
9
9
|
import { AgentPluginItemKind } from './agentPluginItems.js';
|
|
10
10
|
|
|
11
|
-
const AgentPluginEditorIcon = registerIcon("agent-plugin-editor-icon", Codicon.extensions, ( localize(
|
|
11
|
+
const AgentPluginEditorIcon = registerIcon("agent-plugin-editor-icon", Codicon.extensions, ( localize(5083, "Icon of the Agent Plugin editor.")));
|
|
12
12
|
function getPluginId(item) {
|
|
13
13
|
if (item.kind === AgentPluginItemKind.Installed) {
|
|
14
14
|
return ( item.plugin.uri.toString());
|
|
@@ -39,7 +39,7 @@ class AgentPluginEditorInput extends EditorInput {
|
|
|
39
39
|
return this._item;
|
|
40
40
|
}
|
|
41
41
|
getName() {
|
|
42
|
-
return localize(
|
|
42
|
+
return localize(5084, "Plugin: {0}", this._item.name);
|
|
43
43
|
}
|
|
44
44
|
getIcon() {
|
|
45
45
|
return AgentPluginEditorIcon;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
2
2
|
import { ICommandService } from "@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service";
|
|
3
|
-
import {
|
|
3
|
+
import { IWorkbenchEnvironmentService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service";
|
|
4
4
|
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
5
5
|
import { IInstantiationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation";
|
|
6
6
|
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
@@ -19,11 +19,13 @@ export declare class AgentPluginRepositoryService implements IAgentPluginReposit
|
|
|
19
19
|
private readonly _progressService;
|
|
20
20
|
private readonly _storageService;
|
|
21
21
|
readonly _serviceBrand: undefined;
|
|
22
|
+
readonly agentPluginsHome: URI;
|
|
22
23
|
private readonly _cacheRoot;
|
|
23
24
|
private readonly _marketplaceIndex;
|
|
24
25
|
private readonly _pluginSources;
|
|
25
26
|
private readonly _cloneSequencer;
|
|
26
|
-
|
|
27
|
+
private readonly _migrationDone;
|
|
28
|
+
constructor(_commandService: ICommandService, environmentService: IWorkbenchEnvironmentService, _fileService: IFileService, instantiationService: IInstantiationService, _logService: ILogService, _notificationService: INotificationService, _progressService: IProgressService, _storageService: IStorageService);
|
|
27
29
|
getPluginSource(kind: PluginSourceKind): IPluginSource;
|
|
28
30
|
getRepositoryUri(marketplace: IMarketplaceReference, marketplaceType?: MarketplaceType): URI;
|
|
29
31
|
getPluginInstallUri(plugin: IMarketplacePlugin): URI;
|
|
@@ -47,4 +49,10 @@ export declare class AgentPluginRepositoryService implements IAgentPluginReposit
|
|
|
47
49
|
* of the cache root — returns immediately for paths outside it.
|
|
48
50
|
*/
|
|
49
51
|
private _pruneEmptyParents;
|
|
52
|
+
/**
|
|
53
|
+
* One-time migration of plugin files from the old internal cache
|
|
54
|
+
* directory (`{cacheHome}/agentPlugins/`) to the new well-known
|
|
55
|
+
* location (`~/{dataFolderName}/agent-plugins/`).
|
|
56
|
+
*/
|
|
57
|
+
private _migrateDirectory;
|
|
50
58
|
}
|