@codingame/monaco-vscode-chat-service-override 31.0.1 → 32.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.d.ts +1 -1
- package/index.js +21 -5
- package/package.json +5 -5
- package/vscode/src/vs/base/common/defaultAccount.d.ts +69 -0
- package/vscode/src/vs/base/common/defaultAccount.js +12 -0
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +91 -22
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +301 -68
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +24 -5
- package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +89 -16
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +17 -5
- package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +73 -10
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +32 -6
- package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +32 -20
- package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.d.ts +37 -0
- package/vscode/src/vs/platform/agentHost/common/agentHostPermissionService.js +15 -0
- package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +242 -201
- package/vscode/src/vs/platform/agentHost/common/agentService.js +3 -1
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.d.ts +35 -0
- package/vscode/src/vs/platform/agentHost/common/ahpJsonlLogger.js +106 -0
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +38 -30
- package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +2 -1
- package/vscode/src/vs/platform/agentHost/common/state/protocol/errors.d.ts +114 -4
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.d.ts +10 -10
- package/vscode/src/vs/platform/agentHost/common/state/protocol/reducers.js +52 -19
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +42 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +7 -0
- package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +42 -41
- package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +6 -6
- package/vscode/src/vs/platform/agentHost/common/transportConstants.d.ts +15 -0
- package/vscode/src/vs/platform/agentHost/common/transportConstants.js +6 -0
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.d.ts +4 -3
- package/vscode/src/vs/platform/agentPlugins/common/pluginParsers.js +4 -3
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +4 -2
- package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +15 -7
- package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.d.ts +19 -0
- package/vscode/src/vs/workbench/contrib/browserView/common/browserChatToolReferenceNames.js +17 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +16 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +14 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +64 -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 +31 -16
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +18 -9
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.d.ts +16 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +30 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +8 -7
- 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 +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +12 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +27 -18
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +21 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +22 -22
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.d.ts +12 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +171 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +12 -10
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.d.ts +28 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +99 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.js +11 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +9 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +63 -53
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +10 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +3 -3
- 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 +5 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +25 -48
- 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.js +5 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +8 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +99 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -30
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +78 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +38 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +35 -37
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +347 -326
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.d.ts +6 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidgetUtils.js +1 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +113 -109
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +37 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +436 -134
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +52 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +7 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +13 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +23 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +60 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +25 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +93 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +73 -104
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +272 -41
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +12 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +30 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +430 -185
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.d.ts +5 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +44 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +480 -279
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.d.ts +138 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +221 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +84 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +1216 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +32 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +26 -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 +28 -25
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +25 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +68 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +650 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +46 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +533 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.d.ts +29 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +390 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.d.ts +101 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +509 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +18 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +11 -11
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +130 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +276 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +1 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +6 -87
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +116 -182
- package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +12 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +31 -31
- package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +61 -41
- 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 +27 -27
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +16 -13
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +20 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +106 -36
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +25 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +629 -425
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +105 -29
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +175 -148
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +20 -33
- package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +9 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
- package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/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/githubRepoFetcher.d.ts +58 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/githubRepoFetcher.js +339 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +160 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +9 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +123 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +37 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +572 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +36 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +167 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +49 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +315 -19
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +45 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
- package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +44 -40
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptFileContributions.js +4 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
- package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +9 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +111 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +3 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +13 -47
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +3 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +4 -8
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.d.ts +18 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolResultCompressorService.js +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -7
- package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +14 -52
- package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +3 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +17 -2
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +2 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +23 -12
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +39 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +136 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +72 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +56 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +7 -0
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +14 -1
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +41 -26
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +30 -12
- 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 +2 -5
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +25 -6
- package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -2
- package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +5 -4
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +108 -45
- package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +7 -3
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +3 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.d.ts +20 -1
- package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +65 -26
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +5 -3
- package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.js +38 -11
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +17 -1
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +165 -16
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +1 -0
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +62 -1
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/PromptHeaderDefinitionProvider.js +2 -1
- 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.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +15 -21
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.d.ts +1 -3
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +18 -24
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +4 -2
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +203 -180
- package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +30 -0
- package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +35 -0
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl.js +27 -2
- 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 +14 -49
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.d.ts +0 -16
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +35 -177
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -8
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.d.ts +1 -2
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatNotebook.js +2 -3
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +4 -4
- 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 +13 -13
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
- package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
- package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +20 -20
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +29 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +129 -3
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/taskHelpers.js +3 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.d.ts +2 -1
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +14 -6
- 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.d.ts +1 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +12 -38
- 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 +4 -4
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +2 -2
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.d.ts +12 -7
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +77 -70
- 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/browser/tools/terminalOutputCompressor.d.ts +32 -0
- package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/terminalOutputCompressor.js +232 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.d.ts +83 -0
- package/vscode/src/vs/workbench/services/agentHost/common/agentHostPermissionService.js +243 -0
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.d.ts +0 -749
- package/vscode/src/vs/platform/agentHost/common/state/protocol/commands.js +0 -14
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.d.ts +0 -17
- package/vscode/src/vs/platform/agentHost/common/state/sessionCapabilities.js +0 -5
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.d.ts +0 -40
- package/vscode/src/vs/platform/agentHost/common/state/sessionProtocol.js +0 -14
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.d.ts +0 -61
- package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +0 -638
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +0 -131
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +0 -363
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +0 -24
- package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +0 -306
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.d.ts +0 -23
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatStatusWidget.js +0 -97
- package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/media/chatStatusWidget.css +0 -57
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginService.js +0 -29
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.d.ts +0 -50
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookClaudeCompat.js +0 -78
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.d.ts +0 -77
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCompatibility.js +0 -120
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.d.ts +0 -10
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/hookCopilotCliCompat.js +0 -23
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.d.ts +0 -242
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl.js +0 -1701
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.d.ts +0 -191
- package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/utils/promptFilesLocator.js +0 -728
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.d.ts +0 -14
- package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatHistoryService.js +0 -69
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
+
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
3
|
+
import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
|
|
4
|
+
import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
|
|
5
|
+
export type AhpLogDirection = "c2s" | "s2c";
|
|
6
|
+
export interface IAhpJsonlLoggerOptions {
|
|
7
|
+
readonly logsHome: URI;
|
|
8
|
+
readonly connectionId: string;
|
|
9
|
+
readonly transport: string;
|
|
10
|
+
readonly maxFileSizeBytes?: number;
|
|
11
|
+
readonly maxFiles?: number;
|
|
12
|
+
}
|
|
13
|
+
export declare class AhpJsonlLogger extends Disposable {
|
|
14
|
+
private readonly _options;
|
|
15
|
+
private readonly _fileService;
|
|
16
|
+
private readonly _logService;
|
|
17
|
+
private readonly _directory;
|
|
18
|
+
private readonly _baseName;
|
|
19
|
+
private readonly _maxFileSizeBytes;
|
|
20
|
+
private readonly _maxFiles;
|
|
21
|
+
private _currentFile;
|
|
22
|
+
private _currentSize;
|
|
23
|
+
private _segment;
|
|
24
|
+
private _queue;
|
|
25
|
+
private _folderCreated;
|
|
26
|
+
constructor(_options: IAhpJsonlLoggerOptions, _fileService: IFileService, _logService: ILogService);
|
|
27
|
+
get resource(): URI;
|
|
28
|
+
log(message: object, dir: AhpLogDirection, byteLength?: number): void;
|
|
29
|
+
flush(): Promise<void>;
|
|
30
|
+
private _appendLine;
|
|
31
|
+
private _rotate;
|
|
32
|
+
private _resourceForSegment;
|
|
33
|
+
private _getFileSize;
|
|
34
|
+
}
|
|
35
|
+
export declare function getAhpLogByteLength(text: string): number;
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
|
|
2
|
+
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
3
|
+
import { VSBuffer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/buffer';
|
|
4
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
+
import { joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
|
|
6
|
+
import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
|
|
7
|
+
import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
|
|
8
|
+
|
|
9
|
+
const AHP_LOG_DIR = "ahp";
|
|
10
|
+
const DEFAULT_MAX_FILE_SIZE_BYTES = 75 * 1024 * 1024;
|
|
11
|
+
const DEFAULT_MAX_FILES = 5;
|
|
12
|
+
let AhpJsonlLogger = class AhpJsonlLogger extends Disposable {
|
|
13
|
+
constructor(_options, _fileService, _logService) {
|
|
14
|
+
super();
|
|
15
|
+
this._options = _options;
|
|
16
|
+
this._fileService = _fileService;
|
|
17
|
+
this._logService = _logService;
|
|
18
|
+
this._currentSize = 0;
|
|
19
|
+
this._segment = 0;
|
|
20
|
+
this._queue = Promise.resolve();
|
|
21
|
+
this._directory = joinPath(this._options.logsHome, AHP_LOG_DIR);
|
|
22
|
+
const safeConnectionId = sanitizeFilePart(this._options.connectionId).slice(0, 64);
|
|
23
|
+
this._baseName = `ahp-${toFileTimestamp(( new Date()))}-${safeConnectionId}.jsonl`;
|
|
24
|
+
this._maxFileSizeBytes = this._options.maxFileSizeBytes ?? DEFAULT_MAX_FILE_SIZE_BYTES;
|
|
25
|
+
this._maxFiles = this._options.maxFiles ?? DEFAULT_MAX_FILES;
|
|
26
|
+
this._currentFile = joinPath(this._directory, this._baseName);
|
|
27
|
+
}
|
|
28
|
+
get resource() {
|
|
29
|
+
return this._currentFile;
|
|
30
|
+
}
|
|
31
|
+
log(message, dir, byteLength) {
|
|
32
|
+
const entry = {
|
|
33
|
+
...message,
|
|
34
|
+
_ahpLog: {
|
|
35
|
+
ts: ( new Date()).toISOString(),
|
|
36
|
+
dir,
|
|
37
|
+
connectionId: this._options.connectionId,
|
|
38
|
+
transport: this._options.transport,
|
|
39
|
+
...(typeof byteLength === "number" ? {
|
|
40
|
+
byteLength
|
|
41
|
+
} : {})
|
|
42
|
+
}
|
|
43
|
+
};
|
|
44
|
+
const line = `${JSON.stringify(entry)}\n`;
|
|
45
|
+
const buffer = VSBuffer.fromString(line);
|
|
46
|
+
this._queue = this._queue.then(() => this._appendLine(buffer)).catch(error => {
|
|
47
|
+
this._logService.error("[AHPLog] Failed to write transport log", error);
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
async flush() {
|
|
51
|
+
await this._queue;
|
|
52
|
+
}
|
|
53
|
+
async _appendLine(buffer) {
|
|
54
|
+
if (!this._folderCreated) {
|
|
55
|
+
this._folderCreated = this._fileService.createFolder(this._directory);
|
|
56
|
+
}
|
|
57
|
+
await this._folderCreated;
|
|
58
|
+
if (this._currentSize === 0) {
|
|
59
|
+
this._currentSize = await this._getFileSize(this._currentFile);
|
|
60
|
+
}
|
|
61
|
+
if (this._currentSize > 0 && this._currentSize + buffer.byteLength > this._maxFileSizeBytes) {
|
|
62
|
+
await this._rotate();
|
|
63
|
+
}
|
|
64
|
+
await this._fileService.writeFile(this._currentFile, buffer, {
|
|
65
|
+
append: true
|
|
66
|
+
});
|
|
67
|
+
this._currentSize += buffer.byteLength;
|
|
68
|
+
}
|
|
69
|
+
async _rotate() {
|
|
70
|
+
this._segment++;
|
|
71
|
+
const oldSegment = this._segment - this._maxFiles;
|
|
72
|
+
if (oldSegment >= 0) {
|
|
73
|
+
await this._fileService.del(this._resourceForSegment(oldSegment)).catch(error => {
|
|
74
|
+
this._logService.trace("[AHPLog] Failed to delete old transport log", error);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
this._currentFile = this._resourceForSegment(this._segment);
|
|
78
|
+
this._currentSize = await this._getFileSize(this._currentFile);
|
|
79
|
+
}
|
|
80
|
+
_resourceForSegment(segment) {
|
|
81
|
+
if (segment === 0) {
|
|
82
|
+
return joinPath(this._directory, this._baseName);
|
|
83
|
+
}
|
|
84
|
+
const currentBaseName = this._baseName.slice(0, -".jsonl".length);
|
|
85
|
+
return joinPath(this._directory, `${currentBaseName}.${segment}.jsonl`);
|
|
86
|
+
}
|
|
87
|
+
async _getFileSize(resource) {
|
|
88
|
+
try {
|
|
89
|
+
return (await this._fileService.resolve(resource)).size ?? 0;
|
|
90
|
+
} catch {
|
|
91
|
+
return 0;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
AhpJsonlLogger = ( __decorate([( __param(1, IFileService)), ( __param(2, ILogService))], AhpJsonlLogger));
|
|
96
|
+
function getAhpLogByteLength(text) {
|
|
97
|
+
return VSBuffer.fromString(text).byteLength;
|
|
98
|
+
}
|
|
99
|
+
function toFileTimestamp(date) {
|
|
100
|
+
return date.toISOString().replace(/[:.]/g, "-");
|
|
101
|
+
}
|
|
102
|
+
function sanitizeFilePart(value) {
|
|
103
|
+
return value.replace(/[\\/:\*\?"<>\|\s]+/g, "-").replace(/^-+|-+$/g, "") || "connection";
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
export { AhpJsonlLogger, getAhpLogByteLength };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Emitter, Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
2
|
import { Disposable, IReference } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
3
|
+
import { IObservable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/observable";
|
|
3
4
|
import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
|
|
4
|
-
import {
|
|
5
|
-
import type {
|
|
6
|
-
import type {
|
|
7
|
-
import type { IStateSnapshot } from "
|
|
5
|
+
import { ActionEnvelope, IRootConfigChangedAction, SessionAction, StateAction } from "./sessionActions.js";
|
|
6
|
+
import type { TerminalAction } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/action-origin.generated";
|
|
7
|
+
import type { RootState, SessionState, TerminalState } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
|
|
8
|
+
import type { IStateSnapshot } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionProtocol";
|
|
8
9
|
import { StateComponents } from "@codingame/monaco-vscode-xterm-common/vscode/vs/platform/agentHost/common/state/sessionState";
|
|
9
10
|
/**
|
|
10
11
|
* A read-only subscription to an agent host resource (root, session, or terminal).
|
|
@@ -31,9 +32,9 @@ export interface IAgentSubscription<T> {
|
|
|
31
32
|
/** Fires when {@link value} changes (optimistic or confirmed). */
|
|
32
33
|
readonly onDidChange: Event<T>;
|
|
33
34
|
/** Fires before a server-originated action is applied to this subscription's state. */
|
|
34
|
-
readonly onWillApplyAction: Event<
|
|
35
|
+
readonly onWillApplyAction: Event<ActionEnvelope>;
|
|
35
36
|
/** Fires after a server-originated action is applied to this subscription's state. */
|
|
36
|
-
readonly onDidApplyAction: Event<
|
|
37
|
+
readonly onDidApplyAction: Event<ActionEnvelope>;
|
|
37
38
|
}
|
|
38
39
|
/**
|
|
39
40
|
* Base class for agent subscriptions. Handles envelope reception, confirmed
|
|
@@ -48,10 +49,10 @@ declare abstract class BaseAgentSubscription<T> extends Disposable implements IA
|
|
|
48
49
|
private _bufferedEnvelopes;
|
|
49
50
|
protected readonly _onDidChange: Emitter<T>;
|
|
50
51
|
readonly onDidChange: Event<T>;
|
|
51
|
-
protected readonly _onWillApplyAction: Emitter<
|
|
52
|
-
readonly onWillApplyAction: Event<
|
|
53
|
-
protected readonly _onDidApplyAction: Emitter<
|
|
54
|
-
readonly onDidApplyAction: Event<
|
|
52
|
+
protected readonly _onWillApplyAction: Emitter<ActionEnvelope>;
|
|
53
|
+
readonly onWillApplyAction: Event<ActionEnvelope>;
|
|
54
|
+
protected readonly _onDidApplyAction: Emitter<ActionEnvelope>;
|
|
55
|
+
readonly onDidApplyAction: Event<ActionEnvelope>;
|
|
55
56
|
protected readonly _clientId: string;
|
|
56
57
|
protected readonly _log: (msg: string) => void;
|
|
57
58
|
constructor(clientId: string, log: (msg: string) => void);
|
|
@@ -69,11 +70,11 @@ declare abstract class BaseAgentSubscription<T> extends Disposable implements IA
|
|
|
69
70
|
* Process an incoming action envelope. The subscription determines
|
|
70
71
|
* whether the action is relevant via {@link _isRelevantAction}.
|
|
71
72
|
*/
|
|
72
|
-
receiveEnvelope(envelope:
|
|
73
|
+
receiveEnvelope(envelope: ActionEnvelope): void;
|
|
73
74
|
/** Apply the reducer to confirmed state. Subclasses must implement. */
|
|
74
|
-
protected abstract _applyReducer(state: T, action:
|
|
75
|
+
protected abstract _applyReducer(state: T, action: StateAction): T;
|
|
75
76
|
/** Whether the given action targets this subscription. */
|
|
76
|
-
protected abstract _isRelevantAction(action:
|
|
77
|
+
protected abstract _isRelevantAction(action: StateAction): boolean;
|
|
77
78
|
/** Return optimistic state if write-ahead is active, otherwise `undefined`. */
|
|
78
79
|
protected _getOptimisticState(): T | undefined;
|
|
79
80
|
/** Hook called after a snapshot is applied. Replays buffered actions. */
|
|
@@ -82,21 +83,21 @@ declare abstract class BaseAgentSubscription<T> extends Disposable implements IA
|
|
|
82
83
|
* Default reconciliation: apply to confirmed, fire change event.
|
|
83
84
|
* Session subscriptions override this for write-ahead.
|
|
84
85
|
*/
|
|
85
|
-
protected _reconcile(envelope:
|
|
86
|
+
protected _reconcile(envelope: ActionEnvelope, _isOwnAction: boolean): void;
|
|
86
87
|
}
|
|
87
88
|
/**
|
|
88
89
|
* Subscription to the root state at `agenthost:/root`.
|
|
89
90
|
* Server-only mutations — no write-ahead.
|
|
90
91
|
*/
|
|
91
|
-
export declare class RootStateSubscription extends BaseAgentSubscription<
|
|
92
|
-
protected _applyReducer(state:
|
|
93
|
-
protected _isRelevantAction(action:
|
|
92
|
+
export declare class RootStateSubscription extends BaseAgentSubscription<RootState> {
|
|
93
|
+
protected _applyReducer(state: RootState, action: StateAction): RootState;
|
|
94
|
+
protected _isRelevantAction(action: StateAction): boolean;
|
|
94
95
|
}
|
|
95
96
|
/**
|
|
96
97
|
* Subscription to a session at `copilot:/<uuid>`.
|
|
97
98
|
* Supports write-ahead reconciliation for client-dispatchable actions.
|
|
98
99
|
*/
|
|
99
|
-
export declare class SessionStateSubscription extends BaseAgentSubscription<
|
|
100
|
+
export declare class SessionStateSubscription extends BaseAgentSubscription<SessionState> {
|
|
100
101
|
private readonly _pendingActions;
|
|
101
102
|
private _optimisticState;
|
|
102
103
|
private readonly _sessionUri;
|
|
@@ -106,12 +107,12 @@ export declare class SessionStateSubscription extends BaseAgentSubscription<ISes
|
|
|
106
107
|
* Optimistically apply a session action. Returns the clientSeq to send
|
|
107
108
|
* to the server so it can echo back for reconciliation.
|
|
108
109
|
*/
|
|
109
|
-
applyOptimistic(action:
|
|
110
|
-
protected _getOptimisticState():
|
|
111
|
-
protected _applyReducer(state:
|
|
112
|
-
protected _isRelevantAction(action:
|
|
110
|
+
applyOptimistic(action: SessionAction): number;
|
|
111
|
+
protected _getOptimisticState(): SessionState | undefined;
|
|
112
|
+
protected _applyReducer(state: SessionState, action: StateAction): SessionState;
|
|
113
|
+
protected _isRelevantAction(action: StateAction): boolean;
|
|
113
114
|
protected _onSnapshotApplied(fromSeq: number): void;
|
|
114
|
-
protected _reconcile(envelope:
|
|
115
|
+
protected _reconcile(envelope: ActionEnvelope, isOwnAction: boolean): void;
|
|
115
116
|
private _confirmedApply;
|
|
116
117
|
private _recomputeOptimistic;
|
|
117
118
|
/**
|
|
@@ -123,11 +124,11 @@ export declare class SessionStateSubscription extends BaseAgentSubscription<ISes
|
|
|
123
124
|
* Subscription to a terminal at an agent-host terminal URI.
|
|
124
125
|
* Server-only mutations — no write-ahead (terminal I/O is side-effect-only).
|
|
125
126
|
*/
|
|
126
|
-
export declare class TerminalStateSubscription extends BaseAgentSubscription<
|
|
127
|
+
export declare class TerminalStateSubscription extends BaseAgentSubscription<TerminalState> {
|
|
127
128
|
private readonly _terminalUri;
|
|
128
129
|
constructor(terminalUri: string, clientId: string, log: (msg: string) => void);
|
|
129
|
-
protected _applyReducer(state:
|
|
130
|
-
protected _isRelevantAction(action:
|
|
130
|
+
protected _applyReducer(state: TerminalState, action: StateAction): TerminalState;
|
|
131
|
+
protected _isRelevantAction(action: StateAction): boolean;
|
|
131
132
|
}
|
|
132
133
|
/**
|
|
133
134
|
* Manages the lifecycle of resource subscriptions for an agent connection.
|
|
@@ -149,12 +150,12 @@ export declare class AgentSubscriptionManager extends Disposable {
|
|
|
149
150
|
private readonly _unsubscribe;
|
|
150
151
|
constructor(clientId: string, seqAllocator: () => number, log: (msg: string) => void, subscribe: (resource: URI) => Promise<IStateSnapshot>, unsubscribe: (resource: URI) => void);
|
|
151
152
|
/** The always-live root state subscription. */
|
|
152
|
-
get rootState(): IAgentSubscription<
|
|
153
|
+
get rootState(): IAgentSubscription<RootState>;
|
|
153
154
|
/**
|
|
154
155
|
* Initialize the root state from a snapshot received during the
|
|
155
156
|
* connection handshake.
|
|
156
157
|
*/
|
|
157
|
-
handleRootSnapshot(state:
|
|
158
|
+
handleRootSnapshot(state: RootState, fromSeq: number): void;
|
|
158
159
|
/**
|
|
159
160
|
* Returns an existing subscription without affecting its refcount.
|
|
160
161
|
* Returns `undefined` if no subscription is active for the given resource.
|
|
@@ -169,14 +170,21 @@ export declare class AgentSubscriptionManager extends Disposable {
|
|
|
169
170
|
/**
|
|
170
171
|
* Route an incoming action envelope to all active subscriptions.
|
|
171
172
|
*/
|
|
172
|
-
receiveEnvelope(envelope:
|
|
173
|
+
receiveEnvelope(envelope: ActionEnvelope): void;
|
|
173
174
|
/**
|
|
174
175
|
* Dispatch a client action. Applies optimistically to the relevant
|
|
175
176
|
* subscription if applicable, then returns the clientSeq.
|
|
176
177
|
*/
|
|
177
|
-
dispatchOptimistic(action:
|
|
178
|
+
dispatchOptimistic(action: SessionAction | TerminalAction | IRootConfigChangedAction): number;
|
|
178
179
|
private _createSubscription;
|
|
179
180
|
private _releaseSubscription;
|
|
180
181
|
dispose(): void;
|
|
181
182
|
}
|
|
183
|
+
/**
|
|
184
|
+
* Adapts an {@link IAgentSubscription} into an {@link IObservable} of the
|
|
185
|
+
* subscription's value. Errors and the pre-snapshot phase are surfaced as
|
|
186
|
+
* `undefined`; consumers that need the error itself should read
|
|
187
|
+
* {@link IAgentSubscription.value} directly.
|
|
188
|
+
*/
|
|
189
|
+
export declare function observableFromSubscription<T>(owner: object | undefined, sub: IAgentSubscription<T>): IObservable<T | undefined>;
|
|
182
190
|
export {};
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
3
|
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
4
4
|
import { ResourceMap } from '@codingame/monaco-vscode-api/vscode/vs/base/common/map';
|
|
5
|
+
import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
|
|
5
6
|
import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
|
|
6
7
|
import { isSessionAction } from './sessionActions.js';
|
|
7
8
|
import { rootReducer, sessionReducer, terminalReducer } from './protocol/reducers.js';
|
|
@@ -234,7 +235,7 @@ class AgentSubscriptionManager extends Disposable {
|
|
|
234
235
|
dispatchOptimistic(action) {
|
|
235
236
|
if (isSessionAction(action)) {
|
|
236
237
|
const entry = this._subscriptions.get(( URI.parse(action.session)));
|
|
237
|
-
if (entry
|
|
238
|
+
if (entry?.sub instanceof SessionStateSubscription) {
|
|
238
239
|
return entry.sub.applyOptimistic(action);
|
|
239
240
|
}
|
|
240
241
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ProtectedResourceMetadata } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
|
|
2
|
+
import type { ResourceRequestParams } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/commands";
|
|
1
3
|
/**
|
|
2
4
|
* Standard JSON-RPC 2.0 error codes.
|
|
3
5
|
*
|
|
@@ -30,15 +32,20 @@ export declare const AhpErrorCodes: {
|
|
|
30
32
|
readonly SessionAlreadyExists: -32003;
|
|
31
33
|
/** The operation requires no active turn, but one is in progress */
|
|
32
34
|
readonly TurnInProgress: -32004;
|
|
33
|
-
/**
|
|
35
|
+
/**
|
|
36
|
+
* The server cannot speak any of the protocol versions offered by the
|
|
37
|
+
* client in `InitializeParams.protocolVersions`. The `data` field of the
|
|
38
|
+
* JSON-RPC error MAY be an `UnsupportedProtocolVersionErrorData` advertising
|
|
39
|
+
* the protocol versions the server is willing to speak.
|
|
40
|
+
*/
|
|
34
41
|
readonly UnsupportedProtocolVersion: -32005;
|
|
35
42
|
/** The requested content URI does not exist */
|
|
36
43
|
readonly ContentNotFound: -32006;
|
|
37
44
|
/**
|
|
38
45
|
* A command failed because the client has not authenticated for a required
|
|
39
|
-
* protected resource. The `data` field of the JSON-RPC error
|
|
40
|
-
*
|
|
41
|
-
*
|
|
46
|
+
* protected resource. The `data` field of the JSON-RPC error MUST be an
|
|
47
|
+
* `AuthRequiredErrorData` describing the resources that require
|
|
48
|
+
* authentication.
|
|
42
49
|
*
|
|
43
50
|
* @see {@link /specification/authentication | Authentication}
|
|
44
51
|
*/
|
|
@@ -51,6 +58,10 @@ export declare const AhpErrorCodes: {
|
|
|
51
58
|
* Servers SHOULD return this when a client attempts to read or browse
|
|
52
59
|
* a path outside the allowed set (e.g. outside the session's working
|
|
53
60
|
* directory or workspace roots).
|
|
61
|
+
*
|
|
62
|
+
* The `data` field of the JSON-RPC error MAY be a
|
|
63
|
+
* `PermissionDeniedErrorData` advertising a `resourceRequest` that, if
|
|
64
|
+
* granted, would unlock the operation.
|
|
54
65
|
*/
|
|
55
66
|
readonly PermissionDenied: -32009;
|
|
56
67
|
/**
|
|
@@ -63,3 +74,102 @@ export declare const AhpErrorCodes: {
|
|
|
63
74
|
export type AhpErrorCode = (typeof AhpErrorCodes)[keyof typeof AhpErrorCodes];
|
|
64
75
|
/** Union type of all JSON-RPC error codes. */
|
|
65
76
|
export type JsonRpcErrorCode = (typeof JsonRpcErrorCodes)[keyof typeof JsonRpcErrorCodes];
|
|
77
|
+
/**
|
|
78
|
+
* Details carried in the `data` field of an `AuthRequired` (-32007) error.
|
|
79
|
+
*
|
|
80
|
+
* Wraps the protected resource list in `{ resources: [...] }` rather than
|
|
81
|
+
* returning a bare array, so additional fields can be added in future
|
|
82
|
+
* versions without breaking the wire shape.
|
|
83
|
+
*
|
|
84
|
+
* @category Error Details
|
|
85
|
+
* @version 1
|
|
86
|
+
*/
|
|
87
|
+
export interface AuthRequiredErrorData {
|
|
88
|
+
/** Protected resources that require authentication. */
|
|
89
|
+
resources: ProtectedResourceMetadata[];
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Details carried in the `data` field of a `PermissionDenied` (-32009) error.
|
|
93
|
+
*
|
|
94
|
+
* The receiver MAY advertise a `resourceRequest` payload describing the
|
|
95
|
+
* access that, if granted, would unlock the operation. The caller MAY then
|
|
96
|
+
* issue `resourceRequest` with that payload to negotiate access.
|
|
97
|
+
*
|
|
98
|
+
* @category Error Details
|
|
99
|
+
* @version 1
|
|
100
|
+
*/
|
|
101
|
+
export interface PermissionDeniedErrorData {
|
|
102
|
+
/**
|
|
103
|
+
* The resource access that, if granted via `resourceRequest`, would unlock
|
|
104
|
+
* the operation. Omitted when no specific access grant would resolve the
|
|
105
|
+
* denial (for example, when the resource is fundamentally inaccessible).
|
|
106
|
+
*/
|
|
107
|
+
request?: ResourceRequestParams;
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Details carried in the `data` field of an `UnsupportedProtocolVersion`
|
|
111
|
+
* (-32005) error.
|
|
112
|
+
*
|
|
113
|
+
* @category Error Details
|
|
114
|
+
* @version 1
|
|
115
|
+
*/
|
|
116
|
+
export interface UnsupportedProtocolVersionErrorData {
|
|
117
|
+
/**
|
|
118
|
+
* Protocol versions the server is willing to speak.
|
|
119
|
+
*
|
|
120
|
+
* Each entry is either a [SemVer](https://semver.org) `MAJOR.MINOR.PATCH`
|
|
121
|
+
* string (e.g. `"0.1.0"`) or a [SemVer range](https://semver.org/#spec-item-11)
|
|
122
|
+
* constraint (e.g. `">=0.1.0 <0.3.0"` or `"^0.2.0"`).
|
|
123
|
+
*/
|
|
124
|
+
supportedVersions: string[];
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Maps each AHP error code that carries structured `data` to the type of
|
|
128
|
+
* that data.
|
|
129
|
+
*
|
|
130
|
+
* Error codes not present in this map either have no `data` payload or
|
|
131
|
+
* carry an unspecified payload that callers SHOULD treat as `unknown`.
|
|
132
|
+
*
|
|
133
|
+
* @category Error Details
|
|
134
|
+
* @version 1
|
|
135
|
+
*/
|
|
136
|
+
export interface AhpErrorDetailsMap {
|
|
137
|
+
[AhpErrorCodes.AuthRequired]: AuthRequiredErrorData;
|
|
138
|
+
[AhpErrorCodes.PermissionDenied]: PermissionDeniedErrorData;
|
|
139
|
+
[AhpErrorCodes.UnsupportedProtocolVersion]: UnsupportedProtocolVersionErrorData;
|
|
140
|
+
}
|
|
141
|
+
/** AHP error codes that carry a structured `data` payload. */
|
|
142
|
+
export type AhpErrorCodeWithData = keyof AhpErrorDetailsMap;
|
|
143
|
+
/**
|
|
144
|
+
* A typed JSON-RPC error object whose `data` is narrowed by `code`.
|
|
145
|
+
*
|
|
146
|
+
* Distributes over the `AhpErrorCode` union so narrowing on `code` reveals
|
|
147
|
+
* the precise `data` type. For codes listed in {@link AhpErrorDetailsMap}
|
|
148
|
+
* `data` is required; for all other codes `data` is an optional `unknown`.
|
|
149
|
+
*
|
|
150
|
+
* ```ts
|
|
151
|
+
* function handle(err: AhpError) {
|
|
152
|
+
* if (err.code === AhpErrorCodes.PermissionDenied) {
|
|
153
|
+
* err.data.request; // typed as ResourceRequestParams | undefined
|
|
154
|
+
* }
|
|
155
|
+
* }
|
|
156
|
+
* ```
|
|
157
|
+
*
|
|
158
|
+
* @category Error Details
|
|
159
|
+
* @version 1
|
|
160
|
+
*/
|
|
161
|
+
export type AhpError<C extends AhpErrorCode = AhpErrorCode> = C extends AhpErrorCode ? C extends keyof AhpErrorDetailsMap ? {
|
|
162
|
+
/** The error code. */
|
|
163
|
+
readonly code: C;
|
|
164
|
+
/** Human-readable error message. */
|
|
165
|
+
readonly message: string;
|
|
166
|
+
/** Structured detail payload mandated by `AhpErrorDetailsMap`. */
|
|
167
|
+
readonly data: AhpErrorDetailsMap[C];
|
|
168
|
+
} : {
|
|
169
|
+
/** The error code. */
|
|
170
|
+
readonly code: C;
|
|
171
|
+
/** Human-readable error message. */
|
|
172
|
+
readonly message: string;
|
|
173
|
+
/** Optional, unspecified detail payload. */
|
|
174
|
+
readonly data?: unknown;
|
|
175
|
+
} : never;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type
|
|
2
|
-
import { type
|
|
1
|
+
import { type RootState, type SessionState, type TerminalState } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state";
|
|
2
|
+
import { type RootAction, type ClientRootAction, type SessionAction, type ClientSessionAction, type TerminalAction, type ClientTerminalAction } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/action-origin.generated";
|
|
3
3
|
/**
|
|
4
4
|
* Soft assertion for exhaustiveness checking. Place in the `default` branch of
|
|
5
5
|
* a switch on a discriminated union so the compiler errors when a new variant
|
|
@@ -10,21 +10,21 @@ import { type IRootAction, type ISessionAction, type IClientSessionAction, type
|
|
|
10
10
|
*/
|
|
11
11
|
export declare function softAssertNever(value: never, log?: (msg: string) => void): void;
|
|
12
12
|
/**
|
|
13
|
-
* Pure reducer for root state. Handles all {@link
|
|
13
|
+
* Pure reducer for root state. Handles all {@link RootAction} variants.
|
|
14
14
|
*/
|
|
15
|
-
export declare function rootReducer(state:
|
|
15
|
+
export declare function rootReducer(state: RootState, action: RootAction, log?: (msg: string) => void): RootState;
|
|
16
16
|
/**
|
|
17
|
-
* Pure reducer for session state. Handles all {@link
|
|
17
|
+
* Pure reducer for session state. Handles all {@link SessionAction} variants.
|
|
18
18
|
*/
|
|
19
|
-
export declare function sessionReducer(state:
|
|
19
|
+
export declare function sessionReducer(state: SessionState, action: SessionAction, log?: (msg: string) => void): SessionState;
|
|
20
20
|
/**
|
|
21
|
-
* Pure reducer for terminal state. Handles all {@link
|
|
21
|
+
* Pure reducer for terminal state. Handles all {@link TerminalAction} variants.
|
|
22
22
|
*/
|
|
23
|
-
export declare function terminalReducer(state:
|
|
23
|
+
export declare function terminalReducer(state: TerminalState, action: TerminalAction, log?: (msg: string) => void): TerminalState;
|
|
24
24
|
/**
|
|
25
|
-
* Type guard that checks whether
|
|
25
|
+
* Type guard that checks whether an action may be dispatched by a client.
|
|
26
26
|
*
|
|
27
27
|
* Servers SHOULD call this to validate incoming `dispatchAction` requests
|
|
28
28
|
* and reject any action the client is not allowed to originate.
|
|
29
29
|
*/
|
|
30
|
-
export declare function isClientDispatchable(action:
|
|
30
|
+
export declare function isClientDispatchable(action: RootAction | SessionAction | TerminalAction): action is ClientRootAction | ClientSessionAction | ClientTerminalAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { ActionType } from '@codingame/monaco-vscode-xterm-common/vscode/vs/platform/agentHost/common/state/protocol/actions';
|
|
3
|
-
import { ResponsePartKind, ToolCallStatus, SessionStatus, ToolCallCancellationReason, PendingMessageKind, TurnState, SessionLifecycle } from '@codingame/monaco-vscode-
|
|
3
|
+
import { ResponsePartKind, ToolCallStatus, SessionStatus, ToolCallCancellationReason, PendingMessageKind, TurnState, SessionLifecycle } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/protocol/state';
|
|
4
4
|
|
|
5
5
|
function softAssertNever(value, log) {
|
|
6
6
|
const msg = `Unhandled action type: ${JSON.stringify(value)}`;
|
|
@@ -23,17 +23,21 @@ function hasPendingToolCallConfirmation(state) {
|
|
|
23
23
|
part => part.kind === ResponsePartKind.ToolCall && (part.toolCall.status === ToolCallStatus.PendingConfirmation || part.toolCall.status === ToolCallStatus.PendingResultConfirmation)
|
|
24
24
|
));
|
|
25
25
|
}
|
|
26
|
+
function withStatusFlag(status, flag, set) {
|
|
27
|
+
return set ? status | flag : status & ~flag;
|
|
28
|
+
}
|
|
26
29
|
function summaryStatus(state, terminalStatus) {
|
|
30
|
+
let activity;
|
|
27
31
|
if (terminalStatus) {
|
|
28
|
-
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
activity = terminalStatus;
|
|
33
|
+
} else if ((state.inputRequests?.length ?? 0) > 0 || hasPendingToolCallConfirmation(state)) {
|
|
34
|
+
activity = SessionStatus.InputNeeded;
|
|
35
|
+
} else if (state.activeTurn) {
|
|
36
|
+
activity = SessionStatus.InProgress;
|
|
37
|
+
} else {
|
|
38
|
+
activity = SessionStatus.Idle;
|
|
35
39
|
}
|
|
36
|
-
return
|
|
40
|
+
return state.summary.status & -32 | activity;
|
|
37
41
|
}
|
|
38
42
|
function refreshSummaryStatus(state) {
|
|
39
43
|
const status = summaryStatus(state);
|
|
@@ -119,9 +123,8 @@ function upsertInputRequest(state, request) {
|
|
|
119
123
|
...next,
|
|
120
124
|
summary: {
|
|
121
125
|
...next.summary,
|
|
122
|
-
status: summaryStatus(next),
|
|
123
|
-
modifiedAt: Date.now()
|
|
124
|
-
isRead: false
|
|
126
|
+
status: withStatusFlag(summaryStatus(next), SessionStatus.IsRead, false),
|
|
127
|
+
modifiedAt: Date.now()
|
|
125
128
|
}
|
|
126
129
|
};
|
|
127
130
|
}
|
|
@@ -160,6 +163,22 @@ function rootReducer(state, action, log) {
|
|
|
160
163
|
...state,
|
|
161
164
|
terminals: action.terminals
|
|
162
165
|
};
|
|
166
|
+
case ActionType.RootConfigChanged:
|
|
167
|
+
if (!state.config) {
|
|
168
|
+
return state;
|
|
169
|
+
}
|
|
170
|
+
return {
|
|
171
|
+
...state,
|
|
172
|
+
config: {
|
|
173
|
+
...state.config,
|
|
174
|
+
values: action.replace ? {
|
|
175
|
+
...action.config
|
|
176
|
+
} : {
|
|
177
|
+
...state.config.values,
|
|
178
|
+
...action.config
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
};
|
|
163
182
|
default:
|
|
164
183
|
softAssertNever(action, log);
|
|
165
184
|
return state;
|
|
@@ -197,9 +216,8 @@ function sessionReducer(state, action, log) {
|
|
|
197
216
|
...next,
|
|
198
217
|
summary: {
|
|
199
218
|
...next.summary,
|
|
200
|
-
status: summaryStatus(next),
|
|
201
|
-
modifiedAt: Date.now()
|
|
202
|
-
isRead: false
|
|
219
|
+
status: withStatusFlag(summaryStatus(next), SessionStatus.IsRead, false),
|
|
220
|
+
modifiedAt: Date.now()
|
|
203
221
|
}
|
|
204
222
|
};
|
|
205
223
|
if (action.queuedMessageId) {
|
|
@@ -307,15 +325,23 @@ function sessionReducer(state, action, log) {
|
|
|
307
325
|
...state,
|
|
308
326
|
summary: {
|
|
309
327
|
...state.summary,
|
|
310
|
-
|
|
328
|
+
status: withStatusFlag(state.summary.status, SessionStatus.IsRead, action.isRead)
|
|
311
329
|
}
|
|
312
330
|
};
|
|
313
|
-
case ActionType.
|
|
331
|
+
case ActionType.SessionIsArchivedChanged:
|
|
314
332
|
return {
|
|
315
333
|
...state,
|
|
316
334
|
summary: {
|
|
317
335
|
...state.summary,
|
|
318
|
-
|
|
336
|
+
status: withStatusFlag(state.summary.status, SessionStatus.IsArchived, action.isArchived)
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
case ActionType.SessionActivityChanged:
|
|
340
|
+
return {
|
|
341
|
+
...state,
|
|
342
|
+
summary: {
|
|
343
|
+
...state.summary,
|
|
344
|
+
activity: action.activity
|
|
319
345
|
}
|
|
320
346
|
};
|
|
321
347
|
case ActionType.SessionDiffsChanged:
|
|
@@ -334,7 +360,9 @@ function sessionReducer(state, action, log) {
|
|
|
334
360
|
...state,
|
|
335
361
|
config: {
|
|
336
362
|
...state.config,
|
|
337
|
-
values: {
|
|
363
|
+
values: action.replace ? {
|
|
364
|
+
...action.config
|
|
365
|
+
} : {
|
|
338
366
|
...state.config.values,
|
|
339
367
|
...action.config
|
|
340
368
|
}
|
|
@@ -344,6 +372,11 @@ function sessionReducer(state, action, log) {
|
|
|
344
372
|
modifiedAt: Date.now()
|
|
345
373
|
}
|
|
346
374
|
};
|
|
375
|
+
case ActionType.SessionMetaChanged:
|
|
376
|
+
return {
|
|
377
|
+
...state,
|
|
378
|
+
_meta: action._meta
|
|
379
|
+
};
|
|
347
380
|
case ActionType.SessionServerToolsChanged:
|
|
348
381
|
return {
|
|
349
382
|
...state,
|