@readmagic/workmate 0.0.3 → 0.0.5

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 (402) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-mANiG0xj.js → AddWorkspaceDirectory-DJRkEz7o.js} +1 -1
  2. package/dist/chunks/{App-aUVaOLeo.js → App-iJu5qyiF.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-CKfn7U1R.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-36iUE5CW.js → ApproveApiKey-CRejTHUw.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-BLcvdkgb.js → AssistantSessionChooser-CBLQ1v-J.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-CyoLEYWH.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-CTlpvTuz.js → BypassPermissionsModeDialog-D1FCKVOi.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-5pipE8m8.js → ClaudeMdExternalIncludesDialog-CI0yF6sZ.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-TypH-X8e.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-wGQuFt41.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-Blg1TVut.js → DesktopHandoff-D1rrMxeP.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CUEpuocY.js → DiffDialog-BKcfKx7O.js} +2 -2
  13. package/dist/chunks/Doctor-CcJUwSQn.js +1 -0
  14. package/dist/chunks/Doctor-Yco1McrL.js +3 -0
  15. package/dist/chunks/ExitFlow-D3csukbB.js +2 -0
  16. package/dist/chunks/{Feedback-CDTqPqsM.js → Feedback-bEUtrHia.js} +2 -2
  17. package/dist/chunks/Grove-DPkIjqg8.js +1 -0
  18. package/dist/chunks/{Grove-D9lSG_Lh.js → Grove-Dsd7F39b.js} +1 -1
  19. package/dist/chunks/{HybridTransport-8j0AviF6.js → HybridTransport-9fTBC2Pv.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-I3t-0nU3.js → InvalidConfigDialog-9M-1nfZ6.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-BnthOxGT.js → InvalidSettingsDialog-B2F6pryH.js} +1 -1
  22. package/dist/chunks/MCPConnectionManager-MWpKjeZT.js +1 -0
  23. package/dist/chunks/{McpParsingWarnings-D0XvLirX.js → McpParsingWarnings-BPBb7Npe.js} +1 -1
  24. package/dist/chunks/MessageSelector-DsQmqFt2.js +3 -0
  25. package/dist/chunks/Messages-B3sGRx5A.js +11 -0
  26. package/dist/chunks/{Onboarding-B1WRpoBI.js → Onboarding-cHcnsBGp.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-BSmgq089.js → OverageCreditUpsell-CWCD_RpM.js} +1 -1
  28. package/dist/chunks/PluginSettings-B0jbwB2M.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-3rjz6zhK.js → PromptInputFooterSuggestions-D5sAO6y-.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-DgDJHZqC.js → PromptInputHelpMenu-n6hAdsto.js} +1 -1
  31. package/dist/chunks/QueryEngine-cwdsr4dr.js +1 -0
  32. package/dist/chunks/REPL-CJzScgbZ.js +142 -0
  33. package/dist/chunks/REPL-DlBJIPCw.js +1 -0
  34. package/dist/chunks/{RemoteCallout-BFzCx_Pn.js → RemoteCallout-CiA4rCEs.js} +1 -1
  35. package/dist/chunks/RemoteSessionManager-zdHfmvfj.js +2 -0
  36. package/dist/chunks/ResumeConversation-Rxwd6HAJ.js +1 -0
  37. package/dist/chunks/{SSETransport-DGIytG74.js → SSETransport-BPbhCa2f.js} +3 -3
  38. package/dist/chunks/SearchExtraToolsTool-VP87ErGx.js +1 -0
  39. package/dist/chunks/Settings-CxI_KHUj.js +2 -0
  40. package/dist/chunks/{TeleportProgress-Bens06DU.js → TeleportProgress-DrulEQ7z.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-BtLBCZUe.js → TeleportRepoMismatchDialog-D3FOLr0P.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-t50LfWyN.js → TeleportResumeWrapper-DI5iRFND.js} +1 -1
  43. package/dist/chunks/{ThemePicker-BTfuZZ7E.js → ThemePicker-CQ7dfFtv.js} +1 -1
  44. package/dist/chunks/{TrustDialog-CgE_pYUK.js → TrustDialog-CnVKrdxQ.js} +1 -1
  45. package/dist/chunks/{ValidationErrorsList-Bl68E-2-.js → ValidationErrorsList-CPYeuppg.js} +1 -1
  46. package/dist/chunks/{WelcomeV2-C93xQYAF.js → WelcomeV2-C-UXdIng.js} +1 -1
  47. package/dist/chunks/{add-dir-C3IhJYVH.js → add-dir-xTz4COgn.js} +1 -1
  48. package/dist/chunks/{agentDisplay-Cju-aXCx.js → agentDisplay-BuSReYxu.js} +1 -1
  49. package/dist/chunks/{agents-Du3FQ82k.js → agents-CiLlKN2I.js} +1 -1
  50. package/dist/chunks/agents-Du9KYHqN.js +103 -0
  51. package/dist/chunks/allErrors-P3utlEeA.js +1 -0
  52. package/dist/chunks/{ant-CVvy4SuO.js → ant-CBIfqmAb.js} +1 -1
  53. package/dist/chunks/api-B-5jqiMg.js +1 -0
  54. package/dist/chunks/api-BiwZmmsh.js +1 -0
  55. package/dist/chunks/{assistant-C_SkUDk_.js → assistant-XOnU01yl.js} +1 -1
  56. package/dist/chunks/auth-BQa4kzQo.js +1 -0
  57. package/dist/chunks/auth-DT2yxy94.js +15 -0
  58. package/dist/chunks/auth-UAJhZNmZ.js +1 -0
  59. package/dist/chunks/{autoMode-CZyb-mMY.js → autoMode-CEMflt3g.js} +1 -1
  60. package/dist/chunks/{autonomy-DJZ25xZp.js → autonomy-Cg5zweUa.js} +7 -7
  61. package/dist/chunks/{autonomy-BpINX4jw.js → autonomy-_N8aDaA8.js} +1 -1
  62. package/dist/chunks/{autonomyPanel-ssoiIOx5.js → autonomyPanel-I4yCy3Fr.js} +1 -1
  63. package/dist/chunks/backgroundHousekeeping-BUUZ7Csq.js +1 -0
  64. package/dist/chunks/backgroundHousekeeping-DhF2lrQ9.js +17 -0
  65. package/dist/chunks/{branch-BXo5z2al.js → branch-BIX-pyHp.js} +1 -1
  66. package/dist/chunks/{bridge-CbKc1HeD.js → bridge-CYskzVt8.js} +2 -2
  67. package/dist/chunks/{bridgeConfig-DbqUHe0H.js → bridgeConfig-5p_w4s5r.js} +1 -1
  68. package/dist/chunks/bridgeConfig-DWEqKbXk.js +1 -0
  69. package/dist/chunks/bridgeEnabled-CjVCMwnq.js +1 -0
  70. package/dist/chunks/bridgeEnabled-DhFrLTbG.js +1 -0
  71. package/dist/chunks/bridgeMain-6lollTtZ.js +1 -0
  72. package/dist/chunks/bridgeMain-BX2AkLPs.js +68 -0
  73. package/dist/chunks/{bridgeMessaging-lfa_v3oi.js → bridgeMessaging-B5Lbzr8e.js} +1 -1
  74. package/dist/chunks/{btw-Cp0whJaJ.js → btw-CWWFO7u8.js} +1 -1
  75. package/dist/chunks/caches-C46fa77L.js +1 -0
  76. package/dist/chunks/{caches-CmW7idg5.js → caches-DPqPIogk.js} +2 -2
  77. package/dist/chunks/{ccrClient-BPXmxWHw.js → ccrClient-CTLnU9Y1.js} +1 -1
  78. package/dist/chunks/{clear-DjGPxX7T.js → clear-DCAgZwc4.js} +1 -1
  79. package/dist/chunks/client-Bup0Sgcn.js +1 -0
  80. package/dist/chunks/{color-DYYBN52b.js → color-CmJGInHL.js} +1 -1
  81. package/dist/chunks/commands-BdB1eFvP.js +1 -0
  82. package/dist/chunks/{commitAttribution-Bmzgtqc6.js → commitAttribution-CGZr7XNO.js} +2 -2
  83. package/dist/chunks/commitAttribution-D6J3NuhB.js +1 -0
  84. package/dist/chunks/compact-C6-lMHgn.js +2 -0
  85. package/dist/chunks/{config-DiT2Z8dY.js → config-3m_9zSrj.js} +1 -1
  86. package/dist/chunks/config-Bxt1UH1T.js +1 -0
  87. package/dist/chunks/config-CjjXZfNi.js +1 -0
  88. package/dist/chunks/{context-Bh_iUj76.js → context-C9V4GF0n.js} +1 -1
  89. package/dist/chunks/{context-noninteractive-Cb3EM2Oz.js → context-noninteractive-BmC4o5xo.js} +2 -2
  90. package/dist/chunks/context-noninteractive-DvGo1l7b.js +1 -0
  91. package/dist/chunks/conversation-CH9ouFai.js +1 -0
  92. package/dist/chunks/conversation-CYqqk0o7.js +1 -0
  93. package/dist/chunks/{createSSHSession-B0s839mX.js → createSSHSession-BL6j0AU5.js} +1 -1
  94. package/dist/chunks/createSession-DUfOAeyE.js +1 -0
  95. package/dist/chunks/{createSession-VMTMXOHu.js → createSession-D_sgO1Xy.js} +1 -1
  96. package/dist/chunks/crossProjectResume-D5hTOfnE.js +40 -0
  97. package/dist/chunks/{datadog-D9rlcN12.js → datadog-UkGdjL8-.js} +1 -1
  98. package/dist/chunks/{desktop-DidI-4N5.js → desktop-HbYKh-VK.js} +1 -1
  99. package/dist/chunks/{diff-CZg5qL2n.js → diff-nTV17iWX.js} +1 -1
  100. package/dist/chunks/doctor-7fgVhEKL.js +1 -0
  101. package/dist/chunks/{entry-dA1UCfC0.js → entry-CCFI6-gM.js} +3 -3
  102. package/dist/chunks/envLessBridgeConfig-B2HYnEKo.js +1 -0
  103. package/dist/chunks/{envLessBridgeConfig-BFjJ8Kt4.js → envLessBridgeConfig-DXd10GXD.js} +1 -1
  104. package/dist/chunks/{esm-DjGYYlQe.js → esm-CGoYrggU.js} +1 -1
  105. package/dist/chunks/exit-ropaQiOr.js +1 -0
  106. package/dist/chunks/extra-usage-CLhv1Z4g.js +1 -0
  107. package/dist/chunks/{extra-usage-core-RZMzaH0L.js → extra-usage-core-DLYHAInT.js} +1 -1
  108. package/dist/chunks/{extra-usage-BTv_OwGN.js → extra-usage-g2Pw4zt_.js} +1 -1
  109. package/dist/chunks/{extra-usage-noninteractive-BB-BQ3kh.js → extra-usage-noninteractive-D8iszH3c.js} +1 -1
  110. package/dist/chunks/extraUsage-C2Ylufhj.js +1 -0
  111. package/dist/chunks/extractMemories-B2IAvbXM.js +1 -0
  112. package/dist/chunks/{fast-CNXgsvnE.js → fast-Dx2fTmWr.js} +1 -1
  113. package/dist/chunks/fast-_G6zcFye.js +1 -0
  114. package/dist/chunks/{feedback-DeJ2gvw2.js → feedback-DCQ4pJ3v.js} +1 -1
  115. package/dist/chunks/{firstPartyEventLogger-CQdJn3LV.js → firstPartyEventLogger-BNGPPBNP.js} +2 -2
  116. package/dist/chunks/firstPartyEventLogger-C9LzVy6y.js +1 -0
  117. package/dist/chunks/{flushGate-CJ73xcaK.js → flushGate-XaheIZZT.js} +1 -1
  118. package/dist/chunks/{gemini-Cn9bMXwP.js → gemini-BCCLHK3K.js} +1 -1
  119. package/dist/chunks/{generateRecap-BO9kzRon.js → generateRecap-BhvbixY2.js} +1 -1
  120. package/dist/chunks/{generateSessionName-CGpL6ATy.js → generateSessionName-CN1oh7Fa.js} +1 -1
  121. package/dist/chunks/{githubRepoPathMapping-C4umZ1oC.js → githubRepoPathMapping-B4AM8luI.js} +1 -1
  122. package/dist/chunks/{goal-C8Qzl7_i.js → goal-Bp6fyGqo.js} +3 -3
  123. package/dist/chunks/{grok-CDT9P_BL.js → grok-ax26ju8y.js} +1 -1
  124. package/dist/chunks/{grove-BGXzEyH9.js → grove-DrBVaZSN.js} +2 -2
  125. package/dist/chunks/{heapdump-CFHvdSZv.js → heapdump-JseysNDr.js} +1 -1
  126. package/dist/chunks/{help-DUZ7Y7Em.js → help-DR9hKneR.js} +1 -1
  127. package/dist/chunks/hooks-BUJLxdFJ.js +1 -0
  128. package/dist/chunks/{hooks-RHwUCXcT.js → hooks-C5n23H1E.js} +2 -2
  129. package/dist/chunks/inboundAttachments-C0nMTtCi.js +1 -0
  130. package/dist/chunks/{inboundAttachments-Cfl4_n0S.js → inboundAttachments-Cp8XvLMZ.js} +1 -1
  131. package/dist/chunks/initReplBridge-DJs28ZkI.js +1 -0
  132. package/dist/chunks/{install-OkuNmjmB.js → install-C7qTB0V5.js} +1 -1
  133. package/dist/chunks/{instrumentation-hrXeo-G4.js → instrumentation-CLZttr_u.js} +4 -4
  134. package/dist/chunks/{job-DjmIpwJl.js → job-BhiazwPH.js} +1 -1
  135. package/dist/chunks/keybindings-CkL8BzUt.js +2 -0
  136. package/dist/chunks/{language-BA5WprZv.js → language-DIw2871r.js} +1 -1
  137. package/dist/chunks/language-DfOAuDFc.js +1 -0
  138. package/dist/chunks/launchAgentsPlatform-j-mWpwW1.js +1 -0
  139. package/dist/chunks/{launchLocalMemory-CgXtGng1.js → launchLocalMemory-DmoXp0Xo.js} +2 -2
  140. package/dist/chunks/{launchLocalVault-Bs6Km3Ua.js → launchLocalVault-1uKe0HjA.js} +3 -3
  141. package/dist/chunks/launchMemoryStores-SxDKjHJ3.js +1 -0
  142. package/dist/chunks/{launchOnboarding-Cn0t_o2k.js → launchOnboarding-CTtpnXcs.js} +1 -1
  143. package/dist/chunks/launchSchedule-BDVnGhaL.js +1 -0
  144. package/dist/chunks/launchSkillStore-SmMLxp4K.js +1 -0
  145. package/dist/chunks/{launchTeleport-Ba_Hj13c.js → launchTeleport-B472ZSGz.js} +3 -3
  146. package/dist/chunks/launchVault-CsyBgxle.js +1 -0
  147. package/dist/chunks/{loadAgentsDir-DrDu5yYy.js → loadAgentsDir-Clu7Uk6a.js} +629 -629
  148. package/dist/chunks/loadAgentsDir-DTbJJff-.js +1 -0
  149. package/dist/chunks/loadPluginHooks-Cvd5VdjQ.js +1 -0
  150. package/dist/chunks/localSearch-DKv8PRLD.js +1 -0
  151. package/dist/chunks/{localSearch-_bQhk9W6.js → localSearch-iA6JTk19.js} +1 -1
  152. package/dist/chunks/{logoV2Utils-CoC4nheD.js → logoV2Utils-YHBJLIrC.js} +1 -1
  153. package/dist/chunks/{magicDocs-kMjYpjCA.js → magicDocs-Bf1fqnHN.js} +3 -3
  154. package/dist/chunks/{main-C_rVSWfm.js → main-gtV_TqXP.js} +84 -84
  155. package/dist/chunks/{mappers-D0CNXG32.js → mappers-C8lYERPX.js} +1 -1
  156. package/dist/chunks/{mcp-DtxIl6aN.js → mcp-CNuhEGP6.js} +4 -4
  157. package/dist/chunks/mcp-Ci0OPVrR.js +1 -0
  158. package/dist/chunks/mcp-CwIYauZl.js +2 -0
  159. package/dist/chunks/memory-DCGqfQ1U.js +1 -0
  160. package/dist/chunks/{mode-B4WIxCMW.js → mode-DO6g7nkX.js} +2 -2
  161. package/dist/chunks/model-BQF64tZx.js +1 -0
  162. package/dist/chunks/model-DLXL0CNu.js +1 -0
  163. package/dist/chunks/model-DvrvG6BB.js +1 -0
  164. package/dist/chunks/{nativeInstaller-DktvrWRd.js → nativeInstaller-OPuO2sm_.js} +1 -1
  165. package/dist/chunks/{onChangeAppState-CGVeNkt7.js → onChangeAppState-CHhRDkM7.js} +1 -1
  166. package/dist/chunks/openai-HOebt-8k.js +10 -0
  167. package/dist/chunks/{overageCreditGrant-BVxlYgeU.js → overageCreditGrant-Bi1CTBAx.js} +1 -1
  168. package/dist/chunks/{panelCall-Cp6fpQeL.js → panelCall-D0eURklm.js} +1 -1
  169. package/dist/chunks/{partition-RjCtgt9J.js → partition-C8RSL3SQ.js} +1 -1
  170. package/dist/chunks/{passes-ByTLy6pj.js → passes-BJci5SM_.js} +1 -1
  171. package/dist/chunks/permissions-JU9CGHgI.js +3 -0
  172. package/dist/chunks/{pidLock-CdNZ0Wfg.js → pidLock-Bd2e6xuT.js} +2 -2
  173. package/dist/chunks/{plan-BxTA-b4l.js → plan-D4gMsK7i.js} +1 -1
  174. package/dist/chunks/{plugin-DOpl5e1t.js → plugin-CwCo5Kik.js} +1 -1
  175. package/dist/chunks/{pluginAutoupdate-L09CQ-ph.js → pluginAutoupdate-CO-n9bqe.js} +1 -1
  176. package/dist/chunks/{pluginBlocklist-B32eWmzn.js → pluginBlocklist-5qbaTRbV.js} +1 -1
  177. package/dist/chunks/pluginCliCommands-I-lsw_us.js +1 -0
  178. package/dist/chunks/{pluginFlagging-3FQGvIfq.js → pluginFlagging-DNPBbJZo.js} +1 -1
  179. package/dist/chunks/{pluginOperations-ClzXYNQe.js → pluginOperations-Cz6eQ0Vu.js} +2 -2
  180. package/dist/chunks/pluginStartupCheck-CoW7073W.js +1 -0
  181. package/dist/chunks/{pluginStartupCheck-BNd2QNzZ.js → pluginStartupCheck-DJ9fslCK.js} +1 -1
  182. package/dist/chunks/plugins-CzJIuPfb.js +4 -0
  183. package/dist/chunks/policyLimits-BkjgMQD0.js +1 -0
  184. package/dist/chunks/{poor-DekfGNT7.js → poor-Dha9p9RF.js} +1 -1
  185. package/dist/chunks/{poorMode-CtcqaiwD.js → poorMode-1NLYiS3Y.js} +1 -1
  186. package/dist/chunks/poorMode-qlxqU8Hm.js +1 -0
  187. package/dist/chunks/print-BL4EUT5Z.js +23 -0
  188. package/dist/chunks/{privacy-settings-ChNsgGUs.js → privacy-settings-6ZWxR4Qt.js} +1 -1
  189. package/dist/chunks/processBashCommand-BZs9wggV.js +1 -0
  190. package/dist/chunks/processSlashCommand-D8lKLNzM.js +5 -0
  191. package/dist/chunks/{prompt-C0nU0VK3.js → prompt-Bg_1U0gO.js} +1 -1
  192. package/dist/chunks/prompt-CN7gBNKS.js +1 -0
  193. package/dist/chunks/prompt-D-zHhqp8.js +1 -0
  194. package/dist/chunks/{promptEditor-Cumef6hJ.js → promptEditor-BhYDmwdS.js} +2 -2
  195. package/dist/chunks/{protocolHandler-z2zxAtB1.js → protocolHandler-Dnb7lITm.js} +1 -1
  196. package/dist/chunks/rate-limit-options-DVzT3eWH.js +1 -0
  197. package/dist/chunks/{rcDebugLog-2-1XSyFV.js → rcDebugLog-VKwMl0yg.js} +1 -1
  198. package/dist/chunks/reconciler-BdRXZTJf.js +4 -0
  199. package/dist/chunks/{referral-DrebVwqx.js → referral-BlrMpBAV.js} +1 -1
  200. package/dist/chunks/{refresh-pFezssA8.js → refresh-jwqnoK2h.js} +1 -1
  201. package/dist/chunks/{registerProtocol-CukLQuxJ.js → registerProtocol-CuKZAiCc.js} +1 -1
  202. package/dist/chunks/{release-notes-D7vrFNXp.js → release-notes-BgP8u7NE.js} +1 -1
  203. package/dist/chunks/{releaseNotes-CDx2P0fb.js → releaseNotes-CunqVlbU.js} +2 -2
  204. package/dist/chunks/{reload-plugins-CltHfg-l.js → reload-plugins-CD9TzvFm.js} +1 -1
  205. package/dist/chunks/{remote-env-SvvSuP0J.js → remote-env-QaP_W_sv.js} +1 -1
  206. package/dist/chunks/{remoteBridgeCore-BOeljn2c.js → remoteBridgeCore-9-HVMo63.js} +1 -1
  207. package/dist/chunks/{remoteManagedSettings-CaY_ZH8r.js → remoteManagedSettings-jZ6u8ZBT.js} +1 -1
  208. package/dist/chunks/{rename-CbqrCCBO.js → rename-29qxHf8W.js} +1 -1
  209. package/dist/chunks/{resume-DockJaY9.js → resume-D-SpOy_1.js} +2 -2
  210. package/dist/chunks/{runtimeObserver-DSUuYKfs.js → runtimeObserver-DOEcrylu.js} +1 -1
  211. package/dist/chunks/{runtimeObserver-XufSllVw.js → runtimeObserver-Dm3LIUMp.js} +3 -3
  212. package/dist/chunks/sandbox-adapter-LzTcKwBp.js +1 -0
  213. package/dist/chunks/{sandbox-toggle-CZI5fuK3.js → sandbox-toggle-B61AeBor.js} +1 -1
  214. package/dist/chunks/searchExtraTools-CbJJQqzH.js +1 -0
  215. package/dist/chunks/{session-B-Z3DU9o.js → session-RwJCIIcs.js} +2 -2
  216. package/dist/chunks/{sessionDiscovery-C3pMZkBM.js → sessionDiscovery-dkFeWcA3.js} +1 -1
  217. package/dist/chunks/sessionFileAccessHooks-B_nNW0zE.js +1 -0
  218. package/dist/chunks/sessionMemory-C4JAUZ6V.js +1 -0
  219. package/dist/chunks/sessionMemory-btARBn8H.js +1 -0
  220. package/dist/chunks/sessionMemoryUtils-BlqAy8oR.js +1 -0
  221. package/dist/chunks/{sessionObserver-B_09FQKV.js → sessionObserver-CSOYgsvH.js} +1 -1
  222. package/dist/chunks/sessionObserver-DMvWci8-.js +1 -0
  223. package/dist/chunks/sessionStorage-Diyuvt20.js +1 -0
  224. package/dist/chunks/{sessionTitle-CmLWNFuX.js → sessionTitle-CLOlPZ_M.js} +1 -1
  225. package/dist/chunks/{sessionTracing-lArOaj9u.js → sessionTracing-D8wr9j4X.js} +1 -1
  226. package/dist/chunks/{settings-DfWP5y6X.js → settings-Dlp5JTa_.js} +1 -1
  227. package/dist/chunks/settingsSync-QWA0VZSu.js +1 -0
  228. package/dist/chunks/setup-UI9uv2-K.js +3 -0
  229. package/dist/chunks/{shadowedRuleDetection-E2wF1UjU.js → shadowedRuleDetection-CXsmUY2o.js} +1 -1
  230. package/dist/chunks/{sideQuestion-BjHCLSR9.js → sideQuestion-CHpOVzY5.js} +1 -1
  231. package/dist/chunks/{sinks-Cb--pqr-.js → sinks-1hFrW9HK.js} +2 -2
  232. package/dist/chunks/sinks-CXq8-7Qn.js +1 -0
  233. package/dist/chunks/{skill-learning-B0dyBT1_.js → skill-learning-Ck17rwH8.js} +1 -1
  234. package/dist/chunks/skillChangeDetector-s0F9Yf9a.js +1 -0
  235. package/dist/chunks/{skillGapStore-D2fqmnKx.js → skillGapStore-BJ1h2LVr.js} +1 -1
  236. package/dist/chunks/{skillGapStore-75ZYlfwi.js → skillGapStore-DyqNKuNy.js} +2 -2
  237. package/dist/chunks/{skillGenerator-CwXUfM4Y.js → skillGenerator-BT8NGzXT.js} +2 -2
  238. package/dist/chunks/skillLearning-1ZfYIzfL.js +1 -0
  239. package/dist/chunks/{skillLearning-CB-5fdMl.js → skillLearning-Cn9Uw0Kd.js} +1 -1
  240. package/dist/chunks/{skillPanel-Bum7xpgo.js → skillPanel-N0GoWjIi.js} +3 -3
  241. package/dist/chunks/{skillSearchPanel-LSPwZIOw.js → skillSearchPanel-CTwtgTzy.js} +3 -3
  242. package/dist/chunks/{skills-G8WBeffd.js → skills-Bv3lH-aA.js} +1 -1
  243. package/dist/chunks/{stats-DmFubHpI.js → stats-C1Ff6w4i.js} +1 -1
  244. package/dist/chunks/{status-ClSsvm1N.js → status-DyXiBa0m.js} +2 -2
  245. package/dist/chunks/{status-i5beKggW.js → status-FD7HVYS7.js} +1 -1
  246. package/dist/chunks/{statusNoticeHelpers-BK-54uGY.js → statusNoticeHelpers-kTp9Rdk6.js} +1 -1
  247. package/dist/chunks/{tag-DYYq4H_i.js → tag-RzOSA5T0.js} +2 -2
  248. package/dist/chunks/{tasks-BySzm_YJ.js → tasks-eJrOcdhB.js} +1 -1
  249. package/dist/chunks/teleport-ABA-hdmP.js +1 -0
  250. package/dist/chunks/{templateJobs-CT5VxeRr.js → templateJobs-BnOBSFtq.js} +1 -1
  251. package/dist/chunks/{terminalSetup-RDKg8dVa.js → terminalSetup-BfvmoJaK.js} +1 -1
  252. package/dist/chunks/{terminalSetup-BNs9nLbT.js → terminalSetup-D_P5iZmq.js} +1 -1
  253. package/dist/chunks/{theme-CVTVsRwt.js → theme-S0kVMVt4.js} +1 -1
  254. package/dist/chunks/thinkback-C6gV2LpU.js +1 -0
  255. package/dist/chunks/thinkback-HyW_R_88.js +1 -0
  256. package/dist/chunks/{thinkback-play-BhfCaIye.js → thinkback-play-H6md4czq.js} +1 -1
  257. package/dist/chunks/{toolEventObserver--4fqXxQZ.js → toolEventObserver--Z6jENks.js} +1 -1
  258. package/dist/chunks/{toolEventObserver-DdhPsAs1.js → toolEventObserver-BAFzvePj.js} +1 -1
  259. package/dist/chunks/toolPool-CR61XXm3.js +1 -0
  260. package/dist/chunks/trustedDevice-DUrFWupL.js +1 -0
  261. package/dist/chunks/{trustedDevice-DvpN4J1F.js → trustedDevice-Dn4rXbxT.js} +1 -1
  262. package/dist/chunks/types-Bh9S_JG5.js +3 -0
  263. package/dist/chunks/types-DHkZVzJe.js +1 -0
  264. package/dist/chunks/{ultrareviewCommand-i3PfFKly.js → ultrareviewCommand-mYDTBCFD.js} +2 -2
  265. package/dist/chunks/{undercover-Q24TWRw0.js → undercover-CdapzvNH.js} +1 -1
  266. package/dist/chunks/undercover-k3JoOKAb.js +1 -0
  267. package/dist/chunks/{updateCCB-CEXA6dax.js → updateCCB-DPShheOr.js} +1 -1
  268. package/dist/chunks/upgrade-BOeakAP6.js +1 -0
  269. package/dist/chunks/upgrade-D7iGU0PQ.js +1 -0
  270. package/dist/chunks/{upload-B-lNHpWe.js → upload-BXQsDtLW.js} +1 -1
  271. package/dist/chunks/usage-DbRdMJog.js +1 -0
  272. package/dist/chunks/usage-iNQzY960.js +1 -0
  273. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CzFtdlnD.js → useExitOnCtrlCDWithKeybindings-CntByfTQ.js} +1 -1
  274. package/dist/chunks/useMainLoopModel-DHkRIgNs.js +1 -0
  275. package/dist/chunks/useManagePlugins-B8HD0RUh.js +1 -0
  276. package/dist/chunks/{useMergedTools-DMGRA1ga.js → useMergedTools-DfchLQZC.js} +1 -1
  277. package/dist/chunks/{useSearchInput-D5VU9IDU.js → useSearchInput-H-8hJeFD.js} +1 -1
  278. package/dist/chunks/useSettingsErrors-BF5i5Xju.js +1 -0
  279. package/dist/chunks/{util-CNa1ib_4.js → util-CoicMvOv.js} +1 -1
  280. package/dist/chunks/validatePlugin-z2fcngf8.js +1 -0
  281. package/dist/chunks/{vim-C0KTnJJs.js → vim-DdvQlLDm.js} +1 -1
  282. package/dist/chunks/{workerRegistry-B2QD2sKq.js → workerRegistry-CzqQwCHC.js} +1 -1
  283. package/dist/chunks/worktree-DMhP5T0p.js +1 -0
  284. package/dist/cli.js +1 -1
  285. package/package.json +2 -6
  286. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +0 -1
  287. package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +0 -2
  288. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +0 -1
  289. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +0 -1
  290. package/dist/chunks/Doctor-B540I-gq.js +0 -1
  291. package/dist/chunks/Doctor-DlE1Mbb9.js +0 -3
  292. package/dist/chunks/ExitFlow-DCIhnP5h.js +0 -2
  293. package/dist/chunks/Grove-DLYXL8hv.js +0 -1
  294. package/dist/chunks/MCPConnectionManager-zdocEDgk.js +0 -1
  295. package/dist/chunks/MessageSelector-BBhCstBa.js +0 -3
  296. package/dist/chunks/Messages-Dv2VrytX.js +0 -11
  297. package/dist/chunks/PluginSettings-DN9rpwc_.js +0 -17
  298. package/dist/chunks/QueryEngine-BnaHDZVZ.js +0 -1
  299. package/dist/chunks/REPL-B3RbzeV7.js +0 -1
  300. package/dist/chunks/REPL-CA8FEO7J.js +0 -142
  301. package/dist/chunks/RemoteSessionManager-BhUrtejX.js +0 -2
  302. package/dist/chunks/ResumeConversation-BseKUFRI.js +0 -1
  303. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +0 -1
  304. package/dist/chunks/Settings-BvhG1XoW.js +0 -2
  305. package/dist/chunks/agents-Bhg0CtXR.js +0 -103
  306. package/dist/chunks/allErrors-DJYCAtab.js +0 -1
  307. package/dist/chunks/api-CI8HXREw.js +0 -1
  308. package/dist/chunks/api-gJBnC8z3.js +0 -1
  309. package/dist/chunks/auth-B9V3i5oZ.js +0 -1
  310. package/dist/chunks/auth-CgEABs3i.js +0 -15
  311. package/dist/chunks/auth-fSFfSKy_.js +0 -1
  312. package/dist/chunks/backgroundHousekeeping-BHncba6e.js +0 -17
  313. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +0 -1
  314. package/dist/chunks/bridgeConfig-CLHy-BiF.js +0 -1
  315. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +0 -1
  316. package/dist/chunks/bridgeEnabled-CM3SaumJ.js +0 -1
  317. package/dist/chunks/bridgeMain-BESKzpm0.js +0 -1
  318. package/dist/chunks/bridgeMain-CzhBVCsN.js +0 -68
  319. package/dist/chunks/caches-CpqTC0Lb.js +0 -1
  320. package/dist/chunks/client-DPUvQ6Rf.js +0 -1
  321. package/dist/chunks/commands-D7l3P1k9.js +0 -1
  322. package/dist/chunks/commitAttribution-B7NUPJ8E.js +0 -1
  323. package/dist/chunks/compact-D6xqZN4Q.js +0 -2
  324. package/dist/chunks/config-huQaTcNb.js +0 -1
  325. package/dist/chunks/config-qLaiAn7z.js +0 -1
  326. package/dist/chunks/context-noninteractive-CNot6jbs.js +0 -1
  327. package/dist/chunks/conversation-CSpwF3Ha.js +0 -1
  328. package/dist/chunks/conversation-CvCQta8e.js +0 -1
  329. package/dist/chunks/createSession-GNSNbUbN.js +0 -1
  330. package/dist/chunks/crossProjectResume-DGpgCUfk.js +0 -40
  331. package/dist/chunks/doctor-CKUXGCri.js +0 -1
  332. package/dist/chunks/effort-BcvNemuq.js +0 -9
  333. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +0 -1
  334. package/dist/chunks/exit-COMnVxzw.js +0 -1
  335. package/dist/chunks/extra-usage-By33zGLT.js +0 -1
  336. package/dist/chunks/extraUsage-CTn9FWSk.js +0 -1
  337. package/dist/chunks/extractMemories-CXGZGe0h.js +0 -1
  338. package/dist/chunks/fast-BXzdzzXU.js +0 -1
  339. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +0 -1
  340. package/dist/chunks/hooks-fZ1r0jUF.js +0 -1
  341. package/dist/chunks/inboundAttachments-YMxf4fmR.js +0 -1
  342. package/dist/chunks/initReplBridge-GH3-LHF4.js +0 -1
  343. package/dist/chunks/keybindings-B8U17bhs.js +0 -2
  344. package/dist/chunks/language-BbaOTWm3.js +0 -1
  345. package/dist/chunks/launchAgentsPlatform-DnxH2SAn.js +0 -1
  346. package/dist/chunks/launchMemoryStores-DxVAIJuB.js +0 -1
  347. package/dist/chunks/launchSchedule-Chwr3Nzd.js +0 -1
  348. package/dist/chunks/launchSkillStore-6zxJfWVU.js +0 -1
  349. package/dist/chunks/launchVault-hGVrHy33.js +0 -1
  350. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +0 -1
  351. package/dist/chunks/loadPluginHooks-s7bvGtns.js +0 -1
  352. package/dist/chunks/localSearch-CebU5BA9.js +0 -1
  353. package/dist/chunks/mcp-1ZuFesM9.js +0 -2
  354. package/dist/chunks/mcp-CKvGBEjz.js +0 -1
  355. package/dist/chunks/memory-DE2jtkd_.js +0 -1
  356. package/dist/chunks/model-C4RHNhDQ.js +0 -1
  357. package/dist/chunks/model-fi472PRc.js +0 -1
  358. package/dist/chunks/model-j9GNZDFr.js +0 -1
  359. package/dist/chunks/openai-BSVjSJiF.js +0 -10
  360. package/dist/chunks/permissions-B3df_htx.js +0 -3
  361. package/dist/chunks/pluginCliCommands-CDMWnO3d.js +0 -1
  362. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +0 -1
  363. package/dist/chunks/plugins-CcDG95Bs.js +0 -4
  364. package/dist/chunks/policyLimits-Bwi9VqDF.js +0 -1
  365. package/dist/chunks/poorMode-AE4WNYZo.js +0 -1
  366. package/dist/chunks/print-Cc_QOSPF.js +0 -23
  367. package/dist/chunks/processBashCommand-Bx6_oZoE.js +0 -1
  368. package/dist/chunks/processSlashCommand-AltWgIFt.js +0 -5
  369. package/dist/chunks/prompt-CYx145pp.js +0 -1
  370. package/dist/chunks/prompt-DH3lKFag.js +0 -1
  371. package/dist/chunks/rate-limit-options-VL7S3SCx.js +0 -1
  372. package/dist/chunks/reconciler-DHRE_gV2.js +0 -4
  373. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +0 -1
  374. package/dist/chunks/searchExtraTools-iQfI39wB.js +0 -1
  375. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +0 -1
  376. package/dist/chunks/sessionMemory-CqRpgwtU.js +0 -1
  377. package/dist/chunks/sessionMemory-D_HQmhj7.js +0 -1
  378. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +0 -1
  379. package/dist/chunks/sessionObserver-B400YG3s.js +0 -1
  380. package/dist/chunks/sessionStorage-DRnvtrpU.js +0 -1
  381. package/dist/chunks/settingsSync-BlDk6rsM.js +0 -1
  382. package/dist/chunks/setup-DdbmxSZh.js +0 -3
  383. package/dist/chunks/sinks-DbwDBd-E.js +0 -1
  384. package/dist/chunks/skillChangeDetector-DQof8SUY.js +0 -1
  385. package/dist/chunks/skillLearning-CSY5R5Jn.js +0 -1
  386. package/dist/chunks/teleport-dxtBcM01.js +0 -1
  387. package/dist/chunks/thinkback-B-GpXG9U.js +0 -1
  388. package/dist/chunks/thinkback-CXsRbDYN.js +0 -1
  389. package/dist/chunks/toolPool-DvHECcbN.js +0 -1
  390. package/dist/chunks/trustedDevice-e6iF1X7C.js +0 -1
  391. package/dist/chunks/types-BUyOCzUt.js +0 -1
  392. package/dist/chunks/types-Czs-_G1S.js +0 -3
  393. package/dist/chunks/undercover-CPvoDtJ1.js +0 -1
  394. package/dist/chunks/upgrade-7OrBbrzS.js +0 -1
  395. package/dist/chunks/upgrade-uR7SIVtx.js +0 -1
  396. package/dist/chunks/usage-7jOeIVv9.js +0 -1
  397. package/dist/chunks/usage-CZdPfUqP.js +0 -1
  398. package/dist/chunks/useMainLoopModel-DegH12LZ.js +0 -1
  399. package/dist/chunks/useManagePlugins-BkK1zydO.js +0 -1
  400. package/dist/chunks/useSettingsErrors-B5PSF1va.js +0 -1
  401. package/dist/chunks/validatePlugin-Dw-RGCrm.js +0 -1
  402. package/dist/chunks/worktree-D38cJ23W.js +0 -1
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{KS as o,Mb as s,Nb as c,qS as l}from"./loadAgentsDir-DrDu5yYy.js";import{n as u,r as d}from"./analytics-BotDBGh0.js";import{Ut as f,Vt as p}from"./model-fi472PRc.js";import{t as m}from"./WelcomeV2-C93xQYAF.js";import{t as h}from"./useManagePlugins-BkK1zydO.js";import{n as g,t as _}from"./MCPConnectionManager-zdocEDgk.js";import{n as v}from"./onChangeAppState-CGVeNkt7.js";import{cwd as y}from"process";var b=e(r(),1);i(),c(),u(),g(),l(),p();var x=a();async function S(e){d(`tengu_setup_token_command`,{});let r=!f(),{ConsoleOAuthFlow:i}=await import(`./ConsoleOAuthFlow-BDr1Vx5K.js`);await new Promise(a=>{e.render((0,x.jsx)(o,{onChangeAppState:v,children:(0,x.jsx)(s,{children:(0,x.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),r&&(0,x.jsxs)(t,{flexDirection:`column`,children:[(0,x.jsx)(n,{color:`warning`,children:`Warning: You already have authentication configured via environment variable or API key helper.`}),(0,x.jsx)(n,{color:`warning`,children:`The setup-token command will create a new OAuth token which you can use instead.`})]}),(0,x.jsx)(i,{onDone:()=>{a()}})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-B540I-gq.js`).then(e=>({default:e.Doctor})));function w({onDone:e}){return h(),(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(C,{onDone:e})})}async function T(e){d(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(o,{children:(0,x.jsx)(s,{children:(0,x.jsx)(_,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,x.jsx)(w,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function E(e,t){let{setup:n}=await import(`./setup-DdbmxSZh.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-OkuNmjmB.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{T as doctorHandler,E as installHandler,S as setupTokenHandler};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{HS as o,Ob as s,US as c,kb as l}from"./loadAgentsDir-Clu7Uk6a.js";import{n as u,r as d}from"./analytics-BotDBGh0.js";import{Bt as f,Ht as p}from"./model-BQF64tZx.js";import{t as m}from"./WelcomeV2-C-UXdIng.js";import{t as h}from"./useManagePlugins-B8HD0RUh.js";import{n as g,t as _}from"./MCPConnectionManager-MWpKjeZT.js";import{n as v}from"./onChangeAppState-CHhRDkM7.js";import{cwd as y}from"process";var b=e(r(),1);i(),l(),u(),g(),c(),f();var x=a();async function S(e){d(`tengu_setup_token_command`,{});let r=!p(),{ConsoleOAuthFlow:i}=await import(`./ConsoleOAuthFlow-wGQuFt41.js`);await new Promise(a=>{e.render((0,x.jsx)(o,{onChangeAppState:v,children:(0,x.jsx)(s,{children:(0,x.jsxs)(t,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),r&&(0,x.jsxs)(t,{flexDirection:`column`,children:[(0,x.jsx)(n,{color:`warning`,children:`Warning: You already have authentication configured via environment variable or API key helper.`}),(0,x.jsx)(n,{color:`warning`,children:`The setup-token command will create a new OAuth token which you can use instead.`})]}),(0,x.jsx)(i,{onDone:()=>{a()}})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-CcJUwSQn.js`).then(e=>({default:e.Doctor})));function w({onDone:e}){return h(),(0,x.jsx)(b.Suspense,{fallback:null,children:(0,x.jsx)(C,{onDone:e})})}async function T(e){d(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(o,{children:(0,x.jsx)(s,{children:(0,x.jsx)(_,{dynamicMcpConfig:void 0,isStrictMcpConfig:!1,children:(0,x.jsx)(w,{onDone:()=>{t()}})})})}))}),e.unmount(),process.exit(0)}async function E(e,t){let{setup:n}=await import(`./setup-UI9uv2-K.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-C7qTB0V5.js`);await new Promise(n=>{let i=[];e&&i.push(e),t.force&&i.push(`--force`),r.call(e=>{n(),process.exit(+!!e.includes(`failed`))},{},i)})}export{T as doctorHandler,E as installHandler,S as setupTokenHandler};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{h as r,r as i}from"./lazySchema-DcIJE_0i.js";import{CO as a,DO as o,EO as s,QD as c,XD as l,ZD as u,_D as d,gD as f,wO as ee}from"./loadAgentsDir-Clu7Uk6a.js";import{C as p,F as m,I as h,S as g,V as _,a as v,d as y,l as b,p as x,w as te,z as S}from"./debug-BrXObCdR.js";import{St as C,_t as w,bt as T,xt as E,yt as D}from"./settings-Dlp5JTa_.js";import{o as ne,s as O}from"./log-BMCygSzM.js";import{homedir as re}from"os";import*as k from"path";import{join as ie,resolve as ae}from"path";import{randomBytes as oe}from"crypto";import{readFile as A,readdir as j,rename as M,stat as N,unlink as P,writeFile as F}from"fs/promises";function I(){return ie(f(),U)}async function L(){let e=I();try{let t=p(await A(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return b(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return b(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return b(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(b(`Install counts cache has invalid fetchedAt timestamp`),null):n.counts.every(e=>typeof e==`object`&&!!e&&typeof e.plugin==`string`&&typeof e.unique_installs==`number`)?Date.now()-r>G?(b(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(b(`Install counts cache has malformed entries`),null)}catch(e){return h(e)!==`ENOENT`&&b(`Failed to load install counts cache: ${m(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=f();await y().mkdir(r),await F(n,te(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),b(`Install counts cache saved successfully`)}catch(e){O(e);try{await P(n)}catch{}}}async function z(){b(`Fetching install counts from ${W}`);let e=performance.now();try{let n=await t.get(W,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return c(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw c(`install_counts`,W,`failure`,performance.now()-e,l(t)),t}}async function B(){let e=await L();if(e){b(`Using cached install counts`),c(`install_counts`,W,`cache_hit`,0);let t=new Map;for(let n of e.counts)t.set(n.plugin,n.unique_installs);return t}try{let e=await z();await R({version:H,fetchedAt:new Date().toISOString(),counts:e});let t=new Map;for(let n of e)t.set(n.plugin,n.unique_installs);return t}catch(e){return O(e),b(`Failed to fetch install counts: ${m(e)}`),null}}function V(e){if(e<1e3)return String(e);if(e<1e6){let t=(e/1e3).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}K`:`${t}K`}let t=(e/1e6).toFixed(1);return t.endsWith(`.0`)?`${t.slice(0,-2)}M`:`${t}M`}var H,U,W,G,K=e((()=>{n(),v(),S(),x(),ne(),g(),u(),d(),H=1,U=`install-counts-cache.json`,W=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,G=1440*60*1e3}));async function se(e){let t=e.trim(),n=y(),r=t.match(/^([a-zA-Z0-9._-]+@[^:]+:.+?(?:\.git)?)(#(.+))?$/);if(r?.[1]){let e=r[1],t=r[3];return t?{source:`git`,url:e,ref:t}:{source:`git`,url:e}}if(t.startsWith(`http://`)||t.startsWith(`https://`)){let e=t.match(/^([^#]+)(#(.+))?$/),n=e?.[1]||t,r=e?.[3];if(n.endsWith(`.git`)||n.includes(`/_git/`))return r?{source:`git`,url:n,ref:r}:{source:`git`,url:n};let i;try{i=new URL(n)}catch{return{source:`url`,url:n}}if((i.hostname===`github.com`||i.hostname===`www.github.com`)&&i.pathname.match(/^\/([^/]+\/[^/]+?)(\/|\.git|$)/)?.[1]){let e=n.endsWith(`.git`)?n:`${n}.git`;return r?{source:`git`,url:e,ref:r}:{source:`git`,url:e}}return{source:`url`,url:n}}let i=process.platform===`win32`&&(t.startsWith(`.\\`)||t.startsWith(`..\\`)||/^[a-zA-Z]:[/\\]/.test(t));if(t.startsWith(`./`)||t.startsWith(`../`)||t.startsWith(`/`)||t.startsWith(`~`)||i){let e=ae(t.startsWith(`~`)?t.replace(/^~/,re()):t),r;try{r=await n.stat(e)}catch(t){let n=h(t);return{error:n===`ENOENT`?`Path does not exist: ${e}`:`Cannot access path: ${e} (${n??t})`}}return r.isFile()?e.endsWith(`.json`)?{source:`file`,path:e}:{error:`File path must point to a .json file (marketplace.json), but got: ${e}`}:r.isDirectory()?{source:`directory`,path:e}:{error:`Path is neither a file nor a directory: ${e}`}}if(t.includes(`/`)&&!t.startsWith(`@`)){if(t.includes(`:`))return null;let e=t.match(/^([^#@]+)(?:[#@](.+))?$/),n=e?.[1]||t,r=e?.[2];return r?{source:`github`,repo:n,ref:r}:{source:`github`,repo:n}}return null}var ce=e((()=>{S(),x()}));function le(e){let t=k.basename(e),n=k.basename(k.dirname(e));return t===`plugin.json`?`plugin`:t===`marketplace.json`?`marketplace`:n===`.claude-plugin`?`plugin`:`unknown`}function q(e){return e.issues.map(e=>({path:e.path.join(`.`)||`root`,message:e.message,code:e.code}))}function J(e,t,n,r){e.includes(`..`)&&n.push({path:t,message:r?`Path contains "..": ${e}. ${r}`:`Path contains ".." which could be a path traversal attempt: ${e}`})}function ue(e){let t=e.replace(/^(\.\.\/)+/,``);return`Plugin source paths are resolved relative to the marketplace root (the directory containing .claude-plugin/), not relative to marketplace.json. Use "${t===e?`./plugins/my-plugin`:`./${t}`}" instead of "${e}".`}async function Y(e){let t=[],n=[],r=k.resolve(e),i;try{i=await A(r,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=p(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:r,fileType:`plugin`}}if(a&&typeof a==`object`){let e=a;e.commands&&(Array.isArray(e.commands)?e.commands:[e.commands]).forEach((e,n)=>{typeof e==`string`&&J(e,`commands[${n}]`,t)}),e.agents&&(Array.isArray(e.agents)?e.agents:[e.agents]).forEach((e,n)=>{typeof e==`string`&&J(e,`agents[${n}]`,t)}),e.skills&&(Array.isArray(e.skills)?e.skills:[e.skills]).forEach((e,n)=>{typeof e==`string`&&J(e,`skills[${n}]`,t)})}let o=a;if(typeof a==`object`&&a){let e=a,t=Object.keys(e).filter(e=>$.has(e));if(t.length>0){let r={...e};for(let e of t)delete r[e],n.push({path:e,message:`Field '${e}' belongs in the marketplace entry (marketplace.json), not plugin.json. It's harmless here but unused — Work Mate ignores it at load time.`});o=r}}let s=D().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Work Mate accepts it, but the Claude.ai marketplace sync requires kebab-case (lowercase letters, digits, and hyphens only, e.g., "my-plugin").`}),e.version||n.push({path:`version`,message:`No version specified. Consider adding a version following semver (e.g., "1.0.0")`}),e.description||n.push({path:`description`,message:`No description provided. Adding a description helps users understand what your plugin does`}),e.author||n.push({path:`author`,message:`No author information provided. Consider adding author details for plugin attribution`})}return{success:t.length===0,errors:t,warnings:n,filePath:r,fileType:`plugin`}}async function X(e){let t=[],n=[],i=k.resolve(e),a;try{a=await A(i,{encoding:`utf-8`})}catch(e){let t=h(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${m(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let o;try{o=p(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(o&&typeof o==`object`){let e=o;Array.isArray(e.plugins)&&e.plugins.forEach((e,n)=>{if(e&&typeof e==`object`&&`source`in e){let r=e.source;typeof r==`string`&&J(r,`plugins[${n}].source`,t,ue(r)),r&&typeof r==`object`&&`path`in r&&typeof r.path==`string`&&J(r.path,`plugins[${n}].source.path`,t)}})}let s=E().extend({plugins:r(T().strict())}).strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;if((!e.plugins||e.plugins.length===0)&&n.push({path:`plugins`,message:`Marketplace has no plugins defined`}),e.plugins){e.plugins.forEach((n,r)=>{e.plugins.filter(e=>e.name===n.name).length>1&&t.push({path:`plugins[${r}].name`,message:`Duplicate plugin name "${n.name}" found in marketplace`})});let r=k.dirname(i),a=k.basename(r)===`.claude-plugin`?k.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=k.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=p(await A(e,{encoding:`utf-8`}));typeof t.version==`string`&&(i=t.version)}catch{continue}i&&i!==r.version&&n.push({path:`plugins[${t}].version`,message:`Entry declares version "${r.version}" but ${r.source}/.claude-plugin/plugin.json says "${i}". At install time, plugin.json wins (calculatePluginVersion precedence) — the entry version is silently ignored. Update this entry to "${i}" to match.`})}}e.metadata?.description||n.push({path:`metadata.description`,message:`No marketplace description provided. Adding a description helps users understand what this marketplace offers`})}return{success:t.length===0,errors:t,warnings:n,filePath:i,fileType:`marketplace`}}function de(e,t,n){let r=[],i=[],s=t.match(a);if(!s)return i.push({path:`frontmatter`,message:`No frontmatter block found. Add YAML frontmatter between --- delimiters at the top of the file to set description and other metadata.`}),{success:!0,errors:r,warnings:i,filePath:e,fileType:n};let c=s[1]||``,l;try{l=o(c)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${m(t)}. At runtime this ${n} loads with empty metadata (all frontmatter fields silently dropped).`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n}}if(typeof l!=`object`||!l||Array.isArray(l))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(l)?`an array`:l===null?`null`:typeof l}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let u=l;if(u.description!==void 0){let e=u.description;typeof e!=`string`&&typeof e!=`number`&&typeof e!=`boolean`&&e!==null&&r.push({path:`description`,message:`description must be a string, got ${Array.isArray(e)?`array`:typeof e}. At runtime this value is dropped.`})}else i.push({path:`description`,message:`No description in frontmatter. A description helps users and Claude understand when to use this ${n}.`});u.name!==void 0&&u.name!==null&&typeof u.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof u.name}.`});let d=u[`allowed-tools`];d!=null&&(typeof d!=`string`&&!Array.isArray(d)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof d}.`}):Array.isArray(d)&&d.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let f=u.shell;if(f!=null)if(typeof f!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof f}.`});else{let e=f.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${f}'.`})}return{success:r.length===0,errors:r,warnings:i,filePath:e,fileType:n}}async function Z(e){let t;try{t=await A(e,{encoding:`utf-8`})}catch(t){return h(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${m(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${m(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=w().safeParse(n);return r.success?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:q(r.error),warnings:[],filePath:e,fileType:`hooks`}}async function Q(e,t){let n;try{n=await j(e,{withFileTypes:!0})}catch(e){let t=h(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>k.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=k.join(e,t.name);t.isDirectory()?r.push(...await Q(n,!1)):t.isFile()&&t.name.toLowerCase().endsWith(`.md`)&&r.push(n)}return r}async function fe(e){let t=[],n=[[`skill`,k.join(e,`skills`)],[`agent`,k.join(e,`agents`)],[`command`,k.join(e,`commands`)]];for(let[e,r]of n){let n=await Q(r,e===`skill`);for(let r of n){let n;try{n=await A(r,{encoding:`utf-8`})}catch(n){if(_(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${m(n)}`}],warnings:[],filePath:r,fileType:e});continue}let i=de(r,n,e);(i.errors.length>0||i.warnings.length>0)&&t.push(i)}}let r=await Z(k.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=k.resolve(e),n=null;try{n=await N(t)}catch(e){if(!_(e))throw e}if(n?.isDirectory()){let e=await X(k.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(k.join(t,`.claude-plugin`,`plugin.json`));return n.errors[0]?.code===`ENOENT`?{success:!1,errors:[{path:`directory`,message:`No manifest found in directory. Expected .claude-plugin/marketplace.json or .claude-plugin/plugin.json`}],warnings:[],filePath:t,fileType:`plugin`}:n}switch(le(e)){case`plugin`:return Y(e);case`marketplace`:return X(e);case`unknown`:try{let n=p(await A(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(h(e)===`ENOENT`)return{success:!1,errors:[{path:`file`,message:`File not found: ${t}`}],warnings:[],filePath:t,fileType:`plugin`}}return Y(e)}}var $,me=e((()=>{i(),S(),ee(),g(),s(),C(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{se as a,K as c,ce as i,pe as n,V as o,fe as r,B as s,me as t};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{b as t,c as n,g as r}from"./config-DiT2Z8dY.js";import{n as i,r as a}from"./analytics-BotDBGh0.js";var o;e((()=>{i(),r(),o=async()=>{let e=n().editorMode||`normal`;e===`emacs`&&(e=`normal`);let r=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:r})),a(`tengu_editor_mode_changed`,{mode:r,source:`command`}),{type:`text`,value:`Editor mode set to ${r}. ${r===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{b as t,c as n,g as r}from"./config-3m_9zSrj.js";import{n as i,r as a}from"./analytics-BotDBGh0.js";var o;e((()=>{i(),r(),o=async()=>{let e=n().editorMode||`normal`;e===`emacs`&&(e=`normal`);let r=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:r})),a(`tengu_editor_mode_changed`,{mode:r,source:`command`}),{type:`text`,value:`Editor mode set to ${r}. ${r===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
@@ -1 +1 @@
1
- import{F as e,z as t}from"./debug-BrXObCdR.js";import{Vt as n,kt as r}from"./model-fi472PRc.js";import{o as i,t as a}from"./bridgeMain-CzhBVCsN.js";import{resolve as o}from"path";n(),t();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),n=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:n,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>r()?.accessToken,onAuth401:async e=>!!r()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(t){t instanceof a?(console.error(`[remoteControl] permanent error: ${t.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${e(t)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
1
+ import{F as e,z as t}from"./debug-BrXObCdR.js";import{Bt as n,Ot as r}from"./model-BQF64tZx.js";import{o as i,t as a}from"./bridgeMain-BX2AkLPs.js";import{resolve as o}from"path";n(),t();var s=78,c=1;async function l(e){if(!e){console.error(`Error: --daemon-worker requires a worker kind`),process.exitCode=s;return}switch(e){case`remoteControl`:await u();break;default:console.error(`Error: unknown daemon worker kind '${e}'`),process.exitCode=s}}async function u(){let t=process.env.DAEMON_WORKER_DIR||o(`.`),n=process.env.DAEMON_WORKER_NAME||void 0,l=process.env.DAEMON_WORKER_SPAWN_MODE||`same-dir`,u=parseInt(process.env.DAEMON_WORKER_CAPACITY||`4`,10),d=process.env.DAEMON_WORKER_PERMISSION||void 0,f=process.env.DAEMON_WORKER_SANDBOX===`1`,p=process.env.DAEMON_WORKER_TIMEOUT_MS?parseInt(process.env.DAEMON_WORKER_TIMEOUT_MS,10):void 0,m=process.env.DAEMON_WORKER_CREATE_SESSION!==`0`,h=new AbortController,g=()=>h.abort();process.on(`SIGTERM`,g),process.on(`SIGINT`,g);let _={dir:t,name:n,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>r()?.accessToken,onAuth401:async e=>!!r()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(t){t instanceof a?(console.error(`[remoteControl] permanent error: ${t.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${e(t)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
@@ -0,0 +1 @@
1
+ import{Et as e,xt as t}from"./loadAgentsDir-Clu7Uk6a.js";e();export{t as execIntoTmuxWorktree};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{l as e,o as t}from"./chunks/envUtils-DSxRz_kt.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),t(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),e(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,"isTTY",{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`0.0.3 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-DIWVcO4e.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-dA1UCfC0.js`);await e();return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-B2QD2sKq.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-huQaTcNb.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-BWSUZ7Xg.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-BUyOCzUt.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-BESKzpm0.js`),{exitWithError:s}=await import(`./chunks/process-CNfq37LF.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-B9V3i5oZ.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-CLHy-BiF.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-Bwi9VqDF.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-huQaTcNb.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);r();let{initSinks:i}=await import(`./chunks/sinks-DbwDBd-E.js`);i();let{daemonMain:a}=await import(`./chunks/main-D862LI_d.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-BpINX4jw.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-huQaTcNb.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);r(),await(await import(`./chunks/bg-B0iMGM9C.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-huQaTcNb.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);i();let{initSinks:a}=await import(`./chunks/sinks-DbwDBd-E.js`);a();let{daemonMain:o}=await import(`./chunks/main-D862LI_d.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-CT5VxeRr.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-CT5VxeRr.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-huQaTcNb.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-D38cJ23W.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-xcoTbKQn.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-C_rVSWfm.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
2
+ import{l as e,o as t}from"./chunks/envUtils-DSxRz_kt.js";var n=globalThis.performance,r=new Map,i=new Map;function a(){return n.now()}function o(e){return r.set(e,a()),{name:e,entryType:`mark`,startTime:r.get(e),duration:0}}function s(e,t,n){let o,s;if(typeof t==`string`){let e=r.get(t),i=n?r.get(n):a();o=e??a(),s=(i??a())-o}else t&&typeof t==`object`?(o=t.start??0,s=(t.end??a())-o):(o=0,s=a());i.set(e,{name:e,startTime:o,duration:s})}function c(e){return e===`mark`?[...r.entries()].map(([e,t])=>({name:e,entryType:`mark`,startTime:t,duration:0})):e===`measure`?[...i.values()].map(e=>({name:e.name,entryType:`measure`,startTime:e.startTime,duration:e.duration})):[]}function l(e,t){return c(t??`mark`).concat(t===void 0?c(`measure`):[]).filter(t=>t.name===e)}function u(e){e===void 0?r.clear():r.delete(e)}function d(e){e===void 0?i.clear():i.delete(e)}var f={now:a,mark:o,measure:s,getEntriesByType:c,getEntriesByName:l,clearMarks:u,clearMeasures:d,clearResourceTimings:(()=>{}),setResourceTimingBufferSize:(()=>{}),markResourceTiming:(()=>{}),get timeOrigin(){return n.timeOrigin},get onresourcetimingbufferfull(){return n.onresourcetimingbufferfull},set onresourcetimingbufferfull(e){},toJSON(){return n.toJSON()}};function p(){globalThis.__performanceShimInstalled||(globalThis.__performanceShimInstalled=!0,globalThis.performance=f)}if(p(),t(),globalThis.MACRO===void 0&&(globalThis.MACRO={VERSION:process.env.CLAUDE_CODE_VERSION||`2.1.888`,BUILD_TIME:new Date().toISOString(),FEEDBACK_CHANNEL:``,ISSUES_EXPLAINER:``,NATIVE_PACKAGE_URL:``,PACKAGE_URL:``,VERSION_CHANGELOG:``}),e(process.env.CLAUDE_CODE_FORCE_INTERACTIVE)){for(let e of[process.stdin,process.stdout,process.stderr])if(!e.isTTY)try{Object.defineProperty(e,"isTTY",{value:!0,configurable:!0})}catch{}}if(process.env.COREPACK_ENABLE_AUTO_PIN=`0`,process.env.CLAUDE_CODE_REMOTE===`true`){let e=process.env.NODE_OPTIONS||``;process.env.NODE_OPTIONS=e?`${e} --max-old-space-size=8192`:`--max-old-space-size=8192`}async function m(){let e=process.argv.slice(2);if(e.length===1&&(e[0]===`--version`||e[0]===`-v`||e[0]===`-V`)){console.log(`0.0.5 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-DIWVcO4e.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-CCFI6-gM.js`);await e();return}if(e[0]===`--daemon-worker`||e[0]?.startsWith(`--daemon-worker=`)){let t=e[0]===`--daemon-worker`?e[1]:e[0].split(`=`)[1],{runDaemonWorker:n}=await import(`./chunks/workerRegistry-CzqQwCHC.js`);await n(t);return}if(e[0]===`remote-control`||e[0]===`rc`||e[0]===`remote`||e[0]===`sync`||e[0]===`bridge`){t(`cli_bridge_path`);let{enableConfigs:n}=await import(`./chunks/config-Bxt1UH1T.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-CjVCMwnq.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-DHkZVzJe.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-6lollTtZ.js`),{exitWithError:s}=await import(`./chunks/process-CNfq37LF.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-BQa4kzQo.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-DWEqKbXk.js`);!c()?.accessToken&&!l()&&s(a);let u=await r();u&&s(`Error: ${u}`);let d=i();d&&s(d);let{waitForPolicyLimitsToLoad:f,isPolicyAllowed:p}=await import(`./chunks/policyLimits-BkjgMQD0.js`);await f(),p(`allow_remote_control`)||s(`Error: Remote Control is disabled by your organization's policy.`),await o(e.slice(1));return}if(e[0]===`daemon`){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-Bxt1UH1T.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);r();let{initSinks:i}=await import(`./chunks/sinks-CXq8-7Qn.js`);i();let{daemonMain:a}=await import(`./chunks/main-D862LI_d.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-_N8aDaA8.js`),r=await n(e.slice(1).join(` `));await new Promise((e,t)=>{process.stdout.write(`${r}\n`,n=>{if(n){t(n);return}e()})}),process.exit(0)}if(e.includes(`--bg`)||e.includes(`--background`)){t(`cli_daemon_path`);let{enableConfigs:n}=await import(`./chunks/config-Bxt1UH1T.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);r(),await(await import(`./chunks/bg-B0iMGM9C.js`)).handleBgStart(e.filter(e=>e!==`--bg`&&e!==`--background`));return}if(e[0]===`ps`||e[0]===`logs`||e[0]===`attach`||e[0]===`kill`){let n=e[0]===`ps`?`status`:e[0];console.error(`[deprecated] Use: claude daemon ${n}${e[1]?` `+e[1]:``}`),t(`cli_daemon_path`);let{enableConfigs:r}=await import(`./chunks/config-Bxt1UH1T.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);i();let{initSinks:a}=await import(`./chunks/sinks-CXq8-7Qn.js`);a();let{daemonMain:o}=await import(`./chunks/main-D862LI_d.js`);await o([e[0]===`ps`?`status`:e[0],...e.slice(1)]);return}if(e[0]===`job`){t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BnOBSFtq.js`);await n(e.slice(1)),process.exit(0)}if(e[0]===`new`||e[0]===`list`||e[0]===`reply`){console.error(`[deprecated] Use: claude job ${e[0]} ${e.slice(1).join(` `)}`.trim()),t(`cli_templates_path`);let{templatesMain:n}=await import(`./chunks/templateJobs-BnOBSFtq.js`);await n(e),process.exit(0)}if((e.includes(`--tmux`)||e.includes(`--tmux=classic`))&&(e.includes(`-w`)||e.includes(`--worktree`)||e.some(e=>e.startsWith(`--worktree=`)))){t(`cli_tmux_worktree_fast_path`);let{enableConfigs:n}=await import(`./chunks/config-Bxt1UH1T.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-DMhP5T0p.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.js`);e(n.error)}}}e.length===1&&(e[0]===`--update`||e[0]===`--upgrade`)&&(process.argv=[process.argv[0],process.argv[1],`update`]),e.includes(`--bare`)&&(process.env.CLAUDE_CODE_SIMPLE=`1`);let{startCapturingEarlyInput:n}=await import(`./chunks/earlyInput-xcoTbKQn.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-gtV_TqXP.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@readmagic/workmate",
3
- "version": "0.0.3",
3
+ "version": "0.0.5",
4
4
  "description": "workMate",
5
5
  "type": "module",
6
6
  "author": "Frandy",
@@ -92,6 +92,7 @@
92
92
  "@readmagic/workmate-agent-tools": "workspace:*",
93
93
  "@readmagic/workmate-builtin-tools": "workspace:*",
94
94
  "@readmagic/workmate-mcp-client": "workspace:*",
95
+ "@readmagic/workmate-workflow-engine": "workspace:*",
95
96
  "@commander-js/extra-typings": "^14.0.0",
96
97
  "@modelcontextprotocol/sdk": "^1.29.0",
97
98
  "@opentelemetry/api": "^1.9.1",
@@ -116,7 +117,6 @@
116
117
  "@smithy/node-http-handler": "^4.5.3",
117
118
  "@types/bun": "^1.3.12",
118
119
  "@types/cacache": "^20.0.1",
119
- "@types/he": "^1.2.3",
120
120
  "@types/lodash-es": "^4.17.12",
121
121
  "@types/node": "^25.6.0",
122
122
  "@types/picomatch": "^4.0.3",
@@ -129,10 +129,8 @@
129
129
  "@types/sharp": "^0.32.0",
130
130
  "@types/shell-quote": "^1.7.5",
131
131
  "@types/stack-utils": "^2.0.3",
132
- "@types/turndown": "^5.0.6",
133
132
  "@types/ws": "^8.18.1",
134
133
  "ajv": "^8.18.0",
135
- "asciichart": "^1.5.25",
136
134
  "auto-bind": "^5.0.1",
137
135
  "axios": "^1.15.2",
138
136
  "bidi-js": "^1.0.3",
@@ -152,7 +150,6 @@
152
150
  "fuse.js": "^7.3.0",
153
151
  "get-east-asian-width": "^1.5.0",
154
152
  "google-auth-library": "^10.6.2",
155
- "he": "^1.2.0",
156
153
  "https-proxy-agent": "^8.0.0",
157
154
  "husky": "^9.1.7",
158
155
  "ignore": "^7.0.5",
@@ -183,7 +180,6 @@
183
180
  "strip-ansi": "^7.2.0",
184
181
  "supports-hyperlinks": "^4.4.0",
185
182
  "tree-kill": "^1.2.2",
186
- "turndown": "^7.2.4",
187
183
  "type-fest": "^5.6.0",
188
184
  "typescript": "^6.0.3",
189
185
  "undici": "^7.25.0",
@@ -1 +0,0 @@
1
- import{t as e}from"./ApproveApiKey-36iUE5CW.js";export{e as ApproveApiKey};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n,r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{D as o,Gt as s,H as c,I as l,Lt as u,P as d,T as f,fi as p,mt as m,ot as h,t as g,y as _}from"./src-CDCSSo0U2.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{An as y,Au as b,Bb as x,Cu as ee,Dh as S,Dx as C,Eh as te,Eu as w,Ey as T,Fy as ne,HO as re,JS as ie,Km as ae,Mn as oe,Mu as se,Ox as ce,Qa as le,Sy as ue,TS as E,Ty as D,UO as O,Vb as k,XS as de,Xu as fe,Yu as pe,_x as A,df as me,ff as he,ia as ge,jm as _e,jy as ve,km as ye,ku as be,lC as xe,na as Se,pf as Ce,qS as we,qm as Te,qo as Ee,uf as De,vx as Oe,wS as ke,wo as Ae,wx as je,xx as Me,zo as Ne}from"./loadAgentsDir-DrDu5yYy.js";import{F as Pe,p as Fe,v as Ie,z as Le}from"./debug-BrXObCdR.js";import{Kt as Re,_n as ze,gn as j,nt as Be,vn as Ve}from"./settings-DfWP5y6X.js";import{S as M,T as He,b as N,d as Ue,p as We,u as Ge}from"./startupProfiler-xa3NmN7Z.js";import{l as P,o as Ke}from"./stringUtils-DGLPkqJ4.js";import{Cn as qe,Rt as Je,Tn as Ye,Ut as Xe,wn as Ze}from"./prompt-C0nU0VK3.js";import{u as F}from"./referral-DrebVwqx.js";import{n as Qe,t as $e}from"./browser-BmZuQom6.js";import{t as et}from"./Dialog-vfLXEPed.js";import{i as tt,n as nt}from"./mappers-D0CNXG32.js";function I(e,t,n=1e3,r=0,i){let a=()=>Ge(Math.max(0,(i??Date.now())-e-r));return(0,rt.useSyncExternalStore)((0,rt.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var rt,L=t((()=>{rt=n(p(),1),N()}));function it(e,t,n){let r=qe(t,e.toolName);if(!r)return e.toolName;try{let t=r.inputSchema.safeParse(e.input),i=t.success?t.data:{},a=r.userFacingName(i);if(!a)return e.toolName;let o=r.renderToolUseMessage(i,{theme:n,verbose:!1});return o?(0,at.jsxs)(d,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var at,ot=t((()=>{p(),g(),Ye(),at=v()}));function st(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:o}=t??{};return i?a.cross:r?a.questionMarkPrefix:o?a.warning:e===`running`?n?a.ellipsis:a.play:e===`completed`?a.tick:e===`failed`||e===`killed`?a.cross:a.bullet}function ct(e,t){let{isIdle:n,awaitingApproval:r,hasError:i,shutdownRequested:a}=t??{};return i?`error`:r||a?`warning`:n?`background`:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:`background`}function lt(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(!(!k(t)||process.env.USER_TYPE===`ant`&&se(t)))return n=!0,!1;return n}var ut=t((()=>{i(),b(),x()}));function dt({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=c(),a=(0,ft.useMemo)(()=>pe(Ze()),[]),u=I(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);s({"confirm:yes":t},{context:`Confirmation`});let p=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},m=Ae(e.prompt,`plan`),h=e.prompt.length>300?e.prompt.substring(0,297)+`…`:e.prompt,g=e.result?.totalTokens??e.progress?.tokenCount,v=e.result?.totalToolUseCount??e.progress?.toolUseCount;return(0,R.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:p,children:(0,R.jsx)(_,{title:(0,R.jsxs)(d,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,R.jsxs)(d,{children:[e.status!==`running`&&(0,R.jsxs)(d,{color:ct(e.status),children:[st(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,R.jsxs)(d,{dimColor:!0,children:[u,g!==void 0&&g>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,We(g),` tokens`]}),v!==void 0&&v>0&&(0,R.jsxs)(R.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,R.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,R.jsxs)(f,{children:[r&&(0,R.jsx)(o,{shortcut:`←`,action:`go back`}),(0,R.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,R.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,R.jsxs)(l,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,R.jsxs)(l,{flexDirection:`column`,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,R.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,it(t,a,i)]},n))]}),m?(0,R.jsx)(l,{marginTop:1,children:(0,R.jsx)(ae,{addMargin:!1,planContent:m})}):(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,R.jsx)(d,{wrap:`wrap`,children:h})]}),e.status===`failed`&&e.error&&(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,R.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var ft,R,pt=t((()=>{ft=n(p(),1),L(),g(),F(),Ye(),fe(),N(),Ne(),Te(),ot(),ut(),R=v()}));function mt(e,t,n,r){if(!e)return`${t} found · ${n} verified`;if(e===`synthesizing`){let e=[`${n} verified`];return r>0&&e.push(`${r} refuted`),e.push(`deduping`),e.join(` · `)}if(e===`verifying`){let e=[`${t} found`,`${n} verified`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return t>0?`${t} found`:`finding`}function ht({text:e,phase:t=0}){return(0,z.jsx)(z.Fragment,{children:[...e].map((e,n)=>(0,z.jsx)(d,{color:re(n+t),children:e},n))})}function gt(e,t,n){let r=(0,yt.useRef)(e),i=(0,yt.useRef)(t);return n||e<r.current?r.current=e:e>r.current&&t!==i.current&&(r.current+=1,i.current=t),r.current}function _t({session:e}){let t=E().prefersReducedMotion??!1,n=e.reviewProgress,r=e.status===`running`,[,i]=m(r&&!t?bt:null),a=n?.bugsFound??0,o=n?.bugsVerified??0,s=n?.bugsRefuted??0,c=t||!r,l=gt(a,i,c),u=gt(o,i,c),f=gt(s,i,c),p=Math.floor(i/(bt*3))%7;if(e.status===`completed`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:0}),(0,z.jsx)(d,{dimColor:!0,children:` ready · shift+↓ to view`})]});if(e.status===`failed`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:0}),(0,z.jsxs)(d,{color:`error`,dimColor:!0,children:[` · `,`error`]})]});let h=n?mt(n.stage,l,u,f):`setting up`;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◇`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:r?p:0}),(0,z.jsxs)(d,{dimColor:!0,children:[` · `,h]})]})}function vt({session:e}){if(e.isRemoteReview)return(0,z.jsx)(_t,{session:e});if(e.status===`completed`)return(0,z.jsx)(d,{bold:!0,color:`success`,dimColor:!0,children:`done`});if(e.status===`failed`)return(0,z.jsx)(d,{bold:!0,color:`error`,dimColor:!0,children:`error`});if(!e.todoList.length)return(0,z.jsxs)(d,{dimColor:!0,children:[e.status,`…`]});let t=j(e.todoList,e=>e.status===`completed`),n=e.todoList.length;return(0,z.jsxs)(d,{dimColor:!0,children:[t,`/`,n]})}var yt,z,bt,xt=t((()=>{yt=n(p(),1),Re(),ke(),g(),ze(),O(),z=v(),bt=80}));function B({status:e,label:t,suffix:n}){return(0,V.jsxs)(d,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function St({shell:e}){switch(e.status){case`completed`:return(0,V.jsx)(B,{status:`completed`,label:`done`});case`failed`:return(0,V.jsx)(B,{status:`failed`,label:`error`});case`killed`:return(0,V.jsx)(B,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,V.jsx)(B,{status:`running`})}}var V,Ct=t((()=>{g(),V=v()}));function wt({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,H.jsxs)(d,{children:[M(e.kind===`monitor`?e.description:e.command,n,!0),` `,(0,H.jsx)(St,{shell:e})]});case`remote_agent`:return e.isRemoteReview?(0,H.jsx)(d,{children:(0,H.jsx)(vt,{session:e})}):(0,H.jsxs)(d,{children:[(0,H.jsxs)(d,{dimColor:!0,children:[e.status===`running`||e.status===`pending`?`◇`:`◆`,` `]}),M(e.title,n,!0),(0,H.jsx)(d,{dimColor:!0,children:` · `}),(0,H.jsx)(vt,{session:e})]});case`local_agent`:return(0,H.jsxs)(d,{children:[M(e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`local_workflow`:{let t=e;return(0,H.jsxs)(d,{children:[M(t.workflowName??e.summary??e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`running`?`${t.agentCount} ${P(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`monitor_mcp`:return(0,H.jsxs)(d,{children:[M(e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`dream`:{let t=e.filesTouched.length,n=e.phase===`updating`&&t>0?`${t} ${P(t,`file`)}`:`${e.sessionsReviewing} ${P(e.sessionsReviewing,`session`)}`;return(0,H.jsxs)(d,{children:[e.description,` `,(0,H.jsxs)(d,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var H,Tt=t((()=>{p(),g(),N(),Ke(),Re(),xt(),Ct(),H=v()}));function Et({task:e,onDone:t,onBack:n,onKill:r}){let i=I(e.startTime,e.status===`running`,1e3,0);s({"confirm:yes":t},{context:`Confirmation`});let a=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&n?(i.preventDefault(),n()):i.key===`x`&&e.status===`running`&&r&&(i.preventDefault(),r())},c=e.turns.filter(e=>e.text!==``),u=c.slice(-6),p=c.length-u.length;return(0,U.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,U.jsx)(_,{title:`Memory consolidation`,subtitle:(0,U.jsxs)(d,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,P(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,P(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(f,{children:[n&&(0,U.jsx)(o,{shortcut:`←`,action:`go back`}),(0,U.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,U.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,U.jsxs)(d,{children:[(0,U.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,U.jsx)(d,{color:`background`,children:`running`}):e.status===`completed`?(0,U.jsx)(d,{color:`success`,children:e.status}):(0,U.jsx)(d,{color:`error`,children:e.status})]}),u.length===0?(0,U.jsx)(d,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,U.jsxs)(U.Fragment,{children:[p>0&&(0,U.jsxs)(d,{dimColor:!0,children:[`(`,p,` earlier `,P(p,`turn`),`)`]}),u.map((e,t)=>(0,U.jsxs)(l,{flexDirection:`column`,children:[(0,U.jsx)(d,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,U.jsxs)(d,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,P(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var U,Dt=t((()=>{p(),L(),g(),F(),Ke(),U=v()}));function Ot(e,t){if(e===`ExitPlanMode`)return`Review the plan in Claude Code on the web`;if(!t||typeof t!=`object`)return e;if(e===`AskUserQuestion`&&`questions`in t){let e=t.questions;if(Array.isArray(e)&&e[0]&&typeof e[0]==`object`){let t=`question`in e[0]&&typeof e[0].question==`string`&&e[0].question?e[0].question:`header`in e[0]&&typeof e[0].header==`string`?e[0].header:null;if(t)return`Answer in browser: ${He(t.replace(/\s+/g,` `).trim(),50)}`}}for(let n of Object.values(t))if(typeof n==`string`&&n.trim())return`${e} ${He(n.replace(/\s+/g,` `).trim(),60)}`;return e}function kt({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`running`||e.status===`pending`,o=e.ultraplanPhase,s=i?o?Pt[o]:`running`:e.status,c=I(e.startTime,i,1e3,0,e.endTime),{agentsWorking:f,toolCalls:p,lastToolCall:m}=(0,W.useMemo)(()=>{let t=0,n=0,r=null;for(let i of e.log){if(i.type!==`assistant`)continue;let e=i.message?.content??[];for(let i of e)i.type===`tool_use`&&(n++,r=i,(i.name===`Agent`||i.name===`Task`)&&t++)}return{agentsWorking:1+t,toolCalls:n,lastToolCall:r?Ot(r.name,r.input):null}},[e.log]),h=D(e.sessionId),g=n??(()=>t(`Remote session details dismissed`,{display:`system`})),[v,y]=(0,W.useState)(!1);return v?(0,G.jsx)(_,{title:`Stop ultraplan?`,onCancel:()=>y(!1),color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(d,{dimColor:!0,children:`This will terminate the Claude Code on the web session.`}),(0,G.jsx)(A,{options:[{label:`Terminate session`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),g()):y(!1)}})]})}):(0,G.jsx)(_,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:`background`,children:[o===`plan_ready`?`◆`:`◇`,` `]}),(0,G.jsx)(d,{bold:!0,children:`ultraplan`}),(0,G.jsxs)(d,{dimColor:!0,children:[` · `,c,` · `,s]})]}),onCancel:g,color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsxs)(d,{children:[o===`plan_ready`&&(0,G.jsxs)(d,{color:`success`,children:[a.tick,` `]}),f,` `,P(f,`agent`),` `,o?Ft[o]:`working`,` · `,p,` tool`,` `,P(p,`call`)]}),m&&(0,G.jsx)(d,{dimColor:!0,children:m}),(0,G.jsx)(u,{url:h,children:(0,G.jsx)(d,{dimColor:!0,children:h})}),(0,G.jsx)(A,{options:[{label:`Review in Claude Code on the web`,value:`open`},...r&&i?[{label:`Stop ultraplan`,value:`stop`}]:[],{label:`Back`,value:`back`}],onChange:e=>{switch(e){case`open`:Qe(h),t();return;case`stop`:y(!0);return;case`back`:g();return}}})]})})}function At({stage:e,completed:t,hasProgress:n}){let r=e?It.indexOf(e):-1,i=!t&&!n;return(0,G.jsxs)(d,{children:[i?(0,G.jsx)(d,{color:`background`,children:`Setup`}):(0,G.jsx)(d,{dimColor:!0,children:`Setup`}),(0,G.jsx)(d,{dimColor:!0,children:` → `}),It.map((e,n)=>{let a=!t&&!i&&n===r;return(0,G.jsxs)(W.Fragment,{children:[n>0&&(0,G.jsx)(d,{dimColor:!0,children:` → `}),a?(0,G.jsx)(d,{color:`background`,children:Lt[e]}):(0,G.jsx)(d,{dimColor:!0,children:Lt[e]})]},e)}),t&&(0,G.jsx)(d,{color:`success`,children:` ✓`})]})}function jt(e){let t=e.reviewProgress;if(!t)return e.status===`completed`?`done`:`setting up`;let n=t.bugsVerified,r=t.bugsRefuted??0;if(e.status===`completed`){let e=[`${n} ${P(n,`finding`)}`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return mt(t.stage,t.bugsFound,n,r)}function Mt({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`completed`,a=e.status===`running`||e.status===`pending`,[s,c]=(0,W.useState)(!1),p=I(e.startTime,a,1e3,0,e.endTime),m=()=>t(`Remote session details dismissed`,{display:`system`}),h=n??m,g=D(e.sessionId),v=i?`ready`:a?`running`:e.status;if(s)return(0,G.jsx)(_,{title:`Stop ultrareview?`,onCancel:()=>c(!1),color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(d,{dimColor:!0,children:`This archives the remote session and stops local tracking. The review will not complete and any findings so far are discarded.`}),(0,G.jsx)(A,{options:[{label:`Stop ultrareview`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),h()):c(!1)}})]})});let y=i?[{label:`Open in Claude Code on the web`,value:`open`},{label:`Dismiss`,value:`dismiss`}]:[{label:`Open in Claude Code on the web`,value:`open`},...r&&a?[{label:`Stop ultrareview`,value:`stop`}]:[],{label:`Back`,value:`back`}];return(0,G.jsx)(_,{title:(0,G.jsxs)(d,{children:[(0,G.jsxs)(d,{color:`background`,children:[i?`◆`:`◇`,` `]}),(0,G.jsx)(d,{bold:!0,children:`ultrareview`}),(0,G.jsxs)(d,{dimColor:!0,children:[` · `,p,` · `,v]})]}),onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(f,{children:[(0,G.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,G.jsx)(o,{shortcut:`Esc`,action:`go back`})]}),children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(At,{stage:e.reviewProgress?.stage,completed:i,hasProgress:!!e.reviewProgress}),(0,G.jsxs)(l,{flexDirection:`column`,children:[(0,G.jsx)(d,{children:jt(e)}),(0,G.jsx)(u,{url:g,children:(0,G.jsx)(d,{dimColor:!0,children:g})})]}),(0,G.jsx)(A,{options:y,onChange:e=>{switch(e){case`open`:Qe(g),t();break;case`stop`:c(!0);break;case`back`:h();break;case`dismiss`:m();break}}})]})})}function Nt({session:e,toolUseContext:t,onDone:n,onBack:r,onKill:i}){let[a,s]=(0,W.useState)(!1),[c,p]=(0,W.useState)(null),m=(0,W.useMemo)(()=>e.isUltraplan||e.isRemoteReview?[]:Ee(tt(e.log)).filter(e=>e.type!==`progress`).slice(-3),[e]);if(e.isUltraplan)return(0,G.jsx)(kt,{session:e,onDone:n,onBack:r,onKill:i});if(e.isRemoteReview)return(0,G.jsx)(Mt,{session:e,onDone:n,onBack:r,onKill:i});let h=()=>n(`Remote session details dismissed`,{display:`system`}),g=e=>{e.key===` `?(e.preventDefault(),n(`Remote session details dismissed`,{display:`system`})):e.key===`left`&&r?(e.preventDefault(),r()):e.key===`t`&&!a?(e.preventDefault(),v()):e.key===`return`&&(e.preventDefault(),h())};async function v(){s(!0),p(null);try{await ne(e.sessionId)}catch(e){p(Pe(e))}finally{s(!1)}}let y=He(e.title,50),b=e.status===`pending`?`starting`:e.status;return(0,G.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,G.jsxs)(_,{title:`Remote session details`,onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(f,{children:[r&&(0,G.jsx)(o,{shortcut:`←`,action:`go back`}),(0,G.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),!a&&(0,G.jsx)(o,{shortcut:`t`,action:`teleport`})]}),children:[(0,G.jsxs)(l,{flexDirection:`column`,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Status`}),`:`,` `,b===`running`||b===`starting`?(0,G.jsx)(d,{color:`background`,children:b}):b===`completed`?(0,G.jsx)(d,{color:`success`,children:b}):(0,G.jsx)(d,{color:`error`,children:b})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Runtime`}),`: `,Ge((e.endTime??Date.now())-e.startTime)]}),(0,G.jsxs)(d,{wrap:`truncate-end`,children:[(0,G.jsx)(d,{bold:!0,children:`Title`}),`: `,y]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Progress`}),`: `,(0,G.jsx)(vt,{session:e})]}),(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Session URL`}),`:`,` `,(0,G.jsx)(u,{url:D(e.sessionId),children:(0,G.jsx)(d,{dimColor:!0,children:D(e.sessionId)})})]})]}),e.log.length>0&&(0,G.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Recent messages`}),`:`]}),(0,G.jsx)(l,{flexDirection:`column`,height:10,overflowY:`hidden`,children:m.map((e,n)=>(0,G.jsx)(ye,{message:e,lookups:le,addMargin:n>0,tools:t.options.tools,commands:t.options.commands,verbose:t.options.verbose,inProgressToolUseIDs:new Set,progressMessagesForMessage:[],shouldAnimate:!1,shouldShowDot:!1,style:`condensed`,isTranscriptMode:!1,isStatic:!0},n))}),(0,G.jsx)(l,{marginTop:1,children:(0,G.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing last `,m.length,` of `,e.log.length,` messages`]})})]}),c&&(0,G.jsx)(l,{marginTop:1,children:(0,G.jsxs)(d,{color:`error`,children:[`Teleport failed: `,c]})}),a&&(0,G.jsx)(d,{color:`background`,children:`Teleporting to session…`})]})})}var W,G,Pt,Ft,It,Lt,Rt=t((()=>{i(),W=n(p(),1),Re(),L(),g(),T(),Be(),Je(),Xe(),$e(),Le(),N(),nt(),Ne(),Ke(),ve(),Oe(),_e(),xt(),G=v(),Pt={needs_input:`input required`,plan_ready:`ready`},Ft={needs_input:`waiting`,plan_ready:`done`},It=[`finding`,`verifying`,`synthesizing`],Lt={finding:`Find`,verifying:`Verify`,synthesizing:`Dedupe`}}));async function zt(e){let t=y(e.id);try{let e=await Ie(t,Ht);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Bt({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=h(),[a,c]=(0,K.useState)(()=>zt(e)),u=(0,K.useDeferredValue)(a);(0,K.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(zt(t)),1e3,c,e);return()=>clearInterval(t)},[e.id,e.status]);let p=()=>t(`Shell details dismissed`,{display:`system`});s({"confirm:yes":p},{context:`Confirmation`});let m=i=>{i.key===` `?(i.preventDefault(),t(`Shell details dismissed`,{display:`system`})):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},g=e.kind===`monitor`,v=He(e.command,280);return(0,q.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:m,children:(0,q.jsxs)(_,{title:g?`Monitor details`:`Shell details`,onCancel:p,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(f,{children:[r&&(0,q.jsx)(o,{shortcut:`←`,action:`go back`}),(0,q.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,q.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:[(0,q.jsxs)(l,{flexDirection:`column`,children:[(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,q.jsxs)(d,{color:`background`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):e.status===`completed`?(0,q.jsxs)(d,{color:`success`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]}):(0,q.jsxs)(d,{color:`error`,children:[e.status,e.result?.code!==void 0&&` (exit code: ${e.result.code})`]})]}),(0,q.jsxs)(d,{children:[(0,q.jsx)(d,{bold:!0,children:`Runtime:`}),` `,Ge((e.endTime??Date.now())-e.startTime)]}),(0,q.jsxs)(d,{wrap:`wrap`,children:[(0,q.jsx)(d,{bold:!0,children:g?`Script:`:`Command:`}),` `,v]})]}),(0,q.jsxs)(l,{flexDirection:`column`,children:[(0,q.jsx)(d,{bold:!0,children:`Output:`}),(0,q.jsx)(K.Suspense,{fallback:(0,q.jsx)(d,{dimColor:!0,children:`Loading output…`}),children:(0,q.jsx)(Vt,{outputPromise:u,columns:i})})]})]})})}function Vt({outputPromise:e,columns:t}){let{content:n,bytesTotal:r}=(0,K.use)(e);if(!n)return(0,q.jsx)(d,{dimColor:!0,children:`No output available`});let i=[],a=n.length;for(let e=0;e<10&&a>0;e++){let e=n.lastIndexOf(`
2
- `,a-1);i.push(e+1),a=e}i.reverse();let o=r>n.length,s=[];for(let e=0;e<i.length;e++){let t=i[e],r=e<i.length-1?i[e+1]-1:n.length,a=n.slice(t,r);a&&s.push(a)}return(0,q.jsxs)(q.Fragment,{children:[(0,q.jsx)(l,{borderStyle:`round`,paddingX:1,flexDirection:`column`,height:12,maxWidth:t-6,children:s.map((e,t)=>(0,q.jsx)(d,{wrap:`truncate-end`,children:e},t))}),(0,q.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing ${s.length} lines`,o?` of ${Ue(r)}`:``]})]})}var K,q,Ht,Ut=t((()=>{K=n(p(),1),xe(),g(),F(),N(),Fe(),oe(),q=v(),Ht=8192})),Wt=t((()=>{g()})),Gt=t((()=>{g()})),Kt=r({MonitorMcpDetailDialog:()=>qt});function qt({task:e,onBack:t,onKill:n}){let r=I(e.startTime,e.status===`running`,1e3,0);return s({},{context:`MonitorMcpDetail`}),(0,J.jsx)(l,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:r=>{r.key===`left`&&t?(r.preventDefault(),t()):r.key===`x`&&e.status===`running`&&n&&(r.preventDefault(),n())},children:(0,J.jsx)(_,{title:`MCP Monitor`,subtitle:(0,J.jsxs)(d,{dimColor:!0,children:[r,` · `,e.serverName,`:`,e.resourceUri]}),onCancel:t??(()=>{}),inputGuide:()=>(0,J.jsxs)(f,{children:[t&&(0,J.jsx)(o,{shortcut:`←`,action:`go back`}),(0,J.jsx)(o,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,J.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,J.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,J.jsx)(d,{color:`ansi:green`,children:`running`}):e.status===`completed`?(0,J.jsx)(d,{color:`ansi:green`,children:e.status}):(0,J.jsx)(d,{color:`ansi:red`,children:e.status})]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Description:`}),` `,e.description]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Server:`}),` `,e.serverName]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Resource:`}),` `,e.resourceUri]}),e.command&&(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Command:`}),` `,e.command]})]})})})}var J,Jt=t((()=>{p(),L(),g(),F(),Wt(),et(),Gt(),J=v()}));function Yt(e,t){return Object.values(e??{}).filter(k).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Xt({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=ie(e=>e.tasks),i=ie(e=>e.foregroundedTaskId),a=de(),c=ce(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),u=r,p=(0,X.useRef)(!1),[m,h]=(0,X.useState)(()=>{if(n)return p.current=!0,{mode:`detail`,itemId:n};let e=Yt(u,i);return e.length===1?(p.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[g,v]=(0,X.useState)(0);je(`background-tasks-dialog`);let{bashTasks:y,remoteSessions:b,agentTasks:x,workflowTasks:S,mcpMonitors:C,dreamTasks:te,allSelectableItems:w}=(0,X.useMemo)(()=>{let e=Object.values(u??{}).filter(k).map(Zt).sort((e,t)=>{let n=e.status,r=t.status;if(n===`running`&&r!==`running`)return-1;if(n!==`running`&&r===`running`)return 1;let i=`task`in e?e.task.startTime:0;return(`task`in t?t.task.startTime:0)-i}),t=e.filter(e=>e.type===`local_bash`),n=e.filter(e=>e.type===`remote_agent`),r=e.filter(e=>e.type===`local_agent`&&e.id!==i),a=e.filter(e=>e.type===`local_workflow`),o=e.filter(e=>e.type===`monitor_mcp`),s=e.filter(e=>e.type===`dream`);return{bashTasks:t,remoteSessions:n,agentTasks:r,workflowTasks:a,mcpMonitors:o,dreamTasks:s,allSelectableItems:[...t,...o,...n,...r,...a,...s]}},[u,i]),T=w[g]??null;s({"confirm:previous":()=>v(e=>Math.max(0,e-1)),"confirm:next":()=>v(e=>Math.min(w.length-1,e+1)),"confirm:yes":()=>{let e=w[g];e&&h({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:m.mode===`list`});let ne=t=>{if(m.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=w[g];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?re(n.id):n.type===`local_agent`&&n.status===`running`?ae(n.id):n.type===`local_workflow`&&n.status===`running`&&Q?Q(n.id,a):n.type===`monitor_mcp`&&n.status===`running`&&$?$(n.id,a):n.type===`dream`&&n.status===`running`?oe(n.id):n.type===`remote_agent`&&n.status===`running`&&(n.task.isUltraplan?ge(n.id,n.task.sessionId,a):se(n.id)))};async function re(e){await ee.kill(e,a)}async function ae(e){await be.kill(e,a)}async function oe(e){await he.kill(e,a)}async function se(e){await ue.kill(e,a)}let le=(0,X.useEffectEvent)(e);(0,X.useEffect)(()=>{if(m.mode!==`list`){let e=(u??{})[m.itemId];(!e||e.type!==`local_workflow`&&!k(e))&&(p.current?le(`Background tasks dialog dismissed`,{display:`system`}):h({mode:`list`}))}let e=w.length;g>=e&&e>0&&v(e-1)},[m,u,g,w,le]);let E=()=>{p.current&&w.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(p.current=!1,h({mode:`list`}))};if(m.mode!==`list`&&u){let n=u[m.itemId];if(!n)return null;switch(n.type){case`local_bash`:return(0,Z.jsx)(Bt,{shell:n,onDone:e,onKillShell:()=>void re(n.id),onBack:E},`shell-${n.id}`);case`local_agent`:return(0,Z.jsx)(dt,{agent:n,onDone:e,onKillAgent:()=>void ae(n.id),onBack:E},`agent-${n.id}`);case`remote_agent`:return(0,Z.jsx)(Nt,{session:n,onDone:e,toolUseContext:t,onBack:E,onKill:n.status===`running`?n.isUltraplan?()=>void ge(n.id,n.sessionId,a):()=>void se(n.id):void 0},`session-${n.id}`);case`local_workflow`:{let e=n.status===`running`&&Q?()=>Q(n.id,a):void 0;return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),E()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Z.jsx)(_,{title:n.workflowName,subtitle:(0,Z.jsxs)(d,{dimColor:!0,children:[n.status,n.summary?` · ${n.summary}`:``]}),onCancel:E,inputGuide:()=>(0,Z.jsxs)(f,{children:[(0,Z.jsx)(o,{shortcut:`←`,action:`go back`}),(0,Z.jsx)(o,{shortcut:`Esc`,action:`close`}),e&&(0,Z.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:n.status===`failed`&&n.error?(0,Z.jsxs)(l,{flexDirection:`column`,children:[(0,Z.jsxs)(d,{color:`error`,children:[`失败原因:`,n.error]}),(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})]}):(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})})},`workflow-${n.id}`)}case`monitor_mcp`:return Qt?(0,Z.jsx)(Qt,{task:n,onKill:n.status===`running`&&$?()=>$(n.id,a):void 0,onBack:E},`monitor-mcp-${n.id}`):null;case`dream`:return(0,Z.jsx)(Et,{task:n,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:E,onKill:n.status===`running`?()=>void oe(n.id):void 0},`dream-${n.id}`)}}let D=j(y,e=>e.status===`running`),O=j(b,e=>e.status===`running`||e.status===`pending`)+j(x,e=>e.status===`running`),fe=Ve([...D>0?[(0,Z.jsxs)(d,{children:[D,` `,D===1?`active shell`:`active shells`]},`shells`)]:[],...O>0?[(0,Z.jsxs)(d,{children:[O,` `,O===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Z.jsx)(d,{children:` · `},`separator-${e}`)),pe=[(0,Z.jsx)(o,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Z.jsx)(o,{shortcut:`Enter`,action:`view`},`enter`),...(T?.type===`local_bash`||T?.type===`local_agent`||T?.type===`local_workflow`||T?.type===`monitor_mcp`||T?.type===`dream`||T?.type===`remote_agent`)&&T.status===`running`?[(0,Z.jsx)(o,{shortcut:`x`,action:`stop`},`kill`)]:[],...x.some(e=>e.status===`running`)?[(0,Z.jsx)(o,{shortcut:c,action:`stop all agents`},`kill-all`)]:[],(0,Z.jsx)(o,{shortcut:`←/Esc`,action:`close`},`esc`)],A=()=>e(`Background tasks dialog dismissed`,{display:`system`});function me(e){return e.pending?(0,Z.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,Z.jsx)(f,{children:pe})}return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:ne,children:(0,Z.jsx)(_,{title:`Background tasks`,subtitle:(0,Z.jsx)(Z.Fragment,{children:fe}),onCancel:A,color:`background`,inputGuide:me,children:w.length===0?(0,Z.jsx)(d,{dimColor:!0,children:`No tasks currently running`}):(0,Z.jsxs)(l,{flexDirection:`column`,children:[y.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,children:[(b.length>0||x.length>0)&&(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Shells`]}),` (`,y.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:y.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),C.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Monitors`]}),` (`,C.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:C.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),b.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Remote agents`]}),` (`,b.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:b.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),x.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Local agents`]}),` (`,x.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:x.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),S.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Workflows`]}),` (`,S.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:S.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),te.length>0&&(0,Z.jsx)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0||S.length>0),children:(0,Z.jsx)(l,{flexDirection:`column`,children:te.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})})]})})})}function Zt(e){switch(e.type){case`local_bash`:return{id:e.id,type:`local_bash`,label:e.kind===`monitor`?e.description:e.command,status:e.status,task:e};case`remote_agent`:return{id:e.id,type:`remote_agent`,label:e.title,status:e.status,task:e};case`local_agent`:return{id:e.id,type:`local_agent`,label:e.description,status:e.status,task:e};case`local_workflow`:return{id:e.id,type:`local_workflow`,label:e.summary??e.description,status:e.status,task:e};case`monitor_mcp`:return{id:e.id,type:`monitor_mcp`,label:e.description,status:e.status,task:e};case`dream`:return{id:e.id,type:`dream`,label:e.description,status:e.status,task:e}}}function Y({item:e,isSelected:t}){let{columns:n}=h(),r=Math.max(30,n-26);return(0,Z.jsxs)(l,{flexDirection:`row`,children:[(0,Z.jsx)(d,{children:t?a.pointer+` `:` `}),(0,Z.jsx)(d,{color:t?`suggestion`:void 0,children:(0,Z.jsx)(wt,{task:e.task,maxActivityWidth:r})})]})}var X,Z,Q,$,Qt,$t=t((()=>{i(),X=n(p(),1),xe(),we(),Ce(),b(),w(),T(),x(),ze(),Se(),Me(),g(),F(),C(),pt(),Tt(),Dt(),Rt(),Ut(),Z=v(),Q=(me(),e(De))?.killWorkflowTask??null,$=(S(),e(te))?.killMonitorMcp??null,Qt=(Jt(),e(Kt)).MonitorMcpDetailDialog}));export{L as a,lt as i,$t as n,I as o,ut as r,Xt as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./ClaudeMdExternalIncludesDialog-5pipE8m8.js";e();export{t as ClaudeMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{Ix as e,Lx as t}from"./loadAgentsDir-DrDu5yYy.js";t();export{e as ConsoleOAuthFlow};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-DlE1Mbb9.js";e();export{t as Doctor};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Gt as o,I as s,P as c,fi as l,t as u,x as d}from"./src-CDCSSo0U2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{en as p,nt as ee}from"./state-ix0xIunV.js";import{FS as m,IE as h,JS as g,Jp as te,LE as _,MS as v,NE as y,NS as b,PS as x,Qp as ne,Uc as S,Wc as C,Xp as w,Yp as T,Zp as E,_D as D,al as re,bD as O,fO as ie,il as ae,nf as oe,pO as se,qS as ce,rf as le,tf as k,zE as A}from"./loadAgentsDir-DrDu5yYy.js";import{B as j,L as M,g as N,n as P}from"./settings-DfWP5y6X.js";import{_ as F,f as I}from"./file-DcZWPH2V.js";import{l as L,o as R}from"./stringUtils-DGLPkqJ4.js";import{Wn as z,_ as B,qn as V,u as H}from"./model-fi472PRc.js";import{n as U,t as W}from"./ValidationErrorsList-Bl68E-2-.js";import{u as ue}from"./referral-DrebVwqx.js";import{d as de,f as fe,h as pe,i as me,m as he,n as ge,o as _e,r as ve,u as G}from"./pidLock-CdNZ0Wfg.js";import{a as ye,i as be}from"./xdg-DcF9ejUM.js";import{n as xe,t as Se}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import{n as Ce,t as we}from"./McpParsingWarnings-D0XvLirX.js";import{n as Te,t as Ee}from"./PressEnterToContinue-Dl9Hg9Mf.js";import{n as De,t as Oe}from"./useSettingsErrors-B5PSF1va.js";import{n as ke,t as Ae}from"./shadowedRuleDetection-E2wF1UjU.js";import{n as je,r as Me,t as K}from"./statusNoticeHelpers-BK-54uGY.js";import{join as q}from"path";function Ne(){if(!m())return null;let e=v();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(c,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`Location: `}),(0,J.jsx)(c,{dimColor:!0,children:b()})]}),(0,J.jsxs)(s,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`error`,children:`[Error]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,Pe=e((()=>{l(),u(),x(),J=f()}));function Fe(){if(!D.isSupportedPlatform()||!D.isSandboxEnabledInSettings())return null;let e=D.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(s,{flexDirection:`column`,children:[(0,Y.jsx)(c,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(c,{children:[`└ Status: `,(0,Y.jsx)(c,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(c,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(c,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(c,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,Ie=e((()=>{l(),u(),O(),Y=f()}));async function Le(){let e=h(await _());if(e.length===0)return null;let t=e.sort((e,t)=>t.content.length-e.content.length).map(e=>`${e.path}: ${e.content.length.toLocaleString()} chars`);return{type:`claudemd_files`,severity:`warning`,message:e.length===1?`Large CLAUDE.md file detected (${e[0].content.length.toLocaleString()} chars > ${y.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${y.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:y}}async function X(e){if(!e)return null;let t=je(e);if(t<=15e3)return null;let n=e.activeAgents.filter(e=>e.source!==`built-in`).map(e=>{let t=`${e.agentType}: ${e.whenToUse}`;return{name:e.agentType,tokens:C(t)}}).sort((e,t)=>t.tokens-e.tokens),r=n.slice(0,5).map(e=>`${e.name}: ~${e.tokens.toLocaleString()} tokens`);return n.length>5&&r.push(`(${n.length-5} more custom agents)`),{type:`agent_descriptions`,severity:`warning`,message:`Large agent descriptions (~${t.toLocaleString()} tokens > ${K.toLocaleString()})`,details:r,currentValue:t,threshold:K}}async function Re(e,t,n){let r=e.filter(e=>e.isMcp);if(r.length===0)return null;try{let{mcpToolTokens:r,mcpToolDetails:i}=await ae(e,t,n,H());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+C(((t.name?.length||0)+t.description.length).toString()),0);return e<=Z?null:{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${e.toLocaleString()} tokens estimated > ${Z.toLocaleString()})`,details:[`${r.length} MCP tools detected (token count estimated)`],currentValue:e,threshold:Z}}}async function ze(e){let t=Ae(await e(),{sandboxAutoAllowEnabled:D.isSandboxingEnabled()&&D.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${j(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${L(t.length,`unreachable permission rule`)} detected`,details:n,currentValue:t.length,threshold:0}}async function Be(e,t,n){let[r,i,a,o]=await Promise.all([Le(),X(t),Re(e,n,t),ze(n)]);return{claudeMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ve=e((()=>{S(),re(),A(),B(),M(),ke(),O(),Me(),R(),Z=25e3}));function He({promise:e}){let t=(0,Q.use)(e);return t.latest?(0,$.jsxs)($.Fragment,{children:[t.stable&&(0,$.jsxs)(c,{children:[`└ Stable version: `,t.stable]}),(0,$.jsxs)(c,{children:[`└ Latest version: `,t.latest]})]}):(0,$.jsx)(c,{dimColor:!0,children:`└ Failed to fetch versions`})}function Ue({onDone:e}){let t=g(e=>e.agentDefinitions),r=g(e=>e.mcp.tools),i=g(e=>e.toolPermissionContext),l=g(e=>e.plugins.errors);xe();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[_,v]=(0,Q.useState)(null),[y,b]=(0,Q.useState)(null),x=De(),S=(0,Q.useMemo)(()=>G().then(e=>(e.installationType===`native`?fe:he)().catch(()=>({latest:null,stable:null}))),[]),C=P()?.autoUpdatesChannel??`latest`,w=x.filter(e=>e.mcpErrorMetadata===void 0),E=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:te,upperLimit:T},{name:`TASK_MAX_OUTPUT_LENGTH`,default:k,upperLimit:oe},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...z(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=ne(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{G().then(p),(async()=>{let e=q(n(),`agents`),r=q(ee(),`.claude`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([F(e),F(r)]),d={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s};h(d);let f=await Be(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i);if(v(f),_e()){let e=q(be(),`claude`,`locks`),t=ge(e),n=ve(e);b({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else b({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,u,t]);let D=(0,Q.useCallback)(()=>{e(`Claude Code diagnostics dismissed`,{display:`system`})},[e]);return o({"confirm:yes":D,"confirm:no":D},{context:`Confirmation`}),f?(0,$.jsxs)(d,{children:[(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(c,{children:[`└ Currently running: `,f.installationType,` (`,f.version,`)`]}),f.packageManager&&(0,$.jsxs)(c,{children:[`└ Package manager: `,f.packageManager]}),(0,$.jsxs)(c,{children:[`└ Path: `,f.installationPath]}),(0,$.jsxs)(c,{children:[`└ Invoked: `,f.invokedBinary]}),(0,$.jsxs)(c,{children:[`└ Config install method: `,f.configInstallMethod]}),(0,$.jsxs)(c,{children:[`└ Search: `,f.ripgrepStatus.working?`OK`:`Not working`,` (`,f.ripgrepStatus.mode===`embedded`?`bundled`:f.ripgrepStatus.mode===`builtin`?`vendor`:f.ripgrepStatus.systemPath||`system`,`)`]}),f.ripgrepStatus.note&&(0,$.jsxs)(c,{color:`warning`,children:[`└ Note: `,f.ripgrepStatus.note]}),f.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsxs)(c,{color:`warning`,children:[`Recommendation: `,f.recommendation.split(`
2
- `)[0]]}),(0,$.jsx)(c,{dimColor:!0,children:f.recommendation.split(`
3
- `)[1]})]}),f.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsx)(c,{color:`warning`,children:`Warning: Multiple installations found`}),f.multipleInstallations.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.type,` at `,e.path]},t))]}),f.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),f.warnings.map((e,t)=>(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsxs)(c,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(c,{children:[`Fix: `,e.fix]})]},t))]}),w.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(c,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:w})]})]}),(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Updates`}),(0,$.jsxs)(c,{children:[`└ Auto-updates: `,f.packageManager?`Managed by package manager`:f.autoUpdates]}),f.hasUpdatePermissions!==null&&(0,$.jsxs)(c,{children:[`└ Update permissions: `,f.hasUpdatePermissions?`Yes`:`No (requires sudo)`]}),(0,$.jsxs)(c,{children:[`└ Auto-update channel: `,C]}),(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(He,{promise:S})})]}),(0,$.jsx)(Fe,{}),(0,$.jsx)(we,{}),(0,$.jsx)(Ne,{}),E.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Environment Variables`}),E.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(c,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),y?.enabled&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Version Locks`}),y.staleLocksCleaned>0&&(0,$.jsxs)(c,{dimColor:!0,children:[`└ Cleaned `,y.staleLocksCleaned,` stale lock(s)`]}),y.locks.length===0?(0,$.jsx)(c,{dimColor:!0,children:`└ No active version locks`}):y.locks.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(c,{children:`(running)`}):(0,$.jsx)(c,{color:`warning`,children:`(stale)`})]},t))]}),m?.failedFiles&&m.failedFiles.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ Failed to parse `,m.failedFiles.length,` agent file(s):`]}),m.failedFiles.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),l.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ `,l.length,` plugin error(s) detected:`]}),l.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,ie(e)]},t))]}),_?.unreachableRulesWarning&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.unreachableRulesWarning.message]})]}),_.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_&&(_.claudeMdWarning||_.agentWarning||_.mcpWarning)&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Context Usage Warnings`}),_.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.claudeMdWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Files:`]}),_.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.agentWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Top contributors:`]}),_.agentWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.mcpWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ MCP servers:`]}),_.mcpWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(s,{children:(0,$.jsx)(Ee,{})})]}):(0,$.jsx)(d,{children:(0,$.jsx)(c,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,We=e((()=>{i(),Q=t(l(),1),Pe(),Ce(),V(),r(),p(),u(),Te(),Ie(),U(),Oe(),Se(),ue(),ce(),se(),pe(),Ve(),de(),E(),I(),me(),N(),w(),le(),ye(),$=f()}));export{We as n,Ue as t};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{I as r,P as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Ct as l,Ei as u,Et as d,Gp as f,Lb as p,ND as m,Ot as h,PD as g,Wp as _,_x as v,fC as y,gb as b,gt as x,hb as S,jr as C,kt as w,uC as T,vx as E,zb as D}from"./loadAgentsDir-DrDu5yYy.js";import{a as O,l as k}from"./debug-BrXObCdR.js";import{r as A,t as j}from"./execFileNoThrow-D244NytW.js";import{n as M,r as N}from"./analytics-BotDBGh0.js";function P(){(C(),e(u)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,a]=(0,I.useState)(`loading`),[o,c]=(0,I.useState)([]),[u,d]=(0,I.useState)(0),[m,g]=(0,I.useState)(),_=l();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await j(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
2
- `).filter(e=>e.trim()!==``),c(e)),_){let{stdout:t}=await j(`git`,[`rev-list`,`--count`,`${_.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(d(n),e.length===0&&n===0){a(`removing`),x().then(()=>{process.chdir(_.originalCwd),f(_.originalCwd),P(),S.cache.clear?.(),g(`Worktree removed (no changes)`)}).catch(e=>{k(`Failed to clean up worktree: ${e}`,{level:`error`}),g(`Worktree cleanup failed, exiting anyway`)}).then(()=>{a(`done`)});return}else a(`asking`)}}e()},[_]),(0,I.useEffect)(()=>{n===`done`&&e(m)},[n,e,m]),!_)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function y(e){if(!_)return;let t=!!_.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:u,changed_files:o.length}),await h(),process.chdir(_.originalCwd),f(_.originalCwd),P(),S.cache.clear?.(),g(t?`Worktree kept. Your work is saved at ${_.worktreePath} on branch ${_.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${_.tmuxSessionName}`:`Worktree kept. Your work is saved at ${_.worktreePath} on branch ${_.worktreeBranch}`),a(`done`);else if(e===`keep-kill-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:u,changed_files:o.length}),_.tmuxSessionName&&await w(_.tmuxSessionName),await h(),process.chdir(_.originalCwd),f(_.originalCwd),P(),S.cache.clear?.(),g(`Worktree kept at ${_.worktreePath} on branch ${_.worktreeBranch}. Tmux session terminated.`),a(`done`);else if(e===`remove`||e===`remove-with-tmux`){a(`removing`),N(`tengu_worktree_removed`,{commits:u,changed_files:o.length}),_.tmuxSessionName&&await w(_.tmuxSessionName);try{await x(),process.chdir(_.originalCwd),f(_.originalCwd),P(),S.cache.clear?.()}catch(e){k(`Failed to clean up worktree: ${e}`,{level:`error`}),g(`Worktree cleanup failed, exiting anyway`),a(`done`);return}let e=t?` Tmux session terminated.`:``;u>0&&o.length>0?g(`Worktree removed. ${u} ${u===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):u>0?g(`Worktree removed. ${u} ${u===1?`commit`:`commits`} on ${_.worktreeBranch} ${u===1?`was`:`were`} discarded.${e}`):o.length>0?g(`Worktree removed. Uncommitted changes were discarded.${e}`):g(`Worktree removed.${e}`),a(`done`)}}if(n===`keeping`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(p,{}),(0,L.jsx)(i,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(p,{}),(0,L.jsx)(i,{children:`Removing worktree…`})]});let b=_.worktreeBranch,C=o.length>0,T=u>0,E=``;E=C&&T?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`} and ${u} ${u===1?`commit`:`commits`} on ${b}. All will be lost if you remove.`:C?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:T?`You have ${u} ${u===1?`commit`:`commits`} on ${b}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function D(){if(t){t();return}y(`keep`)}let O=C||T?`All changes and commits will be lost.`:`Clean up the worktree directory.`,A=!!_.tmuxSessionName,M=A?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${_.worktreePath}. Reattach with: tmux attach -t ${_.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${_.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${_.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(s,{title:`Exiting worktree session`,subtitle:E,onCancel:D,children:(0,L.jsx)(v,{defaultFocusValue:A?`keep-with-tmux`:`keep`,options:M,onChange:y})})}var I,L,R=t((()=>{I=n(a(),1),M(),O(),o(),A(),b(),_(),d(),E(),D(),L=c()}));function z(){return g(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await T(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{m(),a(),y(),R(),V=c(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./Grove-D9lSG_Lh.js";e();export{t as GroveDialog};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{en as a,ht as o}from"./state-ix0xIunV.js";import{FD as s,GS as c,G_ as l,ID as u,JS as d,K_ as f,L_ as p,M_ as m,Q_ as h,R_ as g,T_ as _,V_ as v,WS as y,XS as ee,X_ as b,YS as x,Z_ as te,ay as S,cg as C,dg as w,ev as T,ey as ne,gg as re,hg as E,ig as D,iy as O,og as k,pg as A,qS as ie,sg as j,ty as ae,ug as M,y_ as oe,z_ as se}from"./loadAgentsDir-DrDu5yYy.js";import{F as N,a as ce,l as le,z as P}from"./debug-BrXObCdR.js";import{ct as F,ot as I}from"./settings-DfWP5y6X.js";import{c as L,l as R,o as z}from"./log-BMCygSzM.js";import{n as B,r as V}from"./analytics-BotDBGh0.js";import{c as H,s as U}from"./pluginFlagging-3FQGvIfq.js";import{o as ue,s as de}from"./localSearch-_bQhk9W6.js";import{basename as fe}from"path";function W(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function G(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>W(e))),r=t.filter(e=>!n.has(W(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function pe(e,t=!1){let n=x(),r=d(e=>e.authVersion),i=d(e=>e.mcp.pluginReconnectKey),a=ee(),s=(0,K.useRef)(new Map),{addNotification:l}=c(),m=(0,K.useRef)([]),y=(0,K.useRef)(null),S=(0,K.useCallback)(()=>{y.current=null;let e=m.current;e.length!==0&&(m.current=[],a(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=I(a.name),d=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),f=o===void 0?n.tools:[...u(n.tools,e=>e.name?.startsWith(l)),...o],p=s===void 0?n.commands:[...u(n.commands,e=>oe(e,a.name)),...s],m=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:H(n.resources,a.name)};n={...n,clients:d,tools:f,commands:p,resources:m}}return{...t,mcp:n}}))},[a]),w=(0,K.useCallback)(e=>{m.current.push(e),y.current===null&&(y.current=setTimeout(S,16))},[S]),T=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(w({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:re(e.client,e.name,a),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(D(e.name,e.config).catch(()=>{le(`Failed to invalidate the server cache: ${e.name}`)}),f(e.name)){L(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=me(t);L(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=s.current.get(e.name);r&&(clearTimeout(r),s.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(f(e.name)){L(e.name,`Server disabled during reconnection, stopping retry`),s.current.delete(e.name);return}w({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await A(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){L(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),s.current.delete(e.name),T(i);return}if(L(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){L(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),T(i);return}}catch(i){let a=Date.now()-r;if(R(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){L(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),w({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);L(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);s.current.set(e.name,n)})}})()}else w({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(O,async()=>{L(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=C.cache.get(e.name);C.cache.delete(e.name);let n=await C(e),r=n.length;t?t.then(e=>{V(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{V(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):V(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),w({...e,tools:n})}catch(t){R(e.name,`Failed to refresh tools after list_changed notification: ${N(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(ne,async()=>{L(e.name,`Received prompts/list_changed notification, refreshing prompts`),V(`tengu_mcp_list_changed`,{type:`prompts`});try{k.cache.delete(e.name);let[t,n]=await Promise.all([k(e),Promise.resolve([])]);w({...e,commands:[...t,...n]}),q?.()}catch(t){R(e.name,`Failed to refresh prompts after list_changed notification: ${N(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(ae,async()=>{L(e.name,`Received resources/list_changed notification, refreshing resources`),V(`tengu_mcp_list_changed`,{type:`resources`});try{j.cache.delete(e.name);{let t=await j(e);w({...e,resources:t})}}catch(t){R(e.name,`Failed to refresh resources after list_changed notification: ${N(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[w]),E=o();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await v(e),i={...n,...e};G(a,r),a(e=>{let{stale:t,...n}=_(e.mcp,i);for(let e of t){let t=s.current.get(e.name);t&&(clearTimeout(t),s.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,D(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),a=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:f(e)?`disabled`:`pending`,config:t}));return a.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...a]}}})}n().catch(e=>{R(`useManageMCPConnections`,`Failed to initialize servers as pending: ${N(e)}`)})},[t,e,a,E,i]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||g()?r=Promise.resolve({}):(te(),r=h());let{servers:i,errors:o}=t?{servers:{},errors:[]}:await v(e,r);if(n)return;G(a,o);let s={...i,...e},c=Object.fromEntries(Object.entries(s).filter(([e])=>!f(e)));M(T,c).catch(e=>{R(`useManageMcpConnections`,`Failed to get MCP resources: ${N(e)}`)});let l={};if(!t){if(l=se(await r).allowed,n)return;if(Object.keys(l).length>0){let{servers:e}=p(l,s);l=e}if(Object.keys(l).length>0){a(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(l).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:f(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}});let e=Object.fromEntries(Object.entries(l).filter(([e])=>!f(e)));M(T,e).catch(e=>{R(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${N(e)}`)})}}let u={...s,...l},d={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},m=[];for(let[e,t]of Object.entries(u))t.scope===`enterprise`?d.enterprise++:t.scope===`user`?d.global++:t.scope===`project`?d.project++:t.scope===`local`?d.user++:t.scope===`dynamic`?d.plugin++:t.scope===`claudeai`&&d.claudeai++,process.env.USER_TYPE===`ant`&&!f(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&m.push(fe(t.command));V(`tengu_mcp_servers`,{...d,...process.env.USER_TYPE===`ant`&&m.length>0?{stdio_commands:m.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,T,a,r,E,i]),(0,K.useEffect)(()=>{let e=s.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),y.current!==null&&(clearTimeout(y.current),y.current=null,S())}},[S]),{reconnectMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=s.current.get(e);r&&(clearTimeout(r),s.current.delete(e));let i=await A(e,t.config);return T(i),i},[n,T]),toggleMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=s.current.get(e);n&&(clearTimeout(n),s.current.delete(e)),b(e,!1),t.type===`connected`&&await D(e,t.config),w({name:e,type:`disabled`,config:t.config})}else{b(e,!0),w({name:e,type:`pending`,config:t.config});let n=await A(e,t.config);T(n)}},[n,w,T])}}function me(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,he=t((()=>{K=n(r(),1),a(),w(),S(),U(),s(),B(),l(),ce(),y(),ie(),P(),z(),E(),T(),F(),m(),q=(ue(),e(de)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ge(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function _e(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function ve({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=pe(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ye=t((()=>{Z=n(r(),1),he(),Q=i(),$=(0,Z.createContext)(null)}));export{_e as i,ye as n,ge as r,ve as t};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{C as a,Gt as o,I as s,P as c,Wt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{en as m,ht as h,nr as g,pt as _}from"./state-ix0xIunV.js";import{$T as v,Cb as y,Dc as b,Ec as x,Fx as S,Gi as C,Go as w,JS as T,Lb as E,Nx as D,Oo as O,QT as k,Qi as A,Rc as j,Sb as ee,So as M,Ui as te,Uo as N,Vo as ne,XT as P,_x as re,aw as ie,ca as ae,hn as oe,ho as se,kb as ce,kc as le,lC as ue,lu as F,on as I,os as de,ow as fe,qS as pe,su as me,vx as he,wb as ge,wo as L,yn as R,yo as _e,zb as z,zc as ve,zo as B}from"./loadAgentsDir-DrDu5yYy.js";import{n as ye,t as be}from"./cwd-CYmmnQVS.js";import{$ as xe,_n as Se,f as Ce,g as we,gn as Te,nt as Ee}from"./settings-DfWP5y6X.js";import{Y as De,h as Oe,m as ke,o as Ae,s as V,w as je}from"./log-BMCygSzM.js";import{n as H,r as U}from"./analytics-BotDBGh0.js";import{S as Me,b as Ne,h as Pe}from"./startupProfiler-xa3NmN7Z.js";import{Ct as Fe,Vt as Ie,X as Le,tt as Re}from"./model-fi472PRc.js";import{E as ze,T as Be,c as Ve,d as He,w as Ue}from"./sessionTracing-lArOaj9u.js";import{u as We}from"./referral-DrebVwqx.js";import{n as Ge,t as Ke}from"./slashCommandParsing-RQb_7Xzt.js";import{n as qe,t as Je}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import*as W from"path";import{randomUUID as G}from"crypto";u();var K=p();r(),f(),m(),ye(),De(),ke(),Ae(),Se(),H(),Ne(),Ee(),we(),Ie(),k(),Ue(),ie(),D(),Ve(),me(),j(),le(),de(),B(),A(),R(),Ke();var Ye={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Xe(e,t){if(!new RegExp(t,`i`).test(e)||e.startsWith(`/`))return[];let n=[],r=null,i=0,a=e=>!!e&&/[\p{L}\p{N}_]/u.test(e);for(let t=0;t<e.length;t++){let o=e[t];if(r){if(r===`[`&&o===`[`){i=t;continue}if(o!==Ye[r]||r===`'`&&a(e[t+1]))continue;n.push({start:i,end:t+1}),r=null}else(o===`<`&&t+1<e.length&&/[a-zA-Z/]/.test(e[t+1])||o===`'`&&!a(e[t-1])||o!==`<`&&o!==`'`&&o in Ye)&&(r=o,i=t)}let o=[],s=RegExp(`\\b${t}\\b`,`gi`),c=e.matchAll(s);for(let t of c){if(t.index===void 0)continue;let r=t.index,i=r+t[0].length;if(n.some(e=>r>=e.start&&r<e.end))continue;let s=e[r-1],c=e[i];s===`/`||s===`\\`||s===`-`||c===`/`||c===`\\`||c===`-`||c===`?`||c===`.`&&a(e[i+1])||o.push({word:t[0],start:r,end:i})}return o}function q(e){return Xe(e,`ultraplan`)}function Ze(e){return Xe(e,`ultrareview`)}function Qe(e){return q(e).length>0}function $e(e){let[t]=q(e);if(!t)return e;let n=e.slice(0,t.start),r=e.slice(t.end);return(n+r).trim()?n+t.word.slice(5)+r:``}function et(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function tt(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function nt(e,t,n,r,i,a,o){let s=G();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;He(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Be(`user_prompt`,{prompt_length:String(l.length),prompt:ze(l),"prompt.id":s}),U(`tengu_input_prompt`,{is_negative:et(c),is_keep_going:tt(c)}),t.length>0?{messages:[M({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[M({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}H(),B();async function rt({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null,y=v?.startsWith(`/`)&&!p;n===`prompt`&&v!==null&&!h&&!y&&c?.(v),F(`query_process_user_input_base_start`);let b=i.getAppState(),S=await at(e,n,r,i,a,o,s,l,u,d,f,b.toolPermissionContext.mode,p,m,h,g,t,_);if(F(`query_process_user_input_base_end`),!S.shouldQuery)return S;F(`query_hooks_start`);let C=O(e)||``;for await(let t of I(C,b.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[_e(`${oe(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:S.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return S.messages.push(M({content:e})),S.shouldQuery=!1,S}if(t.additionalContexts&&t.additionalContexts.length>0&&S.messages.push(x({type:`hook_additional_context`,content:t.additionalContexts.map(it),hookName:`UserPromptSubmit`,toolUseID:`hook-${G()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;S.messages.push({...t.message,attachment:{...t.message.attachment,content:it(t.message.attachment.content)}});break;default:S.messages.push(t.message);break}}return F(`query_hooks_end`),S}var J=1e4;function it(e){return e.length>J?`${e.substring(0,J)}… [output truncated - exceeded ${J} characters]`:e}async function at(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let y=null,x=[],w=[],T=e;if(typeof e==`string`)y=e;else if(e.length>0){F(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await v(n);if(e.dimensions){let t=P(e.dimensions);t&&w.push(t)}t.push(e.block)}else t.push(n);T=t,F(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(y=n.text,x=t.slice(0,-1)):x=t}if(y===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let E=i?Object.values(i).filter(ve):[],D=E.map(e=>e.id),O=i?await S(i):new Map;F(`query_pasted_image_processing_start`);let k=await Promise.all(E.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return U(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await v(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??O.get(e.id)}})),A=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of k){if(e.dimensions){let t=P(e.dimensions,n);t&&w.push(t)}else if(t){let e=P(t,n);e&&w.push(e)}else n&&w.push(`[Image source: ${n}]`);A.push(e.block)}F(`query_pasted_image_processing_end`);let j=f;if(p&&y!==null&&y.startsWith(`/`)){let e=Ge(y),t=e?te(e.commandName,r.options.commands):void 0;if(t){let n=C(t,e?.args??``);if(n.ok)j=!1;else{let e=n.reason??`/${ae(t)} isn't available over Remote Control.`;return{messages:[M({content:y,uuid:s}),se(`<local-command-stdout>${e}</local-command-stdout>`)],shouldQuery:!1,resultText:e}}}}if(t===`prompt`&&!r.options.isNonInteractiveSession&&y!==null&&!j&&!y.startsWith(`/`)&&!r.getAppState().ultraplanSessionUrl&&!r.getAppState().ultraplanLaunching&&Qe(g??y)){U(`tengu_ultraplan_keyword`,{});let e=$e(y).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-AltWgIFt.js`);return Y(await t(`/ultraplan ${e}`,x,A,[],r,n,s,c,u,_),w)}let ee=!h&&y!==null&&(t!==`prompt`||j||!y.startsWith(`/`));F(`query_attachment_loading_start`);let N=ee?await fe(b(y,r,a??null,[],o,l)):[];if(F(`query_attachment_loading_end`),y!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-Bx6_oZoE.js`);return Y(await e(y,x,N,r,n),w)}if(y!==null&&!j&&y.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-AltWgIFt.js`);return Y(await e(y,x,A,N,r,n,s,c,u,_),w)}if(y!==null&&t===`prompt`){let e=y.trim(),t=N.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;U(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return Y(nt(T,A,D,N,s,d,m),w)}function Y(e,t){return t.length>0&&e.messages.push(M({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}m(),Re();function ot(e){return e===`Agent`?xe:e}function st(e){let t=Ce()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:be(),session_id:h(),tools:e.tools.map(e=>ot(e.name)),mcp_servers:e.mcpClients.map(e=>({name:e.name,status:e.type})),model:e.model,permissionMode:e.permissionMode,slash_commands:e.commands.filter(e=>e.userInvocable!==!1).map(e=>e.name),apiKeySource:Fe().source,betas:_(),claude_code_version:`0.0.3`,output_style:t,agents:e.agents.map(e=>e.agentType),skills:e.skills.filter(e=>e.userInvocable!==!1).map(e=>e.name),plugins:e.plugins.map(e=>({name:e.name,path:e.path,source:e.source})),uuid:G()};return n.fast_mode_state=Le(e.model,e.fastMode),n}var ct=n({MessageSelector:()=>ut,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function lt(e){return e.type===`text`}function X(e){return e===`summarize`||e===`summarize_up_to`}function ut({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:u,onClose:d,preselectedMessage:f}){let p=T(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=y(),_=(0,Q.useMemo)(G,[]),v=(0,Q.useMemo)(()=>[...e.filter(Z),{...M({content:``}),uuid:_}],[e,_]),[b,x]=(0,Q.useState)(v.length-1),S=Math.max(0,Math.min(b-Math.floor($/2),v.length-$)),C=v.length>1,[w,D]=(0,Q.useState)(f),[O,k]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!f||!g)return;let e=!1;return ge(p,f.uuid).then(t=>{e||k(t)}),()=>{e=!0}},[f,g,p]);let[A,j]=(0,Q.useState)(!1),[te,N]=(0,Q.useState)(null),[ne,P]=(0,Q.useState)(`both`),[ie,ae]=(0,Q.useState)(``),[oe,se]=(0,Q.useState)(``);function ce(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:ae}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:se}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{U(`tengu_message_selector_opened`,{})},[]);async function le(e){t(),j(!0);try{await n(e),j(!1),d()}catch(e){V(e),j(!1),h(`Failed to restore the conversation:\n${e}`)}}async function ue(t){let n=e.indexOf(t);if(U(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){d();return}if(!g){await le(t);return}let r=await ge(p,t.uuid);D(t),k(r)}async function F(e){if(U(`tengu_message_selector_restore_option_selected`,{option:e}),!w){h(`Message not found.`);return}if(e===`nevermind`){f?d():D(void 0);return}if(X(e)){t(),j(!0),N(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`,n=(t===`up_to`?oe:ie).trim()||void 0;await u(w,n,t),j(!1),N(null),D(void 0),d()}catch(e){V(e),j(!1),N(null),D(void 0),h(`Failed to summarize:\n${e}`)}return}t(),j(!0),h(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(w)}catch(e){i=e,V(i)}if(e===`conversation`||e===`both`)try{await n(w)}catch(e){a=e,V(a)}j(!1),D(void 0),a&&i?h(`Failed to restore the conversation and code:\n${a}\n${i}`):a?h(`Failed to restore the conversation:\n${a}`):i?h(`Failed to restore the code:\n${i}`):d()}let I=qe(),de=(0,Q.useCallback)(()=>{if(w&&!f){D(void 0);return}U(`tengu_message_selector_cancelled`,{}),d()},[d,w,f]),fe=(0,Q.useCallback)(()=>x(e=>Math.max(0,e-1)),[]),pe=(0,Q.useCallback)(()=>x(e=>Math.min(v.length-1,e+1)),[v.length]),me=(0,Q.useCallback)(()=>x(0),[]),he=(0,Q.useCallback)(()=>x(v.length-1),[v.length]),L=(0,Q.useCallback)(()=>{let e=v[b];e&&ue(e)},[v,b,ue]);l(`confirm:no`,de,{context:`Confirmation`,isActive:!w}),o({"messageSelector:up":fe,"messageSelector:down":pe,"messageSelector:top":me,"messageSelector:bottom":he,"messageSelector:select":L},{context:`MessageSelector`,isActive:!A&&!m&&!w&&C});let[R,_e]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=ee(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;_e(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let z=g&&O?.filesChanged&&O.filesChanged.length>0,ve=!m&&!w&&!f&&C;return(0,K.jsxs)(s,{flexDirection:`column`,width:`100%`,children:[(0,K.jsx)(a,{color:`suggestion`}),(0,K.jsxs)(s,{flexDirection:`column`,marginX:1,gap:1,children:[(0,K.jsx)(c,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{color:`error`,children:[`Error: `,m]})}),!C&&(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{children:`Nothing to rewind to yet.`})}),!m&&w&&C&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{children:[`Confirm you want to restore `,!O&&`the conversation `,`to the point before you sent this message:`]}),(0,K.jsxs)(s,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,K.jsx)(ht,{userMessage:w,color:`text`,isCurrent:!1}),(0,K.jsxs)(c,{dimColor:!0,children:[`(`,Pe(new Date(w.timestamp)),`)`]})]}),(0,K.jsx)(ft,{selectedRestoreOption:ne,canRestoreCode:!!z,diffStatsForRestore:O}),A&&X(te)?(0,K.jsxs)(s,{flexDirection:`row`,gap:1,children:[(0,K.jsx)(E,{}),(0,K.jsx)(c,{children:`Summarizing…`})]}):(0,K.jsx)(re,{isDisabled:A,options:ce(!!z),defaultFocusValue:z?`both`:`conversation`,onFocus:e=>P(e),onChange:e=>F(e),onCancel:()=>f?d():D(void 0)}),z&&(0,K.jsx)(s,{marginBottom:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),ve&&(0,K.jsxs)(K.Fragment,{children:[g?(0,K.jsx)(c,{children:`Restore the code and/or conversation to the point before…`}):(0,K.jsx)(c,{children:`Restore and fork the conversation to the point before…`}),(0,K.jsx)(s,{width:`100%`,flexDirection:`column`,children:v.slice(S,S+$).map((e,t)=>{let n=S+t,r=n===b,a=e.uuid===_,o=n in R,l=R[n],u=l?.filesChanged&&l.filesChanged.length;return(0,K.jsxs)(s,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,K.jsx)(s,{width:2,minWidth:2,children:r?(0,K.jsxs)(c,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,K.jsx)(c,{children:` `})}),(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(s,{flexShrink:1,height:1,overflow:`hidden`,children:(0,K.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,K.jsx)(s,{height:1,flexDirection:`row`,children:l?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{dimColor:!r,color:`inactive`,children:u?(0,K.jsxs)(K.Fragment,{children:[u===1&&l.filesChanged[0]?`${W.basename(l.filesChanged[0])} `:`${u} files changed `,(0,K.jsx)(mt,{diffStats:l})]}):(0,K.jsx)(K.Fragment,{children:`No code changes`})})}):(0,K.jsxs)(c,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!w&&(0,K.jsx)(c,{dimColor:!0,italic:!0,children:I.pending?(0,K.jsxs)(K.Fragment,{children:[`Press `,I.keyName,` again to exit`]}):(0,K.jsxs)(K.Fragment,{children:[!m&&C&&`Enter to continue · `,`Esc to exit`]})})]})]})}function dt(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function ft({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(c,{dimColor:!0,children:dt(e)}),!X(e)&&(r?(0,K.jsx)(pt,{diffStatsForRestore:n}):(0,K.jsx)(c,{dimColor:!0,children:`The code will be unchanged.`}))]})}function pt({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,K.jsx)(c,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?W.basename(e.filesChanged[0]||``):t===2?`${W.basename(e.filesChanged[0]||``)} and ${W.basename(e.filesChanged[1]||``)}`:`${W.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{dimColor:!0,children:[`The code will be restored `,(0,K.jsx)(mt,{diffStats:e}),` in `,n,`.`]})})}function mt({diffStats:e}){if(!(!e||!e.filesChanged))return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,K.jsxs)(c,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=d();if(r)return(0,K.jsx)(s,{width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,l=typeof o==`string`?null:o[o.length-1],u=Oe(typeof o==`string`?o.trim():l&&lt(l)?l.text.trim():`(no prompt)`);if(ne(u))return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=L(u,`bash-input`);if(e)return(0,K.jsxs)(s,{flexDirection:`row`,width:`100%`,children:[(0,K.jsx)(c,{color:`bashBorder`,children:`!`}),(0,K.jsxs)(c,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=L(u,je),r=L(u,`command-args`),i=L(u,`skill-format`)===`true`;if(e)return i?(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{color:t,dimColor:n,children:i?Me(u,a-i,!0):u.slice(0,500).split(`
2
- `).slice(0,4).join(`
3
- `)})})}function gt(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!w(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=Te(e.lines,e=>e.startsWith(`+`)),n=Te(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function Z(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||N(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&lt(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!N(t)&&!w(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,vt=e((()=>{Q=t(u(),1),H(),pe(),ce(),Je(),We(),B(),he(),z(),ue(),$=7}));export{Z as a,rt as c,_t as i,q as l,ct as n,st as o,vt as r,ot as s,ut as t,Ze as u};