claude-code-best 2.6.9 → 2.6.10

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 (400) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-_RSNUS7K.js → AddWorkspaceDirectory-DYIf4o0g.js} +1 -1
  2. package/dist/chunks/{App-4VqMMjIu.js → App-Bw4stCcv.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-CBEOrsej.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-B7oSxzWc.js → ApproveApiKey-CNBKF9de.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-Lf5l_1Dh.js → AssistantSessionChooser-DU5OOPwq.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-Ckgmqm6u.js → BackgroundTasksDialog-ChDZ6M4c.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-DNqPpiPC.js → BypassPermissionsModeDialog-UOkwRr3W.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-BODZ64gw.js → ClaudeInChromeOnboarding-6UL2_PCg.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-CG26Jg7h.js +1 -0
  10. package/dist/chunks/{ClaudeMdExternalIncludesDialog-DLI6ey3G.js → ClaudeMdExternalIncludesDialog-DBfmH_dG.js} +1 -1
  11. package/dist/chunks/ConsoleOAuthFlow-1aq67dJV.js +1 -0
  12. package/dist/chunks/{DesktopHandoff--xyI5kTQ.js → DesktopHandoff-B-ySC5nP.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-DJ4mHsA_.js → DevChannelsDialog-DZMsKuak.js} +1 -1
  14. package/dist/chunks/{DiffDialog-CVWUlOjm.js → DiffDialog-CeYcqIIw.js} +1 -1
  15. package/dist/chunks/{Doctor-DVoFX-9y.js → Doctor-ByQrTdef.js} +1 -1
  16. package/dist/chunks/Doctor-DOil8Eh7.js +1 -0
  17. package/dist/chunks/{ExitFlow-BKzQPr75.js → ExitFlow-gMv13EpM.js} +1 -1
  18. package/dist/chunks/Feedback-CGRlFB5g.js +2 -0
  19. package/dist/chunks/Grove-CJn8QGFo.js +1 -0
  20. package/dist/chunks/{Grove-G0DtwY22.js → Grove-CnHyPepC.js} +1 -1
  21. package/dist/chunks/{HybridTransport-xN03sWrt.js → HybridTransport-CiY6jyhx.js} +1 -1
  22. package/dist/chunks/{ITermBackend-DzN3ZWds.js → ITermBackend-CG-a4QYW.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-Iy4Su1Lm.js → InvalidConfigDialog-umJZVrz-.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-dx4y_nY-.js → InvalidSettingsDialog-C62kuhHc.js} +1 -1
  25. package/dist/chunks/{MCPConnectionManager-kVO-4BcA.js → MCPConnectionManager-BbGFGZTr.js} +1 -1
  26. package/dist/chunks/{McpParsingWarnings-D420-W8M.js → McpParsingWarnings-DW0d9Lsb.js} +1 -1
  27. package/dist/chunks/MessageSelector-A-814zUi.js +3 -0
  28. package/dist/chunks/{Messages-C5gVVVmY.js → Messages-C4nIAGDL.js} +2 -2
  29. package/dist/chunks/{Onboarding-BkidUre_.js → Onboarding-BRePz3fJ.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-DoRUucoN.js → OverageCreditUpsell-DEZsyI6y.js} +1 -1
  31. package/dist/chunks/{PluginSettings-DhpNtjTm.js → PluginSettings-CuZtXDaS.js} +1 -1
  32. package/dist/chunks/{PromptInputFooterSuggestions-BnpXzkW9.js → PromptInputFooterSuggestions-BrpVQJVn.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-DKbiO4C0.js → PromptInputHelpMenu-BlGRpX1Q.js} +1 -1
  34. package/dist/chunks/{QueryEngine-J15EOjWx.js → QueryEngine-CK9YRTZo.js} +1 -1
  35. package/dist/chunks/{REPL-nrJ13J1o.js → REPL-D-t0XQx2.js} +6 -6
  36. package/dist/chunks/REPL-DV96-Prr.js +1 -0
  37. package/dist/chunks/{RemoteCallout-DGXIcTKv.js → RemoteCallout-DvOZQWoG.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-3KsuTCZM.js → RemoteSessionManager-BlIA65dM.js} +1 -1
  39. package/dist/chunks/{ResumeConversation-kS7lkjJm.js → ResumeConversation-BTccgPK8.js} +1 -1
  40. package/dist/chunks/{SSETransport-Cy1rXP6E.js → SSETransport-CIvM80QS.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-CmyZbRut.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-B9sk4zvj.js +1 -0
  43. package/dist/chunks/{SentryErrorBoundary-B_6MfzRa.js → SentryErrorBoundary-BK2HjzVw.js} +1 -1
  44. package/dist/chunks/Settings-D3Kpcb7q.js +2 -0
  45. package/dist/chunks/{TeleportProgress-CQUN_zoe.js → TeleportProgress-BFlMrsa_.js} +1 -1
  46. package/dist/chunks/{TeleportRepoMismatchDialog-CPquWrd-.js → TeleportRepoMismatchDialog-BUeyIQCH.js} +1 -1
  47. package/dist/chunks/{TeleportResumeWrapper-NIFNCHIO.js → TeleportResumeWrapper-CHfeyo9J.js} +1 -1
  48. package/dist/chunks/{ThemePicker-DnK0DStD.js → ThemePicker-a5n2EKgk.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-C00k5RF9.js → TmuxBackend-Ct9v-J78.js} +1 -1
  50. package/dist/chunks/{TrustDialog-CUnvtDeS.js → TrustDialog-e1nyM-Fp.js} +1 -1
  51. package/dist/chunks/{ValidationErrorsList-CJbO1qub.js → ValidationErrorsList-BHCepjdO.js} +1 -1
  52. package/dist/chunks/WelcomeV2-BnyziLbm.js +1 -0
  53. package/dist/chunks/{WindowsTerminalBackend-DSsgxuNK.js → WindowsTerminalBackend-Dw6qjsBu.js} +1 -1
  54. package/dist/chunks/{add-dir-BPqd010H.js → add-dir-CjnY5yfR.js} +1 -1
  55. package/dist/chunks/{agentDisplay-C0B1b_90.js → agentDisplay-Dfx-axK9.js} +1 -1
  56. package/dist/chunks/{agents-DMzVeRly.js → agents-CICHEOOq.js} +1 -1
  57. package/dist/chunks/{agents-CYs7WGHP.js → agents-lM-cxA8_.js} +1 -1
  58. package/dist/chunks/{ant-BO0Hmoii.js → ant-JgExUpwJ.js} +1 -1
  59. package/dist/chunks/{api-DLLVkmRJ.js → api-CClu711S.js} +1 -1
  60. package/dist/chunks/api-DgzWK3bh.js +1 -0
  61. package/dist/chunks/{assistant-_dIpsqHM.js → assistant-Bih7t52W.js} +1 -1
  62. package/dist/chunks/{assistant-CHp4-EaF.js → assistant-D1XefK1z.js} +1 -1
  63. package/dist/chunks/assistant-Ojm6Wsb6.js +1 -0
  64. package/dist/chunks/{auth-DelyQc8g.js → auth-CU6ArDos.js} +1 -1
  65. package/dist/chunks/auth-lQWhUjLX.js +1 -0
  66. package/dist/chunks/{autoMode-D3-o7xPK.js → autoMode-DM9eDMmT.js} +1 -1
  67. package/dist/chunks/{autonomy-tTAucjip.js → autonomy-CZCZ9wlx.js} +1 -1
  68. package/dist/chunks/{autonomy-CzSRoxjl.js → autonomy-DUfXLZfq.js} +1 -1
  69. package/dist/chunks/{autonomyPanel-DcK8N52K.js → autonomyPanel-kUZwcjfu.js} +1 -1
  70. package/dist/chunks/backgroundHousekeeping-BcLV1-Ap.js +1 -0
  71. package/dist/chunks/{backgroundHousekeeping-Bbkz61_-.js → backgroundHousekeeping-KGRk7QeA.js} +2 -2
  72. package/dist/chunks/{branch-ZJF4xAh9.js → branch-Ac3HXXs2.js} +1 -1
  73. package/dist/chunks/{bridge-C6gSt_32.js → bridge-Drt-UmFp.js} +2 -2
  74. package/dist/chunks/bridgeConfig-ByjfIoJz.js +1 -0
  75. package/dist/chunks/{bridgeConfig-DXUNQp2l.js → bridgeConfig-GQzZVhuF.js} +1 -1
  76. package/dist/chunks/bridgeEnabled-C7AI9y8g.js +1 -0
  77. package/dist/chunks/{bridgeEnabled-G6vxQV-7.js → bridgeEnabled-CDoXbe3S.js} +1 -1
  78. package/dist/chunks/{bridgeMain-DlnIQOtX.js → bridgeMain-B0fLyOLC.js} +6 -6
  79. package/dist/chunks/bridgeMain-DKQ1u3k_.js +1 -0
  80. package/dist/chunks/{bridgeMessaging-mek-AaFi.js → bridgeMessaging-gRm2WcIE.js} +1 -1
  81. package/dist/chunks/{btw-Cz2lyle-.js → btw-B2Tq2ewP.js} +1 -1
  82. package/dist/chunks/{buddy-BMqKttFw.js → buddy-v00QHFZ6.js} +1 -1
  83. package/dist/chunks/{bypassPermissionsKillswitch-BxvX48jr.js → bypassPermissionsKillswitch-DAr5U3Ep.js} +1 -1
  84. package/dist/chunks/{caches-wtRUk5y5.js → caches-DHUk9KMo.js} +2 -2
  85. package/dist/chunks/caches-DbE9R4Zh.js +1 -0
  86. package/dist/chunks/{ccrClient-BOrmrmgF.js → ccrClient-1Q3C_3_r.js} +1 -1
  87. package/dist/chunks/changeDetector--9sSzU2e.js +1 -0
  88. package/dist/chunks/channelNotification-CLYOd2-R.js +1 -0
  89. package/dist/chunks/{channelNotification-D8do6HUN.js → channelNotification-d08DSK9u.js} +1 -1
  90. package/dist/chunks/{chrome-JF2BXNK6.js → chrome-CKo0_n71.js} +1 -1
  91. package/dist/chunks/clear-Cf1D1WkR.js +1 -0
  92. package/dist/chunks/client-Bzn58Ea4.js +1 -0
  93. package/dist/chunks/{color-oh8CGhkI.js → color-DqtpdhFx.js} +1 -1
  94. package/dist/chunks/commands-CJz20FMO.js +1 -0
  95. package/dist/chunks/{commitAttribution-CUdm_sRl.js → commitAttribution-BJvmLsVe.js} +1 -1
  96. package/dist/chunks/commitAttribution-BgNel6QS.js +1 -0
  97. package/dist/chunks/{compact-R6vMbGQQ.js → compact-DLYic2Oa.js} +1 -1
  98. package/dist/chunks/{companion-ClxqTyG9.js → companion-C2CBSYiF.js} +1 -1
  99. package/dist/chunks/{config-CPK9PlWS.js → config-Cht2x9n9.js} +1 -1
  100. package/dist/chunks/{config-BQ-MayP6.js → config-DnWYFpDc.js} +1 -1
  101. package/dist/chunks/{context-CWfsKYEB.js → context-CDz9HqRT.js} +1 -1
  102. package/dist/chunks/{context-noninteractive-BJ4hE3MX.js → context-noninteractive-BUIf4IMX.js} +1 -1
  103. package/dist/chunks/context-noninteractive-CzuLiIeO.js +1 -0
  104. package/dist/chunks/{conversation-DizpkPtq.js → conversation-CLRfdC_V.js} +1 -1
  105. package/dist/chunks/conversation-D2iFk7Te.js +1 -0
  106. package/dist/chunks/{copy-BuPCS2HG.js → copy-BgHTb1Z0.js} +1 -1
  107. package/dist/chunks/{createSSHSession-Di9Je4Th.js → createSSHSession-C_mpeqPy.js} +1 -1
  108. package/dist/chunks/createSession-XhPMcSns.js +1 -0
  109. package/dist/chunks/{createSession-D6v0lBtG.js → createSession-kVJBXQlZ.js} +1 -1
  110. package/dist/chunks/{cronJitterConfig-By18m-PD.js → cronJitterConfig-SI7bYvJj.js} +1 -1
  111. package/dist/chunks/{crossProjectResume-C4YT2T6P.js → crossProjectResume-BMWSw62A.js} +1 -1
  112. package/dist/chunks/datadog-B5oHSyS1.js +1 -0
  113. package/dist/chunks/{datadog-BFSdlK6C.js → datadog-Bd9AgZT-.js} +1 -1
  114. package/dist/chunks/{desktop-Bd-JHrBo.js → desktop-BeUj2fqu.js} +1 -1
  115. package/dist/chunks/{diff-DGmINgOc.js → diff-BzgXDp1o.js} +1 -1
  116. package/dist/chunks/{doctor-DQ42RQPx.js → doctor-HCOexiL5.js} +1 -1
  117. package/dist/chunks/{effort-E6XjzPYR.js → effort-BaJU_k2K.js} +1 -1
  118. package/dist/chunks/entry-BoXZIfxW.js +14 -0
  119. package/dist/chunks/envLessBridgeConfig-CnR1E53G.js +1 -0
  120. package/dist/chunks/envLessBridgeConfig-DgdkC9jO.js +1 -0
  121. package/dist/chunks/{exit-CVlpMwCq.js → exit-B-9k0zjK.js} +1 -1
  122. package/dist/chunks/{export-CXcPQd0T.js → export-p85q3g8t.js} +1 -1
  123. package/dist/chunks/{exportRenderer-B9WXgMV2.js → exportRenderer-CUqd8PZM.js} +1 -1
  124. package/dist/chunks/extra-usage-CsJ9Z2G1.js +1 -0
  125. package/dist/chunks/{extra-usage-core-B20tawuN.js → extra-usage-core-B9Fy8_RP.js} +1 -1
  126. package/dist/chunks/{extra-usage-noninteractive-DZRe98BZ.js → extra-usage-noninteractive-B4vaWh0y.js} +1 -1
  127. package/dist/chunks/{extra-usage-B2KmuAZe.js → extra-usage-pPprHqwq.js} +1 -1
  128. package/dist/chunks/{extraUsage-CxqJdnGC.js → extraUsage-CEHCMe7l.js} +1 -1
  129. package/dist/chunks/extractMemories-D34FfNYT.js +1 -0
  130. package/dist/chunks/{fast-CPmJ2bp3.js → fast-CiSIZ5FI.js} +1 -1
  131. package/dist/chunks/fast-CxPB-PBH.js +1 -0
  132. package/dist/chunks/{feedback-4GY3ahvw.js → feedback-C2QLdCfW.js} +1 -1
  133. package/dist/chunks/{firstPartyEventLogger-CISUrAsf.js → firstPartyEventLogger-CozFbFD9.js} +1 -1
  134. package/dist/chunks/{flushGate-Dr8sMjB7.js → flushGate-LXr8ynSz.js} +1 -1
  135. package/dist/chunks/{gates-DI4pxvrD.js → gates-BGfvIJXl.js} +1 -1
  136. package/dist/chunks/gates-D-kXXHiv.js +1 -0
  137. package/dist/chunks/{gemini-Dcfosr2Z.js → gemini-BFBrPtVM.js} +1 -1
  138. package/dist/chunks/{generateRecap-CH_fgtxk.js → generateRecap-CLla3Ymz.js} +1 -1
  139. package/dist/chunks/{generateSessionName-DO0R__8w.js → generateSessionName-DF4I7gr2.js} +1 -1
  140. package/dist/chunks/{githubRepoPathMapping-D5I8CVDz.js → githubRepoPathMapping-C_5RCW_Z.js} +1 -1
  141. package/dist/chunks/{grok-X0FzcE6Y.js → grok-Dih61WOo.js} +1 -1
  142. package/dist/chunks/{growthbook-DZPT2JzB.js → growthbook-C39e6Byf.js} +1 -1
  143. package/dist/chunks/{heapdump-Cq6i0wJH.js → heapdump-BRj4tC1y.js} +1 -1
  144. package/dist/chunks/{help-B8ddA-Ec.js → help-fH9LNwox.js} +1 -1
  145. package/dist/chunks/hooks-Cw-F-1uO.js +1 -0
  146. package/dist/chunks/{hooks-CvFNccdv.js → hooks-D22Uu3Vs.js} +1 -1
  147. package/dist/chunks/{hostAdapter-D3s4JFk-.js → hostAdapter-CbXytx4y.js} +1 -1
  148. package/dist/chunks/{ide-CzxV5_D7.js → ide-DM5Tw70v.js} +1 -1
  149. package/dist/chunks/{inboundAttachments-B3ZTyNKF.js → inboundAttachments-2QIORKsd.js} +1 -1
  150. package/dist/chunks/inboundAttachments-CZN_sUNx.js +1 -0
  151. package/dist/chunks/initReplBridge-D8sWx97P.js +1 -0
  152. package/dist/chunks/{insights-DiWlKgVQ.js → insights-B6ogyLuv.js} +1 -1
  153. package/dist/chunks/{install-BFpg1zm1.js → install-DimDiHha.js} +1 -1
  154. package/dist/chunks/{install-github-app-BUCGGSw0.js → install-github-app-CQ7vkhIX.js} +1 -1
  155. package/dist/chunks/{install-slack-app-D5JDqzbs.js → install-slack-app-By9_5YS7.js} +1 -1
  156. package/dist/chunks/{instrumentation--BToLJT9.js → instrumentation-DbKu2GCL.js} +3 -3
  157. package/dist/chunks/{job-mUyxSEc2.js → job-D_DoFtev.js} +1 -1
  158. package/dist/chunks/{keybindings-D4DbE4G0.js → keybindings-DYRBv1bg.js} +1 -1
  159. package/dist/chunks/{lang-cMcnaxAR.js → lang-CAMxxG9F.js} +1 -1
  160. package/dist/chunks/{language-sTn9sA3E.js → language-CoHgN7rh.js} +1 -1
  161. package/dist/chunks/language-DB1HIsF8.js +1 -0
  162. package/dist/chunks/{launchAgentsPlatform-CAfyCAsQ.js → launchAgentsPlatform-9P8K66ku.js} +1 -1
  163. package/dist/chunks/{launchAutofixPr-CSMamZS6.js → launchAutofixPr-BbsqqUMA.js} +1 -1
  164. package/dist/chunks/{launchLocalMemory-nYAwNsNT.js → launchLocalMemory-K55Yo6JM.js} +1 -1
  165. package/dist/chunks/{launchLocalVault-yPp8S-tG.js → launchLocalVault-rrd1Q7jP.js} +1 -1
  166. package/dist/chunks/{launchMemoryStores-Dk3SXucB.js → launchMemoryStores-DMZ8GNQj.js} +1 -1
  167. package/dist/chunks/{launchOnboarding-BoqmHyRx.js → launchOnboarding-Duz_huXl.js} +1 -1
  168. package/dist/chunks/{launchSchedule-C2HBjD6C.js → launchSchedule-7VlG_3M6.js} +1 -1
  169. package/dist/chunks/{launchSkillStore-B5Yjvi-k.js → launchSkillStore-CcJL8RT0.js} +1 -1
  170. package/dist/chunks/{launchTeleport-BayvAnwh.js → launchTeleport-C8h_4F_L.js} +1 -1
  171. package/dist/chunks/{launchVault-BszsgPbZ.js → launchVault-Bm1EeT2x.js} +1 -1
  172. package/dist/chunks/loadAgentsDir-DsskgPWe.js +1 -0
  173. package/dist/chunks/{loadAgentsDir-Cl2w3uvH.js → loadAgentsDir-HZ19tmOZ.js} +45 -45
  174. package/dist/chunks/{loadPluginHooks-YHtjByxm.js → loadPluginHooks-DoFtrBWf.js} +1 -1
  175. package/dist/chunks/{localSearch-CpeqVibs.js → localSearch-4cz5ia5a.js} +1 -1
  176. package/dist/chunks/localSearch-CScvVw0c.js +1 -0
  177. package/dist/chunks/{login-TVtq34WQ.js → login-D6ywctRr.js} +1 -1
  178. package/dist/chunks/login-FdPNsHJs.js +1 -0
  179. package/dist/chunks/{logoV2Utils-DwaRnvOY.js → logoV2Utils-jaFn88oE.js} +1 -1
  180. package/dist/chunks/logout-CulTqT7V.js +1 -0
  181. package/dist/chunks/{magicDocs-_yNWB88A.js → magicDocs-DHGtJq0K.js} +1 -1
  182. package/dist/chunks/{main-gTbhsbIs.js → main-Bv4AvaJk.js} +15 -15
  183. package/dist/chunks/{mappers-COd8OOml.js → mappers-qcXgNBi5.js} +1 -1
  184. package/dist/chunks/{mcp-DoraEndj.js → mcp-BXPg0RPm.js} +1 -1
  185. package/dist/chunks/{mcp-CChzTC5v.js → mcp-iCbCqg7w.js} +2 -2
  186. package/dist/chunks/mcp-yDWIJznG.js +2 -0
  187. package/dist/chunks/{mcpServer-CpBN77YB.js → mcpServer-DcSto-Od.js} +1 -1
  188. package/dist/chunks/{mcpServer-Wd9rZG_E.js → mcpServer-Do9XTs2J.js} +1 -1
  189. package/dist/chunks/{memory-I21QZZ9h.js → memory-B0YG4r65.js} +1 -1
  190. package/dist/chunks/model-DG0v1297.js +1 -0
  191. package/dist/chunks/{model-BrHh21Db.js → model-DwVGG0mc.js} +1 -1
  192. package/dist/chunks/{onChangeAppState-Cn_HSmmQ.js → onChangeAppState-CHYSALjM.js} +1 -1
  193. package/dist/chunks/{openai-BD2V4lHN.js → openai-Brj68CWD.js} +1 -1
  194. package/dist/chunks/{overageCreditGrant-B47t5a73.js → overageCreditGrant-D5X6-TcP.js} +1 -1
  195. package/dist/chunks/{passes-DAOPYX0C.js → passes-B1f6NHWA.js} +1 -1
  196. package/dist/chunks/{paths-q1-Ni8Oh.js → paths-D8Fx3kUi.js} +2 -2
  197. package/dist/chunks/{permissions-BmxTU-Pk.js → permissions-CYrv_WVH.js} +1 -1
  198. package/dist/chunks/{pipeTransport-DnHE3axn.js → pipeTransport-DAYnzvGK.js} +1 -1
  199. package/dist/chunks/{plan-4dmnQ9bv.js → plan-B7EPetF0.js} +1 -1
  200. package/dist/chunks/{plugin-CG7lJIpf.js → plugin-BRWx-_ZS.js} +1 -1
  201. package/dist/chunks/{pluginAutoupdate-CPLuidh-.js → pluginAutoupdate-BwxAsU2F.js} +1 -1
  202. package/dist/chunks/{pluginBlocklist-BHxIUqu4.js → pluginBlocklist-BiRgxFei.js} +1 -1
  203. package/dist/chunks/{pluginCliCommands-BcDIvxR3.js → pluginCliCommands-CXANH43C.js} +1 -1
  204. package/dist/chunks/{pluginFlagging-Dh6rYOvj.js → pluginFlagging-CBbUoCJ9.js} +1 -1
  205. package/dist/chunks/{pluginOperations-fdLcp72i.js → pluginOperations-B3gcFjVq.js} +1 -1
  206. package/dist/chunks/{pluginStartupCheck-Dy7EckW4.js → pluginStartupCheck-BNfv-Pf4.js} +1 -1
  207. package/dist/chunks/pluginStartupCheck-Ga_XiMnA.js +1 -0
  208. package/dist/chunks/{plugins-C3-iYKTp.js → plugins-zHTS03v8.js} +1 -1
  209. package/dist/chunks/policyLimits-Dsz-jkpD.js +1 -0
  210. package/dist/chunks/{pollConfig-BGXMaSla.js → pollConfig-BWY_xmk6.js} +1 -1
  211. package/dist/chunks/{poor-CxAil0Mi.js → poor-Bcu8JaV5.js} +1 -1
  212. package/dist/chunks/poorMode-BAuBNURJ.js +1 -0
  213. package/dist/chunks/{poorMode-DFcYVnMT.js → poorMode-CDhhKGBw.js} +1 -1
  214. package/dist/chunks/{print-Cog1o-Tw.js → print-DO52Fudu.js} +4 -4
  215. package/dist/chunks/{privacy-settings-D6g7p6sB.js → privacy-settings-CmHUlYoo.js} +1 -1
  216. package/dist/chunks/{processBashCommand-DqgujTR4.js → processBashCommand-DltW2Ubs.js} +1 -1
  217. package/dist/chunks/{processSlashCommand-DUPS9Xx3.js → processSlashCommand-JLJ_vF05.js} +1 -1
  218. package/dist/chunks/{prompt-BmOnuQfF.js → prompt-BxoRdmaw.js} +1 -1
  219. package/dist/chunks/prompt-D3rBUscf.js +1 -0
  220. package/dist/chunks/prompt-ohTcwieE.js +1 -0
  221. package/dist/chunks/{promptEditor-ClGwMkWl.js → promptEditor-LQu9NhbN.js} +1 -1
  222. package/dist/chunks/{protocolHandler--b0d38gF.js → protocolHandler-DYn2E9Yl.js} +1 -1
  223. package/dist/chunks/{rate-limit-options-DD2ZRREl.js → rate-limit-options-OQt6LUP8.js} +1 -1
  224. package/dist/chunks/{rcDebugLog-fhwD4wm-.js → rcDebugLog-5XEbz_Yg.js} +1 -1
  225. package/dist/chunks/{referral-rRvT6UDX.js → referral-BsAvaATn.js} +1 -1
  226. package/dist/chunks/{refresh-C7S_6LOQ.js → refresh-TlNezXn4.js} +1 -1
  227. package/dist/chunks/{registerProtocol-Bu_tz5Au.js → registerProtocol-COUVHFku.js} +1 -1
  228. package/dist/chunks/{registry-Bk0vdx_8.js → registry-m7JojEMY.js} +1 -1
  229. package/dist/chunks/{release-notes-BShc_V-B.js → release-notes-BDdughgu.js} +1 -1
  230. package/dist/chunks/{releaseNotes-D3wZdQVZ.js → releaseNotes-Bd3zxid3.js} +2 -2
  231. package/dist/chunks/{reload-plugins-CpytFAAC.js → reload-plugins-qUIybHNy.js} +1 -1
  232. package/dist/chunks/{remote-env-B9Of1v31.js → remote-env-GGlLNGsx.js} +1 -1
  233. package/dist/chunks/{remoteBridgeCore-BXp6nJ8q.js → remoteBridgeCore-DpF5alU6.js} +1 -1
  234. package/dist/chunks/{remoteControlServer-BvlTaHu4.js → remoteControlServer-C32rxr3F.js} +1 -1
  235. package/dist/chunks/{rename-DhTddAd7.js → rename-CCF7A5mG.js} +1 -1
  236. package/dist/chunks/{resume-DwVeFqnc.js → resume-C6ereXig.js} +1 -1
  237. package/dist/chunks/{runtimeObserver-BtgDP8Gz.js → runtimeObserver-DBdzsp_h.js} +1 -1
  238. package/dist/chunks/{runtimeObserver-dtT0QHYO.js → runtimeObserver-jrNSkZU2.js} +2 -2
  239. package/dist/chunks/sandbox-adapter-CQ0imVO1.js +1 -0
  240. package/dist/chunks/{sandbox-toggle-CG2vZNAb.js → sandbox-toggle-Bfti5GKF.js} +1 -1
  241. package/dist/chunks/searchExtraTools-Ntz1u-YC.js +1 -0
  242. package/dist/chunks/{sentry-DFk8bzvt.js → sentry-CZUyEC3A.js} +1 -1
  243. package/dist/chunks/{session-DifFcUdR.js → session-DCIDa5dI.js} +1 -1
  244. package/dist/chunks/{sessionDiscovery-CRbLIQv1.js → sessionDiscovery-5m_pul65.js} +1 -1
  245. package/dist/chunks/sessionFileAccessHooks-DD2a-mTZ.js +1 -0
  246. package/dist/chunks/{sessionMemory-BdptRKL8.js → sessionMemory-BQP_RezB.js} +1 -1
  247. package/dist/chunks/sessionMemory-hbxplpxs.js +1 -0
  248. package/dist/chunks/sessionMemoryUtils-DlW9hqOH.js +1 -0
  249. package/dist/chunks/{sessionObserver-D3vw6SJ_.js → sessionObserver-LBqNoak9.js} +1 -1
  250. package/dist/chunks/sessionObserver-Lb1c5FPy.js +1 -0
  251. package/dist/chunks/sessionStorage-DG68Xvsy.js +1 -0
  252. package/dist/chunks/{sessionTitle-DnvlYJ-c.js → sessionTitle-BIykjtKk.js} +1 -1
  253. package/dist/chunks/{sessionTracing-BkzKJi0v.js → sessionTracing-Da_r0mIc.js} +1 -1
  254. package/dist/chunks/{settingsSync-CHZVpM34.js → settingsSync-BE0PQqyo.js} +1 -1
  255. package/dist/chunks/{setup-GxlEx1KG.js → setup-CjA5bW6e.js} +1 -1
  256. package/dist/chunks/{setup-BpwYOhci.js → setup-lxzmZdw5.js} +2 -2
  257. package/dist/chunks/{setup-BfecYO-n.js → setup-p04XtwYu.js} +1 -1
  258. package/dist/chunks/{shadowedRuleDetection-FNzEipG0.js → shadowedRuleDetection-Zqp1M5St.js} +1 -1
  259. package/dist/chunks/{sideQuestion-Bfa0SZn5.js → sideQuestion-DzJenEES.js} +1 -1
  260. package/dist/chunks/sink-BdRlnpoG.js +1 -0
  261. package/dist/chunks/{sink-DpAjuilF.js → sink-N5XR8Zgp.js} +1 -1
  262. package/dist/chunks/sinks-Bn0FK_Ab.js +1 -0
  263. package/dist/chunks/sinks-D8erzS9D.js +2 -0
  264. package/dist/chunks/{skill-learning-BSeEbCnP.js → skill-learning-CbMQ8IsZ.js} +1 -1
  265. package/dist/chunks/{skillChangeDetector-BEDBRGbY.js → skillChangeDetector-4XWLpjQl.js} +1 -1
  266. package/dist/chunks/{skillGapStore-BCO6YB3H.js → skillGapStore-Bp5IVfOx.js} +1 -1
  267. package/dist/chunks/{skillGapStore-B4GmZRJ0.js → skillGapStore-DbiDG9Pd.js} +2 -2
  268. package/dist/chunks/{skillGenerator-QgDWAvzK.js → skillGenerator-Bys7U1l_.js} +2 -2
  269. package/dist/chunks/skillLearning-702-D6Lq.js +1 -0
  270. package/dist/chunks/skillLearning-Cz7qU9V6.js +1 -0
  271. package/dist/chunks/{skillPanel-srZjMIbC.js → skillPanel-MIHU1PPp.js} +3 -3
  272. package/dist/chunks/{skillSearchPanel-DTvHcwNK.js → skillSearchPanel-MFB-PzB1.js} +2 -2
  273. package/dist/chunks/{skills-BlVUkWg4.js → skills-D4tZYFpd.js} +1 -1
  274. package/dist/chunks/{sprites-QO9r_mXk.js → sprites-B479AZSz.js} +1 -1
  275. package/dist/chunks/{stats-DdXM-u7l.js → stats-B-ErfxCJ.js} +1 -1
  276. package/dist/chunks/{status-BIZWtZqI.js → status-DVACJLsK.js} +1 -1
  277. package/dist/chunks/{statusNoticeHelpers-9sIAjiE6.js → statusNoticeHelpers-CwSCVvxP.js} +1 -1
  278. package/dist/chunks/{tag-DDJ8pAsl.js → tag-YpE2D2ve.js} +1 -1
  279. package/dist/chunks/{tasks-DYt6udr3.js → tasks-7N7iSiEx.js} +1 -1
  280. package/dist/chunks/{teamHelpers-BJuKEuyS.js → teamHelpers-BFdTH57t.js} +1 -1
  281. package/dist/chunks/teamHelpers-CmDn2xyl.js +1 -0
  282. package/dist/chunks/{teammateModeSnapshot-Zp1weNIZ.js → teammateModeSnapshot-CwacsQvD.js} +1 -1
  283. package/dist/chunks/teammateModeSnapshot-DXtG86pG.js +1 -0
  284. package/dist/chunks/{teleport-DkoFG3EI.js → teleport-CPB1CHBs.js} +1 -1
  285. package/dist/chunks/{templateJobs-V2-TVeGE.js → templateJobs-BM98KAEH.js} +1 -1
  286. package/dist/chunks/{terminalSetup-DMUDhXur.js → terminalSetup-CGiIwoIX.js} +1 -1
  287. package/dist/chunks/{terminalSetup-l0Vv_v1c.js → terminalSetup-yQ0CoywX.js} +1 -1
  288. package/dist/chunks/{theme-Dm1yCDce.js → theme-C5ULGNRs.js} +1 -1
  289. package/dist/chunks/{thinkback-DQAZE5SA.js → thinkback-CF_sLFvX.js} +1 -1
  290. package/dist/chunks/thinkback-D1Fv1QYl.js +1 -0
  291. package/dist/chunks/{thinkback-play-BJcGmc9X.js → thinkback-play-syg_SJm8.js} +1 -1
  292. package/dist/chunks/{toolEventObserver-C-BImvCz.js → toolEventObserver-CcLqNRcT.js} +1 -1
  293. package/dist/chunks/{toolEventObserver-BgkqkNwy.js → toolEventObserver-CuJbsUL0.js} +1 -1
  294. package/dist/chunks/toolPool-C4CO158z.js +1 -0
  295. package/dist/chunks/{toolPool-DYvz_Mjt.js → toolPool-CRq0GSrk.js} +1 -1
  296. package/dist/chunks/{trustedDevice-CXsk3eij.js → trustedDevice-C4tvgByY.js} +1 -1
  297. package/dist/chunks/{trustedDevice-BDrK9AQ6.js → trustedDevice-u2HpuTkN.js} +1 -1
  298. package/dist/chunks/{ultrareviewCommand-Bc8hMzHz.js → ultrareviewCommand-CWLiiq-z.js} +1 -1
  299. package/dist/chunks/{undercover-kRoI_nlN.js → undercover-CNlN7Xzl.js} +1 -1
  300. package/dist/chunks/undercover-jZEIpxrJ.js +1 -0
  301. package/dist/chunks/{updateCCB-BPGNN7VA.js → updateCCB-BWN4mOEz.js} +1 -1
  302. package/dist/chunks/{upgrade-DmEGLk6v.js → upgrade-CE25mJEk.js} +1 -1
  303. package/dist/chunks/upgrade-C_0-l0Zo.js +1 -0
  304. package/dist/chunks/{upload-49qk5TBL.js → upload-YpyOX2a-.js} +1 -1
  305. package/dist/chunks/{usage-DhJDFJVx.js → usage-Bw-kTwHb.js} +1 -1
  306. package/dist/chunks/{usage-sYgTL8wR.js → usage-DNXwr_ep.js} +1 -1
  307. package/dist/chunks/{useMainLoopModel-CJaR_qEJ.js → useMainLoopModel-DPmF_cMn.js} +1 -1
  308. package/dist/chunks/{useManagePlugins-B1FpmxFo.js → useManagePlugins-hPG7UMWo.js} +1 -1
  309. package/dist/chunks/{useMergedTools-eMPZ95TX.js → useMergedTools-BSO1NflP.js} +1 -1
  310. package/dist/chunks/{useSearchInput-CR-b0Qi6.js → useSearchInput-CR9uhbA7.js} +1 -1
  311. package/dist/chunks/{useSettingsErrors-p-PFBeaC.js → useSettingsErrors-453j5XuO.js} +1 -1
  312. package/dist/chunks/{useVoice-D3PqTfCK.js → useVoice-B5DQ5Tay.js} +1 -1
  313. package/dist/chunks/{util-BZ2fS3PR.js → util-D_BHu06u.js} +1 -1
  314. package/dist/chunks/utils--ZdihcLH.js +1 -0
  315. package/dist/chunks/{validatePlugin-QtcXXmZu.js → validatePlugin-Dxm-5f8W.js} +1 -1
  316. package/dist/chunks/{vim-LmepJftY.js → vim-BGqKMQxl.js} +1 -1
  317. package/dist/chunks/{voice-CNRTt4gH.js → voice-B2MWrkN3.js} +1 -1
  318. package/dist/chunks/voiceModeEnabled-0NU5pSM-.js +1 -0
  319. package/dist/chunks/{voiceModeEnabled-wWM929QG.js → voiceModeEnabled-if9dV1bW.js} +1 -1
  320. package/dist/chunks/{voiceStreamSTT-CnK9GN6Q.js → voiceStreamSTT-CWhKAxcp.js} +1 -1
  321. package/dist/chunks/voiceStreamSTT-yvcTWD7i.js +1 -0
  322. package/dist/chunks/{workerRegistry-CrIpKIZe.js → workerRegistry-BANOcuS2.js} +1 -1
  323. package/dist/chunks/worktree-CRn2SbHn.js +1 -0
  324. package/dist/chunks/{xml-CMdTGiv6.js → xml-DZp0WcWT.js} +1 -1
  325. package/dist/cli.js +1 -1
  326. package/package.json +1 -1
  327. package/dist/chunks/ApproveApiKey-Bmcop2Do.js +0 -1
  328. package/dist/chunks/ClaudeMdExternalIncludesDialog-DO61Zz-S.js +0 -1
  329. package/dist/chunks/ConsoleOAuthFlow-FSHC5mxO.js +0 -1
  330. package/dist/chunks/Doctor-Dcntgp5Z.js +0 -1
  331. package/dist/chunks/Feedback-hFZwDSRp.js +0 -2
  332. package/dist/chunks/Grove-Cmcsx2UE.js +0 -1
  333. package/dist/chunks/MessageSelector-CDVC2CAj.js +0 -3
  334. package/dist/chunks/REPL-Dk3Ics9i.js +0 -1
  335. package/dist/chunks/SearchExtraToolsTool-C998WSxs.js +0 -1
  336. package/dist/chunks/SentryErrorBoundary-BJLT-ebr.js +0 -1
  337. package/dist/chunks/Settings-DBopjMkN.js +0 -2
  338. package/dist/chunks/WelcomeV2-BBFGft_e.js +0 -1
  339. package/dist/chunks/api-B2HW-oZI.js +0 -1
  340. package/dist/chunks/assistant-BmM44yln.js +0 -1
  341. package/dist/chunks/auth-ndSNSeqS.js +0 -1
  342. package/dist/chunks/backgroundHousekeeping-DVo3ndZr.js +0 -1
  343. package/dist/chunks/bridgeConfig-ZcbBdhji.js +0 -1
  344. package/dist/chunks/bridgeEnabled-D5qCI5v2.js +0 -1
  345. package/dist/chunks/bridgeMain-B4Zv8UOe.js +0 -1
  346. package/dist/chunks/caches-D_W3nCFE.js +0 -1
  347. package/dist/chunks/changeDetector-CUsHUdul.js +0 -1
  348. package/dist/chunks/channelNotification-CLVU5AuO.js +0 -1
  349. package/dist/chunks/clear-BP-G1JWa.js +0 -1
  350. package/dist/chunks/client-BHfY6SC5.js +0 -1
  351. package/dist/chunks/commands-E0eNJ_XZ.js +0 -1
  352. package/dist/chunks/commitAttribution-B4DOgUS7.js +0 -1
  353. package/dist/chunks/context-noninteractive-D1Kxn5e0.js +0 -1
  354. package/dist/chunks/conversation-C23rDJe3.js +0 -1
  355. package/dist/chunks/createSession-Bsa0VJKS.js +0 -1
  356. package/dist/chunks/datadog-MUvg76p3.js +0 -1
  357. package/dist/chunks/entry-Di8oWZUk.js +0 -14
  358. package/dist/chunks/envLessBridgeConfig-BNvozi46.js +0 -1
  359. package/dist/chunks/envLessBridgeConfig-CUTBQKDY.js +0 -1
  360. package/dist/chunks/extra-usage-DVtAa1zD.js +0 -1
  361. package/dist/chunks/extractMemories-8uB606Y0.js +0 -1
  362. package/dist/chunks/fast-DTGg3pRh.js +0 -1
  363. package/dist/chunks/gates-BbF5S-Dy.js +0 -1
  364. package/dist/chunks/hooks-gwB4Eotj.js +0 -1
  365. package/dist/chunks/inboundAttachments-DxrrrqBW.js +0 -1
  366. package/dist/chunks/initReplBridge-DWpGy3aE.js +0 -1
  367. package/dist/chunks/language-DC6bsdvI.js +0 -1
  368. package/dist/chunks/loadAgentsDir-6_9ZFegv.js +0 -1
  369. package/dist/chunks/localSearch-DbEm6f3k.js +0 -1
  370. package/dist/chunks/login-D2x89UCR.js +0 -1
  371. package/dist/chunks/logout-BBPihkXp.js +0 -1
  372. package/dist/chunks/mcp-D-0wE0nJ.js +0 -2
  373. package/dist/chunks/model-C6_WjCy0.js +0 -1
  374. package/dist/chunks/pluginStartupCheck-fyqW-stg.js +0 -1
  375. package/dist/chunks/policyLimits-DUGrXcje.js +0 -1
  376. package/dist/chunks/poorMode-BkPHRLuG.js +0 -1
  377. package/dist/chunks/prompt-B-8CD-W_.js +0 -1
  378. package/dist/chunks/prompt-Da3gIGA8.js +0 -1
  379. package/dist/chunks/sandbox-adapter-Cm8kCM_U.js +0 -1
  380. package/dist/chunks/searchExtraTools-D-RZ9DId.js +0 -1
  381. package/dist/chunks/sessionFileAccessHooks-Bixkjai4.js +0 -1
  382. package/dist/chunks/sessionMemory-T1K_mJRE.js +0 -1
  383. package/dist/chunks/sessionMemoryUtils-q3xRtP-z.js +0 -1
  384. package/dist/chunks/sessionObserver-i_3day_6.js +0 -1
  385. package/dist/chunks/sessionStorage-CusaYoh0.js +0 -1
  386. package/dist/chunks/sink-BSwQ045N.js +0 -1
  387. package/dist/chunks/sinks-C37Xl5c3.js +0 -2
  388. package/dist/chunks/sinks-DHHmQJi-.js +0 -1
  389. package/dist/chunks/skillLearning-CFYgFRPE.js +0 -1
  390. package/dist/chunks/skillLearning-en7AuVDZ.js +0 -1
  391. package/dist/chunks/teamHelpers-Cw5dPQor.js +0 -1
  392. package/dist/chunks/teammateModeSnapshot-BXC7ssXX.js +0 -1
  393. package/dist/chunks/thinkback-D1mk7cq1.js +0 -1
  394. package/dist/chunks/toolPool-DNH5H4Jg.js +0 -1
  395. package/dist/chunks/undercover-DUrQYxYo.js +0 -1
  396. package/dist/chunks/upgrade-BTI562Ce.js +0 -1
  397. package/dist/chunks/utils-hhztcb0b.js +0 -1
  398. package/dist/chunks/voiceModeEnabled-B57V7REx.js +0 -1
  399. package/dist/chunks/voiceStreamSTT-Dp-1uSjP.js +0 -1
  400. package/dist/chunks/worktree-YbEK6b36.js +0 -1
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,n,s as r,u as i}from"./envUtils-BWeoiL4Y.js";import{In as a,Ln as o,Mn as s,Tt as c,Xn as l,vt as u,wn as ee}from"./schemas-BGAvj1T4.js";import{t as d}from"./v4-f1i_CNUT.js";import{Ct as te,Fr as ne,Pr as re,U as ie,cn as ae,xt as f}from"./state-sIHsFpDu.js";import{E as p,L as m,R as h,T as g,V as _,d as v,s as y,w as oe}from"./debug-UI3T040K.js";import{_ as se,v as ce}from"./git-CN3qtTb_.js";import{o as le,s as b}from"./log-CzsijfHZ.js";import{n as ue,r as de}from"./execFileNoThrow-CuQN1sz8.js";import{E as x,T as fe,_ as pe,a as S,f as me,g as he,l as ge,n as _e}from"./teammate-DMYOtLTK.js";import{n as C,t as w}from"./lazySchema-2sOku3cX.js";import{c as ve}from"./constants-41VpZw2G.js";import{join as T}from"path";import{mkdirSync as ye,readFileSync as be,writeFileSync as xe}from"fs";import{mkdir as Se,readFile as E,readdir as D,rm as O,unlink as k,writeFile as A}from"fs/promises";function Ce(e){G!==e&&(G=e,j())}function we(){G!==void 0&&(G=void 0,j())}function j(){try{W.emit()}catch{}}function M(e){return T(F(e),Be)}async function N(e){let t=M(e);try{let e=(await E(t,`utf-8`)).trim(),n=parseInt(e,10);return isNaN(n)?0:n}catch{return 0}}async function Te(e,t){await A(M(e),String(t))}function Ee(){return i(process.env.CLAUDE_CODE_ENABLE_TASKS)?!0:!ie()}async function De(e){let t=F(e),n=await U(e),r;try{r=await x(n,q);let i=await R(e);i>0&&i>await N(e)&&await Te(e,i);let a;try{a=await D(t)}catch{a=[]}for(let e of a)if(e.endsWith(`.json`)&&!e.startsWith(`.`)){let n=T(t,e);try{await k(n)}catch{}}j()}finally{r&&await r()}}function Oe(){if(process.env.CLAUDE_CODE_TASK_LIST_ID)return process.env.CLAUDE_CODE_TASK_LIST_ID;let e=he();return e?e.teamName:S()||G||te()}function P(e){return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}function F(e){return T(n(),`tasks`,P(e))}function I(e,t){return T(F(e),`${P(t)}.json`)}async function L(e){let t=F(e);try{await Se(t,{recursive:!0})}catch{}}async function R(e){let t=F(e),n;try{n=await D(t)}catch{return 0}let r=0;for(let e of n){if(!e.endsWith(`.json`))continue;let t=parseInt(e.replace(`.json`,``),10);!isNaN(t)&&t>r&&(r=t)}return r}async function ke(e){let[t,n]=await Promise.all([R(e),N(e)]);return Math.max(t,n)}async function Ae(e,t){let n=await U(e),r;try{r=await x(n,q);let i=await ke(e),a=String(i+1),o={id:a,...t};return await A(I(e,a),p(o,null,2)),j(),a}finally{r&&await r()}}async function z(e,t){let n=I(e,t);try{let e=g(await E(n,`utf-8`));process.env.USER_TYPE===`ant`&&(e.status===`open`?e.status=`pending`:e.status===`resolved`?e.status=`completed`:e.status&&[`planning`,`implementing`,`reviewing`,`verifying`].includes(e.status)&&(e.status=`in_progress`));let r=ze().safeParse(e);return r.success?r.data:(v(`[Tasks] Task ${t} failed schema validation: ${r.error.message}`),null)}catch(e){return h(e)===`ENOENT`?null:(v(`[Tasks] Failed to read task ${t}: ${m(e)}`),b(e),null)}}async function B(e,t,n){let r=await z(e,t);if(!r)return null;let i={...r,...n,id:t};return await A(I(e,t),p(i,null,2)),j(),i}async function V(e,t,n){let r=I(e,t);if(!await z(e,t))return null;let i;try{return i=await x(r,q),await B(e,t,n)}finally{await i?.()}}async function je(e,t){let n=I(e,t);try{let r=parseInt(t,10);isNaN(r)||r>await N(e)&&await Te(e,r);try{await k(n)}catch(e){if(h(e)===`ENOENT`)return!1;throw e}let i=await H(e);for(let n of i){let r=n.blocks.filter(e=>e!==t),i=n.blockedBy.filter(e=>e!==t);(r.length!==n.blocks.length||i.length!==n.blockedBy.length)&&await V(e,n.id,{blocks:r,blockedBy:i})}return j(),!0}catch{return!1}}async function H(e){let t=F(e),n;try{n=await D(t)}catch{return[]}let r=n.filter(e=>e.endsWith(`.json`)).map(e=>e.replace(`.json`,``));return(await Promise.all(r.map(t=>z(e,t)))).filter(e=>e!==null)}async function Me(e,t,n){let[r,i]=await Promise.all([z(e,t),z(e,n)]);return!r||!i?!1:(r.blocks.includes(n)||await V(e,t,{blocks:[...r.blocks,n]}),i.blockedBy.includes(t)||await V(e,n,{blockedBy:[...i.blockedBy,t]}),!0)}function Ne(e){return T(F(e),`.lock`)}async function U(e){await L(e);let t=Ne(e);try{await A(t,``,{flag:`wx`})}catch{}return t}async function Pe(e,t,n,r={}){let i=I(e,t);if(!await z(e,t))return{success:!1,reason:`task_not_found`};if(r.checkAgentBusy)return Fe(e,t,n);let a;try{a=await x(i,q);let r=await z(e,t);if(!r)return{success:!1,reason:`task_not_found`};if(r.owner&&r.owner!==n)return{success:!1,reason:`already_claimed`,task:r};if(r.status===`completed`)return{success:!1,reason:`already_resolved`,task:r};let o=await H(e),s=new Set(o.filter(e=>e.status!==`completed`).map(e=>e.id)),c=r.blockedBy.filter(e=>s.has(e));return c.length>0?{success:!1,reason:`blocked`,task:r,blockedByTasks:c}:{success:!0,task:await B(e,t,{owner:n})}}catch(e){return v(`[Tasks] Failed to claim task ${t}: ${m(e)}`),b(e),{success:!1,reason:`task_not_found`}}finally{a&&await a()}}async function Fe(e,t,n){let r=await U(e),i;try{i=await x(r,q);let a=await H(e),o=a.find(e=>e.id===t);if(!o)return{success:!1,reason:`task_not_found`};if(o.owner&&o.owner!==n)return{success:!1,reason:`already_claimed`,task:o};if(o.status===`completed`)return{success:!1,reason:`already_resolved`,task:o};let s=new Set(a.filter(e=>e.status!==`completed`).map(e=>e.id)),c=o.blockedBy.filter(e=>s.has(e));if(c.length>0)return{success:!1,reason:`blocked`,task:o,blockedByTasks:c};let l=a.filter(e=>e.status!==`completed`&&e.owner===n&&e.id!==t);return l.length>0?{success:!1,reason:`agent_busy`,task:o,busyWithTasks:l.map(e=>e.id)}:{success:!0,task:await V(e,t,{owner:n})}}catch(e){return v(`[Tasks] Failed to claim task ${t} with busy check: ${m(e)}`),b(e),{success:!1,reason:`task_not_found`}}finally{i&&await i()}}async function Ie(e,t,n,r){let i=(await H(e)).filter(e=>e.status!==`completed`&&(e.owner===t||e.owner===n));for(let t of i)await V(e,t.id,{owner:void 0,status:`pending`});i.length>0&&v(`[Tasks] Unassigned ${i.length} task(s) from ${n}`);let a=`${n} ${r===`terminated`?`was terminated`:`has shut down`}.`;if(i.length>0){let e=i.map(e=>`#${e.id} "${e.subject}"`).join(`, `);a+=` ${i.length} task(s) were unassigned: ${e}. Use TaskList to check availability and TaskUpdate with owner to reassign them to idle teammates.`}return{unassignedTasks:i.map(e=>({id:e.id,subject:e.subject})),notificationMessage:a}}var W,G,Le,Re,K,ze,Be,q,Ve,He=e((()=>{d(),ae(),y(),r(),_(),w(),fe(),le(),ne(),oe(),ge(),pe(),W=re(),Le=W.subscribe,Re=[`pending`,`in_progress`,`completed`],K=C(()=>u([`pending`,`in_progress`,`completed`])),ze=C(()=>ee({id:o(),subject:o(),description:o(),activeForm:o().optional(),owner:o().optional(),status:K(),blocks:c(o()),blockedBy:c(o()),metadata:s(o(),l()).optional()})),Be=`.highwatermark`,q={retries:{retries:30,minTimeout:5,maxTimeout:100}},Ve=`tasklist`}));function J(e){return e===`tmux`||e===`iterm2`||e===`windows-terminal`}var Ue=e((()=>{}));function Y(e){return e.replace(/[^a-zA-Z0-9]/g,`-`).toLowerCase()}function We(e){return e.replace(/@/g,`-`)}function X(e){return T(t(),Y(e))}function Z(e){return T(X(e),`config.json`)}function Q(e){try{return g(be(Z(e),`utf-8`))}catch(t){return h(t)===`ENOENT`||v(`[TeammateTool] Failed to read team file for ${e}: ${m(t)}`),null}}async function Ge(e){try{return g(await E(Z(e),`utf-8`))}catch(t){return h(t)===`ENOENT`||v(`[TeammateTool] Failed to read team file for ${e}: ${m(t)}`),null}}function $(e,t){ye(X(e),{recursive:!0}),xe(Z(e),p(t,null,2))}async function Ke(e,t){await Se(X(e),{recursive:!0}),await A(Z(e),p(t,null,2))}function qe(e,t){let n=t.agentId||t.name;if(!n)return v(`[TeammateTool] removeTeammateFromTeamFile called with no identifier`),!1;let r=Q(e);if(!r)return v(`[TeammateTool] Cannot remove teammate ${n}: failed to read team file for "${e}"`),!1;let i=r.members.length;return r.members=r.members.filter(e=>!(t.agentId&&e.agentId===t.agentId||t.name&&e.name===t.name)),r.members.length===i?(v(`[TeammateTool] Teammate ${n} not found in team file for "${e}"`),!1):($(e,r),v(`[TeammateTool] Removed teammate from team file: ${n}`),!0)}function Je(e,t){let n=Q(e);if(!n)return!1;let r=n.members.findIndex(e=>e.tmuxPaneId===t);if(r===-1)return!1;if(n.members.splice(r,1),n.hiddenPaneIds){let e=n.hiddenPaneIds.indexOf(t);e!==-1&&n.hiddenPaneIds.splice(e,1)}return $(e,n),v(`[TeammateTool] Removed member with pane ${t} from team ${e}`),!0}function Ye(e,t){let n=Q(e);if(!n)return!1;let r=n.members.findIndex(e=>e.agentId===t);return r===-1?!1:(n.members.splice(r,1),$(e,n),v(`[TeammateTool] Removed member ${t} from team ${e}`),!0)}function Xe(e,t,n){let r=Q(e);if(!r)return!1;let i=r.members.find(e=>e.name===t);if(!i)return v(`[TeammateTool] Cannot set member mode: member ${t} not found in team ${e}`),!1;if(i.mode===n)return!0;let a=r.members.map(e=>e.name===t?{...e,mode:n}:e);return $(e,{...r,members:a}),v(`[TeammateTool] Set member ${t} in team ${e} to mode: ${n}`),!0}function Ze(e,t){if(!me())return;let n=t??S(),r=_e();n&&r&&Xe(n,r,e)}function Qe(e,t){let n=Q(e);if(!n)return!1;let r=new Map(t.map(e=>[e.memberName,e.mode])),i=!1,a=n.members.map(e=>{let t=r.get(e.name);return t!==void 0&&e.mode!==t?(i=!0,{...e,mode:t}):e});return i&&($(e,{...n,members:a}),v(`[TeammateTool] Set ${t.length} member modes in team ${e}`)),!0}async function $e(e,t,n){let r=await Ge(e);if(!r){v(`[TeammateTool] Cannot set member active: team ${e} not found`);return}let i=r.members.find(e=>e.name===t);if(!i){v(`[TeammateTool] Cannot set member active: member ${t} not found in team ${e}`);return}i.isActive!==n&&(i.isActive=n,await Ke(e,r),v(`[TeammateTool] Set member ${t} in team ${e} to ${n?`active`:`idle`}`))}async function et(e){let t=T(e,`.git`),n=null;try{let e=(await E(t,`utf-8`)).trim().match(/^gitdir:\s*(.+)$/);if(e&&e[1]){let t=e[1];n=T(T(t,`..`,`..`),`..`)}}catch{}if(n){let t=await ue(se(),[`worktree`,`remove`,`--force`,e],{cwd:n});if(t.code===0){v(`[TeammateTool] Removed worktree via git: ${e}`);return}if(t.stderr?.includes(`not a working tree`)){v(`[TeammateTool] Worktree already removed: ${e}`);return}v(`[TeammateTool] git worktree remove failed, falling back to rm: ${t.stderr}`)}try{await O(e,{recursive:!0,force:!0}),v(`[TeammateTool] Removed worktree directory manually: ${e}`)}catch(t){v(`[TeammateTool] Failed to remove worktree ${e}: ${m(t)}`)}}function tt(e){f().add(e)}function nt(e){f().delete(e)}async function rt(){let e=f();if(e.size===0)return;let t=Array.from(e);v(`cleanupSessionTeams: removing ${t.length} orphan team dir(s): ${t.join(`, `)}`),await Promise.allSettled(t.map(e=>it(e))),await Promise.allSettled(t.map(e=>at(e))),e.clear()}async function it(e){let t=Q(e);if(!t)return;let n=t.members.filter(e=>e.name!==`team-lead`&&e.tmuxPaneId&&e.backendType&&J(e.backendType));if(n.length===0)return;let[{ensureBackendsRegistered:r,getBackendByType:i},{isInsideTmux:a}]=await Promise.all([import(`./registry-Bk0vdx_8.js`),import(`./detection-DJ-vTbBf.js`)]);await r();let o=!await a();await Promise.allSettled(n.map(async e=>{if(!e.tmuxPaneId||!e.backendType||!J(e.backendType))return;let t=await i(e.backendType).killPane(e.tmuxPaneId,o);v(`cleanupSessionTeams: killPane ${e.name} (${e.backendType} ${e.tmuxPaneId}) → ${t}`)}))}async function at(e){let t=Y(e),n=Q(e),r=[];if(n)for(let e of n.members)e.worktreePath&&r.push(e.worktreePath);for(let e of r)await et(e);let i=X(e);try{await O(i,{recursive:!0,force:!0}),v(`[TeammateTool] Cleaned up team directory: ${i}`)}catch(e){v(`[TeammateTool] Failed to clean up team directory ${i}: ${m(e)}`)}let a=F(t);try{await O(a,{recursive:!0,force:!0}),v(`[TeammateTool] Cleaned up tasks directory: ${a}`),j()}catch(e){v(`[TeammateTool] Failed to clean up tasks directory ${a}: ${m(e)}`)}}var ot=e((()=>{d(),ae(),y(),r(),_(),de(),ce(),w(),oe(),He(),ge(),Ue(),ve(),C(()=>a({operation:u([`spawnTeam`,`cleanup`]).describe(`Operation: spawnTeam to create a team, cleanup to remove team and task directories.`),agent_type:o().optional().describe(`Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.`),team_name:o().optional().describe(`Name for the new team to create (required for spawnTeam).`),description:o().optional().describe(`Team description/purpose (only used with spawnTeam).`)}))}));export{L as A,Ce as B,Re as C,we as D,Pe as E,Ee as F,V as H,H as I,Le as L,Oe as M,F as N,Ae as O,He as P,De as R,Ve as S,Me as T,Ie as V,Ze as _,ot as a,Ue as b,tt as c,qe as d,We as f,Qe as g,Xe as h,Z as i,z as j,je as k,Ye as l,$e as m,at as n,Q as o,Y as p,X as r,Ge as s,rt as t,Je as u,nt as v,K as w,J as x,Ke as y,P as z};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{i as t,n,s as r,u as i}from"./envUtils-BWeoiL4Y.js";import{In as a,Ln as o,Mn as s,Tt as c,Xn as l,vt as u,wn as ee}from"./schemas-BGAvj1T4.js";import{t as d}from"./v4-f1i_CNUT.js";import{Ct as te,Fr as ne,Pr as re,U as ie,cn as ae,xt as f}from"./state-sIHsFpDu.js";import{E as p,L as m,R as h,T as g,V as _,d as v,s as y,w as oe}from"./debug-UI3T040K.js";import{_ as se,v as ce}from"./git-CN3qtTb_.js";import{o as le,s as b}from"./log-CzsijfHZ.js";import{n as ue,r as de}from"./execFileNoThrow-CuQN1sz8.js";import{E as x,T as fe,_ as pe,a as S,f as me,g as he,l as ge,n as _e}from"./teammate-DMYOtLTK.js";import{n as C,t as w}from"./lazySchema-2sOku3cX.js";import{c as ve}from"./constants-41VpZw2G.js";import{join as T}from"path";import{mkdirSync as ye,readFileSync as be,writeFileSync as xe}from"fs";import{mkdir as Se,readFile as E,readdir as D,rm as O,unlink as k,writeFile as A}from"fs/promises";function Ce(e){G!==e&&(G=e,j())}function we(){G!==void 0&&(G=void 0,j())}function j(){try{W.emit()}catch{}}function M(e){return T(F(e),Be)}async function N(e){let t=M(e);try{let e=(await E(t,`utf-8`)).trim(),n=parseInt(e,10);return isNaN(n)?0:n}catch{return 0}}async function Te(e,t){await A(M(e),String(t))}function Ee(){return i(process.env.CLAUDE_CODE_ENABLE_TASKS)?!0:!ie()}async function De(e){let t=F(e),n=await U(e),r;try{r=await x(n,q);let i=await R(e);i>0&&i>await N(e)&&await Te(e,i);let a;try{a=await D(t)}catch{a=[]}for(let e of a)if(e.endsWith(`.json`)&&!e.startsWith(`.`)){let n=T(t,e);try{await k(n)}catch{}}j()}finally{r&&await r()}}function Oe(){if(process.env.CLAUDE_CODE_TASK_LIST_ID)return process.env.CLAUDE_CODE_TASK_LIST_ID;let e=he();return e?e.teamName:S()||G||te()}function P(e){return e.replace(/[^a-zA-Z0-9_-]/g,`-`)}function F(e){return T(n(),`tasks`,P(e))}function I(e,t){return T(F(e),`${P(t)}.json`)}async function L(e){let t=F(e);try{await Se(t,{recursive:!0})}catch{}}async function R(e){let t=F(e),n;try{n=await D(t)}catch{return 0}let r=0;for(let e of n){if(!e.endsWith(`.json`))continue;let t=parseInt(e.replace(`.json`,``),10);!isNaN(t)&&t>r&&(r=t)}return r}async function ke(e){let[t,n]=await Promise.all([R(e),N(e)]);return Math.max(t,n)}async function Ae(e,t){let n=await U(e),r;try{r=await x(n,q);let i=await ke(e),a=String(i+1),o={id:a,...t};return await A(I(e,a),p(o,null,2)),j(),a}finally{r&&await r()}}async function z(e,t){let n=I(e,t);try{let e=g(await E(n,`utf-8`));process.env.USER_TYPE===`ant`&&(e.status===`open`?e.status=`pending`:e.status===`resolved`?e.status=`completed`:e.status&&[`planning`,`implementing`,`reviewing`,`verifying`].includes(e.status)&&(e.status=`in_progress`));let r=ze().safeParse(e);return r.success?r.data:(v(`[Tasks] Task ${t} failed schema validation: ${r.error.message}`),null)}catch(e){return h(e)===`ENOENT`?null:(v(`[Tasks] Failed to read task ${t}: ${m(e)}`),b(e),null)}}async function B(e,t,n){let r=await z(e,t);if(!r)return null;let i={...r,...n,id:t};return await A(I(e,t),p(i,null,2)),j(),i}async function V(e,t,n){let r=I(e,t);if(!await z(e,t))return null;let i;try{return i=await x(r,q),await B(e,t,n)}finally{await i?.()}}async function je(e,t){let n=I(e,t);try{let r=parseInt(t,10);isNaN(r)||r>await N(e)&&await Te(e,r);try{await k(n)}catch(e){if(h(e)===`ENOENT`)return!1;throw e}let i=await H(e);for(let n of i){let r=n.blocks.filter(e=>e!==t),i=n.blockedBy.filter(e=>e!==t);(r.length!==n.blocks.length||i.length!==n.blockedBy.length)&&await V(e,n.id,{blocks:r,blockedBy:i})}return j(),!0}catch{return!1}}async function H(e){let t=F(e),n;try{n=await D(t)}catch{return[]}let r=n.filter(e=>e.endsWith(`.json`)).map(e=>e.replace(`.json`,``));return(await Promise.all(r.map(t=>z(e,t)))).filter(e=>e!==null)}async function Me(e,t,n){let[r,i]=await Promise.all([z(e,t),z(e,n)]);return!r||!i?!1:(r.blocks.includes(n)||await V(e,t,{blocks:[...r.blocks,n]}),i.blockedBy.includes(t)||await V(e,n,{blockedBy:[...i.blockedBy,t]}),!0)}function Ne(e){return T(F(e),`.lock`)}async function U(e){await L(e);let t=Ne(e);try{await A(t,``,{flag:`wx`})}catch{}return t}async function Pe(e,t,n,r={}){let i=I(e,t);if(!await z(e,t))return{success:!1,reason:`task_not_found`};if(r.checkAgentBusy)return Fe(e,t,n);let a;try{a=await x(i,q);let r=await z(e,t);if(!r)return{success:!1,reason:`task_not_found`};if(r.owner&&r.owner!==n)return{success:!1,reason:`already_claimed`,task:r};if(r.status===`completed`)return{success:!1,reason:`already_resolved`,task:r};let o=await H(e),s=new Set(o.filter(e=>e.status!==`completed`).map(e=>e.id)),c=r.blockedBy.filter(e=>s.has(e));return c.length>0?{success:!1,reason:`blocked`,task:r,blockedByTasks:c}:{success:!0,task:await B(e,t,{owner:n})}}catch(e){return v(`[Tasks] Failed to claim task ${t}: ${m(e)}`),b(e),{success:!1,reason:`task_not_found`}}finally{a&&await a()}}async function Fe(e,t,n){let r=await U(e),i;try{i=await x(r,q);let a=await H(e),o=a.find(e=>e.id===t);if(!o)return{success:!1,reason:`task_not_found`};if(o.owner&&o.owner!==n)return{success:!1,reason:`already_claimed`,task:o};if(o.status===`completed`)return{success:!1,reason:`already_resolved`,task:o};let s=new Set(a.filter(e=>e.status!==`completed`).map(e=>e.id)),c=o.blockedBy.filter(e=>s.has(e));if(c.length>0)return{success:!1,reason:`blocked`,task:o,blockedByTasks:c};let l=a.filter(e=>e.status!==`completed`&&e.owner===n&&e.id!==t);return l.length>0?{success:!1,reason:`agent_busy`,task:o,busyWithTasks:l.map(e=>e.id)}:{success:!0,task:await V(e,t,{owner:n})}}catch(e){return v(`[Tasks] Failed to claim task ${t} with busy check: ${m(e)}`),b(e),{success:!1,reason:`task_not_found`}}finally{i&&await i()}}async function Ie(e,t,n,r){let i=(await H(e)).filter(e=>e.status!==`completed`&&(e.owner===t||e.owner===n));for(let t of i)await V(e,t.id,{owner:void 0,status:`pending`});i.length>0&&v(`[Tasks] Unassigned ${i.length} task(s) from ${n}`);let a=`${n} ${r===`terminated`?`was terminated`:`has shut down`}.`;if(i.length>0){let e=i.map(e=>`#${e.id} "${e.subject}"`).join(`, `);a+=` ${i.length} task(s) were unassigned: ${e}. Use TaskList to check availability and TaskUpdate with owner to reassign them to idle teammates.`}return{unassignedTasks:i.map(e=>({id:e.id,subject:e.subject})),notificationMessage:a}}var W,G,Le,Re,K,ze,Be,q,Ve,He=e((()=>{d(),ae(),y(),r(),_(),w(),fe(),le(),ne(),oe(),ge(),pe(),W=re(),Le=W.subscribe,Re=[`pending`,`in_progress`,`completed`],K=C(()=>u([`pending`,`in_progress`,`completed`])),ze=C(()=>ee({id:o(),subject:o(),description:o(),activeForm:o().optional(),owner:o().optional(),status:K(),blocks:c(o()),blockedBy:c(o()),metadata:s(o(),l()).optional()})),Be=`.highwatermark`,q={retries:{retries:30,minTimeout:5,maxTimeout:100}},Ve=`tasklist`}));function J(e){return e===`tmux`||e===`iterm2`||e===`windows-terminal`}var Ue=e((()=>{}));function Y(e){return e.replace(/[^a-zA-Z0-9]/g,`-`).toLowerCase()}function We(e){return e.replace(/@/g,`-`)}function X(e){return T(t(),Y(e))}function Z(e){return T(X(e),`config.json`)}function Q(e){try{return g(be(Z(e),`utf-8`))}catch(t){return h(t)===`ENOENT`||v(`[TeammateTool] Failed to read team file for ${e}: ${m(t)}`),null}}async function Ge(e){try{return g(await E(Z(e),`utf-8`))}catch(t){return h(t)===`ENOENT`||v(`[TeammateTool] Failed to read team file for ${e}: ${m(t)}`),null}}function $(e,t){ye(X(e),{recursive:!0}),xe(Z(e),p(t,null,2))}async function Ke(e,t){await Se(X(e),{recursive:!0}),await A(Z(e),p(t,null,2))}function qe(e,t){let n=t.agentId||t.name;if(!n)return v(`[TeammateTool] removeTeammateFromTeamFile called with no identifier`),!1;let r=Q(e);if(!r)return v(`[TeammateTool] Cannot remove teammate ${n}: failed to read team file for "${e}"`),!1;let i=r.members.length;return r.members=r.members.filter(e=>!(t.agentId&&e.agentId===t.agentId||t.name&&e.name===t.name)),r.members.length===i?(v(`[TeammateTool] Teammate ${n} not found in team file for "${e}"`),!1):($(e,r),v(`[TeammateTool] Removed teammate from team file: ${n}`),!0)}function Je(e,t){let n=Q(e);if(!n)return!1;let r=n.members.findIndex(e=>e.tmuxPaneId===t);if(r===-1)return!1;if(n.members.splice(r,1),n.hiddenPaneIds){let e=n.hiddenPaneIds.indexOf(t);e!==-1&&n.hiddenPaneIds.splice(e,1)}return $(e,n),v(`[TeammateTool] Removed member with pane ${t} from team ${e}`),!0}function Ye(e,t){let n=Q(e);if(!n)return!1;let r=n.members.findIndex(e=>e.agentId===t);return r===-1?!1:(n.members.splice(r,1),$(e,n),v(`[TeammateTool] Removed member ${t} from team ${e}`),!0)}function Xe(e,t,n){let r=Q(e);if(!r)return!1;let i=r.members.find(e=>e.name===t);if(!i)return v(`[TeammateTool] Cannot set member mode: member ${t} not found in team ${e}`),!1;if(i.mode===n)return!0;let a=r.members.map(e=>e.name===t?{...e,mode:n}:e);return $(e,{...r,members:a}),v(`[TeammateTool] Set member ${t} in team ${e} to mode: ${n}`),!0}function Ze(e,t){if(!me())return;let n=t??S(),r=_e();n&&r&&Xe(n,r,e)}function Qe(e,t){let n=Q(e);if(!n)return!1;let r=new Map(t.map(e=>[e.memberName,e.mode])),i=!1,a=n.members.map(e=>{let t=r.get(e.name);return t!==void 0&&e.mode!==t?(i=!0,{...e,mode:t}):e});return i&&($(e,{...n,members:a}),v(`[TeammateTool] Set ${t.length} member modes in team ${e}`)),!0}async function $e(e,t,n){let r=await Ge(e);if(!r){v(`[TeammateTool] Cannot set member active: team ${e} not found`);return}let i=r.members.find(e=>e.name===t);if(!i){v(`[TeammateTool] Cannot set member active: member ${t} not found in team ${e}`);return}i.isActive!==n&&(i.isActive=n,await Ke(e,r),v(`[TeammateTool] Set member ${t} in team ${e} to ${n?`active`:`idle`}`))}async function et(e){let t=T(e,`.git`),n=null;try{let e=(await E(t,`utf-8`)).trim().match(/^gitdir:\s*(.+)$/);if(e&&e[1]){let t=e[1];n=T(T(t,`..`,`..`),`..`)}}catch{}if(n){let t=await ue(se(),[`worktree`,`remove`,`--force`,e],{cwd:n});if(t.code===0){v(`[TeammateTool] Removed worktree via git: ${e}`);return}if(t.stderr?.includes(`not a working tree`)){v(`[TeammateTool] Worktree already removed: ${e}`);return}v(`[TeammateTool] git worktree remove failed, falling back to rm: ${t.stderr}`)}try{await O(e,{recursive:!0,force:!0}),v(`[TeammateTool] Removed worktree directory manually: ${e}`)}catch(t){v(`[TeammateTool] Failed to remove worktree ${e}: ${m(t)}`)}}function tt(e){f().add(e)}function nt(e){f().delete(e)}async function rt(){let e=f();if(e.size===0)return;let t=Array.from(e);v(`cleanupSessionTeams: removing ${t.length} orphan team dir(s): ${t.join(`, `)}`),await Promise.allSettled(t.map(e=>it(e))),await Promise.allSettled(t.map(e=>at(e))),e.clear()}async function it(e){let t=Q(e);if(!t)return;let n=t.members.filter(e=>e.name!==`team-lead`&&e.tmuxPaneId&&e.backendType&&J(e.backendType));if(n.length===0)return;let[{ensureBackendsRegistered:r,getBackendByType:i},{isInsideTmux:a}]=await Promise.all([import(`./registry-m7JojEMY.js`),import(`./detection-DJ-vTbBf.js`)]);await r();let o=!await a();await Promise.allSettled(n.map(async e=>{if(!e.tmuxPaneId||!e.backendType||!J(e.backendType))return;let t=await i(e.backendType).killPane(e.tmuxPaneId,o);v(`cleanupSessionTeams: killPane ${e.name} (${e.backendType} ${e.tmuxPaneId}) → ${t}`)}))}async function at(e){let t=Y(e),n=Q(e),r=[];if(n)for(let e of n.members)e.worktreePath&&r.push(e.worktreePath);for(let e of r)await et(e);let i=X(e);try{await O(i,{recursive:!0,force:!0}),v(`[TeammateTool] Cleaned up team directory: ${i}`)}catch(e){v(`[TeammateTool] Failed to clean up team directory ${i}: ${m(e)}`)}let a=F(t);try{await O(a,{recursive:!0,force:!0}),v(`[TeammateTool] Cleaned up tasks directory: ${a}`),j()}catch(e){v(`[TeammateTool] Failed to clean up tasks directory ${a}: ${m(e)}`)}}var ot=e((()=>{d(),ae(),y(),r(),_(),de(),ce(),w(),oe(),He(),ge(),Ue(),ve(),C(()=>a({operation:u([`spawnTeam`,`cleanup`]).describe(`Operation: spawnTeam to create a team, cleanup to remove team and task directories.`),agent_type:o().optional().describe(`Type/role of the team lead (e.g., "researcher", "test-runner"). Used for team file and inter-agent coordination.`),team_name:o().optional().describe(`Name for the new team to create (required for spawnTeam).`),description:o().optional().describe(`Team description/purpose (only used with spawnTeam).`)}))}));export{L as A,Ce as B,Re as C,we as D,Pe as E,Ee as F,V as H,H as I,Le as L,Oe as M,F as N,Ae as O,He as P,De as R,Ve as S,Me as T,Ie as V,Ze as _,ot as a,Ue as b,tt as c,qe as d,We as f,Qe as g,Xe as h,Z as i,z as j,je as k,Ye as l,$e as m,at as n,Q as o,Y as p,X as r,Ge as s,rt as t,Je as u,nt as v,K as w,J as x,Ke as y,P as z};
@@ -0,0 +1 @@
1
+ import{a as e,t}from"./teamHelpers-BFdTH57t.js";e();export{t as cleanupSessionTeams};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{Ac as n,Sc as r}from"./paths-q1-Ni8Oh.js";import{d as i,s as a}from"./debug-UI3T040K.js";import{o,s}from"./log-CzsijfHZ.js";var c=t({captureTeammateModeSnapshot:()=>f,clearCliTeammateModeOverride:()=>d,getCliTeammateModeOverride:()=>u,getTeammateModeFromSnapshot:()=>p,setCliTeammateModeOverride:()=>l});function l(e){h=e}function u(){return h}function d(e){h=null,m=e,i(`[TeammateModeSnapshot] CLI override cleared, new mode: ${e}`)}function f(){h?(m=h,i(`[TeammateModeSnapshot] Captured from CLI override: ${m}`)):(m=r().teammateMode??`auto`,i(`[TeammateModeSnapshot] Captured from config: ${m}`))}function p(){return m===null&&(s(Error(`getTeammateModeFromSnapshot called before capture - this indicates an initialization bug`)),f()),m??`auto`}var m,h,g=e((()=>{n(),a(),o(),m=null,h=null}));export{g as a,p as i,d as n,l as o,u as r,c as s,f as t};
1
+ import{n as e,r as t}from"./chunk-DR8-3Aex.js";import{Ac as n,Sc as r}from"./paths-D8Fx3kUi.js";import{d as i,s as a}from"./debug-UI3T040K.js";import{o,s}from"./log-CzsijfHZ.js";var c=t({captureTeammateModeSnapshot:()=>f,clearCliTeammateModeOverride:()=>d,getCliTeammateModeOverride:()=>u,getTeammateModeFromSnapshot:()=>p,setCliTeammateModeOverride:()=>l});function l(e){h=e}function u(){return h}function d(e){h=null,m=e,i(`[TeammateModeSnapshot] CLI override cleared, new mode: ${e}`)}function f(){h?(m=h,i(`[TeammateModeSnapshot] Captured from CLI override: ${m}`)):(m=r().teammateMode??`auto`,i(`[TeammateModeSnapshot] Captured from config: ${m}`))}function p(){return m===null&&(s(Error(`getTeammateModeFromSnapshot called before capture - this indicates an initialization bug`)),f()),m??`auto`}var m,h,g=e((()=>{n(),a(),o(),m=null,h=null}));export{g as a,p as i,d as n,l as o,u as r,c as s,f as t};
@@ -0,0 +1 @@
1
+ import{a as e,t}from"./teammateModeSnapshot-CwacsQvD.js";e();export{t as captureTeammateModeSnapshot};
@@ -1 +1 @@
1
- import{cv as e,dv as t,gv as n,lv as r,pv as i}from"./loadAgentsDir-Cl2w3uvH.js";r();export{e as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,i as teleportResumeCodeSession,n as validateGitState};
1
+ import{cv as e,dv as t,gv as n,lv as r,pv as i}from"./loadAgentsDir-HZ19tmOZ.js";r();export{e as checkOutTeleportedSessionBranch,t as processMessagesForTeleportResume,i as teleportResumeCodeSession,n as validateGitState};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{GA as r,WA as i,_ as a,g as o,h as s}from"./loadAgentsDir-Cl2w3uvH.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=o(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let i;try{i=p(n)}catch{continue}for(let a of i){if(!a.endsWith(`.md`))continue;let i=c(a,`.md`);if(t.has(i))continue;t.add(i);let o=l(n,a);try{let{frontmatter:t,content:n}=r(f(o,`utf-8`),o),a=(typeof t.description==`string`?t.description:``)||s(n,`No description`);e.push({name:i,description:a,filePath:o,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{i(),n(),a()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,a+`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{GA as r,WA as i,_ as a,g as o,h as s}from"./loadAgentsDir-HZ19tmOZ.js";import{basename as c,join as l}from"path";import{appendFileSync as u,mkdirSync as d,readFileSync as f,readdirSync as p,writeFileSync as m}from"fs";import{randomUUID as h}from"crypto";function g(){let e=o(`templates`,process.cwd()),n=l(t(),`templates`);try{return p(n),[...e,n]}catch{return e}}function _(){let e=[],t=new Set;for(let n of g()){let i;try{i=p(n)}catch{continue}for(let a of i){if(!a.endsWith(`.md`))continue;let i=c(a,`.md`);if(t.has(i))continue;t.add(i);let o=l(n,a);try{let{frontmatter:t,content:n}=r(f(o,`utf-8`),o),a=(typeof t.description==`string`?t.description:``)||s(n,`No description`);e.push({name:i,description:a,filePath:o,frontmatter:t,content:n})}catch{}}}return e}function v(e){return _().find(t=>t.name===e)??null}var y=e((()=>{i(),n(),a()}));function b(){return l(t(),`jobs`)}function x(e){return l(b(),e)}function S(e,t,n,r,i){let a=x(e);d(a,{recursive:!0});let o=new Date().toISOString(),s={jobId:e,templateName:t,createdAt:o,updatedAt:o,status:`created`,args:i};return m(l(a,`state.json`),JSON.stringify(s,null,2),`utf-8`),m(l(a,`template.md`),n,`utf-8`),m(l(a,`input.txt`),r,`utf-8`),a}function C(e){try{let t=f(l(x(e),`state.json`),`utf-8`),n=JSON.parse(t);if(typeof n!=`object`||!n)return null;let r=n;return typeof r.jobId!=`string`||typeof r.status!=`string`?null:r}catch{return null}}function w(e,t){let n=x(e),r=C(e);if(!r)return!1;let i=l(n,`replies.jsonl`),a=JSON.stringify({text:t,timestamp:new Date().toISOString()});try{u(i,a+`
2
2
  `,`utf-8`)}catch{m(i,a+`
3
3
  `,`utf-8`)}let o={...r,updatedAt:new Date().toISOString()};return m(l(n,`state.json`),JSON.stringify(o,null,2),`utf-8`),!0}var T=e((()=>{n()}));async function E(e){let t=e[0];switch(t){case`list`:k();break;case`new`:A(e.slice(1));break;case`reply`:j(e.slice(1));break;case`status`:O(e.slice(1));break;default:console.error(`Unknown template command: ${t}`),D(),process.exitCode=1}}function D(){console.log(`
4
4
  Template Job Commands:
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{$ as r,In as i,Ln as a,t as o,v as s}from"./src-Di342QoJ.js";import{Ac as c,Nc as l,Pc as u,Sc as d,bc as f,el as ee,nl as p}from"./paths-q1-Ni8Oh.js";import{E as m,T as h,V as g,W as _,h as te,p as ne,w as re}from"./debug-UI3T040K.js";import{n as ie,t as v}from"./cwd--iizewsn.js";import{a as ae,n as y}from"./env-chR0gV31.js";import{o as b,s as x}from"./log-CzsijfHZ.js";import{i as oe,o as se}from"./platform-CuyedWpe.js";import{r as S,t as C}from"./execFileNoThrow-CuQN1sz8.js";import{d as w,o as T,s as ce}from"./types-Csi32ZXh.js";import{r as le,t as ue}from"./completionCache-DORrtxkS.js";import{homedir as E,platform as D}from"os";import{dirname as O,join as k}from"path";import{randomBytes as A}from"crypto";import{copyFile as j,mkdir as M,readFile as N,stat as P,writeFile as F}from"fs/promises";import{pathToFileURL as de}from"url";function I(){let e=ne().existsSync(k(v(),`CLAUDE.md`)),t=p(v());return[{key:`workspace`,text:`Ask Claude to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`claudemd`,text:`Run /init to create a CLAUDE.md file with instructions for Claude`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function L(){return I().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function R(){f().hasCompletedProjectOnboarding||L()&&l(e=>({...e,hasCompletedProjectOnboarding:!0}))}function z(){l(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var B,V=e((()=>{n(),c(),ie(),ee(),te(),B=t(()=>{let e=f();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!L()})}));function fe(e){u(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function H(){u(e=>({...e,appleTerminalSetupInProgress:!1}))}function pe(){let e=d();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function U(){return k(E(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function me(){let e=U(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await P(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),fe(t),t}catch(e){return x(e),null}}async function W(){let{inProgress:e,backupPath:t}=pe();if(!e)return{status:`no_backup`};if(!t)return H(),{status:`no_backup`};try{await P(t)}catch{return H(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),H(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return x(Error(`Failed to restore Terminal.app settings with: ${e}`)),H(),{status:`failed`,backupPath:t}}}var G=e((()=>{c(),S(),b()}));function he(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function ge(){return!y.terminal||!(y.terminal in $)?null:$[y.terminal]??null}function K(e){return r()?`\x1b]8;;${de(e).href}\x07${e}\x1b]8;;\x07`:e}function q(){return D()===`darwin`&&y.terminal===`Apple_Terminal`||y.terminal===`vscode`||y.terminal===`cursor`||y.terminal===`windsurf`||y.terminal===`alacritty`||y.terminal===`zed`}async function J(e){let t=``;switch(y.terminal){case`Apple_Terminal`:t=await xe(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await Se(e);break;case`zed`:t=await Ce(e);break;case null:break}return u(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(y.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:y.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),R(),process.env.USER_TYPE===`ant`&&(t+=await le(e)),t}function _e(){return d().shiftEnterKeyBindingInstalled===!0}function ve(){return d().hasUsedBackslashReturn===!0}function ye(){d().hasUsedBackslashReturn||u(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(y.terminal&&y.terminal in $)return e(`Shift+Enter is natively supported in ${$[y.terminal]}.
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./memoize-DNnuA2aU.js";import{$ as r,In as i,Ln as a,t as o,v as s}from"./src-Di342QoJ.js";import{Ac as c,Nc as l,Pc as u,Sc as d,bc as f,el as ee,nl as p}from"./paths-D8Fx3kUi.js";import{E as m,T as h,V as g,W as _,h as te,p as ne,w as re}from"./debug-UI3T040K.js";import{n as ie,t as v}from"./cwd--iizewsn.js";import{a as ae,n as y}from"./env-chR0gV31.js";import{o as b,s as x}from"./log-CzsijfHZ.js";import{i as oe,o as se}from"./platform-CuyedWpe.js";import{r as S,t as C}from"./execFileNoThrow-CuQN1sz8.js";import{d as w,o as T,s as ce}from"./types-Csi32ZXh.js";import{r as le,t as ue}from"./completionCache-DORrtxkS.js";import{homedir as E,platform as D}from"os";import{dirname as O,join as k}from"path";import{randomBytes as A}from"crypto";import{copyFile as j,mkdir as M,readFile as N,stat as P,writeFile as F}from"fs/promises";import{pathToFileURL as de}from"url";function I(){let e=ne().existsSync(k(v(),`CLAUDE.md`)),t=p(v());return[{key:`workspace`,text:`Ask Claude to create a new app or clone a repository`,isComplete:!1,isCompletable:!0,isEnabled:t},{key:`claudemd`,text:`Run /init to create a CLAUDE.md file with instructions for Claude`,isComplete:e,isCompletable:!0,isEnabled:!t}]}function L(){return I().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function R(){f().hasCompletedProjectOnboarding||L()&&l(e=>({...e,hasCompletedProjectOnboarding:!0}))}function z(){l(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var B,V=e((()=>{n(),c(),ie(),ee(),te(),B=t(()=>{let e=f();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!L()})}));function fe(e){u(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function H(){u(e=>({...e,appleTerminalSetupInProgress:!1}))}function pe(){let e=d();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function U(){return k(E(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function me(){let e=U(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await P(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),fe(t),t}catch(e){return x(e),null}}async function W(){let{inProgress:e,backupPath:t}=pe();if(!e)return{status:`no_backup`};if(!t)return H(),{status:`no_backup`};try{await P(t)}catch{return H(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),H(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return x(Error(`Failed to restore Terminal.app settings with: ${e}`)),H(),{status:`failed`,backupPath:t}}}var G=e((()=>{c(),S(),b()}));function he(){let e=process.env.VSCODE_GIT_ASKPASS_MAIN??``,t=process.env.PATH??``;return e.includes(`.vscode-server`)||e.includes(`.cursor-server`)||e.includes(`.windsurf-server`)||t.includes(`.vscode-server`)||t.includes(`.cursor-server`)||t.includes(`.windsurf-server`)}function ge(){return!y.terminal||!(y.terminal in $)?null:$[y.terminal]??null}function K(e){return r()?`\x1b]8;;${de(e).href}\x07${e}\x1b]8;;\x07`:e}function q(){return D()===`darwin`&&y.terminal===`Apple_Terminal`||y.terminal===`vscode`||y.terminal===`cursor`||y.terminal===`windsurf`||y.terminal===`alacritty`||y.terminal===`zed`}async function J(e){let t=``;switch(y.terminal){case`Apple_Terminal`:t=await xe(e);break;case`vscode`:t=await Y(`VSCode`,e);break;case`cursor`:t=await Y(`Cursor`,e);break;case`windsurf`:t=await Y(`Windsurf`,e);break;case`alacritty`:t=await Se(e);break;case`zed`:t=await Ce(e);break;case null:break}return u(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(y.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:y.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),R(),process.env.USER_TYPE===`ant`&&(t+=await le(e)),t}function _e(){return d().shiftEnterKeyBindingInstalled===!0}function ve(){return d().hasUsedBackslashReturn===!0}function ye(){d().hasUsedBackslashReturn||u(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(y.terminal&&y.terminal in $)return e(`Shift+Enter is natively supported in ${$[y.terminal]}.
2
2
 
3
3
  No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!q()){let t=y.terminal||`your current terminal`,n=oe(),r=``;return n===`macos`?r=` • macOS: Apple Terminal
4
4
  `:n===`windows`&&(r=` • Windows: Windows Terminal
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-DMUDhXur.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
1
+ import{a as e,c as t,i as n,n as r,o as i,r as a,s as o,t as s}from"./terminalSetup-CGiIwoIX.js";n();export{s as call,r as getNativeCSIuTerminalDisplayName,a as hasUsedBackslashReturn,e as isShiftEnterKeyBindingInstalled,i as markBackslashReturnUsed,o as setupTerminal,t as shouldOfferTerminalSetup};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,T as n,p as r,t as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{n as o,t as s}from"./ThemePicker-DnK0DStD.js";function c({onDone:e}){let[,t]=n();return(0,l.jsx)(r,{color:`permission`,children:(0,l.jsx)(s,{onThemeSelect:n=>{t(n),e(`Theme set to ${n}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var l,u;e((()=>{t(),i(),o(),l=a(),u=async(e,t)=>(0,l.jsx)(c,{onDone:e})}))();export{u as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,T as n,p as r,t as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{n as o,t as s}from"./ThemePicker-a5n2EKgk.js";function c({onDone:e}){let[,t]=n();return(0,l.jsx)(r,{color:`permission`,children:(0,l.jsx)(s,{onThemeSelect:n=>{t(n),e(`Theme set to ${n}`)},onCancel:()=>{e(`Theme picker dismissed`,{display:`system`})},skipExitHandling:!0})})}var l,u;e((()=>{t(),i(),o(),l=a(),u=async(e,t)=>(0,l.jsx)(c,{onDone:e})}))();export{u as call};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Lt as n,Rn as r,b as i,f as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{al as l,el as u}from"./paths-q1-Ni8Oh.js";import{K as d,U as f,V as p,d as m,s as h}from"./debug-UI3T040K.js";import{r as g,t as _}from"./execa-CGue6Z3n.js";import{o as ee,s as v}from"./log-CzsijfHZ.js";import{i as te,o as y}from"./platform-CuyedWpe.js";import{r as b,t as ne}from"./execFileNoThrow-CuQN1sz8.js";import{As as x,Es as S,Fs as C,Gs as w,Hs as T,Is as re,NA as ie,Nx as ae,Px as oe,Sy as se,Vs as ce,by as E,fs as D,jA as O,lc as k,ps as A,uc as j}from"./loadAgentsDir-Cl2w3uvH.js";import{n as M,r as N}from"./pluginStartupCheck-Dy7EckW4.js";import{a as P,s as F}from"./pluginOperations-fdLcp72i.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:O}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await A(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await l(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),r=I(e,`player.js`);try{await L(t)}catch(e){return f(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(v(e),{success:!1,message:`Could not access animation data: ${d(e).message}`})}try{await L(r)}catch(e){return f(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(v(e),{success:!1,message:`Could not access player script: ${d(e).message}`})}let i=n.get(process.stdout);if(!i)return{success:!1,message:`Failed to access terminal instance`};i.enterAlternateScreen();try{await _(`node`,[r],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{i.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await l(a)){let e=te();ne(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[n,r]=(0,G.useState)({phase:`checking`}),[a,o]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await T(),n=R(),i=z(),a=B(),s=n in t,c=x(a);if(s?c||(r({phase:`installing-marketplace`}),o(`Updating marketplace…`),m(`Refreshing marketplace ${n}`),await w(n,e=>{o(e)}),re(),k(),m(`Marketplace ${n} refreshed`)):(r({phase:`installing-marketplace`}),m(`Installing marketplace ${i}`),await C({source:`github`,repo:i},e=>{o(e)}),k(),m(`Marketplace ${n} installed`)),c){let{disabled:e}=await A();if(e.some(e=>e.name===`thinkback`||e.source?.includes(a))){r({phase:`enabling-plugin`}),m(`Enabling plugin ${a}`);let e=await P(a);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);k(),m(`Plugin ${a} enabled`)}}else{r({phase:`installing-plugin`}),m(`Installing plugin ${a}`);let e=await N([a]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}k(),m(`Plugin ${a} installed`)}r({phase:`ready`}),e()}catch(e){let n=d(e);v(n),r({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),n.phase===`error`)return(0,K.jsx)(s,{flexDirection:`column`,children:(0,K.jsxs)(i,{color:`error`,children:[`Error: `,n.message]})});if(n.phase===`ready`)return null;let c=n.phase===`checking`?`Checking thinkback installation…`:n.phase===`installing-marketplace`?`Installing marketplace…`:n.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(s,{flexDirection:`column`,children:(0,K.jsxs)(s,{children:[(0,K.jsx)(E,{}),(0,K.jsx)(i,{children:a||c})]})})}function W({onDone:e,onAction:t,skillDir:n,hasGenerated:r}){let[o,c]=(0,G.useState)(!1),l=r?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(r){c(!0),r===`play`?H(n).then(()=>{e(void 0,{display:`skip`})}):t(r)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(a,{title:`Think Back on 2025 with Claude Code`,subtitle:`Generate your 2025 Claude Code Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(s,{flexDirection:`column`,gap:1,children:[!r&&(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(i,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(i,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(ae,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,n]=(0,G.useState)(!1),[r,a]=(0,G.useState)(null),[o,c]=(0,G.useState)(null),[u,d]=(0,G.useState)(null);function f(){n(!0)}let p=(0,G.useCallback)(t=>{a(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!o&&!r&&V().then(e=>{e?(m(`Thinkback skill directory: ${e}`),c(e)):p(`Could not find thinkback skill directory`)})},[t,o,r,p]),(0,G.useEffect)(()=>{if(!o)return;let e=I(o,`year_in_review.js`);l(e).then(t=>{m(`Checking for ${e}: ${t?`found`:`not found`}`),d(t)})},[o]);function h(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return r?(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsxs)(i,{color:`error`,children:[`Error: `,r]}),(0,K.jsx)(i,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!o||u===null?(0,K.jsxs)(s,{children:[(0,K.jsx)(E,{}),(0,K.jsx)(i,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:h,skillDir:o,hasGenerated:u}):(0,K.jsx)(U,{onReady:f,onError:p})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{g(),r(),G=t(r(),1),oe(),o(),se(),F(),h(),p(),b(),u(),ee(),y(),j(),S(),ce(),ie(),D(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Claude Code year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Claude Code year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Claude Code year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Lt as n,Rn as r,b as i,f as a,t as o,x as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{al as l,el as u}from"./paths-D8Fx3kUi.js";import{K as d,U as f,V as p,d as m,s as h}from"./debug-UI3T040K.js";import{r as g,t as _}from"./execa-CGue6Z3n.js";import{o as ee,s as v}from"./log-CzsijfHZ.js";import{i as te,o as y}from"./platform-CuyedWpe.js";import{r as b,t as ne}from"./execFileNoThrow-CuQN1sz8.js";import{As as x,Es as S,Fs as C,Gs as w,Hs as T,Is as re,NA as ie,Nx as ae,Px as oe,Sy as se,Vs as ce,by as E,fs as D,jA as O,lc as k,ps as A,uc as j}from"./loadAgentsDir-HZ19tmOZ.js";import{n as M,r as N}from"./pluginStartupCheck-BNfv-Pf4.js";import{a as P,s as F}from"./pluginOperations-B3gcFjVq.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:O}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await A(),t=e.find(e=>e.name===`thinkback`||e.source&&e.source.includes(B()));if(!t)return null;let n=I(t.path,`skills`,X);return await l(n)?n:null}async function H(e){let t=I(e,`year_in_review.js`),r=I(e,`player.js`);try{await L(t)}catch(e){return f(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(v(e),{success:!1,message:`Could not access animation data: ${d(e).message}`})}try{await L(r)}catch(e){return f(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(v(e),{success:!1,message:`Could not access player script: ${d(e).message}`})}let i=n.get(process.stdout);if(!i)return{success:!1,message:`Failed to access terminal instance`};i.enterAlternateScreen();try{await _(`node`,[r],{stdio:`inherit`,cwd:e,reject:!1})}catch{}finally{i.exitAlternateScreen()}let a=I(e,`year_in_review.html`);if(await l(a)){let e=te();ne(e===`macos`?`open`:e===`windows`?`start`:`xdg-open`,[a])}return{success:!0,message:`Year in review animation complete!`}}function U({onReady:e,onError:t}){let[n,r]=(0,G.useState)({phase:`checking`}),[a,o]=(0,G.useState)(``);if((0,G.useEffect)(()=>{async function n(){try{let t=await T(),n=R(),i=z(),a=B(),s=n in t,c=x(a);if(s?c||(r({phase:`installing-marketplace`}),o(`Updating marketplace…`),m(`Refreshing marketplace ${n}`),await w(n,e=>{o(e)}),re(),k(),m(`Marketplace ${n} refreshed`)):(r({phase:`installing-marketplace`}),m(`Installing marketplace ${i}`),await C({source:`github`,repo:i},e=>{o(e)}),k(),m(`Marketplace ${n} installed`)),c){let{disabled:e}=await A();if(e.some(e=>e.name===`thinkback`||e.source?.includes(a))){r({phase:`enabling-plugin`}),m(`Enabling plugin ${a}`);let e=await P(a);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);k(),m(`Plugin ${a} enabled`)}}else{r({phase:`installing-plugin`}),m(`Installing plugin ${a}`);let e=await N([a]);if(e.failed.length>0){let t=e.failed.map(e=>`${e.name}: ${e.error}`).join(`, `);throw Error(`Failed to install plugin: ${t}`)}k(),m(`Plugin ${a} installed`)}r({phase:`ready`}),e()}catch(e){let n=d(e);v(n),r({phase:`error`,message:n.message}),t(n.message)}}n()},[e,t]),n.phase===`error`)return(0,K.jsx)(s,{flexDirection:`column`,children:(0,K.jsxs)(i,{color:`error`,children:[`Error: `,n.message]})});if(n.phase===`ready`)return null;let c=n.phase===`checking`?`Checking thinkback installation…`:n.phase===`installing-marketplace`?`Installing marketplace…`:n.phase===`enabling-plugin`?`Enabling thinkback plugin…`:`Installing thinkback plugin…`;return(0,K.jsx)(s,{flexDirection:`column`,children:(0,K.jsxs)(s,{children:[(0,K.jsx)(E,{}),(0,K.jsx)(i,{children:a||c})]})})}function W({onDone:e,onAction:t,skillDir:n,hasGenerated:r}){let[o,c]=(0,G.useState)(!1),l=r?[{label:`Play animation`,value:`play`,description:`Watch your year in review`},{label:`Edit content`,value:`edit`,description:`Modify the animation`},{label:`Fix errors`,value:`fix`,description:`Fix validation or rendering issues`},{label:`Regenerate`,value:`regenerate`,description:`Create a new animation from scratch`}]:[{label:`Let's go!`,value:`regenerate`,description:`Generate your personalized animation`}];function u(r){c(!0),r===`play`?H(n).then(()=>{e(void 0,{display:`skip`})}):t(r)}function d(){e(void 0,{display:`skip`})}return o?null:(0,K.jsx)(a,{title:`Think Back on 2025 with Claude Code`,subtitle:`Generate your 2025 Claude Code Think Back (takes a few minutes to run)`,onCancel:d,color:`claude`,children:(0,K.jsxs)(s,{flexDirection:`column`,gap:1,children:[!r&&(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(i,{children:`Relive your year of coding with Claude.`}),(0,K.jsx)(i,{dimColor:!0,children:`We'll create a personalized ASCII animation celebrating your journey.`})]}),(0,K.jsx)(ae,{options:l,onChange:u,visibleOptionCount:5})]})})}function le({onDone:e}){let[t,n]=(0,G.useState)(!1),[r,a]=(0,G.useState)(null),[o,c]=(0,G.useState)(null),[u,d]=(0,G.useState)(null);function f(){n(!0)}let p=(0,G.useCallback)(t=>{a(t),e(`Error with thinkback: ${t}. Try running /plugin to manually install the think-back plugin.`,{display:`system`})},[e]);(0,G.useEffect)(()=>{t&&!o&&!r&&V().then(e=>{e?(m(`Thinkback skill directory: ${e}`),c(e)):p(`Could not find thinkback skill directory`)})},[t,o,r,p]),(0,G.useEffect)(()=>{if(!o)return;let e=I(o,`year_in_review.js`);l(e).then(t=>{m(`Checking for ${e}: ${t?`found`:`not found`}`),d(t)})},[o]);function h(t){e({edit:Z,fix:Q,regenerate:$}[t],{display:`user`,shouldQuery:!0})}return r?(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsxs)(i,{color:`error`,children:[`Error: `,r]}),(0,K.jsx)(i,{dimColor:!0,children:`Try running /plugin to manually install the think-back plugin.`})]}):t?!o||u===null?(0,K.jsxs)(s,{children:[(0,K.jsx)(E,{}),(0,K.jsx)(i,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:h,skillDir:o,hasGenerated:u}):(0,K.jsx)(U,{onReady:f,onError:p})}async function ue(e){return(0,K.jsx)(le,{onDone:e})}var G,K,q,J,Y,X,Z,Q,$,de=e((()=>{g(),r(),G=t(r(),1),oe(),o(),se(),F(),h(),p(),b(),u(),ee(),y(),j(),S(),ce(),ie(),D(),M(),K=c(),q=`claude-code-marketplace`,J=`anthropics/claude-code-marketplace`,Y=`anthropics/claude-plugins-official`,X=`thinkback`,Z=`Use the Skill tool to invoke the "thinkback" skill with mode=edit to modify my existing Claude Code year in review animation. Ask me what I want to change. When the animation is ready, tell the user to run /think-back again to play it.`,Q=`Use the Skill tool to invoke the "thinkback" skill with mode=fix to fix validation or rendering errors in my existing Claude Code year in review animation. Run the validator, identify errors, and fix them. When the animation is ready, tell the user to run /think-back again to play it.`,$=`Use the Skill tool to invoke the "thinkback" skill with mode=regenerate to create a completely new Claude Code year in review animation from scratch. Delete the existing animation and start fresh. When the animation is ready, tell the user to run /think-back again to play it.`}));export{de as n,H as r,ue as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./thinkback-CF_sLFvX.js";e();export{n as call,t as playAnimation};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Es as t,Ms as n,NA as r,jA as i}from"./loadAgentsDir-Cl2w3uvH.js";import{n as a,r as o}from"./thinkback-DQAZE5SA.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:i}`}async function l(){let e=n(),t=c(),r=e.plugins[t];if(!r||r.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=r[0];return i?.installPath?{type:`text`,value:(await o(s(i.installPath,`skills`,d))).message}:{type:`text`,value:`Thinkback plugin installation path not found.`}}var u,d;e((()=>{t(),r(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Es as t,Ms as n,NA as r,jA as i}from"./loadAgentsDir-HZ19tmOZ.js";import{n as a,r as o}from"./thinkback-CF_sLFvX.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:i}`}async function l(){let e=n(),t=c(),r=e.plugins[t];if(!r||r.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=r[0];return i?.installPath?{type:`text`,value:(await o(s(i.installPath,`skills`,d))).message}:{type:`text`,value:`Thinkback plugin installation path not found.`}}var u,d;e((()=>{t(),r(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n}from"./debug-UI3T040K.js";import{o as r,s as i}from"./log-CzsijfHZ.js";import{i as a,t as o}from"./observationStore-tvkldXUo.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-0fpRKUeH.js`),import(`./featureCheck-p7OeCYzj.js`),import(`./runtimeObserver-BtgDP8Gz.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,n,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,n).catch(e=>{t(`skill-learning: recordToolStart error`),i(e)})}catch(e){t(`skill-learning: hook setup error`),i(e)}try{let n=await a();return o&&_(o,e,n,`success`).catch(e=>{t(`skill-learning: recordToolComplete error`),i(e)}),n}catch(n){throw o&&v(o,e,n).catch(e=>{t(`skill-learning: recordToolError error`),i(e)}),n}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E,D=e((()=>{a(),n(),r(),x=500,S=250,C=50,w=25,T=new Map}));export{v as a,d as c,_ as i,m as l,D as n,g as o,c as r,y as s,u as t,h as u};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n}from"./debug-UI3T040K.js";import{o as r,s as i}from"./log-CzsijfHZ.js";import{i as a,t as o}from"./observationStore-tvkldXUo.js";import{randomUUID as s}from"node:crypto";function c(){for(let[e,t]of T)if(t.size>x){let e=t.values(),n=t.size-S;for(let r=0;r<n;r++){let n=e.next();if(n.done)break;t.delete(n.value)}}if(T.size>C){let e=T.size-w,t=0;for(let n of T.keys()){if(t>=e)break;T.delete(n),t++}}}function l(e,t){let n=T.get(e)??new Set;n.add(t),T.delete(e),T.set(e,n),c()}function u(e,t){return T.get(e)?.has(t)??!1}function d(){T.clear()}function f(e){return{id:s(),sessionId:e.sessionId,projectId:e.projectId,projectName:e.projectName,cwd:e.cwd,timestamp:new Date().toISOString(),source:`tool-hook`,turn:e.turn}}function p(){return E||(E=Promise.all([import(`./projectContext-0fpRKUeH.js`),import(`./featureCheck-p7OeCYzj.js`),import(`./runtimeObserver-DBdzsp_h.js`)]).then(([e,t,n])=>({resolveProjectContext:e.resolveProjectContext,isSkillLearningEnabled:t.isSkillLearningEnabled,RUNTIME_SESSION_ID:n.RUNTIME_SESSION_ID,getRuntimeTurn:n.getRuntimeTurn}))),E}function m(){E=void 0}async function h(e,n,r,a){let o;try{let{resolveProjectContext:s,isSkillLearningEnabled:c,RUNTIME_SESSION_ID:l,getRuntimeTurn:u}=await p();if(!c())return a();let d=s(process.cwd());o={sessionId:r.sessionId??l,turn:r.turn??u(),projectId:d.projectId,projectName:d.projectName,cwd:d.cwd,project:d},g(o,e,n).catch(e=>{t(`skill-learning: recordToolStart error`),i(e)})}catch(e){t(`skill-learning: hook setup error`),i(e)}try{let n=await a();return o&&_(o,e,n,`success`).catch(e=>{t(`skill-learning: recordToolComplete error`),i(e)}),n}catch(n){throw o&&v(o,e,n).catch(e=>{t(`skill-learning: recordToolError error`),i(e)}),n}}async function g(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_start`,toolName:t,toolInput:b(n)},{project:e.project})}async function _(e,t,n,r=`success`){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:r},{project:e.project})}async function v(e,t,n){return l(e.sessionId,e.turn),o({...f(e),event:`tool_complete`,toolName:t,toolOutput:b(n),outcome:`failure`},{project:e.project})}async function y(e,t){return l(e.sessionId,e.turn),o({...f(e),event:`user_message`,messageText:t},{project:e.project})}function b(e){if(e!=null){if(typeof e==`string`)return e;try{return JSON.stringify(e)}catch{return String(e)}}}var x,S,C,w,T,E,D=e((()=>{a(),n(),r(),x=500,S=250,C=50,w=25,T=new Map}));export{v as a,d as c,_ as i,m as l,D as n,g as o,c as r,y as s,u as t,h as u};
@@ -1 +1 @@
1
- import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./toolEventObserver-C-BImvCz.js";i();export{c as hasToolHookObservationsForTurn,o as pruneEmittedTurns,n as recordToolComplete,e as recordToolError,a as recordToolStart,s as recordUserCorrection,t as resetToolHookBookkeeping,r as resetToolHookDepsCache,l as runToolCallWithSkillLearningHooks};
1
+ import{a as e,c as t,i as n,l as r,n as i,o as a,r as o,s,t as c,u as l}from"./toolEventObserver-CcLqNRcT.js";i();export{c as hasToolHookObservationsForTurn,o as pruneEmittedTurns,n as recordToolComplete,e as recordToolError,a as recordToolStart,s as recordUserCorrection,t as resetToolHookBookkeeping,r as resetToolHookDepsCache,l as runToolCallWithSkillLearningHooks};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./toolPool-CRq0GSrk.js";e();export{t as applyCoordinatorToolFilter};
@@ -1 +1 @@
1
- import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Dl as n,Ol as r,bl as i,yl as a}from"./paths-q1-Ni8Oh.js";import{mE as o,nw as s,pE as c,rw as l}from"./loadAgentsDir-Cl2w3uvH.js";import{s as u,u as d}from"./prompt-BmOnuQfF.js";function f(e){return h.some(t=>e.endsWith(t))}function p(e){return e.filter(e=>u.has(e.name)||f(e.name))}function m(e,t,n){let[a,o]=r(i([...e,...t],`name`),l),s=(e,t)=>e.name.localeCompare(t.name),c=[...o.sort(s),...a.sort(s)];return g&&g.isCoordinatorMode()?p(c):c}var h,g,_=t((()=>{n(),a(),d(),s(),h=[`subscribe_pr_activity`,`unsubscribe_pr_activity`],g=(o(),e(c))}));export{m as i,_ as n,f as r,p as t};
1
+ import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{Dl as n,Ol as r,bl as i,yl as a}from"./paths-D8Fx3kUi.js";import{mE as o,nw as s,pE as c,rw as l}from"./loadAgentsDir-HZ19tmOZ.js";import{s as u,u as d}from"./prompt-BxoRdmaw.js";function f(e){return h.some(t=>e.endsWith(t))}function p(e){return e.filter(e=>u.has(e.name)||f(e.name))}function m(e,t,n){let[a,o]=r(i([...e,...t],`name`),l),s=(e,t)=>e.name.localeCompare(t.name),c=[...o.sort(s),...a.sort(s)];return g&&g.isCoordinatorMode()?p(c):c}var h,g,_=t((()=>{n(),a(),d(),s(),h=[`subscribe_pr_activity`,`unsubscribe_pr_activity`],g=(o(),e(c))}));export{m as i,_ as n,f as r,p as t};
@@ -1 +1 @@
1
- import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,t as a}from"./axios-DhfaybwJ.js";import{Bn as o,Mt as s,S as c,Vn as l,_ as u,l as d,on as f}from"./paths-q1-Ni8Oh.js";import{E as p,L as m,V as h,d as g,s as _,w as v}from"./debug-UI3T040K.js";import{l as y,u as b}from"./oauth-CdZEzMww.js";import{d as x,f as S}from"./log-CzsijfHZ.js";import{hostname as C}from"os";function w(){return u(k,!1)}function T(){if(w())return A()}function E(){A.cache?.clear?.()}function D(){if(!w())return;let e=o();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}A.cache?.clear?.()}async function O(){try{if(!await d(k)){g(`[trusted-device] Gate ${k} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){g(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(f(),e(s)),n=t()?.accessToken;if(!n){g(`[trusted-device] No OAuth token, skipping enrollment`);return}let r=o();if(S()){g(`[trusted-device] Essential traffic only, skipping enrollment`);return}let a=y().BASE_API_URL,c;try{c=await i.post(`${a}/api/auth/trusted_devices`,{display_name:`Claude Code on ${C()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){g(`[trusted-device] Enrollment request failed: ${m(e)}`);return}if(c.status!==200&&c.status!==201){g(`[trusted-device] Enrollment failed ${c.status}: ${p(c.data).slice(0,200)}`);return}let l=c.data?.device_token;if(!l||typeof l!=`string`){g(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=r.read();if(!e){g(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=l;let t=r.update(e);if(!t.success){g(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}A.cache?.clear?.(),g(`[trusted-device] Enrolled device_id=${c.data.device_id??`unknown`}`)}catch(e){g(`[trusted-device] Storage write failed: ${m(e)}`)}}catch(e){g(`[trusted-device] Enrollment error: ${m(e)}`)}}var k,A,j=t((()=>{a(),r(),b(),c(),_(),h(),x(),l(),v(),k=`tengu_sessions_elevated_auth_enforcement`,A=n(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||o().read()?.trustedDeviceToken)}));export{j as a,T as i,E as n,O as r,D as t};
1
+ import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,t as a}from"./axios-DhfaybwJ.js";import{Bn as o,Mt as s,S as c,Vn as l,_ as u,l as d,on as f}from"./paths-D8Fx3kUi.js";import{E as p,L as m,V as h,d as g,s as _,w as v}from"./debug-UI3T040K.js";import{l as y,u as b}from"./oauth-CdZEzMww.js";import{d as x,f as S}from"./log-CzsijfHZ.js";import{hostname as C}from"os";function w(){return u(k,!1)}function T(){if(w())return A()}function E(){A.cache?.clear?.()}function D(){if(!w())return;let e=o();try{let t=e.read();t?.trustedDeviceToken&&(delete t.trustedDeviceToken,e.update(t))}catch{}A.cache?.clear?.()}async function O(){try{if(!await d(k)){g(`[trusted-device] Gate ${k} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){g(`[trusted-device] CLAUDE_TRUSTED_DEVICE_TOKEN env var is set, skipping enrollment (env var takes precedence)`);return}let{getClaudeAIOAuthTokens:t}=(f(),e(s)),n=t()?.accessToken;if(!n){g(`[trusted-device] No OAuth token, skipping enrollment`);return}let r=o();if(S()){g(`[trusted-device] Essential traffic only, skipping enrollment`);return}let a=y().BASE_API_URL,c;try{c=await i.post(`${a}/api/auth/trusted_devices`,{display_name:`Claude Code on ${C()} · ${process.platform}`},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`},timeout:1e4,validateStatus:e=>e<500})}catch(e){g(`[trusted-device] Enrollment request failed: ${m(e)}`);return}if(c.status!==200&&c.status!==201){g(`[trusted-device] Enrollment failed ${c.status}: ${p(c.data).slice(0,200)}`);return}let l=c.data?.device_token;if(!l||typeof l!=`string`){g(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=r.read();if(!e){g(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=l;let t=r.update(e);if(!t.success){g(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}A.cache?.clear?.(),g(`[trusted-device] Enrolled device_id=${c.data.device_id??`unknown`}`)}catch(e){g(`[trusted-device] Storage write failed: ${m(e)}`)}}catch(e){g(`[trusted-device] Enrollment error: ${m(e)}`)}}var k,A,j=t((()=>{a(),r(),b(),c(),_(),h(),x(),l(),v(),k=`tengu_sessions_elevated_auth_enforcement`,A=n(()=>process.env.CLAUDE_TRUSTED_DEVICE_TOKEN||o().read()?.trustedDeviceToken)}));export{j as a,T as i,E as n,O as r,D as t};
@@ -1 +1 @@
1
- import{a as e,r as t,t as n}from"./trustedDevice-CXsk3eij.js";e();export{n as clearTrustedDeviceToken,t as enrollTrustedDevice};
1
+ import{a as e,r as t,t as n}from"./trustedDevice-C4tvgByY.js";e();export{n as clearTrustedDeviceToken,t as enrollTrustedDevice};
@@ -1,3 +1,3 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{S as u,_ as d,dn as f,mn as p,on as m,xn as h}from"./paths-q1-Ni8Oh.js";import{d as g,s as _}from"./debug-UI3T040K.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{_ as b,a as x,v as S}from"./git-CN3qtTb_.js";import{l as ee,u as te}from"./oauth-CdZEzMww.js";import{r as ne,t as C}from"./execFileNoThrow-CuQN1sz8.js";import{$_ as w,Nx as T,Px as E,Q_ as D,av as O,ev as k,lv as A,mv as j,tv as M}from"./loadAgentsDir-Cl2w3uvH.js";import{a as N,r as P}from"./detectRepository-CBk3S2zv.js";import{a as F,l as I,o as L}from"./api-DLLVkmRJ.js";import{n as R,t as z}from"./usage-DhJDFJVx.js";async function B(){if(!f())return null;try{let{accessToken:e,orgUUID:t}=await I();return(await n.get(`${ee().BASE_API_URL}/v1/ultrareview/quota`,{headers:{...F(e),"x-organization-uuid":t},timeout:5e3})).data}catch(e){return g(`fetchUltrareviewQuota failed: ${e}`),null}}var V=e((()=>{r(),te(),m(),_(),L()}));function H(){G=!0}async function U(){if(h()||p())return{kind:`proceed`,billingNote:``};let[e,t]=await Promise.all([B(),z().catch(()=>null)]);if(!e)return{kind:`proceed`,billingNote:``};if(e.reviews_remaining>0)return{kind:`proceed`,billingNote:` This is free ultrareview ${e.reviews_used+1} of ${e.reviews_limit}.`};if(!t)return{kind:`proceed`,billingNote:``};let n=t.extra_usage;if(!n?.is_enabled)return y(`tengu_review_overage_not_enabled`,{}),{kind:`not-enabled`};let r=n.monthly_limit,i=n.used_credits??0,a=r==null?1/0:r-i;return a<10?(y(`tengu_review_overage_low_balance`,{available:a}),{kind:`low-balance`,available:a}):G?{kind:`proceed`,billingNote:` This review bills as Extra Usage.`}:(y(`tengu_review_overage_dialog_shown`,{}),{kind:`needs-confirm`})}async function W(e,t,n){let r=await D();if(!r.eligible){let e=r.errors.filter(e=>e.type!==`no_remote_environment`);if(e.length>0)return y(`tengu_review_remote_precondition_failed`,{precondition_errors:e.map(e=>e.type).join(`,`)}),[{type:`text`,text:`Ultrareview cannot launch:\n${e.map(w).join(`
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Rn as i,b as a,f as o,t as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{S as u,_ as d,dn as f,mn as p,on as m,xn as h}from"./paths-D8Fx3kUi.js";import{d as g,s as _}from"./debug-UI3T040K.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{_ as b,a as x,v as S}from"./git-CN3qtTb_.js";import{l as ee,u as te}from"./oauth-CdZEzMww.js";import{r as ne,t as C}from"./execFileNoThrow-CuQN1sz8.js";import{$_ as w,Nx as T,Px as E,Q_ as D,av as O,ev as k,lv as A,mv as j,tv as M}from"./loadAgentsDir-HZ19tmOZ.js";import{a as N,r as P}from"./detectRepository-CBk3S2zv.js";import{a as F,l as I,o as L}from"./api-CClu711S.js";import{n as R,t as z}from"./usage-Bw-kTwHb.js";async function B(){if(!f())return null;try{let{accessToken:e,orgUUID:t}=await I();return(await n.get(`${ee().BASE_API_URL}/v1/ultrareview/quota`,{headers:{...F(e),"x-organization-uuid":t},timeout:5e3})).data}catch(e){return g(`fetchUltrareviewQuota failed: ${e}`),null}}var V=e((()=>{r(),te(),m(),_(),L()}));function H(){G=!0}async function U(){if(h()||p())return{kind:`proceed`,billingNote:``};let[e,t]=await Promise.all([B(),z().catch(()=>null)]);if(!e)return{kind:`proceed`,billingNote:``};if(e.reviews_remaining>0)return{kind:`proceed`,billingNote:` This is free ultrareview ${e.reviews_used+1} of ${e.reviews_limit}.`};if(!t)return{kind:`proceed`,billingNote:``};let n=t.extra_usage;if(!n?.is_enabled)return y(`tengu_review_overage_not_enabled`,{}),{kind:`not-enabled`};let r=n.monthly_limit,i=n.used_credits??0,a=r==null?1/0:r-i;return a<10?(y(`tengu_review_overage_low_balance`,{available:a}),{kind:`low-balance`,available:a}):G?{kind:`proceed`,billingNote:` This review bills as Extra Usage.`}:(y(`tengu_review_overage_dialog_shown`,{}),{kind:`needs-confirm`})}async function W(e,t,n){let r=await D();if(!r.eligible){let e=r.errors.filter(e=>e.type!==`no_remote_environment`);if(e.length>0)return y(`tengu_review_remote_precondition_failed`,{precondition_errors:e.map(e=>e.type).join(`,`)}),[{type:`text`,text:`Ultrareview cannot launch:\n${e.map(w).join(`
2
2
  `)}`}]}let i=n??``,a=e.trim(),o=/^\d+$/.test(a),s=`env_011111111111111111111113`,c=d(`tengu_review_bughunter_config`,null),l=(e,t,n)=>{if(typeof e!=`number`||!Number.isFinite(e))return t;let r=Math.floor(e);return r<=0||n!==void 0&&r>n?t:r},u={BUGHUNTER_DRY_RUN:`1`,BUGHUNTER_FLEET_SIZE:String(l(c?.fleet_size,5,20)),BUGHUNTER_MAX_DURATION:String(l(c?.max_duration_minutes,10,25)),BUGHUNTER_AGENT_TIMEOUT:String(l(c?.agent_timeout_seconds,600,1800)),BUGHUNTER_TOTAL_WALLCLOCK:String(l(c?.total_wallclock_minutes,22,27)),...process.env.BUGHUNTER_DEV_BUNDLE_B64&&{BUGHUNTER_DEV_BUNDLE_B64:process.env.BUGHUNTER_DEV_BUNDLE_B64}},f,p,m;if(o){let e=await P();if(!e||e.host!==`github.com`)return y(`tengu_review_remote_precondition_failed`,{}),null;f=await j({initialMessage:null,description:`ultrareview: ${e.owner}/${e.name}#${a}`,signal:t.abortController.signal,branchName:`refs/pull/${a}/head`,environmentId:s,environmentVariables:{BUGHUNTER_PR_NUMBER:a,BUGHUNTER_REPOSITORY:`${e.owner}/${e.name}`,...u}}),p=`/ultrareview ${a}`,m=`${e.owner}/${e.name}#${a}`}else{let e=await x()||`main`,{stdout:n,code:r}=await C(b(),[`merge-base`,e,`HEAD`],{preserveOutputOnError:!1}),i=n.trim();if(r!==0||!i)return y(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`Could not find merge-base with ${e}. Make sure you're in a git repo with a ${e} branch.`}];let{stdout:a,code:o}=await C(b(),[`diff`,`--shortstat`,i],{preserveOutputOnError:!1});if(o===0&&!a.trim())return y(`tengu_review_remote_precondition_failed`,{}),[{type:`text`,text:`No changes against the ${e} fork point. Make some commits or stage files first.`}];if(f=await j({initialMessage:null,description:`ultrareview: ${e}`,signal:t.abortController.signal,useBundle:!0,environmentId:s,environmentVariables:{BUGHUNTER_BASE_BRANCH:i,...u}}),!f)return y(`tengu_review_remote_teleport_failed`,{}),[{type:`text`,text:"Repo is too large. Push a PR and use `/ultrareview <PR#>` instead."}];p=`/ultrareview`,m=e}if(!f)return y(`tengu_review_remote_teleport_failed`,{}),null;O({remoteTaskType:`ultrareview`,session:f,command:p,context:t,isRemoteReview:!0}),y(`tengu_review_remote_launched`,{});let h=k(f.id);return[{type:`text`,text:`Ultrareview launched for ${m} (~10–20 min, runs in the cloud). Track: ${h}${i} Findings arrive via task-notification. Briefly acknowledge the launch to the user without repeating the target or URL — both are already visible in the tool output above.`}]}var G,K=e((()=>{u(),v(),V(),R(),M(),m(),N(),ne(),S(),A(),G=!1}));function q({onProceed:e,onCancel:t}){let[n,r]=(0,J.useState)(!1),i=(0,J.useRef)(new AbortController),s=(0,J.useCallback)(n=>{n===`proceed`?(r(!0),e(i.current.signal).catch(()=>r(!1))):t()},[e,t]),l=(0,J.useCallback)(()=>{i.current.abort(),t()},[t]);return(0,Y.jsx)(o,{title:`Ultrareview billing`,onCancel:l,color:`background`,children:(0,Y.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,Y.jsx)(a,{children:`Your free ultrareviews for this organization are used. Further reviews bill as Extra Usage (pay-per-use).`}),n?(0,Y.jsx)(a,{color:`background`,children:`Launching…`}):(0,Y.jsx)(T,{options:[{label:`Proceed with Extra Usage billing`,value:`proceed`},{label:`Cancel`,value:`cancel`}],onChange:s,onCancel:l})]})})}var J,Y,X=e((()=>{J=t(i(),1),E(),s(),Y=l()}));function re(e){return e.map(e=>e.type===`text`?e.text:``).filter(Boolean).join(`
3
3
  `)}async function Z(e,t,n,r,i){let a=await W(e,t,r);i?.aborted||(a?n(re(a),{shouldQuery:!0}):n(`Ultrareview failed to launch the remote session. Check that this is a GitHub repo and try again.`,{display:`system`}))}var Q,$;e((()=>{K(),X(),Q=l(),$=async(e,t,n)=>{let r=await U();return r.kind===`not-enabled`?(e(`Free ultrareviews used. Enable Extra Usage at https://claude.ai/settings/billing to continue.`,{display:`system`}),null):r.kind===`low-balance`?(e(`Balance too low to launch ultrareview ($${r.available.toFixed(2)} available, $10 minimum). Top up at https://claude.ai/settings/billing`,{display:`system`}),null):r.kind===`needs-confirm`?(0,Q.jsx)(q,{onProceed:async r=>{await Z(n,t,e,` This review bills as Extra Usage.`,r),r.aborted||H()},onCancel:()=>e(`Ultrareview cancelled.`,{display:`system`})}):(await Z(n,t,e,r.billingNote),null)}}))();export{$ as call};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{Ac as r,Sc as i}from"./paths-q1-Ni8Oh.js";import{l as a,s as o}from"./commitAttribution-CUdm_sRl.js";function s(){return process.env.USER_TYPE===`ant`?n(process.env.CLAUDE_CODE_UNDERCOVER)?!0:o()!==`internal`:!1}function c(){return process.env.USER_TYPE===`ant`?`## UNDERCOVER MODE — CRITICAL
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{s as t,u as n}from"./envUtils-BWeoiL4Y.js";import{Ac as r,Sc as i}from"./paths-D8Fx3kUi.js";import{l as a,s as o}from"./commitAttribution-BJvmLsVe.js";function s(){return process.env.USER_TYPE===`ant`?n(process.env.CLAUDE_CODE_UNDERCOVER)?!0:o()!==`internal`:!1}function c(){return process.env.USER_TYPE===`ant`?`## UNDERCOVER MODE — CRITICAL
2
2
 
3
3
  You are operating UNDERCOVER in a PUBLIC/OPEN-SOURCE repository. Your commit
4
4
  messages, PR titles, and PR bodies MUST NOT contain ANY Anthropic-internal
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./undercover-CNlN7Xzl.js";t();export{e as shouldShowUndercoverAutoNotice};
@@ -1,4 +1,4 @@
1
- import{In as e,Ln as t}from"./src-Di342QoJ.js";import{d as n,s as r}from"./debug-UI3T040K.js";import{n as i,o as a}from"./process-DMKLUQIO.js";import{n as o,r as s}from"./execFileNoThrow-CuQN1sz8.js";import{$T as c,ZT as l}from"./loadAgentsDir-Cl2w3uvH.js";import{n as u,t as d}from"./distRoot-CcxmnzqQ.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";t(),r(),u(),s(),c(),i();var _=`claude-code-best`;function v(){try{let e=f(d,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`2.6.9`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await o(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(n(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let t=v();a(`Current version: ${t}\n`);let n=y(`bun`),r=b()&&n?`bun`:`npm`;a(`Package manager: ${r}\n`),a(`Checking for updates...
1
+ import{In as e,Ln as t}from"./src-Di342QoJ.js";import{d as n,s as r}from"./debug-UI3T040K.js";import{n as i,o as a}from"./process-DMKLUQIO.js";import{n as o,r as s}from"./execFileNoThrow-CuQN1sz8.js";import{$T as c,ZT as l}from"./loadAgentsDir-HZ19tmOZ.js";import{n as u,t as d}from"./distRoot-CcxmnzqQ.js";import{join as f}from"node:path";import{execSync as p}from"node:child_process";import{existsSync as m,readFileSync as h}from"node:fs";import{homedir as g}from"node:os";t(),r(),u(),s(),c(),i();var _=`claude-code-best`;function v(){try{let e=f(d,`..`,`package.json`);if(m(e)){let t=JSON.parse(h(e,`utf-8`));if(t.version)return t.version}}catch{}return`2.6.10`}function y(e){try{return p(`which ${e} 2>/dev/null`,{stdio:`pipe`}),!0}catch{return!1}}function b(){return!!(process.execPath.includes(`bun`)||m(f(f(g(),`.bun`,`install`,`global`),`node_modules`,_)))}async function x(){let e=await o(`npm`,[`view`,`${_}@latest`,`version`,`--prefer-online`],{abortSignal:AbortSignal.timeout(1e4),cwd:g()});return e.code===0?e.stdout.trim():(n(`npm view failed: ${e.stderr}`),null)}function S(e,t){let n=e=>e.replace(/^\D/,``).split(`.`).map(Number),r=n(e),i=n(t);for(let e=0;e<3;e++){if((r[e]??0)>(i[e]??0))return!0;if((r[e]??0)<(i[e]??0))return!1}return!0}async function C(){let t=v();a(`Current version: ${t}\n`);let n=y(`bun`),r=b()&&n?`bun`:`npm`;a(`Package manager: ${r}\n`),a(`Checking for updates...
2
2
  `);let i=await x();if(!i){process.stderr.write(e.red(`Failed to check for updates`)+`
3
3
  `),process.stderr.write(`Unable to fetch latest version from npm registry.
4
4
  `),await l(1);return}if(i===t||S(t,i)){a(e.green(`ccb is up to date (${t})`)+`
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{Jt as r,dn as i,on as a,va as o,ya as s}from"./paths-q1-Ni8Oh.js";import{o as c,s as l}from"./log-CzsijfHZ.js";import{n as u,t as d}from"./browser-fLRXxIsQ.js";import{r as f,t as p}from"./login-TVtq34WQ.js";async function m(e,t){try{if(i()){let t=r(),n=!1;if(t?.subscriptionType&&t?.rateLimitTier)n=t.subscriptionType===`max`&&t.rateLimitTier===`default_claude_max_20x`;else if(t?.accessToken){let e=await o(t.accessToken);n=e?.organization?.organization_type===`claude_max`&&e?.organization?.rate_limit_tier===`default_claude_max_20x`}if(n)return setTimeout(e,0,`You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account.`),null}return await u(`https://claude.ai/upgrade/max`),(0,h.jsx)(p,{startingMessage:`Starting new login following /upgrade. Exit with Ctrl-C to use existing account.`,onDone:n=>{t.onChangeAPIKey(),e(n?`Login successful`:`Login interrupted`)}})}catch(t){l(t),setTimeout(e,0,`Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.`)}return null}var h,g=e((()=>{t(),s(),a(),d(),c(),f(),h=n()}));export{g as n,m as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{t as n}from"./jsx-runtime-D-D469L8.js";import{Jt as r,dn as i,on as a,va as o,ya as s}from"./paths-D8Fx3kUi.js";import{o as c,s as l}from"./log-CzsijfHZ.js";import{n as u,t as d}from"./browser-fLRXxIsQ.js";import{r as f,t as p}from"./login-D6ywctRr.js";async function m(e,t){try{if(i()){let t=r(),n=!1;if(t?.subscriptionType&&t?.rateLimitTier)n=t.subscriptionType===`max`&&t.rateLimitTier===`default_claude_max_20x`;else if(t?.accessToken){let e=await o(t.accessToken);n=e?.organization?.organization_type===`claude_max`&&e?.organization?.rate_limit_tier===`default_claude_max_20x`}if(n)return setTimeout(e,0,`You are already on the highest Max subscription plan. For additional usage, run /login to switch to an API usage-billed account.`),null}return await u(`https://claude.ai/upgrade/max`),(0,h.jsx)(p,{startingMessage:`Starting new login following /upgrade. Exit with Ctrl-C to use existing account.`,onDone:n=>{t.onChangeAPIKey(),e(n?`Login successful`:`Login interrupted`)}})}catch(t){l(t),setTimeout(e,0,`Failed to open browser. Please visit https://claude.ai/upgrade/max to upgrade.`)}return null}var h,g=e((()=>{t(),s(),a(),d(),c(),f(),h=n()}));export{g as n,m as t};
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./upgrade-CE25mJEk.js";e();export{t as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Ln as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{E as o,d as s,s as c,w as l}from"./debug-UI3T040K.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{n as f,t as p}from"./lazySchema-2sOku3cX.js";import{a as m,r as h,t as g}from"./bridgeConfig-DXUNQp2l.js";import{basename as _,extname as v}from"path";import{randomUUID as y}from"crypto";import{readFile as b}from"fs/promises";function x(e){return D[v(e).toLowerCase()]??`application/octet-stream`}function S(e){s(`[brief:upload] ${e}`)}function C(){return h()??process.env.ANTHROPIC_BASE_URL??u().BASE_API_URL}async function w(e,n,r){{if(!r.replBridgeEnabled)return;if(n>T){S(`skip ${e}: ${n} bytes exceeds ${T} limit`);return}let i=g();if(!i){S(`skip: no oauth token`);return}let a;try{a=await b(e)}catch(t){S(`read failed for ${e}: ${t}`);return}let s=`${C()}/api/oauth/file_upload`,c=_(e),l=x(c),u=`----FormBoundary${y()}`,d=Buffer.concat([Buffer.from(`--${u}\r\nContent-Disposition: form-data; name="file"; filename="${c}"\r\nContent-Type: ${l}\r\n\r\n`),a,Buffer.from(`\r\n--${u}--\r\n`)]);try{let a=await t.post(s,d,{headers:{Authorization:`Bearer ${i}`,"Content-Type":`multipart/form-data; boundary=${u}`,"Content-Length":d.length.toString()},timeout:E,signal:r.signal,validateStatus:()=>!0});if(a.status!==201){S(`upload failed for ${e}: status=${a.status} body=${o(a.data).slice(0,200)}`);return}let c=O().safeParse(a.data);if(!c.success){S(`unexpected response shape for ${e}: ${c.error.message}`);return}return S(`uploaded ${e} → ${c.data.file_uuid} (${n} bytes)`),c.data.file_uuid}catch(t){S(`upload threw for ${e}: ${t}`);return}}}var T,E,D,O;e((()=>{n(),a(),m(),d(),c(),p(),l(),T=30*1024*1024,E=3e4,D={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`},O=f(()=>i({file_uuid:r()}))}))();export{w as uploadBriefAttachment};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Ln as r,wn as i}from"./schemas-BGAvj1T4.js";import{t as a}from"./v4-f1i_CNUT.js";import{E as o,d as s,s as c,w as l}from"./debug-UI3T040K.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{n as f,t as p}from"./lazySchema-2sOku3cX.js";import{a as m,r as h,t as g}from"./bridgeConfig-GQzZVhuF.js";import{basename as _,extname as v}from"path";import{randomUUID as y}from"crypto";import{readFile as b}from"fs/promises";function x(e){return D[v(e).toLowerCase()]??`application/octet-stream`}function S(e){s(`[brief:upload] ${e}`)}function C(){return h()??process.env.ANTHROPIC_BASE_URL??u().BASE_API_URL}async function w(e,n,r){{if(!r.replBridgeEnabled)return;if(n>T){S(`skip ${e}: ${n} bytes exceeds ${T} limit`);return}let i=g();if(!i){S(`skip: no oauth token`);return}let a;try{a=await b(e)}catch(t){S(`read failed for ${e}: ${t}`);return}let s=`${C()}/api/oauth/file_upload`,c=_(e),l=x(c),u=`----FormBoundary${y()}`,d=Buffer.concat([Buffer.from(`--${u}\r\nContent-Disposition: form-data; name="file"; filename="${c}"\r\nContent-Type: ${l}\r\n\r\n`),a,Buffer.from(`\r\n--${u}--\r\n`)]);try{let a=await t.post(s,d,{headers:{Authorization:`Bearer ${i}`,"Content-Type":`multipart/form-data; boundary=${u}`,"Content-Length":d.length.toString()},timeout:E,signal:r.signal,validateStatus:()=>!0});if(a.status!==201){S(`upload failed for ${e}: status=${a.status} body=${o(a.data).slice(0,200)}`);return}let c=O().safeParse(a.data);if(!c.success){S(`unexpected response shape for ${e}: ${c.error.message}`);return}return S(`uploaded ${e} → ${c.data.file_uuid} (${n} bytes)`),c.data.file_uuid}catch(t){S(`upload threw for ${e}: ${t}`);return}}}var T,E,D,O;e((()=>{n(),a(),m(),d(),c(),p(),l(),T=30*1024*1024,E=3e4,D={".png":`image/png`,".jpg":`image/jpeg`,".jpeg":`image/jpeg`,".gif":`image/gif`,".webp":`image/webp`},O=f(()=>i({file_uuid:r()}))}))();export{w as uploadBriefAttachment};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{At as r,Jt as i,an as a,bt as o,da as s,dn as c,jt as l,on as u,ua as d,wt as f}from"./paths-q1-Ni8Oh.js";import{l as p,u as m}from"./oauth-CdZEzMww.js";async function h(){if(!c()||!a())return{};let e=i();if(e&&s(e.expiresAt))return null;let n=o();if(n.error)throw Error(`Auth error: ${n.error}`);let l={"Content-Type":`application/json`,"User-Agent":r(),...n.headers},u=`${p().BASE_API_URL}/api/oauth/usage`;return(await t.get(u,{headers:l,timeout:5e3})).data}var g=e((()=>{n(),m(),u(),f(),l(),d()}));export{g as n,h as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{At as r,Jt as i,an as a,bt as o,da as s,dn as c,jt as l,on as u,ua as d,wt as f}from"./paths-D8Fx3kUi.js";import{l as p,u as m}from"./oauth-CdZEzMww.js";async function h(){if(!c()||!a())return{};let e=i();if(e&&s(e.expiresAt))return null;let n=o();if(n.error)throw Error(`Auth error: ${n.error}`);let l={"Content-Type":`application/json`,"User-Agent":r(),...n.headers},u=`${p().BASE_API_URL}/api/oauth/usage`;return(await t.get(u,{headers:l,timeout:5e3})).data}var g=e((()=>{n(),m(),u(),f(),l(),d()}));export{g as n,h as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Settings-DBopjMkN.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Usage`})}))();export{a as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Settings-D3Kpcb7q.js";var i,a;e((()=>{n(),i=t(),a=async(e,t)=>(0,i.jsx)(r,{onClose:e,context:t,defaultTab:`Usage`})}))();export{a as call};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{Br as r,Pr as i,S as a,w as o,wr as s}from"./paths-q1-Ni8Oh.js";import{LS as c,RS as l}from"./loadAgentsDir-Cl2w3uvH.js";function u(){let e=l(e=>e.mainLoopModel),t=l(e=>e.mainLoopModelForSession),[,n]=(0,d.useReducer)(e=>e+1,0);return(0,d.useEffect)(()=>o(n),[]),r(t??e??s())}var d,f=e((()=>{d=t(n(),1),a(),c(),i()}));export{u as n,f as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{Br as r,Pr as i,S as a,w as o,wr as s}from"./paths-D8Fx3kUi.js";import{LS as c,RS as l}from"./loadAgentsDir-HZ19tmOZ.js";function u(){let e=l(e=>e.mainLoopModel),t=l(e=>e.mainLoopModelForSession),[,n]=(0,d.useReducer)(e=>e+1,0);return(0,d.useEffect)(()=>o(n),[]),r(t??e??s())}var d,f=e((()=>{d=t(n(),1),a(),c(),i()}));export{u as n,f as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{K as n,V as r,d as i,s as a}from"./debug-UI3T040K.js";import{n as o,r as s}from"./analytics-DqMQntaB.js";import{F as c,P as l}from"./git-CN3qtTb_.js";import{o as u,s as d}from"./log-CzsijfHZ.js";import{b as f,x as p}from"./teammate-DMYOtLTK.js";import{Aw as m,BS as h,Cc as g,FS as _,Fv as v,LS as y,PS as b,Pv as x,RS as S,Sc as C,Tc as w,fs as T,gh as E,kw as D,mh as O,ps as k,vh as A,wc as j,yh as M}from"./loadAgentsDir-Cl2w3uvH.js";import{n as N,r as P}from"./pluginFlagging-Dh6rYOvj.js";import{t as F}from"./pluginBlocklist-BHxIUqu4.js";var I=e(t(),1);b(),o(),O(),y(),p(),a(),l(),r(),u(),j(),g(),x(),A(),D(),P(),T();function L({enabled:e=!0}={}){let t=h(),r=S(e=>e.plugins.needsRefresh),{addNotification:a}=_(),o=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:r}=await k();await F();let o=N();Object.keys(o).length>0&&a({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let s=[],c=[];try{s=await C()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{c=await w()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await v()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let l=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await m(e,r);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),u=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await M(e,r);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);E(),t(t=>{let i=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),a=new Set(r.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...i.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!a.has(t)}),...r];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:s,errors:o}}}),i(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${s.length}, Agents: ${c.length}, Errors: ${r.length}`);let d=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:n.length,inline_count:f(e,e=>e.source.endsWith(`@inline`)),marketplace_count:f(e,e=>!e.source.endsWith(`@inline`)),error_count:r.length,skill_count:s.length,agent_count:c.length,hook_count:d,mcp_count:l,lsp_count:u,ant_enabled_names:process.env.USER_TYPE===`ant`&&e.length>0?e.map(e=>e.name).sort().join(`,`):void 0}}catch(e){let r=n(e);return d(r),i(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),n={type:`generic-error`,source:`plugin-system`,error:r.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,n]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,a]);(0,I.useEffect)(()=>{e&&o().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};s(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),c(`info`,`tengu_plugins_loaded`,r)})},[o,e]),(0,I.useEffect)(()=>{!e||!r||a({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,r,a])}export{L as t};
1
+ import{o as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-Di342QoJ.js";import{K as n,V as r,d as i,s as a}from"./debug-UI3T040K.js";import{n as o,r as s}from"./analytics-DqMQntaB.js";import{F as c,P as l}from"./git-CN3qtTb_.js";import{o as u,s as d}from"./log-CzsijfHZ.js";import{b as f,x as p}from"./teammate-DMYOtLTK.js";import{Aw as m,BS as h,Cc as g,FS as _,Fv as v,LS as y,PS as b,Pv as x,RS as S,Sc as C,Tc as w,fs as T,gh as E,kw as D,mh as O,ps as k,vh as A,wc as j,yh as M}from"./loadAgentsDir-HZ19tmOZ.js";import{n as N,r as P}from"./pluginFlagging-CBbUoCJ9.js";import{t as F}from"./pluginBlocklist-BiRgxFei.js";var I=e(t(),1);b(),o(),O(),y(),p(),a(),l(),r(),u(),j(),g(),x(),A(),D(),P(),T();function L({enabled:e=!0}={}){let t=h(),r=S(e=>e.plugins.needsRefresh),{addNotification:a}=_(),o=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:r}=await k();await F();let o=N();Object.keys(o).length>0&&a({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let s=[],c=[];try{s=await C()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-commands`,error:`Failed to load plugin commands: ${t}`})}try{c=await w()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-agents`,error:`Failed to load plugin agents: ${t}`})}try{await v()}catch(e){let t=e instanceof Error?e.message:String(e);r.push({type:`generic-error`,source:`plugin-hooks`,error:`Failed to load plugin hooks: ${t}`})}let l=(await Promise.all(e.map(async e=>{if(e.mcpServers)return Object.keys(e.mcpServers).length;let t=await m(e,r);return t&&(e.mcpServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0),u=(await Promise.all(e.map(async e=>{if(e.lspServers)return Object.keys(e.lspServers).length;let t=await M(e,r);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);E(),t(t=>{let i=t.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),a=new Set(r.map(e=>e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`)),o=[...i.filter(e=>{let t=e.type===`generic-error`?`generic-error:${e.source}:${e.error}`:`${e.type}:${e.source}`;return!a.has(t)}),...r];return{...t,plugins:{...t.plugins,enabled:e,disabled:n,commands:s,errors:o}}}),i(`Loaded plugins - Enabled: ${e.length}, Disabled: ${n.length}, Commands: ${s.length}, Agents: ${c.length}, Errors: ${r.length}`);let d=e.reduce((e,t)=>t.hooksConfig?e+Object.values(t.hooksConfig).reduce((e,t)=>e+(t?.reduce((e,t)=>e+t.hooks.length,0)??0),0):e,0);return{enabled_count:e.length,disabled_count:n.length,inline_count:f(e,e=>e.source.endsWith(`@inline`)),marketplace_count:f(e,e=>!e.source.endsWith(`@inline`)),error_count:r.length,skill_count:s.length,agent_count:c.length,hook_count:d,mcp_count:l,lsp_count:u,ant_enabled_names:process.env.USER_TYPE===`ant`&&e.length>0?e.map(e=>e.name).sort().join(`,`):void 0}}catch(e){let r=n(e);return d(r),i(`Error loading plugins: ${e}`),t(e=>{let t=e.plugins.errors.filter(e=>e.source===`lsp-manager`||e.source.startsWith(`plugin:`)),n={type:`generic-error`,source:`plugin-system`,error:r.message};return{...e,plugins:{...e.plugins,enabled:[],disabled:[],commands:[],errors:[...t,n]}}}),{enabled_count:0,disabled_count:0,inline_count:0,marketplace_count:0,error_count:1,skill_count:0,agent_count:0,hook_count:0,mcp_count:0,lsp_count:0,load_failed:!0,ant_enabled_names:void 0}}},[t,a]);(0,I.useEffect)(()=>{e&&o().then(e=>{let{ant_enabled_names:t,...n}=e,r={...n,has_custom_plugin_cache_dir:!!process.env.CLAUDE_CODE_PLUGIN_CACHE_DIR};s(`tengu_plugins_loaded`,{...r,...t!==void 0&&{enabled_names:t}}),c(`info`,`tengu_plugins_loaded`,r)})},[o,e]),(0,I.useEffect)(()=>{!e||!r||a({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,r,a])}export{L as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{Uu as r,qu as i}from"./loadAgentsDir-Cl2w3uvH.js";import{i as a,n as o}from"./toolPool-DYvz_Mjt.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{Uu as r,qu as i}from"./loadAgentsDir-HZ19tmOZ.js";import{i as a,n as o}from"./toolPool-CRq0GSrk.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,r(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),i(),o()}));export{s as n,l as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,t as i,xt as a,zt as o}from"./src-Di342QoJ.js";import{Uw as s,cS as c,dS as l,fS as u,iS as d,lS as f,nS as p,pS as m,rS as h,uS as g}from"./loadAgentsDir-Cl2w3uvH.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:i,columns:s,passthroughCtrlKeys:d=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=n(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let a=p.fromText(T,w,D);if(!(n.ctrl&&d.includes(n.key.toLowerCase()))){if(_(n)||g(),v(n)||l(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),i&&i();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=a.deleteWordBefore();c(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=a.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault(),O(a.prevWord().offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault(),O(a.nextWord().offset);return}if(n.key===`left`){n.preventDefault(),O(a.left().offset);return}if(n.key===`right`){n.preventDefault(),O(a.right().offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(a.left().offset);return;case`f`:O(a.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=a.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=a.deleteToLineEnd();c(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=a.deleteToLineStart();c(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=a.deleteWordBefore();c(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=h();if(e.length>0){let t=a.offset,n=a.insert(e);f(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(a.prevWord().offset);return;case`f`:O(a.nextWord().offset);return;case`d`:{let e=a.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=m();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;u(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=a.insert(n.key);E(e.text),O(e.offset)}}};return a((e,t,n)=>{A(new o(n.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),i(),d(),s(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,t as i,xt as a,zt as o}from"./src-Di342QoJ.js";import{Uw as s,cS as c,dS as l,fS as u,iS as d,lS as f,nS as p,pS as m,rS as h,uS as g}from"./loadAgentsDir-HZ19tmOZ.js";function _(e){return!!(e.ctrl&&(e.key===`k`||e.key===`u`||e.key===`w`)||e.meta&&e.key===`backspace`)}function v(e){return(e.ctrl||e.meta)&&e.key===`y`}function y({isActive:e,onExit:t,onCancel:r,onExitUp:i,columns:s,passthroughCtrlKeys:d=[],initialQuery:y=``,backspaceExitsOnEmpty:S=!0}){let{columns:C}=n(),w=s??C,[T,E]=(0,b.useState)(y),[D,O]=(0,b.useState)(y.length),k=(0,b.useCallback)(e=>{E(e),O(e.length)},[]),A=n=>{if(!e)return;let a=p.fromText(T,w,D);if(!(n.ctrl&&d.includes(n.key.toLowerCase()))){if(_(n)||g(),v(n)||l(),n.key===`return`||n.key===`down`){n.preventDefault(),t();return}if(n.key===`up`){n.preventDefault(),i&&i();return}if(n.key===`escape`){n.preventDefault(),r?r():T.length>0?(E(``),O(0)):t();return}if(n.key===`backspace`){if(n.preventDefault(),n.meta){let{cursor:e,killed:t}=a.deleteWordBefore();c(t,`prepend`),E(e.text),O(e.offset);return}if(T.length===0){S&&(r??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}if(n.key===`delete`){n.preventDefault();let e=a.del();E(e.text),O(e.offset);return}if(n.key===`left`&&(n.ctrl||n.meta||n.fn)){n.preventDefault(),O(a.prevWord().offset);return}if(n.key===`right`&&(n.ctrl||n.meta||n.fn)){n.preventDefault(),O(a.nextWord().offset);return}if(n.key===`left`){n.preventDefault(),O(a.left().offset);return}if(n.key===`right`){n.preventDefault(),O(a.right().offset);return}if(n.key===`home`){n.preventDefault(),O(0);return}if(n.key===`end`){n.preventDefault(),O(T.length);return}if(n.ctrl){switch(n.preventDefault(),n.key.toLowerCase()){case`a`:O(0);return;case`e`:O(T.length);return;case`b`:O(a.left().offset);return;case`f`:O(a.right().offset);return;case`d`:{if(T.length===0){(r??t)();return}let e=a.del();E(e.text),O(e.offset);return}case`h`:{if(T.length===0){S&&(r??t)();return}let e=a.backspace();E(e.text),O(e.offset);return}case`k`:{let{cursor:e,killed:t}=a.deleteToLineEnd();c(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=a.deleteToLineStart();c(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=a.deleteWordBefore();c(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=h();if(e.length>0){let t=a.offset,n=a.insert(e);f(t,e.length),E(n.text),O(n.offset)}return}case`g`:case`c`:if(r){r();return}}return}if(n.meta){switch(n.preventDefault(),n.key.toLowerCase()){case`b`:O(a.prevWord().offset);return;case`f`:O(a.nextWord().offset);return;case`d`:{let e=a.deleteWordAfter();E(e.text),O(e.offset);return}case`y`:{let e=m();if(e){let{text:t,start:n,length:r}=e,i=T.slice(0,n),a=T.slice(n+r),o=i+t+a,s=n+t.length;u(t.length),E(o),O(s)}return}}return}if(n.key!==`tab`&&n.key.length>=1&&!x.has(n.key)){n.preventDefault();let e=a.insert(n.key);E(e.text),O(e.offset)}}};return a((e,t,n)=>{A(new o(n.keypress))},{isActive:e}),{query:T,setQuery:k,cursorOffset:D,handleKeyDown:A}}var b,x,S=e((()=>{b=t(r(),1),i(),d(),s(),x=new Set([`pageup`,`pagedown`,`insert`,`wheelup`,`wheeldown`,`mouse`,`f1`,`f2`,`f3`,`f4`,`f5`,`f6`,`f7`,`f8`,`f9`,`f10`,`f11`,`f12`])}));export{y as n,S as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{FS as a,Ib as o,KS as s,Lb as c,PS as l,qS as u}from"./loadAgentsDir-Cl2w3uvH.js";function d(){let{addNotification:e,removeNotification:t}=a(),[n,i]=(0,f.useState)(()=>{let{errors:e}=o();return e});return u((0,f.useCallback)(()=>{let{errors:e}=o();i(e)},[])),(0,f.useEffect)(()=>{r()||(n.length>0?e({key:p,text:`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`,color:`warning`,priority:`high`,timeoutMs:6e4}):t(p))},[n,e,t]),n}var f,p,m=e((()=>{f=t(n()),l(),i(),c(),s(),p=`settings-errors`}));export{d as n,m as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-Di342QoJ.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{FS as a,Ib as o,KS as s,Lb as c,PS as l,qS as u}from"./loadAgentsDir-HZ19tmOZ.js";function d(){let{addNotification:e,removeNotification:t}=a(),[n,i]=(0,f.useState)(()=>{let{errors:e}=o();return e});return u((0,f.useCallback)(()=>{let{errors:e}=o();i(e)},[])),(0,f.useEffect)(()=>{r()||(n.length>0?e({key:p,text:`Found ${n.length} settings ${n.length===1?`issue`:`issues`} · /doctor for details`,color:`warning`,priority:`high`,timeoutMs:6e4}):t(p))},[n,e,t]),n}var f,p,m=e((()=>{f=t(n()),l(),i(),c(),s(),p=`settings-errors`}));export{d as n,m as t};
@@ -1 +1 @@
1
- import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./defineProperty-80gRi2ZW.js";import{Rn as a,Ut as o,t as s}from"./src-Di342QoJ.js";import{cn as c,ut as l}from"./state-sIHsFpDu.js";import{Ka as u,oo as d}from"./paths-q1-Ni8Oh.js";import{K as f,V as p,d as m,s as h}from"./debug-UI3T040K.js";import{n as g,r as _}from"./analytics-DqMQntaB.js";import{i as v,v as y}from"./git-CN3qtTb_.js";import{o as b,s as x}from"./log-CzsijfHZ.js";import{i as ee,s as S}from"./intl-Pse97ORk.js";import{n as te,t as C}from"./sleep-8Eb9j_Ly.js";import{QS as ne,XS as w}from"./loadAgentsDir-Cl2w3uvH.js";import{i as re,n as T,r as E}from"./voiceStreamSTT-CnK9GN6Q.js";import{basename as D}from"path";import{homedir as O}from"node:os";function k(e){return e.replace(/([a-z])([A-Z])/g,`$1 $2`).split(/[-_./\s]+/).map(e=>e.trim()).filter(e=>e.length>2&&e.length<=20)}function A(e){return k(D(e).replace(/\.[^.]+$/,``))}async function j(e){let t=new Set(M);try{let e=l();if(e){let n=D(e);n.length>2&&n.length<=50&&t.add(n)}}catch{}try{let e=await v();if(e)for(let n of k(e))t.add(n)}catch{}if(e)for(let n of e){if(t.size>=N)break;for(let e of A(n))t.add(e)}return[...t].slice(0,N)}var M,N,P=e((()=>{c(),y(),M=[`MCP`,`symlink`,`grep`,`regex`,`localhost`,`codebase`,`TypeScript`,`JSON`,`OAuth`,`webhook`,`gRPC`,`dotfiles`,`subagent`,`worktree`],N=50}));function ie(){return L===null?!0:L}async function ae(e,t){let n;try{n=await import(`doubaoime-asr`)}catch(t){return x(Error(`[doubao-asr] Failed to import doubaoime-asr package: ${String(t)}`)),e.onError(`doubaoime-asr package import failed: ${String(t)}`,{fatal:!0}),null}let{transcribeRealtime:r,ASRConfig:i,ResponseType:a}=n,o=new I,s=!1,c={resolve:null},l={send(e){s||o.push(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},finalize(){return s?Promise.resolve(`ws_already_closed`):(s=!0,o.push(null),m(`[doubao-asr] Finalize — resolving immediately`),Promise.resolve(`post_closestream_endpoint`))},close(){s=!0,o.abort();let t=c.resolve;c.resolve=null,t&&t(`ws_close`),e.onClose()},isConnected(){return!0}},u=new i({credentialPath:`${O()}/.claude/tts/doubao/credentials.json`});try{await u.ensureCredentials()}catch(t){return x(Error(`[doubao-asr] Credential initialization failed: ${String(t)}`)),e.onError(`Doubao ASR 凭证初始化失败: ${String(t)}`,{fatal:!0}),null}return m(`[doubao-asr] Firing onReady immediately`),e.onReady(l),(async()=>{try{let t=r(o,{config:u});for await(let n of t)if(!(s&&n.type!==a.FINAL_RESULT&&n.type!==a.SESSION_FINISHED))switch(n.type){case a.SESSION_STARTED:m(`[doubao-asr] Session started`);break;case a.VAD_START:m(`[doubao-asr] VAD detected speech start`);break;case a.INTERIM_RESULT:n.text&&e.onTranscript(n.text,!1);break;case a.FINAL_RESULT:n.text&&e.onTranscript(n.text,!0);break;case a.ERROR:x(Error(`[doubao-asr] Error: ${n.errorMsg}`)),s||e.onError(n.errorMsg||`Doubao ASR 识别错误`);break;case a.SESSION_FINISHED:m(`[doubao-asr] Session finished`);break;default:break}let n=c.resolve;c.resolve=null,n&&n(`post_closestream_endpoint`)}catch(t){x(Error(`[doubao-asr] Stream error: ${String(t)}`)),s||e.onError(`Doubao ASR 连接错误: ${String(t)}`);let n=c.resolve;c.resolve=null,n&&n(`ws_close`)}})(),l}var F,I,L,R=e((()=>{h(),b(),r(),F=Symbol.asyncIterator,I=class{constructor(){i(this,`chunks`,[]),i(this,`waiting`,null),i(this,`done`,!1)}push(e){if(!this.done){if(e===null){if(this.done=!0,this.waiting){let e=this.waiting;this.waiting=null,e({value:void 0,done:!0})}return}if(this.waiting){let t=this.waiting;this.waiting=null,t({value:e,done:!1})}else this.chunks.push(e)}}abort(){if(this.done=!0,this.chunks.length=0,this.waiting){let e=this.waiting;this.waiting=null,e({value:void 0,done:!0})}}[F](){return{next:async()=>this.chunks.length>0?{value:this.chunks.shift(),done:!1}:this.done?{value:void 0,done:!0}:new Promise(e=>{this.waiting=e})}}},L=null})),z=n({FIRST_PRESS_FALLBACK_MS:()=>Z,computeLevel:()=>H,normalizeLanguageForSTT:()=>V,useVoice:()=>U});function B(){return u().voiceProvider===`doubao`}function V(e){if(!e)return{code:G};let t=e.toLowerCase().trim();if(!t)return{code:G};if(q.has(t))return{code:t};let n=K[t];if(n)return{code:n};let r=t.split(`-`)[0];return r&&q.has(r)?{code:r}:{code:G,fellBackFrom:e}}function H(e){let t=e.length>>1;if(t===0)return 0;let n=0;for(let t=0;t<e.length-1;t+=2){let r=(e[t]|e[t+1]<<8)<<16>>16;n+=r*r}let r=Math.sqrt(n/t),i=Math.min(r/2e3,1);return Math.sqrt(i)}function U({onTranscript:e,onError:t,enabled:n,focusMode:r}){let[i,a]=(0,W.useState)(`idle`),s=(0,W.useRef)(`idle`),c=(0,W.useRef)(null),l=(0,W.useRef)(``),d=(0,W.useRef)(e),p=(0,W.useRef)(t),h=(0,W.useRef)(null),g=(0,W.useRef)(null),v=(0,W.useRef)(!1),y=(0,W.useRef)(null),b=(0,W.useRef)(!1),S=(0,W.useRef)(null),C=(0,W.useRef)(!1),w=(0,W.useRef)(0),E=(0,W.useRef)(0),D=(0,W.useRef)(!1),O=(0,W.useRef)([]),k=(0,W.useRef)(!1),A=(0,W.useRef)(0),M=(0,W.useRef)(0),N=(0,W.useRef)(!1),P=(0,W.useRef)(!1),F=(0,W.useRef)([]),I=o(),L=ne();d.current=e,p.current=t;function R(e){s.current=e,a(e),L(t=>t.voiceState===e?t:{...t,voiceState:e})}let z=(0,W.useCallback)(()=>{E.current++,h.current&&(clearTimeout(h.current),h.current=null),g.current&&(clearTimeout(g.current),g.current=null),y.current&&(clearTimeout(y.current),y.current=null),S.current&&(clearTimeout(S.current),S.current=null),C.current=!1,J?.stopRecording(),c.current&&(c.current.close(),c.current=null),l.current=``,F.current=[],O.current=[],L(e=>e.voiceInterimTranscript===``&&!e.voiceAudioLevels.length?e:{...e,voiceInterimTranscript:``,voiceAudioLevels:[]})},[L]);function U(){m(`[voice] finishRecording: stopping recording, transitioning to processing`),A.current++;let e=b.current;b.current=!1,R(`processing`),J?.stopRecording();let t=Date.now()-w.current,n=N.current,r=D.current,i=M.current,a=P.current,o=E.current,s=()=>E.current!==o;m(`[voice] Recording stopped`),(c.current?c.current.finalize():Promise.resolve(void 0)).then(async o=>{if(s())return;if(o===`no_data_timeout`&&n&&a&&!e&&i===0&&l.current.trim()===``&&!k.current&&O.current.length>0){k.current=!0,m(`[voice] Silent-drop detected (no_data_timeout, ${String(O.current.length)} chunks); replaying on fresh connection`),_(`tengu_voice_silent_drop_replay`,{recordingDurationMs:t,chunkCount:O.current.length}),c.current&&(c.current.close(),c.current=null);let e=O.current;if(await te(250),s())return;let n=V(u().language),r=await j();if(s()||(await new Promise(t=>{T({onTranscript:(e,t)=>{s()||t&&e.trim()&&(l.current&&(l.current+=` `),l.current+=e.trim())},onError:()=>t(),onClose:()=>{},onReady:n=>{if(s()){n.close(),t();return}c.current=n;let r=[],i=0;for(let t of e)i>0&&i+t.length>32e3&&(n.send(Buffer.concat(r)),r=[],i=0),r.push(t),i+=t.length;r.length&&n.send(Buffer.concat(r)),n.finalize().then(()=>{n.close(),t()})}},{language:n.code,keyterms:r}).then(e=>{e||t()},()=>t())}),s()))return}O.current=[];let f=l.current.trim();m(`[voice] Final transcript assembled (${String(f.length)} chars): "${f.slice(0,200)}"`),_(`tengu_voice_recording_completed`,{transcriptChars:f.length+i,recordingDurationMs:t,hadAudioSignal:n,retried:r,silentDropRetried:k.current,wsConnected:a,focusTriggered:e}),c.current&&(c.current.close(),c.current=null),f?(m(`[voice] Injecting transcript (${String(f.length)} chars)`),d.current(f)):i===0&&t>2e3&&(a?n?p.current?.(`No speech detected.`):p.current?.(`No audio detected from microphone. Check that the correct input device is selected and that Claude Code has microphone access.`):p.current?.(`Voice connection failed. Check your network and try again.`)),l.current=``,L(e=>e.voiceInterimTranscript===``?e:{...e,voiceInterimTranscript:``}),R(`idle`)}).catch(e=>{x(f(e)),s()||R(`idle`)})}(0,W.useEffect)(()=>{n&&!J&&import(`./voice-DXiiy8HX.js`).then(e=>{J=e})},[n]);function G(){S.current&&clearTimeout(S.current),S.current=setTimeout((e,t,n,r,i)=>{e.current=null,t.current===`recording`&&n.current&&(m(`[voice] Focus silence timeout — tearing down session`),r.current=!0,i())},Q,S,s,b,C,U)}(0,W.useEffect)(()=>{if(!n||!r||B()){b.current&&s.current===`recording`&&(m(`[voice] Focus mode disabled during recording, finishing`),U());return}let e=!1;if(I&&s.current===`idle`&&!C.current){let t=()=>{e||s.current!==`idle`||C.current||(m(`[voice] Focus gained, starting recording session`),b.current=!0,K(),G())};J?t():import(`./voice-DXiiy8HX.js`).then(e=>{J=e,t()})}else I||(C.current=!1,s.current===`recording`&&(m(`[voice] Focus lost, finishing recording`),U()));return()=>{e=!0}},[n,r,I]);async function K(){if(!J){p.current?.(`Voice module not loaded yet. Try again in a moment.`);return}R(`recording`),w.current=Date.now(),l.current=``,v.current=!1,N.current=!1,D.current=!1,k.current=!1,O.current=[],M.current=0,P.current=!1;let e=++E.current,t=await J.checkRecordingAvailability();if(!t.available){m(`[voice] Recording not available: ${t.reason??`unknown`}`),p.current?.(t.reason??`Audio recording is not available.`),z(),R(`idle`);return}m(`[voice] Starting recording session, connecting voice stream`),L(e=>e.voiceError?{...e,voiceError:null}:e);let n=[];if(m(`[voice] startRecording: buffering audio while WebSocket connects`),F.current=[],!await J.startRecording(e=>{let t=Buffer.from(e);b.current||O.current.push(t),c.current?c.current.send(t):n.push(t);let r=H(e);!N.current&&r>.01&&(N.current=!0);let i=F.current;i.length>=$&&i.shift(),i.push(r);let a=[...i];F.current=a,L(e=>({...e,voiceAudioLevels:a}))},()=>{s.current===`recording`&&U()},{silenceDetection:!1})){x(Error(`[voice] Recording failed — no audio tool found`)),p.current?.(`Failed to start audio capture. Check that your microphone is accessible.`),z(),R(`idle`),L(e=>({...e,voiceError:`Recording failed — no audio tool found`}));return}let r=u().language,i=V(r);_(`tengu_voice_recording_started`,{focusTriggered:b.current,sttLanguage:i.code,sttLanguageIsDefault:!r?.trim(),sttLanguageFellBack:i.fellBackFrom!==void 0,systemLocaleLanguage:ee()});let a=!1,o=()=>E.current!==e,f=e=>{let t=A.current;(B()?(e,t)=>ae(e,t):(e,t)=>T(e,t))({onTranscript:(e,t)=>{if(!o()){if(a=!0,m(`[voice] onTranscript: isFinal=${String(t)} text="${e}"`),t&&e.trim())b.current?(m(`[voice] Focus mode: flushing final transcript immediately: "${e.trim()}"`),d.current(e.trim()),M.current+=e.trim().length,L(e=>e.voiceInterimTranscript===``?e:{...e,voiceInterimTranscript:``}),l.current=``,G()):(l.current&&(l.current+=` `),l.current+=e.trim(),m(`[voice] Accumulated final transcript: "${l.current}"`),L(e=>{let t=l.current;return e.voiceInterimTranscript===t?e:{...e,voiceInterimTranscript:t}}));else if(!t){b.current&&G();let t=e.trim(),n=l.current?l.current+(t?` `+t:``):t;L(e=>e.voiceInterimTranscript===n?e:{...e,voiceInterimTranscript:n})}}},onError:(r,i)=>{if(o()){m(`[voice] ignoring onError from stale session: ${r}`);return}if(A.current!==t){m(`[voice] ignoring stale onError from superseded attempt: ${r}`);return}if(!i?.fatal&&!a&&s.current===`recording`&&!D.current){D.current=!0,m(`[voice] early voice_stream error (pre-transcript), retrying once: ${r}`),_(`tengu_voice_stream_early_retry`,{}),c.current=null,A.current++,setTimeout((e,t,n)=>{e.current===`recording`&&t(n)},250,s,f,e);return}A.current++,x(Error(`[voice] voice_stream error: ${r}`)),p.current?.(`Voice stream error: ${r}`),n.length=0,b.current=!1,z(),R(`idle`)},onClose:()=>{},onReady:e=>{if(o()||s.current!==`recording`){e.close();return}if(c.current=e,P.current=!0,n.length>0){let t=0;for(let e of n)t+=e.length;let r=[[]],i=0;for(let e of n)i>0&&i+e.length>32e3&&(r.push([]),i=0),r[r.length-1].push(e),i+=e.length;m(`[voice] onReady: flushing ${String(n.length)} buffered chunks (${String(t)} bytes) as ${String(r.length)} coalesced frame(s)`);for(let t of r)e.send(Buffer.concat(t))}n.length=0,g.current&&clearTimeout(g.current),v.current&&(g.current=setTimeout((e,t,n)=>{e.current=null,t.current===`recording`&&n()},Y,g,s,U))}},{language:i.code,keyterms:e}).then(e=>{if(o()){e?.close();return}if(!e){m(`[voice] Failed to connect to voice_stream (no OAuth token?)`),p.current?.(`Voice mode requires a Claude.ai account. Please run /login to sign in.`),n.length=0,z(),R(`idle`);return}if(s.current!==`recording`){n.length=0,e.close();return}})};B()?f([]):j().then(f)}let q=(0,W.useCallback)((e=X)=>{let t=B()?ie():re();if(!n||!t||b.current)return;if(r&&C.current){m(`[voice] Re-arming focus recording after silence timeout`),C.current=!1,b.current=!0,K(),G();return}let i=s.current;i!==`processing`&&(i===`idle`?(m(`[voice] handleKeyEvent: idle, starting recording session immediately`),K(),y.current=setTimeout((e,t,n,r,i)=>{e.current=null,t.current===`recording`&&!n.current&&(m(`[voice] No auto-repeat seen, arming release timer via fallback`),n.current=!0,r.current=setTimeout((e,t,n)=>{e.current=null,t.current===`recording`&&n()},Y,r,t,i))},e,y,s,v,g,U)):i===`recording`&&(v.current=!0,y.current&&(clearTimeout(y.current),y.current=null)),g.current&&clearTimeout(g.current),s.current===`recording`&&v.current&&(g.current=setTimeout((e,t,n)=>{e.current=null,t.current===`recording`&&n()},Y,g,s,U)))},[n,r,z]);return(0,W.useEffect)(()=>(!n&&s.current!==`idle`&&(z(),R(`idle`)),()=>{z()}),[n,z]),{state:i,handleKeyEvent:q}}var W,G,K,q,J,Y,X,Z,Q,$,oe=e((()=>{W=t(a(),1),w(),s(),g(),P(),E(),R(),h(),p(),S(),b(),d(),C(),G=`en`,K={english:`en`,spanish:`es`,español:`es`,espanol:`es`,french:`fr`,français:`fr`,francais:`fr`,japanese:`ja`,日本語:`ja`,german:`de`,deutsch:`de`,portuguese:`pt`,português:`pt`,portugues:`pt`,italian:`it`,italiano:`it`,korean:`ko`,한국어:`ko`,hindi:`hi`,हिन्दी:`hi`,हिंदी:`hi`,indonesian:`id`,"bahasa indonesia":`id`,bahasa:`id`,russian:`ru`,русский:`ru`,polish:`pl`,polski:`pl`,turkish:`tr`,türkçe:`tr`,turkce:`tr`,dutch:`nl`,nederlands:`nl`,ukrainian:`uk`,українська:`uk`,greek:`el`,ελληνικά:`el`,czech:`cs`,čeština:`cs`,cestina:`cs`,danish:`da`,dansk:`da`,swedish:`sv`,svenska:`sv`,norwegian:`no`,norsk:`no`},q=new Set([`en`,`es`,`fr`,`ja`,`de`,`pt`,`it`,`ko`,`hi`,`id`,`ru`,`pl`,`tr`,`nl`,`uk`,`el`,`cs`,`da`,`sv`,`no`]),J=null,Y=200,X=600,Z=2e3,Q=5e3,$=16}));export{V as n,z as r,oe as t};
1
+ import{n as e,o as t,r as n}from"./chunk-DR8-3Aex.js";import{n as r,t as i}from"./defineProperty-80gRi2ZW.js";import{Rn as a,Ut as o,t as s}from"./src-Di342QoJ.js";import{cn as c,ut as l}from"./state-sIHsFpDu.js";import{Ka as u,oo as d}from"./paths-D8Fx3kUi.js";import{K as f,V as p,d as m,s as h}from"./debug-UI3T040K.js";import{n as g,r as _}from"./analytics-DqMQntaB.js";import{i as v,v as y}from"./git-CN3qtTb_.js";import{o as b,s as x}from"./log-CzsijfHZ.js";import{i as ee,s as S}from"./intl-Pse97ORk.js";import{n as te,t as C}from"./sleep-8Eb9j_Ly.js";import{QS as ne,XS as w}from"./loadAgentsDir-HZ19tmOZ.js";import{i as re,n as T,r as E}from"./voiceStreamSTT-CWhKAxcp.js";import{basename as D}from"path";import{homedir as O}from"node:os";function k(e){return e.replace(/([a-z])([A-Z])/g,`$1 $2`).split(/[-_./\s]+/).map(e=>e.trim()).filter(e=>e.length>2&&e.length<=20)}function A(e){return k(D(e).replace(/\.[^.]+$/,``))}async function j(e){let t=new Set(M);try{let e=l();if(e){let n=D(e);n.length>2&&n.length<=50&&t.add(n)}}catch{}try{let e=await v();if(e)for(let n of k(e))t.add(n)}catch{}if(e)for(let n of e){if(t.size>=N)break;for(let e of A(n))t.add(e)}return[...t].slice(0,N)}var M,N,P=e((()=>{c(),y(),M=[`MCP`,`symlink`,`grep`,`regex`,`localhost`,`codebase`,`TypeScript`,`JSON`,`OAuth`,`webhook`,`gRPC`,`dotfiles`,`subagent`,`worktree`],N=50}));function ie(){return L===null?!0:L}async function ae(e,t){let n;try{n=await import(`doubaoime-asr`)}catch(t){return x(Error(`[doubao-asr] Failed to import doubaoime-asr package: ${String(t)}`)),e.onError(`doubaoime-asr package import failed: ${String(t)}`,{fatal:!0}),null}let{transcribeRealtime:r,ASRConfig:i,ResponseType:a}=n,o=new I,s=!1,c={resolve:null},l={send(e){s||o.push(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))},finalize(){return s?Promise.resolve(`ws_already_closed`):(s=!0,o.push(null),m(`[doubao-asr] Finalize — resolving immediately`),Promise.resolve(`post_closestream_endpoint`))},close(){s=!0,o.abort();let t=c.resolve;c.resolve=null,t&&t(`ws_close`),e.onClose()},isConnected(){return!0}},u=new i({credentialPath:`${O()}/.claude/tts/doubao/credentials.json`});try{await u.ensureCredentials()}catch(t){return x(Error(`[doubao-asr] Credential initialization failed: ${String(t)}`)),e.onError(`Doubao ASR 凭证初始化失败: ${String(t)}`,{fatal:!0}),null}return m(`[doubao-asr] Firing onReady immediately`),e.onReady(l),(async()=>{try{let t=r(o,{config:u});for await(let n of t)if(!(s&&n.type!==a.FINAL_RESULT&&n.type!==a.SESSION_FINISHED))switch(n.type){case a.SESSION_STARTED:m(`[doubao-asr] Session started`);break;case a.VAD_START:m(`[doubao-asr] VAD detected speech start`);break;case a.INTERIM_RESULT:n.text&&e.onTranscript(n.text,!1);break;case a.FINAL_RESULT:n.text&&e.onTranscript(n.text,!0);break;case a.ERROR:x(Error(`[doubao-asr] Error: ${n.errorMsg}`)),s||e.onError(n.errorMsg||`Doubao ASR 识别错误`);break;case a.SESSION_FINISHED:m(`[doubao-asr] Session finished`);break;default:break}let n=c.resolve;c.resolve=null,n&&n(`post_closestream_endpoint`)}catch(t){x(Error(`[doubao-asr] Stream error: ${String(t)}`)),s||e.onError(`Doubao ASR 连接错误: ${String(t)}`);let n=c.resolve;c.resolve=null,n&&n(`ws_close`)}})(),l}var F,I,L,R=e((()=>{h(),b(),r(),F=Symbol.asyncIterator,I=class{constructor(){i(this,`chunks`,[]),i(this,`waiting`,null),i(this,`done`,!1)}push(e){if(!this.done){if(e===null){if(this.done=!0,this.waiting){let e=this.waiting;this.waiting=null,e({value:void 0,done:!0})}return}if(this.waiting){let t=this.waiting;this.waiting=null,t({value:e,done:!1})}else this.chunks.push(e)}}abort(){if(this.done=!0,this.chunks.length=0,this.waiting){let e=this.waiting;this.waiting=null,e({value:void 0,done:!0})}}[F](){return{next:async()=>this.chunks.length>0?{value:this.chunks.shift(),done:!1}:this.done?{value:void 0,done:!0}:new Promise(e=>{this.waiting=e})}}},L=null})),z=n({FIRST_PRESS_FALLBACK_MS:()=>Z,computeLevel:()=>H,normalizeLanguageForSTT:()=>V,useVoice:()=>U});function B(){return u().voiceProvider===`doubao`}function V(e){if(!e)return{code:G};let t=e.toLowerCase().trim();if(!t)return{code:G};if(q.has(t))return{code:t};let n=K[t];if(n)return{code:n};let r=t.split(`-`)[0];return r&&q.has(r)?{code:r}:{code:G,fellBackFrom:e}}function H(e){let t=e.length>>1;if(t===0)return 0;let n=0;for(let t=0;t<e.length-1;t+=2){let r=(e[t]|e[t+1]<<8)<<16>>16;n+=r*r}let r=Math.sqrt(n/t),i=Math.min(r/2e3,1);return Math.sqrt(i)}function U({onTranscript:e,onError:t,enabled:n,focusMode:r}){let[i,a]=(0,W.useState)(`idle`),s=(0,W.useRef)(`idle`),c=(0,W.useRef)(null),l=(0,W.useRef)(``),d=(0,W.useRef)(e),p=(0,W.useRef)(t),h=(0,W.useRef)(null),g=(0,W.useRef)(null),v=(0,W.useRef)(!1),y=(0,W.useRef)(null),b=(0,W.useRef)(!1),S=(0,W.useRef)(null),C=(0,W.useRef)(!1),w=(0,W.useRef)(0),E=(0,W.useRef)(0),D=(0,W.useRef)(!1),O=(0,W.useRef)([]),k=(0,W.useRef)(!1),A=(0,W.useRef)(0),M=(0,W.useRef)(0),N=(0,W.useRef)(!1),P=(0,W.useRef)(!1),F=(0,W.useRef)([]),I=o(),L=ne();d.current=e,p.current=t;function R(e){s.current=e,a(e),L(t=>t.voiceState===e?t:{...t,voiceState:e})}let z=(0,W.useCallback)(()=>{E.current++,h.current&&(clearTimeout(h.current),h.current=null),g.current&&(clearTimeout(g.current),g.current=null),y.current&&(clearTimeout(y.current),y.current=null),S.current&&(clearTimeout(S.current),S.current=null),C.current=!1,J?.stopRecording(),c.current&&(c.current.close(),c.current=null),l.current=``,F.current=[],O.current=[],L(e=>e.voiceInterimTranscript===``&&!e.voiceAudioLevels.length?e:{...e,voiceInterimTranscript:``,voiceAudioLevels:[]})},[L]);function U(){m(`[voice] finishRecording: stopping recording, transitioning to processing`),A.current++;let e=b.current;b.current=!1,R(`processing`),J?.stopRecording();let t=Date.now()-w.current,n=N.current,r=D.current,i=M.current,a=P.current,o=E.current,s=()=>E.current!==o;m(`[voice] Recording stopped`),(c.current?c.current.finalize():Promise.resolve(void 0)).then(async o=>{if(s())return;if(o===`no_data_timeout`&&n&&a&&!e&&i===0&&l.current.trim()===``&&!k.current&&O.current.length>0){k.current=!0,m(`[voice] Silent-drop detected (no_data_timeout, ${String(O.current.length)} chunks); replaying on fresh connection`),_(`tengu_voice_silent_drop_replay`,{recordingDurationMs:t,chunkCount:O.current.length}),c.current&&(c.current.close(),c.current=null);let e=O.current;if(await te(250),s())return;let n=V(u().language),r=await j();if(s()||(await new Promise(t=>{T({onTranscript:(e,t)=>{s()||t&&e.trim()&&(l.current&&(l.current+=` `),l.current+=e.trim())},onError:()=>t(),onClose:()=>{},onReady:n=>{if(s()){n.close(),t();return}c.current=n;let r=[],i=0;for(let t of e)i>0&&i+t.length>32e3&&(n.send(Buffer.concat(r)),r=[],i=0),r.push(t),i+=t.length;r.length&&n.send(Buffer.concat(r)),n.finalize().then(()=>{n.close(),t()})}},{language:n.code,keyterms:r}).then(e=>{e||t()},()=>t())}),s()))return}O.current=[];let f=l.current.trim();m(`[voice] Final transcript assembled (${String(f.length)} chars): "${f.slice(0,200)}"`),_(`tengu_voice_recording_completed`,{transcriptChars:f.length+i,recordingDurationMs:t,hadAudioSignal:n,retried:r,silentDropRetried:k.current,wsConnected:a,focusTriggered:e}),c.current&&(c.current.close(),c.current=null),f?(m(`[voice] Injecting transcript (${String(f.length)} chars)`),d.current(f)):i===0&&t>2e3&&(a?n?p.current?.(`No speech detected.`):p.current?.(`No audio detected from microphone. Check that the correct input device is selected and that Claude Code has microphone access.`):p.current?.(`Voice connection failed. Check your network and try again.`)),l.current=``,L(e=>e.voiceInterimTranscript===``?e:{...e,voiceInterimTranscript:``}),R(`idle`)}).catch(e=>{x(f(e)),s()||R(`idle`)})}(0,W.useEffect)(()=>{n&&!J&&import(`./voice-DXiiy8HX.js`).then(e=>{J=e})},[n]);function G(){S.current&&clearTimeout(S.current),S.current=setTimeout((e,t,n,r,i)=>{e.current=null,t.current===`recording`&&n.current&&(m(`[voice] Focus silence timeout — tearing down session`),r.current=!0,i())},Q,S,s,b,C,U)}(0,W.useEffect)(()=>{if(!n||!r||B()){b.current&&s.current===`recording`&&(m(`[voice] Focus mode disabled during recording, finishing`),U());return}let e=!1;if(I&&s.current===`idle`&&!C.current){let t=()=>{e||s.current!==`idle`||C.current||(m(`[voice] Focus gained, starting recording session`),b.current=!0,K(),G())};J?t():import(`./voice-DXiiy8HX.js`).then(e=>{J=e,t()})}else I||(C.current=!1,s.current===`recording`&&(m(`[voice] Focus lost, finishing recording`),U()));return()=>{e=!0}},[n,r,I]);async function K(){if(!J){p.current?.(`Voice module not loaded yet. Try again in a moment.`);return}R(`recording`),w.current=Date.now(),l.current=``,v.current=!1,N.current=!1,D.current=!1,k.current=!1,O.current=[],M.current=0,P.current=!1;let e=++E.current,t=await J.checkRecordingAvailability();if(!t.available){m(`[voice] Recording not available: ${t.reason??`unknown`}`),p.current?.(t.reason??`Audio recording is not available.`),z(),R(`idle`);return}m(`[voice] Starting recording session, connecting voice stream`),L(e=>e.voiceError?{...e,voiceError:null}:e);let n=[];if(m(`[voice] startRecording: buffering audio while WebSocket connects`),F.current=[],!await J.startRecording(e=>{let t=Buffer.from(e);b.current||O.current.push(t),c.current?c.current.send(t):n.push(t);let r=H(e);!N.current&&r>.01&&(N.current=!0);let i=F.current;i.length>=$&&i.shift(),i.push(r);let a=[...i];F.current=a,L(e=>({...e,voiceAudioLevels:a}))},()=>{s.current===`recording`&&U()},{silenceDetection:!1})){x(Error(`[voice] Recording failed — no audio tool found`)),p.current?.(`Failed to start audio capture. Check that your microphone is accessible.`),z(),R(`idle`),L(e=>({...e,voiceError:`Recording failed — no audio tool found`}));return}let r=u().language,i=V(r);_(`tengu_voice_recording_started`,{focusTriggered:b.current,sttLanguage:i.code,sttLanguageIsDefault:!r?.trim(),sttLanguageFellBack:i.fellBackFrom!==void 0,systemLocaleLanguage:ee()});let a=!1,o=()=>E.current!==e,f=e=>{let t=A.current;(B()?(e,t)=>ae(e,t):(e,t)=>T(e,t))({onTranscript:(e,t)=>{if(!o()){if(a=!0,m(`[voice] onTranscript: isFinal=${String(t)} text="${e}"`),t&&e.trim())b.current?(m(`[voice] Focus mode: flushing final transcript immediately: "${e.trim()}"`),d.current(e.trim()),M.current+=e.trim().length,L(e=>e.voiceInterimTranscript===``?e:{...e,voiceInterimTranscript:``}),l.current=``,G()):(l.current&&(l.current+=` `),l.current+=e.trim(),m(`[voice] Accumulated final transcript: "${l.current}"`),L(e=>{let t=l.current;return e.voiceInterimTranscript===t?e:{...e,voiceInterimTranscript:t}}));else if(!t){b.current&&G();let t=e.trim(),n=l.current?l.current+(t?` `+t:``):t;L(e=>e.voiceInterimTranscript===n?e:{...e,voiceInterimTranscript:n})}}},onError:(r,i)=>{if(o()){m(`[voice] ignoring onError from stale session: ${r}`);return}if(A.current!==t){m(`[voice] ignoring stale onError from superseded attempt: ${r}`);return}if(!i?.fatal&&!a&&s.current===`recording`&&!D.current){D.current=!0,m(`[voice] early voice_stream error (pre-transcript), retrying once: ${r}`),_(`tengu_voice_stream_early_retry`,{}),c.current=null,A.current++,setTimeout((e,t,n)=>{e.current===`recording`&&t(n)},250,s,f,e);return}A.current++,x(Error(`[voice] voice_stream error: ${r}`)),p.current?.(`Voice stream error: ${r}`),n.length=0,b.current=!1,z(),R(`idle`)},onClose:()=>{},onReady:e=>{if(o()||s.current!==`recording`){e.close();return}if(c.current=e,P.current=!0,n.length>0){let t=0;for(let e of n)t+=e.length;let r=[[]],i=0;for(let e of n)i>0&&i+e.length>32e3&&(r.push([]),i=0),r[r.length-1].push(e),i+=e.length;m(`[voice] onReady: flushing ${String(n.length)} buffered chunks (${String(t)} bytes) as ${String(r.length)} coalesced frame(s)`);for(let t of r)e.send(Buffer.concat(t))}n.length=0,g.current&&clearTimeout(g.current),v.current&&(g.current=setTimeout((e,t,n)=>{e.current=null,t.current===`recording`&&n()},Y,g,s,U))}},{language:i.code,keyterms:e}).then(e=>{if(o()){e?.close();return}if(!e){m(`[voice] Failed to connect to voice_stream (no OAuth token?)`),p.current?.(`Voice mode requires a Claude.ai account. Please run /login to sign in.`),n.length=0,z(),R(`idle`);return}if(s.current!==`recording`){n.length=0,e.close();return}})};B()?f([]):j().then(f)}let q=(0,W.useCallback)((e=X)=>{let t=B()?ie():re();if(!n||!t||b.current)return;if(r&&C.current){m(`[voice] Re-arming focus recording after silence timeout`),C.current=!1,b.current=!0,K(),G();return}let i=s.current;i!==`processing`&&(i===`idle`?(m(`[voice] handleKeyEvent: idle, starting recording session immediately`),K(),y.current=setTimeout((e,t,n,r,i)=>{e.current=null,t.current===`recording`&&!n.current&&(m(`[voice] No auto-repeat seen, arming release timer via fallback`),n.current=!0,r.current=setTimeout((e,t,n)=>{e.current=null,t.current===`recording`&&n()},Y,r,t,i))},e,y,s,v,g,U)):i===`recording`&&(v.current=!0,y.current&&(clearTimeout(y.current),y.current=null)),g.current&&clearTimeout(g.current),s.current===`recording`&&v.current&&(g.current=setTimeout((e,t,n)=>{e.current=null,t.current===`recording`&&n()},Y,g,s,U)))},[n,r,z]);return(0,W.useEffect)(()=>(!n&&s.current!==`idle`&&(z(),R(`idle`)),()=>{z()}),[n,z]),{state:i,handleKeyEvent:q}}var W,G,K,q,J,Y,X,Z,Q,$,oe=e((()=>{W=t(a(),1),w(),s(),g(),P(),E(),R(),h(),p(),S(),b(),d(),C(),G=`en`,K={english:`en`,spanish:`es`,español:`es`,espanol:`es`,french:`fr`,français:`fr`,francais:`fr`,japanese:`ja`,日本語:`ja`,german:`de`,deutsch:`de`,portuguese:`pt`,português:`pt`,portugues:`pt`,italian:`it`,italiano:`it`,korean:`ko`,한국어:`ko`,hindi:`hi`,हिन्दी:`hi`,हिंदी:`hi`,indonesian:`id`,"bahasa indonesia":`id`,bahasa:`id`,russian:`ru`,русский:`ru`,polish:`pl`,polski:`pl`,turkish:`tr`,türkçe:`tr`,turkce:`tr`,dutch:`nl`,nederlands:`nl`,ukrainian:`uk`,українська:`uk`,greek:`el`,ελληνικά:`el`,czech:`cs`,čeština:`cs`,cestina:`cs`,danish:`da`,dansk:`da`,swedish:`sv`,svenska:`sv`,norwegian:`no`,norsk:`no`},q=new Set([`en`,`es`,`fr`,`ja`,`de`,`pt`,`it`,`ko`,`hi`,`id`,`ru`,`pl`,`tr`,`nl`,`uk`,`el`,`cs`,`da`,`sv`,`no`]),J=null,Y=200,X=600,Z=2e3,Q=5e3,$=16}));export{V as n,z as r,oe as t};
@@ -1 +1 @@
1
- import{o as e}from"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{cn as o,on as s}from"./paths-q1-Ni8Oh.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{IS as u,LS as d,dy as f,uy as p}from"./loadAgentsDir-Cl2w3uvH.js";import{t as m}from"./WelcomeV2-BBFGft_e.js";import{t as h}from"./useManagePlugins-B1FpmxFo.js";import{n as g,t as _}from"./MCPConnectionManager-kVO-4BcA.js";import{n as v}from"./onChangeAppState-Cn_HSmmQ.js";import{cwd as y}from"process";var b=e(t(),1);r(),f(),c(),g(),d(),s();var x=a();async function S(e){l(`tengu_setup_token_command`,{});let t=!o(),{ConsoleOAuthFlow:r}=await import(`./ConsoleOAuthFlow-FSHC5mxO.js`);await new Promise(a=>{e.render((0,x.jsx)(u,{onChangeAppState:v,children:(0,x.jsx)(p,{children:(0,x.jsxs)(i,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),t&&(0,x.jsxs)(i,{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)(r,{onDone:()=>{a()},mode:`setup-token`,startingMessage:`This will guide you through long-lived (1-year) auth token setup for your Claude account. Claude subscription required.`})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-Dcntgp5Z.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){l(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(u,{children:(0,x.jsx)(p,{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-BpwYOhci.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-BFpg1zm1.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"./chunk-DR8-3Aex.js";import{Rn as t,b as n,t as r,x as i}from"./src-Di342QoJ.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{cn as o,on as s}from"./paths-D8Fx3kUi.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{IS as u,LS as d,dy as f,uy as p}from"./loadAgentsDir-HZ19tmOZ.js";import{t as m}from"./WelcomeV2-BnyziLbm.js";import{t as h}from"./useManagePlugins-hPG7UMWo.js";import{n as g,t as _}from"./MCPConnectionManager-BbGFGZTr.js";import{n as v}from"./onChangeAppState-CHYSALjM.js";import{cwd as y}from"process";var b=e(t(),1);r(),f(),c(),g(),d(),s();var x=a();async function S(e){l(`tengu_setup_token_command`,{});let t=!o(),{ConsoleOAuthFlow:r}=await import(`./ConsoleOAuthFlow-1aq67dJV.js`);await new Promise(a=>{e.render((0,x.jsx)(u,{onChangeAppState:v,children:(0,x.jsx)(p,{children:(0,x.jsxs)(i,{flexDirection:`column`,gap:1,children:[(0,x.jsx)(m,{}),t&&(0,x.jsxs)(i,{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)(r,{onDone:()=>{a()},mode:`setup-token`,startingMessage:`This will guide you through long-lived (1-year) auth token setup for your Claude account. Claude subscription required.`})]})})}))}),e.unmount(),process.exit(0)}var C=b.lazy(()=>import(`./Doctor-DOil8Eh7.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){l(`tengu_doctor_command`,{}),await new Promise(t=>{e.render((0,x.jsx)(u,{children:(0,x.jsx)(p,{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-lxzmZdw5.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-DimDiHha.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{Sp as e,yp as t}from"./loadAgentsDir-HZ19tmOZ.js";e();export{t as clearWebFetchCache};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Tt as r}from"./schemas-BGAvj1T4.js";import{t as i}from"./v4-f1i_CNUT.js";import{bs as a,gs as o,vs as s,xs as c,ys as l}from"./paths-q1-Ni8Oh.js";import{E as u,L as d,R as f,T as p,U as m,V as h,d as g,h as _,p as v,s as y,w as b}from"./debug-UI3T040K.js";import{o as ee,s as x}from"./log-CzsijfHZ.js";import{AA as S,KA as C,OA as w,UA as T,WA as E,aA as D,iA as O,kA as te,qA as ne}from"./loadAgentsDir-Cl2w3uvH.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(O(),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 g(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return g(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return g(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(g(`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?(g(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(g(`Install counts cache has malformed entries`),null)}catch(e){return f(e)!==`ENOENT`&&g(`Failed to load install counts cache: ${d(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=O();await v().mkdir(r),await F(n,u(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),g(`Install counts cache saved successfully`)}catch(e){x(e);try{await P(n)}catch{}}}async function z(){g(`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 S(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw S(`install_counts`,W,`failure`,performance.now()-e,w(t)),t}}async function B(){let e=await L();if(e){g(`Using cached install counts`),S(`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 x(e),g(`Failed to fetch install counts: ${d(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(),y(),h(),_(),ee(),b(),te(),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=v(),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=f(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((()=>{h(),_()}));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=f(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${d(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: ${d(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 — Claude Code ignores it at load time.`});o=r}}let c=s().strict().safeParse(o);if(c.success||t.push(...q(c.error)),c.success){let e=c.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Claude Code 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),o;try{o=await A(i,{encoding:`utf-8`})}catch(e){let t=f(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${d(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let s;try{s=p(o)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(s&&typeof s==`object`){let e=s;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 c=a().extend({plugins:r(l().strict())}).strict().safeParse(s);if(c.success||t.push(...q(c.error)),c.success){let e=c.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=[],a=t.match(T);if(!a)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 o=a[1]||``,s;try{s=ne(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${d(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 s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.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}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let u=c.shell;if(u!=null)if(typeof u!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof u}.`});else{let e=u.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${u}'.`})}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 f(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${d(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=o().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=f(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(m(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${d(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(!m(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(f(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(),h(),E(),b(),C(),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
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Tt as r}from"./schemas-BGAvj1T4.js";import{t as i}from"./v4-f1i_CNUT.js";import{bs as a,gs as o,vs as s,xs as c,ys as l}from"./paths-D8Fx3kUi.js";import{E as u,L as d,R as f,T as p,U as m,V as h,d as g,h as _,p as v,s as y,w as b}from"./debug-UI3T040K.js";import{o as ee,s as x}from"./log-CzsijfHZ.js";import{AA as S,KA as C,OA as w,UA as T,WA as E,aA as D,iA as O,kA as te,qA as ne}from"./loadAgentsDir-HZ19tmOZ.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(O(),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 g(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==H)return g(`Install counts cache version mismatch (got ${n.version}, expected ${H})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return g(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(g(`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?(g(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(g(`Install counts cache has malformed entries`),null)}catch(e){return f(e)!==`ENOENT`&&g(`Failed to load install counts cache: ${d(e)}`),null}}async function R(e){let t=I(),n=`${t}.${oe(8).toString(`hex`)}.tmp`;try{let r=O();await v().mkdir(r),await F(n,u(e,null,2),{encoding:`utf-8`,mode:384}),await M(n,t),g(`Install counts cache saved successfully`)}catch(e){x(e);try{await P(n)}catch{}}}async function z(){g(`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 S(`install_counts`,W,`success`,performance.now()-e),n.data.plugins}catch(t){throw S(`install_counts`,W,`failure`,performance.now()-e,w(t)),t}}async function B(){let e=await L();if(e){g(`Using cached install counts`),S(`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 x(e),g(`Failed to fetch install counts: ${d(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(),y(),h(),_(),ee(),b(),te(),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=v(),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=f(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((()=>{h(),_()}));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=f(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${d(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: ${d(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 — Claude Code ignores it at load time.`});o=r}}let c=s().strict().safeParse(o);if(c.success||t.push(...q(c.error)),c.success){let e=c.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. Claude Code 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),o;try{o=await A(i,{encoding:`utf-8`})}catch(e){let t=f(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${d(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let s;try{s=p(o)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(s&&typeof s==`object`){let e=s;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 c=a().extend({plugins:r(l().strict())}).strict().safeParse(s);if(c.success||t.push(...q(c.error)),c.success){let e=c.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=[],a=t.match(T);if(!a)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 o=a[1]||``,s;try{s=ne(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${d(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 s!=`object`||!s||Array.isArray(s))return r.push({path:`frontmatter`,message:`Frontmatter must be a YAML mapping (key: value pairs), got ${Array.isArray(s)?`an array`:s===null?`null`:typeof s}.`}),{success:!1,errors:r,warnings:i,filePath:e,fileType:n};let c=s;if(c.description!==void 0){let e=c.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}.`});c.name!==void 0&&c.name!==null&&typeof c.name!=`string`&&r.push({path:`name`,message:`name must be a string, got ${typeof c.name}.`});let l=c[`allowed-tools`];l!=null&&(typeof l!=`string`&&!Array.isArray(l)?r.push({path:`allowed-tools`,message:`allowed-tools must be a string or array of strings, got ${typeof l}.`}):Array.isArray(l)&&l.some(e=>typeof e!=`string`)&&r.push({path:`allowed-tools`,message:`allowed-tools array must contain only strings.`}));let u=c.shell;if(u!=null)if(typeof u!=`string`)r.push({path:`shell`,message:`shell must be a string, got ${typeof u}.`});else{let e=u.trim().toLowerCase();e!==`bash`&&e!==`powershell`&&r.push({path:`shell`,message:`shell must be 'bash' or 'powershell', got '${u}'.`})}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 f(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${d(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=p(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${d(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=o().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=f(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(m(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${d(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(!m(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(f(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(),h(),E(),b(),C(),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"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n,Sc as r}from"./paths-q1-Ni8Oh.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";var o;e((()=>{i(),t(),o=async()=>{let e=r().editorMode||`normal`;e===`emacs`&&(e=`normal`);let t=e===`normal`?`vim`:`normal`;return n(e=>({...e,editorMode:t})),a(`tengu_editor_mode_changed`,{mode:t,source:`command`}),{type:`text`,value:`Editor mode set to ${t}. ${t===`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"./chunk-DR8-3Aex.js";import{Ac as t,Pc as n,Sc as r}from"./paths-D8Fx3kUi.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";var o;e((()=>{i(),t(),o=async()=>{let e=r().editorMode||`normal`;e===`emacs`&&(e=`normal`);let t=e===`normal`?`vim`:`normal`;return n(e=>({...e,editorMode:t})),a(`tengu_editor_mode_changed`,{mode:t,source:`command`}),{type:`text`,value:`Editor mode set to ${t}. ${t===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};