claude-code-best 2.7.1 → 2.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (497) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-C7od6sFQ.js → AddWorkspaceDirectory-DRO4tbYd.js} +1 -1
  2. package/dist/chunks/{App-EfHjElWP.js → App-DJyiiVKi.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-CSz0291w.js → ApproveApiKey-DygOEAkM.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-oTZKoMvB.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-mLIhDlxW.js → AssistantSessionChooser-C67mOxVi.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-Bqk_Cn3j.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-BCdft-m_.js → BypassPermissionsModeDialog-C4z7RkFV.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-BPlrCIo-.js → ClaudeInChromeOnboarding-CyVFdjBe.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-5FCT81WS.js +1 -0
  10. package/dist/chunks/{ClaudeMdExternalIncludesDialog-D8fk-Ib5.js → ClaudeMdExternalIncludesDialog-IpqqBuJs.js} +1 -1
  11. package/dist/chunks/ConsoleOAuthFlow-BmGziW64.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-BQwx7qWA.js → DesktopHandoff-CJpa8Xy-.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-CujM8Ivu.js → DevChannelsDialog-CfAuHVRL.js} +1 -1
  14. package/dist/chunks/Dialog-C8eGKH-e.js +1 -0
  15. package/dist/chunks/{DiffDialog-Byv1UJvS.js → DiffDialog-CV3brWsG.js} +1 -1
  16. package/dist/chunks/{Doctor-Cv7wbi6C.js → Doctor-D3GysagF.js} +1 -1
  17. package/dist/chunks/Doctor-DohPtIKu.js +1 -0
  18. package/dist/chunks/{ExitFlow-DKusdm_v.js → ExitFlow-L2sh80sm.js} +2 -2
  19. package/dist/chunks/{Feedback-Diw8XUr-.js → Feedback-DfkBCvva.js} +1 -1
  20. package/dist/chunks/{Grove-CAi037VV.js → Grove-Bo74aZx-.js} +1 -1
  21. package/dist/chunks/Grove-C_ocvHd3.js +1 -0
  22. package/dist/chunks/{HybridTransport-CP0RopXu.js → HybridTransport-BItIDJyC.js} +1 -1
  23. package/dist/chunks/{ITermBackend-RvD4VX7c.js → ITermBackend-3iS8Bvmo.js} +1 -1
  24. package/dist/chunks/{InvalidConfigDialog-Bhlgysxl.js → InvalidConfigDialog-6lPGcuOX.js} +1 -1
  25. package/dist/chunks/{InvalidSettingsDialog-dGStgJZN.js → InvalidSettingsDialog-D8DwHiys.js} +1 -1
  26. package/dist/chunks/ListItem-DDMe4CJ3.js +1 -0
  27. package/dist/chunks/{MCPConnectionManager-D5a9ysw2.js → MCPConnectionManager-CsPizxTx.js} +1 -1
  28. package/dist/chunks/{McpParsingWarnings-B_z9pZ_8.js → McpParsingWarnings-Cepe7RPZ.js} +1 -1
  29. package/dist/chunks/MessageSelector-BzUQUeDn.js +3 -0
  30. package/dist/chunks/{Messages-DTmFVhRG.js → Messages-KmeXIJqL.js} +3 -3
  31. package/dist/chunks/{Onboarding-BoAtphYb.js → Onboarding-BZUXID6q.js} +1 -1
  32. package/dist/chunks/{OverageCreditUpsell-DA7Ne7Mj.js → OverageCreditUpsell-Dhm7HBuD.js} +1 -1
  33. package/dist/chunks/{PermissionDialog-_WQPRYHQ.js → PermissionDialog-BrRBxx5o.js} +1 -1
  34. package/dist/chunks/PluginSettings-BZ-PX9Tg.js +17 -0
  35. package/dist/chunks/{PressEnterToContinue-BJ58eCFC.js → PressEnterToContinue-DtA_p3X6.js} +1 -1
  36. package/dist/chunks/{PromptInputFooterSuggestions-DhIQ0Nge.js → PromptInputFooterSuggestions-Da8Fty6P.js} +1 -1
  37. package/dist/chunks/{PromptInputHelpMenu-B__j9zE6.js → PromptInputHelpMenu-Bz7EPzzq.js} +1 -1
  38. package/dist/chunks/QueryEngine-CmJK27jU.js +1 -0
  39. package/dist/chunks/REPL-BBmn_itf.js +1 -0
  40. package/dist/chunks/{REPL-B1BS9jwx.js → REPL-DxEJZpIp.js} +36 -36
  41. package/dist/chunks/{RemoteCallout-Bwe1ESr9.js → RemoteCallout-DONJj8l2.js} +1 -1
  42. package/dist/chunks/RemoteSessionManager-BvvNspY8.js +2 -0
  43. package/dist/chunks/ResumeConversation-EpjJdFHu.js +1 -0
  44. package/dist/chunks/{SSETransport-D3e5KNL3.js → SSETransport-D51Jfdaj.js} +1 -1
  45. package/dist/chunks/SearchBox-CciJ8giD.js +1 -0
  46. package/dist/chunks/SearchExtraToolsTool-kjVFsFkT.js +1 -0
  47. package/dist/chunks/SentryErrorBoundary-DsrmgmKF.js +1 -0
  48. package/dist/chunks/{SentryErrorBoundary-D-YZTGQG.js → SentryErrorBoundary-nYTimi4l.js} +1 -1
  49. package/dist/chunks/Settings-C2vEJjLx.js +2 -0
  50. package/dist/chunks/{TeleportProgress-C3Ubx1Se.js → TeleportProgress--jgrqIfW.js} +1 -1
  51. package/dist/chunks/{TeleportRepoMismatchDialog-D_ax3xQy.js → TeleportRepoMismatchDialog-BKDaFT_L.js} +1 -1
  52. package/dist/chunks/{TeleportResumeWrapper-DeVKIXQp.js → TeleportResumeWrapper-CxlpiHIz.js} +1 -1
  53. package/dist/chunks/{ThemePicker-DKmIL5Ku.js → ThemePicker-CYL4C-F-.js} +1 -1
  54. package/dist/chunks/{TmuxBackend-Bm_cRJ2x.js → TmuxBackend-C_N4ww8i.js} +2 -2
  55. package/dist/chunks/{TrustDialog-ClXFMKj6.js → TrustDialog-CYdftZ1M.js} +1 -1
  56. package/dist/chunks/{ValidationErrorsList-SdQADfvA.js → ValidationErrorsList-CaTwOP3f.js} +1 -1
  57. package/dist/chunks/{WelcomeV2-BijS6i2Z.js → WelcomeV2-5rgKm4Mz.js} +1 -1
  58. package/dist/chunks/{WindowsTerminalBackend-CGEQ5ClB.js → WindowsTerminalBackend-BzoSs0VA.js} +2 -2
  59. package/dist/chunks/{add-dir-B7kleB6k.js → add-dir-RNzFR3XZ.js} +1 -1
  60. package/dist/chunks/{agentDisplay-Dr1XbOAu.js → agentDisplay-DgeOQY1E.js} +1 -1
  61. package/dist/chunks/{agents-CpLvvWpO.js → agents-D7cgzb3f.js} +7 -7
  62. package/dist/chunks/{agents-Dy5YOJC9.js → agents-iMtFurok.js} +1 -1
  63. package/dist/chunks/{ant-gwf-4eGN.js → ant-CF1iRpXD.js} +1 -1
  64. package/dist/chunks/{api-CDmgYrwN.js → api-DMbWqJlK.js} +1 -1
  65. package/dist/chunks/api-DkgaFAzq.js +1 -0
  66. package/dist/chunks/artifacts-D2kY_AMp.js +1 -0
  67. package/dist/chunks/{assistant-1usDIXtk.js → assistant-CZ4VXgzH.js} +1 -1
  68. package/dist/chunks/assistant-CiNV3Q0f.js +1 -0
  69. package/dist/chunks/{assistant-BULedprW.js → assistant-JAqAZqaE.js} +1 -1
  70. package/dist/chunks/{auth-CvHVr2A5.js → auth-BemPA3ot.js} +1 -1
  71. package/dist/chunks/auth-CbQCc9vz.js +1 -0
  72. package/dist/chunks/{autoMode-DSMM2seL.js → autoMode-CGovMAzJ.js} +1 -1
  73. package/dist/chunks/{autonomy-TtBO2TAe.js → autonomy-BVXyNEj0.js} +1 -1
  74. package/dist/chunks/{autonomy-Dj6Nzxus.js → autonomy-BnAHLZWH.js} +3 -3
  75. package/dist/chunks/{autonomyPanel-CbmU7lPg.js → autonomyPanel-COMI2iR0.js} +1 -1
  76. package/dist/chunks/{backgroundHousekeeping-Cp2RvmEN.js → backgroundHousekeeping-BRtG20l2.js} +2 -2
  77. package/dist/chunks/backgroundHousekeeping-LYpOamcN.js +1 -0
  78. package/dist/chunks/{banner-D9Cq292T.js → banner-D_rqe2XQ.js} +1 -1
  79. package/dist/chunks/{branch-Cj5TGroO.js → branch-BnKwIQtC.js} +1 -1
  80. package/dist/chunks/{break-cache-DrIa8RdW.js → break-cache-CDzQDHwY.js} +1 -1
  81. package/dist/chunks/{bridge-CsqJAoEg.js → bridge-ChVjEHVq.js} +2 -2
  82. package/dist/chunks/bridgeConfig-Budgp2Go.js +1 -0
  83. package/dist/chunks/{bridgeConfig-pjDV5Z2l.js → bridgeConfig-e0MGfed6.js} +1 -1
  84. package/dist/chunks/{bridgeEnabled-D9jI6X-w.js → bridgeEnabled-DR-v8AXw.js} +1 -1
  85. package/dist/chunks/bridgeEnabled-DmvmwuUY.js +1 -0
  86. package/dist/chunks/bridgeMain-KYR5iq6H.js +1 -0
  87. package/dist/chunks/{bridgeMain-CNmR9iDD.js → bridgeMain-OsR-_PRp.js} +11 -11
  88. package/dist/chunks/{bridgeMessaging-DN0X35NX.js → bridgeMessaging-BvBnxgD4.js} +1 -1
  89. package/dist/chunks/{btw-BOg0RTKl.js → btw-_b16RGoh.js} +1 -1
  90. package/dist/chunks/{buddy-BFuPeIxM.js → buddy-DJ3QSQyd.js} +1 -1
  91. package/dist/chunks/{bypassPermissionsKillswitch-kxVnIVRs.js → bypassPermissionsKillswitch-OhGSWZrB.js} +1 -1
  92. package/dist/chunks/{caches-BumkMuGA.js → caches-Bp4F7tZ5.js} +2 -2
  93. package/dist/chunks/caches-CkH9F-Fd.js +1 -0
  94. package/dist/chunks/{ccrClient-BI1QPLmN.js → ccrClient-D7pEGzQa.js} +1 -1
  95. package/dist/chunks/changeDetector-IFbty4jj.js +1 -0
  96. package/dist/chunks/{channelNotification-CoZSFUlb.js → channelNotification-BZFMAWln.js} +1 -1
  97. package/dist/chunks/channelNotification-CIyWY0hs.js +1 -0
  98. package/dist/chunks/{chrome-C_5EZcdc.js → chrome-B5IxDA16.js} +1 -1
  99. package/dist/chunks/clear-BVjSQsUL.js +1 -0
  100. package/dist/chunks/client-BUUsZdSe.js +1 -0
  101. package/dist/chunks/color-BYVWpzI8.js +1 -0
  102. package/dist/chunks/commands-pTQdOvN6.js +1 -0
  103. package/dist/chunks/{commitAttribution-iKd8bTOI.js → commitAttribution-ClSlXMPG.js} +1 -1
  104. package/dist/chunks/commitAttribution-QPrKt_BF.js +1 -0
  105. package/dist/chunks/{compact-B6Muofhz.js → compact-B9c12JXf.js} +3 -3
  106. package/dist/chunks/{companion-B_LrjSk5.js → companion-C8e7dVlu.js} +1 -1
  107. package/dist/chunks/completionCache-BB7-y2BX.js +1 -0
  108. package/dist/chunks/{completionCache-C7hDqIDL.js → completionCache-Br6OwASx.js} +1 -1
  109. package/dist/chunks/{config-CJd9kJ57.js → config-Bxgfx_nO.js} +1 -1
  110. package/dist/chunks/{config-CQd4IkXo.js → config-C-yz-f4W.js} +1 -1
  111. package/dist/chunks/{context-qAHTuazZ.js → context-Bf5t6C-a.js} +1 -1
  112. package/dist/chunks/{context-noninteractive-DZsSp-ES.js → context-noninteractive-CJu7hZCM.js} +1 -1
  113. package/dist/chunks/context-noninteractive-OUTZ6BKj.js +1 -0
  114. package/dist/chunks/conversation-BYMS5Hqa.js +1 -0
  115. package/dist/chunks/conversation-Bs8l0KNl.js +1 -0
  116. package/dist/chunks/{copy-B2jhZndZ.js → copy-C0BZ7Gm0.js} +1 -1
  117. package/dist/chunks/{createSSHSession-CKdoEmAg.js → createSSHSession-DNXCWneI.js} +1 -1
  118. package/dist/chunks/{createSession-WkBw7wdn.js → createSession-DjM6Ev45.js} +1 -1
  119. package/dist/chunks/createSession-DpqtD4ML.js +1 -0
  120. package/dist/chunks/cron-DwR6OJuW.js +1 -0
  121. package/dist/chunks/{cronJitterConfig-2u6WAlti.js → cronJitterConfig-CaFkPXKB.js} +1 -1
  122. package/dist/chunks/{crossProjectResume-CjJISRBQ.js → crossProjectResume-BCr6jfGz.js} +3 -3
  123. package/dist/chunks/{daemon-BRKR4D1D.js → daemon-Bu0Uy-qG.js} +1 -1
  124. package/dist/chunks/{datadog-YsyhnDmr.js → datadog-ClZjR-jM.js} +1 -1
  125. package/dist/chunks/datadog-DlzPb5oG.js +1 -0
  126. package/dist/chunks/desktop-WH8s-9-6.js +1 -0
  127. package/dist/chunks/{diff-BTtUFuf-.js → diff-D9hjPq4W.js} +1 -1
  128. package/dist/chunks/{doctor-BKBb426q.js → doctor-4-im_J_h.js} +1 -1
  129. package/dist/chunks/earlyInput-DEZaWwKF.js +1 -0
  130. package/dist/chunks/{effort-ClhxMqY6.js → effort-Bz-9GIpe.js} +1 -1
  131. package/dist/chunks/entry-CEBaLwEG.js +14 -0
  132. package/dist/chunks/{envLessBridgeConfig-C9UUbQCo.js → envLessBridgeConfig-DW4-nPbZ.js} +1 -1
  133. package/dist/chunks/envLessBridgeConfig-izoVnE8s.js +1 -0
  134. package/dist/chunks/exit-DBNDTR4b.js +1 -0
  135. package/dist/chunks/{export-DS2esu8D.js → export-CQHUM_Nv.js} +1 -1
  136. package/dist/chunks/{exportRenderer-DX2L5fQ7.js → exportRenderer-CuIDQBLH.js} +1 -1
  137. package/dist/chunks/{extra-usage-XJxfHsbe.js → extra-usage-DTr6gExD.js} +1 -1
  138. package/dist/chunks/extra-usage-VSASGlte.js +1 -0
  139. package/dist/chunks/{extra-usage-core-D84ifgBo.js → extra-usage-core-D3CwYO_8.js} +1 -1
  140. package/dist/chunks/{extra-usage-noninteractive-fxqxHnIt.js → extra-usage-noninteractive-d-QVg1D5.js} +1 -1
  141. package/dist/chunks/{extraUsage-P_NGI1-I.js → extraUsage-BNRQOkgU.js} +1 -1
  142. package/dist/chunks/extractMemories-hQlhiVOD.js +1 -0
  143. package/dist/chunks/fast-2gWrhEFZ.js +1 -0
  144. package/dist/chunks/{fast-CpN8lLnE.js → fast-bkGXbuHX.js} +1 -1
  145. package/dist/chunks/{feedback-CqRsOG3c.js → feedback-BvFgE_FF.js} +1 -1
  146. package/dist/chunks/{firstPartyEventLogger-CM0V7Uev.js → firstPartyEventLogger-D-ifHvWu.js} +1 -1
  147. package/dist/chunks/{flushGate-DNutWuOE.js → flushGate-BA24vFBg.js} +1 -1
  148. package/dist/chunks/{fpsMetrics-DKWp7vng.js → fpsMetrics-CBFlAGTS.js} +1 -1
  149. package/dist/chunks/{gates-C4JvRq4i.js → gates-C66Nz9b2.js} +1 -1
  150. package/dist/chunks/gates-dO6m4Hdp.js +1 -0
  151. package/dist/chunks/{gemini-B0M6SQSG.js → gemini-DuQl4hTA.js} +1 -1
  152. package/dist/chunks/{generateRecap-DhDOgXn3.js → generateRecap-CwBU76xi.js} +1 -1
  153. package/dist/chunks/{generateSessionName-CoFR2wgK.js → generateSessionName-LnmjE9jh.js} +1 -1
  154. package/dist/chunks/{githubRepoPathMapping-DGiSNykv.js → githubRepoPathMapping-DrreQj47.js} +1 -1
  155. package/dist/chunks/{goal-DRb6pPAp.js → goal-BIvjF6B7.js} +3 -3
  156. package/dist/chunks/{grok-emDua_hT.js → grok-KNLYSRBQ.js} +1 -1
  157. package/dist/chunks/{growthbook-COAneL48.js → growthbook-ksjGAskq.js} +1 -1
  158. package/dist/chunks/{heapdump-CA6DHA8G.js → heapdump-Cz8vkcOr.js} +1 -1
  159. package/dist/chunks/{help-XXY7deZm.js → help-Cx9OordP.js} +1 -1
  160. package/dist/chunks/{hooks-C6zZYnDi.js → hooks-BW-d9Bdu.js} +2 -2
  161. package/dist/chunks/hooks-BWoN0nQP.js +1 -0
  162. package/dist/chunks/{hostAdapter-DZbdeXCV.js → hostAdapter-DLmaB6eN.js} +1 -1
  163. package/dist/chunks/{ide-BLRNkzVx.js → ide-CECrIg1r.js} +2 -2
  164. package/dist/chunks/{inboundAttachments-60kD5Qt_.js → inboundAttachments-B0sGIu79.js} +1 -1
  165. package/dist/chunks/inboundAttachments-D8vq1NQO.js +1 -0
  166. package/dist/chunks/initReplBridge-BAEMZEcg.js +1 -0
  167. package/dist/chunks/{insights-BBugI3tW.js → insights-DeWggLxC.js} +1 -1
  168. package/dist/chunks/{install-github-app-ByyzrlM9.js → install-github-app-DqKEiHQ1.js} +2 -2
  169. package/dist/chunks/{install-CuVHbwyW.js → install-pxH_HR1p.js} +1 -1
  170. package/dist/chunks/{install-slack-app-CJGtmacz.js → install-slack-app-P1L9x-YI.js} +1 -1
  171. package/dist/chunks/{instrumentation-C8zvzMg1.js → instrumentation-Dx0s2jzr.js} +3 -3
  172. package/dist/chunks/{job-DBf6aPQX.js → job-CbxxkPgE.js} +1 -1
  173. package/dist/chunks/{keybindings-Bi7SMp5-.js → keybindings-BBPC7FAc.js} +1 -1
  174. package/dist/chunks/{lang-CVDkUhjk.js → lang-CKp0Tn76.js} +1 -1
  175. package/dist/chunks/language-CSDpzbTz.js +1 -0
  176. package/dist/chunks/{language-BYeqMX74.js → language-iERMuOEu.js} +1 -1
  177. package/dist/chunks/{launchAgentsPlatform-BKqxMFFn.js → launchAgentsPlatform-DQvKVtl2.js} +1 -1
  178. package/dist/chunks/{launchAutofixPr-CauX6gOB.js → launchAutofixPr-B7hu9C8h.js} +3 -3
  179. package/dist/chunks/{launchCommand-9eYsPG7W.js → launchCommand-CJsikSlW.js} +1 -1
  180. package/dist/chunks/{launchLocalMemory-Brrd_BJC.js → launchLocalMemory-Cpz7L5j5.js} +2 -2
  181. package/dist/chunks/{launchLocalVault-DtAn656A.js → launchLocalVault-XLfOQtP7.js} +3 -3
  182. package/dist/chunks/{launchMemoryStores-x7_Id7Yr.js → launchMemoryStores-Cz04PaDE.js} +1 -1
  183. package/dist/chunks/{launchOnboarding-DkamFByn.js → launchOnboarding-XPbUNdHS.js} +1 -1
  184. package/dist/chunks/{launchSchedule-DjNQNxW4.js → launchSchedule-B1VEe3o-.js} +1 -1
  185. package/dist/chunks/{launchSkillStore-D2GUGhDD.js → launchSkillStore-Cy59z5xx.js} +1 -1
  186. package/dist/chunks/{launchTeleport-DTfhiZkf.js → launchTeleport-ZPM_DvzK.js} +3 -3
  187. package/dist/chunks/{launchVault-BZ2Po4r8.js → launchVault-BhnTOZq8.js} +1 -1
  188. package/dist/chunks/loadAgentsDir-B-4D2dVE.js +1 -0
  189. package/dist/chunks/{loadAgentsDir-C_wFhytF.js → loadAgentsDir-CQF8qhne.js} +778 -778
  190. package/dist/chunks/loadPluginHooks-TyULD8KH.js +1 -0
  191. package/dist/chunks/{localSearch-B0p0_bjP.js → localSearch-BNYypHsK.js} +1 -1
  192. package/dist/chunks/localSearch-DsFH9yls.js +1 -0
  193. package/dist/chunks/login-CEJEl2mW.js +1 -0
  194. package/dist/chunks/{login-C1uE6Pg9.js → login-CxbcJk9_.js} +1 -1
  195. package/dist/chunks/{logoV2Utils-BJHvwGup.js → logoV2Utils-Br_w1z39.js} +1 -1
  196. package/dist/chunks/logout-BXr4jzNY.js +1 -0
  197. package/dist/chunks/{magicDocs-DPZzG7Z2.js → magicDocs-DnxdS9yV.js} +1 -1
  198. package/dist/chunks/{main-CNwSLti2.js → main-FBmdv32j.js} +145 -66
  199. package/dist/chunks/{mappers-Dxs_kNJH.js → mappers-BNI_df3v.js} +1 -1
  200. package/dist/chunks/mcp-BhAGhDQE.js +1 -0
  201. package/dist/chunks/{mcp-CbDDqdzF.js → mcp-DbqUZ1Cf.js} +1 -1
  202. package/dist/chunks/mcp-esqdO_lV.js +6 -0
  203. package/dist/chunks/{mcpServer-Py4Iz9Hx.js → mcpServer-Ct-GVL-y.js} +1 -1
  204. package/dist/chunks/{mcpServer-BJNjQXsU.js → mcpServer-DeL2ADSF.js} +1 -1
  205. package/dist/chunks/memory-DwapBEsD.js +1 -0
  206. package/dist/chunks/{mobile-BMglW1NB.js → mobile-D7MSmMhc.js} +1 -1
  207. package/dist/chunks/{modalContext-c5Yqx_CQ.js → modalContext-DxfeT_3m.js} +1 -1
  208. package/dist/chunks/{mode-CqGusjoT.js → mode-B5cmHCvz.js} +1 -1
  209. package/dist/chunks/{model-BBULcn7y.js → model-BePO0VaC.js} +1 -1
  210. package/dist/chunks/model-CgH43-hO.js +1 -0
  211. package/dist/chunks/{onChangeAppState-BkRihYau.js → onChangeAppState-B3d5iy6T.js} +1 -1
  212. package/dist/chunks/{openai-yNI_zoao.js → openai-fRhGOIQq.js} +3 -3
  213. package/dist/chunks/{overageCreditGrant-Cbh0_fbM.js → overageCreditGrant-B6sx7IFi.js} +1 -1
  214. package/dist/chunks/{panel-D3wvAEFE.js → panel-CAVG5BOM.js} +1 -1
  215. package/dist/chunks/{panel-BYfvo_mR.js → panel-DU8y_jcf.js} +1 -1
  216. package/dist/chunks/{panelCall-t10Sud9A.js → panelCall-DUQdjDee.js} +1 -1
  217. package/dist/chunks/{passes-D_iS6DaC.js → passes-CWPPUigp.js} +1 -1
  218. package/dist/chunks/{paths-Ci1iwL5Y.js → paths-4ZWdjPP4.js} +3 -3
  219. package/dist/chunks/{permissions-CHvu4-yX.js → permissions-DW8CRuJp.js} +3 -3
  220. package/dist/chunks/{pipeTransport-EAYXsubu.js → pipeTransport-CUeYRWJn.js} +1 -1
  221. package/dist/chunks/{plan-CP5nq_EB.js → plan-Cf-tHvGq.js} +1 -1
  222. package/dist/chunks/plugin-DXhCgoNC.js +1 -0
  223. package/dist/chunks/{pluginAutoupdate-ClrgF5b3.js → pluginAutoupdate-CdmKzIRf.js} +1 -1
  224. package/dist/chunks/{pluginBlocklist-B1LVo0j_.js → pluginBlocklist-C9XwbFSo.js} +1 -1
  225. package/dist/chunks/{pluginCliCommands-eqyMBWcP.js → pluginCliCommands-CmY_maYg.js} +1 -1
  226. package/dist/chunks/{pluginFlagging-BiTDVP10.js → pluginFlagging-DyzxZolj.js} +1 -1
  227. package/dist/chunks/{pluginOperations-gZ-iCmhu.js → pluginOperations-mr4I7Jw9.js} +1 -1
  228. package/dist/chunks/{pluginStartupCheck-DCDWHam6.js → pluginStartupCheck-B6OdK29Z.js} +1 -1
  229. package/dist/chunks/pluginStartupCheck-BFuZqpnX.js +1 -0
  230. package/dist/chunks/{plugins-BAIVqfi8.js → plugins-rdPgpjF8.js} +1 -1
  231. package/dist/chunks/policyLimits-B3dtp_Fe.js +1 -0
  232. package/dist/chunks/{pollConfig-_2W7bHoW.js → pollConfig-DLbuHBse.js} +1 -1
  233. package/dist/chunks/{poor-Dii0mpOW.js → poor-pmz2b7zu.js} +1 -1
  234. package/dist/chunks/poorMode-BPIUnFFi.js +1 -0
  235. package/dist/chunks/{poorMode-aDmmvJ_e.js → poorMode-DD-q_w6Z.js} +1 -1
  236. package/dist/chunks/{print-BwSmcUQu.js → print-luaON-Cg.js} +12 -12
  237. package/dist/chunks/{privacy-settings-DaAgSLKw.js → privacy-settings-BpigC4oX.js} +1 -1
  238. package/dist/chunks/{processBashCommand-BZ1_JKu4.js → processBashCommand-f_84bSlP.js} +1 -1
  239. package/dist/chunks/processSlashCommand-BkBqV3Jd.js +6 -0
  240. package/dist/chunks/{projectContext-Cd7V9pES.js → projectContext-fS1t-xRh.js} +1 -1
  241. package/dist/chunks/{prompt-6ZKyqv6z.js → prompt-CogZQuTN.js} +1 -1
  242. package/dist/chunks/prompt-CriAIdkT.js +1 -0
  243. package/dist/chunks/prompt-TGc_H1cL.js +1 -0
  244. package/dist/chunks/{promptEditor-Dz41P-3I.js → promptEditor-C___2FFs.js} +2 -2
  245. package/dist/chunks/{protocolHandler-CHGHjfdf.js → protocolHandler-qwll5gSY.js} +1 -1
  246. package/dist/chunks/{rate-limit-options-BlU9av7g.js → rate-limit-options-nQcTipEp.js} +1 -1
  247. package/dist/chunks/{rcDebugLog-C42A0pX1.js → rcDebugLog-DOXxIr8l.js} +1 -1
  248. package/dist/chunks/{referral-IIcY3jkp.js → referral-CMPZjf3I.js} +1 -1
  249. package/dist/chunks/{refresh-DTGEx7X_.js → refresh-CP7Dnjp4.js} +1 -1
  250. package/dist/chunks/{registerProtocol-BkNncGMI.js → registerProtocol-DCNuqdCC.js} +1 -1
  251. package/dist/chunks/registry-DLqZJleQ.js +1 -0
  252. package/dist/chunks/{release-notes-BxzOD-zP.js → release-notes-BsDW6T9f.js} +1 -1
  253. package/dist/chunks/{releaseNotes-C8KQGZHq.js → releaseNotes-Tbd018Qz.js} +2 -2
  254. package/dist/chunks/{reload-plugins-gYyC6_g8.js → reload-plugins-iG9ZE9wF.js} +1 -1
  255. package/dist/chunks/{remote-env-CEJH5aJh.js → remote-env-BFntnltf.js} +1 -1
  256. package/dist/chunks/{remoteBridgeCore-Dte7ZUAN.js → remoteBridgeCore-Dpko9c-J.js} +1 -1
  257. package/dist/chunks/{remoteControlServer-GN-eDbEz.js → remoteControlServer-D3P82kVF.js} +1 -1
  258. package/dist/chunks/{rename-BEU6BNRp.js → rename-Codm2nfB.js} +1 -1
  259. package/dist/chunks/{resume-D36S2rXg.js → resume-BB1ceL_x.js} +2 -2
  260. package/dist/chunks/{runtimeObserver-CDMCeww2.js → runtimeObserver-BpRn0RiL.js} +1 -1
  261. package/dist/chunks/{runtimeObserver-DaKaKNVW.js → runtimeObserver-D6aF77Dq.js} +2 -2
  262. package/dist/chunks/sandbox-adapter-DrHD1mch.js +1 -0
  263. package/dist/chunks/{sandbox-toggle-BPO26t48.js → sandbox-toggle-DZ-8qXDS.js} +1 -1
  264. package/dist/chunks/searchExtraTools-Dwg6ZafS.js +1 -0
  265. package/dist/chunks/{sentry-9EbPa1Xu.js → sentry-CVdHlmNQ.js} +1 -1
  266. package/dist/chunks/{session-D18B22u4.js → session-B4j1ViVc.js} +1 -1
  267. package/dist/chunks/{sessionDiscovery-B-OTvXJf.js → sessionDiscovery-DkIIFsWX.js} +1 -1
  268. package/dist/chunks/sessionFileAccessHooks-n7HcOfZ7.js +1 -0
  269. package/dist/chunks/{sessionMemory-Ctauybzs.js → sessionMemory-CnT3-Mj7.js} +1 -1
  270. package/dist/chunks/sessionMemory-DVq43VXP.js +1 -0
  271. package/dist/chunks/sessionMemoryUtils-BjkdLRvh.js +1 -0
  272. package/dist/chunks/sessionObserver-CrfmnMzL.js +1 -0
  273. package/dist/chunks/{sessionObserver-ardnTJ37.js → sessionObserver-gjdJ91cv.js} +1 -1
  274. package/dist/chunks/sessionStorage-BTbr9wkZ.js +1 -0
  275. package/dist/chunks/{sessionTitle-DEKvIVCK.js → sessionTitle-CSU5-VK9.js} +1 -1
  276. package/dist/chunks/{sessionTracing-CJUUEWZ4.js → sessionTracing-BDN64fWh.js} +1 -1
  277. package/dist/chunks/{settingsSync-BWt3oUR7.js → settingsSync-Nixbcaox.js} +1 -1
  278. package/dist/chunks/{setup-BECFDOT9.js → setup-9nXlu56r.js} +1 -1
  279. package/dist/chunks/{setup-CmCTB2T_.js → setup-CZxLEcQh.js} +1 -1
  280. package/dist/chunks/setup-n3Ixr_gs.js +3 -0
  281. package/dist/chunks/{shadowedRuleDetection-BbALfdxE.js → shadowedRuleDetection-CCS7R7F1.js} +1 -1
  282. package/dist/chunks/{sideQuestion-BHK6dd1q.js → sideQuestion-MzExGTvn.js} +1 -1
  283. package/dist/chunks/{sink-Do5fWbUC.js → sink-BL75jACh.js} +1 -1
  284. package/dist/chunks/sink-CoUVbLFs.js +1 -0
  285. package/dist/chunks/{sinks-Dc9V7k6a.js → sinks-C-gxj_Eu.js} +2 -2
  286. package/dist/chunks/sinks-wuo1yQ_m.js +1 -0
  287. package/dist/chunks/{skill-learning-BHW9G3Dn.js → skill-learning-B9Msm4jG.js} +1 -1
  288. package/dist/chunks/skillChangeDetector-DlWPJTny.js +1 -0
  289. package/dist/chunks/{skillGapStore-DVMbI2yy.js → skillGapStore-Cpmbwyo3.js} +1 -1
  290. package/dist/chunks/{skillGapStore-Wa7s6orv.js → skillGapStore-CsADiV5a.js} +2 -2
  291. package/dist/chunks/{skillGenerator-CBuoIFsH.js → skillGenerator-_khb-Gmc.js} +2 -2
  292. package/dist/chunks/skillLearning-CFnZiM5J.js +1 -0
  293. package/dist/chunks/skillLearning-D6mvGN90.js +1 -0
  294. package/dist/chunks/{skillPanel-2w82nkOl.js → skillPanel-DQmj3Yh1.js} +3 -3
  295. package/dist/chunks/{skillSearchPanel-7BhCBkdh.js → skillSearchPanel-6w_zzoI3.js} +2 -2
  296. package/dist/chunks/{skills-D5rMEo2w.js → skills-B3LN9tp9.js} +1 -1
  297. package/dist/chunks/{sprites-uNWgVZT6.js → sprites-8JVWnXzp.js} +1 -1
  298. package/dist/chunks/{src-poaoYkuc.js → src-BJM0zMNO.js} +1 -1
  299. package/dist/chunks/{src-Di342QoJ.js → src-KjMLauwe.js} +1 -1
  300. package/dist/chunks/startupProfiler-BmnoJtfF.js +1 -0
  301. package/dist/chunks/{startupProfiler-CAntGAbs.js → startupProfiler-rCtNuhXz.js} +1 -1
  302. package/dist/chunks/{staticRender-C5v46np_.js → staticRender-DboURbK0.js} +1 -1
  303. package/dist/chunks/{stats-D0CJB2HV.js → stats-BDlygx5X.js} +1 -1
  304. package/dist/chunks/status-DlT1tUmc.js +1 -0
  305. package/dist/chunks/{statusNoticeHelpers-Lqf99003.js → statusNoticeHelpers-Cd_LDPvn.js} +1 -1
  306. package/dist/chunks/{tag-BnvWS9HE.js → tag-BLPgXlQZ.js} +1 -1
  307. package/dist/chunks/tasks-Bf1Nf3WX.js +1 -0
  308. package/dist/chunks/{teamHelpers-D8R_gGLb.js → teamHelpers-B-poMJeE.js} +1 -1
  309. package/dist/chunks/teamHelpers-DeQCfdgu.js +1 -0
  310. package/dist/chunks/{teammateModeSnapshot-Bdra3VIJ.js → teammateModeSnapshot-B1_3D1CQ.js} +1 -1
  311. package/dist/chunks/teammateModeSnapshot-BRuKcJNr.js +1 -0
  312. package/dist/chunks/teleport-CSo3PT05.js +1 -0
  313. package/dist/chunks/{templateJobs-BDKGtmr3.js → templateJobs-BVebX2BK.js} +1 -1
  314. package/dist/chunks/{terminalSetup-C1X-sXwp.js → terminalSetup-DHWL0gnz.js} +1 -1
  315. package/dist/chunks/{terminalSetup-Bbvq-9Xl.js → terminalSetup-DZTEKKne.js} +1 -1
  316. package/dist/chunks/{theme-DXv6bV7f.js → theme-BHQSNwSe.js} +1 -1
  317. package/dist/chunks/thinkback-CVYpxAyO.js +1 -0
  318. package/dist/chunks/{thinkback-CMsW7mvG.js → thinkback-DOzxcgMy.js} +1 -1
  319. package/dist/chunks/{thinkback-play-CFdkpzlj.js → thinkback-play-CK1C_F7G.js} +1 -1
  320. package/dist/chunks/{toolEventObserver-DDJV8cvW.js → toolEventObserver-BIjUIh4k.js} +1 -1
  321. package/dist/chunks/{toolEventObserver-CF7T7FBH.js → toolEventObserver-XPorjjtG.js} +1 -1
  322. package/dist/chunks/toolPool-CDEeuQd2.js +1 -0
  323. package/dist/chunks/{toolPool-BJv0sBnR.js → toolPool-hQlvQn-j.js} +1 -1
  324. package/dist/chunks/{trustedDevice-C9nJhhyZ.js → trustedDevice-CyfQd_GU.js} +1 -1
  325. package/dist/chunks/{trustedDevice-C5s2au0k.js → trustedDevice-D-L5uAor.js} +1 -1
  326. package/dist/chunks/{tui-DoOiz2RW.js → tui-C7aBeORE.js} +1 -1
  327. package/dist/chunks/{ultrareviewCommand-BEv1_AS1.js → ultrareviewCommand-rnMsUWTn.js} +2 -2
  328. package/dist/chunks/undercover-BviGW-bQ.js +1 -0
  329. package/dist/chunks/{undercover-DPVt2WN7.js → undercover-ClLYK52H.js} +1 -1
  330. package/dist/chunks/{updateCCB-D-4naIUu.js → updateCCB-pqkACWbs.js} +1 -1
  331. package/dist/chunks/upgrade-DAuhXFVI.js +1 -0
  332. package/dist/chunks/{upgrade-CSld83v7.js → upgrade-DpfZlPyC.js} +1 -1
  333. package/dist/chunks/{upload-DVlE8SRp.js → upload-D98tqZnO.js} +1 -1
  334. package/dist/chunks/{usage-D4Ubnttz.js → usage-BWd5R6DU.js} +1 -1
  335. package/dist/chunks/{usage-B_bY46ep.js → usage-CRquq5_O.js} +1 -1
  336. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-BHi41Ku_.js → useExitOnCtrlCDWithKeybindings-Dkcp6EkA.js} +1 -1
  337. package/dist/chunks/useKeybinding-DOjEx42R.js +1 -0
  338. package/dist/chunks/useMainLoopModel-BZoZdEdj.js +1 -0
  339. package/dist/chunks/{useManagePlugins-B4kcqcyY.js → useManagePlugins-DMY74XAk.js} +1 -1
  340. package/dist/chunks/{useMergedTools-CTQl4cdV.js → useMergedTools-NN58Kguw.js} +1 -1
  341. package/dist/chunks/{useSearchInput-JPayBRPC.js → useSearchInput-CodP_5SB.js} +1 -1
  342. package/dist/chunks/{useSettingsErrors-YTgPxnRZ.js → useSettingsErrors-BRxaYl6B.js} +1 -1
  343. package/dist/chunks/useTerminalSize-mqo2Swmk.js +1 -0
  344. package/dist/chunks/{useVoice-CaBv3G13.js → useVoice-ByU-q_w4.js} +1 -1
  345. package/dist/chunks/{util-Q70qdjeS.js → util-SpgBY5_I.js} +1 -1
  346. package/dist/chunks/utils-CM5oEyAY.js +1 -0
  347. package/dist/chunks/{validatePlugin-6lg9B564.js → validatePlugin-CxCXNV8o.js} +1 -1
  348. package/dist/chunks/{vim-zOsQBIp4.js → vim-ByXlYzf9.js} +1 -1
  349. package/dist/chunks/{voice-DBQevAhk.js → voice-BnLS_SdQ.js} +1 -1
  350. package/dist/chunks/voiceModeEnabled-B3njLfhA.js +1 -0
  351. package/dist/chunks/{voiceModeEnabled-CjBjjeNR.js → voiceModeEnabled-D070o6QK.js} +1 -1
  352. package/dist/chunks/voiceStreamSTT-BkeyhhFJ.js +1 -0
  353. package/dist/chunks/{voiceStreamSTT-B8CTbb_6.js → voiceStreamSTT-vkQ-Aop7.js} +1 -1
  354. package/dist/chunks/{web-tools-CGqBqo07.js → web-tools-1yM0ZBfA.js} +1 -1
  355. package/dist/chunks/{workerRegistry-Bx6FvTZF.js → workerRegistry-7xGv_sNB.js} +1 -1
  356. package/dist/chunks/worktree-UA9gKCwL.js +1 -0
  357. package/dist/chunks/{xml-CVF7dWfi.js → xml-BUaEXGXx.js} +1 -1
  358. package/dist/cli.js +1 -1
  359. package/package.json +1 -1
  360. package/dist/chunks/ApproveApiKey-Cc5SaLqs.js +0 -1
  361. package/dist/chunks/BackgroundTasksDialog-OkUSMj0I.js +0 -2
  362. package/dist/chunks/ClaudeMdExternalIncludesDialog-BbPaorIs.js +0 -1
  363. package/dist/chunks/ConsoleOAuthFlow-Dyv4mI_o.js +0 -1
  364. package/dist/chunks/Dialog-91X6ZGg9.js +0 -1
  365. package/dist/chunks/Doctor-CRrE5Sf4.js +0 -1
  366. package/dist/chunks/Grove-CgX5Fdeh.js +0 -1
  367. package/dist/chunks/ListItem-DCQhApdJ.js +0 -1
  368. package/dist/chunks/MessageSelector-CEvbAZGv.js +0 -3
  369. package/dist/chunks/PluginSettings-D3bQRsge.js +0 -17
  370. package/dist/chunks/QueryEngine-CMcQGyql.js +0 -1
  371. package/dist/chunks/REPL-C9f3ToGu.js +0 -1
  372. package/dist/chunks/RemoteSessionManager-BKD4YmzY.js +0 -2
  373. package/dist/chunks/ResumeConversation-DxqbAKA4.js +0 -1
  374. package/dist/chunks/SearchBox-CkO4rQ-9.js +0 -1
  375. package/dist/chunks/SearchExtraToolsTool-BVAhywUI.js +0 -1
  376. package/dist/chunks/SentryErrorBoundary-M1ipwe1n.js +0 -1
  377. package/dist/chunks/Settings-D5EWYL40.js +0 -2
  378. package/dist/chunks/api-BdbBnz5c.js +0 -1
  379. package/dist/chunks/assistant-BMviqf0l.js +0 -1
  380. package/dist/chunks/auth-ORBmEqnH.js +0 -1
  381. package/dist/chunks/backgroundHousekeeping-BAvSPaZ5.js +0 -1
  382. package/dist/chunks/bridgeConfig-B49H_B9L.js +0 -1
  383. package/dist/chunks/bridgeEnabled-DsG2JvIr.js +0 -1
  384. package/dist/chunks/bridgeMain-DYCShrcV.js +0 -1
  385. package/dist/chunks/caches-BsYvQnWV.js +0 -1
  386. package/dist/chunks/changeDetector-By54zja0.js +0 -1
  387. package/dist/chunks/channelNotification-Cx82K1CD.js +0 -1
  388. package/dist/chunks/clear-BQr2zTyP.js +0 -1
  389. package/dist/chunks/client-BbavFXJZ.js +0 -1
  390. package/dist/chunks/color-DOsgZO2n.js +0 -1
  391. package/dist/chunks/commands-CfwfGt3T.js +0 -1
  392. package/dist/chunks/commitAttribution-CH9C_hoL.js +0 -1
  393. package/dist/chunks/completionCache-BQgiR45Q.js +0 -1
  394. package/dist/chunks/context-noninteractive-DCYvLxWx.js +0 -1
  395. package/dist/chunks/conversation-DYUVAAQt.js +0 -1
  396. package/dist/chunks/conversation-NrAy2em3.js +0 -1
  397. package/dist/chunks/createSession-Czx7_nf6.js +0 -1
  398. package/dist/chunks/cron-g_P3I5uT.js +0 -1
  399. package/dist/chunks/datadog-QSR9B7CZ.js +0 -1
  400. package/dist/chunks/desktop-BN9pHpK_.js +0 -1
  401. package/dist/chunks/earlyInput-D3OhUZ4G.js +0 -1
  402. package/dist/chunks/entry-CJlJ47nP.js +0 -14
  403. package/dist/chunks/envLessBridgeConfig-DSJqg3Ox.js +0 -1
  404. package/dist/chunks/exit-DxY3yJrp.js +0 -1
  405. package/dist/chunks/extra-usage-DaxUQk9I.js +0 -1
  406. package/dist/chunks/extractMemories-B3cTWsph.js +0 -1
  407. package/dist/chunks/fast-CHiQGMBE.js +0 -1
  408. package/dist/chunks/gates-DvjyKZVA.js +0 -1
  409. package/dist/chunks/hooks-DOej0jqp.js +0 -1
  410. package/dist/chunks/inboundAttachments-BBYxcnvj.js +0 -1
  411. package/dist/chunks/initReplBridge-Dt2aQBia.js +0 -1
  412. package/dist/chunks/language-BoKr5ylY.js +0 -1
  413. package/dist/chunks/loadAgentsDir-whRB0phu.js +0 -1
  414. package/dist/chunks/loadPluginHooks-CYZjzxyO.js +0 -1
  415. package/dist/chunks/localSearch-DAwFmV2Y.js +0 -1
  416. package/dist/chunks/login-DOyB64Rv.js +0 -1
  417. package/dist/chunks/logout-DTPo3Myl.js +0 -1
  418. package/dist/chunks/mcp-CVnFM6nR.js +0 -6
  419. package/dist/chunks/mcp-CzfQB8BT.js +0 -1
  420. package/dist/chunks/memory-BdUqEKio.js +0 -1
  421. package/dist/chunks/model-BOc_-7m0.js +0 -1
  422. package/dist/chunks/plugin-8apy_RBT.js +0 -1
  423. package/dist/chunks/pluginStartupCheck-EjLvCXru.js +0 -1
  424. package/dist/chunks/policyLimits-Cdp3QwZ1.js +0 -1
  425. package/dist/chunks/poorMode-DzEL0cu0.js +0 -1
  426. package/dist/chunks/processSlashCommand-v1Rvzxwn.js +0 -6
  427. package/dist/chunks/prompt-DPqKtC0b.js +0 -1
  428. package/dist/chunks/prompt-WjMHPk90.js +0 -1
  429. package/dist/chunks/registry-CBqb7wbi.js +0 -1
  430. package/dist/chunks/sandbox-adapter-DqTuhgud.js +0 -1
  431. package/dist/chunks/searchExtraTools-Brae4wmG.js +0 -1
  432. package/dist/chunks/sessionFileAccessHooks-BXsK8Dwf.js +0 -1
  433. package/dist/chunks/sessionMemory-Bv-AYifm.js +0 -1
  434. package/dist/chunks/sessionMemoryUtils-D-bzdsAT.js +0 -1
  435. package/dist/chunks/sessionObserver-j8D9hidw.js +0 -1
  436. package/dist/chunks/sessionStorage-Cw5ibYWA.js +0 -1
  437. package/dist/chunks/setup-CDxkPTCq.js +0 -2
  438. package/dist/chunks/sink-DFWgcGHX.js +0 -1
  439. package/dist/chunks/sinks-BnkxTOU9.js +0 -1
  440. package/dist/chunks/skillChangeDetector-DwAvG835.js +0 -1
  441. package/dist/chunks/skillLearning-BI2YDG3K.js +0 -1
  442. package/dist/chunks/skillLearning-BZMJRJPp.js +0 -1
  443. package/dist/chunks/startupProfiler-WtUzkMKV.js +0 -1
  444. package/dist/chunks/status-nte1Arzy.js +0 -1
  445. package/dist/chunks/tasks-CEs-pxkC.js +0 -1
  446. package/dist/chunks/teamHelpers-D4vCj2hP.js +0 -1
  447. package/dist/chunks/teammateModeSnapshot-BDJ1JTcl.js +0 -1
  448. package/dist/chunks/teleport-RxTr4aCi.js +0 -1
  449. package/dist/chunks/thinkback-DRJBz3Is.js +0 -1
  450. package/dist/chunks/toolPool-0zCdXfEu.js +0 -1
  451. package/dist/chunks/undercover-DYa00dVv.js +0 -1
  452. package/dist/chunks/upgrade-BHj8ALep.js +0 -1
  453. package/dist/chunks/useKeybinding-DPOUuymz.js +0 -1
  454. package/dist/chunks/useMainLoopModel-D3tJJC3y.js +0 -1
  455. package/dist/chunks/useTerminalSize-Du-EamDN.js +0 -1
  456. package/dist/chunks/utils-Cr-x1Oyd.js +0 -1
  457. package/dist/chunks/voiceModeEnabled-DK6u8Aaj.js +0 -1
  458. package/dist/chunks/voiceStreamSTT-CCkOfmdI.js +0 -1
  459. package/dist/chunks/worktree-DPpgPLLG.js +0 -1
  460. /package/dist/chunks/{InProcessTransport-B9II3BiO.js → InProcessTransport-DW2ed2Hs.js} +0 -0
  461. /package/dist/chunks/{attributionHooks-VGSpz4mk.js → attributionHooks-COqmxGy1.js} +0 -0
  462. /package/dist/chunks/{attributionTrailer-C8uqiLIb.js → attributionTrailer-Nx8I_ZRK.js} +0 -0
  463. /package/dist/chunks/{autoModeDenials-DlO5g6E9.js → autoModeDenials-BDpcFLb7.js} +0 -0
  464. /package/dist/chunks/{bedrockClient-BUmO2U-X.js → bedrockClient-BfPpXPI0.js} +0 -0
  465. /package/dist/chunks/{ccshareResume-DKwcd0Vc.js → ccshareResume-DPP1blaU.js} +0 -0
  466. /package/dist/chunks/{chromeNativeHost-BldB1Zzi.js → chromeNativeHost-DfYuJafI.js} +0 -0
  467. /package/dist/chunks/{claudeDesktop-BqTW_pbB.js → claudeDesktop-CEQCLZmG.js} +0 -0
  468. /package/dist/chunks/{cleanup-rCLlo4w8.js → cleanup-DUVwlFl7.js} +0 -0
  469. /package/dist/chunks/{connectHeadless-ByewVfOb.js → connectHeadless-DutPm1RT.js} +0 -0
  470. /package/dist/chunks/{dangerousBackend-Dkjtndh1.js → dangerousBackend-BDKHrF6i.js} +0 -0
  471. /package/dist/chunks/{earlyInput-CFYRGxau.js → earlyInput-B3U01GAm.js} +0 -0
  472. /package/dist/chunks/{eventLoopStallDetector-bYy0fesH.js → eventLoopStallDetector-MNrFR4OH.js} +0 -0
  473. /package/dist/chunks/{files-Bdr_PQyV.js → files-BGuNpYgH.js} +0 -0
  474. /package/dist/chunks/{fuse-D3B-UE5Y.js → fuse-D7icKomM.js} +0 -0
  475. /package/dist/chunks/{instinctParser-DOtj1Kni.js → instinctParser-BMtAMLSx.js} +0 -0
  476. /package/dist/chunks/{lockfile-C3JsqLpb.js → lockfile-DEaq0BaL.js} +0 -0
  477. /package/dist/chunks/{main-CfkIGrBF.js → main-SFdnVz-G.js} +0 -0
  478. /package/dist/chunks/{observationStore-rLlDwRtG.js → observationStore-Bi1rRKcD.js} +0 -0
  479. /package/dist/chunks/{openaiShared-C-AuktRP.js → openaiShared-BkVgd2rZ.js} +0 -0
  480. /package/dist/chunks/{output-style-B64-Zum6.js → output-style-F8fBWFZo.js} +0 -0
  481. /package/dist/chunks/{parseConnectUrl-DL390ePs.js → parseConnectUrl-CVT_db9n.js} +0 -0
  482. /package/dist/chunks/{poller-BA1jhG3F.js → poller-DhLgWNxJ.js} +0 -0
  483. /package/dist/chunks/{postCommitAttribution-D8MoHFoz.js → postCommitAttribution-Br4g4R6h.js} +0 -0
  484. /package/dist/chunks/{projectContext-Dn7umMp6.js → projectContext-2Z2w8AI8.js} +0 -0
  485. /package/dist/chunks/{renderOptions-Caca3bCd.js → renderOptions-4HxIPoDZ.js} +0 -0
  486. /package/dist/chunks/{rewind-Djt1zU_3.js → rewind-FKh7loMA.js} +0 -0
  487. /package/dist/chunks/{sanitization-Ds6zRQyx.js → sanitization-B-JlvWcf.js} +0 -0
  488. /package/dist/chunks/{sdkHeapDumpMonitor-DLMMNeqo.js → sdkHeapDumpMonitor-DTHI5WbD.js} +0 -0
  489. /package/dist/chunks/{server-DONKdvGc.js → server-BsxW1FVq.js} +0 -0
  490. /package/dist/chunks/{serverBanner-DIyjgIM-.js → serverBanner-DR3GYXpH.js} +0 -0
  491. /package/dist/chunks/{serverLog-D1N5yx8A.js → serverLog-CH1fCGsD.js} +0 -0
  492. /package/dist/chunks/{sessionDataUploader-CsNePsOb.js → sessionDataUploader-BgmJTXQr.js} +0 -0
  493. /package/dist/chunks/{sessionManager-BOmgJd1l.js → sessionManager-mesT4zIQ.js} +0 -0
  494. /package/dist/chunks/{stickers-DDAm--86.js → stickers-B0P4weWp.js} +0 -0
  495. /package/dist/chunks/{udsClient-CBF_cZFW.js → udsClient-B85rNglp.js} +0 -0
  496. /package/dist/chunks/{upstreamproxy-CLf1UaJv.js → upstreamproxy-D-6vdoIJ.js} +0 -0
  497. /package/dist/chunks/{voice-YtzCcIoM.js → voice-BXg-kzte.js} +0 -0
@@ -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{Cc as c,Gc as l,Sc as u,Uc as d,dc as f,lc as p,yc as m}from"./paths-Ci1iwL5Y.js";import{D as ee,E as te,K as h,O as ne,U as re,_ as ie,h as ae}from"./debug-otxXY3j-.js";import{n as oe,t as g}from"./cwd--iizewsn.js";import{a as se,n as _}from"./env-C2A9gV_G.js";import{o as v,s as y}from"./log-DSV4Ht5l.js";import{i as b,o as x}from"./platform-mh9ypxS8.js";import{r as S,t as C}from"./execFileNoThrow-azCkYhmF.js";import{d as ce,o as w,s as le}from"./types-KeqFPzY5.js";import{r as T,t as ue}from"./completionCache-C7hDqIDL.js";import{homedir as E,platform as D}from"os";import{dirname as de,join as O}from"path";import{randomBytes as k}from"crypto";import{copyFile as A,mkdir as j,readFile as M,stat as N,writeFile as P}from"fs/promises";import{pathToFileURL as fe}from"url";function F(){let e=ae().existsSync(O(g(),`CLAUDE.md`)),t=l(g());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 I(){return F().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function L(){p().hasCompletedProjectOnboarding||I()&&u(e=>({...e,hasCompletedProjectOnboarding:!0}))}function R(){u(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),m(),oe(),d(),ie(),z=t(()=>{let e=p();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!I()})}));function pe(e){c(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function V(){c(e=>({...e,appleTerminalSetupInProgress:!1}))}function me(){let e=f();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function H(){return O(E(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function he(){let e=H(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await N(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),pe(t),t}catch(e){return y(e),null}}async function U(){let{inProgress:e,backupPath:t}=me();if(!e)return{status:`no_backup`};if(!t)return V(),{status:`no_backup`};try{await N(t)}catch{return V(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),V(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return y(Error(`Failed to restore Terminal.app settings with: ${e}`)),V(),{status:`failed`,backupPath:t}}}var W=e((()=>{m(),S(),v()}));function ge(){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 _e(){return!_.terminal||!(_.terminal in $)?null:$[_.terminal]??null}function G(e){return r()?`\x1b]8;;${fe(e).href}\x07${e}\x1b]8;;\x07`:e}function K(){return D()===`darwin`&&_.terminal===`Apple_Terminal`||_.terminal===`vscode`||_.terminal===`cursor`||_.terminal===`windsurf`||_.terminal===`alacritty`||_.terminal===`zed`}async function q(e){let t=``;switch(_.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 c(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(_.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:_.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),L(),process.env.USER_TYPE===`ant`&&(t+=await T(e)),t}function ve(){return f().shiftEnterKeyBindingInstalled===!0}function J(){return f().hasUsedBackslashReturn===!0}function ye(){f().hasUsedBackslashReturn||c(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(_.terminal&&_.terminal in $)return e(`Shift+Enter is natively supported in ${$[_.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-KjMLauwe.js";import{Cc as c,Gc as l,Sc as u,Uc as d,dc as f,lc as p,yc as m}from"./paths-4ZWdjPP4.js";import{D as ee,E as te,K as h,O as ne,U as re,_ as ie,h as ae}from"./debug-otxXY3j-.js";import{n as oe,t as g}from"./cwd--iizewsn.js";import{a as se,n as _}from"./env-C2A9gV_G.js";import{o as v,s as y}from"./log-DSV4Ht5l.js";import{i as b,o as x}from"./platform-mh9ypxS8.js";import{r as S,t as C}from"./execFileNoThrow-azCkYhmF.js";import{d as ce,o as w,s as le}from"./types-KeqFPzY5.js";import{r as T,t as ue}from"./completionCache-Br6OwASx.js";import{homedir as E,platform as D}from"os";import{dirname as de,join as O}from"path";import{randomBytes as k}from"crypto";import{copyFile as A,mkdir as j,readFile as M,stat as N,writeFile as P}from"fs/promises";import{pathToFileURL as fe}from"url";function F(){let e=ae().existsSync(O(g(),`CLAUDE.md`)),t=l(g());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 I(){return F().filter(({isCompletable:e,isEnabled:t})=>e&&t).every(({isComplete:e})=>e)}function L(){p().hasCompletedProjectOnboarding||I()&&u(e=>({...e,hasCompletedProjectOnboarding:!0}))}function R(){u(e=>({...e,projectOnboardingSeenCount:e.projectOnboardingSeenCount+1}))}var z,B=e((()=>{n(),m(),oe(),d(),ie(),z=t(()=>{let e=p();return e.hasCompletedProjectOnboarding||e.projectOnboardingSeenCount>=4||process.env.IS_DEMO?!1:!I()})}));function pe(e){c(t=>({...t,appleTerminalSetupInProgress:!0,appleTerminalBackupPath:e}))}function V(){c(e=>({...e,appleTerminalSetupInProgress:!1}))}function me(){let e=f();return{inProgress:e.appleTerminalSetupInProgress??!1,backupPath:e.appleTerminalBackupPath||null}}function H(){return O(E(),`Library`,`Preferences`,`com.apple.Terminal.plist`)}async function he(){let e=H(),t=`${e}.bak`;try{let{code:n}=await C(`defaults`,[`export`,`com.apple.Terminal`,e]);if(n!==0)return null;try{await N(e)}catch{return null}return await C(`defaults`,[`export`,`com.apple.Terminal`,t]),pe(t),t}catch(e){return y(e),null}}async function U(){let{inProgress:e,backupPath:t}=me();if(!e)return{status:`no_backup`};if(!t)return V(),{status:`no_backup`};try{await N(t)}catch{return V(),{status:`no_backup`}}try{let{code:e}=await C(`defaults`,[`import`,`com.apple.Terminal`,t]);return e===0?(await C(`killall`,[`cfprefsd`]),V(),{status:`restored`}):{status:`failed`,backupPath:t}}catch(e){return y(Error(`Failed to restore Terminal.app settings with: ${e}`)),V(),{status:`failed`,backupPath:t}}}var W=e((()=>{m(),S(),v()}));function ge(){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 _e(){return!_.terminal||!(_.terminal in $)?null:$[_.terminal]??null}function G(e){return r()?`\x1b]8;;${fe(e).href}\x07${e}\x1b]8;;\x07`:e}function K(){return D()===`darwin`&&_.terminal===`Apple_Terminal`||_.terminal===`vscode`||_.terminal===`cursor`||_.terminal===`windsurf`||_.terminal===`alacritty`||_.terminal===`zed`}async function q(e){let t=``;switch(_.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 c(e=>[`vscode`,`cursor`,`windsurf`,`alacritty`,`zed`].includes(_.terminal??``)?e.shiftEnterKeyBindingInstalled===!0?e:{...e,shiftEnterKeyBindingInstalled:!0}:_.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled===!0?e:{...e,optionAsMetaKeyInstalled:!0}:e),L(),process.env.USER_TYPE===`ant`&&(t+=await T(e)),t}function ve(){return f().shiftEnterKeyBindingInstalled===!0}function J(){return f().hasUsedBackslashReturn===!0}function ye(){f().hasUsedBackslashReturn||c(e=>({...e,hasUsedBackslashReturn:!0}))}async function be(e,t,n){if(_.terminal&&_.terminal in $)return e(`Shift+Enter is natively supported in ${$[_.terminal]}.
2
2
 
3
3
  No configuration needed. Just use Shift+Enter to add newlines.`),null;if(!K()){let t=_.terminal||`your current terminal`,n=b(),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-C1X-sXwp.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-DHWL0gnz.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-DKmIL5Ku.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-KjMLauwe.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{n as o,t as s}from"./ThemePicker-CYL4C-F-.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};
@@ -0,0 +1 @@
1
+ import{n as e,r as t,t as n}from"./thinkback-DOzxcgMy.js";e();export{n as call,t as playAnimation};
@@ -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{Jc as l,Uc as u}from"./paths-Ci1iwL5Y.js";import{G as d,J as f,U as p,l as m,p as h}from"./debug-otxXY3j-.js";import{r as ee,t as g}from"./execa-CGue6Z3n.js";import{o as te,s as _}from"./log-DSV4Ht5l.js";import{i as ne,o as v}from"./platform-mh9ypxS8.js";import{r as y,t as re}from"./execFileNoThrow-azCkYhmF.js";import{$A as b,Hs as x,Is as S,Js as C,Jy as w,Ky as T,Ms as ie,Vs as ae,Zs as oe,aS as se,gc as ce,hc as E,oS as D,qs as O,tj as k,vs as A,ys as j}from"./loadAgentsDir-C_wFhytF.js";import{n as M,r as N}from"./pluginStartupCheck-DCDWHam6.js";import{a as P,s as F}from"./pluginOperations-gZ-iCmhu.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:b}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await j(),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 d(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(_(e),{success:!1,message:`Could not access animation data: ${f(e).message}`})}try{await L(r)}catch(e){return d(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(_(e),{success:!1,message:`Could not access player script: ${f(e).message}`})}let i=n.get(process.stdout);if(!i)return{success:!1,message:`Failed to access terminal instance`};i.enterAlternateScreen();try{await g(`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=ne();re(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 C(),n=R(),i=z(),a=B(),s=n in t,c=S(a);if(s?c||(r({phase:`installing-marketplace`}),o(`Updating marketplace…`),h(`Refreshing marketplace ${n}`),await oe(n,e=>{o(e)}),x(),E(),h(`Marketplace ${n} refreshed`)):(r({phase:`installing-marketplace`}),h(`Installing marketplace ${i}`),await ae({source:`github`,repo:i},e=>{o(e)}),E(),h(`Marketplace ${n} installed`)),c){let{disabled:e}=await j();if(e.some(e=>e.name===`thinkback`||e.source?.includes(a))){r({phase:`enabling-plugin`}),h(`Enabling plugin ${a}`);let e=await P(a);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);E(),h(`Plugin ${a} enabled`)}}else{r({phase:`installing-plugin`}),h(`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}`)}E(),h(`Plugin ${a} installed`)}r({phase:`ready`}),e()}catch(e){let n=f(e);_(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)(T,{}),(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)(se,{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?(h(`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=>{h(`Checking for ${e}: ${t?`found`:`not found`}`),d(t)})},[o]);function m(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)(T,{}),(0,K.jsx)(i,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:m,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((()=>{ee(),r(),G=t(r(),1),D(),o(),w(),F(),m(),p(),y(),u(),te(),v(),ce(),ie(),O(),k(),A(),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-KjMLauwe.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Jc as l,Uc as u}from"./paths-4ZWdjPP4.js";import{G as d,J as f,U as p,l as m,p as h}from"./debug-otxXY3j-.js";import{r as ee,t as g}from"./execa-CGue6Z3n.js";import{o as te,s as _}from"./log-DSV4Ht5l.js";import{i as ne,o as v}from"./platform-mh9ypxS8.js";import{r as y,t as re}from"./execFileNoThrow-azCkYhmF.js";import{$A as b,Hs as x,Is as S,Js as C,Ky as w,Ms as ie,Vs as ae,Wy as T,Zs as oe,aS as se,gc as ce,hc as E,oS as D,qs as O,tj as k,vs as A,ys as j}from"./loadAgentsDir-CQF8qhne.js";import{n as M,r as N}from"./pluginStartupCheck-B6OdK29Z.js";import{a as P,s as F}from"./pluginOperations-mr4I7Jw9.js";import{join as I}from"path";import{readFile as L}from"fs/promises";function R(){return process.env.USER_TYPE===`ant`?q:b}function z(){return process.env.USER_TYPE===`ant`?J:Y}function B(){return`thinkback@${R()}`}async function V(){let{enabled:e}=await j(),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 d(e)?{success:!1,message:`No animation found. Run /think-back first to generate one.`}:(_(e),{success:!1,message:`Could not access animation data: ${f(e).message}`})}try{await L(r)}catch(e){return d(e)?{success:!1,message:`Player script not found. The player.js file is missing from the thinkback skill.`}:(_(e),{success:!1,message:`Could not access player script: ${f(e).message}`})}let i=n.get(process.stdout);if(!i)return{success:!1,message:`Failed to access terminal instance`};i.enterAlternateScreen();try{await g(`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=ne();re(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 C(),n=R(),i=z(),a=B(),s=n in t,c=S(a);if(s?c||(r({phase:`installing-marketplace`}),o(`Updating marketplace…`),h(`Refreshing marketplace ${n}`),await oe(n,e=>{o(e)}),x(),E(),h(`Marketplace ${n} refreshed`)):(r({phase:`installing-marketplace`}),h(`Installing marketplace ${i}`),await ae({source:`github`,repo:i},e=>{o(e)}),E(),h(`Marketplace ${n} installed`)),c){let{disabled:e}=await j();if(e.some(e=>e.name===`thinkback`||e.source?.includes(a))){r({phase:`enabling-plugin`}),h(`Enabling plugin ${a}`);let e=await P(a);if(!e.success)throw Error(`Failed to enable plugin: ${e.message}`);E(),h(`Plugin ${a} enabled`)}}else{r({phase:`installing-plugin`}),h(`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}`)}E(),h(`Plugin ${a} installed`)}r({phase:`ready`}),e()}catch(e){let n=f(e);_(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)(T,{}),(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)(se,{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?(h(`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=>{h(`Checking for ${e}: ${t?`found`:`not found`}`),d(t)})},[o]);function m(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)(T,{}),(0,K.jsx)(i,{children:`Loading thinkback skill…`})]}):(0,K.jsx)(W,{onDone:e,onAction:m,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((()=>{ee(),r(),G=t(r(),1),D(),o(),w(),F(),m(),p(),y(),u(),te(),v(),ce(),ie(),O(),k(),A(),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 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{$A as t,Ms as n,Rs as r,tj as i}from"./loadAgentsDir-C_wFhytF.js";import{n as a,r as o}from"./thinkback-CMsW7mvG.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:t}`}async function l(){let e=r(),t=c(),n=e.plugins[t];if(!n||n.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=n[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((()=>{n(),i(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{$A as t,Ms as n,Rs as r,tj as i}from"./loadAgentsDir-CQF8qhne.js";import{n as a,r as o}from"./thinkback-DOzxcgMy.js";import{join as s}from"path";function c(){return`thinkback@${process.env.USER_TYPE===`ant`?u:t}`}async function l(){let e=r(),t=c(),n=e.plugins[t];if(!n||n.length===0)return{type:`text`,value:`Thinkback plugin not installed. Run /think-back first to install it.`};let i=n[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((()=>{n(),i(),a(),u=`claude-code-marketplace`,d=`thinkback`}))();export{l as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{l as t,p as n}from"./debug-otxXY3j-.js";import{o as r,s as i}from"./log-DSV4Ht5l.js";import{i as a,t as o}from"./observationStore-rLlDwRtG.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-Cd7V9pES.js`),import(`./featureCheck-CUJ2rPM6.js`),import(`./runtimeObserver-CDMCeww2.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,t,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,t).catch(e=>{n(`skill-learning: recordToolStart error`),i(e)})}catch(e){n(`skill-learning: hook setup error`),i(e)}try{let t=await a();return o&&_(o,e,t,`success`).catch(e=>{n(`skill-learning: recordToolComplete error`),i(e)}),t}catch(t){throw o&&v(o,e,t).catch(e=>{n(`skill-learning: recordToolError error`),i(e)}),t}}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(),t(),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{l as t,p as n}from"./debug-otxXY3j-.js";import{o as r,s as i}from"./log-DSV4Ht5l.js";import{i as a,t as o}from"./observationStore-Bi1rRKcD.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-fS1t-xRh.js`),import(`./featureCheck-CUJ2rPM6.js`),import(`./runtimeObserver-BpRn0RiL.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,t,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,t).catch(e=>{n(`skill-learning: recordToolStart error`),i(e)})}catch(e){n(`skill-learning: hook setup error`),i(e)}try{let t=await a();return o&&_(o,e,t,`success`).catch(e=>{n(`skill-learning: recordToolComplete error`),i(e)}),t}catch(t){throw o&&v(o,e,t).catch(e=>{n(`skill-learning: recordToolError error`),i(e)}),t}}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(),t(),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-DDJV8cvW.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-BIjUIh4k.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-hQlvQn-j.js";e();export{t as applyCoordinatorToolFilter};
@@ -1 +1 @@
1
- import{a as e,n as t}from"./chunk-DR8-3Aex.js";import{_l as n,cl as r,gl as i,ll as a}from"./paths-Ci1iwL5Y.js";import{Ow as o,RE as s,kw as c,zE as l}from"./loadAgentsDir-C_wFhytF.js";import{s as u,u as d}from"./prompt-6ZKyqv6z.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,r){let[i,o]=n(a([...e,...t],`name`),c),s=(e,t)=>e.name.localeCompare(t.name),l=[...o.sort(s),...i.sort(s)];return g&&g.isCoordinatorMode()?p(l):l}var h,g,_=t((()=>{i(),r(),d(),o(),h=[`subscribe_pr_activity`,`unsubscribe_pr_activity`],g=(l(),e(s))}));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{_l as n,cl as r,gl as i,ll as a}from"./paths-4ZWdjPP4.js";import{Ow as o,RE as s,kw as c,zE as l}from"./loadAgentsDir-CQF8qhne.js";import{s as u,u as d}from"./prompt-CogZQuTN.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,r){let[i,o]=n(a([...e,...t],`name`),c),s=(e,t)=>e.name.localeCompare(t.name),l=[...o.sort(s),...i.sort(s)];return g&&g.isCoordinatorMode()?p(l):l}var h,g,_=t((()=>{i(),r(),d(),o(),h=[`subscribe_pr_activity`,`unsubscribe_pr_activity`],g=(l(),e(s))}));export{m as i,_ as n,f as r,p as t};
@@ -1 +1 @@
1
- import{a as e,r as t,t as n}from"./trustedDevice-C5s2au0k.js";e();export{n as clearTrustedDeviceToken,t as enrollTrustedDevice};
1
+ import{a as e,r as t,t as n}from"./trustedDevice-D-L5uAor.js";e();export{n as clearTrustedDeviceToken,t as enrollTrustedDevice};
@@ -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-Ci1iwL5Y.js";import{E as p,O as m,U as h,l as g,p as _,z as v}from"./debug-otxXY3j-.js";import{l as y,u as b}from"./oauth-CdZEzMww.js";import{d as x,f as S}from"./log-DSV4Ht5l.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)){_(`[trusted-device] Gate ${k} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){_(`[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){_(`[trusted-device] No OAuth token, skipping enrollment`);return}let r=o();if(S()){_(`[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){_(`[trusted-device] Enrollment request failed: ${v(e)}`);return}if(c.status!==200&&c.status!==201){_(`[trusted-device] Enrollment failed ${c.status}: ${m(c.data).slice(0,200)}`);return}let l=c.data?.device_token;if(!l||typeof l!=`string`){_(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=r.read();if(!e){_(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=l;let t=r.update(e);if(!t.success){_(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}A.cache?.clear?.(),_(`[trusted-device] Enrolled device_id=${c.data.device_id??`unknown`}`)}catch(e){_(`[trusted-device] Storage write failed: ${v(e)}`)}}catch(e){_(`[trusted-device] Enrollment error: ${v(e)}`)}}var k,A,j=t((()=>{a(),r(),b(),c(),g(),h(),x(),l(),p(),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-4ZWdjPP4.js";import{E as p,O as m,U as h,l as g,p as _,z as v}from"./debug-otxXY3j-.js";import{l as y,u as b}from"./oauth-CdZEzMww.js";import{d as x,f as S}from"./log-DSV4Ht5l.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)){_(`[trusted-device] Gate ${k} is off, skipping enrollment`);return}if(process.env.CLAUDE_TRUSTED_DEVICE_TOKEN){_(`[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){_(`[trusted-device] No OAuth token, skipping enrollment`);return}let r=o();if(S()){_(`[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){_(`[trusted-device] Enrollment request failed: ${v(e)}`);return}if(c.status!==200&&c.status!==201){_(`[trusted-device] Enrollment failed ${c.status}: ${m(c.data).slice(0,200)}`);return}let l=c.data?.device_token;if(!l||typeof l!=`string`){_(`[trusted-device] Enrollment response missing device_token field`);return}try{let e=r.read();if(!e){_(`[trusted-device] Cannot read storage, skipping token persist`);return}e.trustedDeviceToken=l;let t=r.update(e);if(!t.success){_(`[trusted-device] Failed to persist token: ${t.warning??`unknown`}`);return}A.cache?.clear?.(),_(`[trusted-device] Enrolled device_id=${c.data.device_id??`unknown`}`)}catch(e){_(`[trusted-device] Storage write failed: ${v(e)}`)}}catch(e){_(`[trusted-device] Enrollment error: ${v(e)}`)}}var k,A,j=t((()=>{a(),r(),b(),c(),g(),h(),x(),l(),p(),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};
@@ -3,4 +3,4 @@ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWe
3
3
  `)}):{type:`text`,value:`TUI mode was not active.`}}async function m(e){let t=e.trim().toLowerCase();if(t===`status`){let e=d(),t=u(),n=process.env.CLAUDE_CODE_NO_FLICKER,r;return r=n===`1`||n===`true`?`CLAUDE_CODE_NO_FLICKER=1 (forced on via env var)`:n===`0`||n===`false`?`CLAUDE_CODE_NO_FLICKER=0 (forced off via env var)`:`CLAUDE_CODE_NO_FLICKER not set`,{type:`text`,value:[`## TUI Mode Status`,``,` Marker file: ${e?`present`:`absent`} (\`${t}\`)`,` Mode: ${e?`enabled`:`disabled`}`,` Env var: ${r}`,``,`Note: changes take effect on the next session start.`].join(`
4
4
  `)}}return t===`on`?f():t===`off`?p():t===``||t===`toggle`?d()?p():f():{type:`text`,value:[`Unknown subcommand: "${t}"`,``,h].join(`
5
5
  `)}}var h,g,_,v=e((()=>{i(),n(),h=[`Usage: /tui [subcommand]`,``,` (no args) Toggle flicker-free TUI mode (alternate screen buffer)`,` on Enable TUI mode`,` off Disable TUI mode`,` status Show current TUI mode state`,``,`TUI mode uses the ANSI alternate screen buffer (\\x1b[?1049h) so the`,`Claude Code UI occupies a clean full-screen area with no scroll-back`,`flicker. The setting is stored in ~/.claude/.tui-mode and takes effect`,`on the next session start.`,``,`Shell-profile integration (auto-enable on every start):`,` [ -f "$HOME/.claude/.tui-mode" ] && export CLAUDE_CODE_NO_FLICKER=1`,``,`Environment override:`,` CLAUDE_CODE_NO_FLICKER=1 force on (overrides marker)`,` CLAUDE_CODE_NO_FLICKER=0 force off (overrides marker)`].join(`
6
- `),g={type:`local-jsx`,name:`tui`,description:`Manage flicker-free TUI mode. Open actions or run: status, on, off, toggle`,isHidden:!1,isEnabled:()=>!r(),argumentHint:`[status|on|off|toggle]`,bridgeSafe:!0,getBridgeInvocationError:e=>e.trim()?void 0:`Use /tui status/on/off/toggle over Remote Control.`,load:()=>import(`./panel-BYfvo_mR.js`)},_={type:`local`,name:`tui`,description:`Toggle flicker-free TUI mode (alternate screen buffer). Subcommands: on, off, status`,isHidden:!1,isEnabled:()=>r(),supportsNonInteractive:!0,bridgeSafe:!0,load:async()=>({call:m})}}));export{_ as i,v as n,g as r,m as t};
6
+ `),g={type:`local-jsx`,name:`tui`,description:`Manage flicker-free TUI mode. Open actions or run: status, on, off, toggle`,isHidden:!1,isEnabled:()=>!r(),argumentHint:`[status|on|off|toggle]`,bridgeSafe:!0,getBridgeInvocationError:e=>e.trim()?void 0:`Use /tui status/on/off/toggle over Remote Control.`,load:()=>import(`./panel-DU8y_jcf.js`)},_={type:`local`,name:`tui`,description:`Toggle flicker-free TUI mode (alternate screen buffer). Subcommands: on, off, status`,isHidden:!1,isEnabled:()=>r(),supportsNonInteractive:!0,bridgeSafe:!0,load:async()=>({call:m})}}));export{_ as i,v as n,g as r,m as t};
@@ -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-Ci1iwL5Y.js";import{l as g,p as _}from"./debug-otxXY3j-.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{_ as b,a as x,v as S}from"./git-C0IuvuIy.js";import{l as ee,u as te}from"./oauth-CdZEzMww.js";import{r as ne,t as C}from"./execFileNoThrow-azCkYhmF.js";import{Bv as w,Dv as T,Ev as E,Fv as D,Tv as O,aS as k,jv as A,oS as j,wv as M}from"./loadAgentsDir-C_wFhytF.js";import{a as N,r as P}from"./detectRepository-2ICvGD0U.js";import{a as F,l as I,o as L}from"./api-CDmgYrwN.js";import{n as R,t as z}from"./usage-B_bY46ep.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 _(`fetchUltrareviewQuota failed: ${e}`),null}}var V=e((()=>{r(),te(),m(),g(),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 M();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(O).join(`
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 w({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 w({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;A({remoteTaskType:`ultrareview`,session:f,command:p,context:t,isRemoteReview:!0}),y(`tengu_review_remote_launched`,{});let h=E(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(),T(),m(),N(),ne(),S(),D(),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)(k,{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),j(),s(),Y=l()}));function re(e){return e.map(e=>e.type===`text`?e.text:``).filter(Boolean).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-KjMLauwe.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-4ZWdjPP4.js";import{l as g,p as _}from"./debug-otxXY3j-.js";import{n as v,r as y}from"./analytics-DqMQntaB.js";import{_ as b,a as x,v as S}from"./git-C0IuvuIy.js";import{l as ee,u as te}from"./oauth-CdZEzMww.js";import{r as ne,t as C}from"./execFileNoThrow-azCkYhmF.js";import{Cv as w,Nv as T,Rv as E,Sv as D,Tv as O,aS as k,kv as A,oS as j,wv as M}from"./loadAgentsDir-CQF8qhne.js";import{a as N,r as P}from"./detectRepository-2ICvGD0U.js";import{a as F,l as I,o as L}from"./api-DMbWqJlK.js";import{n as R,t as z}from"./usage-CRquq5_O.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 _(`fetchUltrareviewQuota failed: ${e}`),null}}var V=e((()=>{r(),te(),m(),g(),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
+ `)}`}]}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 E({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 E({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;A({remoteTaskType:`ultrareview`,session:f,command:p,context:t,isRemoteReview:!0}),y(`tengu_review_remote_launched`,{});let h=M(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(),O(),m(),N(),ne(),S(),T(),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)(k,{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),j(),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};
@@ -0,0 +1 @@
1
+ import{i as e,n as t}from"./undercover-ClLYK52H.js";t();export{e as shouldShowUndercoverAutoNotice};
@@ -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{dc as r,yc as i}from"./paths-Ci1iwL5Y.js";import{l as a,s as o}from"./commitAttribution-iKd8bTOI.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{dc as r,yc as i}from"./paths-4ZWdjPP4.js";import{l as a,s as o}from"./commitAttribution-ClSlXMPG.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
@@ -1,4 +1,4 @@
1
- import{In as e,Ln as t}from"./src-Di342QoJ.js";import{l as n,p as r}from"./debug-otxXY3j-.js";import{n as i,o as a}from"./process-DMKLUQIO.js";import{n as o,r as s}from"./execFileNoThrow-azCkYhmF.js";import{SE as c,wE as l}from"./loadAgentsDir-C_wFhytF.js";import{n as u,t as d}from"./distRoot-BNg_iO5-.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(),n(),u(),s(),l(),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.7.1`}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():(r(`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-KjMLauwe.js";import{l as n,p as r}from"./debug-otxXY3j-.js";import{n as i,o as a}from"./process-DMKLUQIO.js";import{n as o,r as s}from"./execFileNoThrow-azCkYhmF.js";import{SE as c,wE as l}from"./loadAgentsDir-CQF8qhne.js";import{n as u,t as d}from"./distRoot-BNg_iO5-.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(),n(),u(),s(),l(),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.8.0`}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():(r(`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 c(1);return}if(i===t||S(t,i)){a(e.green(`ccb is up to date (${t})`)+`
@@ -0,0 +1 @@
1
+ import{n as e,t}from"./upgrade-DpfZlPyC.js";e();export{t as call};
@@ -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-Ci1iwL5Y.js";import{o as c,s as l}from"./log-DSV4Ht5l.js";import{n as u,t as d}from"./browser-Bt-ckCaU.js";import{r as f,t as p}from"./login-C1uE6Pg9.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-KjMLauwe.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-4ZWdjPP4.js";import{o as c,s as l}from"./log-DSV4Ht5l.js";import{n as u,t as d}from"./browser-Bt-ckCaU.js";import{r as f,t as p}from"./login-CxbcJk9_.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 +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,O as s,l as c,p as l}from"./debug-otxXY3j-.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{n as f,t as p}from"./lazySchema-B0QShMaQ.js";import{a as m,r as h,t as g}from"./bridgeConfig-pjDV5Z2l.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){l(`[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 o=`${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(o,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=${s(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(),o(),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,O as s,l as c,p as l}from"./debug-otxXY3j-.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{n as f,t as p}from"./lazySchema-B0QShMaQ.js";import{a as m,r as h,t as g}from"./bridgeConfig-e0MGfed6.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){l(`[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 o=`${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(o,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=${s(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(),o(),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{t}from"./jsx-runtime-D-D469L8.js";import{n,t as r}from"./Settings-D5EWYL40.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-C2vEJjLx.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}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-Ci1iwL5Y.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-4ZWdjPP4.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,o as t}from"./chunk-DR8-3Aex.js";import{H as n,M as r,Rn as i,nt as a,t as o}from"./src-Di342QoJ.js";import{t as s}from"./useKeybinding-DPOUuymz.js";var c=e((()=>{o()}));function l(e,t,i,a=!0){let{exit:o}=n(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>i??o,[i,o]),d=r(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=r(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:a}),s}var u,d=e((()=>{u=t(i(),1),o(),c()}));function f(e,t,n){return l(a,t,e,n)}var p=e((()=>{s(),d()}));export{f as n,c as r,p as t};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{H as n,M as r,Rn as i,nt as a,t as o}from"./src-KjMLauwe.js";import{t as s}from"./useKeybinding-DOjEx42R.js";var c=e((()=>{o()}));function l(e,t,i,a=!0){let{exit:o}=n(),[s,c]=(0,u.useState)({pending:!1,keyName:null}),l=(0,u.useMemo)(()=>i??o,[i,o]),d=r(e=>c({pending:e,keyName:`Ctrl-C`}),l),f=r(e=>c({pending:e,keyName:`Ctrl-D`}),l),p=(0,u.useCallback)(()=>{t?.()||d()},[d,t]),m=(0,u.useCallback)(()=>{f()},[f]);return e((0,u.useMemo)(()=>({"app:interrupt":p,"app:exit":m}),[p,m]),{context:`Global`,isActive:a}),s}var u,d=e((()=>{u=t(i(),1),o(),c()}));function f(e,t,n){return l(a,t,e,n)}var p=e((()=>{s(),d()}));export{f as n,c as r,p as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./src-KjMLauwe.js";var n=e((()=>{t()}));export{n as t};
@@ -0,0 +1 @@
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n}from"./src-KjMLauwe.js";import{Br as r,Pr as i,S as a,w as o,wr as s}from"./paths-4ZWdjPP4.js";import{lC as c,uC as l}from"./loadAgentsDir-CQF8qhne.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{J as n,U as r,l as i,p as a}from"./debug-otxXY3j-.js";import{n as o,r as s}from"./analytics-DqMQntaB.js";import{F as c,P as l}from"./git-C0IuvuIy.js";import{o as u,s as d}from"./log-DSV4Ht5l.js";import{b as f,x as p}from"./teammate-CbskW5G9.js";import{Ac as m,Bh as h,Gh as g,Hh as _,Oc as v,Wh as y,fC as b,jc as x,kc as S,lC as C,nT as w,oC as T,oy as E,sC as D,sy as O,tT as k,uC as A,vs as j,ys as M}from"./loadAgentsDir-C_wFhytF.js";import{n as N,r as P}from"./pluginFlagging-BiTDVP10.js";import{t as F}from"./pluginBlocklist-B1LVo0j_.js";var I=e(t(),1);T(),o(),h(),C(),p(),i(),l(),r(),u(),m(),S(),E(),y(),k(),P(),j();function L({enabled:e=!0}={}){let t=b(),r=A(e=>e.plugins.needsRefresh),{addNotification:i}=D(),o=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:r}=await M();await F();let o=N();Object.keys(o).length>0&&i({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let s=[],c=[];try{s=await v()}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 x()}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 O()}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 w(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 g(e,r);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);_(),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}}}),a(`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),a(`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,i]);(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||i({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,r,i])}export{L as t};
1
+ import{o as e}from"./chunk-DR8-3Aex.js";import{Rn as t}from"./src-KjMLauwe.js";import{J as n,U as r,l as i,p as a}from"./debug-otxXY3j-.js";import{n as o,r as s}from"./analytics-DqMQntaB.js";import{F as c,P as l}from"./git-C0IuvuIy.js";import{o as u,s as d}from"./log-DSV4Ht5l.js";import{b as f,x as p}from"./teammate-CbskW5G9.js";import{Ac as m,Bh as h,Gh as g,Hh as _,Oc as v,Wh as y,ay as b,fC as x,iy as S,jc as C,kc as w,lC as T,nT as E,oC as D,sC as O,tT as k,uC as A,vs as j,ys as M}from"./loadAgentsDir-CQF8qhne.js";import{n as N,r as P}from"./pluginFlagging-DyzxZolj.js";import{t as F}from"./pluginBlocklist-C9XwbFSo.js";var I=e(t(),1);D(),o(),h(),T(),p(),i(),l(),r(),u(),m(),w(),S(),y(),k(),P(),j();function L({enabled:e=!0}={}){let t=x(),r=A(e=>e.plugins.needsRefresh),{addNotification:i}=O(),o=(0,I.useCallback)(async()=>{try{let{enabled:e,disabled:n,errors:r}=await M();await F();let o=N();Object.keys(o).length>0&&i({key:`plugin-delisted-flagged`,text:`Plugins flagged. Check /plugins`,color:`warning`,priority:`high`});let s=[],c=[];try{s=await v()}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 C()}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 b()}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 E(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 g(e,r);return t&&(e.lspServers=t),t?Object.keys(t).length:0}))).reduce((e,t)=>e+t,0);_(),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}}}),a(`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),a(`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,i]);(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||i({key:`plugin-reload-pending`,text:`Plugins changed. Run /reload-plugins to activate.`,color:`suggestion`,priority:`low`})},[e,r,i])}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{$u as r,Yu as i}from"./loadAgentsDir-C_wFhytF.js";import{i as a,n as o}from"./toolPool-BJv0sBnR.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,i(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),r(),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-KjMLauwe.js";import{Zu as r,qu as i}from"./loadAgentsDir-CQF8qhne.js";import{i as a,n as o}from"./toolPool-hQlvQn-j.js";function s(e,t,n){return(0,c.useMemo)(()=>a(e,i(n,t),n.mode),[e,t,n,!1,!1])}var c,l=e((()=>{c=t(n(),1),r(),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{AS as s,FS as c,IS as l,LS as u,OS as d,PS as f,RS as p,kS as m,zS as h}from"./loadAgentsDir-C_wFhytF.js";import{t as g}from"./useTerminalSize-Du-EamDN.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:g=[],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=d.fromText(T,w,D);if(!(n.ctrl&&g.includes(n.key.toLowerCase()))){if(_(n)||l(),v(n)||u(),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();f(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();f(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=a.deleteToLineStart();f(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=a.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=a.offset,n=a.insert(e);c(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=h();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;p(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(),s(),g(),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-KjMLauwe.js";import{AS as s,FS as c,IS as l,LS as u,OS as d,PS as f,RS as p,kS as m,zS as h}from"./loadAgentsDir-CQF8qhne.js";import{t as g}from"./useTerminalSize-mqo2Swmk.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:g=[],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=d.fromText(T,w,D);if(!(n.ctrl&&g.includes(n.key.toLowerCase()))){if(_(n)||l(),v(n)||u(),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();f(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();f(t,`append`),E(e.text),O(e.offset);return}case`u`:{let{cursor:e,killed:t}=a.deleteToLineStart();f(t,`prepend`),E(e.text),O(e.offset);return}case`w`:{let{cursor:e,killed:t}=a.deleteWordBefore();f(t,`prepend`),E(e.text),O(e.offset);return}case`y`:{let e=m();if(e.length>0){let t=a.offset,n=a.insert(e);c(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=h();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;p(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(),s(),g(),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{cx as a,lx as o,oC as s,sC as c,vC as l,yC as u}from"./loadAgentsDir-C_wFhytF.js";function d(){let{addNotification:e,removeNotification:t}=c(),[n,i]=(0,f.useState)(()=>{let{errors:e}=a();return e});return u((0,f.useCallback)(()=>{let{errors:e}=a();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()),s(),i(),o(),l(),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-KjMLauwe.js";import{W as r,cn as i}from"./state-sIHsFpDu.js";import{cx as a,lx as o,oC as s,sC as c,vC as l,yC as u}from"./loadAgentsDir-CQF8qhne.js";function d(){let{addNotification:e,removeNotification:t}=c(),[n,i]=(0,f.useState)(()=>{let{errors:e}=a();return e});return u((0,f.useCallback)(()=>{let{errors:e}=a();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()),s(),i(),o(),l(),p=`settings-errors`}));export{d as n,m as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{t}from"./src-KjMLauwe.js";var n=e((()=>{t()}));export{n 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-Ci1iwL5Y.js";import{J as f,U as p,l as m,p as h}from"./debug-otxXY3j-.js";import{n as g,r as _}from"./analytics-DqMQntaB.js";import{i as v,v as y}from"./git-C0IuvuIy.js";import{o as b,s as x}from"./log-DSV4Ht5l.js";import{i as ee,s as S}from"./intl-CLeE9DsD.js";import{n as te,t as C}from"./sleep-C6koP5Ka.js";import{SC as w,wC as ne}from"./loadAgentsDir-C_wFhytF.js";import{i as re,n as T,r as E}from"./voiceStreamSTT-B8CTbb_6.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),h(`[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 h(`[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:h(`[doubao-asr] Session started`);break;case a.VAD_START:h(`[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:h(`[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((()=>{m(),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),m=(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++,m.current&&(clearTimeout(m.current),m.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(){h(`[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;h(`[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,h(`[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();h(`[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?(h(`[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-YtzCcIoM.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&&(h(`[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`&&(h(`[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||(h(`[voice] Focus gained, starting recording session`),b.current=!0,K(),G())};J?t():import(`./voice-YtzCcIoM.js`).then(e=>{J=e,t()})}else I||(C.current=!1,s.current===`recording`&&(h(`[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){h(`[voice] Recording not available: ${t.reason??`unknown`}`),p.current?.(t.reason??`Audio recording is not available.`),z(),R(`idle`);return}h(`[voice] Starting recording session, connecting voice stream`),L(e=>e.voiceError?{...e,voiceError:null}:e);let n=[];if(h(`[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,h(`[voice] onTranscript: isFinal=${String(t)} text="${e}"`),t&&e.trim())b.current?(h(`[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(),h(`[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()){h(`[voice] ignoring onError from stale session: ${r}`);return}if(A.current!==t){h(`[voice] ignoring stale onError from superseded attempt: ${r}`);return}if(!i?.fatal&&!a&&s.current===`recording`&&!D.current){D.current=!0,h(`[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;h(`[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){h(`[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){h(`[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`?(h(`[voice] handleKeyEvent: idle, starting recording session immediately`),K(),y.current=setTimeout((e,t,n,r,i)=>{e.current=null,t.current===`recording`&&!n.current&&(h(`[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(),m(),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-KjMLauwe.js";import{cn as c,ut as l}from"./state-sIHsFpDu.js";import{Ka as u,oo as d}from"./paths-4ZWdjPP4.js";import{J as f,U as p,l as m,p as h}from"./debug-otxXY3j-.js";import{n as g,r as _}from"./analytics-DqMQntaB.js";import{i as v,v as y}from"./git-C0IuvuIy.js";import{o as b,s as x}from"./log-DSV4Ht5l.js";import{i as ee,s as S}from"./intl-CLeE9DsD.js";import{n as te,t as C}from"./sleep-C6koP5Ka.js";import{SC as w,wC as ne}from"./loadAgentsDir-CQF8qhne.js";import{i as re,n as T,r as E}from"./voiceStreamSTT-vkQ-Aop7.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),h(`[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 h(`[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:h(`[doubao-asr] Session started`);break;case a.VAD_START:h(`[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:h(`[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((()=>{m(),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),m=(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++,m.current&&(clearTimeout(m.current),m.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(){h(`[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;h(`[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,h(`[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();h(`[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?(h(`[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-BXg-kzte.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&&(h(`[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`&&(h(`[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||(h(`[voice] Focus gained, starting recording session`),b.current=!0,K(),G())};J?t():import(`./voice-BXg-kzte.js`).then(e=>{J=e,t()})}else I||(C.current=!1,s.current===`recording`&&(h(`[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){h(`[voice] Recording not available: ${t.reason??`unknown`}`),p.current?.(t.reason??`Audio recording is not available.`),z(),R(`idle`);return}h(`[voice] Starting recording session, connecting voice stream`),L(e=>e.voiceError?{...e,voiceError:null}:e);let n=[];if(h(`[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,h(`[voice] onTranscript: isFinal=${String(t)} text="${e}"`),t&&e.trim())b.current?(h(`[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(),h(`[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()){h(`[voice] ignoring onError from stale session: ${r}`);return}if(A.current!==t){h(`[voice] ignoring stale onError from superseded attempt: ${r}`);return}if(!i?.fatal&&!a&&s.current===`recording`&&!D.current){D.current=!0,h(`[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;h(`[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){h(`[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){h(`[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`?(h(`[voice] handleKeyEvent: idle, starting recording session immediately`),K(),y.current=setTimeout((e,t,n,r,i)=>{e.current=null,t.current===`recording`&&!n.current&&(h(`[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(),m(),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-Ci1iwL5Y.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{Iy as u,Ly as d,cC as f,lC as p}from"./loadAgentsDir-C_wFhytF.js";import{t as m}from"./WelcomeV2-BijS6i2Z.js";import{t as h}from"./useManagePlugins-B4kcqcyY.js";import{n as g,t as _}from"./MCPConnectionManager-D5a9ysw2.js";import{n as v}from"./onChangeAppState-BkRihYau.js";import{cwd as y}from"process";var b=e(t(),1);r(),d(),c(),g(),p(),s();var x=a();async function S(e){l(`tengu_setup_token_command`,{});let t=!o(),{ConsoleOAuthFlow:r}=await import(`./ConsoleOAuthFlow-Dyv4mI_o.js`);await new Promise(a=>{e.render((0,x.jsx)(f,{onChangeAppState:v,children:(0,x.jsx)(u,{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-CRrE5Sf4.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)(f,{children:(0,x.jsx)(u,{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-CDxkPTCq.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-CuVHbwyW.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-KjMLauwe.js";import{t as a}from"./jsx-runtime-D-D469L8.js";import{cn as o,on as s}from"./paths-4ZWdjPP4.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{Fy as u,Py as d,cC as f,lC as p}from"./loadAgentsDir-CQF8qhne.js";import{t as m}from"./WelcomeV2-5rgKm4Mz.js";import{t as h}from"./useManagePlugins-DMY74XAk.js";import{n as g,t as _}from"./MCPConnectionManager-CsPizxTx.js";import{n as v}from"./onChangeAppState-B3d5iy6T.js";import{cwd as y}from"process";var b=e(t(),1);r(),u(),c(),g(),p(),s();var x=a();async function S(e){l(`tengu_setup_token_command`,{});let t=!o(),{ConsoleOAuthFlow:r}=await import(`./ConsoleOAuthFlow-BmGziW64.js`);await new Promise(a=>{e.render((0,x.jsx)(f,{onChangeAppState:v,children:(0,x.jsx)(d,{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-DohPtIKu.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)(f,{children:(0,x.jsx)(d,{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-n3Ixr_gs.js`);await n(y(),`default`,!1,!1,void 0,!1);let{install:r}=await import(`./install-pxH_HR1p.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{Fp as e,jp as t}from"./loadAgentsDir-CQF8qhne.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{as as a,cs as o,ls as s,ss as c,us as l}from"./paths-Ci1iwL5Y.js";import{B as u,D as d,E as f,G as p,O as ee,U as m,_ as h,h as g,l as _,p as v,z as y}from"./debug-otxXY3j-.js";import{o as te,s as b}from"./log-DSV4Ht5l.js";import{AA as x,QA as S,XA as C,ZA as w,dj as T,fj as ne,hj as re,kA as E,mj as ie}from"./loadAgentsDir-C_wFhytF.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(E(),H)}async function I(){let e=F();try{let t=d(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return v(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return v(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return v(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(v(`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>W?(v(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(v(`Install counts cache has malformed entries`),null)}catch(e){return u(e)!==`ENOENT`&&v(`Failed to load install counts cache: ${y(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=E();await g().mkdir(r),await P(n,ee(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),v(`Install counts cache saved successfully`)}catch(e){b(e);try{await N(n)}catch{}}}async function R(){v(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return S(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw S(`install_counts`,U,`failure`,performance.now()-e,C(t)),t}}async function z(){let e=await I();if(e){v(`Using cached install counts`),S(`install_counts`,U,`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 R();await L({version:V,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 b(e),v(`Failed to fetch install counts: ${y(e)}`),null}}function B(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 V,H,U,W,G=e((()=>{n(),_(),m(),h(),te(),f(),w(),x(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=g(),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=se(t.startsWith(`~`)?t.replace(/^~/,ae()):t),r;try{r=await n.stat(e)}catch(t){let n=u(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((()=>{m(),h()}));function le(e){let t=D.basename(e),n=D.basename(D.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=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=u(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=d(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(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 s=c().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. 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=D.resolve(e),a;try{a=await k(i,{encoding:`utf-8`})}catch(e){let t=u(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let c;try{c=d(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(c&&typeof c==`object`){let e=c;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 l=s().extend({plugins:r(o().strict())}).strict().safeParse(c);if(l.success||t.push(...q(l.error)),l.success){let e=l.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=D.dirname(i),a=D.basename(r)===`.claude-plugin`?D.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=d(await k(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=re(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${y(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 k(e,{encoding:`utf-8`})}catch(t){return u(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${y(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=d(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=a().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 A(e,{withFileTypes:!0})}catch(e){let t=u(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.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`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.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 k(r,{encoding:`utf-8`})}catch(n){if(p(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${y(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(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!p(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.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=d(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(u(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(),m(),ne(),f(),ie(),l(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z 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{as as a,cs as o,ls as s,ss as c,us as l}from"./paths-4ZWdjPP4.js";import{B as u,D as d,E as f,G as p,O as ee,U as m,_ as h,h as g,l as _,p as v,z as y}from"./debug-otxXY3j-.js";import{o as te,s as b}from"./log-DSV4Ht5l.js";import{AA as x,QA as S,XA as C,ZA as w,dj as T,fj as ne,hj as re,kA as E,mj as ie}from"./loadAgentsDir-CQF8qhne.js";import{homedir as ae}from"os";import*as D from"path";import{join as oe,resolve as se}from"path";import{randomBytes as O}from"crypto";import{readFile as k,readdir as A,rename as j,stat as M,unlink as N,writeFile as P}from"fs/promises";function F(){return oe(E(),H)}async function I(){let e=F();try{let t=d(await k(e,{encoding:`utf-8`}));if(typeof t!=`object`||!t||!(`version`in t)||!(`fetchedAt`in t)||!(`counts`in t))return v(`Install counts cache has invalid structure`),null;let n=t;if(n.version!==V)return v(`Install counts cache version mismatch (got ${n.version}, expected ${V})`),null;if(typeof n.fetchedAt!=`string`||!Array.isArray(n.counts))return v(`Install counts cache has invalid structure`),null;let r=new Date(n.fetchedAt).getTime();return Number.isNaN(r)?(v(`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>W?(v(`Install counts cache is stale (>24h old)`),null):{version:n.version,fetchedAt:n.fetchedAt,counts:n.counts}:(v(`Install counts cache has malformed entries`),null)}catch(e){return u(e)!==`ENOENT`&&v(`Failed to load install counts cache: ${y(e)}`),null}}async function L(e){let t=F(),n=`${t}.${O(8).toString(`hex`)}.tmp`;try{let r=E();await g().mkdir(r),await P(n,ee(e,null,2),{encoding:`utf-8`,mode:384}),await j(n,t),v(`Install counts cache saved successfully`)}catch(e){b(e);try{await N(n)}catch{}}}async function R(){v(`Fetching install counts from ${U}`);let e=performance.now();try{let n=await t.get(U,{timeout:1e4});if(!n.data?.plugins||!Array.isArray(n.data.plugins))throw Error(`Invalid response format from install counts API`);return S(`install_counts`,U,`success`,performance.now()-e),n.data.plugins}catch(t){throw S(`install_counts`,U,`failure`,performance.now()-e,C(t)),t}}async function z(){let e=await I();if(e){v(`Using cached install counts`),S(`install_counts`,U,`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 R();await L({version:V,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 b(e),v(`Failed to fetch install counts: ${y(e)}`),null}}function B(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 V,H,U,W,G=e((()=>{n(),_(),m(),h(),te(),f(),w(),x(),V=1,H=`install-counts-cache.json`,U=`https://raw.githubusercontent.com/anthropics/claude-plugins-official/refs/heads/stats/stats/plugin-installs.json`,W=1440*60*1e3}));async function K(e){let t=e.trim(),n=g(),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=se(t.startsWith(`~`)?t.replace(/^~/,ae()):t),r;try{r=await n.stat(e)}catch(t){let n=u(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((()=>{m(),h()}));function le(e){let t=D.basename(e),n=D.basename(D.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=D.resolve(e),i;try{i=await k(r,{encoding:`utf-8`})}catch(e){let t=u(e),n;return n=t===`ENOENT`?`File not found: ${r}`:t===`EISDIR`?`Path is not a file: ${r}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:r,fileType:`plugin`}}let a;try{a=d(i)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(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 s=c().strict().safeParse(o);if(s.success||t.push(...q(s.error)),s.success){let e=s.data;/^[a-z0-9]+(-[a-z0-9]+)*$/.test(e.name)||n.push({path:`name`,message:`Plugin name "${e.name}" is not kebab-case. 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=D.resolve(e),a;try{a=await k(i,{encoding:`utf-8`})}catch(e){let t=u(e),n;return n=t===`ENOENT`?`File not found: ${i}`:t===`EISDIR`?`Path is not a file: ${i}`:`Failed to read file: ${y(e)}`,{success:!1,errors:[{path:`file`,message:n,code:t}],warnings:[],filePath:i,fileType:`marketplace`}}let c;try{c=d(a)}catch(e){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(e)}`}],warnings:[],filePath:i,fileType:`marketplace`}}if(c&&typeof c==`object`){let e=c;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 l=s().extend({plugins:r(o().strict())}).strict().safeParse(c);if(l.success||t.push(...q(l.error)),l.success){let e=l.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=D.dirname(i),a=D.basename(r)===`.claude-plugin`?D.dirname(r):r;for(let[t,r]of e.plugins.entries()){if(!r.version||typeof r.source!=`string`||!r.source.startsWith(`./`))continue;let e=D.join(a,r.source,`.claude-plugin`,`plugin.json`),i;try{let t=d(await k(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=re(o)}catch(t){return r.push({path:`frontmatter`,message:`YAML frontmatter failed to parse: ${y(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 k(e,{encoding:`utf-8`})}catch(t){return u(t)===`ENOENT`?{success:!0,errors:[],warnings:[],filePath:e,fileType:`hooks`}:{success:!1,errors:[{path:`file`,message:`Failed to read file: ${y(t)}`}],warnings:[],filePath:e,fileType:`hooks`}}let n;try{n=d(t)}catch(t){return{success:!1,errors:[{path:`json`,message:`Invalid JSON syntax: ${y(t)}. At runtime this breaks the entire plugin load.`}],warnings:[],filePath:e,fileType:`hooks`}}let r=a().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 A(e,{withFileTypes:!0})}catch(e){let t=u(e);if(t===`ENOENT`||t===`ENOTDIR`)return[];throw e}if(t)return n.filter(e=>e.isDirectory()).map(t=>D.join(e,t.name,`SKILL.md`));let r=[];for(let t of n){let n=D.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`,D.join(e,`skills`)],[`agent`,D.join(e,`agents`)],[`command`,D.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 k(r,{encoding:`utf-8`})}catch(n){if(p(n))continue;t.push({success:!1,errors:[{path:`file`,message:`Failed to read: ${y(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(D.join(e,`hooks`,`hooks.json`));return(r.errors.length>0||r.warnings.length>0)&&t.push(r),t}async function pe(e){let t=D.resolve(e),n=null;try{n=await M(t)}catch(e){if(!p(e))throw e}if(n?.isDirectory()){let e=await X(D.join(t,`.claude-plugin`,`marketplace.json`));if(e.errors[0]?.code!==`ENOENT`)return e;let n=await Y(D.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=d(await k(t,{encoding:`utf-8`}));if(Array.isArray(n.plugins))return X(e)}catch(e){if(u(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(),m(),ne(),f(),ie(),l(),$=new Set([`category`,`source`,`tags`,`strict`,`id`])}));export{K as a,G as c,ce as i,pe as n,B as o,fe as r,z as s,me as t};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,dc as n,yc as r}from"./paths-Ci1iwL5Y.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";var o;e((()=>{i(),r(),o=async()=>{let e=n().editorMode||`normal`;e===`emacs`&&(e=`normal`);let r=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:r})),a(`tengu_editor_mode_changed`,{mode:r,source:`command`}),{type:`text`,value:`Editor mode set to ${r}. ${r===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,dc as n,yc as r}from"./paths-4ZWdjPP4.js";import{n as i,r as a}from"./analytics-DqMQntaB.js";var o;e((()=>{i(),r(),o=async()=>{let e=n().editorMode||`normal`;e===`emacs`&&(e=`normal`);let r=e===`normal`?`vim`:`normal`;return t(e=>({...e,editorMode:r})),a(`tengu_editor_mode_changed`,{mode:r,source:`command`}),{type:`text`,value:`Editor mode set to ${r}. ${r===`vim`?`Use Escape key to toggle between INSERT and NORMAL modes.`:`Using standard (readline) keyboard bindings.`}`}}}))();export{o as call};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,Ka as n,dc as r,lo as i,oo as a,yc as o}from"./paths-Ci1iwL5Y.js";import{n as s,r as c}from"./analytics-DqMQntaB.js";import{AT as l,BA as u,WA as d,jT as f}from"./loadAgentsDir-C_wFhytF.js";import{n as p,r as m}from"./voiceModeEnabled-CjBjjeNR.js";import{n as h,t as g}from"./useVoice-CaBv3G13.js";var _,v;e((()=>{g(),f(),s(),o(),u(),a(),p(),_=2,v=async e=>{if(!m())return{type:`text`,value:`Voice mode is not available.`};let a=n(),o=a.voiceEnabled===!0,s=e?.trim().toLowerCase();if(o&&s===`doubao`)return i(`userSettings`,{voiceProvider:`doubao`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(d.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Doubao ASR. Hold ${l(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o&&s===`anthropic`)return i(`userSettings`,{voiceProvider:`anthropic`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(d.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Anthropic STT. Hold ${l(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o)return i(`userSettings`,{voiceEnabled:!1}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(d.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!1}),{type:`text`,value:`Voice mode disabled.`});let u=s===`doubao`?`doubao`:`anthropic`,{isVoiceStreamAvailable:f}=await import(`./voiceStreamSTT-CCkOfmdI.js`),{checkRecordingAvailability:p}=await import(`./voice-YtzCcIoM.js`),g=await p();if(!g.available)return{type:`text`,value:g.reason??`Voice mode is not available in this environment.`};if(u!==`doubao`&&!f())return{type:`text`,value:`Voice mode requires a Claude.ai account. Please run /login to sign in.`};let{checkVoiceDependencies:v,requestMicrophonePermission:y}=await import(`./voice-YtzCcIoM.js`),b=await v();if(!b.available)return{type:`text`,value:`No audio recording tool found.${b.installCommand?`\nInstall audio recording tools? Run: ${b.installCommand}`:`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,Ka as n,dc as r,lo as i,oo as a,yc as o}from"./paths-4ZWdjPP4.js";import{n as s,r as c}from"./analytics-DqMQntaB.js";import{AT as l,BA as u,WA as d,jT as f}from"./loadAgentsDir-CQF8qhne.js";import{n as p,r as m}from"./voiceModeEnabled-D070o6QK.js";import{n as h,t as g}from"./useVoice-ByU-q_w4.js";var _,v;e((()=>{g(),f(),s(),o(),u(),a(),p(),_=2,v=async e=>{if(!m())return{type:`text`,value:`Voice mode is not available.`};let a=n(),o=a.voiceEnabled===!0,s=e?.trim().toLowerCase();if(o&&s===`doubao`)return i(`userSettings`,{voiceProvider:`doubao`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(d.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Doubao ASR. Hold ${l(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o&&s===`anthropic`)return i(`userSettings`,{voiceProvider:`anthropic`}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(d.notifyChange(`userSettings`),{type:`text`,value:`Voice mode switched to Anthropic STT. Hold ${l(`voice:pushToTalk`,`Chat`,`Space`)} to record.`});if(o)return i(`userSettings`,{voiceEnabled:!1}).error?{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`}:(d.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!1}),{type:`text`,value:`Voice mode disabled.`});let u=s===`doubao`?`doubao`:`anthropic`,{isVoiceStreamAvailable:f}=await import(`./voiceStreamSTT-BkeyhhFJ.js`),{checkRecordingAvailability:p}=await import(`./voice-BXg-kzte.js`),g=await p();if(!g.available)return{type:`text`,value:g.reason??`Voice mode is not available in this environment.`};if(u!==`doubao`&&!f())return{type:`text`,value:`Voice mode requires a Claude.ai account. Please run /login to sign in.`};let{checkVoiceDependencies:v,requestMicrophonePermission:y}=await import(`./voice-BXg-kzte.js`),b=await v();if(!b.available)return{type:`text`,value:`No audio recording tool found.${b.installCommand?`\nInstall audio recording tools? Run: ${b.installCommand}`:`
2
2
  Install SoX manually for audio recording.`}`};if(!await y()){let e;return e=process.platform===`win32`?`Settings → Privacy → Microphone`:process.platform===`linux`?`your system's audio settings`:`System Settings → Privacy & Security → Microphone`,{type:`text`,value:`Microphone access is denied. To enable it, go to ${e}, then run /voice again.`}}if(i(`userSettings`,{voiceEnabled:!0,...u===`doubao`?{voiceProvider:`doubao`}:{}}).error)return{type:`text`,value:`Failed to update settings. Check your settings file for syntax errors.`};d.notifyChange(`userSettings`),c(`tengu_voice_toggled`,{enabled:!0});let x=l(`voice:pushToTalk`,`Chat`,`Space`),S=``,C=u===`doubao`?`Doubao ASR`:`Anthropic`;if(u!==`doubao`){let e=h(a.language),n=r(),i=n.voiceLangHintLastLanguage!==e.code,o=i?0:n.voiceLangHintShownCount??0,s=!e.fellBackFrom&&o<_;e.fellBackFrom?S=` Note: "${e.fellBackFrom}" is not a supported dictation language; using English. Change it via /config.`:s&&(S=` Dictation language: ${e.code} (/config to change).`),(i||s)&&t(t=>({...t,voiceLangHintShownCount:o+ +!!s,voiceLangHintLastLanguage:e.code}))}return{type:`text`,value:`Voice mode enabled (${C}). Hold ${x} to record.${S}`}}}))();export{v as call};
@@ -0,0 +1 @@
1
+ import{a as e,i as t,n}from"./voiceModeEnabled-D070o6QK.js";n();export{t as isVoiceGrowthBookEnabled,e as isVoiceModeEnabled};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-Ci1iwL5Y.js";function o(){return!r(`tengu_amber_quartz_disabled`,!1)}function s(){return i()?!!t()?.accessToken:!1}function c(){return s()&&o()}function l(){return o()}var u=e((()=>{n(),a()}));export{c as a,o as i,u as n,l as r,s as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Jt as t,S as n,_ as r,cn as i,on as a}from"./paths-4ZWdjPP4.js";function o(){return!r(`tengu_amber_quartz_disabled`,!1)}function s(){return i()?!!t()?.accessToken:!1}function c(){return s()&&o()}function l(){return o()}var u=e((()=>{n(),a()}));export{c as a,o as i,u as n,l as r,s as t};
@@ -0,0 +1 @@
1
+ import{i as e,r as t}from"./voiceStreamSTT-vkQ-Aop7.js";t();export{e as isVoiceStreamAvailable};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-Ci1iwL5Y.js";import{D as d,E as f,O as p,l as m,p as h}from"./debug-otxXY3j-.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-DSV4Ht5l.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CF7ZDxaW.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return h(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&h(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),h(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let f=`${c}${k}?${l.toString()}`;h(`[voice_stream] Connecting to ${f}`);let m={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(f,typeof Bun<`u`?{headers:m,proxy:C(f),tls:_||void 0}:{headers:m,agent:b(f),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){h(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}h(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){h(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}h(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(h(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{h(`[voice_stream] WebSocket connected`),w=!0,h(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(h(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();h(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=d(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(h(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(h(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{h(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;h(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??p(r);h(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(h(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){h(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){h(`[voice_stream] unexpected-response fired with 101; ignoring`);return}h(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),h(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),f(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,r as n}from"./wrapper-D5qL1aQL.js";import{Jt as r,Pt as i,S as a,St as o,_ as s,cn as c,on as l,wt as u}from"./paths-4ZWdjPP4.js";import{D as d,E as f,O as p,l as m,p as h}from"./debug-otxXY3j-.js";import{l as g,u as _}from"./oauth-CdZEzMww.js";import{o as v,s as y}from"./log-DSV4Ht5l.js";import{c as b,g as x,h as S,l as C,u as w}from"./proxy-CF7ZDxaW.js";function T(){if(!c())return!1;let e=r();return e!==null&&e.accessToken!==null}async function E(e,t){await i();let a=r();if(!a?.accessToken)return h(`[voice_stream] No OAuth token available`),null;let c=process.env.VOICE_STREAM_BASE_URL||g().BASE_API_URL.replace(`https://`,`wss://`).replace(`http://`,`ws://`);process.env.VOICE_STREAM_BASE_URL&&h(`[voice_stream] Using VOICE_STREAM_BASE_URL override: ${process.env.VOICE_STREAM_BASE_URL}`);let l=new URLSearchParams({encoding:`linear16`,sample_rate:`16000`,channels:`1`,endpointing_ms:`300`,utterance_end_ms:`1000`,language:t?.language??`en`}),u=s(`tengu_cobalt_frost`,!1);if(u&&(l.set(`use_conversation_engine`,`true`),l.set(`stt_provider`,`deepgram-nova3`),h(`[voice_stream] Nova 3 gate enabled (tengu_cobalt_frost)`)),t?.keyterms?.length)for(let e of t.keyterms)l.append(`keyterms`,e);let f=`${c}${k}?${l.toString()}`;h(`[voice_stream] Connecting to ${f}`);let m={Authorization:`Bearer ${a.accessToken}`,"User-Agent":o(),"x-app":`cli`},_=S(),v=new n(f,typeof Bun<`u`?{headers:m,proxy:C(f),tls:_||void 0}:{headers:m,agent:b(f),..._}),x=null,w=!1,T=!1,E=!1,M=!1,N=null,P=null,F={send(e){if(v.readyState===n.OPEN){if(T){h(`[voice_stream] Dropping audio chunk after CloseStream: ${String(e.length)} bytes`);return}h(`[voice_stream] Sending audio chunk: ${String(e.length)} bytes`),v.send(Buffer.from(e))}},finalize(){return E||T?Promise.resolve(`ws_already_closed`):(E=!0,new Promise(t=>{let r=setTimeout(()=>N?.(`safety_timeout`),j.safety),i=setTimeout(()=>N?.(`no_data_timeout`),j.noData);if(P=()=>{clearTimeout(i),P=null},N=n=>{if(clearTimeout(r),clearTimeout(i),N=null,P=null,I){h(`[voice_stream] Promoting unreported interim before ${n} resolve`);let t=I;I=``,e.onTranscript(t,!0)}h(`[voice_stream] Finalize resolved via ${n}`),t(n)},v.readyState===n.CLOSED||v.readyState===n.CLOSING){N(`ws_already_closed`);return}setTimeout(()=>{T=!0,v.readyState===n.OPEN&&(h(`[voice_stream] Sending CloseStream (finalize)`),v.send(O))},0)}))},close(){T=!0,x&&(clearInterval(x),x=null),w=!1,v.readyState===n.OPEN&&v.close()},isConnected(){return w&&v.readyState===n.OPEN}};v.on(`open`,()=>{h(`[voice_stream] WebSocket connected`),w=!0,h(`[voice_stream] Sending initial KeepAlive`),v.send(D),x=setInterval(e=>{e.readyState===n.OPEN&&(h(`[voice_stream] Sending periodic KeepAlive`),e.send(D))},A,v),e.onReady(F)});let I=``;return v.on(`message`,t=>{let n=t.toString();h(`[voice_stream] Message received (${String(n.length)} chars): ${n.slice(0,200)}`);let r;try{r=d(n)}catch{return}switch(r.type){case`TranscriptText`:{let t=r.data;if(h(`[voice_stream] TranscriptText: "${t??``}"`),T&&P?.(),t){if(!u&&I){let n=I.trimStart(),r=t.trimStart();n&&r&&!r.startsWith(n)&&!n.startsWith(r)&&(h(`[voice_stream] Auto-finalizing previous segment (new segment detected): "${I}"`),e.onTranscript(I,!0))}I=t,e.onTranscript(t,!1)}break}case`TranscriptEndpoint`:{h(`[voice_stream] TranscriptEndpoint received, lastTranscriptText="${I}"`);let t=I;I=``,t&&e.onTranscript(t,!0),T&&N?.(`post_closestream_endpoint`);break}case`TranscriptError`:{let t=r.description??r.error_code??`unknown transcription error`;h(`[voice_stream] TranscriptError: ${t}`),E||e.onError(t);break}case`error`:{let t=r.message??p(r);h(`[voice_stream] Server error: ${t}`),E||e.onError(t);break}default:break}}),v.on(`close`,(t,n)=>{let r=n?.toString()??``;if(h(`[voice_stream] WebSocket closed: code=${String(t)} reason="${r}"`),w=!1,x&&(clearInterval(x),x=null),I){h(`[voice_stream] Promoting unreported interim transcript to final on close`);let t=I;I=``,e.onTranscript(t,!0)}N?.(`ws_close`),!E&&!M&&t!==1e3&&t!==1005&&e.onError(`Connection closed: code ${String(t)}${r?` — ${r}`:``}`),e.onClose()}),v.on(`unexpected-response`,(t,n)=>{let r=n.statusCode??0;if(r===101){h(`[voice_stream] unexpected-response fired with 101; ignoring`);return}h(`[voice_stream] Upgrade rejected: status=${String(r)} cf-mitigated=${String(n.headers[`cf-mitigated`])} cf-ray=${String(n.headers[`cf-ray`])}`),M=!0,n.resume(),t.destroy(),!E&&e.onError(`WebSocket upgrade rejected with HTTP ${String(r)}`,{fatal:r>=400&&r<500})}),v.on(`error`,t=>{y(t),h(`[voice_stream] WebSocket error: ${t.message}`),E||e.onError(`Voice stream connection error: ${t.message}`)}),F}var D,O,k,A,j,M=e((()=>{t(),_(),l(),m(),u(),v(),x(),w(),f(),a(),D=`{"type":"KeepAlive"}`,O=`{"type":"CloseStream"}`,k=`/api/ws/speech_to_text/voice_stream`,A=8e3,j={safety:5e3,noData:1500}}));export{T as i,E as n,M as r,j as t};