@codingame/monaco-vscode-chat-service-override 36.2.7 → 37.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.
Files changed (725) hide show
  1. package/index.d.ts +1 -0
  2. package/index.js +92 -10
  3. package/package.json +5 -5
  4. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +10 -3
  5. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +54 -17
  6. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.d.ts +14 -0
  7. package/vscode/src/vs/platform/agentHost/browser/agentHostEnablementService.js +46 -0
  8. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.d.ts +7 -2
  9. package/vscode/src/vs/platform/agentHost/browser/agentHostIpcChannelTransport.js +34 -2
  10. package/vscode/src/vs/platform/agentHost/browser/{remoteAgentHostProtocolClient.d.ts → agentHostProtocolClient.d.ts} +240 -60
  11. package/vscode/src/vs/platform/agentHost/browser/agentHostProtocolClient.js +1911 -0
  12. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +30 -33
  13. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +381 -315
  14. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.d.ts +3 -1
  15. package/vscode/src/vs/platform/agentHost/browser/webSocketClientTransport.js +2 -0
  16. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.d.ts +9 -0
  17. package/vscode/src/vs/platform/agentHost/common/agentHostClientInfo.js +20 -0
  18. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.d.ts +144 -0
  19. package/vscode/src/vs/platform/agentHost/common/agentHostExtensionProtocol.js +20 -0
  20. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +14 -6
  21. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +14 -10
  22. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemService.js +1 -1
  23. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.d.ts +47 -0
  24. package/vscode/src/vs/platform/agentHost/common/agentHostManagedRules.js +75 -0
  25. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.d.ts +68 -0
  26. package/vscode/src/vs/platform/agentHost/common/agentHostManagedSettings.js +161 -0
  27. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +288 -45
  28. package/vscode/src/vs/platform/agentHost/common/agentMerge.d.ts +261 -0
  29. package/vscode/src/vs/platform/agentHost/common/agentMerge.js +67 -0
  30. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.d.ts +53 -0
  31. package/vscode/src/vs/platform/agentHost/common/agentSdkSetup.js +45 -0
  32. package/vscode/src/vs/platform/agentHost/common/changesetUri.d.ts +130 -0
  33. package/vscode/src/vs/platform/agentHost/common/changesetUri.js +27 -0
  34. package/vscode/src/vs/platform/agentHost/common/customAgents.d.ts +8 -2
  35. package/vscode/src/vs/platform/agentHost/common/customAgents.js +7 -0
  36. package/vscode/src/vs/platform/agentHost/common/meta/agentChatSurfaceMeta.d.ts +39 -0
  37. package/vscode/src/vs/platform/agentHost/common/meta/agentChatSurfaceMeta.js +25 -0
  38. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.d.ts +110 -0
  39. package/vscode/src/vs/platform/agentHost/common/meta/agentCompletionAttachmentMeta.js +38 -0
  40. package/vscode/src/vs/platform/agentHost/common/meta/agentHostArtifactRemovalMeta.d.ts +4 -0
  41. package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.d.ts +7 -0
  42. package/vscode/src/vs/platform/agentHost/common/meta/clientPluginCustomizationMeta.js +14 -0
  43. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +3 -3
  44. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +16 -24
  45. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.d.ts +8 -0
  46. package/vscode/src/vs/platform/agentHost/common/semanticSearchConstants.js +8 -0
  47. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.d.ts +75 -0
  48. package/vscode/src/vs/platform/agentHost/common/sessionArtifacts.js +84 -0
  49. package/vscode/src/vs/platform/agentHost/common/shellInitScript.d.ts +24 -0
  50. package/vscode/src/vs/platform/agentHost/common/shellInitScript.js +63 -0
  51. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +71 -20
  52. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +187 -26
  53. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.d.ts +30 -0
  54. package/vscode/src/vs/platform/agentHost/common/state/legacyProtocolCompatibility.js +87 -0
  55. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +2 -2
  56. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.d.ts +4 -0
  57. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation/reducer.js +37 -0
  58. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.d.ts +4 -0
  59. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-automation-run/reducer.js +45 -0
  60. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.d.ts +5 -4
  61. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +100 -35
  62. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +193 -49
  63. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +161 -40
  64. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.d.ts +1 -1
  65. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-terminal/reducer.js +5 -1
  66. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +2 -2
  67. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.d.ts +1 -0
  68. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/timestamps.js +7 -0
  69. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
  70. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +114 -3
  71. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +28 -5
  72. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +4 -2
  73. package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.d.ts +34 -0
  74. package/vscode/src/vs/platform/agentHost/common/state/sessionWorkingDirectories.js +28 -0
  75. package/vscode/src/vs/platform/agentHost/common/worktreePaths.d.ts +24 -0
  76. package/vscode/src/vs/platform/agentHost/common/worktreePaths.js +15 -0
  77. package/vscode/src/vs/platform/browserView/common/browserChatToolReferenceNames.d.ts +1 -1
  78. package/vscode/src/vs/platform/chat/common/aiAgentEnv.d.ts +18 -0
  79. package/vscode/src/vs/platform/chat/common/aiAgentEnv.js +6 -0
  80. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.d.ts +5 -1
  81. package/vscode/src/vs/platform/networkFilter/common/domainMatcher.js +77 -5
  82. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.d.ts +1 -1
  83. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +9 -5
  84. package/vscode/src/vs/platform/networkFilter/common/settings.d.ts +1 -5
  85. package/vscode/src/vs/platform/networkFilter/common/settings.js +0 -4
  86. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +19 -7
  87. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +49 -37
  88. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.d.ts +2 -1
  89. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +12 -0
  90. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +1 -2
  91. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +1 -0
  92. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveParseSafety.d.ts +5 -0
  93. package/vscode/src/vs/platform/terminal/common/autoApprove/autoApproveParseSafety.js +7 -0
  94. package/vscode/src/vs/platform/terminal/common/autoApprove/cmdDelayedExpansion.d.ts +5 -0
  95. package/vscode/src/vs/platform/terminal/common/autoApprove/cmdDelayedExpansion.js +8 -0
  96. package/vscode/src/vs/{workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers → platform/terminal/common/autoApprove}/sedFileWriteParser.d.ts +1 -2
  97. package/vscode/src/vs/workbench/browser/chatChangesPill.d.ts +29 -0
  98. package/vscode/src/vs/workbench/browser/chatChangesPill.js +84 -0
  99. package/vscode/src/vs/workbench/common/chatPullRequest.d.ts +19 -0
  100. package/vscode/src/vs/workbench/common/chatPullRequest.js +53 -0
  101. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +342 -155
  102. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +2 -2
  103. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +25 -2
  104. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +150 -67
  105. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +5 -3
  106. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +5 -1
  107. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +39 -9
  108. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +1 -1
  109. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +3 -3
  110. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +6 -6
  111. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +4 -2
  112. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +54 -17
  113. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +11 -11
  114. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +1 -1
  115. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +9 -9
  116. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +1 -1
  117. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +5 -5
  118. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +6 -0
  119. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +5 -1
  120. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +1 -1
  121. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +1 -1
  122. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +2 -2
  123. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/media/voiceModeOnboarding.css +252 -0
  124. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +13 -13
  125. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +7 -7
  126. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.d.ts +146 -0
  127. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.js +889 -0
  128. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +2 -2
  129. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.d.ts +2 -7
  130. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +3 -54
  131. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +32 -3
  132. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +214 -161
  133. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +10 -9
  134. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +2 -1
  135. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +256 -72
  136. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  137. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.d.ts +2 -1
  138. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +11 -12
  139. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +19 -15
  140. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +30 -14
  141. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +19 -10
  142. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +9 -9
  143. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  144. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.d.ts +6 -0
  145. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFindActions.js +237 -0
  146. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +7 -6
  147. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  148. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +10 -10
  149. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.d.ts +6 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +68 -61
  151. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +17 -21
  152. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +17 -21
  153. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  154. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.d.ts +5 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +68 -14
  156. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +9 -9
  157. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +21 -19
  158. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.d.ts +7 -2
  159. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +222 -72
  160. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +64 -17
  161. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +530 -305
  162. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.d.ts +25 -0
  163. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openAgentHostStateFileAction.js +63 -0
  164. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.d.ts +30 -0
  165. package/vscode/src/vs/workbench/contrib/chat/browser/agentHostCompletionAction.js +37 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.d.ts +6 -0
  167. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginCommands.js +95 -0
  168. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +10 -6
  169. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  170. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginItems.d.ts +2 -1
  171. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +18 -1
  172. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +86 -47
  173. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +61 -47
  174. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +43 -24
  175. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +326 -76
  176. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +112 -5
  177. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +33 -7
  178. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.d.ts +20 -0
  179. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.js +26 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +28 -10
  181. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +110 -126
  182. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.d.ts +131 -0
  183. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupport.js +638 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.d.ts +41 -0
  185. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostMcpServerSupportScope.js +202 -0
  186. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.d.ts +24 -1
  187. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +26 -5
  188. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +10 -7
  189. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.d.ts +20 -0
  190. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.js +55 -0
  191. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.d.ts +62 -0
  192. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostResponseFileChanges.js +40 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.d.ts +59 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionInputPills.js +624 -0
  195. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.d.ts +90 -0
  196. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.js +207 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.d.ts +31 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.js +140 -0
  199. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +4 -0
  200. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +5 -1
  201. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolUtils.js +5 -4
  202. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +74 -5
  203. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +511 -171
  204. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.d.ts +32 -0
  205. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/applyAgentHostSessionConfig.js +48 -0
  206. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +55 -6
  207. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +210 -20
  208. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +43 -24
  209. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.d.ts +46 -10
  210. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +216 -110
  211. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.d.ts +9 -4
  212. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +26 -17
  213. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  214. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  215. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  216. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  217. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +30 -26
  218. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/agenttitlebarstatuswidget.css +5 -2
  219. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/media/unifiedQuickAccess.css +6 -6
  220. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  221. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  222. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.d.ts +3 -0
  223. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/externalSessionsFilterMenu.js +62 -0
  224. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/media/sessionSummaryHover.css +104 -0
  225. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.d.ts +115 -0
  226. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHover.js +168 -0
  227. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.d.ts +24 -0
  228. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.js +32 -0
  229. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessionsConfiguration.js +56 -0
  230. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +0 -4
  231. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +16 -17
  232. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +7 -3
  233. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +1 -0
  234. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +2 -0
  235. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +10 -1
  236. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +48 -1
  237. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +913 -220
  238. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.d.ts +1 -1
  239. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +148 -84
  240. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +161 -17
  241. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +2367 -247
  242. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +5 -2
  243. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +21 -13
  244. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.d.ts +26 -0
  245. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementSectionRegistry.js +34 -0
  246. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.d.ts +2 -0
  247. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationPresentation.js +23 -0
  248. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +15 -0
  249. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +3 -0
  250. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +10 -2
  251. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +143 -68
  252. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +1 -0
  253. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +10 -5
  254. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.d.ts +40 -0
  255. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCardList.js +302 -0
  256. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +1 -2
  257. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +49 -8
  258. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationGroupHeaderRenderer.js +3 -3
  259. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.d.ts +38 -0
  260. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigration.js +240 -0
  261. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.d.ts +1 -0
  262. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationAccessibility.js +53 -0
  263. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.d.ts +82 -0
  264. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationCategories.js +762 -0
  265. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.d.ts +80 -0
  266. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationDashboard.js +279 -0
  267. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.d.ts +44 -0
  268. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl.js +437 -0
  269. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.d.ts +85 -6
  270. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +697 -15
  271. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +7 -7
  272. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.d.ts +40 -10
  273. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +164 -42
  274. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +6 -9
  275. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +260 -31
  276. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +2097 -589
  277. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.d.ts +32 -0
  278. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpServerCustomizationMigration.js +860 -0
  279. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +2229 -1338
  280. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +79 -26
  281. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/customizationMigrationDashboard.css +354 -0
  282. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +85 -9
  283. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +1550 -357
  284. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +2 -4
  285. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +13 -27
  286. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +38 -26
  287. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +637 -319
  288. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +28 -10
  289. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService.d.ts +10 -0
  290. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService.js +22 -0
  291. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.d.ts +15 -0
  292. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution.js +38 -0
  293. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.d.ts +8 -0
  294. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution.js +38 -0
  295. package/vscode/src/vs/workbench/contrib/chat/browser/chat.contribution.js +4 -1
  296. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +1675 -633
  297. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +93 -6
  298. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +823 -52
  299. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.d.ts +132 -0
  300. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostLogSources.js +446 -0
  301. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.d.ts +183 -0
  302. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostUsageSidecar.js +218 -0
  303. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +45 -42
  304. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +11 -0
  305. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +163 -136
  306. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +72 -72
  307. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +7 -7
  308. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.d.ts +22 -2
  309. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditor.js +105 -14
  310. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  311. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.d.ts +32 -0
  312. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEnablement.js +49 -0
  313. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  314. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  315. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  316. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  317. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +27 -22
  318. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.d.ts +6 -0
  319. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +22 -23
  320. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  321. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +25 -25
  322. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  323. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  324. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.d.ts +7 -2
  325. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +76 -43
  326. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  327. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.d.ts +3 -2
  328. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugTypes.js +1 -0
  329. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.d.ts +145 -0
  330. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugWireLogView.js +839 -0
  331. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +277 -3
  332. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  333. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.d.ts +6 -6
  334. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  335. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +8 -8
  336. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  337. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +16 -16
  338. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.d.ts +4 -4
  339. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +2 -2
  340. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +8 -4
  341. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  342. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.d.ts +6 -3
  343. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +35 -19
  344. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +16 -9
  345. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSessionStorage.js +4 -3
  346. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.d.ts +4 -4
  347. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingEditorOverlay.css +4 -0
  348. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/media/chatEditingExplanationWidget.css +7 -2
  349. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  350. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/notebookCellChanges.d.ts +5 -5
  351. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +3 -3
  352. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.d.ts +86 -0
  353. package/vscode/src/vs/workbench/contrib/chat/browser/chatInputPills.js +282 -0
  354. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +14 -10
  355. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  356. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.d.ts +5 -0
  357. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsViewModel.js +37 -25
  358. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +7 -5
  359. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +135 -82
  360. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +22 -3
  361. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutlineCreator.d.ts +17 -0
  362. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutlineCreator.js +28 -0
  363. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +5 -5
  364. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +32 -32
  365. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.d.ts +7 -0
  366. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementPreview.js +114 -0
  367. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.d.ts +45 -0
  368. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievements.contribution.js +326 -0
  369. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.d.ts +33 -0
  370. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditor.js +99 -0
  371. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.d.ts +17 -0
  372. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsEditorInput.js +46 -0
  373. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.d.ts +27 -0
  374. package/vscode/src/vs/workbench/contrib/chat/browser/chatPetAchievementsWidget.js +301 -0
  375. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.d.ts +22 -0
  376. package/vscode/src/vs/workbench/contrib/chat/browser/chatPromoNotification.js +103 -0
  377. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +9 -36
  378. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +103 -196
  379. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  380. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +36 -30
  381. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.d.ts +2 -0
  382. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +51 -12
  383. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  384. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +31 -27
  385. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +65 -20
  386. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +291 -138
  387. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/chatSetup.css +9 -0
  388. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-dark.svg +1 -0
  389. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/media/microsoft-light.svg +1 -0
  390. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChat.d.ts +9 -0
  391. package/vscode/src/vs/workbench/contrib/chat/browser/chatSideChat.js +24 -0
  392. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.d.ts +2 -1
  393. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +59 -35
  394. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +7 -2
  395. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +221 -145
  396. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +15 -29
  397. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +21 -3
  398. package/vscode/src/vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.d.ts +22 -0
  399. package/vscode/src/vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.js +27 -0
  400. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.d.ts +9 -0
  401. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +23 -21
  402. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.d.ts +6 -1
  403. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +62 -6
  404. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.d.ts +15 -1
  405. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +97 -8
  406. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  407. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +6 -6
  408. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.d.ts +11 -2
  409. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContextService.js +24 -16
  410. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  411. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  412. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.d.ts +44 -0
  413. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationConfig.js +232 -0
  414. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.d.ts +36 -0
  415. package/vscode/src/vs/workbench/contrib/chat/browser/expNotification/chatExpNotificationContribution.js +127 -0
  416. package/vscode/src/vs/workbench/contrib/chat/browser/exploreAgentDefaultModel.js +1 -1
  417. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyPromptContribution.d.ts +18 -0
  418. package/vscode/src/vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyPromptContribution.js +55 -0
  419. package/vscode/src/vs/workbench/contrib/chat/browser/hasByokModelsContribution.js +4 -3
  420. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  421. package/vscode/src/vs/workbench/contrib/chat/browser/media/chatPetAchievements.css +236 -0
  422. package/vscode/src/vs/workbench/contrib/chat/browser/planAgentDefaultModel.js +1 -1
  423. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.d.ts +9 -0
  424. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorOverlay.js +260 -0
  425. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.d.ts +39 -5
  426. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.js +155 -56
  427. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +10 -14
  428. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +29 -14
  429. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.d.ts +2 -0
  430. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +76 -24
  431. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +1 -1
  432. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +53 -32
  433. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.d.ts +1 -1
  434. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +17 -17
  435. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +8 -7
  436. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.d.ts +1 -1
  437. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +29 -71
  438. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.d.ts +3 -0
  439. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +36 -40
  440. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.d.ts +3 -0
  441. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +5 -5
  442. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  443. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +2 -2
  444. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  445. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  446. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +9 -16
  447. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  448. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +5 -13
  449. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/media/promptTimeline.css +820 -0
  450. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.d.ts +38 -0
  451. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptBucketing.js +100 -0
  452. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.d.ts +1 -0
  453. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimeline.contribution.js +51 -0
  454. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.d.ts +30 -0
  455. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineCard.js +113 -0
  456. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.d.ts +146 -0
  457. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineGutterRail.js +440 -0
  458. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineLayout.d.ts +16 -0
  459. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineLayout.js +5 -0
  460. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.d.ts +194 -0
  461. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineModel.js +525 -0
  462. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRail.d.ts +33 -0
  463. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.d.ts +128 -0
  464. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineRulerRail.js +460 -0
  465. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.d.ts +38 -0
  466. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineStickyHeader.js +120 -0
  467. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.d.ts +53 -0
  468. package/vscode/src/vs/workbench/contrib/chat/browser/promptTimeline/promptTimelineWidgetContrib.js +160 -0
  469. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +25 -22
  470. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.d.ts +13 -0
  471. package/vscode/src/vs/workbench/contrib/chat/browser/sessionChatPillOptions.js +52 -0
  472. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.d.ts +22 -0
  473. package/vscode/src/vs/workbench/contrib/chat/browser/sessionPullRequestPill.js +58 -0
  474. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.d.ts +63 -0
  475. package/vscode/src/vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.js +361 -0
  476. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.d.ts +35 -0
  477. package/vscode/src/vs/workbench/contrib/chat/browser/telemetry/chatEditorTopologyTelemetry.js +90 -0
  478. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +25 -18
  479. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.d.ts +3 -1
  480. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +77 -41
  481. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +60 -43
  482. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.d.ts +4 -1
  483. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +60 -16
  484. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +10 -8
  485. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +13 -4
  486. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.d.ts +3 -1
  487. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +44 -24
  488. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +4 -4
  489. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  490. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +52 -6
  491. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +446 -79
  492. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.d.ts +11 -0
  493. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceInputUtils.js +13 -0
  494. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.d.ts +66 -0
  495. package/vscode/src/vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.js +297 -0
  496. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.d.ts +137 -0
  497. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/chatSubagentOpenChat.js +714 -0
  498. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/media/chatSubagentOpenChat.css +379 -0
  499. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.d.ts +10 -0
  500. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatFind/chatFindAccessibilityHelp.js +78 -0
  501. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.d.ts +36 -0
  502. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.js +172 -0
  503. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.d.ts +5 -1
  504. package/vscode/src/vs/workbench/contrib/chat/browser/widget/chatWidgetService.js +8 -1
  505. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.d.ts +15 -0
  506. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.js +30 -0
  507. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.d.ts +11 -1
  508. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +41 -13
  509. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +5 -2
  510. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +133 -3
  511. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.d.ts +3 -2
  512. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletionsBase.js +11 -2
  513. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatEditorInputContentProvider.js +4 -4
  514. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.d.ts +1 -0
  515. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCommandArgumentHint.js +96 -0
  516. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.d.ts +12 -0
  517. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletionUtils.js +36 -1
  518. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +67 -17
  519. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +23 -37
  520. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.d.ts +18 -0
  521. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +72 -3
  522. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputPlaceholderDecoration.d.ts +11 -0
  523. package/vscode/src/vs/workbench/contrib/{agentsVoice/common/agentsVoiceColors.js → chat/browser/widget/input/editor/chatInputPlaceholderDecoration.js} +17 -15
  524. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.d.ts +3 -0
  525. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputReferenceDecorations.js +16 -0
  526. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +2 -2
  527. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +6 -4
  528. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +21 -13
  529. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +48 -8
  530. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +457 -142
  531. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.d.ts +1 -1
  532. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +22 -14
  533. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +6 -22
  534. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.d.ts +22 -0
  535. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationBlueprint.js +163 -0
  536. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +27 -5
  537. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +79 -32
  538. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.d.ts +6 -0
  539. package/vscode/src/vs/workbench/contrib/chat/common/chatNotification.js +12 -0
  540. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +44 -11
  541. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +404 -51
  542. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +64 -4
  543. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +33 -2
  544. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.d.ts +68 -0
  545. package/vscode/src/vs/workbench/contrib/chat/common/chatSideChatService.js +70 -0
  546. package/vscode/src/vs/workbench/contrib/chat/common/model/chatModelStore.d.ts +5 -2
  547. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +18 -5
  548. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +43 -14
  549. package/vscode/src/vs/workbench/contrib/chat/common/participants/chatSlashCommands.d.ts +4 -0
  550. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +4 -9
  551. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +164 -71
  552. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.d.ts +1 -1
  553. package/vscode/src/vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.js +1 -1
  554. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +18 -18
  555. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +12 -12
  556. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  557. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  558. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.d.ts +3 -1
  559. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptLinkProvider.js +19 -10
  560. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +3 -1
  561. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +172 -159
  562. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.d.ts +115 -0
  563. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.js +69 -0
  564. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.d.ts +60 -0
  565. package/vscode/src/vs/workbench/contrib/chat/common/sessionChatPills.js +139 -0
  566. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  567. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +5 -0
  568. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +21 -1
  569. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.d.ts +25 -2
  570. package/vscode/src/vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.js +55 -18
  571. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +10 -10
  572. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  573. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +1 -1
  574. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChat.contribution.js +1 -0
  575. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  576. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  577. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.d.ts +59 -0
  578. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatEditReviewSession.js +323 -0
  579. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.d.ts +30 -0
  580. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.js +79 -0
  581. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.d.ts +6 -2
  582. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +118 -13
  583. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  584. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  585. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  586. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  587. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  588. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +8 -8
  589. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminal.chat.contribution.js +1 -0
  590. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.d.ts +81 -0
  591. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChat.js +85 -0
  592. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +17 -17
  593. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibleView.js +1 -1
  594. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +23 -23
  595. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatEnabler.js +1 -1
  596. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.d.ts +17 -3
  597. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService.js +81 -7
  598. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.d.ts +30 -0
  599. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.js +86 -0
  600. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.d.ts +10 -2
  601. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +97 -18
  602. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +2 -22
  603. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +10 -8
  604. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.js +2 -1
  605. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.d.ts +2 -0
  606. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +42 -36
  607. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.d.ts +8 -0
  608. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalToolTelemetry.js +10 -0
  609. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -4
  610. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +2 -1
  611. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  612. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +25 -16
  613. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +4 -3
  614. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.d.ts +70 -0
  615. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/consoleCompactor/consoleCompactor.js +4316 -0
  616. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  617. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +3 -3
  618. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  619. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  620. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.d.ts +4 -4
  621. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  622. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +4 -4
  623. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +6 -1
  624. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +188 -148
  625. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  626. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  627. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  628. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  629. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  630. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.d.ts +7 -0
  631. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/treeSitterCommandParser.js +82 -3
  632. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +5 -6
  633. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +5 -42
  634. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalOutput.d.ts +2 -0
  635. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalOutput.js +8 -0
  636. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +1 -0
  637. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +27 -8
  638. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.d.ts +205 -0
  639. package/vscode/src/vs/workbench/services/accounts/browser/defaultAccount.js +1580 -0
  640. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.d.ts +30 -0
  641. package/vscode/src/vs/workbench/services/agentEditorComments/browser/agentEditorCommentsOverlayWidget.js +175 -0
  642. package/vscode/src/vs/workbench/services/agentEditorComments/browser/media/agentEditorCommentsOverlayWidget.css +65 -0
  643. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.d.ts +47 -0
  644. package/vscode/src/vs/workbench/services/agentHost/browser/agentSdkSetupService.js +129 -0
  645. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +26 -8
  646. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +89 -27
  647. package/vscode/src/vs/workbench/services/agentHost/browser/webAgentHostEnablementService.d.ts +8 -0
  648. package/vscode/src/vs/workbench/services/agentHost/browser/webAgentHostEnablementService.js +28 -0
  649. package/vscode/src/vs/workbench/services/agentHost/common/agentHostFileSystemService.js +5 -1
  650. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.d.ts +18 -18
  651. package/vscode/src/vs/workbench/services/agentHost/common/agentHostResourceService.js +159 -60
  652. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.d.ts +47 -0
  653. package/vscode/src/vs/workbench/services/agentHost/common/editorRemoteAgentHostTransport.js +362 -0
  654. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.d.ts +0 -1
  655. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.js +0 -40
  656. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +0 -1110
  657. package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +0 -76
  658. package/vscode/src/vs/platform/agentHost/common/agentHostResourceService.d.ts +0 -63
  659. package/vscode/src/vs/platform/agentHost/common/agentHostResourceService.js +0 -25
  660. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +0 -254
  661. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +0 -451
  662. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +0 -1294
  663. package/vscode/src/vs/platform/agentHost/common/agentService.js +0 -92
  664. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/errors.d.ts +0 -186
  665. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/errors.js +0 -10
  666. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.d.ts +0 -42
  667. package/vscode/src/vs/platform/agentHost/common/state/sessionTransport.js +0 -7
  668. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.d.ts +0 -15
  669. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.js +0 -15
  670. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.d.ts +0 -2
  671. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +0 -19
  672. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +0 -243
  673. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.d.ts +0 -24
  674. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +0 -77
  675. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.d.ts +0 -92
  676. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +0 -224
  677. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.d.ts +0 -23
  678. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.js +0 -52
  679. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.d.ts +0 -16
  680. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +0 -96
  681. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.d.ts +0 -27
  682. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.js +0 -152
  683. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.d.ts +0 -87
  684. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.js +0 -772
  685. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.d.ts +0 -30
  686. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.js +0 -29
  687. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.d.ts +0 -20
  688. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +0 -40
  689. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/media/planReviewFeedback.css +0 -160
  690. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.d.ts +0 -9
  691. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +0 -123
  692. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.d.ts +0 -37
  693. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +0 -572
  694. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.d.ts +0 -125
  695. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.js +0 -399
  696. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.d.ts +0 -321
  697. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.js +0 -2117
  698. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.d.ts +0 -57
  699. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.js +0 -367
  700. package/vscode/src/vs/workbench/contrib/chat/common/automations/automation.d.ts +0 -78
  701. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.d.ts +0 -13
  702. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.d.ts +0 -11
  703. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.js +0 -6
  704. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.d.ts +0 -16
  705. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.js +0 -6
  706. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.d.ts +0 -46
  707. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.d.ts +0 -36
  708. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.js +0 -6
  709. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.d.ts +0 -12
  710. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.js +0 -6
  711. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +0 -9
  712. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +0 -6
  713. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +0 -15
  714. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +0 -177
  715. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.d.ts +0 -67
  716. package/vscode/src/vs/workbench/contrib/chat/common/plugins/fileBackedInstalledPluginsStore.js +0 -195
  717. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +0 -65
  718. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +0 -264
  719. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +0 -190
  720. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +0 -865
  721. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +0 -31
  722. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +0 -122
  723. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers/commandFileWriteParser.d.ts +0 -24
  724. /package/vscode/src/vs/{workbench/contrib/terminalContrib/chatAgentTools/browser/commandParsers → platform/terminal/common/autoApprove}/sedFileWriteParser.js +0 -0
  725. /package/vscode/src/vs/{platform/agentHost/common/agentHost.config.contribution.d.ts → workbench/contrib/chat/browser/agentSessionsConfiguration.d.ts} +0 -0
@@ -1,2117 +0,0 @@
1
-
2
- import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
- import { Disposable, DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
4
- import '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/index';
5
- import { disposableWindowInterval } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
6
- import { disposableTimeout } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
7
- import { CancellationTokenSource } from '@codingame/monaco-vscode-api/vscode/vs/base/common/cancellation';
8
- import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
9
- import { generateUuid } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uuid';
10
- import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
11
- import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands';
12
- import { ICommandService } from '@codingame/monaco-vscode-api/vscode/vs/platform/commands/common/commands.service';
13
- import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
14
- import { IAuthenticationService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/authentication/common/authentication.service';
15
- import { IVoiceTranscriptStore } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.service';
16
- import { IVoiceClientService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/voiceClient/voiceClientService.service';
17
- import { IMicCaptureService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.service';
18
- import { ITtsPlaybackService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.service';
19
- import { VoiceToolDispatchService } from './voiceToolDispatchService.js';
20
- import { IVoiceToolDispatchService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.service';
21
- import { IVoicePlaybackService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/voicePlaybackService.service';
22
- import { IAgentSessionsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service';
23
- import '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel';
24
- import { IChatToolInvocation, ToolConfirmKind } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService';
25
- import { IChatService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatService/chatService.service';
26
- import { ChatAgentLocation } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/constants';
27
- import { IWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/common/environmentService.service';
28
- import { ITelemetryService } from '@codingame/monaco-vscode-api/vscode/vs/platform/telemetry/common/telemetry.service';
29
- import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
30
- import { AccessibilitySignal } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService';
31
- import { IAccessibilitySignalService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibilitySignal/browser/accessibilitySignalService.service';
32
- import { IAccessibilityService } from '@codingame/monaco-vscode-api/vscode/vs/platform/accessibility/common/accessibility.service';
33
- import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
34
- import { observableValue } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableValue';
35
- import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
36
- import { transaction } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/transaction';
37
- import { ChatSessionStatus } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatSessionsService';
38
- import { observableSignalFromEvent } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/observables/observableSignalFromEvent';
39
-
40
- var VoiceSessionController_1;
41
- let VoiceSessionController = class VoiceSessionController extends Disposable {
42
- static {
43
- VoiceSessionController_1 = this;
44
- }
45
- static {
46
- this._MAX_TURNS = 2;
47
- }
48
- static {
49
- this._PTT_MAX_DURATION_MS = 5 * 60 * 1000;
50
- }
51
- static {
52
- this._PTT_TOGGLE_THRESHOLD_MS = 300;
53
- }
54
- static {
55
- this._AUTO_LISTEN_QUIET_MS = 1200;
56
- }
57
- static {
58
- this._USER_CANCEL_SUPPRESS_MS = 10_000;
59
- }
60
- static {
61
- this._CONFIRMATION_FLUSH_DELAY_MS = 1500;
62
- }
63
- static {
64
- this.PRIOR_TIMELINE_ENTRY_LIMIT = 30;
65
- }
66
- static {
67
- this.CODING_AGENT_REPLY_SENTENCE_LIMIT = 2;
68
- }
69
- constructor(
70
- voiceClientService,
71
- micCaptureService,
72
- ttsPlaybackService,
73
- voiceToolDispatchService,
74
- voicePlaybackService,
75
- agentSessionsService,
76
- chatService,
77
- commandService,
78
- authenticationService,
79
- voiceTranscriptStore,
80
- logService,
81
- environmentService,
82
- telemetryService,
83
- configurationService,
84
- accessibilitySignalService,
85
- accessibilityService
86
- ) {
87
- super();
88
- this.voiceClientService = voiceClientService;
89
- this.micCaptureService = micCaptureService;
90
- this.ttsPlaybackService = ttsPlaybackService;
91
- this.voiceToolDispatchService = voiceToolDispatchService;
92
- this.voicePlaybackService = voicePlaybackService;
93
- this.agentSessionsService = agentSessionsService;
94
- this.chatService = chatService;
95
- this.commandService = commandService;
96
- this.authenticationService = authenticationService;
97
- this.voiceTranscriptStore = voiceTranscriptStore;
98
- this.logService = logService;
99
- this.environmentService = environmentService;
100
- this.telemetryService = telemetryService;
101
- this.configurationService = configurationService;
102
- this.accessibilitySignalService = accessibilitySignalService;
103
- this.accessibilityService = accessibilityService;
104
- this._voiceState = observableValue(this, "idle");
105
- this.voiceState = this._voiceState;
106
- this._statusText = observableValue(this, "Tap to start");
107
- this.statusText = this._statusText;
108
- this._transcriptTurns = observableValue(this, []);
109
- this.transcriptTurns = this._transcriptTurns;
110
- this._isConnected = observableValue(this, false);
111
- this.isConnected = this._isConnected;
112
- this._isConnecting = observableValue(this, false);
113
- this.isConnecting = this._isConnecting;
114
- this._isReconnecting = observableValue(this, false);
115
- this.isReconnecting = this._isReconnecting;
116
- this._pendingToolConfirmations = observableValue(this, []);
117
- this.pendingToolConfirmations = this._pendingToolConfirmations;
118
- this._targetSession = observableValue(this, undefined);
119
- this.targetSession = this._targetSession;
120
- this._pttHeld = false;
121
- this._pttToggleMode = false;
122
- this._pttCurrentTurnId = "";
123
- this._voiceEventDisposables = this._register(( new DisposableStore()));
124
- this._voiceAutorunDisposable = this._register(( new MutableDisposable()));
125
- this._autoApprovedSessions = ( new Set());
126
- this._pttWaitingForPlayback = false;
127
- this._replyPlayedSinceSend = false;
128
- this._awaitingReplyAudio = false;
129
- this._autoListenAfterGreeting = false;
130
- this._hasPlayedInitialListenCue = false;
131
- this._audioQueue = [];
132
- this._currentPlaybackSessionId = null;
133
- this._isProcessingQueue = false;
134
- this._suppressIncomingAudio = false;
135
- this._sessionAudioCache = ( new Map());
136
- this._prevSessionStates = ( new Map());
137
- this._userCancelledSessions = ( new Map());
138
- this._confirmationFlushWatchdogs = ( new Map());
139
- this._eagerModelRefs = ( new Map());
140
- this._eagerModelLoading = ( new Set());
141
- this._pendingIdleNarration = ( new Set());
142
- this._telemetrySessionIndex = 0;
143
- this._telemetryTurnCount = 0;
144
- this._telemetryReconnectCount = 0;
145
- this._telemetryFirstConnect = true;
146
- this._telemetryTtsInterrupted = false;
147
- this._pendingPriorTimeline = [];
148
- this.voiceToolDispatchService.setDelegate({
149
- acceptInput: text => {
150
- this.commandService.executeCommand("_chat.voice.acceptInput", text).catch(err => {
151
- this.logService.warn("[voice] acceptInput delegate failed:", err);
152
- });
153
- return true;
154
- },
155
- getCurrentSessionResource: async () => {
156
- const resourceStr = await this.commandService.executeCommand("_chat.voice.getCurrentSession").catch(() => undefined);
157
- return resourceStr ? ( URI.parse(resourceStr)) : undefined;
158
- },
159
- switchToSession: resource => {
160
- this.commandService.executeCommand("_chat.voice.switchToSession", ( resource.toString()));
161
- },
162
- getAutoApprovedSessions: () => {
163
- return this._autoApprovedSessions;
164
- },
165
- addAllAutoApprovedSessions: () => {
166
- const sessions = this.agentSessionsService.model.sessions.filter(s => !s.isArchived());
167
- for (const s of sessions) {
168
- this._autoApprovedSessions.add(( s.resource.toString()));
169
- const model = this.chatService.getSession(s.resource);
170
- if (model) {
171
- for (const req of model.getRequests()) {
172
- const pending = req.response?.isPendingConfirmation.get();
173
- if (pending && req.response) {
174
- for (const part of req.response.response.value) {
175
- if (part.kind === "toolInvocation") {
176
- IChatToolInvocation.confirmWith(part, {
177
- type: ToolConfirmKind.UserAction
178
- });
179
- }
180
- }
181
- }
182
- }
183
- }
184
- }
185
- },
186
- removeAutoApprovedSession: resource => {
187
- this._autoApprovedSessions.delete(resource);
188
- },
189
- triggerAutoApproveCheck: () => {
190
- this._autoApproveCheck();
191
- }
192
- });
193
- this._register(autorun(reader => {
194
- const agentSessions = this.agentSessionsService.model.sessions.filter(s => !s.isArchived());
195
- const toolConfirmations = [];
196
- const processedResources = ( new Set());
197
- const modelsToCheck = [];
198
- for (const s of agentSessions) {
199
- processedResources.add(( s.resource.toString()));
200
- const model = this.chatService.getSession(s.resource);
201
- if (model) {
202
- modelsToCheck.push({
203
- model,
204
- resource: s.resource,
205
- label: s.label || "Untitled session"
206
- });
207
- }
208
- }
209
- for (const chatModel of this.chatService.chatModels.read(reader)) {
210
- const key = ( chatModel.sessionResource.toString());
211
- if (( processedResources.has(key))) {
212
- continue;
213
- }
214
- if (chatModel.getRequests().length === 0) {
215
- continue;
216
- }
217
- processedResources.add(key);
218
- modelsToCheck.push({
219
- model: chatModel,
220
- resource: chatModel.sessionResource,
221
- label: chatModel.title || "Chat"
222
- });
223
- }
224
- for (const {
225
- model,
226
- resource,
227
- label
228
- } of modelsToCheck) {
229
- const lastReq = model.lastRequestObs.read(reader);
230
- if (lastReq?.response) {
231
- const pending = lastReq.response.isPendingConfirmation.read(reader);
232
- if (pending && !( this._autoApprovedSessions.has(( resource.toString())))) {
233
- const confirmType = this._classifyPendingType(lastReq.response);
234
- const desc = this._getConfirmationDescription(lastReq.response);
235
- toolConfirmations.push({
236
- type: confirmType,
237
- sessionLabel: label,
238
- sessionResource: resource,
239
- description: desc || pending.detail || (confirmType === "input" ? "Needs your input" : "Needs approval"),
240
- approve: () => {
241
- if (lastReq.response) {
242
- for (const part of lastReq.response.response.value) {
243
- if (part.kind === "toolInvocation") {
244
- IChatToolInvocation.confirmWith(part, {
245
- type: ToolConfirmKind.UserAction
246
- });
247
- }
248
- }
249
- }
250
- },
251
- deny: () => {
252
- if (lastReq.response) {
253
- for (const part of lastReq.response.response.value) {
254
- if (part.kind === "toolInvocation") {
255
- IChatToolInvocation.confirmWith(part, {
256
- type: ToolConfirmKind.Denied
257
- });
258
- }
259
- }
260
- }
261
- }
262
- });
263
- }
264
- if (!pending && !( this._autoApprovedSessions.has(( resource.toString())))) {
265
- for (const part of lastReq.response.response.value) {
266
- if (part.kind === "toolInvocation") {
267
- const toolState = part.state.read(reader);
268
- if (toolState.type === IChatToolInvocation.StateKind.WaitingForConfirmation) {
269
- const params = toolState.parameters;
270
- const questions = params?.["questions"];
271
- let desc = "";
272
- if (Array.isArray(questions) && questions.length > 0) {
273
- desc = ( questions.map(q => {
274
- const title = q["header"] || q["question"];
275
- if (!title) {
276
- return "";
277
- }
278
- const options = q["options"];
279
- if (Array.isArray(options) && options.length > 0) {
280
- const labels = ( options.map(o => o["label"])).filter(Boolean);
281
- if (labels.length > 0) {
282
- return `${title}: ${labels.join(", ")}`;
283
- }
284
- }
285
- return title;
286
- })).filter(Boolean).join("; ");
287
- }
288
- toolConfirmations.push({
289
- type: "input",
290
- sessionLabel: label,
291
- sessionResource: resource,
292
- description: desc || "Needs your input",
293
- approve: () => {
294
- IChatToolInvocation.confirmWith(part, {
295
- type: ToolConfirmKind.UserAction
296
- });
297
- },
298
- deny: () => {
299
- IChatToolInvocation.confirmWith(part, {
300
- type: ToolConfirmKind.Denied
301
- });
302
- }
303
- });
304
- break;
305
- }
306
- }
307
- }
308
- }
309
- }
310
- }
311
- this._pendingToolConfirmations.set(toolConfirmations, undefined);
312
- }));
313
- this._register(
314
- CommandsRegistry.registerCommand("_chat.voicePlayback.replay", (_accessor, payload) => {
315
- const sessionId = payload?.sessionId;
316
- if (!sessionId) {
317
- return;
318
- }
319
- this._replaySessionAudio(sessionId);
320
- })
321
- );
322
- this._register(
323
- CommandsRegistry.registerCommand("_chat.voicePlayback.stop", (_accessor, payload) => {
324
- this._stopReplay();
325
- if (payload?.sessionId) {
326
- this.voicePlaybackService.notifyPlaybackEnd(( URI.parse(payload.sessionId)));
327
- }
328
- })
329
- );
330
- this._register({
331
- dispose: () => this.disconnect()
332
- });
333
- }
334
- async connect(window) {
335
- if (this._isConnecting.get() || this._isConnected.get()) {
336
- return;
337
- }
338
- this._window = window;
339
- this._isConnecting.set(true, undefined);
340
- this._statusText.set("Connecting...", undefined);
341
- this._voiceState.set("idle", undefined);
342
- this._telemetryConnectStartMs = Date.now();
343
- let authToken;
344
- try {
345
- const sessions = await this.authenticationService.getSessions("github");
346
- this._userLogin = sessions[0]?.account.label;
347
- authToken = sessions[0]?.accessToken;
348
- if (!this._userLogin) {
349
- this.logService.warn("[voice] no GitHub session found; transcripts will not be persisted");
350
- } else {
351
- const lastTurn = (await this.voiceTranscriptStore.loadTurns(this._userLogin, {
352
- limit: 1
353
- }))[0];
354
- this._lastPersistedTurnId = lastTurn?.turnId;
355
- try {
356
- const recent = await this.voiceTranscriptStore.loadTurns(this._userLogin, {
357
- limit: VoiceSessionController_1.PRIOR_TIMELINE_ENTRY_LIMIT
358
- });
359
- this._pendingPriorTimeline = this._buildPriorTimeline(recent);
360
- } catch (err) {
361
- this.logService.warn("[voice] failed to load prior timeline entries for context", err);
362
- this._pendingPriorTimeline = [];
363
- }
364
- }
365
- } catch (err) {
366
- this.logService.warn("[voice] failed to resolve GitHub session", err);
367
- }
368
- this._voiceEventDisposables.clear();
369
- this._voiceEventDisposables.add(this.micCaptureService.onPttStart(() => {
370
- this.voiceClientService.sendPttStart(this._pttCurrentTurnId);
371
- }));
372
- this._voiceEventDisposables.add(this.micCaptureService.onPttAudioChunk(b64 => {
373
- this.voiceClientService.sendPttAudioChunk(b64);
374
- }));
375
- this._voiceEventDisposables.add(this.micCaptureService.onPttEnd(() => {
376
- this.voiceClientService.sendPttEnd();
377
- }));
378
- this._voiceEventDisposables.add(this.micCaptureService.onPttDiagnostic(diag => {
379
- this.logService.info(
380
- `[voice] ptt.diagnostic turn_id=${diag.turnId} ` + `msHeld=${diag.msHeld} chunksSent=${diag.chunksSent} samplesSent=${diag.samplesSent} ` + `drainFired=${diag.drainFired} drainChunks=${diag.drainChunks} drainSamples=${diag.drainSamples} drainWindowMs=${diag.drainWindowMs} ` + `drainSkippedByMute=${diag.drainSkippedByMute} drainSkippedBySuppression=${diag.drainSkippedBySuppression} ` + `postReleaseCallbacks=${diag.postReleaseCallbacks} postReleaseSamples=${diag.postReleaseSamples} ` + `postReleaseSkippedByMute=${diag.postReleaseSkippedByMute} postReleaseSkippedBySuppression=${diag.postReleaseSkippedBySuppression} ` + `postReleaseWindowMs=${diag.postReleaseWindowMs} ` + `releasedDuringAcquire=${diag.releasedDuringAcquire} pttUpWithoutCapture=${diag.pttUpWithoutCapture}`
381
- );
382
- this.voiceClientService.sendPttDiagnostic(diag.turnId, {
383
- ms_held: diag.msHeld,
384
- chunks_sent: diag.chunksSent,
385
- samples_sent: diag.samplesSent,
386
- drain_fired: diag.drainFired,
387
- drain_chunks: diag.drainChunks,
388
- drain_samples: diag.drainSamples,
389
- drain_window_ms: diag.drainWindowMs,
390
- drain_skipped_by_mute: diag.drainSkippedByMute,
391
- drain_skipped_by_suppression: diag.drainSkippedBySuppression,
392
- post_release_callbacks: diag.postReleaseCallbacks,
393
- post_release_samples: diag.postReleaseSamples,
394
- post_release_skipped_by_mute: diag.postReleaseSkippedByMute,
395
- post_release_skipped_by_suppression: diag.postReleaseSkippedBySuppression,
396
- post_release_window_ms: diag.postReleaseWindowMs,
397
- released_during_acquire: diag.releasedDuringAcquire,
398
- ptt_up_without_capture: diag.pttUpWithoutCapture
399
- });
400
- }));
401
- this._voiceEventDisposables.add(this.ttsPlaybackService.onPlaybackStopped(() => {
402
- const listenedToEnd = !this._telemetryTtsInterrupted;
403
- this.telemetryService.publicLog2("voiceTtsListenThrough", {
404
- listenedToEnd,
405
- listenedPct: listenedToEnd ? 100 : 50
406
- });
407
- this._telemetryTtsInterrupted = false;
408
- const finishedSessionId = this._currentPlaybackSessionId;
409
- const samples = this.ttsPlaybackService.getLastPlayedSamples();
410
- if (samples && finishedSessionId !== null) {
411
- const cacheKey = finishedSessionId ?? "__generic__";
412
- this._sessionAudioCache.set(cacheKey, samples);
413
- }
414
- this.voicePlaybackService.notifyPlaybackEnd(undefined);
415
- this._currentPlaybackSessionId = null;
416
- if (this._audioQueue.length > 0) {
417
- setTimeout(() => this._processQueue(), 500);
418
- } else {
419
- if (this._pttHeld) {
420
- this._voiceState.set("listening", undefined);
421
- this._statusText.set("Listening...", undefined);
422
- } else {
423
- this._voiceState.set("idle", undefined);
424
- this._statusText.set("Hold to speak...", undefined);
425
- if (this._pttWaitingForPlayback) {
426
- this._scheduleDelayedMicStop();
427
- }
428
- if (this._isAutoSendEnabled() && !this._awaitingReplyAudio) {
429
- if (this._autoListenAfterGreeting) {
430
- this._autoListenAfterGreeting = false;
431
- this._enterAutoListen();
432
- } else if (this._replyPlayedSinceSend) {
433
- this._scheduleAutoListen();
434
- }
435
- }
436
- }
437
- }
438
- }));
439
- this._voiceEventDisposables.add(this.voiceClientService.onDidChangeConnectionState(async connected => {
440
- if (connected) {
441
- const pbCtx = this.ttsPlaybackService.ensureContext(window);
442
- pbCtx.resume();
443
- const isResuming = this.voiceClientService.isResuming;
444
- const now = Date.now();
445
- const connectMs = this._telemetryConnectStartMs ? now - this._telemetryConnectStartMs : 0;
446
- if (this._telemetryFirstConnect) {
447
- this._telemetryFirstConnect = false;
448
- this.telemetryService.publicLog2("voiceFirstConnect", {
449
- timeToConnectMs: connectMs
450
- });
451
- }
452
- if (isResuming) {
453
- this._telemetryReconnectCount++;
454
- const secSinceLast = this._telemetryLastConnectMs ? Math.round((now - this._telemetryLastConnectMs) / 1000) : 0;
455
- this.telemetryService.publicLog2("voiceReconnect", {
456
- timeSinceLastConnectSec: secSinceLast
457
- });
458
- } else {
459
- this._telemetrySessionIndex++;
460
- this._telemetrySessionStart = now;
461
- this._telemetryTurnCount = 0;
462
- this._telemetryReconnectCount = 0;
463
- this.telemetryService.publicLog2("voiceSessionStarted", {
464
- sessionIndex: this._telemetrySessionIndex
465
- });
466
- }
467
- this._telemetryLastConnectMs = now;
468
- if (isResuming) {
469
- this.voiceClientService.sendResumeSession(this._buildSessionContext(), this._getMachineId());
470
- } else {
471
- const priorTimeline = this._pendingPriorTimeline;
472
- this._pendingPriorTimeline = [];
473
- this.voiceClientService.sendStartSession(this._buildSessionContext(), this._getMachineId(), priorTimeline);
474
- }
475
- if (isResuming) {
476
- this.micCaptureService.stopCapture();
477
- }
478
- this.micCaptureService.prepare(window);
479
- transaction(tx => {
480
- this._isConnecting.set(false, tx);
481
- this._isReconnecting.set(false, tx);
482
- this._isConnected.set(true, tx);
483
- });
484
- const seededResources = ( new Set());
485
- for (const s of this.agentSessionsService.model.sessions.filter(ss => !ss.isArchived())) {
486
- seededResources.add(( s.resource.toString()));
487
- const model = this.chatService.getSession(s.resource);
488
- const info = model ? this._getAgentStateInfo(model) : undefined;
489
- const currentState = info?.state ?? (s.status === ChatSessionStatus.InProgress ? "thinking" : s.status === ChatSessionStatus.NeedsInput ? "waiting_for_confirmation" : s.status === ChatSessionStatus.Completed ? "idle" : "unknown");
490
- if (currentState !== "unknown") {
491
- this._prevSessionStates.set(( s.resource.toString()), {
492
- state: currentState,
493
- detail: info?.detail ?? ""
494
- });
495
- }
496
- }
497
- for (const chatModel of this.chatService.chatModels.get()) {
498
- const key = ( chatModel.sessionResource.toString());
499
- if (( seededResources.has(key))) {
500
- continue;
501
- }
502
- if (chatModel.getRequests().length === 0) {
503
- continue;
504
- }
505
- const info = this._getAgentStateInfo(chatModel);
506
- if (info.state !== "unknown") {
507
- this._prevSessionStates.set(key, {
508
- state: info.state,
509
- detail: info.detail ?? ""
510
- });
511
- }
512
- }
513
- const sessionChangeListener = this.agentSessionsService.model.onDidChangeSessions(() => {
514
- this._checkSessionStateChanges();
515
- this._sendContext();
516
- });
517
- const autorunDisposable = autorun(reader => {
518
- const agentSessions = this.agentSessionsService.model.sessions.filter(s => !s.isArchived());
519
- let needsRecheck = false;
520
- const stateChanges = [];
521
- const waitingForConfirmationSessions = [];
522
- const processedResources = ( new Set());
523
- const processModel = (model, resource, label) => {
524
- const sessionId = ( resource.toString());
525
- this._pendingIdleNarration.delete(sessionId);
526
- const lastReq = model.lastRequestObs.read(reader);
527
- if (lastReq?.response) {
528
- lastReq.response.isIncomplete.read(reader);
529
- const pending = lastReq.response.isPendingConfirmation.read(reader);
530
- if (pending && ( this._autoApprovedSessions.has(sessionId))) {
531
- for (const part of lastReq.response.response.value) {
532
- if (part.kind === "toolInvocation") {
533
- if (IChatToolInvocation.confirmWith(part, {
534
- type: ToolConfirmKind.UserAction
535
- })) {
536
- needsRecheck = true;
537
- }
538
- }
539
- }
540
- }
541
- const responseSignal = observableSignalFromEvent(lastReq.response, lastReq.response.onDidChange);
542
- responseSignal.read(reader);
543
- }
544
- const info = this._getAgentStateInfo(model);
545
- const currentState = info.state;
546
- const detail = info.detail;
547
- const lastResponseSummary = info.last_response_summary;
548
- const prev = this._prevSessionStates.get(sessionId);
549
- const isStateTransition = prev !== undefined && prev.state !== currentState && currentState !== "unknown";
550
- const isDetailTransition = !isStateTransition && prev !== undefined && currentState === "waiting_for_confirmation" && (detail ?? "") !== prev.detail;
551
- const isTransition = isStateTransition || isDetailTransition;
552
- if (isTransition) {
553
- this.logService.info(
554
- `[voice] autorun transition id=${sessionId.slice(-32)} ${prev?.state}→${currentState} detailChanged=${isDetailTransition} hasDetail=${!!detail}`
555
- );
556
- const cancelExpiry = this._userCancelledSessions.get(sessionId);
557
- if (cancelExpiry) {
558
- this.logService.info(
559
- `[voice] autorun swallowing transition (user-cancelled) id=${sessionId.slice(-32)}`
560
- );
561
- clearTimeout(cancelExpiry);
562
- this._userCancelledSessions.delete(sessionId);
563
- } else {
564
- stateChanges.push({
565
- sessionId,
566
- currentState,
567
- label,
568
- detail,
569
- lastResponseSummary,
570
- detailOnly: isDetailTransition
571
- });
572
- }
573
- }
574
- if (currentState !== "unknown") {
575
- this._prevSessionStates.set(sessionId, {
576
- state: currentState,
577
- detail: detail ?? ""
578
- });
579
- }
580
- if (currentState === "waiting_for_confirmation") {
581
- waitingForConfirmationSessions.push({
582
- sessionId,
583
- label,
584
- detail,
585
- transition: isTransition
586
- });
587
- }
588
- };
589
- for (const s of agentSessions) {
590
- processedResources.add(( s.resource.toString()));
591
- const model = this.chatService.getSession(s.resource);
592
- if (model) {
593
- processModel(model, s.resource, s.label || "Untitled session");
594
- } else {
595
- const sessionId = ( s.resource.toString());
596
- const currentState = s.status === ChatSessionStatus.InProgress ? "thinking" : s.status === ChatSessionStatus.NeedsInput ? "waiting_for_confirmation" : s.status === ChatSessionStatus.Completed ? "idle" : "unknown";
597
- if (s.status === ChatSessionStatus.NeedsInput) {
598
- this._ensureModelLoaded(s.resource);
599
- }
600
- const prev = this._prevSessionStates.get(sessionId);
601
- const isStateTransition = prev !== undefined && prev.state !== currentState && currentState !== "unknown";
602
- if (isStateTransition && currentState === "idle") {
603
- this._deferIdleNarrationUntilModelLoaded(s.resource);
604
- continue;
605
- }
606
- if (isStateTransition) {
607
- const cancelExpiry = this._userCancelledSessions.get(sessionId);
608
- if (cancelExpiry) {
609
- clearTimeout(cancelExpiry);
610
- this._userCancelledSessions.delete(sessionId);
611
- } else {
612
- stateChanges.push({
613
- sessionId,
614
- currentState,
615
- label: s.label || "Untitled session"
616
- });
617
- }
618
- }
619
- if (currentState !== "unknown") {
620
- this._prevSessionStates.set(sessionId, {
621
- state: currentState,
622
- detail: ""
623
- });
624
- }
625
- if (currentState === "waiting_for_confirmation") {
626
- waitingForConfirmationSessions.push({
627
- sessionId,
628
- label: s.label || "Untitled session",
629
- detail: undefined,
630
- transition: isStateTransition
631
- });
632
- }
633
- }
634
- }
635
- for (const chatModel of this.chatService.chatModels.read(reader)) {
636
- const key = ( chatModel.sessionResource.toString());
637
- if (( processedResources.has(key))) {
638
- continue;
639
- }
640
- if (chatModel.getRequests().length === 0) {
641
- continue;
642
- }
643
- processedResources.add(key);
644
- processModel(chatModel, chatModel.sessionResource, chatModel.title || "Chat");
645
- }
646
- if (needsRecheck) {
647
- setTimeout(() => this._autoApproveCheck(), 500);
648
- }
649
- this._sendContext();
650
- if (stateChanges.length > 0) {
651
- for (const change of stateChanges) {
652
- if (change.detailOnly) {
653
- this.voiceClientService.invalidateSessionCache(change.sessionId);
654
- }
655
- }
656
- if (( stateChanges.some(c => c.detailOnly))) {
657
- this._sendContext();
658
- }
659
- this.logService.info(
660
- `[voice] autorun stateChanges=${stateChanges.length} flushing immediately: ${( stateChanges.map(c => `${c.label}:${c.currentState}${c.detailOnly ? " (detail-only)" : ""}`)).join(", ")}`
661
- );
662
- this.voiceClientService.flushSessionContext();
663
- }
664
- for (const change of stateChanges) {
665
- this._persistEntry("coding_event", `session "${change.label}" → ${change.currentState}`, {
666
- codingSessionId: change.sessionId,
667
- codingStatus: change.currentState,
668
- codingSessionLabel: change.label
669
- });
670
- }
671
- for (const w of waitingForConfirmationSessions) {
672
- this._armConfirmationFlushWatchdog(w.sessionId, w.label, w.transition);
673
- }
674
- const stillWaiting = ( new Set(( waitingForConfirmationSessions.map(w => w.sessionId))));
675
- for (const id of [...( this._confirmationFlushWatchdogs.keys())]) {
676
- if (!( stillWaiting.has(id))) {
677
- const t = this._confirmationFlushWatchdogs.get(id);
678
- if (t) {
679
- clearTimeout(t);
680
- }
681
- this._confirmationFlushWatchdogs.delete(id);
682
- }
683
- }
684
- for (const id of [...( this._eagerModelRefs.keys())]) {
685
- if (!( stillWaiting.has(id))) {
686
- this._eagerModelRefs.get(id).dispose();
687
- this._eagerModelRefs.delete(id);
688
- }
689
- }
690
- });
691
- const connectionDisposables = ( new DisposableStore());
692
- connectionDisposables.add(sessionChangeListener);
693
- connectionDisposables.add(autorunDisposable);
694
- connectionDisposables.add(
695
- disposableWindowInterval(this._window, () => this._checkSessionStateChanges(), 5000)
696
- );
697
- this._voiceAutorunDisposable.value = connectionDisposables;
698
- this.micCaptureService.isMuted = false;
699
- this._statusText.set("Hold to speak...", undefined);
700
- this._voiceState.set("idle", undefined);
701
- if (!isResuming && this._isAutoSendEnabled()) {
702
- this._autoListenAfterGreeting = true;
703
- }
704
- } else if (this._isConnected.get()) {
705
- this._onConnectionLost();
706
- } else if (this._isReconnecting.get()) {
707
- this._isReconnecting.set(false, undefined);
708
- this._voiceState.set("idle", undefined);
709
- this._statusText.set("Tap to start", undefined);
710
- } else if (this._isConnecting.get()) {
711
- this._isConnecting.set(false, undefined);
712
- this._voiceState.set("idle", undefined);
713
- this._statusText.set("Tap to start", undefined);
714
- } else {
715
- this._voiceState.set("idle", undefined);
716
- }
717
- }));
718
- this._voiceEventDisposables.add(this.voiceClientService.onSpeechStarted(() => {
719
- this._clearAutoSendSilenceTimer();
720
- this._clearAutoListenTimer();
721
- this.ttsPlaybackService.stopPlayback();
722
- this._audioQueue.length = 0;
723
- this._currentPlaybackSessionId = null;
724
- this._isProcessingQueue = false;
725
- this._suppressIncomingAudio = true;
726
- this._startUserTurn();
727
- }));
728
- this._voiceEventDisposables.add(this.voiceClientService.onTranscription(e => {
729
- if (!this._telemetryFirstTranscriptionMs && this._telemetryPttDownMs) {
730
- this._telemetryFirstTranscriptionMs = Date.now();
731
- }
732
- let text = e.text;
733
- if (this._pttToggleMode && this._pttHeld) {
734
- const strippedText = this._checkSendKeyword(text);
735
- if (strippedText !== undefined) {
736
- text = strippedText;
737
- this._updateUserTurn(text, e.committed ?? "", false);
738
- this._persistTurn("user", text);
739
- this._pttToggleMode = false;
740
- this._finishPtt();
741
- return;
742
- }
743
- }
744
- this._updateUserTurn(text, e.committed ?? "", e.status === "partial");
745
- if (e.status !== "partial") {
746
- if (!this._pttHeld) {
747
- this._voiceState.set("processing", undefined);
748
- this._statusText.set("Processing...", undefined);
749
- }
750
- this._persistTurn("user", text);
751
- }
752
- if (this._pttToggleMode && this._pttHeld) {
753
- this._scheduleAutoSendOnSilence();
754
- }
755
- }));
756
- this._voiceEventDisposables.add(this.voiceClientService.onAudioResponse(e => {
757
- if (e.isFirstChunk && this._telemetryPttUpMs) {
758
- const ttft = this._telemetryFirstTranscriptionMs && this._telemetryPttDownMs ? this._telemetryFirstTranscriptionMs - this._telemetryPttDownMs : 0;
759
- const e2e = Date.now() - this._telemetryPttUpMs;
760
- this.telemetryService.publicLog2("voiceLatency", {
761
- timeToFirstTranscriptionMs: ttft,
762
- endToEndTurnMs: e2e
763
- });
764
- this._telemetryPttUpMs = undefined;
765
- }
766
- this._enqueueAudio(e.codingSessionId, e.audio, e.isFirstChunk, e.isFinal, e.transcript);
767
- if (e.isFinal && e.transcript) {
768
- this._persistTurn("assistant", e.transcript);
769
- }
770
- }));
771
- this._voiceEventDisposables.add(this.voiceClientService.onToolCall(e => {
772
- const allowedTools = [
773
- "send_to_chat",
774
- "get_session_info",
775
- "get_session_changes",
776
- "get_session_thread",
777
- "approve_confirmation",
778
- "reject_confirmation",
779
- "auto_approve_session",
780
- "revoke_auto_approve",
781
- "focus_session"
782
- ];
783
- if (e.name === "send_to_chat") {
784
- let text = typeof e.args?.["text"] === "string" ? e.args["text"] : "";
785
- const stripped = this._checkSendKeyword(text);
786
- if (stripped !== undefined) {
787
- text = stripped;
788
- }
789
- this._statusText.set(VoiceToolDispatchService.getActionLabel(e.name), undefined);
790
- this._persistEntry("agent_tool_call", this._renderToolCallSummary(e.name, e.args), {
791
- toolName: e.name,
792
- toolArgs: e.args
793
- });
794
- this._setAwaitingReply();
795
- const sendPromise = text.trim() ? this._sendTranscriptionToChat(text) : Promise.resolve();
796
- sendPromise.finally(() => {
797
- this.voiceClientService.sendToolResult(e.callId, "ok");
798
- this._voiceState.set("idle", undefined);
799
- this._statusText.set("Hold to speak...", undefined);
800
- this._sendContext();
801
- });
802
- return;
803
- }
804
- if (allowedTools.includes(e.name)) {
805
- this._statusText.set(VoiceToolDispatchService.getActionLabel(e.name), undefined);
806
- this._persistEntry("agent_tool_call", this._renderToolCallSummary(e.name, e.args), {
807
- toolName: e.name,
808
- toolArgs: e.args
809
- });
810
- if (e.name === "approve_confirmation" || e.name === "reject_confirmation") {
811
- this.telemetryService.publicLog2("voiceToolApproval", {
812
- toolName: e.name,
813
- approved: e.name === "approve_confirmation"
814
- });
815
- }
816
- if (this._pttHeld) {
817
- this._finishPtt();
818
- }
819
- this._suppressIncomingAudio = false;
820
- this._setAwaitingReply();
821
- this.voiceToolDispatchService.dispatchToolCall(e).then(result => {
822
- this.voiceClientService.sendToolResult(e.callId, result);
823
- this._voiceState.set("idle", undefined);
824
- this._statusText.set("Hold to speak...", undefined);
825
- this._sendContext();
826
- });
827
- } else {
828
- this.voiceClientService.sendToolResult(e.callId, "ok");
829
- }
830
- }));
831
- this._voiceEventDisposables.add(this.voiceClientService.onError(detail => {
832
- if (!this._isConnecting.get()) {
833
- this._voiceState.set("error", undefined);
834
- this._statusText.set(`Error: ${detail}`, undefined);
835
- }
836
- }));
837
- await this.voiceClientService.connect(window, authToken);
838
- const connectTimeout = setTimeout(() => {
839
- if (this._isConnecting.get() && !this._isConnected.get()) {
840
- this.disconnect();
841
- }
842
- }, 10000);
843
- this._voiceEventDisposables.add({
844
- dispose: () => clearTimeout(connectTimeout)
845
- });
846
- }
847
- disconnect() {
848
- if (this._telemetrySessionStart) {
849
- const durationSec = Math.round((Date.now() - this._telemetrySessionStart) / 1000);
850
- this.telemetryService.publicLog2("voiceSessionEnded", {
851
- turnCount: this._telemetryTurnCount,
852
- durationSec,
853
- reconnectCount: this._telemetryReconnectCount
854
- });
855
- this._telemetrySessionStart = undefined;
856
- }
857
- this._isConnecting.set(false, undefined);
858
- this._isReconnecting.set(false, undefined);
859
- this._voiceAutorunDisposable.clear();
860
- this._voiceEventDisposables.clear();
861
- this.ttsPlaybackService.closeContext();
862
- this.micCaptureService.stopCapture();
863
- this.voiceClientService.disconnect();
864
- this._pttHeld = false;
865
- this._pttToggleMode = false;
866
- this._isConnected.set(false, undefined);
867
- this._voiceState.set("idle", undefined);
868
- this._statusText.set("Tap to start", undefined);
869
- this._transcriptTurns.set([], undefined);
870
- this._clearAutoSendSilenceTimer();
871
- this._clearAutoListenTimer();
872
- this._clearAwaitingReply();
873
- this._autoListenAfterGreeting = false;
874
- this._hasPlayedInitialListenCue = false;
875
- this._replyPlayedSinceSend = false;
876
- this._audioQueue.length = 0;
877
- this._currentPlaybackSessionId = null;
878
- this._isProcessingQueue = false;
879
- this._suppressIncomingAudio = false;
880
- this._prevSessionStates.clear();
881
- for (const t of ( this._userCancelledSessions.values())) {
882
- clearTimeout(t);
883
- }
884
- this._userCancelledSessions.clear();
885
- for (const t of ( this._confirmationFlushWatchdogs.values())) {
886
- clearTimeout(t);
887
- }
888
- this._confirmationFlushWatchdogs.clear();
889
- for (const ref of ( this._eagerModelRefs.values())) {
890
- ref.dispose();
891
- }
892
- this._eagerModelRefs.clear();
893
- this._eagerModelLoading.clear();
894
- this._pendingIdleNarration.clear();
895
- this._userLogin = undefined;
896
- this._lastPersistedTurnId = undefined;
897
- this._pendingPriorTimeline = [];
898
- this._stopReplay();
899
- this._sessionAudioCache.clear();
900
- }
901
- simulateConnection() {
902
- this._isConnected.set(true, undefined);
903
- this._isConnecting.set(false, undefined);
904
- this._voiceState.set("idle", undefined);
905
- this._statusText.set("Hold to speak...", undefined);
906
- this._voiceEventDisposables.add(disposableTimeout(() => {
907
- if (!this._isConnected.get()) {
908
- return;
909
- }
910
- this._voiceState.set("listening", undefined);
911
- this._transcriptTurns.set([{
912
- speaker: "user",
913
- text: "Create a",
914
- committed: "",
915
- isPartial: true
916
- }], undefined);
917
- }, 1000));
918
- this._voiceEventDisposables.add(disposableTimeout(() => {
919
- if (!this._isConnected.get()) {
920
- return;
921
- }
922
- this._transcriptTurns.set([{
923
- speaker: "user",
924
- text: "Create a new React component",
925
- committed: "Create a ",
926
- isPartial: true
927
- }], undefined);
928
- }, 2000));
929
- this._voiceEventDisposables.add(disposableTimeout(() => {
930
- if (!this._isConnected.get()) {
931
- return;
932
- }
933
- this._transcriptTurns.set([{
934
- speaker: "user",
935
- text: "Create a new React component for the dashboard",
936
- committed: "Create a new React component for the dashboard",
937
- isPartial: false
938
- }], undefined);
939
- this._voiceState.set("idle", undefined);
940
- }, 3000));
941
- this._voiceEventDisposables.add(disposableTimeout(() => {
942
- if (!this._isConnected.get()) {
943
- return;
944
- }
945
- this._transcriptTurns.set([{
946
- speaker: "user",
947
- text: "Create a new React component for the dashboard",
948
- committed: "Create a new React component for the dashboard",
949
- isPartial: false
950
- }, {
951
- speaker: "assistant",
952
- text: "I'll create a Dashboard component with some widgets...",
953
- committed: "",
954
- isPartial: false
955
- }], undefined);
956
- }, 4500));
957
- }
958
- _onConnectionLost() {
959
- this.logService.warn("[voice] connection lost, preserving state for reconnect");
960
- this.ttsPlaybackService.closeContext();
961
- this._pttHeld = false;
962
- this._pttToggleMode = false;
963
- this._isConnected.set(false, undefined);
964
- this._isReconnecting.set(true, undefined);
965
- this._voiceState.set("idle", undefined);
966
- this._statusText.set("Reconnecting...", undefined);
967
- }
968
- pttDown() {
969
- if (!this._isConnected.get()) {
970
- return;
971
- }
972
- this._clearAutoSendSilenceTimer();
973
- if (this._pttToggleMode) {
974
- this._pttToggleMode = false;
975
- this._finishPtt();
976
- return;
977
- }
978
- if (this._pttHeld) {
979
- return;
980
- }
981
- this._pttHeld = true;
982
- this._autoListenAfterGreeting = false;
983
- this._clearAutoListenTimer();
984
- this._pttCurrentTurnId = generateUuid();
985
- this._pttWaitingForPlayback = false;
986
- this._telemetryPttDownMs = Date.now();
987
- this._telemetryFirstTranscriptionMs = undefined;
988
- this._telemetryTurnCount++;
989
- this._telemetryTtsInterrupted = this.ttsPlaybackService.isPlaying;
990
- if (this._delayedMicStopTimer) {
991
- clearTimeout(this._delayedMicStopTimer);
992
- this._delayedMicStopTimer = undefined;
993
- }
994
- this._cancelTranscriptFade();
995
- this._startUserTurn();
996
- this._audioQueue.length = 0;
997
- this._currentPlaybackSessionId = null;
998
- this._isProcessingQueue = false;
999
- this._suppressIncomingAudio = true;
1000
- this.micCaptureService.isMuted = false;
1001
- this.micCaptureService.pttDown(this._pttCurrentTurnId).catch(() => {
1002
- this._pttHeld = false;
1003
- this._statusText.set("Microphone denied", undefined);
1004
- this._voiceState.set("error", undefined);
1005
- if (this._pttMaxDurationTimer) {
1006
- clearTimeout(this._pttMaxDurationTimer);
1007
- this._pttMaxDurationTimer = undefined;
1008
- }
1009
- this.disconnect();
1010
- });
1011
- this.ttsPlaybackService.stopPlayback();
1012
- this._voiceState.set("listening", undefined);
1013
- this._statusText.set("Listening...", undefined);
1014
- if (this._isAutoSendEnabled()) {
1015
- if (!this._hasPlayedInitialListenCue) {
1016
- this._hasPlayedInitialListenCue = true;
1017
- this.accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStarted);
1018
- } else if (this.accessibilityService.isScreenReaderOptimized()) {
1019
- this.accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStarted);
1020
- }
1021
- }
1022
- this._pttMaxDurationTimer = setTimeout(() => {
1023
- if (this._pttHeld) {
1024
- this._statusText.set("Max duration reached", undefined);
1025
- this.pttUp();
1026
- }
1027
- }, VoiceSessionController_1._PTT_MAX_DURATION_MS);
1028
- }
1029
- pttUp() {
1030
- if (!this._pttHeld) {
1031
- return;
1032
- }
1033
- const holdMs = this._telemetryPttDownMs ? Date.now() - this._telemetryPttDownMs : Infinity;
1034
- if (holdMs < VoiceSessionController_1._PTT_TOGGLE_THRESHOLD_MS) {
1035
- this._pttToggleMode = true;
1036
- return;
1037
- }
1038
- this._finishPtt();
1039
- }
1040
- _finishPtt() {
1041
- if (!this._pttHeld) {
1042
- return;
1043
- }
1044
- this._clearAutoSendSilenceTimer();
1045
- this._clearAutoListenTimer();
1046
- this._pttHeld = false;
1047
- this._telemetryPttUpMs = Date.now();
1048
- const holdMs = this._telemetryPttDownMs ? Date.now() - this._telemetryPttDownMs : 0;
1049
- this.telemetryService.publicLog2("voicePtt", {
1050
- holdDurationMs: holdMs
1051
- });
1052
- if (this._pttMaxDurationTimer) {
1053
- clearTimeout(this._pttMaxDurationTimer);
1054
- this._pttMaxDurationTimer = undefined;
1055
- }
1056
- this._voiceState.set("processing", undefined);
1057
- this._statusText.set("Processing...", undefined);
1058
- this._replyPlayedSinceSend = false;
1059
- this._clearAwaitingReply();
1060
- this._suppressIncomingAudio = false;
1061
- this.micCaptureService.pttUp();
1062
- if (this.accessibilityService.isScreenReaderOptimized()) {
1063
- this.accessibilitySignalService.playSignal(AccessibilitySignal.voiceRecordingStopped);
1064
- }
1065
- }
1066
- markUserCancelled(sessionId) {
1067
- const existing = this._userCancelledSessions.get(sessionId);
1068
- if (existing) {
1069
- clearTimeout(existing);
1070
- }
1071
- const expiry = setTimeout(() => {
1072
- this._userCancelledSessions.delete(sessionId);
1073
- }, VoiceSessionController_1._USER_CANCEL_SUPPRESS_MS);
1074
- this._userCancelledSessions.set(sessionId, expiry);
1075
- }
1076
- setTargetSession(resource) {
1077
- this._targetSession.set(resource, undefined);
1078
- }
1079
- newSessionAsTarget() {
1080
- const ref = this.chatService.startNewLocalSession(ChatAgentLocation.Chat);
1081
- const resource = ref.object.sessionResource;
1082
- ref.dispose();
1083
- this._targetSession.set(resource, undefined);
1084
- this.commandService.executeCommand("_chat.voice.switchToSession", ( resource.toString())).catch(() => {});
1085
- }
1086
- _scheduleDelayedMicStop() {
1087
- if (this._delayedMicStopTimer) {
1088
- clearTimeout(this._delayedMicStopTimer);
1089
- }
1090
- this._delayedMicStopTimer = setTimeout(() => {
1091
- this._delayedMicStopTimer = undefined;
1092
- this._pttWaitingForPlayback = false;
1093
- }, 1000);
1094
- }
1095
- _isAutoSendEnabled() {
1096
- const delayMs = this.configurationService.getValue("agents.voice.autoSendDelay");
1097
- return typeof delayMs === "number" && delayMs >= 0;
1098
- }
1099
- _checkSendKeyword(text) {
1100
- const keyword = this.configurationService.getValue("agents.voice.sendKeyword")?.trim();
1101
- if (!keyword) {
1102
- return undefined;
1103
- }
1104
- const trimmed = text.trimEnd().replace(/[.,!?;:]+$/, "").trimEnd();
1105
- const keywordLower = keyword.toLowerCase();
1106
- if (trimmed.toLowerCase().endsWith(keywordLower)) {
1107
- const stripped = trimmed.slice(0, trimmed.length - keyword.length).trimEnd();
1108
- return stripped || undefined;
1109
- }
1110
- return undefined;
1111
- }
1112
- _enterAutoListen() {
1113
- this._clearAutoListenTimer();
1114
- if (!this._isConnected.get() || this._pttHeld) {
1115
- return;
1116
- }
1117
- if (this.ttsPlaybackService.isPlaying || this._audioQueue.length > 0 || this._currentPlaybackSessionId !== null) {
1118
- return;
1119
- }
1120
- this.pttDown();
1121
- this.pttUp();
1122
- }
1123
- _scheduleAutoListen() {
1124
- this._clearAutoListenTimer();
1125
- this._autoListenTimer = setTimeout(() => {
1126
- this._autoListenTimer = undefined;
1127
- if (this._awaitingReplyAudio) {
1128
- return;
1129
- }
1130
- this._enterAutoListen();
1131
- }, VoiceSessionController_1._AUTO_LISTEN_QUIET_MS);
1132
- }
1133
- _clearAutoListenTimer() {
1134
- if (this._autoListenTimer) {
1135
- clearTimeout(this._autoListenTimer);
1136
- this._autoListenTimer = undefined;
1137
- }
1138
- }
1139
- _scheduleAutoSendOnSilence() {
1140
- this._clearAutoSendSilenceTimer();
1141
- const delayMs = this.configurationService.getValue("agents.voice.autoSendDelay");
1142
- if (typeof delayMs !== "number" || delayMs < 0) {
1143
- return;
1144
- }
1145
- this._autoSendSilenceTimer = setTimeout(() => {
1146
- this._autoSendSilenceTimer = undefined;
1147
- if (this._pttToggleMode && this._pttHeld) {
1148
- this._pttToggleMode = false;
1149
- this._finishPtt();
1150
- }
1151
- }, delayMs);
1152
- }
1153
- _clearAutoSendSilenceTimer() {
1154
- if (this._autoSendSilenceTimer) {
1155
- clearTimeout(this._autoSendSilenceTimer);
1156
- this._autoSendSilenceTimer = undefined;
1157
- }
1158
- }
1159
- _setAwaitingReply() {
1160
- this._awaitingReplyAudio = true;
1161
- this._clearAutoListenTimer();
1162
- if (this._awaitingReplyWatchdog) {
1163
- clearTimeout(this._awaitingReplyWatchdog);
1164
- }
1165
- this._awaitingReplyWatchdog = setTimeout(() => {
1166
- this._awaitingReplyWatchdog = undefined;
1167
- this._awaitingReplyAudio = false;
1168
- if (this._isAutoSendEnabled() && !this._pttHeld) {
1169
- this._enterAutoListen();
1170
- }
1171
- }, 30_000);
1172
- }
1173
- _clearAwaitingReply() {
1174
- this._awaitingReplyAudio = false;
1175
- if (this._awaitingReplyWatchdog) {
1176
- clearTimeout(this._awaitingReplyWatchdog);
1177
- this._awaitingReplyWatchdog = undefined;
1178
- }
1179
- }
1180
- async _sendTranscriptionToChat(text) {
1181
- const target = this._targetSession.get();
1182
- if (target) {
1183
- const currentSession = await this.commandService.executeCommand("_chat.voice.getCurrentSession").catch(() => undefined);
1184
- const isTargetVisible = currentSession === ( target.toString());
1185
- if (isTargetVisible) {
1186
- await this.commandService.executeCommand("_chat.voice.acceptInput", text).catch(err => {
1187
- this.logService.warn("[voice] acceptInput failed for visible target:", err);
1188
- });
1189
- } else {
1190
- const cts = ( new CancellationTokenSource());
1191
- const ref = await this.chatService.acquireOrLoadSession(target, ChatAgentLocation.Chat, cts.token, "voice-send").catch(err => {
1192
- this.logService.warn("[voice] Failed to load target session:", err);
1193
- return undefined;
1194
- });
1195
- cts.dispose();
1196
- if (!ref) {
1197
- this.logService.warn("[voice] Could not load target session, falling back to switch");
1198
- const switched = await this.commandService.executeCommand("_chat.voice.switchToSession", ( target.toString())).catch(() => false);
1199
- if (switched) {
1200
- await ( new Promise(resolve => setTimeout(resolve, 200)));
1201
- await this.commandService.executeCommand("_chat.voice.acceptInput", text).catch(() => {});
1202
- }
1203
- return;
1204
- }
1205
- const result = await this.chatService.sendRequest(target, text).catch(err => {
1206
- this.logService.warn("[voice] Error sending transcription to target session:", err);
1207
- return undefined;
1208
- });
1209
- if (result && result.kind !== "rejected") {
1210
- this._watchResponseForFloatingWindow(target);
1211
- this.commandService.executeCommand("_agentsVoice.openWindow").catch(() => {});
1212
- const model = this.chatService.getSession(target);
1213
- if (model) {
1214
- const lastReq = model.getRequests().at(-1);
1215
- if (lastReq?.response && !lastReq.response.isComplete && !lastReq.response.isCanceled) {
1216
- const responseDisposable = lastReq.response.onDidChange(() => {
1217
- if (lastReq.response.isComplete || lastReq.response.isCanceled) {
1218
- responseDisposable.dispose();
1219
- ref.dispose();
1220
- }
1221
- });
1222
- } else {
1223
- ref.dispose();
1224
- }
1225
- } else {
1226
- ref.dispose();
1227
- }
1228
- } else {
1229
- ref.dispose();
1230
- }
1231
- }
1232
- } else {
1233
- const currentSession = await this.commandService.executeCommand("_chat.voice.getCurrentSession").catch(() => undefined);
1234
- if (currentSession) {
1235
- this.commandService.executeCommand("_chat.voice.acceptInput", text).catch(err => {
1236
- this.logService.warn("[voice] acceptInput failed for current session:", err);
1237
- });
1238
- } else {
1239
- const models = [...this.chatService.chatModels.get()];
1240
- const existingSession = models.length > 0 ? models[models.length - 1] : undefined;
1241
- const sessionResource = existingSession?.sessionResource;
1242
- if (sessionResource) {
1243
- const switched = await this.commandService.executeCommand("_chat.voice.switchToSession", ( sessionResource.toString())).catch(() => false);
1244
- if (switched) {
1245
- await ( new Promise(resolve => setTimeout(resolve, 200)));
1246
- await this.commandService.executeCommand("_chat.voice.acceptInput", text).catch(err => {
1247
- this.logService.warn("[voice] acceptInput failed after switch to existing:", err);
1248
- });
1249
- } else {
1250
- this.chatService.sendRequest(sessionResource, text).catch(err => {
1251
- this.logService.warn("[voice] Error sending transcription to existing session:", err);
1252
- });
1253
- }
1254
- } else {
1255
- const ref = this.chatService.startNewLocalSession(ChatAgentLocation.Chat);
1256
- const resource = ref.object.sessionResource;
1257
- ref.dispose();
1258
- this.commandService.executeCommand("_chat.voice.switchToSession", ( resource.toString())).catch(() => {});
1259
- this.chatService.sendRequest(resource, text).catch(err => {
1260
- this.logService.warn("[voice] Error sending transcription to new session:", err);
1261
- });
1262
- }
1263
- }
1264
- this.commandService.executeCommand("workbench.panel.chat.view.copilot.focus").catch(() => {});
1265
- }
1266
- }
1267
- _watchResponseForFloatingWindow(sessionResource) {
1268
- const model = this.chatService.getSession(sessionResource);
1269
- if (!model) {
1270
- return;
1271
- }
1272
- this._prevSessionStates.set(( sessionResource.toString()), {
1273
- state: "thinking",
1274
- detail: ""
1275
- });
1276
- this._sendContext();
1277
- const disposables = ( new DisposableStore());
1278
- let lastText = "";
1279
- const updateFromResponse = () => {
1280
- const lastReq = model.lastRequest;
1281
- const response = lastReq?.response;
1282
- if (!response) {
1283
- return;
1284
- }
1285
- const markdown = response.response.getMarkdown();
1286
- const previewText = markdown.length > 200 ? markdown.slice(0, 200) + "…" : markdown;
1287
- if (previewText && previewText !== lastText) {
1288
- const isFirst = lastText === "";
1289
- lastText = previewText;
1290
- this._setAssistantTurn(previewText, {
1291
- startNewTurn: isFirst
1292
- });
1293
- }
1294
- if (response.isComplete || response.isCanceled) {
1295
- this._prevSessionStates.set(( sessionResource.toString()), {
1296
- state: "idle",
1297
- detail: ""
1298
- });
1299
- this._sendContext();
1300
- this.voiceClientService.flushSessionContext();
1301
- disposables.dispose();
1302
- }
1303
- };
1304
- const checkResponse = () => {
1305
- const lastReq = model.lastRequest;
1306
- if (lastReq?.response) {
1307
- disposables.add(lastReq.response.onDidChange(() => updateFromResponse()));
1308
- updateFromResponse();
1309
- }
1310
- };
1311
- disposables.add(model.onDidChange(e => {
1312
- if (e.kind === "addResponse") {
1313
- checkResponse();
1314
- }
1315
- }));
1316
- checkResponse();
1317
- const timeout = setTimeout(() => disposables.dispose(), 5 * 60 * 1000);
1318
- disposables.add({
1319
- dispose: () => clearTimeout(timeout)
1320
- });
1321
- }
1322
- _pushTurn(turn) {
1323
- const cur = this._transcriptTurns.get();
1324
- const next = [...cur, turn].slice(-VoiceSessionController_1._MAX_TURNS);
1325
- this._transcriptTurns.set(next, undefined);
1326
- }
1327
- _startUserTurn() {
1328
- const cur = this._transcriptTurns.get();
1329
- const last = cur[cur.length - 1];
1330
- if (last && last.speaker === "user" && !last.text) {
1331
- return;
1332
- }
1333
- this._pushTurn({
1334
- speaker: "user",
1335
- text: "",
1336
- committed: "",
1337
- isPartial: true
1338
- });
1339
- }
1340
- _updateUserTurn(text, committed, isPartial) {
1341
- const cur = this._transcriptTurns.get();
1342
- const last = cur[cur.length - 1];
1343
- if (!last || last.speaker !== "user") {
1344
- this._pushTurn({
1345
- speaker: "user",
1346
- text,
1347
- committed,
1348
- isPartial
1349
- });
1350
- return;
1351
- }
1352
- const updated = {
1353
- speaker: "user",
1354
- text,
1355
- committed,
1356
- isPartial
1357
- };
1358
- this._transcriptTurns.set([...cur.slice(0, -1), updated], undefined);
1359
- }
1360
- _setAssistantTurn(
1361
- text,
1362
- opts = {
1363
- startNewTurn: true
1364
- }
1365
- ) {
1366
- const cur = this._transcriptTurns.get();
1367
- const last = cur[cur.length - 1];
1368
- if (!opts.startNewTurn && last && last.speaker === "assistant") {
1369
- const updated = {
1370
- speaker: "assistant",
1371
- text,
1372
- committed: "",
1373
- isPartial: false
1374
- };
1375
- this._transcriptTurns.set([...cur.slice(0, -1), updated], undefined);
1376
- return;
1377
- }
1378
- this._pushTurn({
1379
- speaker: "assistant",
1380
- text,
1381
- committed: "",
1382
- isPartial: false
1383
- });
1384
- }
1385
- _cancelTranscriptFade() {
1386
- if (this._transcriptFadeTimer) {
1387
- clearTimeout(this._transcriptFadeTimer);
1388
- this._transcriptFadeTimer = undefined;
1389
- }
1390
- }
1391
- _persistEntry(kind, text, metadata) {
1392
- const userId = this._userLogin;
1393
- if (!userId || !text) {
1394
- return;
1395
- }
1396
- const entry = {
1397
- turnId: generateUuid(),
1398
- ancestorIds: this._lastPersistedTurnId ? [this._lastPersistedTurnId] : [],
1399
- kind,
1400
- role: kind === "user_voice" ? "user" : "assistant",
1401
- text,
1402
- timestamp: ( new Date()).toISOString(),
1403
- ...(metadata ? {
1404
- metadata
1405
- } : {})
1406
- };
1407
- this._lastPersistedTurnId = entry.turnId;
1408
- this.voiceTranscriptStore.appendTurn(userId, entry).catch(err => {
1409
- this.logService.warn("[voice] failed to persist transcript entry", err);
1410
- });
1411
- }
1412
- _persistTurn(role, text) {
1413
- this._persistEntry(role === "user" ? "user_voice" : "agent_voice", text);
1414
- }
1415
- _renderToolCallSummary(name, args) {
1416
- if (!args || ( Object.keys(args)).length === 0) {
1417
- return `${name}()`;
1418
- }
1419
- const pairs = [];
1420
- for (const [k, v] of Object.entries(args)) {
1421
- let rendered;
1422
- if (typeof v === "string") {
1423
- rendered = v.length > 200 ? `${v.slice(0, 197)}...` : v;
1424
- rendered = JSON.stringify(rendered);
1425
- } else {
1426
- try {
1427
- const json = JSON.stringify(v);
1428
- rendered = json.length > 200 ? `${json.slice(0, 197)}...` : json;
1429
- } catch {
1430
- rendered = String(v);
1431
- }
1432
- }
1433
- pairs.push(`${k}=${rendered}`);
1434
- }
1435
- return `${name}(${pairs.join(", ")})`;
1436
- }
1437
- _buildPriorTimeline(turns) {
1438
- const out = [];
1439
- for (const t of turns) {
1440
- const kind = t.kind;
1441
- if (!kind) {
1442
- continue;
1443
- }
1444
- const entry = {
1445
- kind,
1446
- text: t.text,
1447
- timestamp: ( new Date(t.timestamp)).toISOString(),
1448
- ...(t.metadata?.toolName ? {
1449
- toolName: t.metadata.toolName
1450
- } : {}),
1451
- ...(t.metadata?.codingSessionId ? {
1452
- codingSessionId: t.metadata.codingSessionId
1453
- } : {}),
1454
- ...(t.metadata?.codingStatus ? {
1455
- codingStatus: t.metadata.codingStatus
1456
- } : {})
1457
- };
1458
- out.push(entry);
1459
- }
1460
- try {
1461
- const sessions = this.agentSessionsService.model.sessions.filter(s => !s.isArchived());
1462
- for (const session of sessions) {
1463
- const model = this.chatService.getSession(session.resource);
1464
- const lastReq = model?.getRequests().at(-1);
1465
- const value = lastReq?.response?.response.value;
1466
- if (!value) {
1467
- continue;
1468
- }
1469
- const full = ( value.filter(p => p.kind === "markdownContent").map(p => p.content.value)).join(" ").trim();
1470
- if (!full) {
1471
- continue;
1472
- }
1473
- const summary = this._firstSentences(full, VoiceSessionController_1.CODING_AGENT_REPLY_SENTENCE_LIMIT);
1474
- if (!summary) {
1475
- continue;
1476
- }
1477
- out.push({
1478
- kind: "coding_agent_reply",
1479
- text: summary,
1480
- timestamp: ( new Date()).toISOString(),
1481
- codingSessionId: ( session.resource.toString())
1482
- });
1483
- }
1484
- } catch (err) {
1485
- this.logService.warn("[voice] failed to synthesize coding_agent_reply timeline entries", err);
1486
- }
1487
- return out;
1488
- }
1489
- _firstSentences(text, n) {
1490
- const collapsed = text.replace(/\s+/g, " ").trim();
1491
- if (!collapsed) {
1492
- return "";
1493
- }
1494
- const sentences = [];
1495
- const re = /[^.!?]+[.!?]+(\s|$)/g;
1496
- let m;
1497
- while ((m = re.exec(collapsed)) !== null && sentences.length < n) {
1498
- sentences.push(m[0].trim());
1499
- }
1500
- if (sentences.length === 0) {
1501
- return collapsed.length > 600 ? `${collapsed.slice(0, 597)}...` : collapsed;
1502
- }
1503
- return sentences.join(" ");
1504
- }
1505
- _enqueueAudio(sessionId, audio, isFirstChunk, isFinal, transcript) {
1506
- if (this._suppressIncomingAudio) {
1507
- if (isFirstChunk) {
1508
- this._suppressIncomingAudio = false;
1509
- } else {
1510
- return;
1511
- }
1512
- }
1513
- if (isFirstChunk) {
1514
- this._clearAwaitingReply();
1515
- }
1516
- const nothingPlaying = this._currentPlaybackSessionId === null;
1517
- const sameSession = !nothingPlaying && this._currentPlaybackSessionId === sessionId;
1518
- if ((nothingPlaying && this._audioQueue.length === 0) || sameSession) {
1519
- this._playChunk(sessionId, audio, isFirstChunk, isFinal, transcript);
1520
- return;
1521
- }
1522
- let entry = this._audioQueue.find(
1523
- e => e.sessionId === sessionId || (e.sessionId === undefined && sessionId === undefined)
1524
- );
1525
- if (!entry) {
1526
- entry = {
1527
- sessionId,
1528
- chunks: []
1529
- };
1530
- this._audioQueue.push(entry);
1531
- }
1532
- entry.chunks.push({
1533
- audio,
1534
- isFirstChunk,
1535
- isFinal,
1536
- transcript
1537
- });
1538
- if (this._currentPlaybackSessionId === null && !this._isProcessingQueue) {
1539
- this._processQueue();
1540
- }
1541
- }
1542
- _playChunk(sessionId, audio, isFirstChunk, isFinal, transcript) {
1543
- this._currentPlaybackSessionId = sessionId;
1544
- if (transcript) {
1545
- this._setAssistantTurn(transcript, {
1546
- startNewTurn: isFirstChunk
1547
- });
1548
- }
1549
- const sessionResource = sessionId ? ( URI.parse(sessionId)) : undefined;
1550
- if (sessionResource) {
1551
- this.voicePlaybackService.notifyPlaybackStart(sessionResource, transcript);
1552
- }
1553
- const ttsEnabled = this.configurationService.getValue("agents.voice.textToSpeech") !== false;
1554
- if (ttsEnabled && audio) {
1555
- this._clearAutoListenTimer();
1556
- this._replyPlayedSinceSend = true;
1557
- this.micCaptureService.suppressUntil(Date.now() + 800);
1558
- this._voiceState.set("speaking", undefined);
1559
- this._statusText.set("Speaking...", undefined);
1560
- this.ttsPlaybackService.playAudioChunk(audio, isFinal, this._window);
1561
- } else if (!ttsEnabled) {
1562
- this._replyPlayedSinceSend = true;
1563
- if (isFinal) {
1564
- this._currentPlaybackSessionId = null;
1565
- this._processQueue();
1566
- if (this._isAutoSendEnabled()) {
1567
- this._scheduleAutoListen();
1568
- }
1569
- }
1570
- } else {
1571
- this.ttsPlaybackService.playAudioChunk(audio, isFinal, this._window);
1572
- }
1573
- }
1574
- _processQueue() {
1575
- if (this._audioQueue.length === 0 || this._currentPlaybackSessionId !== null) {
1576
- this._isProcessingQueue = false;
1577
- return;
1578
- }
1579
- this._isProcessingQueue = true;
1580
- const next = this._audioQueue.shift();
1581
- for (const chunk of next.chunks) {
1582
- this._playChunk(
1583
- next.sessionId,
1584
- chunk.audio,
1585
- chunk.isFirstChunk,
1586
- chunk.isFinal,
1587
- chunk.transcript
1588
- );
1589
- }
1590
- this._isProcessingQueue = false;
1591
- }
1592
- _replaySessionAudio(sessionId) {
1593
- this._stopReplay();
1594
- const samples = this._sessionAudioCache.get(sessionId);
1595
- if (!samples || !this._window) {
1596
- return;
1597
- }
1598
- const ctx = this.ttsPlaybackService.ensureContext(this._window);
1599
- const buffer = ctx.createBuffer(1, samples.length, 24000);
1600
- buffer.getChannelData(0).set(samples);
1601
- const source = ctx.createBufferSource();
1602
- source.buffer = buffer;
1603
- source.connect(ctx.destination);
1604
- this._replaySourceNode = source;
1605
- const sessionResource = ( URI.parse(sessionId));
1606
- this.voicePlaybackService.notifyPlaybackStart(sessionResource, undefined);
1607
- this._voiceState.set("speaking", undefined);
1608
- this._statusText.set("Replaying...", undefined);
1609
- source.onended = () => {
1610
- if (this._replaySourceNode === source) {
1611
- this._replaySourceNode = undefined;
1612
- this.voicePlaybackService.notifyPlaybackEnd(sessionResource);
1613
- this._voiceState.set("idle", undefined);
1614
- this._statusText.set("Hold to speak...", undefined);
1615
- }
1616
- };
1617
- source.start(0);
1618
- }
1619
- _stopReplay() {
1620
- if (this._replaySourceNode) {
1621
- try {
1622
- this._replaySourceNode.stop();
1623
- } catch {}
1624
- this._replaySourceNode = undefined;
1625
- }
1626
- }
1627
- _sendContext() {
1628
- this.voiceClientService.sendSessionContext(this._buildSessionContext());
1629
- }
1630
- _armConfirmationFlushWatchdog(sessionId, label, isTransition) {
1631
- if (( this._confirmationFlushWatchdogs.has(sessionId))) {
1632
- return;
1633
- }
1634
- if (isTransition) {
1635
- this.logService.info(
1636
- `[voice] arming confirmation flush watchdog id=${sessionId.slice(-32)} label="${label}"`
1637
- );
1638
- }
1639
- const timer = setTimeout(() => {
1640
- this._confirmationFlushWatchdogs.delete(sessionId);
1641
- this.logService.info(
1642
- `[voice] confirmation flush watchdog firing id=${sessionId.slice(-32)} label="${label}"`
1643
- );
1644
- this._sendContext();
1645
- this.voiceClientService.flushSessionContext();
1646
- }, VoiceSessionController_1._CONFIRMATION_FLUSH_DELAY_MS);
1647
- this._confirmationFlushWatchdogs.set(sessionId, timer);
1648
- }
1649
- _checkSessionStateChanges() {
1650
- const sessions = this.agentSessionsService.model.sessions.filter(s => !s.isArchived());
1651
- const stateChanges = [];
1652
- const processedResources = ( new Set());
1653
- for (const s of sessions) {
1654
- processedResources.add(( s.resource.toString()));
1655
- const sessionId = ( s.resource.toString());
1656
- const model = this.chatService.getSession(s.resource);
1657
- let currentState;
1658
- let detail;
1659
- let lastResponseSummary;
1660
- if (model) {
1661
- const info = this._getAgentStateInfo(model);
1662
- currentState = info.state;
1663
- detail = info.detail;
1664
- lastResponseSummary = info.last_response_summary;
1665
- this._pendingIdleNarration.delete(sessionId);
1666
- } else {
1667
- currentState = s.status === ChatSessionStatus.InProgress ? "thinking" : s.status === ChatSessionStatus.NeedsInput ? "waiting_for_confirmation" : s.status === ChatSessionStatus.Completed ? "idle" : "unknown";
1668
- if (s.status === ChatSessionStatus.NeedsInput) {
1669
- this._ensureModelLoaded(s.resource);
1670
- }
1671
- }
1672
- const prev = this._prevSessionStates.get(sessionId);
1673
- const isStateChange = prev !== undefined && prev.state !== currentState && currentState !== "unknown";
1674
- const isDetailChange = !isStateChange && prev !== undefined && currentState === "waiting_for_confirmation" && (detail ?? "") !== prev.detail;
1675
- if (!model && currentState === "idle" && isStateChange) {
1676
- this._deferIdleNarrationUntilModelLoaded(s.resource);
1677
- continue;
1678
- }
1679
- if (isStateChange || isDetailChange) {
1680
- const cancelExpiry = this._userCancelledSessions.get(sessionId);
1681
- if (cancelExpiry) {
1682
- clearTimeout(cancelExpiry);
1683
- this._userCancelledSessions.delete(sessionId);
1684
- } else {
1685
- if (isDetailChange) {
1686
- this.voiceClientService.invalidateSessionCache(sessionId);
1687
- }
1688
- stateChanges.push({
1689
- sessionId,
1690
- currentState,
1691
- label: s.label || "Untitled session",
1692
- detail,
1693
- lastResponseSummary
1694
- });
1695
- }
1696
- }
1697
- if (currentState !== "unknown") {
1698
- this._prevSessionStates.set(sessionId, {
1699
- state: currentState,
1700
- detail: detail ?? ""
1701
- });
1702
- }
1703
- }
1704
- for (const chatModel of this.chatService.chatModels.get()) {
1705
- const key = ( chatModel.sessionResource.toString());
1706
- if (( processedResources.has(key))) {
1707
- continue;
1708
- }
1709
- if (chatModel.getRequests().length === 0) {
1710
- continue;
1711
- }
1712
- const info = this._getAgentStateInfo(chatModel);
1713
- const currentState = info.state;
1714
- const detail = info.detail;
1715
- const lastResponseSummary = info.last_response_summary;
1716
- const prev = this._prevSessionStates.get(key);
1717
- const isStateChange = prev !== undefined && prev.state !== currentState && currentState !== "unknown";
1718
- const isDetailChange = !isStateChange && prev !== undefined && currentState === "waiting_for_confirmation" && (detail ?? "") !== prev.detail;
1719
- if (isStateChange || isDetailChange) {
1720
- if (isDetailChange) {
1721
- this.voiceClientService.invalidateSessionCache(key);
1722
- }
1723
- stateChanges.push({
1724
- sessionId: key,
1725
- currentState,
1726
- label: chatModel.title || "Chat",
1727
- detail,
1728
- lastResponseSummary
1729
- });
1730
- }
1731
- if (currentState !== "unknown") {
1732
- this._prevSessionStates.set(key, {
1733
- state: currentState,
1734
- detail: detail ?? ""
1735
- });
1736
- }
1737
- }
1738
- if (stateChanges.length > 0) {
1739
- this.logService.info(
1740
- `[voice] onDidChangeSessions detected ${stateChanges.length} state change(s): ${( stateChanges.map(c => `${c.label}: ${c.currentState}`)).join(", ")}`
1741
- );
1742
- this._sendContext();
1743
- this.voiceClientService.flushSessionContext();
1744
- for (const change of stateChanges) {
1745
- this._persistEntry("coding_event", `session "${change.label}" → ${change.currentState}`, {
1746
- codingSessionId: change.sessionId,
1747
- codingStatus: change.currentState,
1748
- codingSessionLabel: change.label
1749
- });
1750
- }
1751
- }
1752
- }
1753
- _buildSessionContext() {
1754
- const oneHourAgo = Date.now() - 60 * 60 * 1000;
1755
- const sessions = this.agentSessionsService.model.sessions.filter(s => {
1756
- if (s.isArchived()) {
1757
- return false;
1758
- }
1759
- if (s.status === ChatSessionStatus.InProgress || s.status === ChatSessionStatus.NeedsInput) {
1760
- return true;
1761
- }
1762
- if (s.status === ChatSessionStatus.Completed) {
1763
- const endedAt = s.timing.lastRequestEnded ?? s.timing.created;
1764
- return endedAt !== undefined && endedAt > oneHourAgo;
1765
- }
1766
- return false;
1767
- });
1768
- const targetSessionId = this._targetSession.get()?.toString();
1769
- const sessionList = ( sessions.map(s => {
1770
- const model = this.chatService.getSession(s.resource);
1771
- const isActive = ( s.resource.toString()) === targetSessionId;
1772
- if (!model) {
1773
- const sessionIdStr = ( s.resource.toString());
1774
- let fallbackState = s.status === ChatSessionStatus.InProgress ? "thinking" : s.status === ChatSessionStatus.NeedsInput ? "waiting_for_confirmation" : s.status === ChatSessionStatus.Completed ? "idle" : "unknown";
1775
- if (fallbackState === "idle" && ( this._pendingIdleNarration.has(sessionIdStr))) {
1776
- const prev = this._prevSessionStates.get(sessionIdStr);
1777
- if (prev?.state) {
1778
- fallbackState = prev.state;
1779
- }
1780
- }
1781
- return {
1782
- id: sessionIdStr,
1783
- is_active: isActive,
1784
- agent_state: fallbackState
1785
- };
1786
- }
1787
- const stateInfo = this._getAgentStateInfo(model);
1788
- return {
1789
- id: ( s.resource.toString()),
1790
- is_active: isActive,
1791
- agent_state: stateInfo.state,
1792
- ...(stateInfo.detail ? {
1793
- agent_state_detail: stateInfo.detail
1794
- } : {}),
1795
- ...(stateInfo.last_response_summary ? {
1796
- last_response_summary: stateInfo.last_response_summary
1797
- } : {})
1798
- };
1799
- }));
1800
- const agentResources = ( new Set(( this.agentSessionsService.model.sessions.map(s => ( s.resource.toString())))));
1801
- for (const chatModel of this.chatService.chatModels.get()) {
1802
- const key = ( chatModel.sessionResource.toString());
1803
- if (( agentResources.has(key))) {
1804
- continue;
1805
- }
1806
- if (chatModel.getRequests().length === 0) {
1807
- continue;
1808
- }
1809
- const stateInfo = this._getAgentStateInfo(chatModel);
1810
- if (stateInfo.state === "idle") {
1811
- const lastActive = chatModel.lastMessageDate;
1812
- if (lastActive < oneHourAgo) {
1813
- continue;
1814
- }
1815
- }
1816
- sessionList.push({
1817
- id: key,
1818
- is_active: key === targetSessionId,
1819
- agent_state: stateInfo.state,
1820
- ...(stateInfo.detail ? {
1821
- agent_state_detail: stateInfo.detail
1822
- } : {}),
1823
- ...(stateInfo.last_response_summary ? {
1824
- last_response_summary: stateInfo.last_response_summary
1825
- } : {})
1826
- });
1827
- }
1828
- const context = {
1829
- sessions: sessionList,
1830
- display_locale: this._window?.navigator.language
1831
- };
1832
- return context;
1833
- }
1834
- _ensureModelLoaded(resource) {
1835
- const key = ( resource.toString());
1836
- if (( this._eagerModelRefs.has(key)) || ( this._eagerModelLoading.has(key)) || this.chatService.getSession(resource)) {
1837
- return;
1838
- }
1839
- this.logService.info(`[voice] eagerly loading model for session ${key.slice(-32)}`);
1840
- this._eagerModelLoading.add(key);
1841
- const cts = ( new CancellationTokenSource());
1842
- this.chatService.acquireOrLoadSession(
1843
- resource,
1844
- ChatAgentLocation.Chat,
1845
- cts.token,
1846
- "VoiceSessionController#eagerLoad"
1847
- ).then(ref => {
1848
- this._eagerModelLoading.delete(key);
1849
- if (ref) {
1850
- const existing = this._eagerModelRefs.get(key);
1851
- if (!this._isConnected.get() || existing) {
1852
- ref.dispose();
1853
- if (!this._isConnected.get()) {
1854
- this._pendingIdleNarration.delete(key);
1855
- }
1856
- } else {
1857
- this._eagerModelRefs.set(key, ref);
1858
- }
1859
- } else {
1860
- this._pendingIdleNarration.delete(key);
1861
- }
1862
- cts.dispose();
1863
- }, () => {
1864
- this._eagerModelLoading.delete(key);
1865
- this._pendingIdleNarration.delete(key);
1866
- cts.dispose();
1867
- });
1868
- }
1869
- _deferIdleNarrationUntilModelLoaded(resource) {
1870
- this._pendingIdleNarration.add(( resource.toString()));
1871
- this._ensureModelLoaded(resource);
1872
- }
1873
- _getAgentStateInfo(model) {
1874
- if (!model) {
1875
- return {
1876
- state: "unknown"
1877
- };
1878
- }
1879
- const lastRequest = model.getRequests().at(-1);
1880
- const pendingConfirmation = lastRequest?.response?.isPendingConfirmation.get();
1881
- if (pendingConfirmation) {
1882
- let confirmDetail = "";
1883
- for (const part of lastRequest?.response?.response.value ?? []) {
1884
- if (part.kind === "questionCarousel" && !part.isUsed) {
1885
- const carousel = part;
1886
- const titles = ( (carousel.questions ?? []).map(q => q.title)).filter(Boolean);
1887
- if (titles.length > 0) {
1888
- confirmDetail = `questions: ${titles.join(", ")}`;
1889
- } else {
1890
- const msg = carousel.message;
1891
- confirmDetail = msg ? (typeof msg === "string" ? msg : msg.value) : "asking clarifying questions";
1892
- }
1893
- } else if (part.kind === "planReview" && !part.isUsed) {
1894
- confirmDetail = "review the plan to continue";
1895
- } else if (part.kind === "elicitation2") {
1896
- const elicitation = part;
1897
- if (elicitation.state.get() === "pending") {
1898
- const title = elicitation.title;
1899
- confirmDetail = title ? (typeof title === "string" ? title : title.value) : "needs input";
1900
- }
1901
- } else if (part.kind === "confirmation" && !part.isUsed) {
1902
- const conf = part;
1903
- confirmDetail = conf.title ?? "needs approval";
1904
- } else if (part.kind === "toolInvocation") {
1905
- const state = part.state.get();
1906
- if (state.type === IChatToolInvocation.StateKind.WaitingForConfirmation) {
1907
- const params = state.parameters;
1908
- const command = params?.["command"] ?? params?.["input"];
1909
- const explanation = params?.["explanation"] ?? params?.["goal"];
1910
- if (typeof command === "string" && command) {
1911
- confirmDetail = `command: ${command}`;
1912
- if (typeof explanation === "string" && explanation) {
1913
- confirmDetail += `\nreason: ${explanation}`;
1914
- }
1915
- } else {
1916
- confirmDetail = pendingConfirmation.detail ?? "";
1917
- }
1918
- }
1919
- }
1920
- }
1921
- return {
1922
- state: "waiting_for_confirmation",
1923
- detail: confirmDetail || pendingConfirmation.detail || ""
1924
- };
1925
- }
1926
- if (lastRequest?.response) {
1927
- let fallbackDetail;
1928
- for (const part of lastRequest.response.response.value) {
1929
- if (part.kind === "toolInvocation") {
1930
- const state = part.state.get();
1931
- if (state.type === IChatToolInvocation.StateKind.WaitingForConfirmation) {
1932
- const params = state.parameters;
1933
- const questions = params?.["questions"];
1934
- let detail = "";
1935
- if (Array.isArray(questions) && questions.length > 0) {
1936
- const headers = ( questions.map(q => q["header"] || q["question"])).filter(Boolean).join(", ");
1937
- detail = headers ? `questions: ${headers}` : "asking clarifying questions";
1938
- }
1939
- if (!detail) {
1940
- const invMsg = part.invocationMessage;
1941
- detail = invMsg ? (typeof invMsg === "string" ? invMsg : invMsg.value) : "needs input";
1942
- }
1943
- fallbackDetail = detail;
1944
- }
1945
- }
1946
- }
1947
- if (fallbackDetail !== undefined) {
1948
- return {
1949
- state: "waiting_for_confirmation",
1950
- detail: fallbackDetail
1951
- };
1952
- }
1953
- }
1954
- const incomplete = lastRequest?.response?.isIncomplete.get() ?? false;
1955
- if (incomplete) {
1956
- return {
1957
- state: "thinking"
1958
- };
1959
- }
1960
- const responseText = lastRequest?.response?.response.getMarkdown().trim() ?? "";
1961
- return {
1962
- state: "idle",
1963
- ...(responseText ? {
1964
- last_response_summary: responseText
1965
- } : {})
1966
- };
1967
- }
1968
- _classifyPendingType(response) {
1969
- let result = "input";
1970
- for (const part of response.response.value) {
1971
- if (part.kind === "toolInvocation") {
1972
- const invocation = part;
1973
- const state = invocation.state.get();
1974
- if (state.type === IChatToolInvocation.StateKind.WaitingForConfirmation || state.type === IChatToolInvocation.StateKind.WaitingForPostApproval) {
1975
- result = "approval";
1976
- }
1977
- }
1978
- if (part.kind === "confirmation" && !part.isUsed) {
1979
- result = "approval";
1980
- }
1981
- if (part.kind === "questionCarousel" && !part.isUsed) {
1982
- result = "input";
1983
- }
1984
- if (part.kind === "planReview" && !part.isUsed) {
1985
- result = "input";
1986
- }
1987
- if (part.kind === "elicitation2") {
1988
- result = "input";
1989
- }
1990
- }
1991
- return result;
1992
- }
1993
- _getConfirmationDescription(response) {
1994
- let desc = "";
1995
- for (const part of response.response.value) {
1996
- if (part.kind === "toolInvocation") {
1997
- const invocation = part;
1998
- const state = invocation.state.get();
1999
- if (state.type === IChatToolInvocation.StateKind.WaitingForConfirmation) {
2000
- const params = state.parameters;
2001
- const command = params?.["command"] ?? params?.["input"];
2002
- const explanation = params?.["explanation"] ?? params?.["goal"];
2003
- if (typeof command === "string" && command) {
2004
- desc = typeof explanation === "string" ? `${command} — ${explanation}` : command;
2005
- }
2006
- }
2007
- } else if (part.kind === "questionCarousel" && !part.isUsed) {
2008
- const carousel = part;
2009
- const titles = ( (carousel.questions ?? []).map(q => q.title)).filter(Boolean);
2010
- if (titles.length > 0) {
2011
- desc = titles.join(", ");
2012
- } else {
2013
- const msg = carousel.message;
2014
- desc = msg ? (typeof msg === "string" ? msg : msg.value) : "asking clarifying questions";
2015
- }
2016
- } else if (part.kind === "elicitation2") {
2017
- const elicitation = part;
2018
- if (elicitation.state.get() === "pending") {
2019
- const title = elicitation.title;
2020
- desc = title ? (typeof title === "string" ? title : title.value) : "needs input";
2021
- }
2022
- } else if (part.kind === "planReview" && !part.isUsed) {
2023
- desc = "review the plan to continue";
2024
- } else if (part.kind === "confirmation" && !part.isUsed) {
2025
- desc = part.title ?? "needs approval";
2026
- }
2027
- }
2028
- return desc;
2029
- }
2030
- _autoApproveCheck() {
2031
- if (this._autoApprovedSessions.size === 0) {
2032
- return;
2033
- }
2034
- const sessions = this.agentSessionsService.model.sessions.filter(s => !s.isArchived());
2035
- for (const s of sessions) {
2036
- if (!( this._autoApprovedSessions.has(( s.resource.toString())))) {
2037
- continue;
2038
- }
2039
- const model = this.chatService.getSession(s.resource);
2040
- if (!model) {
2041
- continue;
2042
- }
2043
- for (const req of model.getRequests()) {
2044
- const pending = req.response?.isPendingConfirmation.get();
2045
- if (pending && req.response) {
2046
- for (const part of req.response.response.value) {
2047
- if (part.kind === "toolInvocation") {
2048
- IChatToolInvocation.confirmWith(part, {
2049
- type: ToolConfirmKind.UserAction
2050
- });
2051
- }
2052
- }
2053
- }
2054
- }
2055
- }
2056
- }
2057
- _getMachineId() {
2058
- return this.environmentService.machineId ?? "unknown";
2059
- }
2060
- async submitFeedback(feedbackText) {
2061
- let userId = this._userLogin;
2062
- if (!userId) {
2063
- try {
2064
- const sessions = await this.authenticationService.getSessions("github");
2065
- userId = sessions[0]?.account.label ?? "unknown";
2066
- } catch {
2067
- userId = "unknown";
2068
- }
2069
- }
2070
- let transcriptHistory = [];
2071
- try {
2072
- const turns = await this.voiceTranscriptStore.loadTurns(userId);
2073
- transcriptHistory = ( turns.map(t => ({
2074
- role: t.role,
2075
- text: t.text,
2076
- timestamp: t.timestamp
2077
- })));
2078
- } catch (err) {
2079
- this.logService.warn("[voice] failed to load transcript history for feedback", err);
2080
- }
2081
- const sessions = this.agentSessionsService.model.sessions.filter(s => !s.isArchived());
2082
- const clientSessionState = {
2083
- voiceState: this._voiceState.get(),
2084
- isConnected: this._isConnected.get(),
2085
- isConnecting: this._isConnecting.get(),
2086
- isReconnecting: this._isReconnecting.get(),
2087
- pendingToolConfirmations: ( this._pendingToolConfirmations.get().map(tc => ({
2088
- type: tc.type,
2089
- sessionLabel: tc.sessionLabel,
2090
- description: tc.description
2091
- }))),
2092
- activeSessions: ( sessions.map(s => ({
2093
- id: ( s.resource.toString()),
2094
- label: s.label,
2095
- status: s.status
2096
- })))
2097
- };
2098
- const clientEnvironment = {
2099
- machineId: this._getMachineId()
2100
- };
2101
- const payload = {
2102
- feedbackText,
2103
- machineId: this._getMachineId(),
2104
- userId,
2105
- sessionId: this.voiceClientService.currentSessionId ?? "",
2106
- submissionId: generateUuid(),
2107
- transcriptHistory,
2108
- clientSessionState,
2109
- clientEnvironment,
2110
- timestamp: ( new Date()).toISOString()
2111
- };
2112
- return this.voiceClientService.submitFeedback(payload);
2113
- }
2114
- };
2115
- VoiceSessionController = VoiceSessionController_1 = ( __decorate([( __param(0, IVoiceClientService)), ( __param(1, IMicCaptureService)), ( __param(2, ITtsPlaybackService)), ( __param(3, IVoiceToolDispatchService)), ( __param(4, IVoicePlaybackService)), ( __param(5, IAgentSessionsService)), ( __param(6, IChatService)), ( __param(7, ICommandService)), ( __param(8, IAuthenticationService)), ( __param(9, IVoiceTranscriptStore)), ( __param(10, ILogService)), ( __param(11, IWorkbenchEnvironmentService)), ( __param(12, ITelemetryService)), ( __param(13, IConfigurationService)), ( __param(14, IAccessibilitySignalService)), ( __param(15, IAccessibilityService))], VoiceSessionController));
2116
-
2117
- export { VoiceSessionController };