@codingame/monaco-vscode-chat-service-override 34.1.3 → 35.0.1

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 (427) hide show
  1. package/index.js +38 -0
  2. package/package.json +5 -5
  3. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.d.ts +1 -0
  4. package/vscode/src/vs/platform/agentHost/browser/agentHost.config.contribution.js +40 -0
  5. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.d.ts +27 -0
  6. package/vscode/src/vs/platform/agentHost/browser/agentHostConnectionsService.js +91 -0
  7. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.d.ts +20 -4
  8. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostProtocolClient.js +148 -15
  9. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.d.ts +1 -0
  10. package/vscode/src/vs/platform/agentHost/browser/remoteAgentHostServiceImpl.js +9 -1
  11. package/vscode/src/vs/platform/agentHost/common/agentHost.config.contribution.js +57 -3
  12. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.d.ts +10 -14
  13. package/vscode/src/vs/platform/agentHost/common/agentHostFileSystemProvider.js +29 -8
  14. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.d.ts +109 -2
  15. package/vscode/src/vs/platform/agentHost/common/agentHostSchema.js +207 -21
  16. package/vscode/src/vs/platform/agentHost/common/agentHostStarter.config.contribution.js +362 -37
  17. package/vscode/src/vs/platform/agentHost/common/agentService.d.ts +698 -91
  18. package/vscode/src/vs/platform/agentHost/common/agentService.js +46 -3
  19. package/vscode/src/vs/platform/agentHost/common/customAgents.js +1 -0
  20. package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.d.ts +1 -0
  21. package/vscode/src/vs/platform/agentHost/common/resourceReadLogging.js +26 -0
  22. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.d.ts +5 -5
  23. package/vscode/src/vs/platform/agentHost/common/sandboxConfigSchema.js +17 -17
  24. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.d.ts +96 -12
  25. package/vscode/src/vs/platform/agentHost/common/state/agentSubscription.js +226 -19
  26. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.d.ts +18 -0
  27. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-annotations/reducer.js +89 -0
  28. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-changeset/reducer.js +10 -0
  29. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.d.ts +6 -0
  30. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-chat/reducer.js +400 -0
  31. package/vscode/src/vs/platform/agentHost/common/state/protocol/channels-session/reducer.js +129 -446
  32. package/vscode/src/vs/platform/agentHost/common/state/protocol/common/reducer-helpers.d.ts +2 -2
  33. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.d.ts +1 -1
  34. package/vscode/src/vs/platform/agentHost/common/state/protocol/version/registry.js +1 -1
  35. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.d.ts +35 -25
  36. package/vscode/src/vs/platform/agentHost/common/state/sessionActions.js +7 -1
  37. package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.d.ts +4 -0
  38. package/vscode/src/vs/platform/networkFilter/common/networkFilterService.js +1 -1
  39. package/vscode/src/vs/platform/sandbox/browser/sandboxHelperService.js +1 -0
  40. package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.d.ts +0 -6
  41. package/vscode/src/vs/platform/sandbox/common/terminalSandboxCommandRules.js +5 -18
  42. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.d.ts +52 -3
  43. package/vscode/src/vs/platform/sandbox/common/terminalSandboxEngine.js +212 -34
  44. package/vscode/src/vs/platform/sandbox/common/terminalSandboxReadAllowList.js +3 -4
  45. package/vscode/src/vs/platform/sandbox/common/terminalSandboxRuntimeConfigurationPerOperation.js +11 -10
  46. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.d.ts +13 -6
  47. package/vscode/src/vs/platform/sandbox/common/terminalSandboxService.js +6 -1
  48. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.d.ts +2 -0
  49. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution.js +399 -0
  50. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.d.ts +20 -0
  51. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceSessionsPicker.js +85 -0
  52. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.d.ts +177 -0
  53. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidget.js +898 -0
  54. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.d.ts +24 -0
  55. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWidgetBinding.js +204 -0
  56. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.d.ts +61 -0
  57. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService.js +338 -0
  58. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.d.ts +10 -0
  59. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/confirmationComponent.js +57 -0
  60. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.d.ts +33 -0
  61. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/feedbackDialog.js +98 -0
  62. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.d.ts +30 -0
  63. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/headerComponent.js +149 -0
  64. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.d.ts +12 -0
  65. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/onboardingComponent.js +116 -0
  66. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.d.ts +32 -0
  67. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/sessionListComponent.js +226 -0
  68. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.d.ts +18 -0
  69. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/statusRowsComponent.js +138 -0
  70. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.d.ts +26 -0
  71. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/tokens.js +25 -0
  72. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.d.ts +13 -0
  73. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/transcriptComponent.js +108 -0
  74. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.d.ts +13 -0
  75. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/components/voiceBarComponent.js +63 -0
  76. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.d.ts +1 -0
  77. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscripts.contribution.js +178 -0
  78. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.d.ts +47 -0
  79. package/vscode/src/vs/workbench/contrib/agentsVoice/browser/transcriptsView/voiceTranscriptsView.js +322 -0
  80. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.d.ts +15 -0
  81. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoice.js +15 -0
  82. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.d.ts +2 -0
  83. package/vscode/src/vs/workbench/contrib/agentsVoice/common/agentsVoiceColors.js +26 -0
  84. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.d.ts +132 -0
  85. package/vscode/src/vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.js +237 -0
  86. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService.js +2 -2
  87. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.d.ts +2 -2
  88. package/vscode/src/vs/workbench/contrib/chat/browser/accessibility/chatResponseAccessibleView.js +32 -16
  89. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityActions.js +8 -8
  90. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.d.ts +1 -1
  91. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAccessibilityHelp.js +71 -60
  92. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatAgentRecommendationActions.js +1 -1
  93. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatClear.js +6 -1
  94. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCodeblockActions.js +15 -15
  95. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatContextActions.js +8 -8
  96. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatCopyActions.js +7 -7
  97. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatDeveloperActions.js +19 -24
  98. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatFileTreeActions.js +2 -2
  99. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.d.ts +9 -0
  100. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatForkActions.js +14 -5
  101. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatImportExport.js +3 -3
  102. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatLanguageModelActions.js +13 -13
  103. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatMoveActions.js +6 -6
  104. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatNewActions.js +14 -14
  105. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatOpenAgentDebugPanelAction.js +13 -13
  106. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPluginActions.js +66 -52
  107. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatPromptNavigationActions.js +2 -2
  108. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQueueActions.js +15 -36
  109. package/vscode/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.js +8 -8
  110. package/vscode/src/vs/workbench/contrib/chat/browser/actions/codeBlockOperations.js +19 -19
  111. package/vscode/src/vs/workbench/contrib/chat/browser/actions/createPluginAction.js +20 -20
  112. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.d.ts +1 -1
  113. package/vscode/src/vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.js +128 -13
  114. package/vscode/src/vs/workbench/contrib/chat/browser/actions/openCopilotCliStateFileAction.js +6 -6
  115. package/vscode/src/vs/workbench/contrib/chat/browser/actions/reviewEdits.js +1 -1
  116. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginActions.js +10 -10
  117. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditor.js +2 -2
  118. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginEditor/agentPluginEditorInput.js +2 -2
  119. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.d.ts +1 -0
  120. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginRepositoryService.js +58 -9
  121. package/vscode/src/vs/workbench/contrib/chat/browser/agentPluginsView.js +13 -13
  122. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.d.ts +15 -3
  123. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.js +64 -17
  124. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.d.ts +45 -1
  125. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.js +15 -0
  126. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.d.ts +25 -5
  127. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostLocalCustomizations.js +143 -20
  128. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostModeSynchronizer.js +7 -31
  129. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.d.ts +23 -0
  130. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.js +52 -0
  131. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostPermissionUiContribution.js +5 -5
  132. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.d.ts +47 -0
  133. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.js +163 -0
  134. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.d.ts +26 -3
  135. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.js +106 -8
  136. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.d.ts +16 -3
  137. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentHost/syncedCustomizationBundler.js +44 -14
  138. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution.js +3 -3
  139. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsActions.js +70 -59
  140. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsPicker.js +5 -5
  141. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/agentSessionsQuickAccess.js +1 -1
  142. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjection.js +1 -1
  143. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionActions.js +4 -4
  144. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.js +1 -1
  145. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution.js +4 -4
  146. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusWidget.js +22 -22
  147. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccess.js +17 -17
  148. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/experiments/unifiedQuickAccessActions.js +4 -4
  149. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.d.ts +27 -0
  150. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentDisabledInputTipContribution.js +152 -0
  151. package/vscode/src/vs/workbench/contrib/chat/browser/agentSessions/localAgentSessionsController.js +11 -5
  152. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.d.ts +1 -1
  153. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationDebugPanel.js +9 -36
  154. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.d.ts +8 -0
  155. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationIcons.js +17 -15
  156. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.d.ts +143 -0
  157. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource.js +30 -0
  158. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.d.ts +6 -3
  159. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.js +3 -1
  160. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.d.ts +1 -3
  161. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationListWidget.js +107 -126
  162. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution.js +46 -46
  163. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.d.ts +19 -22
  164. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditor.js +244 -190
  165. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.d.ts +2 -0
  166. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagementEditorInput.js +13 -1
  167. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.d.ts +3 -1
  168. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePage.js +7 -2
  169. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.d.ts +5 -1
  170. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWelcomePagePromptLaunchers.js +47 -28
  171. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.d.ts +2 -5
  172. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService.js +4 -8
  173. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.d.ts +87 -0
  174. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/automationsListWidget.js +772 -0
  175. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.d.ts +24 -8
  176. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationCreatorService.js +3 -8
  177. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService.js +1 -7
  178. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedAgentPluginDetail.js +2 -2
  179. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.d.ts +42 -0
  180. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedExtensionToolsDetail.js +130 -0
  181. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/embeddedMcpServerDetail.js +3 -3
  182. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.d.ts +46 -0
  183. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/galleryItemRenderer.js +94 -0
  184. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.d.ts +9 -1
  185. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/mcpListWidget.js +421 -201
  186. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationManagement.css +1424 -97
  187. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/media/aiCustomizationWelcomePromptLaunchers.css +1 -1
  188. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.d.ts +1 -0
  189. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/pluginListWidget.js +107 -127
  190. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.d.ts +29 -0
  191. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/promptsServiceCustomizationItemProvider.js +331 -0
  192. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.d.ts +120 -0
  193. package/vscode/src/vs/workbench/contrib/chat/browser/aiCustomization/toolsListWidget.js +898 -0
  194. package/vscode/src/vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.js +1 -1
  195. package/vscode/src/vs/workbench/contrib/chat/browser/chat.shared.contribution.js +581 -336
  196. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.d.ts +123 -0
  197. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/agentHostChatDebugProvider.js +567 -0
  198. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatCustomizationDiscoveryRenderer.js +32 -32
  199. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheDiff.js +168 -84
  200. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.d.ts +183 -2
  201. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheExplorerView.js +897 -251
  202. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.d.ts +213 -0
  203. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugCacheInsights.js +720 -0
  204. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugDetailPanel.js +6 -6
  205. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEditorInput.js +2 -2
  206. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventDetailRenderer.js +20 -20
  207. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugEventList.js +7 -7
  208. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFilters.js +4 -4
  209. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowChartView.js +7 -7
  210. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugFlowGraph.js +22 -22
  211. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHomeView.js +13 -13
  212. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugHookContentRenderer.js +17 -17
  213. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugLogsView.js +24 -24
  214. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugMessageContentRenderer.js +8 -8
  215. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugModelTurnContentRenderer.js +23 -23
  216. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugOverviewView.js +33 -33
  217. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/chatDebugToolCallContentRenderer.js +11 -11
  218. package/vscode/src/vs/workbench/contrib/chat/browser/chatDebug/media/chatDebug.css +354 -1
  219. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCheckpointTimelineImpl.js +9 -2
  220. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingCodeEditorIntegration.js +1 -1
  221. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingDeletedFileEntry.js +1 -1
  222. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorActions.js +14 -14
  223. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingEditorOverlay.js +7 -7
  224. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.js +3 -3
  225. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationWidget.js +12 -12
  226. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedDocumentEntry.js +11 -4
  227. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedFileEntry.js +1 -1
  228. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingModifiedNotebookEntry.js +1 -1
  229. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl.js +4 -4
  230. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingSession.js +3 -3
  231. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelChangeService.js +1 -1
  232. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/notebook/chatEditingNotebookEditorIntegration.js +1 -1
  233. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.d.ts +9 -3
  234. package/vscode/src/vs/workbench/contrib/chat/browser/chatImageCarouselService.js +55 -8
  235. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagement.contribution.js +8 -8
  236. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatManagementEditorInput.js +2 -2
  237. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.d.ts +18 -1
  238. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/chatModelsWidget.js +192 -87
  239. package/vscode/src/vs/workbench/contrib/chat/browser/chatManagement/media/chatModelsWidget.css +37 -3
  240. package/vscode/src/vs/workbench/contrib/chat/browser/chatOutputItemRenderer.js +4 -4
  241. package/vscode/src/vs/workbench/contrib/chat/browser/chatParticipant.contribution.js +30 -30
  242. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.d.ts +40 -1
  243. package/vscode/src/vs/workbench/contrib/chat/browser/chatQuotaNotification.js +230 -41
  244. package/vscode/src/vs/workbench/contrib/chat/browser/chatRepoInfo.js +2 -2
  245. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.d.ts +30 -0
  246. package/vscode/src/vs/workbench/contrib/chat/browser/chatResponseFileChangesService.js +29 -0
  247. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupContributions.js +23 -25
  248. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupController.js +10 -10
  249. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupGrowthSession.js +6 -6
  250. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupProviders.js +35 -32
  251. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.d.ts +26 -2
  252. package/vscode/src/vs/workbench/contrib/chat/browser/chatSetup/chatSetupRunner.js +56 -32
  253. package/vscode/src/vs/workbench/contrib/chat/browser/chatSlashCommands.js +19 -19
  254. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.d.ts +0 -1
  255. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusDashboard.js +109 -68
  256. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.d.ts +38 -5
  257. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/chatStatusEntry.js +175 -50
  258. package/vscode/src/vs/workbench/contrib/chat/browser/chatStatus/media/chatStatus.css +4 -0
  259. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipCatalog.js +19 -19
  260. package/vscode/src/vs/workbench/contrib/chat/browser/chatTipService.js +2 -2
  261. package/vscode/src/vs/workbench/contrib/chat/browser/chatWindowNotifier.js +4 -4
  262. package/vscode/src/vs/workbench/contrib/chat/browser/claudePluginRecommendations.js +2 -2
  263. package/vscode/src/vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution.js +5 -5
  264. package/vscode/src/vs/workbench/contrib/chat/browser/defaultModelContribution.js +5 -5
  265. package/vscode/src/vs/workbench/contrib/chat/browser/enablementActions.js +4 -4
  266. package/vscode/src/vs/workbench/contrib/chat/browser/enablementStatusWidget.js +2 -2
  267. package/vscode/src/vs/workbench/contrib/chat/browser/languageModelsConfigurationService.js +1 -1
  268. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorActions.js +4 -4
  269. package/vscode/src/vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackEditorContribution.js +5 -5
  270. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.d.ts +4 -5
  271. package/vscode/src/vs/workbench/contrib/chat/browser/pluginAutoUpdate.js +1 -1
  272. package/vscode/src/vs/workbench/contrib/chat/browser/pluginGitCommandService.js +3 -3
  273. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.d.ts +32 -3
  274. package/vscode/src/vs/workbench/contrib/chat/browser/pluginInstallService.js +183 -84
  275. package/vscode/src/vs/workbench/contrib/chat/browser/pluginSources.js +15 -15
  276. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.d.ts +3 -1
  277. package/vscode/src/vs/workbench/contrib/chat/browser/pluginUrlHandler.js +20 -9
  278. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/chatModeActions.js +6 -6
  279. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookActions.js +27 -27
  280. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/hookUtils.js +3 -3
  281. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptCodingAgentActionOverlay.js +2 -2
  282. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.d.ts +1 -0
  283. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolSetsCodeLensProvider.js +109 -0
  284. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptToolsCodeLensProvider.js +2 -2
  285. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/promptUrlHandler.js +8 -8
  286. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/runPromptAction.js +7 -7
  287. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/saveAsPromptFileActions.js +3 -3
  288. package/vscode/src/vs/workbench/contrib/chat/browser/promptSyntax/skillActions.js +3 -3
  289. package/vscode/src/vs/workbench/contrib/chat/browser/promptsDebugContribution.js +20 -20
  290. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.d.ts +17 -0
  291. package/vscode/src/vs/workbench/contrib/chat/browser/tools/clientToolSetsContribution.js +117 -0
  292. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService.js +39 -39
  293. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.d.ts +40 -4
  294. package/vscode/src/vs/workbench/contrib/chat/browser/tools/languageModelToolsService.js +169 -34
  295. package/vscode/src/vs/workbench/contrib/chat/browser/tools/renameTool.js +7 -7
  296. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.d.ts +5 -1
  297. package/vscode/src/vs/workbench/contrib/chat/browser/tools/toolHelpers.js +2 -2
  298. package/vscode/src/vs/workbench/contrib/chat/browser/tools/usagesTool.js +8 -8
  299. package/vscode/src/vs/workbench/contrib/chat/browser/utilityModelContribution.js +2 -2
  300. package/vscode/src/vs/workbench/contrib/chat/browser/viewsWelcome/chatViewsWelcomeHandler.js +5 -5
  301. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.d.ts +125 -0
  302. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.js +399 -0
  303. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.d.ts +34 -0
  304. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.js +198 -0
  305. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.d.ts +85 -0
  306. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceClientService.js +504 -0
  307. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.d.ts +321 -0
  308. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.js +2117 -0
  309. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.d.ts +57 -0
  310. package/vscode/src/vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.js +367 -0
  311. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/chatQueuePickerActionItem.js +16 -12
  312. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.d.ts +2 -0
  313. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/agentHostInputCompletions.js +68 -18
  314. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputCompletions.js +11 -10
  315. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorContrib.js +2 -2
  316. package/vscode/src/vs/workbench/contrib/chat/browser/widget/input/editor/chatInputEditorHover.js +1 -1
  317. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/chatQuick.js +1 -1
  318. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.d.ts +7 -0
  319. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/editor/chatEditor.js +13 -2
  320. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.d.ts +23 -5
  321. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewPane.js +320 -40
  322. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/chatViewTitleControl.js +2 -2
  323. package/vscode/src/vs/workbench/contrib/chat/browser/widgetHosts/viewPane/media/chatViewPane.css +80 -4
  324. package/vscode/src/vs/workbench/contrib/chat/common/automations/automation.d.ts +78 -0
  325. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.d.ts +13 -0
  326. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.d.ts +11 -0
  327. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationDialogService.service.js +6 -0
  328. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.d.ts +16 -0
  329. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationRunner.service.js +6 -0
  330. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.d.ts +46 -0
  331. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.d.ts +36 -0
  332. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationService.service.js +6 -0
  333. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.d.ts +12 -0
  334. package/vscode/src/vs/workbench/contrib/chat/common/automations/automationsEnabled.js +6 -0
  335. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.d.ts +9 -0
  336. package/vscode/src/vs/workbench/contrib/chat/common/automations/schedule.js +6 -0
  337. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.d.ts +2 -0
  338. package/vscode/src/vs/workbench/contrib/chat/common/chatDebugServiceImpl.js +7 -1
  339. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.d.ts +28 -0
  340. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceImpl.js +226 -88
  341. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.d.ts +6 -0
  342. package/vscode/src/vs/workbench/contrib/chat/common/chatService/chatServiceTelemetry.js +8 -3
  343. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionOperationLog.js +13 -2
  344. package/vscode/src/vs/workbench/contrib/chat/common/model/chatSessionStore.js +12 -8
  345. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.d.ts +5 -0
  346. package/vscode/src/vs/workbench/contrib/chat/common/model/objectMutationLog.js +5 -2
  347. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.d.ts +15 -0
  348. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginEnablement.js +177 -0
  349. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.d.ts +2 -18
  350. package/vscode/src/vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl.js +78 -136
  351. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.d.ts +1 -16
  352. package/vscode/src/vs/workbench/contrib/chat/common/plugins/marketplaceReference.js +1 -17
  353. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.d.ts +2 -0
  354. package/vscode/src/vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.js +16 -5
  355. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.d.ts +31 -0
  356. package/vscode/src/vs/workbench/contrib/chat/common/plugins/strictKnownMarketplaces.js +122 -0
  357. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/chatPromptFilesContribution.js +24 -18
  358. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.d.ts +3 -0
  359. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptCodeActions.js +113 -10
  360. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHeaderAutocompletion.js +5 -5
  361. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptHovers.js +12 -12
  362. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.d.ts +10 -0
  363. package/vscode/src/vs/workbench/contrib/chat/common/promptSyntax/languageProviders/promptValidator.js +227 -152
  364. package/vscode/src/vs/workbench/contrib/chat/common/voiceChatService.js +1 -1
  365. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.d.ts +26 -0
  366. package/vscode/src/vs/workbench/contrib/chat/common/voicePlaybackService.js +98 -0
  367. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.d.ts +5 -0
  368. package/vscode/src/vs/workbench/contrib/chat/common/workingDirectory.js +7 -6
  369. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution.js +11 -12
  370. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditor.js +10 -10
  371. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.d.ts +2 -0
  372. package/vscode/src/vs/workbench/contrib/imageCarousel/browser/imageCarouselEditorInput.js +7 -0
  373. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatActions.js +15 -15
  374. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatDefaultModel.js +2 -2
  375. package/vscode/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.js +4 -4
  376. package/vscode/src/vs/workbench/contrib/mcp/browser/mcpPromptArgumentPick.js +14 -14
  377. package/vscode/src/vs/workbench/contrib/notebook/browser/contrib/chat/notebookChatUtils.js +1 -1
  378. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/cellChatActions.js +10 -10
  379. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebook.chat.contribution.js +5 -5
  380. package/vscode/src/vs/workbench/contrib/notebook/browser/controller/chat/notebookChatContext.js +1 -1
  381. package/vscode/src/vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution.js +7 -7
  382. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatAccessibilityHelp.js +16 -16
  383. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.js +32 -20
  384. package/vscode/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatWidget.js +1 -1
  385. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.d.ts +23 -5
  386. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/agentHostSandboxForwarder.js +37 -30
  387. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/basicExecuteStrategy.js +7 -0
  388. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/noneExecuteStrategy.js +7 -0
  389. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/executeStrategy/richExecuteStrategy.js +7 -0
  390. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.d.ts +33 -0
  391. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/largeOutputFileWriter.js +71 -0
  392. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.d.ts +19 -0
  393. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/outputHelpers.js +29 -9
  394. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalHelpers.js +7 -20
  395. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/terminal.chatAgentTools.contribution.js +4 -4
  396. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/toolTerminalCreator.js +2 -1
  397. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/autoApprove/npmScriptAutoApprover.js +1 -1
  398. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineAutoApproveAnalyzer.js +12 -12
  399. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/commandLineAnalyzer/commandLineFileWriteAnalyzer.js +10 -8
  400. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalLastCommandTool.js +3 -3
  401. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalOutputTool.js +4 -4
  402. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/getTerminalSelectionTool.js +3 -3
  403. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/killTerminalTool.js +3 -3
  404. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/monitoring/outputMonitor.js +3 -3
  405. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalConfirmationTool.js +26 -2
  406. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.d.ts +32 -3
  407. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/runInTerminalTool.js +416 -252
  408. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.d.ts +1 -1
  409. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sandboxOutputAnalyzer.js +3 -2
  410. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/sendToTerminalTool.js +10 -10
  411. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/createAndRunTaskTool.js +14 -14
  412. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/getTaskOutputTool.js +7 -7
  413. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/runTaskTool.js +14 -14
  414. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/tools/task/taskHelpers.js +1 -1
  415. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.d.ts +2 -3
  416. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/sandboxSettingsReader.js +5 -5
  417. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.d.ts +6 -2
  418. package/vscode/src/vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService.js +25 -8
  419. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.d.ts +8 -3
  420. package/vscode/src/vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient.js +15 -0
  421. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.d.ts +0 -20
  422. package/vscode/src/vs/workbench/contrib/chat/browser/chatEditing/chatEditingTextModelContentProviders.js +0 -77
  423. package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.d.ts +0 -52
  424. package/vscode/src/vs/workbench/contrib/chat/browser/copilotCliEventsUri.js +0 -82
  425. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.d.ts +0 -38
  426. package/vscode/src/vs/workbench/contrib/chat/common/chatSelectedModel.js +0 -47
  427. /package/vscode/src/vs/{workbench/contrib → platform}/browserView/common/browserChatToolReferenceNames.js +0 -0
@@ -0,0 +1,123 @@
1
+ import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
2
+ import { URI } from "@codingame/monaco-vscode-api/vscode/vs/base/common/uri";
3
+ import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
4
+ import { IFileService } from "@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service";
5
+ import { ILogService } from "@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service";
6
+ import { IAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService.service";
7
+ import { IRemoteAgentHostService } from "@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service";
8
+ import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
9
+ import { IPathService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service";
10
+ import { IChatDebugEvent, IChatDebugResolvedEventContent } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService";
11
+ import { IChatDebugService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service";
12
+ /**
13
+ * One record in an Agent Host Copilot CLI `events.jsonl` stream. The CLI
14
+ * writes a line-delimited JSON log of the session under
15
+ * `~/.copilot/session-state/<id>/events.jsonl`. Every record shares the same
16
+ * envelope. Note that `parentId` is **not** a logical parent: the SDK defines
17
+ * it as the chronologically preceding event in the session (a flat linked chain
18
+ * over every event), not the user → model-turn → tool-call hierarchy. The
19
+ * panel's trajectory tree is instead reconstructed from each record's logical
20
+ * context (turn / tool-call / agent ids); see
21
+ * {@link convertAgentHostEventsToDebugEvents}.
22
+ */
23
+ interface IAgentHostEventRecord {
24
+ readonly type: string;
25
+ readonly id: string;
26
+ readonly parentId: string | null;
27
+ /** Sub-agent instance id; absent for the main agent and session-level events. */
28
+ readonly agentId?: string;
29
+ readonly timestamp: string;
30
+ readonly data: Record<string, unknown>;
31
+ }
32
+ /**
33
+ * Feeds Agent Host (Copilot CLI) sessions into the Agent Debug Logs panel by
34
+ * reading each session's on-disk `events.jsonl` and converting the records
35
+ * into {@link IChatDebugEvent}s. Registers a core-side
36
+ * {@link IChatDebugLogProvider} (the service supports multiple providers
37
+ * alongside the extension's), and adds discovered local sessions to the
38
+ * available-sessions list so they appear in the home view.
39
+ */
40
+ export declare class AgentHostChatDebugContribution extends Disposable implements IWorkbenchContribution {
41
+ private readonly _chatDebugService;
42
+ private readonly _fileService;
43
+ private readonly _pathService;
44
+ private readonly _remoteAgentHostService;
45
+ private readonly _agentHostService;
46
+ private readonly _configurationService;
47
+ private readonly _logService;
48
+ static readonly ID = "workbench.contrib.agentHostChatDebug";
49
+ /** Resolved (expanded) detail for each emitted event id. */
50
+ private readonly _resolved;
51
+ /** Guards against concurrent/overlapping session discovery scans. */
52
+ private _discovering;
53
+ /** Watches the currently-viewed session's events.jsonl for live refresh. */
54
+ private readonly _liveRefresh;
55
+ private _watchedSessionKey;
56
+ constructor(_chatDebugService: IChatDebugService, _fileService: IFileService, _pathService: IPathService, _remoteAgentHostService: IRemoteAgentHostService, _agentHostService: IAgentHostService, _configurationService: IConfigurationService, _logService: ILogService);
57
+ /**
58
+ * Runs {@link _discoverLocalSessions} when file logging is enabled,
59
+ * guarding against overlapping scans. Safe to call repeatedly:
60
+ * {@link IChatDebugService.addAvailableSessionResources} dedupes by URI.
61
+ */
62
+ private _maybeDiscoverLocalSessions;
63
+ private _resolveEventsUri;
64
+ /**
65
+ * Watches the given session's events.jsonl and re-invokes providers when it
66
+ * changes, so the panel updates as new turns/requests stream in. Only one
67
+ * session (the one currently shown) is watched at a time. Remote
68
+ * (non-`file`) sessions are not watched; they still load on open.
69
+ */
70
+ private _ensureLiveRefresh;
71
+ /**
72
+ * Returns the live AHP chat-state subscription for a local Agent Host
73
+ * session, if one is currently active (i.e. the session is open/subscribed).
74
+ * Turns (and their usage) live on the session's default chat channel, so we
75
+ * subscribe to that channel rather than the session. Read-only: never
76
+ * creates a subscription.
77
+ */
78
+ private _sessionChatSubscription;
79
+ /**
80
+ * Reads live Copilot AIU from the AHP session state as a fallback usage
81
+ * source for in-progress sessions (no `session.shutdown` summary yet).
82
+ * Only AIU is reliable live; input/cache need the shutdown summary (F1).
83
+ */
84
+ private _getLiveUsageTotals;
85
+ private _provideChatDebugLog;
86
+ private _discoverLocalSessions;
87
+ }
88
+ /**
89
+ * Converts a parsed `events.jsonl` record stream into debug-panel events plus
90
+ * their expanded detail. Pure (no services) so it can be unit-tested directly.
91
+ *
92
+ * The record `parentId` is **not** a logical parent: the Copilot SDK documents
93
+ * it as "the chronologically preceding event in the session, forming a linked
94
+ * chain" — a flat back-pointer over every event, not the user → model-turn →
95
+ * tool-call hierarchy the panel's flow chart needs. So we reconstruct that
96
+ * hierarchy from each record's logical context as we iterate chronologically:
97
+ * - `session.start` is the tree root.
98
+ * - a `user.message` hangs off the session root.
99
+ * - an `assistant.message` hangs off the current user message (tracked per
100
+ * agent), unless it carries a `parentToolCallId` (a sub-agent turn), in
101
+ * which case it hangs off that spawning tool call.
102
+ * - a `tool.execution_start` hangs off the current assistant message (tracked
103
+ * per agent), unless it carries a `parentToolCallId` (a nested / sub-agent
104
+ * tool), in which case it hangs off that parent tool call.
105
+ * `tool.execution_start` and `tool.execution_complete` records share a
106
+ * `toolCallId` and are merged into a single tool-call event.
107
+ */
108
+ export declare function convertAgentHostEventsToDebugEvents(records: readonly IAgentHostEventRecord[], sessionResource: URI, fallbackUsageTotals?: ISessionUsageTotals): {
109
+ readonly events: IChatDebugEvent[];
110
+ readonly resolved: Map<string, IChatDebugResolvedEventContent>;
111
+ };
112
+ /** Session usage totals distributed across model turns. */
113
+ interface ISessionUsageTotals {
114
+ /** Cumulative input tokens — only set when known from an exact source (`session.shutdown`). */
115
+ readonly inputTokens?: number;
116
+ /** Cumulative cache-read tokens — only set when known from an exact source. */
117
+ readonly cacheReadTokens?: number;
118
+ /** Cumulative Copilot AIU (nano). */
119
+ readonly totalNanoAiu: number;
120
+ }
121
+ /** Parses a line-delimited JSON stream, skipping blank or malformed lines. */
122
+ export declare function parseJsonl(text: string): IAgentHostEventRecord[];
123
+ export {};
@@ -0,0 +1,567 @@
1
+
2
+ import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
3
+ import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
4
+ import { Disposable, MutableDisposable, DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
5
+ import { Schemas } from '@codingame/monaco-vscode-api/vscode/vs/base/common/network';
6
+ import { joinPath } from '@codingame/monaco-vscode-api/vscode/vs/base/common/resources';
7
+ import { URI } from '@codingame/monaco-vscode-api/vscode/vs/base/common/uri';
8
+ import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
9
+ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
10
+ import { IFileService } from '@codingame/monaco-vscode-api/vscode/vs/platform/files/common/files.service';
11
+ import { ILogService } from '@codingame/monaco-vscode-api/vscode/vs/platform/log/common/log.service';
12
+ import { IAgentHostService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentService.service';
13
+ import { agentHostAuthority } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/agentHostUri';
14
+ import { IRemoteAgentHostService } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/remoteAgentHostService.service';
15
+ import { buildDefaultChatUri, StateComponents } from '@codingame/monaco-vscode-api/vscode/vs/platform/agentHost/common/state/sessionState';
16
+ import { IPathService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/path/common/pathService.service';
17
+ import { ChatDebugLogLevel } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService';
18
+ import { IChatDebugService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/chatDebugService.service';
19
+ import { AGENT_DEBUG_LOG_FILE_LOGGING_ENABLED_SETTING } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/chat/common/promptSyntax/promptTypes';
20
+ import { resolveEventsUri, COPILOT_CLI_LOCAL_AH_SCHEME, getCopilotCliSessionRawId, COPILOT_CLI_EH_SCHEME } from '@codingame/monaco-vscode-xterm-addons-common/vscode/vs/workbench/contrib/chat/browser/copilotCliEventsUri';
21
+
22
+ const MAX_DISCOVERED_SESSIONS = 30;
23
+ const TITLE_READ_BYTES = 64 * 1024;
24
+ const MAX_RESOLVED_DETAILS = 50_000;
25
+ const MAX_EVENT_PAYLOAD = 4_000;
26
+ const MAX_DETAIL_PAYLOAD = 100_000;
27
+ let AgentHostChatDebugContribution = class AgentHostChatDebugContribution extends Disposable {
28
+ static {
29
+ this.ID = "workbench.contrib.agentHostChatDebug";
30
+ }
31
+ constructor(
32
+ _chatDebugService,
33
+ _fileService,
34
+ _pathService,
35
+ _remoteAgentHostService,
36
+ _agentHostService,
37
+ _configurationService,
38
+ _logService
39
+ ) {
40
+ super();
41
+ this._chatDebugService = _chatDebugService;
42
+ this._fileService = _fileService;
43
+ this._pathService = _pathService;
44
+ this._remoteAgentHostService = _remoteAgentHostService;
45
+ this._agentHostService = _agentHostService;
46
+ this._configurationService = _configurationService;
47
+ this._logService = _logService;
48
+ this._resolved = ( new Map());
49
+ this._discovering = false;
50
+ this._liveRefresh = this._register(( new MutableDisposable()));
51
+ const provider = {
52
+ provideChatDebugLog: (sessionResource, token) => this._provideChatDebugLog(sessionResource, token),
53
+ resolveChatDebugLogEvent: async eventId => this._resolved.get(eventId)
54
+ };
55
+ this._register(this._chatDebugService.registerProvider(provider));
56
+ this._register(this._chatDebugService.onDidEndSession(sessionResource => {
57
+ if (( sessionResource.toString()) === this._watchedSessionKey) {
58
+ this._liveRefresh.clear();
59
+ this._watchedSessionKey = undefined;
60
+ }
61
+ }));
62
+ this._maybeDiscoverLocalSessions();
63
+ this._register(this._configurationService.onDidChangeConfiguration(e => {
64
+ if (e.affectsConfiguration(AGENT_DEBUG_LOG_FILE_LOGGING_ENABLED_SETTING)) {
65
+ this._maybeDiscoverLocalSessions();
66
+ }
67
+ }));
68
+ }
69
+ async _maybeDiscoverLocalSessions() {
70
+ if (this._discovering || !this._configurationService.getValue(AGENT_DEBUG_LOG_FILE_LOGGING_ENABLED_SETTING)) {
71
+ return;
72
+ }
73
+ this._discovering = true;
74
+ try {
75
+ await this._discoverLocalSessions();
76
+ } catch (err) {
77
+ this._logService.warn(`[AgentHostChatDebug] session discovery failed: ${toErrorMessage(err)}`);
78
+ } finally {
79
+ this._discovering = false;
80
+ }
81
+ }
82
+ _resolveEventsUri(sessionResource) {
83
+ const userHome = this._pathService.userHome({
84
+ preferLocal: true
85
+ });
86
+ const result = resolveEventsUri(
87
+ sessionResource,
88
+ userHome,
89
+ authority => this._remoteAgentHostService.connections.find(c => agentHostAuthority(c.address) === authority)
90
+ );
91
+ return result.kind === "ok" ? result.resource : undefined;
92
+ }
93
+ _ensureLiveRefresh(sessionResource, eventsUri) {
94
+ const key = ( sessionResource.toString());
95
+ if (this._watchedSessionKey === key) {
96
+ return;
97
+ }
98
+ if (eventsUri.scheme !== Schemas.file) {
99
+ this._liveRefresh.clear();
100
+ this._watchedSessionKey = undefined;
101
+ return;
102
+ }
103
+ this._watchedSessionKey = key;
104
+ const store = ( new DisposableStore());
105
+ const scheduler = store.add(( new RunOnceScheduler(() => this._chatDebugService.invokeProviders(sessionResource), 400)));
106
+ const watcher = store.add(this._fileService.createWatcher(eventsUri, {
107
+ recursive: false,
108
+ excludes: []
109
+ }));
110
+ store.add(watcher.onDidChange(e => {
111
+ if (e.affects(eventsUri)) {
112
+ scheduler.schedule();
113
+ }
114
+ }));
115
+ const liveSub = this._sessionChatSubscription(sessionResource);
116
+ if (liveSub) {
117
+ store.add(liveSub.onDidChange(() => scheduler.schedule()));
118
+ }
119
+ this._liveRefresh.value = store;
120
+ }
121
+ _sessionChatSubscription(sessionResource) {
122
+ if (sessionResource.scheme !== COPILOT_CLI_LOCAL_AH_SCHEME) {
123
+ return undefined;
124
+ }
125
+ const rawId = getCopilotCliSessionRawId(sessionResource);
126
+ if (!rawId) {
127
+ return undefined;
128
+ }
129
+ const backendSession = ( URI.from({
130
+ scheme: COPILOT_CLI_EH_SCHEME,
131
+ path: `/${rawId}`
132
+ }));
133
+ const chatUri = ( URI.parse(buildDefaultChatUri(( backendSession.toString()))));
134
+ return this._agentHostService.getSubscriptionUnmanaged(StateComponents.Chat, chatUri);
135
+ }
136
+ _getLiveUsageTotals(sessionResource) {
137
+ const chat = this._sessionChatSubscription(sessionResource)?.value;
138
+ if (!chat || chat instanceof Error) {
139
+ return undefined;
140
+ }
141
+ return sumChatStateUsage(chat);
142
+ }
143
+ async _provideChatDebugLog(sessionResource, token) {
144
+ const eventsUri = this._resolveEventsUri(sessionResource);
145
+ if (!eventsUri) {
146
+ return undefined;
147
+ }
148
+ let text;
149
+ try {
150
+ const content = await this._fileService.readFile(eventsUri);
151
+ text = ( content.value.toString());
152
+ } catch {
153
+ return undefined;
154
+ }
155
+ if (token.isCancellationRequested) {
156
+ return undefined;
157
+ }
158
+ this._ensureLiveRefresh(sessionResource, eventsUri);
159
+ const liveUsageTotals = this._getLiveUsageTotals(sessionResource);
160
+ const {
161
+ events,
162
+ resolved
163
+ } = convertAgentHostEventsToDebugEvents(parseJsonl(text), sessionResource, liveUsageTotals);
164
+ for (const [id, detail] of resolved) {
165
+ this._resolved.set(id, detail);
166
+ if (this._resolved.size > MAX_RESOLVED_DETAILS) {
167
+ const first = ( this._resolved.keys()).next().value;
168
+ if (first !== undefined) {
169
+ this._resolved.delete(first);
170
+ }
171
+ }
172
+ }
173
+ return events;
174
+ }
175
+ async _discoverLocalSessions() {
176
+ const userHome = this._pathService.userHome({
177
+ preferLocal: true
178
+ });
179
+ const sessionStateDir = joinPath(userHome, ".copilot", "session-state");
180
+ let stat;
181
+ try {
182
+ stat = await this._fileService.resolve(sessionStateDir, {
183
+ resolveMetadata: true
184
+ });
185
+ } catch {
186
+ return;
187
+ }
188
+ const folders = (stat.children ?? []).filter(child => child.isDirectory).sort((a, b) => b.mtime - a.mtime).slice(0, MAX_DISCOVERED_SESSIONS);
189
+ const found = await Promise.all(( folders.map(async folder => {
190
+ const eventsUri = joinPath(folder.resource, "events.jsonl");
191
+ let title;
192
+ try {
193
+ const head = await this._fileService.readFile(eventsUri, {
194
+ length: TITLE_READ_BYTES
195
+ });
196
+ title = extractSessionTitle(( head.value.toString())) ?? fallbackSessionTitle(folder.name);
197
+ } catch {
198
+ return undefined;
199
+ }
200
+ return {
201
+ uri: ( URI.from({
202
+ scheme: COPILOT_CLI_LOCAL_AH_SCHEME,
203
+ path: `/${folder.name}`
204
+ })),
205
+ title
206
+ };
207
+ })));
208
+ const sessions = found.filter(s => s !== undefined);
209
+ if (sessions.length > 0) {
210
+ this._chatDebugService.addAvailableSessionResources(sessions);
211
+ }
212
+ }
213
+ };
214
+ AgentHostChatDebugContribution = ( __decorate([( __param(0, IChatDebugService)), ( __param(1, IFileService)), ( __param(2, IPathService)), ( __param(3, IRemoteAgentHostService)), ( __param(4, IAgentHostService)), ( __param(5, IConfigurationService)), ( __param(6, ILogService))], AgentHostChatDebugContribution));
215
+ function convertAgentHostEventsToDebugEvents(records, sessionResource, fallbackUsageTotals) {
216
+ const completeByToolCallId = ( new Map());
217
+ const turnStartByTurnId = ( new Map());
218
+ for (const record of records) {
219
+ if (record.type === "tool.execution_complete") {
220
+ const toolCallId = asString(record.data.toolCallId);
221
+ if (toolCallId) {
222
+ completeByToolCallId.set(toolCallId, record);
223
+ }
224
+ } else if (record.type === "assistant.turn_start") {
225
+ const turnId = asString(record.data.turnId);
226
+ if (turnId) {
227
+ turnStartByTurnId.set(turnId, record);
228
+ }
229
+ }
230
+ }
231
+ const events = [];
232
+ const resolved = ( new Map());
233
+ const modelTurnRefs = [];
234
+ let rootEventId;
235
+ const currentUserMessageByAgent = ( new Map());
236
+ const currentAssistantMessageByAgent = ( new Map());
237
+ const toolEventByToolCallId = ( new Map());
238
+ for (const record of records) {
239
+ const created = ( new Date(record.timestamp));
240
+ const agentKey = record.agentId ?? "";
241
+ switch (record.type) {
242
+ case "session.start":
243
+ {
244
+ rootEventId = record.id;
245
+ const model = asString(record.data.selectedModel);
246
+ const effort = asString(record.data.reasoningEffort);
247
+ const details = model ? (effort ? ( localize(6516, "model={0}, reasoningEffort={1}", model, effort)) : ( localize(6517, "model={0}", model))) : undefined;
248
+ events.push({
249
+ kind: "generic",
250
+ id: record.id,
251
+ sessionResource,
252
+ created,
253
+ parentEventId: undefined,
254
+ name: ( localize(6518, "Session Started")),
255
+ details,
256
+ level: ChatDebugLogLevel.Info,
257
+ category: "session"
258
+ });
259
+ break;
260
+ }
261
+ case "user.message":
262
+ {
263
+ const content = asString(record.data.content) ?? "";
264
+ const transformed = asString(record.data.transformedContent);
265
+ const sections = [{
266
+ name: ( localize(6519, "User Request")),
267
+ content
268
+ }];
269
+ if (transformed && transformed !== content) {
270
+ sections.push({
271
+ name: ( localize(6520, "Full Prompt")),
272
+ content: transformed
273
+ });
274
+ }
275
+ const message = summarize(content);
276
+ currentUserMessageByAgent.set(agentKey, record.id);
277
+ currentAssistantMessageByAgent.delete(agentKey);
278
+ events.push({
279
+ kind: "userMessage",
280
+ id: record.id,
281
+ sessionResource,
282
+ created,
283
+ parentEventId: rootEventId,
284
+ message,
285
+ sections
286
+ });
287
+ resolved.set(record.id, {
288
+ kind: "message",
289
+ type: "user",
290
+ message,
291
+ sections
292
+ });
293
+ break;
294
+ }
295
+ case "assistant.message":
296
+ {
297
+ const model = asString(record.data.model);
298
+ const outputTokens = asNumber(record.data.outputTokens);
299
+ const content = asString(record.data.content) ?? "";
300
+ const reasoning = asString(record.data.reasoningText);
301
+ const parentToolCallId = asString(record.data.parentToolCallId);
302
+ const spawningTool = parentToolCallId ? toolEventByToolCallId.get(parentToolCallId) : undefined;
303
+ const parentEventId = spawningTool ?? currentUserMessageByAgent.get(agentKey) ?? rootEventId;
304
+ const turnId = asString(record.data.turnId);
305
+ const turnStart = turnId ? turnStartByTurnId.get(turnId) : undefined;
306
+ const durationInMillis = turnStart ? diffMillis(turnStart.timestamp, record.timestamp) : undefined;
307
+ currentAssistantMessageByAgent.set(agentKey, record.id);
308
+ modelTurnRefs.push({
309
+ index: events.length,
310
+ id: record.id,
311
+ outputTokens
312
+ });
313
+ events.push({
314
+ kind: "modelTurn",
315
+ id: record.id,
316
+ sessionResource,
317
+ created,
318
+ parentEventId,
319
+ model,
320
+ requestName: "copilotcli",
321
+ outputTokens,
322
+ durationInMillis
323
+ });
324
+ const sections = [];
325
+ if (content) {
326
+ sections.push({
327
+ name: ( localize(6521, "Response")),
328
+ content
329
+ });
330
+ }
331
+ if (reasoning) {
332
+ sections.push({
333
+ name: ( localize(6522, "Reasoning")),
334
+ content: reasoning
335
+ });
336
+ }
337
+ resolved.set(record.id, {
338
+ kind: "modelTurn",
339
+ requestName: "copilotcli",
340
+ model,
341
+ outputTokens,
342
+ durationInMillis,
343
+ sections
344
+ });
345
+ break;
346
+ }
347
+ case "tool.execution_start":
348
+ {
349
+ const toolName = asString(record.data.toolName) ?? "tool";
350
+ const toolCallId = asString(record.data.toolCallId);
351
+ const complete = toolCallId ? completeByToolCallId.get(toolCallId) : undefined;
352
+ const success = complete ? asBoolean(complete.data.success) : undefined;
353
+ const result = success === undefined ? undefined : (success ? "success" : "error");
354
+ const durationInMillis = complete ? diffMillis(record.timestamp, complete.timestamp) : undefined;
355
+ const fullInput = stringifyPayload(record.data.arguments);
356
+ const fullOutput = complete ? stringifyPayload(complete.data.result) : undefined;
357
+ const parentToolCallId = asString(record.data.parentToolCallId);
358
+ const parentTool = parentToolCallId ? toolEventByToolCallId.get(parentToolCallId) : undefined;
359
+ const parentEventId = parentTool ?? currentAssistantMessageByAgent.get(agentKey) ?? currentUserMessageByAgent.get(agentKey) ?? rootEventId;
360
+ if (toolCallId) {
361
+ toolEventByToolCallId.set(toolCallId, record.id);
362
+ }
363
+ events.push({
364
+ kind: "toolCall",
365
+ id: record.id,
366
+ sessionResource,
367
+ created,
368
+ parentEventId,
369
+ toolName,
370
+ toolCallId,
371
+ result,
372
+ durationInMillis,
373
+ input: truncate(fullInput, MAX_EVENT_PAYLOAD),
374
+ output: truncate(fullOutput, MAX_EVENT_PAYLOAD)
375
+ });
376
+ resolved.set(record.id, {
377
+ kind: "toolCall",
378
+ toolName,
379
+ result,
380
+ durationInMillis,
381
+ input: truncate(fullInput, MAX_DETAIL_PAYLOAD),
382
+ output: truncate(fullOutput, MAX_DETAIL_PAYLOAD)
383
+ });
384
+ break;
385
+ }
386
+ }
387
+ }
388
+ const totals = extractSessionUsageTotals(records) ?? fallbackUsageTotals;
389
+ if (totals && modelTurnRefs.length > 0) {
390
+ const n = modelTurnRefs.length;
391
+ const inputs = totals.inputTokens !== undefined ? distributeEvenly(totals.inputTokens, n) : undefined;
392
+ const cached = totals.cacheReadTokens !== undefined ? distributeEvenly(totals.cacheReadTokens, n) : undefined;
393
+ const aiu = distributeEvenly(totals.totalNanoAiu, n);
394
+ for (let i = 0; i < n; i++) {
395
+ const ref = modelTurnRefs[i];
396
+ const turn = events[ref.index];
397
+ const inputTokens = inputs?.[i];
398
+ const cachedTokens = cached?.[i];
399
+ const totalTokens = inputTokens !== undefined ? inputTokens + (ref.outputTokens ?? 0) : undefined;
400
+ const copilotUsageNanoAiu = aiu[i] > 0 ? aiu[i] : undefined;
401
+ events[ref.index] = {
402
+ ...turn,
403
+ inputTokens,
404
+ cachedTokens,
405
+ totalTokens,
406
+ copilotUsageNanoAiu
407
+ };
408
+ const detail = resolved.get(ref.id);
409
+ if (detail?.kind === "modelTurn") {
410
+ resolved.set(ref.id, {
411
+ ...detail,
412
+ inputTokens,
413
+ cachedTokens,
414
+ totalTokens
415
+ });
416
+ }
417
+ }
418
+ }
419
+ return {
420
+ events,
421
+ resolved
422
+ };
423
+ }
424
+ function extractSessionUsageTotals(records) {
425
+ let shutdown;
426
+ for (const record of records) {
427
+ if (record.type === "session.shutdown") {
428
+ shutdown = record;
429
+ }
430
+ }
431
+ if (!shutdown) {
432
+ return undefined;
433
+ }
434
+ let inputTokens = 0;
435
+ let cacheReadTokens = 0;
436
+ let perModelNanoAiu = 0;
437
+ const modelMetrics = shutdown.data.modelMetrics;
438
+ if (modelMetrics && typeof modelMetrics === "object") {
439
+ for (const metric of ( Object.values(modelMetrics))) {
440
+ const entry = metric;
441
+ const usage = entry?.usage;
442
+ inputTokens += asNumber(usage?.inputTokens) ?? 0;
443
+ cacheReadTokens += asNumber(usage?.cacheReadTokens) ?? 0;
444
+ perModelNanoAiu += asNumber(entry?.totalNanoAiu) ?? 0;
445
+ }
446
+ }
447
+ const totalNanoAiu = asNumber(shutdown.data.totalNanoAiu) ?? perModelNanoAiu;
448
+ return {
449
+ inputTokens,
450
+ cacheReadTokens,
451
+ totalNanoAiu
452
+ };
453
+ }
454
+ function distributeEvenly(total, n) {
455
+ if (n <= 0) {
456
+ return [];
457
+ }
458
+ const base = Math.floor(total / n);
459
+ const parts = ( new Array(n)).fill(base);
460
+ let remainder = total - base * n;
461
+ for (let i = n - 1; remainder > 0; i--, remainder--) {
462
+ parts[i] += 1;
463
+ }
464
+ return parts;
465
+ }
466
+ function sumChatStateUsage(chat) {
467
+ let totalNanoAiu = 0;
468
+ let hasUsage = false;
469
+ const add = usage => {
470
+ if (!usage) {
471
+ return;
472
+ }
473
+ hasUsage = true;
474
+ totalNanoAiu += readCopilotNanoAiu(usage);
475
+ };
476
+ for (const turn of chat.turns) {
477
+ add(turn.usage);
478
+ }
479
+ add(chat.activeTurn?.usage);
480
+ return hasUsage ? {
481
+ totalNanoAiu
482
+ } : undefined;
483
+ }
484
+ function readCopilotNanoAiu(usage) {
485
+ const meta = usage._meta;
486
+ if (!meta || typeof meta !== "object") {
487
+ return 0;
488
+ }
489
+ const copilotUsage = meta.copilotUsage;
490
+ if (!copilotUsage || typeof copilotUsage !== "object") {
491
+ return 0;
492
+ }
493
+ const nano = copilotUsage.totalNanoAiu;
494
+ return typeof nano === "number" ? nano : 0;
495
+ }
496
+ function parseJsonl(text) {
497
+ const records = [];
498
+ for (const line of text.split("\n")) {
499
+ const trimmed = line.trim();
500
+ if (!trimmed) {
501
+ continue;
502
+ }
503
+ try {
504
+ const parsed = JSON.parse(trimmed);
505
+ if (parsed && typeof parsed.type === "string" && typeof parsed.id === "string" && typeof parsed.timestamp === "string" && (parsed.parentId === null || typeof parsed.parentId === "string") && parsed.data && typeof parsed.data === "object" && !Array.isArray(parsed.data)) {
506
+ records.push(parsed);
507
+ }
508
+ } catch {}
509
+ }
510
+ return records;
511
+ }
512
+ function fallbackSessionTitle(sessionId) {
513
+ return localize(6523, "Copilot CLI Session {0}", sessionId.slice(0, 8));
514
+ }
515
+ function extractSessionTitle(text) {
516
+ for (const record of parseJsonl(text)) {
517
+ if (record.type === "user.message") {
518
+ const content = asString(record.data.content);
519
+ if (content) {
520
+ return summarize(content);
521
+ }
522
+ }
523
+ }
524
+ return undefined;
525
+ }
526
+ function asString(value) {
527
+ return typeof value === "string" ? value : undefined;
528
+ }
529
+ function asNumber(value) {
530
+ return typeof value === "number" && isFinite(value) ? value : undefined;
531
+ }
532
+ function asBoolean(value) {
533
+ return typeof value === "boolean" ? value : undefined;
534
+ }
535
+ function diffMillis(start, end) {
536
+ const a = ( new Date(start)).getTime();
537
+ const b = ( new Date(end)).getTime();
538
+ return isFinite(a) && isFinite(b) && b >= a ? b - a : undefined;
539
+ }
540
+ function stringifyPayload(value) {
541
+ if (value === undefined || value === null) {
542
+ return undefined;
543
+ }
544
+ if (typeof value === "string") {
545
+ return value;
546
+ }
547
+ try {
548
+ return JSON.stringify(value, undefined, 2);
549
+ } catch {
550
+ return undefined;
551
+ }
552
+ }
553
+ function truncate(value, max) {
554
+ if (value === undefined) {
555
+ return undefined;
556
+ }
557
+ return value.length > max ? value.slice(0, max) + "…" : value;
558
+ }
559
+ function summarize(content) {
560
+ const firstLine = ( content.split("\n").map(l => l.trim())).find(l => l.length > 0) ?? "";
561
+ return firstLine.length > 100 ? firstLine.slice(0, 100) + "…" : firstLine;
562
+ }
563
+ function toErrorMessage(err) {
564
+ return err instanceof Error ? err.message : String(err);
565
+ }
566
+
567
+ export { AgentHostChatDebugContribution, convertAgentHostEventsToDebugEvents, parseJsonl };