ummaya 0.2.14 → 0.2.15

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 (564) hide show
  1. package/npm-shrinkwrap.json +2 -2
  2. package/package.json +7 -4
  3. package/pyproject.toml +2 -2
  4. package/tui/package.json +1 -1
  5. package/tui/src/buddy/CompanionSprite.tsx +1 -2
  6. package/tui/src/buddy/useBuddyNotification.tsx +1 -2
  7. package/tui/src/cli/controlAuth.ts +20 -0
  8. package/tui/src/cli/handlers/auth.ts +7 -7
  9. package/tui/src/cli/handlers/mcp.tsx +0 -1
  10. package/tui/src/cli/handlers/util.tsx +2 -3
  11. package/tui/src/cli/print.ts +7 -4
  12. package/tui/src/commands/add-dir/add-dir.tsx +1 -2
  13. package/tui/src/commands/agents/agents.tsx +1 -2
  14. package/tui/src/commands/bridge/bridge.tsx +1 -2
  15. package/tui/src/commands/btw/btw.tsx +1 -2
  16. package/tui/src/commands/config/config.tsx +1 -2
  17. package/tui/src/commands/context/context.tsx +1 -2
  18. package/tui/src/commands/copy/copy.tsx +1 -2
  19. package/tui/src/commands/desktop/desktop.tsx +1 -2
  20. package/tui/src/commands/diff/diff.tsx +1 -2
  21. package/tui/src/commands/doctor/doctor.tsx +1 -2
  22. package/tui/src/commands/effort/effort.tsx +1 -2
  23. package/tui/src/commands/exit/exit.tsx +1 -2
  24. package/tui/src/commands/export/export.tsx +1 -2
  25. package/tui/src/commands/extra-usage/extra-usage.tsx +1 -2
  26. package/tui/src/commands/fast/fast.tsx +0 -1
  27. package/tui/src/commands/feedback/feedback.tsx +1 -2
  28. package/tui/src/commands/help/help.tsx +1 -2
  29. package/tui/src/commands/hooks/hooks.tsx +1 -2
  30. package/tui/src/commands/ide/ide.tsx +0 -1
  31. package/tui/src/commands/install.tsx +0 -1
  32. package/tui/src/commands/login/login.tsx +1 -2
  33. package/tui/src/commands/logout/logout.tsx +0 -1
  34. package/tui/src/commands/mcp/mcp.tsx +1 -2
  35. package/tui/src/commands/memory/memory.tsx +0 -1
  36. package/tui/src/commands/mobile/mobile.tsx +0 -1
  37. package/tui/src/commands/model/model.tsx +0 -1
  38. package/tui/src/commands/output-style/output-style.tsx +1 -2
  39. package/tui/src/commands/passes/passes.tsx +1 -2
  40. package/tui/src/commands/permissions/permissions.tsx +1 -2
  41. package/tui/src/commands/plan/plan.tsx +1 -2
  42. package/tui/src/commands/plugin/AddMarketplace.tsx +1 -2
  43. package/tui/src/commands/plugin/BrowseMarketplace.tsx +1 -2
  44. package/tui/src/commands/plugin/DiscoverPlugins.tsx +0 -1
  45. package/tui/src/commands/plugin/ManageMarketplaces.tsx +0 -1
  46. package/tui/src/commands/plugin/ManagePlugins.tsx +1 -2
  47. package/tui/src/commands/plugin/PluginErrors.tsx +1 -2
  48. package/tui/src/commands/plugin/PluginOptionsDialog.tsx +1 -2
  49. package/tui/src/commands/plugin/PluginOptionsFlow.tsx +1 -2
  50. package/tui/src/commands/plugin/PluginSettings.tsx +1 -2
  51. package/tui/src/commands/plugin/PluginTrustWarning.tsx +0 -1
  52. package/tui/src/commands/plugin/UnifiedInstalledCell.tsx +1 -2
  53. package/tui/src/commands/plugin/ValidatePlugin.tsx +1 -2
  54. package/tui/src/commands/plugin/index.tsx +0 -1
  55. package/tui/src/commands/plugin/plugin.tsx +1 -2
  56. package/tui/src/commands/plugin/pluginDetailsHelpers.tsx +1 -2
  57. package/tui/src/commands/privacy-settings/privacy-settings.tsx +0 -1
  58. package/tui/src/commands/rate-limit-options/rate-limit-options.tsx +1 -2
  59. package/tui/src/commands/remote-env/remote-env.tsx +1 -2
  60. package/tui/src/commands/remote-setup/remote-setup.tsx +0 -1
  61. package/tui/src/commands/resume/resume.tsx +1 -2
  62. package/tui/src/commands/review/UltrareviewOverageDialog.tsx +1 -2
  63. package/tui/src/commands/review/ultrareviewCommand.tsx +0 -1
  64. package/tui/src/commands/sandbox-toggle/sandbox-toggle.tsx +1 -2
  65. package/tui/src/commands/session/session.tsx +0 -1
  66. package/tui/src/commands/skills/skills.tsx +1 -2
  67. package/tui/src/commands/stats/stats.tsx +1 -2
  68. package/tui/src/commands/status/status.tsx +1 -2
  69. package/tui/src/commands/statusline.tsx +0 -1
  70. package/tui/src/commands/tag/tag.tsx +1 -2
  71. package/tui/src/commands/tasks/tasks.tsx +1 -2
  72. package/tui/src/commands/terminalSetup/terminalSetup.tsx +1 -2
  73. package/tui/src/commands/theme/theme.tsx +1 -2
  74. package/tui/src/commands/thinkback/thinkback.tsx +0 -1
  75. package/tui/src/commands/ultraplan.tsx +0 -1
  76. package/tui/src/commands/usage/usage.tsx +1 -2
  77. package/tui/src/commands/voice/voice.ts +2 -2
  78. package/tui/src/components/AgentProgressLine.tsx +1 -2
  79. package/tui/src/components/App.tsx +1 -2
  80. package/tui/src/components/ApproveApiKey.tsx +1 -2
  81. package/tui/src/components/AutoModeOptInDialog.tsx +0 -1
  82. package/tui/src/components/AutoUpdater.tsx +1 -2
  83. package/tui/src/components/AutoUpdaterWrapper.tsx +1 -2
  84. package/tui/src/components/AwsAuthStatusBox.tsx +1 -2
  85. package/tui/src/components/BaseTextInput.tsx +0 -1
  86. package/tui/src/components/BashModeProgress.tsx +1 -2
  87. package/tui/src/components/BridgeDialog.tsx +1 -2
  88. package/tui/src/components/BypassPermissionsModeDialog.tsx +0 -1
  89. package/tui/src/components/ChannelDowngradeDialog.tsx +1 -2
  90. package/tui/src/components/ClaudeCodeHint/PluginHintMenu.tsx +1 -2
  91. package/tui/src/components/ClaudeMdExternalIncludesDialog.tsx +0 -1
  92. package/tui/src/components/ClickableImageRef.tsx +1 -2
  93. package/tui/src/components/CompactSummary.tsx +1 -2
  94. package/tui/src/components/ConfigurableShortcutHint.tsx +1 -2
  95. package/tui/src/components/ContextSuggestions.tsx +1 -2
  96. package/tui/src/components/ContextVisualization.tsx +1 -2
  97. package/tui/src/components/CoordinatorAgentStatus.tsx +1 -2
  98. package/tui/src/components/CostThresholdDialog.tsx +0 -1
  99. package/tui/src/components/CtrlOToExpand.tsx +1 -2
  100. package/tui/src/components/CustomSelect/SelectMulti.tsx +1 -2
  101. package/tui/src/components/CustomSelect/select-input-option.tsx +1 -2
  102. package/tui/src/components/CustomSelect/select-option.tsx +1 -2
  103. package/tui/src/components/CustomSelect/select.tsx +1 -2
  104. package/tui/src/components/DesktopHandoff.tsx +0 -1
  105. package/tui/src/components/DesktopUpsell/DesktopUpsellStartup.tsx +0 -1
  106. package/tui/src/components/DevBar.tsx +1 -2
  107. package/tui/src/components/DevChannelsDialog.tsx +1 -2
  108. package/tui/src/components/DiagnosticsDisplay.tsx +1 -2
  109. package/tui/src/components/EffortCallout.tsx +1 -2
  110. package/tui/src/components/ExitFlow.tsx +1 -2
  111. package/tui/src/components/ExportDialog.tsx +1 -2
  112. package/tui/src/components/FallbackToolUseErrorMessage.tsx +0 -1
  113. package/tui/src/components/FallbackToolUseRejectedMessage.tsx +1 -2
  114. package/tui/src/components/FastIcon.tsx +1 -2
  115. package/tui/src/components/Feedback.tsx +0 -1
  116. package/tui/src/components/FeedbackSurvey/FeedbackSurvey.tsx +1 -2
  117. package/tui/src/components/FeedbackSurvey/FeedbackSurveyView.tsx +0 -1
  118. package/tui/src/components/FeedbackSurvey/TranscriptSharePrompt.tsx +0 -1
  119. package/tui/src/components/FeedbackSurvey/useFeedbackSurvey.tsx +0 -1
  120. package/tui/src/components/FeedbackSurvey/useMemorySurvey.tsx +0 -1
  121. package/tui/src/components/FeedbackSurvey/usePostCompactSurvey.tsx +0 -1
  122. package/tui/src/components/FeedbackSurvey/useSurveyState.tsx +1 -2
  123. package/tui/src/components/FileEditToolDiff.tsx +1 -2
  124. package/tui/src/components/FileEditToolUpdatedMessage.tsx +1 -2
  125. package/tui/src/components/FileEditToolUseRejectedMessage.tsx +1 -2
  126. package/tui/src/components/FilePathLink.tsx +1 -2
  127. package/tui/src/components/FullscreenLayout.tsx +1 -2
  128. package/tui/src/components/GlobalSearchDialog.tsx +1 -2
  129. package/tui/src/components/HelpV2/Commands.tsx +1 -2
  130. package/tui/src/components/HelpV2/General.tsx +0 -1
  131. package/tui/src/components/HelpV2/HelpV2.tsx +0 -1
  132. package/tui/src/components/HighlightedCode/Fallback.tsx +1 -2
  133. package/tui/src/components/HighlightedCode.tsx +1 -2
  134. package/tui/src/components/HistorySearchDialog.tsx +1 -2
  135. package/tui/src/components/IdeAutoConnectDialog.tsx +1 -2
  136. package/tui/src/components/IdeOnboardingDialog.tsx +0 -1
  137. package/tui/src/components/IdeStatusIndicator.tsx +1 -2
  138. package/tui/src/components/IdleReturnDialog.tsx +1 -2
  139. package/tui/src/components/InterruptedByUser.tsx +0 -1
  140. package/tui/src/components/InvalidConfigDialog.tsx +1 -2
  141. package/tui/src/components/InvalidSettingsDialog.tsx +1 -2
  142. package/tui/src/components/KeybindingWarnings.tsx +1 -2
  143. package/tui/src/components/LanguagePicker.tsx +1 -2
  144. package/tui/src/components/LogSelector.tsx +0 -1
  145. package/tui/src/components/LogoV2/AnimatedAsterisk.tsx +1 -2
  146. package/tui/src/components/LogoV2/AnimatedClawd.tsx +1 -2
  147. package/tui/src/components/LogoV2/ChannelsNotice.tsx +0 -1
  148. package/tui/src/components/LogoV2/Clawd.tsx +1 -2
  149. package/tui/src/components/LogoV2/CondensedLogo.tsx +0 -1
  150. package/tui/src/components/LogoV2/EmergencyTip.tsx +0 -1
  151. package/tui/src/components/LogoV2/Feed.tsx +1 -2
  152. package/tui/src/components/LogoV2/FeedColumn.tsx +1 -2
  153. package/tui/src/components/LogoV2/GuestPassesUpsell.tsx +0 -1
  154. package/tui/src/components/LogoV2/LogoV2.tsx +0 -1
  155. package/tui/src/components/LogoV2/Opus1mMergeNotice.tsx +1 -2
  156. package/tui/src/components/LogoV2/OverageCreditUpsell.tsx +1 -2
  157. package/tui/src/components/LogoV2/VoiceModeNotice.tsx +1 -2
  158. package/tui/src/components/LogoV2/feedConfigs.tsx +0 -1
  159. package/tui/src/components/LspRecommendation/LspRecommendationMenu.tsx +1 -2
  160. package/tui/src/components/MCPServerApprovalDialog.tsx +1 -2
  161. package/tui/src/components/MCPServerDesktopImportDialog.tsx +0 -1
  162. package/tui/src/components/MCPServerDialogCopy.tsx +0 -1
  163. package/tui/src/components/MCPServerMultiselectDialog.tsx +1 -2
  164. package/tui/src/components/ManagedSettingsSecurityDialog/ManagedSettingsSecurityDialog.tsx +0 -1
  165. package/tui/src/components/Markdown.tsx +1 -2
  166. package/tui/src/components/MarkdownTable.tsx +1 -2
  167. package/tui/src/components/MemoryUsageIndicator.tsx +1 -2
  168. package/tui/src/components/Message.tsx +1 -2
  169. package/tui/src/components/MessageModel.tsx +1 -2
  170. package/tui/src/components/MessageResponse.tsx +1 -2
  171. package/tui/src/components/MessageRow.tsx +1 -2
  172. package/tui/src/components/MessageSelector.tsx +1 -2
  173. package/tui/src/components/MessageTimestamp.tsx +1 -2
  174. package/tui/src/components/Messages.tsx +0 -1
  175. package/tui/src/components/ModelPicker.tsx +0 -1
  176. package/tui/src/components/NativeAutoUpdater.tsx +1 -2
  177. package/tui/src/components/NotebookEditToolUseRejectedMessage.tsx +1 -2
  178. package/tui/src/components/OffscreenFreeze.tsx +1 -2
  179. package/tui/src/components/Onboarding.tsx +2 -3
  180. package/tui/src/components/OutputStylePicker.tsx +0 -1
  181. package/tui/src/components/PackageManagerAutoUpdater.tsx +0 -1
  182. package/tui/src/components/Passes/Passes.tsx +0 -1
  183. package/tui/src/components/PrBadge.tsx +1 -2
  184. package/tui/src/components/PressEnterToContinue.tsx +1 -2
  185. package/tui/src/components/PromptInput/HistorySearchInput.tsx +1 -2
  186. package/tui/src/components/PromptInput/IssueFlagBanner.tsx +1 -2
  187. package/tui/src/components/PromptInput/Notifications.tsx +1 -2
  188. package/tui/src/components/PromptInput/PromptInput.tsx +0 -1
  189. package/tui/src/components/PromptInput/PromptInputFooter.tsx +1 -2
  190. package/tui/src/components/PromptInput/PromptInputFooterLeftSide.tsx +1 -2
  191. package/tui/src/components/PromptInput/PromptInputFooterSuggestions.tsx +1 -2
  192. package/tui/src/components/PromptInput/PromptInputHelpMenu.tsx +1 -2
  193. package/tui/src/components/PromptInput/PromptInputModeIndicator.tsx +1 -2
  194. package/tui/src/components/PromptInput/PromptInputQueuedCommands.tsx +1 -2
  195. package/tui/src/components/PromptInput/PromptInputStashNotice.tsx +1 -2
  196. package/tui/src/components/PromptInput/SandboxPromptFooterHint.tsx +1 -2
  197. package/tui/src/components/PromptInput/ShimmeredInput.tsx +1 -2
  198. package/tui/src/components/PromptInput/VoiceIndicator.tsx +1 -2
  199. package/tui/src/components/QuickOpenDialog.tsx +1 -2
  200. package/tui/src/components/RemoteCallout.tsx +0 -1
  201. package/tui/src/components/RemoteEnvironmentDialog.tsx +0 -1
  202. package/tui/src/components/ResumeTask.tsx +0 -1
  203. package/tui/src/components/SandboxViolationExpandedView.tsx +1 -2
  204. package/tui/src/components/ScrollKeybindingHandler.tsx +0 -1
  205. package/tui/src/components/SearchBox.tsx +1 -2
  206. package/tui/src/components/SessionBackgroundHint.tsx +1 -2
  207. package/tui/src/components/SessionPreview.tsx +1 -2
  208. package/tui/src/components/Settings/Config.tsx +0 -1
  209. package/tui/src/components/Settings/Settings.tsx +1 -2
  210. package/tui/src/components/Settings/Status.tsx +1 -2
  211. package/tui/src/components/Settings/Usage.tsx +1 -2
  212. package/tui/src/components/ShowInIDEPrompt.tsx +1 -2
  213. package/tui/src/components/SkillImprovementSurvey.tsx +1 -2
  214. package/tui/src/components/Spinner/FlashingChar.tsx +1 -2
  215. package/tui/src/components/Spinner/GlimmerMessage.tsx +1 -2
  216. package/tui/src/components/Spinner/ShimmerChar.tsx +1 -2
  217. package/tui/src/components/Spinner/SpinnerAnimationRow.tsx +1 -2
  218. package/tui/src/components/Spinner/SpinnerGlyph.tsx +1 -2
  219. package/tui/src/components/Spinner/TeammateSpinnerLine.tsx +1 -2
  220. package/tui/src/components/Spinner/TeammateSpinnerTree.tsx +1 -2
  221. package/tui/src/components/Spinner.tsx +0 -1
  222. package/tui/src/components/Stats.tsx +0 -1
  223. package/tui/src/components/StatusLine.tsx +1 -2
  224. package/tui/src/components/StatusNotices.tsx +1 -2
  225. package/tui/src/components/StructuredDiff/Fallback.tsx +1 -2
  226. package/tui/src/components/StructuredDiff.tsx +1 -2
  227. package/tui/src/components/StructuredDiffList.tsx +1 -2
  228. package/tui/src/components/TagTabs.tsx +1 -2
  229. package/tui/src/components/TaskListV2.tsx +1 -2
  230. package/tui/src/components/TeammateViewHeader.tsx +1 -2
  231. package/tui/src/components/TeleportError.tsx +0 -1
  232. package/tui/src/components/TeleportProgress.tsx +1 -2
  233. package/tui/src/components/TeleportRepoMismatchDialog.tsx +0 -1
  234. package/tui/src/components/TeleportStash.tsx +1 -2
  235. package/tui/src/components/TextInput.tsx +1 -2
  236. package/tui/src/components/ThemePicker.tsx +0 -1
  237. package/tui/src/components/ThinkingToggle.tsx +0 -1
  238. package/tui/src/components/TokenWarning.tsx +1 -2
  239. package/tui/src/components/ToolUseLoader.tsx +1 -2
  240. package/tui/src/components/TrustDialog/TrustDialog.tsx +0 -1
  241. package/tui/src/components/ValidationErrorsList.tsx +1 -2
  242. package/tui/src/components/VimTextInput.tsx +1 -2
  243. package/tui/src/components/VirtualMessageList.tsx +1 -2
  244. package/tui/src/components/WorktreeExitDialog.tsx +1 -2
  245. package/tui/src/components/agents/AgentDetail.tsx +0 -1
  246. package/tui/src/components/agents/AgentEditor.tsx +1 -2
  247. package/tui/src/components/agents/AgentNavigationFooter.tsx +1 -2
  248. package/tui/src/components/agents/AgentsList.tsx +0 -1
  249. package/tui/src/components/agents/AgentsMenu.tsx +1 -2
  250. package/tui/src/components/agents/ColorPicker.tsx +1 -2
  251. package/tui/src/components/agents/ModelSelector.tsx +1 -2
  252. package/tui/src/components/agents/ToolSelector.tsx +1 -2
  253. package/tui/src/components/agents/new-agent-creation/CreateAgentWizard.tsx +1 -2
  254. package/tui/src/components/agents/new-agent-creation/wizard-steps/ColorStep.tsx +1 -2
  255. package/tui/src/components/agents/new-agent-creation/wizard-steps/ConfirmStep.tsx +0 -1
  256. package/tui/src/components/agents/new-agent-creation/wizard-steps/ConfirmStepWrapper.tsx +1 -2
  257. package/tui/src/components/agents/new-agent-creation/wizard-steps/DescriptionStep.tsx +0 -1
  258. package/tui/src/components/agents/new-agent-creation/wizard-steps/GenerateStep.tsx +1 -2
  259. package/tui/src/components/agents/new-agent-creation/wizard-steps/LocationStep.tsx +1 -2
  260. package/tui/src/components/agents/new-agent-creation/wizard-steps/MemoryStep.tsx +1 -2
  261. package/tui/src/components/agents/new-agent-creation/wizard-steps/MethodStep.tsx +0 -1
  262. package/tui/src/components/agents/new-agent-creation/wizard-steps/ModelStep.tsx +1 -2
  263. package/tui/src/components/agents/new-agent-creation/wizard-steps/PromptStep.tsx +1 -2
  264. package/tui/src/components/agents/new-agent-creation/wizard-steps/ToolsStep.tsx +1 -2
  265. package/tui/src/components/agents/new-agent-creation/wizard-steps/TypeStep.tsx +1 -2
  266. package/tui/src/components/design-system/Byline.tsx +1 -2
  267. package/tui/src/components/design-system/Dialog.tsx +1 -2
  268. package/tui/src/components/design-system/Divider.tsx +1 -2
  269. package/tui/src/components/design-system/FuzzyPicker.tsx +1 -2
  270. package/tui/src/components/design-system/KeyboardShortcutHint.tsx +1 -2
  271. package/tui/src/components/design-system/ListItem.tsx +1 -2
  272. package/tui/src/components/design-system/LoadingState.tsx +0 -1
  273. package/tui/src/components/design-system/Pane.tsx +1 -2
  274. package/tui/src/components/design-system/ProgressBar.tsx +1 -2
  275. package/tui/src/components/design-system/Ratchet.tsx +1 -2
  276. package/tui/src/components/design-system/StatusIcon.tsx +1 -2
  277. package/tui/src/components/design-system/Tabs.tsx +1 -2
  278. package/tui/src/components/design-system/ThemeProvider.tsx +1 -2
  279. package/tui/src/components/design-system/ThemedBox.tsx +1 -2
  280. package/tui/src/components/design-system/ThemedText.tsx +1 -2
  281. package/tui/src/components/diff/DiffDetailView.tsx +1 -2
  282. package/tui/src/components/diff/DiffDialog.tsx +1 -2
  283. package/tui/src/components/diff/DiffFileList.tsx +1 -2
  284. package/tui/src/components/grove/Grove.tsx +0 -1
  285. package/tui/src/components/hooks/HooksConfigMenu.tsx +0 -1
  286. package/tui/src/components/hooks/PromptDialog.tsx +1 -2
  287. package/tui/src/components/hooks/SelectEventMode.tsx +0 -1
  288. package/tui/src/components/hooks/SelectHookMode.tsx +0 -1
  289. package/tui/src/components/hooks/SelectMatcherMode.tsx +0 -1
  290. package/tui/src/components/hooks/ViewHookMode.tsx +0 -1
  291. package/tui/src/components/mcp/CapabilitiesSection.tsx +1 -2
  292. package/tui/src/components/mcp/ElicitationDialog.tsx +0 -1
  293. package/tui/src/components/mcp/MCPAgentServerMenu.tsx +1 -2
  294. package/tui/src/components/mcp/MCPListPanel.tsx +0 -1
  295. package/tui/src/components/mcp/MCPReconnect.tsx +1 -2
  296. package/tui/src/components/mcp/MCPRemoteServerMenu.tsx +2 -3
  297. package/tui/src/components/mcp/MCPSettings.tsx +0 -1
  298. package/tui/src/components/mcp/MCPStdioServerMenu.tsx +1 -2
  299. package/tui/src/components/mcp/MCPToolDetailView.tsx +1 -2
  300. package/tui/src/components/mcp/MCPToolListView.tsx +1 -2
  301. package/tui/src/components/mcp/McpParsingWarnings.tsx +0 -1
  302. package/tui/src/components/mcp/utils/reconnectHelpers.tsx +1 -2
  303. package/tui/src/components/memory/MemoryFileSelector.tsx +1 -2
  304. package/tui/src/components/memory/MemoryUpdateNotification.tsx +1 -2
  305. package/tui/src/components/messageActions.tsx +1 -2
  306. package/tui/src/components/messages/AdvisorMessage.tsx +1 -2
  307. package/tui/src/components/messages/AssistantRedactedThinkingMessage.tsx +1 -2
  308. package/tui/src/components/messages/AssistantThinkingMessage.tsx +1 -2
  309. package/tui/src/components/messages/AssistantToolUseMessage.tsx +0 -1
  310. package/tui/src/components/messages/AttachmentMessage.tsx +1 -2
  311. package/tui/src/components/messages/CollapsedReadSearchContent.tsx +1 -2
  312. package/tui/src/components/messages/CompactBoundaryMessage.tsx +1 -2
  313. package/tui/src/components/messages/GroupedToolUseContent.tsx +1 -2
  314. package/tui/src/components/messages/HighlightedThinkingText.tsx +1 -2
  315. package/tui/src/components/messages/HookProgressMessage.tsx +1 -2
  316. package/tui/src/components/messages/PlanApprovalMessage.tsx +1 -2
  317. package/tui/src/components/messages/RateLimitMessage.tsx +1 -2
  318. package/tui/src/components/messages/ShutdownMessage.tsx +1 -2
  319. package/tui/src/components/messages/SystemAPIErrorMessage.tsx +1 -2
  320. package/tui/src/components/messages/SystemTextMessage.tsx +1 -2
  321. package/tui/src/components/messages/TaskAssignmentMessage.tsx +1 -2
  322. package/tui/src/components/messages/UserAgentNotificationMessage.tsx +1 -2
  323. package/tui/src/components/messages/UserBashInputMessage.tsx +1 -2
  324. package/tui/src/components/messages/UserBashOutputMessage.tsx +1 -2
  325. package/tui/src/components/messages/UserChannelMessage.tsx +1 -2
  326. package/tui/src/components/messages/UserCommandMessage.tsx +1 -2
  327. package/tui/src/components/messages/UserImageMessage.tsx +1 -2
  328. package/tui/src/components/messages/UserLocalCommandOutputMessage.tsx +1 -2
  329. package/tui/src/components/messages/UserMemoryInputMessage.tsx +1 -2
  330. package/tui/src/components/messages/UserPlanMessage.tsx +1 -2
  331. package/tui/src/components/messages/UserPromptMessage.tsx +1 -2
  332. package/tui/src/components/messages/UserResourceUpdateMessage.tsx +1 -2
  333. package/tui/src/components/messages/UserTeammateMessage.tsx +1 -2
  334. package/tui/src/components/messages/UserTextMessage.tsx +1 -2
  335. package/tui/src/components/messages/UserToolResultMessage/RejectedPlanMessage.tsx +0 -1
  336. package/tui/src/components/messages/UserToolResultMessage/RejectedToolUseMessage.tsx +1 -2
  337. package/tui/src/components/messages/UserToolResultMessage/UserToolCanceledMessage.tsx +1 -2
  338. package/tui/src/components/messages/UserToolResultMessage/UserToolErrorMessage.tsx +1 -2
  339. package/tui/src/components/messages/UserToolResultMessage/UserToolRejectMessage.tsx +1 -2
  340. package/tui/src/components/messages/UserToolResultMessage/UserToolResultMessage.tsx +1 -2
  341. package/tui/src/components/messages/UserToolResultMessage/UserToolSuccessMessage.tsx +1 -2
  342. package/tui/src/components/messages/UserToolResultMessage/utils.tsx +0 -1
  343. package/tui/src/components/messages/teamMemCollapsed.tsx +1 -2
  344. package/tui/src/components/permissions/AskUserQuestionPermissionRequest/AskUserQuestionPermissionRequest.tsx +1 -2
  345. package/tui/src/components/permissions/AskUserQuestionPermissionRequest/PreviewBox.tsx +1 -2
  346. package/tui/src/components/permissions/AskUserQuestionPermissionRequest/PreviewQuestionView.tsx +1 -2
  347. package/tui/src/components/permissions/AskUserQuestionPermissionRequest/QuestionNavigationBar.tsx +1 -2
  348. package/tui/src/components/permissions/AskUserQuestionPermissionRequest/QuestionView.tsx +1 -2
  349. package/tui/src/components/permissions/AskUserQuestionPermissionRequest/SubmitQuestionsView.tsx +1 -2
  350. package/tui/src/components/permissions/BashPermissionRequest/BashPermissionRequest.tsx +1 -2
  351. package/tui/src/components/permissions/BashPermissionRequest/bashToolUseOptions.tsx +0 -1
  352. package/tui/src/components/permissions/ComputerUseApproval/ComputerUseApproval.tsx +0 -1
  353. package/tui/src/components/permissions/EnterPlanModePermissionRequest/EnterPlanModePermissionRequest.tsx +0 -1
  354. package/tui/src/components/permissions/ExitPlanModePermissionRequest/ExitPlanModePermissionRequest.tsx +0 -1
  355. package/tui/src/components/permissions/FallbackPermissionRequest.tsx +1 -2
  356. package/tui/src/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.tsx +1 -2
  357. package/tui/src/components/permissions/FilePermissionDialog/FilePermissionDialog.tsx +1 -2
  358. package/tui/src/components/permissions/FilePermissionDialog/permissionOptions.tsx +0 -1
  359. package/tui/src/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.tsx +1 -2
  360. package/tui/src/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.tsx +1 -2
  361. package/tui/src/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.tsx +1 -2
  362. package/tui/src/components/permissions/NotebookEditPermissionRequest/NotebookEditPermissionRequest.tsx +1 -2
  363. package/tui/src/components/permissions/NotebookEditPermissionRequest/NotebookEditToolDiff.tsx +1 -2
  364. package/tui/src/components/permissions/PermissionDecisionDebugInfo.tsx +1 -2
  365. package/tui/src/components/permissions/PermissionDialog.tsx +1 -2
  366. package/tui/src/components/permissions/PermissionExplanation.tsx +1 -2
  367. package/tui/src/components/permissions/PermissionPrompt.tsx +0 -1
  368. package/tui/src/components/permissions/PermissionRequest.tsx +0 -1
  369. package/tui/src/components/permissions/PermissionRequestTitle.tsx +1 -2
  370. package/tui/src/components/permissions/PermissionRuleExplanation.tsx +1 -2
  371. package/tui/src/components/permissions/PowerShellPermissionRequest/PowerShellPermissionRequest.tsx +1 -2
  372. package/tui/src/components/permissions/PowerShellPermissionRequest/powershellToolUseOptions.tsx +0 -1
  373. package/tui/src/components/permissions/SandboxPermissionRequest.tsx +0 -1
  374. package/tui/src/components/permissions/SedEditPermissionRequest/SedEditPermissionRequest.tsx +1 -2
  375. package/tui/src/components/permissions/SkillPermissionRequest/SkillPermissionRequest.tsx +0 -1
  376. package/tui/src/components/permissions/WebFetchPermissionRequest/WebFetchPermissionRequest.tsx +0 -1
  377. package/tui/src/components/permissions/WorkerBadge.tsx +1 -2
  378. package/tui/src/components/permissions/WorkerPendingPermission.tsx +1 -2
  379. package/tui/src/components/permissions/rules/AddPermissionRules.tsx +0 -1
  380. package/tui/src/components/permissions/rules/AddWorkspaceDirectory.tsx +0 -1
  381. package/tui/src/components/permissions/rules/PermissionRuleDescription.tsx +1 -2
  382. package/tui/src/components/permissions/rules/PermissionRuleInput.tsx +1 -2
  383. package/tui/src/components/permissions/rules/PermissionRuleList.tsx +0 -1
  384. package/tui/src/components/permissions/rules/RecentDenialsTab.tsx +1 -2
  385. package/tui/src/components/permissions/rules/RemoveWorkspaceDirectory.tsx +0 -1
  386. package/tui/src/components/permissions/rules/WorkspaceTab.tsx +1 -2
  387. package/tui/src/components/permissions/shellPermissionHelpers.tsx +1 -2
  388. package/tui/src/components/sandbox/SandboxConfigTab.tsx +1 -2
  389. package/tui/src/components/sandbox/SandboxDependenciesTab.tsx +1 -2
  390. package/tui/src/components/sandbox/SandboxDoctorSection.tsx +1 -2
  391. package/tui/src/components/sandbox/SandboxOverridesTab.tsx +0 -1
  392. package/tui/src/components/sandbox/SandboxSettings.tsx +0 -1
  393. package/tui/src/components/shell/ExpandShellOutputContext.tsx +1 -2
  394. package/tui/src/components/shell/OutputLine.tsx +1 -2
  395. package/tui/src/components/shell/ShellProgressMessage.tsx +1 -2
  396. package/tui/src/components/shell/ShellTimeDisplay.tsx +1 -2
  397. package/tui/src/components/skills/SkillsMenu.tsx +0 -1
  398. package/tui/src/components/tasks/AsyncAgentDetailDialog.tsx +1 -2
  399. package/tui/src/components/tasks/BackgroundTask.tsx +1 -2
  400. package/tui/src/components/tasks/BackgroundTaskStatus.tsx +1 -2
  401. package/tui/src/components/tasks/BackgroundTasksDialog.tsx +1 -2
  402. package/tui/src/components/tasks/DreamDetailDialog.tsx +1 -2
  403. package/tui/src/components/tasks/InProcessTeammateDetailDialog.tsx +1 -2
  404. package/tui/src/components/tasks/RemoteSessionDetailDialog.tsx +0 -1
  405. package/tui/src/components/tasks/RemoteSessionProgress.tsx +1 -2
  406. package/tui/src/components/tasks/ShellDetailDialog.tsx +1 -2
  407. package/tui/src/components/tasks/ShellProgress.tsx +1 -2
  408. package/tui/src/components/tasks/renderToolActivity.tsx +1 -2
  409. package/tui/src/components/tasks/taskStatusUtils.tsx +1 -2
  410. package/tui/src/components/teams/TeamStatus.tsx +1 -2
  411. package/tui/src/components/teams/TeamsDialog.tsx +1 -2
  412. package/tui/src/components/ui/OrderedList.tsx +1 -2
  413. package/tui/src/components/ui/OrderedListItem.tsx +1 -2
  414. package/tui/src/components/ui/TreeSelect.tsx +1 -2
  415. package/tui/src/components/wizard/WizardDialogLayout.tsx +1 -2
  416. package/tui/src/components/wizard/WizardNavigationFooter.tsx +1 -2
  417. package/tui/src/components/wizard/WizardProvider.tsx +1 -2
  418. package/tui/src/context/QueuedMessageContext.tsx +1 -2
  419. package/tui/src/context/fpsMetrics.tsx +1 -2
  420. package/tui/src/context/mailbox.tsx +1 -2
  421. package/tui/src/context/modalContext.tsx +1 -2
  422. package/tui/src/context/notifications.tsx +1 -2
  423. package/tui/src/context/overlayContext.tsx +1 -2
  424. package/tui/src/context/promptOverlayContext.tsx +1 -2
  425. package/tui/src/context/stats.tsx +1 -2
  426. package/tui/src/context/voice.tsx +1 -2
  427. package/tui/src/dialogLaunchers.tsx +0 -1
  428. package/tui/src/entrypoints/cli.tsx +0 -1
  429. package/tui/src/hooks/notifs/useCanSwitchToExistingSubscription.tsx +0 -1
  430. package/tui/src/hooks/notifs/useDeprecationWarningNotification.tsx +1 -2
  431. package/tui/src/hooks/notifs/useFastModeNotification.tsx +1 -2
  432. package/tui/src/hooks/notifs/useIDEStatusIndicator.tsx +1 -2
  433. package/tui/src/hooks/notifs/useInstallMessages.tsx +1 -2
  434. package/tui/src/hooks/notifs/useLspInitializationNotification.tsx +1 -2
  435. package/tui/src/hooks/notifs/useMcpConnectivityStatus.tsx +0 -1
  436. package/tui/src/hooks/notifs/useModelMigrationNotifications.tsx +1 -2
  437. package/tui/src/hooks/notifs/useNpmDeprecationNotification.tsx +1 -2
  438. package/tui/src/hooks/notifs/usePluginAutoupdateNotification.tsx +1 -2
  439. package/tui/src/hooks/notifs/usePluginInstallationStatus.tsx +1 -2
  440. package/tui/src/hooks/notifs/useRateLimitWarningNotification.tsx +1 -2
  441. package/tui/src/hooks/notifs/useSettingsErrors.tsx +1 -2
  442. package/tui/src/hooks/useApiKeyVerification.ts +7 -7
  443. package/tui/src/hooks/useArrowKeyHistory.tsx +1 -2
  444. package/tui/src/hooks/useCanUseTool.tsx +0 -1
  445. package/tui/src/hooks/useChromeExtensionNotification.tsx +0 -1
  446. package/tui/src/hooks/useClaudeCodeHintRecommendation.tsx +1 -2
  447. package/tui/src/hooks/useCommandKeybindings.tsx +1 -2
  448. package/tui/src/hooks/useGlobalKeybindings.tsx +1 -2
  449. package/tui/src/hooks/useIDEIntegration.tsx +1 -2
  450. package/tui/src/hooks/useLspPluginRecommendation.tsx +1 -2
  451. package/tui/src/hooks/useOfficialMarketplaceNotification.tsx +0 -1
  452. package/tui/src/hooks/usePluginRecommendationBase.tsx +1 -2
  453. package/tui/src/hooks/usePromptsFromClaudeInChrome.tsx +1 -2
  454. package/tui/src/hooks/useReplBridge.tsx +1 -2
  455. package/tui/src/hooks/useTypeahead.tsx +0 -1
  456. package/tui/src/hooks/useVoiceIntegration.tsx +1 -2
  457. package/tui/src/ink/Ansi.tsx +1 -2
  458. package/tui/src/ink/components/AlternateScreen.tsx +1 -2
  459. package/tui/src/ink/components/App.tsx +0 -1
  460. package/tui/src/ink/components/Box.tsx +1 -2
  461. package/tui/src/ink/components/Button.tsx +1 -2
  462. package/tui/src/ink/components/ClockContext.tsx +1 -2
  463. package/tui/src/ink/components/ErrorOverview.tsx +1 -2
  464. package/tui/src/ink/components/Link.tsx +1 -2
  465. package/tui/src/ink/components/Newline.tsx +1 -2
  466. package/tui/src/ink/components/NoSelect.tsx +1 -2
  467. package/tui/src/ink/components/RawAnsi.tsx +1 -2
  468. package/tui/src/ink/components/ScrollBox.tsx +1 -2
  469. package/tui/src/ink/components/Spacer.tsx +1 -2
  470. package/tui/src/ink/components/TerminalFocusContext.tsx +1 -2
  471. package/tui/src/ink/components/TerminalSizeContext.tsx +1 -2
  472. package/tui/src/ink/components/Text.tsx +1 -2
  473. package/tui/src/ink/ink.tsx +0 -1
  474. package/tui/src/interactiveHelpers.tsx +0 -1
  475. package/tui/src/keybindings/KeybindingContext.tsx +1 -2
  476. package/tui/src/keybindings/KeybindingProviderSetup.tsx +1 -2
  477. package/tui/src/main.tsx +0 -1
  478. package/tui/src/moreright/useMoreRight.tsx +1 -2
  479. package/tui/src/replLauncher.tsx +1 -2
  480. package/tui/src/screens/Doctor.tsx +0 -1
  481. package/tui/src/screens/REPL.tsx +0 -1
  482. package/tui/src/screens/ResumeConversation.tsx +0 -1
  483. package/tui/src/services/mcp/MCPConnectionManager.tsx +1 -2
  484. package/tui/src/services/mcp/claudeai.ts +1 -1
  485. package/tui/src/services/mcpServerApproval.tsx +1 -2
  486. package/tui/src/services/oauth/client.ts +15 -15
  487. package/tui/src/services/oauth/getOauthProfile.ts +2 -2
  488. package/tui/src/services/oauth/index.ts +12 -18
  489. package/tui/src/services/policyLimits/index.ts +3 -3
  490. package/tui/src/services/remoteManagedSettings/index.ts +3 -3
  491. package/tui/src/services/remoteManagedSettings/securityCheck.tsx +1 -2
  492. package/tui/src/services/remoteManagedSettings/syncCache.ts +3 -3
  493. package/tui/src/services/voiceStreamSTT.ts +2 -2
  494. package/tui/src/state/AppState.tsx +1 -2
  495. package/tui/src/tasks/InProcessTeammateTask/InProcessTeammateTask.tsx +1 -2
  496. package/tui/src/tasks/LocalAgentTask/LocalAgentTask.tsx +1 -2
  497. package/tui/src/tasks/LocalShellTask/LocalShellTask.tsx +1 -2
  498. package/tui/src/tasks/RemoteAgentTask/RemoteAgentTask.tsx +0 -1
  499. package/tui/src/tools/AgentTool/UI.tsx +1 -2
  500. package/tui/src/tools/BashTool/BashToolResultMessage.tsx +0 -1
  501. package/tui/src/tools/BashTool/UI.tsx +1 -2
  502. package/tui/src/tools/BriefTool/UI.tsx +0 -1
  503. package/tui/src/tools/ConfigTool/ConfigTool.ts +2 -2
  504. package/tui/src/tools/ConfigTool/UI.tsx +1 -2
  505. package/tui/src/tools/EnterPlanModeTool/UI.tsx +0 -1
  506. package/tui/src/tools/EnterWorktreeTool/UI.tsx +1 -2
  507. package/tui/src/tools/ExitPlanModeTool/UI.tsx +0 -1
  508. package/tui/src/tools/ExitWorktreeTool/UI.tsx +1 -2
  509. package/tui/src/tools/FileEditTool/UI.tsx +1 -2
  510. package/tui/src/tools/FileReadTool/UI.tsx +1 -2
  511. package/tui/src/tools/FileWriteTool/UI.tsx +1 -2
  512. package/tui/src/tools/GlobTool/UI.tsx +1 -2
  513. package/tui/src/tools/GrepTool/UI.tsx +1 -2
  514. package/tui/src/tools/LSPTool/UI.tsx +1 -2
  515. package/tui/src/tools/ListMcpResourcesTool/UI.tsx +1 -2
  516. package/tui/src/tools/MCPTool/UI.tsx +1 -2
  517. package/tui/src/tools/NotebookEditTool/UI.tsx +1 -2
  518. package/tui/src/tools/PowerShellTool/UI.tsx +0 -1
  519. package/tui/src/tools/ReadMcpResourceTool/UI.tsx +1 -2
  520. package/tui/src/tools/RemoteTriggerTool/UI.tsx +1 -2
  521. package/tui/src/tools/ScheduleCronTool/UI.tsx +1 -2
  522. package/tui/src/tools/SendMessageTool/UI.tsx +1 -2
  523. package/tui/src/tools/SkillTool/UI.tsx +1 -2
  524. package/tui/src/tools/TaskStopTool/UI.tsx +1 -2
  525. package/tui/src/tools/TeamCreateTool/UI.tsx +1 -2
  526. package/tui/src/tools/TeamDeleteTool/UI.tsx +1 -2
  527. package/tui/src/tools/WebFetchTool/UI.tsx +1 -2
  528. package/tui/src/tools/testing/TestingPermissionTool.tsx +1 -2
  529. package/tui/src/utils/auth.ts +6 -12
  530. package/tui/src/utils/autoRunIssue.tsx +1 -2
  531. package/tui/src/utils/billing.ts +2 -2
  532. package/tui/src/utils/computerUse/toolRendering.tsx +1 -2
  533. package/tui/src/utils/computerUse/wrapper.tsx +0 -1
  534. package/tui/src/utils/exportRenderer.tsx +1 -2
  535. package/tui/src/utils/fastMode.ts +2 -2
  536. package/tui/src/utils/highlightMatch.tsx +1 -2
  537. package/tui/src/utils/http.ts +2 -2
  538. package/tui/src/utils/managedEnv.ts +1 -1
  539. package/tui/src/utils/messages/systemInit.ts +2 -2
  540. package/tui/src/utils/plugins/performStartupChecks.tsx +1 -2
  541. package/tui/src/utils/preflightChecks.tsx +0 -1
  542. package/tui/src/utils/processUserInput/processBashCommand.tsx +1 -2
  543. package/tui/src/utils/processUserInput/processSlashCommand.tsx +0 -1
  544. package/tui/src/utils/staticRender.tsx +1 -2
  545. package/tui/src/utils/status.tsx +1 -2
  546. package/tui/src/utils/statusNoticeDefinitions.tsx +5 -6
  547. package/tui/src/utils/swarm/It2SetupPrompt.tsx +1 -2
  548. package/tui/src/utils/teleport.tsx +0 -1
  549. package/tui/src/voice/voiceModeEnabled.ts +3 -3
  550. package/uv.lock +1 -1
  551. package/src/ummaya/llm/_cc_reference/README.md +0 -104
  552. package/src/ummaya/llm/_cc_reference/api.ts +0 -721
  553. package/src/ummaya/llm/_cc_reference/claude.ts +0 -3422
  554. package/src/ummaya/llm/_cc_reference/client.ts +0 -392
  555. package/src/ummaya/llm/_cc_reference/emptyUsage.ts +0 -25
  556. package/src/ummaya/llm/_cc_reference/errors.ts +0 -1210
  557. package/src/ummaya/llm/_cc_reference/messages.ts +0 -5515
  558. package/src/ummaya/llm/_cc_reference/permissions.ts +0 -1489
  559. package/src/ummaya/llm/_cc_reference/prompts.ts +0 -917
  560. package/src/ummaya/llm/_cc_reference/query.ts +0 -1732
  561. package/src/ummaya/llm/_cc_reference/toolExecution.ts +0 -1748
  562. package/src/ummaya/llm/_cc_reference/toolOrchestration.ts +0 -191
  563. package/src/ummaya/llm/_cc_reference/toolResultStorage.ts +0 -1043
  564. package/src/ummaya/llm/_cc_reference/tools.ts +0 -392
@@ -1,191 +0,0 @@
1
- // SPDX-License-Identifier: Apache-2.0 (Anthropic upstream) — research-use mirror
2
- // Source: .references/claude-code-sourcemap/restored-src/src/services/tools/toolOrchestration.ts (CC 2.1.88)
3
-
4
- import type { ToolUseBlock } from '@anthropic-ai/sdk/resources/index.mjs'
5
- import type { CanUseToolFn } from '../../hooks/useCanUseTool.js'
6
- import { findToolByName, type ToolUseContext } from '../../Tool.js'
7
- import type { AssistantMessage, Message } from '../../types/message.js'
8
- import { all } from '../../utils/generators.js'
9
- import { type MessageUpdateLazy, runToolUse } from './toolExecution.js'
10
-
11
- function getMaxToolUseConcurrency(): number {
12
- return (
13
- parseInt(process.env.CLAUDE_CODE_MAX_TOOL_USE_CONCURRENCY || '', 10) || 10
14
- )
15
- }
16
-
17
- export type MessageUpdate = {
18
- message?: Message
19
- newContext: ToolUseContext
20
- }
21
-
22
- export async function* runTools(
23
- toolUseMessages: ToolUseBlock[],
24
- assistantMessages: AssistantMessage[],
25
- canUseTool: CanUseToolFn,
26
- toolUseContext: ToolUseContext,
27
- ): AsyncGenerator<MessageUpdate, void> {
28
- let currentContext = toolUseContext
29
- for (const { isConcurrencySafe, blocks } of partitionToolCalls(
30
- toolUseMessages,
31
- currentContext,
32
- )) {
33
- if (isConcurrencySafe) {
34
- const queuedContextModifiers: Record<
35
- string,
36
- ((context: ToolUseContext) => ToolUseContext)[]
37
- > = {}
38
- // Run read-only batch concurrently
39
- for await (const update of runToolsConcurrently(
40
- blocks,
41
- assistantMessages,
42
- canUseTool,
43
- currentContext,
44
- )) {
45
- if (update.contextModifier) {
46
- const { toolUseID, modifyContext } = update.contextModifier
47
- if (!queuedContextModifiers[toolUseID]) {
48
- queuedContextModifiers[toolUseID] = []
49
- }
50
- queuedContextModifiers[toolUseID].push(modifyContext)
51
- }
52
- yield {
53
- message: update.message,
54
- newContext: currentContext,
55
- }
56
- }
57
- for (const block of blocks) {
58
- const modifiers = queuedContextModifiers[block.id]
59
- if (!modifiers) {
60
- continue
61
- }
62
- for (const modifier of modifiers) {
63
- currentContext = modifier(currentContext)
64
- }
65
- }
66
- yield { newContext: currentContext }
67
- } else {
68
- // Run non-read-only batch serially
69
- for await (const update of runToolsSerially(
70
- blocks,
71
- assistantMessages,
72
- canUseTool,
73
- currentContext,
74
- )) {
75
- if (update.newContext) {
76
- currentContext = update.newContext
77
- }
78
- yield {
79
- message: update.message,
80
- newContext: currentContext,
81
- }
82
- }
83
- }
84
- }
85
- }
86
-
87
- type Batch = { isConcurrencySafe: boolean; blocks: ToolUseBlock[] }
88
-
89
- /**
90
- * Partition tool calls into batches where each batch is either:
91
- * 1. A single non-read-only tool, or
92
- * 2. Multiple consecutive read-only tools
93
- */
94
- function partitionToolCalls(
95
- toolUseMessages: ToolUseBlock[],
96
- toolUseContext: ToolUseContext,
97
- ): Batch[] {
98
- return toolUseMessages.reduce((acc: Batch[], toolUse) => {
99
- const tool = findToolByName(toolUseContext.options.tools, toolUse.name)
100
- const parsedInput = tool?.inputSchema.safeParse(toolUse.input)
101
- const isConcurrencySafe = parsedInput?.success
102
- ? (() => {
103
- try {
104
- return Boolean(tool?.isConcurrencySafe(parsedInput.data))
105
- } catch {
106
- // If isConcurrencySafe throws (e.g., due to shell-quote parse failure),
107
- // treat as not concurrency-safe to be conservative
108
- return false
109
- }
110
- })()
111
- : false
112
- if (isConcurrencySafe && acc[acc.length - 1]?.isConcurrencySafe) {
113
- acc[acc.length - 1]!.blocks.push(toolUse)
114
- } else {
115
- acc.push({ isConcurrencySafe, blocks: [toolUse] })
116
- }
117
- return acc
118
- }, [])
119
- }
120
-
121
- async function* runToolsSerially(
122
- toolUseMessages: ToolUseBlock[],
123
- assistantMessages: AssistantMessage[],
124
- canUseTool: CanUseToolFn,
125
- toolUseContext: ToolUseContext,
126
- ): AsyncGenerator<MessageUpdate, void> {
127
- let currentContext = toolUseContext
128
-
129
- for (const toolUse of toolUseMessages) {
130
- toolUseContext.setInProgressToolUseIDs(prev =>
131
- new Set(prev).add(toolUse.id),
132
- )
133
- for await (const update of runToolUse(
134
- toolUse,
135
- assistantMessages.find(_ =>
136
- _.message.content.some(
137
- _ => _.type === 'tool_use' && _.id === toolUse.id,
138
- ),
139
- )!,
140
- canUseTool,
141
- currentContext,
142
- )) {
143
- if (update.contextModifier) {
144
- currentContext = update.contextModifier.modifyContext(currentContext)
145
- }
146
- yield {
147
- message: update.message,
148
- newContext: currentContext,
149
- }
150
- }
151
- markToolUseAsComplete(toolUseContext, toolUse.id)
152
- }
153
- }
154
-
155
- async function* runToolsConcurrently(
156
- toolUseMessages: ToolUseBlock[],
157
- assistantMessages: AssistantMessage[],
158
- canUseTool: CanUseToolFn,
159
- toolUseContext: ToolUseContext,
160
- ): AsyncGenerator<MessageUpdateLazy, void> {
161
- yield* all(
162
- toolUseMessages.map(async function* (toolUse) {
163
- toolUseContext.setInProgressToolUseIDs(prev =>
164
- new Set(prev).add(toolUse.id),
165
- )
166
- yield* runToolUse(
167
- toolUse,
168
- assistantMessages.find(_ =>
169
- _.message.content.some(
170
- _ => _.type === 'tool_use' && _.id === toolUse.id,
171
- ),
172
- )!,
173
- canUseTool,
174
- toolUseContext,
175
- )
176
- markToolUseAsComplete(toolUseContext, toolUse.id)
177
- }),
178
- getMaxToolUseConcurrency(),
179
- )
180
- }
181
-
182
- function markToolUseAsComplete(
183
- toolUseContext: ToolUseContext,
184
- toolUseID: string,
185
- ) {
186
- toolUseContext.setInProgressToolUseIDs(prev => {
187
- const next = new Set(prev)
188
- next.delete(toolUseID)
189
- return next
190
- })
191
- }