claude-code-best 2.6.10 → 2.6.12

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 (484) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DYIf4o0g.js → AddWorkspaceDirectory-LhW1QZFL.js} +1 -1
  2. package/dist/chunks/{App-Bw4stCcv.js → App-DYMNbl0d.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-B1XCQNW6.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-CNBKF9de.js → ApproveApiKey-Bi2Iq_gN.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-DU5OOPwq.js → AssistantSessionChooser-Dv6yYR3s.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-qS15If6H.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-UOkwRr3W.js → BypassPermissionsModeDialog-Bhjd2F2o.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-6UL2_PCg.js → ClaudeInChromeOnboarding-CxBS5xZY.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-DBfmH_dG.js → ClaudeMdExternalIncludesDialog-CiANFiNV.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-nuKXhM2t.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-C8FzG3uF.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-B-ySC5nP.js → DesktopHandoff-BSpzQF0U.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-DZMsKuak.js → DevChannelsDialog-B2xqlZtS.js} +1 -1
  14. package/dist/chunks/{DiffDialog-CeYcqIIw.js → DiffDialog-XmOsaUeN.js} +2 -2
  15. package/dist/chunks/Doctor-C6FXh99k.js +1 -0
  16. package/dist/chunks/Doctor-DLx7Z_sA.js +3 -0
  17. package/dist/chunks/{ExitFlow-gMv13EpM.js → ExitFlow-CHDj7fv7.js} +2 -2
  18. package/dist/chunks/{Feedback-CGRlFB5g.js → Feedback-CUjTJbIh.js} +2 -2
  19. package/dist/chunks/Grove-B8ZQOflC.js +1 -0
  20. package/dist/chunks/{Grove-CnHyPepC.js → Grove-fenDMHVw.js} +1 -1
  21. package/dist/chunks/{HybridTransport-CiY6jyhx.js → HybridTransport-CP63usH9.js} +1 -1
  22. package/dist/chunks/{ITermBackend-CG-a4QYW.js → ITermBackend-Bp_3qpix.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-umJZVrz-.js → InvalidConfigDialog-CgD7HSg0.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-C62kuhHc.js → InvalidSettingsDialog-pYMa5Fp4.js} +1 -1
  25. package/dist/chunks/MCPConnectionManager-ip1xShU_.js +1 -0
  26. package/dist/chunks/{McpParsingWarnings-DW0d9Lsb.js → McpParsingWarnings-DhobExFM.js} +1 -1
  27. package/dist/chunks/MessageSelector-B2X6zrsb.js +3 -0
  28. package/dist/chunks/Messages-CmsZIA66.js +11 -0
  29. package/dist/chunks/{Onboarding-BRePz3fJ.js → Onboarding-BaoLhLiT.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-DEZsyI6y.js → OverageCreditUpsell-DnLMobAh.js} +1 -1
  31. package/dist/chunks/{PluginSettings-CuZtXDaS.js → PluginSettings-BetzicTb.js} +3 -3
  32. package/dist/chunks/{PromptInputFooterSuggestions-BrpVQJVn.js → PromptInputFooterSuggestions-D-1hRFAD.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-BlGRpX1Q.js → PromptInputHelpMenu-DnQj3Hpq.js} +1 -1
  34. package/dist/chunks/QueryEngine-BwvqdZVN.js +1 -0
  35. package/dist/chunks/REPL-CCgaPc2g.js +1 -0
  36. package/dist/chunks/{REPL-D-t0XQx2.js → REPL-zS2s1JnV.js} +34 -34
  37. package/dist/chunks/{RemoteCallout-DvOZQWoG.js → RemoteCallout-B9hClSYj.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-BlIA65dM.js → RemoteSessionManager-BgLIvi8Z.js} +2 -2
  39. package/dist/chunks/ResumeConversation-DAMMGHGc.js +1 -0
  40. package/dist/chunks/{SSETransport-CIvM80QS.js → SSETransport-CD7R7FfS.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-CP6G9xhL.js +1 -0
  42. package/dist/chunks/{SentryErrorBoundary-BK2HjzVw.js → SentryErrorBoundary-6dQQW6kh.js} +1 -1
  43. package/dist/chunks/SentryErrorBoundary-B2e3QmqR.js +1 -0
  44. package/dist/chunks/Settings-DgW58gbY.js +2 -0
  45. package/dist/chunks/{TeleportProgress-BFlMrsa_.js → TeleportProgress-D_USKi0I.js} +1 -1
  46. package/dist/chunks/TeleportRepoMismatchDialog-C1-iWmRP.js +1 -0
  47. package/dist/chunks/{TeleportResumeWrapper-CHfeyo9J.js → TeleportResumeWrapper-BX9nUVsC.js} +1 -1
  48. package/dist/chunks/{ThemePicker-a5n2EKgk.js → ThemePicker-C0JghXSS.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-Ct9v-J78.js → TmuxBackend-BxPiis2l.js} +1 -1
  50. package/dist/chunks/{TrustDialog-e1nyM-Fp.js → TrustDialog-BZD-KGrA.js} +1 -1
  51. package/dist/chunks/{ValidationErrorsList-BHCepjdO.js → ValidationErrorsList-CTFdkGiH.js} +1 -1
  52. package/dist/chunks/{WelcomeV2-BnyziLbm.js → WelcomeV2-C7F1y8zh.js} +1 -1
  53. package/dist/chunks/{WindowsTerminalBackend-Dw6qjsBu.js → WindowsTerminalBackend-DLxmmXo4.js} +2 -2
  54. package/dist/chunks/{add-dir-CjnY5yfR.js → add-dir-Dhv9aEca.js} +1 -1
  55. package/dist/chunks/{agentDisplay-Dfx-axK9.js → agentDisplay-BoBFMmGh.js} +1 -1
  56. package/dist/chunks/{agents-lM-cxA8_.js → agents-Bt9kYpgi.js} +1 -1
  57. package/dist/chunks/{agents-CICHEOOq.js → agents-CdsfzK3E.js} +7 -7
  58. package/dist/chunks/{ant-JgExUpwJ.js → ant-Bo6XJuE9.js} +1 -1
  59. package/dist/chunks/api-CRPzfBL5.js +1 -0
  60. package/dist/chunks/{api-CClu711S.js → api-CslgFoHj.js} +1 -1
  61. package/dist/chunks/{assistant-D1XefK1z.js → assistant--L1Ll62G.js} +1 -1
  62. package/dist/chunks/assistant-DypEudjI.js +1 -0
  63. package/dist/chunks/{assistant-Bih7t52W.js → assistant-od6Nf6EJ.js} +1 -1
  64. package/dist/chunks/auth-BaaTtn3M.js +1 -0
  65. package/dist/chunks/{auth-CU6ArDos.js → auth-yKNn60lZ.js} +1 -1
  66. package/dist/chunks/{autoMode-DM9eDMmT.js → autoMode-C4b9u7WQ.js} +6 -6
  67. package/dist/chunks/{autonomy-DUfXLZfq.js → autonomy-7nZpCyNC.js} +12 -12
  68. package/dist/chunks/{autonomy-CZCZ9wlx.js → autonomy-rMsykUYN.js} +1 -1
  69. package/dist/chunks/{autonomyPanel-kUZwcjfu.js → autonomyPanel-j0q1dMDj.js} +1 -1
  70. package/dist/chunks/backgroundHousekeeping-DGAYPsK9.js +1 -0
  71. package/dist/chunks/backgroundHousekeeping-KCpR7i2h.js +17 -0
  72. package/dist/chunks/{branch-Ac3HXXs2.js → branch-GL4WvvLa.js} +2 -2
  73. package/dist/chunks/{bridge-Drt-UmFp.js → bridge-BVzpVEsr.js} +2 -2
  74. package/dist/chunks/bridgeConfig-B1OTOi0O.js +1 -0
  75. package/dist/chunks/{bridgeConfig-GQzZVhuF.js → bridgeConfig-C110hgnb.js} +1 -1
  76. package/dist/chunks/{bridgeEnabled-CDoXbe3S.js → bridgeEnabled-DrW-kkAr.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-Zk2slA-p.js +1 -0
  78. package/dist/chunks/bridgeMain-C-MUVlCX.js +68 -0
  79. package/dist/chunks/bridgeMain-L1ScqrgM.js +1 -0
  80. package/dist/chunks/{bridgeMessaging-gRm2WcIE.js → bridgeMessaging-DobCpZGY.js} +1 -1
  81. package/dist/chunks/{btw-B2Tq2ewP.js → btw-CSDRs-n8.js} +1 -1
  82. package/dist/chunks/{buddy-v00QHFZ6.js → buddy-D3Owb2U5.js} +1 -1
  83. package/dist/chunks/{bypassPermissionsKillswitch-DAr5U3Ep.js → bypassPermissionsKillswitch-B_5qku-e.js} +1 -1
  84. package/dist/chunks/caches-CpgRh__l.js +1 -0
  85. package/dist/chunks/{caches-DHUk9KMo.js → caches-Di_WVMtD.js} +2 -2
  86. package/dist/chunks/{ccrClient-1Q3C_3_r.js → ccrClient-CWH1f8Nk.js} +1 -1
  87. package/dist/chunks/changeDetector-DEStinxa.js +1 -0
  88. package/dist/chunks/channelNotification-DxAS15nL.js +1 -0
  89. package/dist/chunks/{channelNotification-d08DSK9u.js → channelNotification-Y5fNpq-B.js} +1 -1
  90. package/dist/chunks/{chrome-CKo0_n71.js → chrome-Cgl-Sq1y.js} +1 -1
  91. package/dist/chunks/clear-Dja0RB_p.js +1 -0
  92. package/dist/chunks/client-DuWXRBa0.js +1 -0
  93. package/dist/chunks/color-tvVGbuuv.js +1 -0
  94. package/dist/chunks/commands-ElmJnxRE.js +1 -0
  95. package/dist/chunks/{commitAttribution-BJvmLsVe.js → commitAttribution-CedoNRL0.js} +1 -1
  96. package/dist/chunks/commitAttribution-D6vYpAMS.js +1 -0
  97. package/dist/chunks/compact-BwsLImWZ.js +3 -0
  98. package/dist/chunks/{companion-C2CBSYiF.js → companion-C3hWMSgF.js} +1 -1
  99. package/dist/chunks/{config-Cht2x9n9.js → config-BHCIawwx.js} +1 -1
  100. package/dist/chunks/{config-DnWYFpDc.js → config-Dh0QGc4B.js} +1 -1
  101. package/dist/chunks/{context-CDz9HqRT.js → context-CSHiU4LG.js} +1 -1
  102. package/dist/chunks/{context-noninteractive-BUIf4IMX.js → context-noninteractive-CKFY_j1P.js} +2 -2
  103. package/dist/chunks/context-noninteractive-DirFwn0d.js +1 -0
  104. package/dist/chunks/conversation-DfIv8Jzc.js +1 -0
  105. package/dist/chunks/conversation-Dyb5kfil.js +1 -0
  106. package/dist/chunks/{copy-BgHTb1Z0.js → copy-BSyDpOx5.js} +2 -2
  107. package/dist/chunks/{createSSHSession-C_mpeqPy.js → createSSHSession-PfzB7zZR.js} +1 -1
  108. package/dist/chunks/{createSession-kVJBXQlZ.js → createSession-Bk6r39b1.js} +1 -1
  109. package/dist/chunks/createSession-DdsaDZoq.js +1 -0
  110. package/dist/chunks/{cronJitterConfig-SI7bYvJj.js → cronJitterConfig-BFVNIkjD.js} +3 -3
  111. package/dist/chunks/crossProjectResume-CdoH1cwH.js +40 -0
  112. package/dist/chunks/{daemon-VYRit6Aq.js → daemon-CCtZ9wY3.js} +1 -1
  113. package/dist/chunks/{datadog-Bd9AgZT-.js → datadog-By0GhDXI.js} +1 -1
  114. package/dist/chunks/datadog-CTRRIaBJ.js +1 -0
  115. package/dist/chunks/{desktop-BeUj2fqu.js → desktop-BV6CI329.js} +1 -1
  116. package/dist/chunks/{diff-BzgXDp1o.js → diff-qDuBFv-P.js} +1 -1
  117. package/dist/chunks/{doctor-HCOexiL5.js → doctor-BtTsew-G.js} +1 -1
  118. package/dist/chunks/earlyInput-RoVleNEN.js +1 -0
  119. package/dist/chunks/{effort-BaJU_k2K.js → effort-DSpAOBeU.js} +2 -2
  120. package/dist/chunks/{entry-BoXZIfxW.js → entry-CYCQJU7M.js} +8 -8
  121. package/dist/chunks/envLessBridgeConfig-B3o52JMX.js +1 -0
  122. package/dist/chunks/{envLessBridgeConfig-CnR1E53G.js → envLessBridgeConfig-BKs6Mk4e.js} +1 -1
  123. package/dist/chunks/exit-BgaIlRuS.js +1 -0
  124. package/dist/chunks/{export-p85q3g8t.js → export-BOQCWSMm.js} +1 -1
  125. package/dist/chunks/{exportRenderer-CUqd8PZM.js → exportRenderer-B-2J3ocI.js} +1 -1
  126. package/dist/chunks/extra-usage-BLVbAE1O.js +1 -0
  127. package/dist/chunks/{extra-usage-pPprHqwq.js → extra-usage-S4WYpDn5.js} +1 -1
  128. package/dist/chunks/{extra-usage-core-B9Fy8_RP.js → extra-usage-core-Sq4JALS7.js} +1 -1
  129. package/dist/chunks/{extra-usage-noninteractive-B4vaWh0y.js → extra-usage-noninteractive-BlJVTTwe.js} +1 -1
  130. package/dist/chunks/{extraUsage-CEHCMe7l.js → extraUsage-CMJ1LEPS.js} +1 -1
  131. package/dist/chunks/extractMemories-BpN0fQF-.js +1 -0
  132. package/dist/chunks/fast-B8a-zz4X.js +1 -0
  133. package/dist/chunks/{fast-CiSIZ5FI.js → fast-OzVowRYW.js} +1 -1
  134. package/dist/chunks/{feedback-C2QLdCfW.js → feedback-BZet1Qu_.js} +1 -1
  135. package/dist/chunks/{firstPartyEventLogger-CozFbFD9.js → firstPartyEventLogger-DeytNcUC.js} +1 -1
  136. package/dist/chunks/{flushGate-LXr8ynSz.js → flushGate-CeFJrqgK.js} +1 -1
  137. package/dist/chunks/{gates-BGfvIJXl.js → gates-Be4ovdxj.js} +1 -1
  138. package/dist/chunks/gates-WmmZ-8JT.js +1 -0
  139. package/dist/chunks/gemini-DExthrur.js +1 -0
  140. package/dist/chunks/{generateRecap-CLla3Ymz.js → generateRecap-BIFrnTIe.js} +1 -1
  141. package/dist/chunks/{generateSessionName-DF4I7gr2.js → generateSessionName-DlC0lhSv.js} +1 -1
  142. package/dist/chunks/{githubRepoPathMapping-C_5RCW_Z.js → githubRepoPathMapping-BKB2G52c.js} +1 -1
  143. package/dist/chunks/grok-BNxCseLh.js +1 -0
  144. package/dist/chunks/{growthbook-C39e6Byf.js → growthbook-B3_MJJ45.js} +1 -1
  145. package/dist/chunks/{heapdump-BRj4tC1y.js → heapdump-sPWpCjXq.js} +1 -1
  146. package/dist/chunks/{help-fH9LNwox.js → help-BuUi6cM0.js} +1 -1
  147. package/dist/chunks/{hooks-D22Uu3Vs.js → hooks-5vDlGpNp.js} +2 -2
  148. package/dist/chunks/hooks-CVJA4uQu.js +1 -0
  149. package/dist/chunks/{hostAdapter-CbXytx4y.js → hostAdapter-BfBHV5nj.js} +1 -1
  150. package/dist/chunks/{ide-DM5Tw70v.js → ide-DvUftvRn.js} +2 -2
  151. package/dist/chunks/inboundAttachments-CQyeysIk.js +1 -0
  152. package/dist/chunks/{inboundAttachments-2QIORKsd.js → inboundAttachments-CiF42Eku.js} +1 -1
  153. package/dist/chunks/initReplBridge-Bzg5Gx97.js +1 -0
  154. package/dist/chunks/{insights-B6ogyLuv.js → insights-CvwFcRQt.js} +64 -64
  155. package/dist/chunks/{install-github-app-CQ7vkhIX.js → install-github-app-DxxG2VlZ.js} +2 -2
  156. package/dist/chunks/{install-slack-app-By9_5YS7.js → install-slack-app-Bc5m1UFG.js} +1 -1
  157. package/dist/chunks/{install-DimDiHha.js → install-tclc0QHM.js} +1 -1
  158. package/dist/chunks/{instrumentation-DbKu2GCL.js → instrumentation-Dn_FDn6G.js} +3 -3
  159. package/dist/chunks/{job-D_DoFtev.js → job-ssZ2ESAX.js} +1 -1
  160. package/dist/chunks/{keybindings-DYRBv1bg.js → keybindings-DVZlobLM.js} +2 -2
  161. package/dist/chunks/{lang-CAMxxG9F.js → lang-BQ--zwb1.js} +1 -1
  162. package/dist/chunks/language-BM5numKK.js +1 -0
  163. package/dist/chunks/{language-CoHgN7rh.js → language-CcxtaVJA.js} +1 -1
  164. package/dist/chunks/{launchAgentsPlatform-9P8K66ku.js → launchAgentsPlatform-CLwlpK5C.js} +1 -1
  165. package/dist/chunks/{launchAutofixPr-BbsqqUMA.js → launchAutofixPr-vGLlC4Jm.js} +3 -3
  166. package/dist/chunks/{launchLocalMemory-K55Yo6JM.js → launchLocalMemory-DJ4pR8a2.js} +2 -2
  167. package/dist/chunks/{launchLocalVault-rrd1Q7jP.js → launchLocalVault-Cl7Dds3W.js} +3 -3
  168. package/dist/chunks/{launchMemoryStores-DMZ8GNQj.js → launchMemoryStores-Czk-a1P6.js} +1 -1
  169. package/dist/chunks/{launchOnboarding-Duz_huXl.js → launchOnboarding-66gN_781.js} +1 -1
  170. package/dist/chunks/{launchSchedule-7VlG_3M6.js → launchSchedule-Tx5efcfv.js} +1 -1
  171. package/dist/chunks/{launchSkillStore-CcJL8RT0.js → launchSkillStore-BGPd1KCD.js} +1 -1
  172. package/dist/chunks/{launchTeleport-C8h_4F_L.js → launchTeleport-DzXrNn2h.js} +2 -2
  173. package/dist/chunks/{launchVault-Bm1EeT2x.js → launchVault-C5djf6XO.js} +1 -1
  174. package/dist/chunks/{loadAgentsDir-HZ19tmOZ.js → loadAgentsDir-DaApSWNv.js} +807 -764
  175. package/dist/chunks/loadAgentsDir-_BePoo3r.js +1 -0
  176. package/dist/chunks/loadPluginHooks-GENkKqO8.js +1 -0
  177. package/dist/chunks/{localSearch-4cz5ia5a.js → localSearch-BQuH38SB.js} +1 -1
  178. package/dist/chunks/localSearch-BSR9byCr.js +1 -0
  179. package/dist/chunks/{login-D6ywctRr.js → login-C64M5OdJ.js} +1 -1
  180. package/dist/chunks/login-dkrrvdEl.js +1 -0
  181. package/dist/chunks/{logoV2Utils-jaFn88oE.js → logoV2Utils-D6ceZmK0.js} +1 -1
  182. package/dist/chunks/logout-BITK5qkB.js +1 -0
  183. package/dist/chunks/{magicDocs-DHGtJq0K.js → magicDocs-KPodA4bi.js} +2 -2
  184. package/dist/chunks/{main-Bv4AvaJk.js → main-wb2H0Xbt.js} +48 -48
  185. package/dist/chunks/{mappers-qcXgNBi5.js → mappers-D54WYYhL.js} +1 -1
  186. package/dist/chunks/mcp-Bgeq8jbd.js +6 -0
  187. package/dist/chunks/mcp-CJvRg7ft.js +2 -0
  188. package/dist/chunks/mcp-Ddvz5we7.js +1 -0
  189. package/dist/chunks/{mcpServer-Do9XTs2J.js → mcpServer-VYXTzAFl.js} +1 -1
  190. package/dist/chunks/{mcpServer-DcSto-Od.js → mcpServer-d0863d94.js} +1 -1
  191. package/dist/chunks/memory-BNyVCuw9.js +1 -0
  192. package/dist/chunks/mode-D_L3DNsz.js +2 -0
  193. package/dist/chunks/model-DevOJk2A.js +1 -0
  194. package/dist/chunks/{model-DwVGG0mc.js → model-Dy_oUo2C.js} +1 -1
  195. package/dist/chunks/{onChangeAppState-CHYSALjM.js → onChangeAppState-GPs10FBm.js} +1 -1
  196. package/dist/chunks/{openai-Brj68CWD.js → openai-C0CrRENO.js} +3 -3
  197. package/dist/chunks/{overageCreditGrant-D5X6-TcP.js → overageCreditGrant-DCiIf_SF.js} +1 -1
  198. package/dist/chunks/{panel-Bz_8td5D.js → panel-s9fbCKfl.js} +1 -1
  199. package/dist/chunks/{passes-B1f6NHWA.js → passes-C9oR06Fa.js} +1 -1
  200. package/dist/chunks/{paths-D8Fx3kUi.js → paths-BZbIj1Z1.js} +3 -3
  201. package/dist/chunks/permissions-DNb8DG22.js +3 -0
  202. package/dist/chunks/{pipeTransport-DAYnzvGK.js → pipeTransport-Cx55TUNu.js} +1 -1
  203. package/dist/chunks/{plan-B7EPetF0.js → plan-D-RJTUxb.js} +1 -1
  204. package/dist/chunks/{plugin-BRWx-_ZS.js → plugin-BV-DabiK.js} +1 -1
  205. package/dist/chunks/{pluginAutoupdate-BwxAsU2F.js → pluginAutoupdate-DPciQRLz.js} +1 -1
  206. package/dist/chunks/pluginBlocklist-CtSUf3sp.js +1 -0
  207. package/dist/chunks/{pluginCliCommands-CXANH43C.js → pluginCliCommands-Cbcc-AQq.js} +1 -1
  208. package/dist/chunks/{pluginFlagging-CBbUoCJ9.js → pluginFlagging-D2d7jd4v.js} +1 -1
  209. package/dist/chunks/pluginOperations-rU56uptC.js +2 -0
  210. package/dist/chunks/{pluginStartupCheck-BNfv-Pf4.js → pluginStartupCheck-DuhCLRbp.js} +1 -1
  211. package/dist/chunks/pluginStartupCheck-DwY7j_Cg.js +1 -0
  212. package/dist/chunks/plugins-LbLpZOhz.js +4 -0
  213. package/dist/chunks/policyLimits-Dl863Z85.js +1 -0
  214. package/dist/chunks/{pollConfig-BWY_xmk6.js → pollConfig-orFqIbGd.js} +1 -1
  215. package/dist/chunks/{poor-Bcu8JaV5.js → poor-2u_yWIRG.js} +1 -1
  216. package/dist/chunks/poorMode-BBr7GGQ3.js +1 -0
  217. package/dist/chunks/{poorMode-CDhhKGBw.js → poorMode-DtQVZvON.js} +1 -1
  218. package/dist/chunks/print-BgLbepaC.js +39 -0
  219. package/dist/chunks/{privacy-settings-CmHUlYoo.js → privacy-settings-CC_FyvjV.js} +1 -1
  220. package/dist/chunks/processBashCommand-DnekNzlT.js +1 -0
  221. package/dist/chunks/processSlashCommand-sLL0pyIW.js +6 -0
  222. package/dist/chunks/{projectContext-0fpRKUeH.js → projectContext-D5FgyE-d.js} +1 -1
  223. package/dist/chunks/{prompt-BxoRdmaw.js → prompt-DHHypkUR.js} +1 -1
  224. package/dist/chunks/prompt-Dexwn9YP.js +1 -0
  225. package/dist/chunks/prompt-DhaPVt1T.js +1 -0
  226. package/dist/chunks/{promptEditor-LQu9NhbN.js → promptEditor-I8ZpszKv.js} +2 -2
  227. package/dist/chunks/{protocolHandler-DYn2E9Yl.js → protocolHandler-CEsrhel_.js} +1 -1
  228. package/dist/chunks/rate-limit-options-B0Iyzr4x.js +1 -0
  229. package/dist/chunks/{rcDebugLog-5XEbz_Yg.js → rcDebugLog-CF73Wofq.js} +1 -1
  230. package/dist/chunks/{referral-BsAvaATn.js → referral-Nz20w4pB.js} +1 -1
  231. package/dist/chunks/refresh-DecpoOX1.js +1 -0
  232. package/dist/chunks/{registerProtocol-COUVHFku.js → registerProtocol-CAoaYyt8.js} +1 -1
  233. package/dist/chunks/registry-BQdQRu-K.js +1 -0
  234. package/dist/chunks/{release-notes-BDdughgu.js → release-notes-C0HeOmQY.js} +1 -1
  235. package/dist/chunks/{releaseNotes-Bd3zxid3.js → releaseNotes-BDzfbUAu.js} +2 -2
  236. package/dist/chunks/{reload-plugins-qUIybHNy.js → reload-plugins-BZ4LTYY3.js} +1 -1
  237. package/dist/chunks/{remote-env-GGlLNGsx.js → remote-env-CPalv-BL.js} +1 -1
  238. package/dist/chunks/{remoteBridgeCore-DpF5alU6.js → remoteBridgeCore-B2yFfG6S.js} +1 -1
  239. package/dist/chunks/{remoteControlServer-C32rxr3F.js → remoteControlServer-CsnLedUv.js} +2 -2
  240. package/dist/chunks/rename-CQPtjj_Q.js +1 -0
  241. package/dist/chunks/{resume-C6ereXig.js → resume-Ycuezjv2.js} +2 -2
  242. package/dist/chunks/{runtimeObserver-DBdzsp_h.js → runtimeObserver-CW0_wm1t.js} +1 -1
  243. package/dist/chunks/{runtimeObserver-jrNSkZU2.js → runtimeObserver-DnhLm9O1.js} +3 -3
  244. package/dist/chunks/sandbox-adapter-BOsa-en7.js +1 -0
  245. package/dist/chunks/{sandbox-toggle-Bfti5GKF.js → sandbox-toggle-Bl5Drxeo.js} +1 -1
  246. package/dist/chunks/searchExtraTools-CgdrY8XO.js +1 -0
  247. package/dist/chunks/{sentry-CZUyEC3A.js → sentry-BN3GTgYM.js} +1 -1
  248. package/dist/chunks/{session-DCIDa5dI.js → session-ULekTZVn.js} +2 -2
  249. package/dist/chunks/{sessionDiscovery-5m_pul65.js → sessionDiscovery-DAmbR6o-.js} +1 -1
  250. package/dist/chunks/sessionFileAccessHooks-C-o5001P.js +1 -0
  251. package/dist/chunks/sessionMemory-Bg458voj.js +1 -0
  252. package/dist/chunks/sessionMemory-DR-esdhZ.js +1 -0
  253. package/dist/chunks/sessionMemoryUtils-DgVGiwjB.js +1 -0
  254. package/dist/chunks/sessionObserver-C5cujEe6.js +1 -0
  255. package/dist/chunks/{sessionObserver-LBqNoak9.js → sessionObserver-CQ3PQWgU.js} +1 -1
  256. package/dist/chunks/sessionStorage-BIDUQ8wo.js +1 -0
  257. package/dist/chunks/{sessionTitle-BIykjtKk.js → sessionTitle-DyexSH43.js} +1 -1
  258. package/dist/chunks/{sessionTracing-Da_r0mIc.js → sessionTracing-gKle2qzF.js} +1 -1
  259. package/dist/chunks/{settingsSync-BE0PQqyo.js → settingsSync-BWW4FOMm.js} +1 -1
  260. package/dist/chunks/{setup-p04XtwYu.js → setup-DX6984LY.js} +1 -1
  261. package/dist/chunks/setup-OvlOCIFL.js +2 -0
  262. package/dist/chunks/{setup-CjA5bW6e.js → setup-n91rSYO2.js} +1 -1
  263. package/dist/chunks/{shadowedRuleDetection-Zqp1M5St.js → shadowedRuleDetection-uYIZBoii.js} +1 -1
  264. package/dist/chunks/{sideQuestion-DzJenEES.js → sideQuestion-DIMsNoEc.js} +2 -2
  265. package/dist/chunks/sink-BBn0HwoH.js +1 -0
  266. package/dist/chunks/{sink-N5XR8Zgp.js → sink-DLRpC2qX.js} +1 -1
  267. package/dist/chunks/{sinks-D8erzS9D.js → sinks-BI1hGD9c.js} +2 -2
  268. package/dist/chunks/sinks-DKGE2sSC.js +1 -0
  269. package/dist/chunks/{skill-learning-CbMQ8IsZ.js → skill-learning-Dz-Zq-xT.js} +1 -1
  270. package/dist/chunks/skillChangeDetector-C2Te20cK.js +1 -0
  271. package/dist/chunks/{skillGapStore-DbiDG9Pd.js → skillGapStore-BFpryJIe.js} +2 -2
  272. package/dist/chunks/{skillGapStore-Bp5IVfOx.js → skillGapStore-CxPjoWci.js} +1 -1
  273. package/dist/chunks/{skillGenerator-Bys7U1l_.js → skillGenerator-BGOIb5p-.js} +2 -2
  274. package/dist/chunks/skillLearning-BRvWwB8E.js +1 -0
  275. package/dist/chunks/skillLearning-DTo7lCKd.js +1 -0
  276. package/dist/chunks/{skillPanel-MIHU1PPp.js → skillPanel-DzYZLnuH.js} +3 -3
  277. package/dist/chunks/{skillSearchPanel-MFB-PzB1.js → skillSearchPanel-DrysL5R-.js} +3 -3
  278. package/dist/chunks/{skills-D4tZYFpd.js → skills-CTfNqisc.js} +1 -1
  279. package/dist/chunks/{sprites-B479AZSz.js → sprites-CHzZCAGE.js} +1 -1
  280. package/dist/chunks/{stats-B-ErfxCJ.js → stats-D2s-hIY8.js} +1 -1
  281. package/dist/chunks/{status-DVACJLsK.js → status-XxrX2kHw.js} +1 -1
  282. package/dist/chunks/statusNoticeHelpers-CUm1pflC.js +1 -0
  283. package/dist/chunks/{tag-YpE2D2ve.js → tag-FV031rKW.js} +2 -2
  284. package/dist/chunks/{tasks-7N7iSiEx.js → tasks-aK2rp8CW.js} +1 -1
  285. package/dist/chunks/{teamHelpers-BFdTH57t.js → teamHelpers-2m66Mr8w.js} +1 -1
  286. package/dist/chunks/teamHelpers-Bg3nHlWr.js +1 -0
  287. package/dist/chunks/{teammateModeSnapshot-CwacsQvD.js → teammateModeSnapshot-BtdUJBKp.js} +1 -1
  288. package/dist/chunks/teammateModeSnapshot-VojvAMbR.js +1 -0
  289. package/dist/chunks/teleport-4x9eIl8c.js +1 -0
  290. package/dist/chunks/{templateJobs-BM98KAEH.js → templateJobs-fEz4DGWh.js} +1 -1
  291. package/dist/chunks/{terminalSetup-CGiIwoIX.js → terminalSetup-Cjdlcznm.js} +1 -1
  292. package/dist/chunks/{terminalSetup-yQ0CoywX.js → terminalSetup-EirH-l0a.js} +1 -1
  293. package/dist/chunks/{theme-C5ULGNRs.js → theme-BjdEyakL.js} +1 -1
  294. package/dist/chunks/thinkback-CrW3VlCR.js +1 -0
  295. package/dist/chunks/thinkback-DHyz-lmU.js +1 -0
  296. package/dist/chunks/thinkback-play-B46ystVF.js +1 -0
  297. package/dist/chunks/{toolEventObserver-CuJbsUL0.js → toolEventObserver-CJ68x4wM.js} +1 -1
  298. package/dist/chunks/{toolEventObserver-CcLqNRcT.js → toolEventObserver-Dak6ETA6.js} +1 -1
  299. package/dist/chunks/toolPool-3CMCh3QU.js +1 -0
  300. package/dist/chunks/toolPool-BHdCDihh.js +1 -0
  301. package/dist/chunks/{trustedDevice-u2HpuTkN.js → trustedDevice-QhApqKq4.js} +1 -1
  302. package/dist/chunks/{trustedDevice-C4tvgByY.js → trustedDevice-oDn6E85N.js} +1 -1
  303. package/dist/chunks/{tui-BVc2q4Xv.js → tui-geoc3zxu.js} +1 -1
  304. package/dist/chunks/{ultrareviewCommand-CWLiiq-z.js → ultrareviewCommand-Ar9zzqz4.js} +2 -2
  305. package/dist/chunks/undercover-D1ieJ54D.js +1 -0
  306. package/dist/chunks/{undercover-CNlN7Xzl.js → undercover-DZq2Tf-o.js} +1 -1
  307. package/dist/chunks/{updateCCB-BWN4mOEz.js → updateCCB-Db3CfFcn.js} +1 -1
  308. package/dist/chunks/upgrade-B28O0zeQ.js +1 -0
  309. package/dist/chunks/{upgrade-CE25mJEk.js → upgrade-BZvNOhEJ.js} +1 -1
  310. package/dist/chunks/{upload-YpyOX2a-.js → upload-DAmbsBq4.js} +1 -1
  311. package/dist/chunks/{usage-Bw-kTwHb.js → usage-COv9UCxX.js} +1 -1
  312. package/dist/chunks/{usage-DNXwr_ep.js → usage-Dtv3YQf8.js} +1 -1
  313. package/dist/chunks/useMainLoopModel-BpM3dlzJ.js +1 -0
  314. package/dist/chunks/{useManagePlugins-hPG7UMWo.js → useManagePlugins-DZ-_Ll9E.js} +1 -1
  315. package/dist/chunks/useMergedTools-INKnp2ij.js +1 -0
  316. package/dist/chunks/{useSearchInput-CR9uhbA7.js → useSearchInput-DobM3JKI.js} +1 -1
  317. package/dist/chunks/useSettingsErrors-DjvaCC5-.js +1 -0
  318. package/dist/chunks/{useVoice-B5DQ5Tay.js → useVoice-exDfbv1t.js} +1 -1
  319. package/dist/chunks/{util-D_BHu06u.js → util-CDzNDmax.js} +1 -1
  320. package/dist/chunks/utils-B0iiiW_p.js +1 -0
  321. package/dist/chunks/validatePlugin-DaLnfLSC.js +1 -0
  322. package/dist/chunks/{vim-BGqKMQxl.js → vim-CPKu15l_.js} +1 -1
  323. package/dist/chunks/{voice-B2MWrkN3.js → voice-gNxUce-I.js} +2 -2
  324. package/dist/chunks/voiceModeEnabled-CwPbMJ9C.js +1 -0
  325. package/dist/chunks/{voiceModeEnabled-if9dV1bW.js → voiceModeEnabled-DEwGjUP6.js} +1 -1
  326. package/dist/chunks/voiceStreamSTT-6b3Oslnl.js +1 -0
  327. package/dist/chunks/{voiceStreamSTT-CWhKAxcp.js → voiceStreamSTT-BjX-mTB_.js} +1 -1
  328. package/dist/chunks/{workerRegistry-BANOcuS2.js → workerRegistry-Bc6t6VlK.js} +1 -1
  329. package/dist/chunks/worktree-NnuvJmoP.js +1 -0
  330. package/dist/chunks/{xml-DZp0WcWT.js → xml-Dg8-vY8G.js} +1 -1
  331. package/dist/cli.js +1 -1
  332. package/package.json +1 -1
  333. package/dist/chunks/ApproveApiKey-CBEOrsej.js +0 -1
  334. package/dist/chunks/BackgroundTasksDialog-ChDZ6M4c.js +0 -2
  335. package/dist/chunks/ClaudeMdExternalIncludesDialog-CG26Jg7h.js +0 -1
  336. package/dist/chunks/ConsoleOAuthFlow-1aq67dJV.js +0 -1
  337. package/dist/chunks/Doctor-ByQrTdef.js +0 -3
  338. package/dist/chunks/Doctor-DOil8Eh7.js +0 -1
  339. package/dist/chunks/Grove-CJn8QGFo.js +0 -1
  340. package/dist/chunks/MCPConnectionManager-BbGFGZTr.js +0 -1
  341. package/dist/chunks/MessageSelector-A-814zUi.js +0 -3
  342. package/dist/chunks/Messages-C4nIAGDL.js +0 -11
  343. package/dist/chunks/QueryEngine-CK9YRTZo.js +0 -1
  344. package/dist/chunks/REPL-DV96-Prr.js +0 -1
  345. package/dist/chunks/ResumeConversation-BTccgPK8.js +0 -1
  346. package/dist/chunks/SearchExtraToolsTool-CmyZbRut.js +0 -1
  347. package/dist/chunks/SentryErrorBoundary-B9sk4zvj.js +0 -1
  348. package/dist/chunks/Settings-D3Kpcb7q.js +0 -2
  349. package/dist/chunks/TeleportRepoMismatchDialog-BUeyIQCH.js +0 -1
  350. package/dist/chunks/api-DgzWK3bh.js +0 -1
  351. package/dist/chunks/assistant-Ojm6Wsb6.js +0 -1
  352. package/dist/chunks/auth-lQWhUjLX.js +0 -1
  353. package/dist/chunks/backgroundHousekeeping-BcLV1-Ap.js +0 -1
  354. package/dist/chunks/backgroundHousekeeping-KGRk7QeA.js +0 -17
  355. package/dist/chunks/bridgeConfig-ByjfIoJz.js +0 -1
  356. package/dist/chunks/bridgeEnabled-C7AI9y8g.js +0 -1
  357. package/dist/chunks/bridgeMain-B0fLyOLC.js +0 -68
  358. package/dist/chunks/bridgeMain-DKQ1u3k_.js +0 -1
  359. package/dist/chunks/caches-DbE9R4Zh.js +0 -1
  360. package/dist/chunks/changeDetector--9sSzU2e.js +0 -1
  361. package/dist/chunks/channelNotification-CLYOd2-R.js +0 -1
  362. package/dist/chunks/clear-Cf1D1WkR.js +0 -1
  363. package/dist/chunks/client-Bzn58Ea4.js +0 -1
  364. package/dist/chunks/color-DqtpdhFx.js +0 -1
  365. package/dist/chunks/commands-CJz20FMO.js +0 -1
  366. package/dist/chunks/commitAttribution-BgNel6QS.js +0 -1
  367. package/dist/chunks/compact-DLYic2Oa.js +0 -3
  368. package/dist/chunks/context-noninteractive-CzuLiIeO.js +0 -1
  369. package/dist/chunks/conversation-CLRfdC_V.js +0 -1
  370. package/dist/chunks/conversation-D2iFk7Te.js +0 -1
  371. package/dist/chunks/createSession-XhPMcSns.js +0 -1
  372. package/dist/chunks/crossProjectResume-BMWSw62A.js +0 -40
  373. package/dist/chunks/datadog-B5oHSyS1.js +0 -1
  374. package/dist/chunks/earlyInput-JGJo1zcC.js +0 -1
  375. package/dist/chunks/envLessBridgeConfig-DgdkC9jO.js +0 -1
  376. package/dist/chunks/exit-B-9k0zjK.js +0 -1
  377. package/dist/chunks/extra-usage-CsJ9Z2G1.js +0 -1
  378. package/dist/chunks/extractMemories-D34FfNYT.js +0 -1
  379. package/dist/chunks/fast-CxPB-PBH.js +0 -1
  380. package/dist/chunks/gates-D-kXXHiv.js +0 -1
  381. package/dist/chunks/gemini-BFBrPtVM.js +0 -1
  382. package/dist/chunks/grok-Dih61WOo.js +0 -1
  383. package/dist/chunks/hooks-Cw-F-1uO.js +0 -1
  384. package/dist/chunks/inboundAttachments-CZN_sUNx.js +0 -1
  385. package/dist/chunks/initReplBridge-D8sWx97P.js +0 -1
  386. package/dist/chunks/language-DB1HIsF8.js +0 -1
  387. package/dist/chunks/loadAgentsDir-DsskgPWe.js +0 -1
  388. package/dist/chunks/loadPluginHooks-DoFtrBWf.js +0 -1
  389. package/dist/chunks/localSearch-CScvVw0c.js +0 -1
  390. package/dist/chunks/login-FdPNsHJs.js +0 -1
  391. package/dist/chunks/logout-CulTqT7V.js +0 -1
  392. package/dist/chunks/mcp-BXPg0RPm.js +0 -1
  393. package/dist/chunks/mcp-iCbCqg7w.js +0 -6
  394. package/dist/chunks/mcp-yDWIJznG.js +0 -2
  395. package/dist/chunks/memory-B0YG4r65.js +0 -1
  396. package/dist/chunks/model-DG0v1297.js +0 -1
  397. package/dist/chunks/permissions-CYrv_WVH.js +0 -3
  398. package/dist/chunks/pluginBlocklist-BiRgxFei.js +0 -1
  399. package/dist/chunks/pluginOperations-B3gcFjVq.js +0 -2
  400. package/dist/chunks/pluginStartupCheck-Ga_XiMnA.js +0 -1
  401. package/dist/chunks/plugins-zHTS03v8.js +0 -4
  402. package/dist/chunks/policyLimits-Dsz-jkpD.js +0 -1
  403. package/dist/chunks/poorMode-BAuBNURJ.js +0 -1
  404. package/dist/chunks/print-DO52Fudu.js +0 -39
  405. package/dist/chunks/processBashCommand-DltW2Ubs.js +0 -1
  406. package/dist/chunks/processSlashCommand-JLJ_vF05.js +0 -6
  407. package/dist/chunks/prompt-D3rBUscf.js +0 -1
  408. package/dist/chunks/prompt-ohTcwieE.js +0 -1
  409. package/dist/chunks/rate-limit-options-OQt6LUP8.js +0 -1
  410. package/dist/chunks/refresh-TlNezXn4.js +0 -1
  411. package/dist/chunks/registry-m7JojEMY.js +0 -1
  412. package/dist/chunks/rename-CCF7A5mG.js +0 -1
  413. package/dist/chunks/sandbox-adapter-CQ0imVO1.js +0 -1
  414. package/dist/chunks/searchExtraTools-Ntz1u-YC.js +0 -1
  415. package/dist/chunks/sessionFileAccessHooks-DD2a-mTZ.js +0 -1
  416. package/dist/chunks/sessionMemory-BQP_RezB.js +0 -1
  417. package/dist/chunks/sessionMemory-hbxplpxs.js +0 -1
  418. package/dist/chunks/sessionMemoryUtils-DlW9hqOH.js +0 -1
  419. package/dist/chunks/sessionObserver-Lb1c5FPy.js +0 -1
  420. package/dist/chunks/sessionStorage-DG68Xvsy.js +0 -1
  421. package/dist/chunks/setup-lxzmZdw5.js +0 -2
  422. package/dist/chunks/sink-BdRlnpoG.js +0 -1
  423. package/dist/chunks/sinks-Bn0FK_Ab.js +0 -1
  424. package/dist/chunks/skillChangeDetector-4XWLpjQl.js +0 -1
  425. package/dist/chunks/skillLearning-702-D6Lq.js +0 -1
  426. package/dist/chunks/skillLearning-Cz7qU9V6.js +0 -1
  427. package/dist/chunks/statusNoticeHelpers-CwSCVvxP.js +0 -1
  428. package/dist/chunks/teamHelpers-CmDn2xyl.js +0 -1
  429. package/dist/chunks/teammateModeSnapshot-DXtG86pG.js +0 -1
  430. package/dist/chunks/teleport-CPB1CHBs.js +0 -1
  431. package/dist/chunks/thinkback-CF_sLFvX.js +0 -1
  432. package/dist/chunks/thinkback-D1Fv1QYl.js +0 -1
  433. package/dist/chunks/thinkback-play-syg_SJm8.js +0 -1
  434. package/dist/chunks/toolPool-C4CO158z.js +0 -1
  435. package/dist/chunks/toolPool-CRq0GSrk.js +0 -1
  436. package/dist/chunks/undercover-jZEIpxrJ.js +0 -1
  437. package/dist/chunks/upgrade-C_0-l0Zo.js +0 -1
  438. package/dist/chunks/useMainLoopModel-DPmF_cMn.js +0 -1
  439. package/dist/chunks/useMergedTools-BSO1NflP.js +0 -1
  440. package/dist/chunks/useSettingsErrors-453j5XuO.js +0 -1
  441. package/dist/chunks/utils--ZdihcLH.js +0 -1
  442. package/dist/chunks/validatePlugin-Dxm-5f8W.js +0 -1
  443. package/dist/chunks/voiceModeEnabled-0NU5pSM-.js +0 -1
  444. package/dist/chunks/voiceStreamSTT-yvcTWD7i.js +0 -1
  445. package/dist/chunks/worktree-CRn2SbHn.js +0 -1
  446. /package/dist/chunks/{InProcessTransport-DB52dh4f.js → InProcessTransport-gJLr5CIx.js} +0 -0
  447. /package/dist/chunks/{attributionHooks-PygdohOh.js → attributionHooks-Br5LZ6bk.js} +0 -0
  448. /package/dist/chunks/{attributionTrailer-BpvhXgRP.js → attributionTrailer-BMTuK4Ax.js} +0 -0
  449. /package/dist/chunks/{autoModeDenials-Cp6VFdsm.js → autoModeDenials-D8eQ1CoM.js} +0 -0
  450. /package/dist/chunks/{banner-CVXH2xts.js → banner-32EBTKI7.js} +0 -0
  451. /package/dist/chunks/{bedrockClient-qi1-JCOK.js → bedrockClient-Ci523Btx.js} +0 -0
  452. /package/dist/chunks/{ccshareResume-DWLjTF22.js → ccshareResume-CqNm2k-J.js} +0 -0
  453. /package/dist/chunks/{chromeNativeHost-4U39yLtd.js → chromeNativeHost-DX8f9Y2L.js} +0 -0
  454. /package/dist/chunks/{claudeDesktop-D0S1eq1F.js → claudeDesktop-C1qQs6os.js} +0 -0
  455. /package/dist/chunks/{cleanup-Bg_gFgcj.js → cleanup-Pv6U3HiI.js} +0 -0
  456. /package/dist/chunks/{connectHeadless-CwsFt-Mh.js → connectHeadless-DFCrE6O4.js} +0 -0
  457. /package/dist/chunks/{dangerousBackend-BU_PHGR2.js → dangerousBackend-Du0K4q5Z.js} +0 -0
  458. /package/dist/chunks/{earlyInput-tRkbxFv2.js → earlyInput-feVuZGzR.js} +0 -0
  459. /package/dist/chunks/{eventLoopStallDetector-Dnh1fc31.js → eventLoopStallDetector-XfubcyMN.js} +0 -0
  460. /package/dist/chunks/{fpsMetrics-DeezdcwV.js → fpsMetrics-CEQt6Tk1.js} +0 -0
  461. /package/dist/chunks/{fuse-Ch_OAlm3.js → fuse-TM-TeOo_.js} +0 -0
  462. /package/dist/chunks/{instinctParser-DHMa8xa0.js → instinctParser-CJPM8VjX.js} +0 -0
  463. /package/dist/chunks/{lockfile-DBwdlC3K.js → lockfile-Y1hwdHrQ.js} +0 -0
  464. /package/dist/chunks/{main-C6be1KFk.js → main-D9fUXJiD.js} +0 -0
  465. /package/dist/chunks/{observationStore-tvkldXUo.js → observationStore-gFvWXJmc.js} +0 -0
  466. /package/dist/chunks/{openaiShared-Bjrci9n8.js → openaiShared-Dy78YERG.js} +0 -0
  467. /package/dist/chunks/{output-style-XDb9-2Kk.js → output-style-BmEQscMd.js} +0 -0
  468. /package/dist/chunks/{parseConnectUrl-BS6i9JPo.js → parseConnectUrl-C6cvMkkH.js} +0 -0
  469. /package/dist/chunks/{poller-Ds0Y6Cir.js → poller-Dbo07OEA.js} +0 -0
  470. /package/dist/chunks/{postCommitAttribution-Ehmwzzuq.js → postCommitAttribution-DhFkZMxJ.js} +0 -0
  471. /package/dist/chunks/{projectContext-eXMSfgdZ.js → projectContext-iWPqcl0Z.js} +0 -0
  472. /package/dist/chunks/{renderOptions-BiyC2rj1.js → renderOptions-rmj4Mkls.js} +0 -0
  473. /package/dist/chunks/{rewind-CXplHgh_.js → rewind-DAn-nNs-.js} +0 -0
  474. /package/dist/chunks/{sanitization-CYp-9DbE.js → sanitization-JYRkZFrK.js} +0 -0
  475. /package/dist/chunks/{sdkHeapDumpMonitor--fevrC5z.js → sdkHeapDumpMonitor-DKtfJW5o.js} +0 -0
  476. /package/dist/chunks/{server-C5XZSlto.js → server-CswFAYwN.js} +0 -0
  477. /package/dist/chunks/{serverBanner-WlSYP-f8.js → serverBanner-CImTYGhY.js} +0 -0
  478. /package/dist/chunks/{serverLog-DtsUvDiY.js → serverLog-Bwt7XEmk.js} +0 -0
  479. /package/dist/chunks/{sessionDataUploader-Ctjo1bgR.js → sessionDataUploader-CKRXCBxI.js} +0 -0
  480. /package/dist/chunks/{sessionManager-Dw72ZUTg.js → sessionManager-Ca2O821f.js} +0 -0
  481. /package/dist/chunks/{stickers-2K05wjSp.js → stickers-BMh2qjgF.js} +0 -0
  482. /package/dist/chunks/{udsClient-BvG_Jip0.js → udsClient-BdPOrL1H.js} +0 -0
  483. /package/dist/chunks/{upstreamproxy-DcLeL2XX.js → upstreamproxy-Ci5T_JCo.js} +0 -0
  484. /package/dist/chunks/{voice-DXiiy8HX.js → voice-BcA5h8ya.js} +0 -0
@@ -1 +1 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Q as r,Rn as i,b as a,i as o,n as s,p as c,r as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{C as m,S as h}from"./startupProfiler-DnXZaX4A.js";import{Fi as g,Hi as _,Li as v,Nx as y,Px as b,Uw as x,Xi as S,nT as C,rT as w}from"./loadAgentsDir-HZ19tmOZ.js";import{t as T}from"./useKeybinding-FsOnjW6T.js";import{l as E,u as D}from"./referral-BsAvaATn.js";import{n as O,r as k}from"./modalContext-CmSKRyea.js";import{n as A,t as j}from"./PromptInputHelpMenu-BlGRpX1Q.js";function M({commands:e,maxHeight:t,columns:n,title:r,onCancel:i,emptyMessage:s}){let{headerFocused:c,focusHeader:l}=o(),u=Math.max(1,n-10),d=Math.max(1,Math.floor((t-10)/2)),p=(0,N.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:m(_(e),u,!0)}))},[e,u]);return(0,P.jsx)(f,{flexDirection:`column`,paddingY:1,children:e.length===0&&s?(0,P.jsx)(a,{dimColor:!0,children:s}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{children:r}),(0,P.jsx)(f,{marginTop:1,children:(0,P.jsx)(y,{options:p,visibleOptionCount:d,onCancel:i,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:l,isDisabled:c})})]})})}var N,P,F=e((()=>{i(),N=t(i(),1),S(),h(),u(),b(),P=p()}));function I(){return(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,L.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,L.jsx)(a,{bold:!0,children:`Getting started`}),(0,L.jsxs)(f,{flexDirection:`column`,children:[(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`1. `}),(0,L.jsx)(a,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`2. `}),(0,L.jsx)(a,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`3. `}),(0,L.jsx)(a,{children:`Type `}),(0,L.jsx)(a,{bold:!0,children:`/commit`}),(0,L.jsx)(a,{children:` to commit changes, `}),(0,L.jsx)(a,{bold:!0,children:`/help`}),(0,L.jsx)(a,{children:` for commands, or `}),(0,L.jsx)(a,{bold:!0,children:`?`}),(0,L.jsx)(a,{children:` for shortcuts.`})]})]})]}),(0,L.jsxs)(f,{flexDirection:`column`,children:[(0,L.jsx)(f,{children:(0,L.jsx)(a,{bold:!0,children:`Shortcuts`})}),(0,L.jsx)(j,{gap:2,fixedWidth:!0})]})]})}var L,R=e((()=>{i(),u(),A(),L=p()}));function z({onClose:e,commands:t}){let{rows:i,columns:o}=n(),u=Math.floor(i/2),p=k(),m=()=>e(`Help dialog dismissed`,{display:`system`});d(`help:dismiss`,m,{context:`Help`});let h=D(m),_=w(`help:dismiss`,`Help`,`esc`),y=v(),b=t.filter(e=>y.has(e.name)&&!e.isHidden),x=[];if(process.env.USER_TYPE===`ant`){let e=new Set(g.map(e=>e.name));b=b.filter(t=>!e.has(t.name)),x=t.filter(t=>e.has(t.name)&&!t.isHidden)}let S=t.filter(e=>!y.has(e.name)&&!e.isHidden),C=[(0,B.jsx)(s,{title:`general`,children:(0,B.jsx)(I,{})},`general`)];return C.push((0,B.jsx)(s,{title:`commands`,children:(0,B.jsx)(M,{commands:b,maxHeight:u,columns:o,title:`Browse default commands:`,onCancel:m})},`commands`)),C.push((0,B.jsx)(s,{title:`custom-commands`,children:(0,B.jsx)(M,{commands:S,maxHeight:u,columns:o,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:m})},`custom`)),process.env.USER_TYPE===`ant`&&x.length>0&&C.push((0,B.jsx)(s,{title:`[ant-only]`,children:(0,B.jsx)(M,{commands:x,maxHeight:u,columns:o,title:`Browse ant-only commands:`,onCancel:m})},`ant-only`)),(0,B.jsx)(f,{flexDirection:`column`,height:p?void 0:u,children:(0,B.jsxs)(c,{color:`professionalBlue`,children:[(0,B.jsx)(l,{title:process.env.USER_TYPE===`ant`?`/help`:`Claude Code v2.6.10`,color:`professionalBlue`,defaultTab:`general`,children:C}),(0,B.jsx)(f,{marginTop:1,children:(0,B.jsxs)(a,{children:[`For more help: `,(0,B.jsx)(r,{url:`https://code.claude.com/docs/en/overview`})]})}),(0,B.jsx)(f,{marginTop:1,children:(0,B.jsx)(a,{dimColor:!0,children:h.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,B.jsxs)(a,{italic:!0,children:[_,` to cancel`]})})})]})})}var B,V=e((()=>{i(),E(),C(),S(),O(),x(),u(),T(),F(),R(),B=p()})),H,U;e((()=>{V(),H=p(),U=async(e,{options:{commands:t}})=>(0,H.jsx)(z,{commands:t,onClose:e})}))();export{U as call};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Q as r,Rn as i,b as a,i as o,n as s,p as c,r as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{C as m,S as h}from"./startupProfiler-DnXZaX4A.js";import{Ki as g,Lx as _,Rx as v,Vi as y,ea as b,oT as x,qw as S,sT as C,zi as w}from"./loadAgentsDir-DaApSWNv.js";import{t as T}from"./useKeybinding-FsOnjW6T.js";import{l as E,u as D}from"./referral-Nz20w4pB.js";import{n as O,r as k}from"./modalContext-CmSKRyea.js";import{n as A,t as j}from"./PromptInputHelpMenu-DnQj3Hpq.js";function M({commands:e,maxHeight:t,columns:n,title:r,onCancel:i,emptyMessage:s}){let{headerFocused:c,focusHeader:l}=o(),u=Math.max(1,n-10),d=Math.max(1,Math.floor((t-10)/2)),p=(0,N.useMemo)(()=>{let t=new Set;return e.filter(e=>t.has(e.name)?!1:(t.add(e.name),!0)).sort((e,t)=>e.name.localeCompare(t.name)).map(e=>({label:`/${e.name}`,value:e.name,description:m(g(e),u,!0)}))},[e,u]);return(0,P.jsx)(f,{flexDirection:`column`,paddingY:1,children:e.length===0&&s?(0,P.jsx)(a,{dimColor:!0,children:s}):(0,P.jsxs)(P.Fragment,{children:[(0,P.jsx)(a,{children:r}),(0,P.jsx)(f,{marginTop:1,children:(0,P.jsx)(_,{options:p,visibleOptionCount:d,onCancel:i,disableSelection:!0,hideIndexes:!0,layout:`compact-vertical`,onUpFromFirstItem:l,isDisabled:c})})]})})}var N,P,F=e((()=>{i(),N=t(i(),1),b(),h(),u(),v(),P=p()}));function I(){return(0,L.jsxs)(f,{flexDirection:`column`,paddingY:1,gap:1,children:[(0,L.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,L.jsx)(a,{bold:!0,children:`Getting started`}),(0,L.jsxs)(f,{flexDirection:`column`,children:[(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`1. `}),(0,L.jsx)(a,{children:`Ask a question or describe a task — Claude will explore your code and respond.`})]}),(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`2. `}),(0,L.jsx)(a,{children:`When Claude wants to edit files or run commands, you review and approve each action.`})]}),(0,L.jsxs)(a,{children:[(0,L.jsx)(a,{bold:!0,children:`3. `}),(0,L.jsx)(a,{children:`Type `}),(0,L.jsx)(a,{bold:!0,children:`/commit`}),(0,L.jsx)(a,{children:` to commit changes, `}),(0,L.jsx)(a,{bold:!0,children:`/help`}),(0,L.jsx)(a,{children:` for commands, or `}),(0,L.jsx)(a,{bold:!0,children:`?`}),(0,L.jsx)(a,{children:` for shortcuts.`})]})]})]}),(0,L.jsxs)(f,{flexDirection:`column`,children:[(0,L.jsx)(f,{children:(0,L.jsx)(a,{bold:!0,children:`Shortcuts`})}),(0,L.jsx)(j,{gap:2,fixedWidth:!0})]})]})}var L,R=e((()=>{i(),u(),A(),L=p()}));function z({onClose:e,commands:t}){let{rows:i,columns:o}=n(),u=Math.floor(i/2),p=k(),m=()=>e(`Help dialog dismissed`,{display:`system`});d(`help:dismiss`,m,{context:`Help`});let h=D(m),g=C(`help:dismiss`,`Help`,`esc`),_=y(),v=t.filter(e=>_.has(e.name)&&!e.isHidden),b=[];if(process.env.USER_TYPE===`ant`){let e=new Set(w.map(e=>e.name));v=v.filter(t=>!e.has(t.name)),b=t.filter(t=>e.has(t.name)&&!t.isHidden)}let x=t.filter(e=>!_.has(e.name)&&!e.isHidden),S=[(0,B.jsx)(s,{title:`general`,children:(0,B.jsx)(I,{})},`general`)];return S.push((0,B.jsx)(s,{title:`commands`,children:(0,B.jsx)(M,{commands:v,maxHeight:u,columns:o,title:`Browse default commands:`,onCancel:m})},`commands`)),S.push((0,B.jsx)(s,{title:`custom-commands`,children:(0,B.jsx)(M,{commands:x,maxHeight:u,columns:o,title:`Browse custom commands:`,emptyMessage:`No custom commands found`,onCancel:m})},`custom`)),process.env.USER_TYPE===`ant`&&b.length>0&&S.push((0,B.jsx)(s,{title:`[ant-only]`,children:(0,B.jsx)(M,{commands:b,maxHeight:u,columns:o,title:`Browse ant-only commands:`,onCancel:m})},`ant-only`)),(0,B.jsx)(f,{flexDirection:`column`,height:p?void 0:u,children:(0,B.jsxs)(c,{color:`professionalBlue`,children:[(0,B.jsx)(l,{title:process.env.USER_TYPE===`ant`?`/help`:`Claude Code v2.6.12`,color:`professionalBlue`,defaultTab:`general`,children:S}),(0,B.jsx)(f,{marginTop:1,children:(0,B.jsxs)(a,{children:[`For more help: `,(0,B.jsx)(r,{url:`https://code.claude.com/docs/en/overview`})]})}),(0,B.jsx)(f,{marginTop:1,children:(0,B.jsx)(a,{dimColor:!0,children:h.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,h.keyName,` again to exit`]}):(0,B.jsxs)(a,{italic:!0,children:[g,` to cancel`]})})})]})})}var B,V=e((()=>{i(),E(),x(),b(),O(),S(),u(),T(),F(),R(),B=p()})),H,U;e((()=>{V(),H=p(),U=async(e,{options:{commands:t}})=>(0,H.jsx)(z,{commands:t,onClose:e})}))();export{U as call};
@@ -1,4 +1,4 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Q as o,Rn as s,b as c,f as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,ht as h}from"./state-sIHsFpDu.js";import{Po as g,Qa as _,jo as v,no as y,oo as b}from"./paths-D8Fx3kUi.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{A_ as C,F_ as w,I_ as T,KS as E,Ku as D,LS as O,M_ as k,N_ as A,Nx as j,P_ as ee,Px as M,RS as N,j_ as P,qS as F,qu as te,zS as ne}from"./loadAgentsDir-HZ19tmOZ.js";import{t as re}from"./useKeybinding-FsOnjW6T.js";function ie(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);C(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=h();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}else if(process.env.USER_TYPE===`ant`){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:{type:`command`,command:`[ANT-ONLY] Built-in Hook`},matcher:e.matcher,source:`builtinHook`})}}}return n}function ae(e,t){return T(Object.keys(e[t]||{}),e,t)}function oe(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),m(),w(),L=n(function(e){return{PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./memoize-DNnuA2aU.js";import{n as i,t as a}from"./figures-gfT9mM8P.js";import{Q as o,Rn as s,b as c,f as l,t as u,tt as d,x as f}from"./src-Di342QoJ.js";import{t as p}from"./jsx-runtime-D-D469L8.js";import{cn as m,ht as h}from"./state-sIHsFpDu.js";import{Po as g,Qa as _,jo as v,no as y,oo as b}from"./paths-BZbIj1Z1.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{B_ as C,F_ as w,HS as T,I_ as E,L_ as D,Lx as O,P_ as k,R_ as ee,Rx as A,US as j,VS as M,XS as N,Xu as P,ZS as te,Zu as ne,z_ as F}from"./loadAgentsDir-DaApSWNv.js";import{t as re}from"./useKeybinding-FsOnjW6T.js";function ie(e,t){let n={PreToolUse:{},PostToolUse:{},PostToolUseFailure:{},PermissionDenied:{},Notification:{},UserPromptSubmit:{},SessionStart:{},SessionEnd:{},Stop:{},StopFailure:{},SubagentStart:{},SubagentStop:{},PreCompact:{},PostCompact:{},PermissionRequest:{},Setup:{},TeammateIdle:{},TaskCreated:{},TaskCompleted:{},Elicitation:{},ElicitationResult:{},ConfigChange:{},WorktreeCreate:{},WorktreeRemove:{},InstructionsLoaded:{},CwdChanged:{},FileChanged:{}},r=L(t);k(e).forEach(e=>{let t=n[e.event];if(t){let n=r[e.event].matcherMetadata===void 0?``:e.matcher||``;t[n]||(t[n]=[]),t[n].push(e)}});let i=h();if(i)for(let[e,t]of Object.entries(i)){let r=e,i=n[r];if(i)for(let e of t??[]){let t=e.matcher||``;if(`pluginRoot`in e){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:n,matcher:e.matcher,source:`pluginHook`,pluginName:e.pluginId})}else if(process.env.USER_TYPE===`ant`){i[t]??(i[t]=[]);for(let n of e.hooks)i[t].push({event:r,config:{type:`command`,command:`[ANT-ONLY] Built-in Hook`},matcher:e.matcher,source:`builtinHook`})}}}return n}function ae(e,t){return C(Object.keys(e[t]||{}),e,t)}function oe(e,t,n){let r=n??``;return e[t]?.[r]??[]}function I(e,t){return L(t)[e].matcherMetadata}var L,R=e((()=>{r(),m(),F(),L=n(function(e){return{PreToolUse:{summary:`Before tool execution`,description:`Input to command is JSON of tool call arguments.
2
2
  Exit code 0 - stdout/stderr not shown
3
3
  Exit code 2 - show stderr to model and block tool call
4
4
  Other exit codes - show stderr to user only but continue with tool call`,matcherMetadata:{fieldToMatch:`tool_name`,values:e}},PostToolUse:{summary:`After tool execution`,description:`Input to command is JSON with fields "inputs" (tool call arguments) and "response" (tool call response).
@@ -76,4 +76,4 @@ CLAUDE_ENV_FILE is set — write bash exports there to apply env to subsequent B
76
76
  The matcher field specifies filenames to watch in the current directory (e.g. ".envrc|.env").
77
77
  Hook output can include hookSpecificOutput.watchPaths (array of absolute paths) to dynamically update the watch list.
78
78
  Exit code 0 - command completes successfully
79
- Other exit codes - show stderr to user only`}}},e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:s}){return(0,B.jsx)(l,{title:`Hooks`,subtitle:`${n} ${g(n,`hook`)} configured`,onCancel:s,children:(0,B.jsxs)(f,{flexDirection:`column`,gap:1,children:[r&&(0,B.jsxs)(f,{flexDirection:`column`,children:[(0,B.jsxs)(c,{color:`suggestion`,children:[a.info,` Hooks Restricted by Policy`]}),(0,B.jsx)(c,{dimColor:!0,children:`Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked.`})]}),(0,B.jsx)(f,{flexDirection:`column`,children:(0,B.jsxs)(c,{dimColor:!0,children:[a.info,` This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.`,` `,(0,B.jsx)(o,{url:`https://code.claude.com/docs/en/hooks`,children:`Learn more`})]})}),(0,B.jsx)(f,{flexDirection:`column`,children:(0,B.jsx)(j,{onChange:e=>{i(e)},onCancel:s,options:Object.entries(e).map(([e,n])=>{let r=t[e]||0;return{label:r>0?(0,B.jsxs)(c,{children:[e,` `,(0,B.jsxs)(c,{color:`suggestion`,children:[`(`,r,`)`]})]}):e,value:e,description:n.summary}})})})]})})}var B,V=e((()=>{i(),s(),u(),v(),M(),B=p()}));function H({selectedEvent:e,selectedMatcher:t,hooksForSelectedMatcher:n,hookEventMetadata:r,onSelect:i,onCancel:a}){let o=r.matcherMetadata===void 0?e:`${e} - Matcher: ${t||`(all)`}`;return n.length===0?(0,U.jsx)(l,{title:o,subtitle:r.description,onCancel:a,inputGuide:()=>(0,U.jsx)(c,{children:`Esc to go back`}),children:(0,U.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,U.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,U.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,U.jsx)(l,{title:o,subtitle:r.description,onCancel:a,children:(0,U.jsx)(f,{flexDirection:`column`,children:(0,U.jsx)(j,{options:n.map((e,t)=>({label:`[${e.config.type}] ${P(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${A(e.source)} (${e.pluginName})`:A(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{s(),u(),w(),M(),U=p()}));function G({selectedEvent:e,matchersForSelectedEvent:t,hooksByEventAndMatcher:n,eventDescription:r,onSelect:i,onCancel:a}){let o=K.useMemo(()=>t.map(t=>{let r=n[e]?.[t]||[];return{matcher:t,sources:Array.from(new Set(r.map(e=>e.source))),hookCount:r.length}}),[t,n,e]);return t.length===0?(0,q.jsx)(l,{title:`${e} - Matchers`,subtitle:r,onCancel:a,inputGuide:()=>(0,q.jsx)(c,{children:`Esc to go back`}),children:(0,q.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,q.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,q.jsx)(l,{title:`${e} - Matchers`,subtitle:r,onCancel:a,children:(0,q.jsx)(f,{flexDirection:`column`,children:(0,q.jsx)(j,{options:o.map(e=>({label:`[${e.sources.map(ee).join(`, `)}] ${e.matcher||`(all)`}`,value:e.matcher,description:`${e.hookCount} ${g(e.hookCount,`hook`)}`})),onChange:e=>{i(e)},onCancel:a})})})}var K,q,se=e((()=>{K=t(s(),1),u(),w(),v(),M(),q=p()}));function ce({selectedHook:e,eventSupportsMatcher:t,onCancel:n}){return(0,J.jsx)(l,{title:`Hook details`,onCancel:n,inputGuide:()=>(0,J.jsx)(c,{children:`Esc to go back`}),children:(0,J.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsxs)(c,{children:[`Event: `,(0,J.jsx)(c,{bold:!0,children:e.event})]}),t&&(0,J.jsxs)(c,{children:[`Matcher: `,(0,J.jsx)(c,{bold:!0,children:e.matcher||`(all)`})]}),(0,J.jsxs)(c,{children:[`Type: `,(0,J.jsx)(c,{bold:!0,children:e.config.type})]}),(0,J.jsxs)(c,{children:[`Source: `,(0,J.jsx)(c,{dimColor:!0,children:k(e.source)})]}),e.pluginName&&(0,J.jsxs)(c,{children:[`Plugin: `,(0,J.jsx)(c,{dimColor:!0,children:e.pluginName})]})]}),(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsxs)(c,{dimColor:!0,children:[le(e.config),`:`]}),(0,J.jsx)(f,{borderStyle:`round`,borderDimColor:!0,paddingLeft:1,paddingRight:1,children:(0,J.jsx)(c,{children:ue(e.config)})})]}),`statusMessage`in e.config&&e.config.statusMessage&&(0,J.jsxs)(c,{children:[`Status message: `,(0,J.jsx)(c,{dimColor:!0,children:e.config.statusMessage})]}),(0,J.jsx)(c,{dimColor:!0,children:`To modify or remove this hook, edit settings.json directly or ask Claude to help.`})]})})}function le(e){switch(e.type){case`command`:return`Command`;case`prompt`:return`Prompt`;case`agent`:return`Prompt`;case`http`:return`URL`}}function ue(e){switch(e.type){case`command`:return e.command;case`prompt`:return e.prompt;case`agent`:return e.prompt;case`http`:return e.url}}var J,Y=e((()=>{s(),u(),w(),J=p()}));function de({toolNames:e,onExit:t}){let[n,r]=(0,X.useState)({mode:`select-event`}),[i,a]=(0,X.useState)(()=>y()?.disableAllHooks===!0&&_(`policySettings`)?.disableAllHooks===!0),[o,s]=(0,X.useState)(()=>_(`policySettings`)?.allowManagedHooksOnly===!0);F(e=>{e===`policySettings`&&(a(y()?.disableAllHooks===!0&&_(`policySettings`)?.disableAllHooks===!0),s(_(`policySettings`)?.allowManagedHooksOnly===!0))});let u=n.mode,p=`event`in n?n.event:`PreToolUse`,m=`matcher`in n?n.matcher:null,h=N(e=>e.mcp),v=ne(),b=(0,X.useMemo)(()=>[...e,...h.tools.map(e=>e.name)],[e,h.tools]),x=(0,X.useMemo)(()=>ie(v.getState(),b),[b,v]),S=(0,X.useMemo)(()=>ae(x,p),[x,p]),C=(0,X.useMemo)(()=>oe(x,p,m),[x,p,m]),w=(0,X.useCallback)(()=>{t(`Hooks dialog dismissed`,{display:`system`})},[t]);d(`confirm:no`,w,{context:`Confirmation`,isActive:u===`select-event`}),d(`confirm:no`,()=>{r({mode:`select-event`})},{context:`Confirmation`,isActive:u===`select-matcher`}),d(`confirm:no`,()=>{`event`in n&&(I(n.event,b)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event}))},{context:`Confirmation`,isActive:u===`select-hook`}),d(`confirm:no`,()=>{if(n.mode===`view-hook`){let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}},{context:`Confirmation`,isActive:u===`view-hook`});let T=L(b),E=y()?.disableAllHooks===!0,{hooksByEvent:D,totalHooksCount:O}=(0,X.useMemo)(()=>{let e={},t=0;for(let[n,r]of Object.entries(x)){let i=Object.values(r).reduce((e,t)=>e+t.length,0);e[n]=i,t+=i}return{hooksByEvent:e,totalHooksCount:t}},[x]);if(E)return(0,Z.jsx)(l,{title:`Hook Configuration - Disabled`,onCancel:w,inputGuide:()=>(0,Z.jsx)(c,{children:`Esc to close`}),children:(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsxs)(f,{flexDirection:`column`,children:[(0,Z.jsxs)(c,{children:[`All hooks are currently `,(0,Z.jsx)(c,{bold:!0,children:`disabled`}),i&&` by a managed settings file`,`. You have `,(0,Z.jsx)(c,{bold:!0,children:O}),` `,`configured `,g(O,`hook`),` that `,g(O,`is`,`are`),` not running.`]}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsx)(c,{dimColor:!0,children:`When hooks are disabled:`})}),(0,Z.jsx)(c,{dimColor:!0,children:`· No hook commands will execute`}),(0,Z.jsx)(c,{dimColor:!0,children:`· StatusLine will not be displayed`}),(0,Z.jsx)(c,{dimColor:!0,children:`· Tool operations will proceed without hook validation`})]}),!i&&(0,Z.jsx)(c,{dimColor:!0,children:`To re-enable hooks, remove "disableAllHooks" from settings.json or ask Claude.`})]})});switch(n.mode){case`select-event`:return(0,Z.jsx)(z,{hookEventMetadata:T,hooksByEvent:D,totalHooksCount:O,restrictedByPolicy:o,onSelectEvent:e=>{I(e,b)===void 0?r({mode:`select-hook`,event:e,matcher:``}):r({mode:`select-matcher`,event:e})},onCancel:w});case`select-matcher`:return(0,Z.jsx)(G,{selectedEvent:n.event,matchersForSelectedEvent:S,hooksByEventAndMatcher:x,eventDescription:T[n.event].description,onSelect:e=>{r({mode:`select-hook`,event:n.event,matcher:e})},onCancel:()=>{r({mode:`select-event`})}});case`select-hook`:return(0,Z.jsx)(H,{selectedEvent:n.event,selectedMatcher:n.matcher,hooksForSelectedMatcher:C,hookEventMetadata:T[n.event],onSelect:e=>{r({mode:`view-hook`,event:n.event,hook:e})},onCancel:()=>{I(n.event,b)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event})}});case`view-hook`:return(0,Z.jsx)(ce,{selectedHook:n.hook,eventSupportsMatcher:I(n.event,b)!==void 0,onCancel:()=>{let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}})}}var X,Z,fe=e((()=>{s(),X=t(s(),1),O(),E(),u(),re(),R(),b(),v(),V(),W(),se(),Y(),Z=p()})),Q,$;e((()=>{fe(),x(),te(),Q=p(),$=async(e,t)=>{S(`tengu_hooks_command`,{});let n=t.getAppState().toolPermissionContext;return(0,Q.jsx)(de,{toolNames:D(n).map(e=>e.name),onExit:e})}}))();export{$ as call};
79
+ Other exit codes - show stderr to user only`}}},e=>e.slice().sort().join(`,`))}));function z({hookEventMetadata:e,hooksByEvent:t,totalHooksCount:n,restrictedByPolicy:r,onSelectEvent:i,onCancel:s}){return(0,B.jsx)(l,{title:`Hooks`,subtitle:`${n} ${g(n,`hook`)} configured`,onCancel:s,children:(0,B.jsxs)(f,{flexDirection:`column`,gap:1,children:[r&&(0,B.jsxs)(f,{flexDirection:`column`,children:[(0,B.jsxs)(c,{color:`suggestion`,children:[a.info,` Hooks Restricted by Policy`]}),(0,B.jsx)(c,{dimColor:!0,children:`Only hooks from managed settings can run. User-defined hooks from ~/.claude/settings.json, .claude/settings.json, and .claude/settings.local.json are blocked.`})]}),(0,B.jsx)(f,{flexDirection:`column`,children:(0,B.jsxs)(c,{dimColor:!0,children:[a.info,` This menu is read-only. To add or modify hooks, edit settings.json directly or ask Claude.`,` `,(0,B.jsx)(o,{url:`https://code.claude.com/docs/en/hooks`,children:`Learn more`})]})}),(0,B.jsx)(f,{flexDirection:`column`,children:(0,B.jsx)(O,{onChange:e=>{i(e)},onCancel:s,options:Object.entries(e).map(([e,n])=>{let r=t[e]||0;return{label:r>0?(0,B.jsxs)(c,{children:[e,` `,(0,B.jsxs)(c,{color:`suggestion`,children:[`(`,r,`)`]})]}):e,value:e,description:n.summary}})})})]})})}var B,V=e((()=>{i(),s(),u(),v(),A(),B=p()}));function H({selectedEvent:e,selectedMatcher:t,hooksForSelectedMatcher:n,hookEventMetadata:r,onSelect:i,onCancel:a}){let o=r.matcherMetadata===void 0?e:`${e} - Matcher: ${t||`(all)`}`;return n.length===0?(0,U.jsx)(l,{title:o,subtitle:r.description,onCancel:a,inputGuide:()=>(0,U.jsx)(c,{children:`Esc to go back`}),children:(0,U.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,U.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,U.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,U.jsx)(l,{title:o,subtitle:r.description,onCancel:a,children:(0,U.jsx)(f,{flexDirection:`column`,children:(0,U.jsx)(O,{options:n.map((e,t)=>({label:`[${e.config.type}] ${w(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${D(e.source)} (${e.pluginName})`:D(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{s(),u(),F(),A(),U=p()}));function G({selectedEvent:e,matchersForSelectedEvent:t,hooksByEventAndMatcher:n,eventDescription:r,onSelect:i,onCancel:a}){let o=K.useMemo(()=>t.map(t=>{let r=n[e]?.[t]||[];return{matcher:t,sources:Array.from(new Set(r.map(e=>e.source))),hookCount:r.length}}),[t,n,e]);return t.length===0?(0,q.jsx)(l,{title:`${e} - Matchers`,subtitle:r,onCancel:a,inputGuide:()=>(0,q.jsx)(c,{children:`Esc to go back`}),children:(0,q.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(c,{dimColor:!0,children:`No hooks configured for this event.`}),(0,q.jsx)(c,{dimColor:!0,children:`To add hooks, edit settings.json directly or ask Claude.`})]})}):(0,q.jsx)(l,{title:`${e} - Matchers`,subtitle:r,onCancel:a,children:(0,q.jsx)(f,{flexDirection:`column`,children:(0,q.jsx)(O,{options:o.map(e=>({label:`[${e.sources.map(ee).join(`, `)}] ${e.matcher||`(all)`}`,value:e.matcher,description:`${e.hookCount} ${g(e.hookCount,`hook`)}`})),onChange:e=>{i(e)},onCancel:a})})})}var K,q,se=e((()=>{K=t(s(),1),u(),F(),v(),A(),q=p()}));function ce({selectedHook:e,eventSupportsMatcher:t,onCancel:n}){return(0,J.jsx)(l,{title:`Hook details`,onCancel:n,inputGuide:()=>(0,J.jsx)(c,{children:`Esc to go back`}),children:(0,J.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsxs)(c,{children:[`Event: `,(0,J.jsx)(c,{bold:!0,children:e.event})]}),t&&(0,J.jsxs)(c,{children:[`Matcher: `,(0,J.jsx)(c,{bold:!0,children:e.matcher||`(all)`})]}),(0,J.jsxs)(c,{children:[`Type: `,(0,J.jsx)(c,{bold:!0,children:e.config.type})]}),(0,J.jsxs)(c,{children:[`Source: `,(0,J.jsx)(c,{dimColor:!0,children:E(e.source)})]}),e.pluginName&&(0,J.jsxs)(c,{children:[`Plugin: `,(0,J.jsx)(c,{dimColor:!0,children:e.pluginName})]})]}),(0,J.jsxs)(f,{flexDirection:`column`,children:[(0,J.jsxs)(c,{dimColor:!0,children:[le(e.config),`:`]}),(0,J.jsx)(f,{borderStyle:`round`,borderDimColor:!0,paddingLeft:1,paddingRight:1,children:(0,J.jsx)(c,{children:ue(e.config)})})]}),`statusMessage`in e.config&&e.config.statusMessage&&(0,J.jsxs)(c,{children:[`Status message: `,(0,J.jsx)(c,{dimColor:!0,children:e.config.statusMessage})]}),(0,J.jsx)(c,{dimColor:!0,children:`To modify or remove this hook, edit settings.json directly or ask Claude to help.`})]})})}function le(e){switch(e.type){case`command`:return`Command`;case`prompt`:return`Prompt`;case`agent`:return`Prompt`;case`http`:return`URL`}}function ue(e){switch(e.type){case`command`:return e.command;case`prompt`:return e.prompt;case`agent`:return e.prompt;case`http`:return e.url}}var J,Y=e((()=>{s(),u(),F(),J=p()}));function de({toolNames:e,onExit:t}){let[n,r]=(0,X.useState)({mode:`select-event`}),[i,a]=(0,X.useState)(()=>y()?.disableAllHooks===!0&&_(`policySettings`)?.disableAllHooks===!0),[o,s]=(0,X.useState)(()=>_(`policySettings`)?.allowManagedHooksOnly===!0);te(e=>{e===`policySettings`&&(a(y()?.disableAllHooks===!0&&_(`policySettings`)?.disableAllHooks===!0),s(_(`policySettings`)?.allowManagedHooksOnly===!0))});let u=n.mode,p=`event`in n?n.event:`PreToolUse`,m=`matcher`in n?n.matcher:null,h=T(e=>e.mcp),v=j(),b=(0,X.useMemo)(()=>[...e,...h.tools.map(e=>e.name)],[e,h.tools]),x=(0,X.useMemo)(()=>ie(v.getState(),b),[b,v]),S=(0,X.useMemo)(()=>ae(x,p),[x,p]),C=(0,X.useMemo)(()=>oe(x,p,m),[x,p,m]),w=(0,X.useCallback)(()=>{t(`Hooks dialog dismissed`,{display:`system`})},[t]);d(`confirm:no`,w,{context:`Confirmation`,isActive:u===`select-event`}),d(`confirm:no`,()=>{r({mode:`select-event`})},{context:`Confirmation`,isActive:u===`select-matcher`}),d(`confirm:no`,()=>{`event`in n&&(I(n.event,b)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event}))},{context:`Confirmation`,isActive:u===`select-hook`}),d(`confirm:no`,()=>{if(n.mode===`view-hook`){let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}},{context:`Confirmation`,isActive:u===`view-hook`});let E=L(b),D=y()?.disableAllHooks===!0,{hooksByEvent:O,totalHooksCount:k}=(0,X.useMemo)(()=>{let e={},t=0;for(let[n,r]of Object.entries(x)){let i=Object.values(r).reduce((e,t)=>e+t.length,0);e[n]=i,t+=i}return{hooksByEvent:e,totalHooksCount:t}},[x]);if(D)return(0,Z.jsx)(l,{title:`Hook Configuration - Disabled`,onCancel:w,inputGuide:()=>(0,Z.jsx)(c,{children:`Esc to close`}),children:(0,Z.jsxs)(f,{flexDirection:`column`,gap:1,children:[(0,Z.jsxs)(f,{flexDirection:`column`,children:[(0,Z.jsxs)(c,{children:[`All hooks are currently `,(0,Z.jsx)(c,{bold:!0,children:`disabled`}),i&&` by a managed settings file`,`. You have `,(0,Z.jsx)(c,{bold:!0,children:k}),` `,`configured `,g(k,`hook`),` that `,g(k,`is`,`are`),` not running.`]}),(0,Z.jsx)(f,{marginTop:1,children:(0,Z.jsx)(c,{dimColor:!0,children:`When hooks are disabled:`})}),(0,Z.jsx)(c,{dimColor:!0,children:`· No hook commands will execute`}),(0,Z.jsx)(c,{dimColor:!0,children:`· StatusLine will not be displayed`}),(0,Z.jsx)(c,{dimColor:!0,children:`· Tool operations will proceed without hook validation`})]}),!i&&(0,Z.jsx)(c,{dimColor:!0,children:`To re-enable hooks, remove "disableAllHooks" from settings.json or ask Claude.`})]})});switch(n.mode){case`select-event`:return(0,Z.jsx)(z,{hookEventMetadata:E,hooksByEvent:O,totalHooksCount:k,restrictedByPolicy:o,onSelectEvent:e=>{I(e,b)===void 0?r({mode:`select-hook`,event:e,matcher:``}):r({mode:`select-matcher`,event:e})},onCancel:w});case`select-matcher`:return(0,Z.jsx)(G,{selectedEvent:n.event,matchersForSelectedEvent:S,hooksByEventAndMatcher:x,eventDescription:E[n.event].description,onSelect:e=>{r({mode:`select-hook`,event:n.event,matcher:e})},onCancel:()=>{r({mode:`select-event`})}});case`select-hook`:return(0,Z.jsx)(H,{selectedEvent:n.event,selectedMatcher:n.matcher,hooksForSelectedMatcher:C,hookEventMetadata:E[n.event],onSelect:e=>{r({mode:`view-hook`,event:n.event,hook:e})},onCancel:()=>{I(n.event,b)===void 0?r({mode:`select-event`}):r({mode:`select-matcher`,event:n.event})}});case`view-hook`:return(0,Z.jsx)(ce,{selectedHook:n.hook,eventSupportsMatcher:I(n.event,b)!==void 0,onCancel:()=>{let{event:e,hook:t}=n;r({mode:`select-hook`,event:e,matcher:t.matcher||``})}})}}var X,Z,fe=e((()=>{s(),X=t(s(),1),M(),N(),u(),re(),R(),b(),v(),V(),W(),se(),Y(),Z=p()})),Q,$;e((()=>{fe(),x(),ne(),Q=p(),$=async(e,t)=>{S(`tengu_hooks_command`,{});let n=t.getAppState().toolPermissionContext;return(0,Q.jsx)(de,{toolNames:P(n).map(e=>e.name),onExit:e})}}))();export{$ as call};
@@ -0,0 +1 @@
1
+ import{$t as e,Cn as t,Sn as n,mn as r}from"./loadAgentsDir-DaApSWNv.js";t();export{e as executeSessionEndHooks,r as getSessionEndHookTimeoutMs,n as hasWorktreeCreateHook};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n}from"./debug-UI3T040K.js";import{o as r,r as i}from"./common-B379wT22.js";import{c as a,s as o}from"./escHotkey-Cyz0yyh1.js";import{i as s,n as c,r as l}from"./gates-BGfvIJXl.js";import{n as u,t as d}from"./executor-4EeD8GNm.js";import{format as f}from"util";function p(){try{return Bun.spawnSync({cmd:[`osascript`,`-e`,`tell application "System Events" to get name of every process whose background only is false`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function m(){try{return Bun.spawnSync({cmd:[`screencapture`,`-x`,`-R`,`0,0,1,1`,`/dev/null`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function h(){return _||(_={serverName:i,logger:new g,executor:d({getMouseAnimationEnabled:()=>l().mouseAnimation,getHideBeforeActionEnabled:()=>l().hideBeforeAction}),ensureOsPermissions:async()=>{if(process.platform!==`darwin`)return{granted:!0};let e=a().tcc;if(e){let t=e.checkAccessibility(),n=e.checkScreenRecording();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}}let t=p(),n=m();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}},isDisabled:()=>!c(),getSubGates:l,getAutoUnhideEnabled:()=>!0,cropRawPatch:()=>null},_)}var g,_,v=e((()=>{n(),r(),u(),s(),o(),g=class{silly(e,n){t(f(e,n??``),{level:`debug`})}debug(e,n){t(f(e,n??``),{level:`debug`})}info(e,n){t(f(e,n??``),{level:`info`})}warn(e,n){t(f(e,n??``),{level:`warn`})}error(e,n){t(f(e,n??``),{level:`error`})}}}));export{v as n,h as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n}from"./debug-UI3T040K.js";import{o as r,r as i}from"./common-B379wT22.js";import{c as a,s as o}from"./escHotkey-Cyz0yyh1.js";import{i as s,n as c,r as l}from"./gates-Be4ovdxj.js";import{n as u,t as d}from"./executor-4EeD8GNm.js";import{format as f}from"util";function p(){try{return Bun.spawnSync({cmd:[`osascript`,`-e`,`tell application "System Events" to get name of every process whose background only is false`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function m(){try{return Bun.spawnSync({cmd:[`screencapture`,`-x`,`-R`,`0,0,1,1`,`/dev/null`],stdout:`pipe`,stderr:`pipe`}).exitCode===0}catch{return!1}}function h(){return _||(_={serverName:i,logger:new g,executor:d({getMouseAnimationEnabled:()=>l().mouseAnimation,getHideBeforeActionEnabled:()=>l().hideBeforeAction}),ensureOsPermissions:async()=>{if(process.platform!==`darwin`)return{granted:!0};let e=a().tcc;if(e){let t=e.checkAccessibility(),n=e.checkScreenRecording();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}}let t=p(),n=m();return t&&n?{granted:!0}:{granted:!1,accessibility:t,screenRecording:n}},isDisabled:()=>!c(),getSubGates:l,getAutoUnhideEnabled:()=>!0,cropRawPatch:()=>null},_)}var g,_,v=e((()=>{n(),r(),u(),s(),o(),g=class{silly(e,n){t(f(e,n??``),{level:`debug`})}debug(e,n){t(f(e,n??``),{level:`debug`})}info(e,n){t(f(e,n??``),{level:`info`})}warn(e,n){t(f(e,n??``),{level:`warn`})}error(e,n){t(f(e,n??``),{level:`error`})}}}));export{v as n,h as t};
@@ -1,2 +1,2 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,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{Ac as u,Pc as d,Sc as f}from"./paths-D8Fx3kUi.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{r as _,t as v}from"./execFileNoThrow-CuQN1sz8.js";import{BS as y,LS as b,Nx as x,RS as S,Sx as C,Xb as w,Zb as T,cx as E,ix as D,kx as O,lx as k,my as A,px as j,sx as M,wt as N,xt as P}from"./loadAgentsDir-HZ19tmOZ.js";import*as F from"path";function I({onComplete:e}){return(0,V.jsxs)(o,{title:`Do you wish to enable auto-connect to IDE?`,color:`ide`,onCancel:e,children:[(0,V.jsx)(x,{options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}],onChange:(0,B.useCallback)(async t=>{let n=t===`yes`;d(e=>({...e,autoConnectIde:n,hasIdeAutoConnectDialogBeenShown:!0})),e()},[e]),defaultValue:`yes`}),(0,V.jsx)(a,{dimColor:!0,children:`You can also configure this in /config or with the --ide flag`})]})}function L(){let e=f();return!k()&&e.autoConnectIde!==!0&&e.hasIdeAutoConnectDialogBeenShown!==!0}function R({onComplete:e}){let t=(0,B.useCallback)(t=>{let n=t===`yes`;n&&d(e=>({...e,autoConnectIde:!1})),e(n)},[e]);return(0,V.jsx)(o,{title:`Do you wish to disable auto-connect to IDE?`,subtitle:`You can also configure this in /config`,onCancel:(0,B.useCallback)(()=>{e(!1)},[e]),color:`ide`,children:(0,V.jsx)(x,{options:[{label:`No`,value:`no`},{label:`Yes`,value:`yes`}],onChange:t,defaultValue:`no`})})}function z(){let e=f();return!k()&&e.autoConnectIde===!0}var B,V,H=e((()=>{B=t(i(),1),s(),u(),D(),A(),V=l()}));function U({availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:r,onSelect:i}){let[s,l]=(0,Z.useState)(n?.port?.toString()??`None`),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=(0,Z.useCallback)(t=>{t!==`None`&&L()?d(!0):t===`None`&&z()?p(!0):i(e.find(e=>e.port===parseInt(t,10)))},[e,i]),h=e.reduce((e,t)=>(e[t.name]=(e[t.name]||0)+1,e),{}),g=e.map(e=>{let t=(h[e.name]||0)>1&&e.workspaceFolders.length>0;return{label:e.name,value:e.port.toString(),description:t?X(e.workspaceFolders):void 0}}).concat([{label:`None`,value:`None`,description:void 0}]);return u?(0,Q.jsx)(I,{onComplete:()=>m(s)}):f?(0,Q.jsx)(R,{onComplete:()=>{i(void 0)}}):(0,Q.jsx)(o,{title:`Select IDE`,subtitle:`Connect to an IDE for integrated development features.`,onCancel:r,color:`ide`,children:(0,Q.jsxs)(c,{flexDirection:`column`,children:[e.length===0&&(0,Q.jsx)(a,{dimColor:!0,children:E()?`No available IDEs detected. Please install the plugin and restart your IDE:
2
- https://docs.claude.com/s/claude-code-jetbrains`:`No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running.`}),e.length!==0&&(0,Q.jsx)(x,{defaultValue:s,defaultFocusValue:s,options:g,onChange:e=>{l(e),m(e)}}),e.length!==0&&e.some(e=>e.name===`VS Code`||e.name===`Visual Studio Code`)&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{color:`warning`,children:`Note: Only one Claude Code instance can be connected to VS Code at a time.`})}),e.length!==0&&!k()&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{dimColor:!0,children:`Tip: You can enable auto-connect to IDE in /config or with the --ide flag`})}),t.length>0&&(0,Q.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,Q.jsxs)(a,{dimColor:!0,children:[`Found `,t.length,` other running IDE(s). However, their workspace/project directories do not match the current cwd.`]}),(0,Q.jsx)(c,{marginTop:1,flexDirection:`column`,children:t.map((e,t)=>(0,Q.jsx)(c,{paddingLeft:3,children:(0,Q.jsxs)(a,{dimColor:!0,children:[`• `,e.name,`: `,X(e.workspaceFolders)]})},t))})]})]})})}async function W(e,t){let n=t?.ide;if(!n||n.type!==`sse-ide`&&n.type!==`ws-ide`)return null;for(let t of e)if(t.url===n.url)return t;return null}function G({availableIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]?.port?.toString()??``),a=(0,Z.useCallback)(n=>{t(e.find(e=>e.port===parseInt(n,10)))},[e,t]),s=e.map(e=>({label:e.name,value:e.port.toString()}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select an IDE to open the project`,onCancel:c,color:`ide`,children:(0,Q.jsx)(x,{defaultValue:r,defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function K({runningIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]??``),a=(0,Z.useCallback)(e=>{t(e)},[t]),s=e.map(e=>({label:j(e),value:e}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select IDE to install extension`,onCancel:c,color:`ide`,children:(0,Q.jsx)(x,{defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function q({ide:e,onInstall:t}){return(0,Z.useEffect)(()=>{t(e)},[e,t]),null}async function J(e,t,r){m(`tengu_ext_ide_command`,{});let{options:{dynamicMcpConfig:i},onChangeDynamicMcpConfig:a}=t;if(r?.trim()===`open`){let t=P(),r=t?t.worktreePath:g(),i=(await w(!0)).filter(e=>e.isValid);return i.length===0?(e(`No IDEs with Claude Code extension detected.`),null):(0,Q.jsx)(G,{availableIDEs:i,onSelectIDE:async i=>{if(!i){e(`No IDE selected.`);return}if(i.name.toLowerCase().includes(`vscode`)||i.name.toLowerCase().includes(`cursor`)||i.name.toLowerCase().includes(`windsurf`)){let{code:a}=await v(`code`,[r]);e(a===0?`Opened ${t?`worktree`:`project`} in ${n.bold(i.name)}`:`Failed to open in ${i.name}. Try opening manually: ${r}`)}else E(),e(`Please open the ${t?`worktree`:`project`} manually in ${n.bold(i.name)}: ${r}`)},onDone:()=>{e(`Exited without opening IDE`,{display:`system`})}})}let o=await w(!0);if(o.length===0&&t.onInstallIDEExtension&&!k()){let r=await T(),i=r=>{t.onInstallIDEExtension&&(t.onInstallIDEExtension(r),M(r)?e(`Installed plugin to ${n.bold(j(r))}\nPlease ${n.bold(`restart your IDE`)} completely for it to take effect`):e(`Installed extension to ${n.bold(j(r))}`))};if(r.length>1)return(0,Q.jsx)(K,{runningIDEs:r,onSelectIDE:i,onDone:()=>{e(`No IDE selected.`,{display:`system`})}});if(r.length===1)return(0,Q.jsx)(q,{ide:r[0],onInstall:i})}let s=o.filter(e=>e.isValid);return(0,Q.jsx)(Y,{availableIDEs:s,unavailableIDEs:o.filter(e=>!e.isValid),currentIDE:await W(s,i),dynamicMcpConfig:i,onChangeDynamicMcpConfig:a,onDone:e})}function Y({availableIDEs:e,unavailableIDEs:t,currentIDE:n,dynamicMcpConfig:r,onChangeDynamicMcpConfig:i,onDone:o}){let[s,c]=(0,Z.useState)(null),l=S(e=>e.mcp.clients.find(e=>e.name===`ide`)),u=y(),d=(0,Z.useRef)(!0);(0,Z.useEffect)(()=>{if(s){if(d.current){d.current=!1;return}!l||l.type===`pending`||(l.type===`connected`?o(`Connected to ${s.name}.`):l.type===`failed`&&o(`Failed to connect to ${s.name}.`))}},[l,s,o]),(0,Z.useEffect)(()=>{if(!s)return;let e=setTimeout(o,$,`Connection to ${s.name} timed out.`);return()=>clearTimeout(e)},[s,o]);let f=(0,Z.useCallback)(e=>{if(!i){o(`Error connecting to IDE.`);return}let t={...r||{}};if(n&&delete t.ide,!e){l&&l.type===`connected`&&n&&(l.client.onclose=()=>{},C(`ide`,l.config),u(e=>({...e,mcp:{...e.mcp,clients:e.mcp.clients.filter(e=>e.name!==`ide`),tools:e.mcp.tools.filter(e=>!e.name?.startsWith(`mcp__ide__`)),commands:e.mcp.commands.filter(e=>!e.name?.startsWith(`mcp__ide__`))}}))),i(t),o(n?`Disconnected from ${n.name}.`:`No IDE selected.`);return}let a=e.url;t.ide={type:a.startsWith(`ws:`)?`ws-ide`:`sse-ide`,url:a,ideName:e.name,authToken:e.authToken,ideRunningInWindows:e.ideRunningInWindows,scope:`dynamic`},d.current=!0,c(e),i(t)},[r,n,l,u,i,o]);return s?(0,Q.jsxs)(a,{dimColor:!0,children:[`Connecting to `,s.name,`…`]}):(0,Q.jsx)(U,{availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:()=>o(`IDE selection cancelled`,{display:`system`}),onSelect:f})}function X(e,t=100){if(e.length===0)return``;let n=g(),r=e.slice(0,2),i=e.length>2,a=i?3:0,o=t-(r.length-1)*2-a,s=Math.floor(o/r.length),c=n.normalize(`NFC`),l=r.map(e=>{let t=e.normalize(`NFC`);return t.startsWith(c+F.sep)&&(e=t.slice(c.length+1)),e.length<=s?e:`…`+e.slice(-(s-1))}).join(`, `);return i&&(l+=`, …`),l}var Z,Q,$;e((()=>{r(),Z=t(i(),1),p(),A(),s(),H(),O(),b(),h(),_(),D(),N(),Q=l(),$=35e3}))();export{J as call,X as formatWorkspaceFolders};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{In as n,Ln as r,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{Ac as u,Pc as d,Sc as f}from"./paths-BZbIj1Z1.js";import{n as p,r as m}from"./analytics-DqMQntaB.js";import{n as h,t as g}from"./cwd--iizewsn.js";import{r as _,t as v}from"./execFileNoThrow-CuQN1sz8.js";import{Ex as y,HS as b,Lx as x,Nx as S,Ot as C,Tt as w,VS as T,WS as E,_x as D,cx as O,dx as k,ex as A,fx as j,px as M,tx as N,vy as P}from"./loadAgentsDir-DaApSWNv.js";import*as F from"path";function I({onComplete:e}){return(0,V.jsxs)(o,{title:`Do you wish to enable auto-connect to IDE?`,color:`ide`,onCancel:e,children:[(0,V.jsx)(x,{options:[{label:`Yes`,value:`yes`},{label:`No`,value:`no`}],onChange:(0,B.useCallback)(async t=>{let n=t===`yes`;d(e=>({...e,autoConnectIde:n,hasIdeAutoConnectDialogBeenShown:!0})),e()},[e]),defaultValue:`yes`}),(0,V.jsx)(a,{dimColor:!0,children:`You can also configure this in /config or with the --ide flag`})]})}function L(){let e=f();return!M()&&e.autoConnectIde!==!0&&e.hasIdeAutoConnectDialogBeenShown!==!0}function R({onComplete:e}){let t=(0,B.useCallback)(t=>{let n=t===`yes`;n&&d(e=>({...e,autoConnectIde:!1})),e(n)},[e]);return(0,V.jsx)(o,{title:`Do you wish to disable auto-connect to IDE?`,subtitle:`You can also configure this in /config`,onCancel:(0,B.useCallback)(()=>{e(!1)},[e]),color:`ide`,children:(0,V.jsx)(x,{options:[{label:`No`,value:`no`},{label:`Yes`,value:`yes`}],onChange:t,defaultValue:`no`})})}function z(){let e=f();return!M()&&e.autoConnectIde===!0}var B,V,H=e((()=>{B=t(i(),1),s(),u(),O(),P(),V=l()}));function U({availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:r,onSelect:i}){let[s,l]=(0,Z.useState)(n?.port?.toString()??`None`),[u,d]=(0,Z.useState)(!1),[f,p]=(0,Z.useState)(!1),m=(0,Z.useCallback)(t=>{t!==`None`&&L()?d(!0):t===`None`&&z()?p(!0):i(e.find(e=>e.port===parseInt(t,10)))},[e,i]),h=e.reduce((e,t)=>(e[t.name]=(e[t.name]||0)+1,e),{}),g=e.map(e=>{let t=(h[e.name]||0)>1&&e.workspaceFolders.length>0;return{label:e.name,value:e.port.toString(),description:t?X(e.workspaceFolders):void 0}}).concat([{label:`None`,value:`None`,description:void 0}]);return u?(0,Q.jsx)(I,{onComplete:()=>m(s)}):f?(0,Q.jsx)(R,{onComplete:()=>{i(void 0)}}):(0,Q.jsx)(o,{title:`Select IDE`,subtitle:`Connect to an IDE for integrated development features.`,onCancel:r,color:`ide`,children:(0,Q.jsxs)(c,{flexDirection:`column`,children:[e.length===0&&(0,Q.jsx)(a,{dimColor:!0,children:j()?`No available IDEs detected. Please install the plugin and restart your IDE:
2
+ https://docs.claude.com/s/claude-code-jetbrains`:`No available IDEs detected. Make sure your IDE has the Claude Code extension or plugin installed and is running.`}),e.length!==0&&(0,Q.jsx)(x,{defaultValue:s,defaultFocusValue:s,options:g,onChange:e=>{l(e),m(e)}}),e.length!==0&&e.some(e=>e.name===`VS Code`||e.name===`Visual Studio Code`)&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{color:`warning`,children:`Note: Only one Claude Code instance can be connected to VS Code at a time.`})}),e.length!==0&&!M()&&(0,Q.jsx)(c,{marginTop:1,children:(0,Q.jsx)(a,{dimColor:!0,children:`Tip: You can enable auto-connect to IDE in /config or with the --ide flag`})}),t.length>0&&(0,Q.jsxs)(c,{marginTop:1,flexDirection:`column`,children:[(0,Q.jsxs)(a,{dimColor:!0,children:[`Found `,t.length,` other running IDE(s). However, their workspace/project directories do not match the current cwd.`]}),(0,Q.jsx)(c,{marginTop:1,flexDirection:`column`,children:t.map((e,t)=>(0,Q.jsx)(c,{paddingLeft:3,children:(0,Q.jsxs)(a,{dimColor:!0,children:[`• `,e.name,`: `,X(e.workspaceFolders)]})},t))})]})]})})}async function W(e,t){let n=t?.ide;if(!n||n.type!==`sse-ide`&&n.type!==`ws-ide`)return null;for(let t of e)if(t.url===n.url)return t;return null}function G({availableIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]?.port?.toString()??``),a=(0,Z.useCallback)(n=>{t(e.find(e=>e.port===parseInt(n,10)))},[e,t]),s=e.map(e=>({label:e.name,value:e.port.toString()}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select an IDE to open the project`,onCancel:c,color:`ide`,children:(0,Q.jsx)(x,{defaultValue:r,defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function K({runningIDEs:e,onSelectIDE:t,onDone:n}){let[r,i]=(0,Z.useState)(e[0]??``),a=(0,Z.useCallback)(e=>{t(e)},[t]),s=e.map(e=>({label:D(e),value:e}));function c(){n(`IDE selection cancelled`,{display:`system`})}return(0,Q.jsx)(o,{title:`Select IDE to install extension`,onCancel:c,color:`ide`,children:(0,Q.jsx)(x,{defaultFocusValue:r,options:s,onChange:e=>{i(e),a(e)}})})}function q({ide:e,onInstall:t}){return(0,Z.useEffect)(()=>{t(e)},[e,t]),null}async function J(e,t,r){m(`tengu_ext_ide_command`,{});let{options:{dynamicMcpConfig:i},onChangeDynamicMcpConfig:a}=t;if(r?.trim()===`open`){let t=w(),r=t?t.worktreePath:g(),i=(await A(!0)).filter(e=>e.isValid);return i.length===0?(e(`No IDEs with Claude Code extension detected.`),null):(0,Q.jsx)(G,{availableIDEs:i,onSelectIDE:async i=>{if(!i){e(`No IDE selected.`);return}if(i.name.toLowerCase().includes(`vscode`)||i.name.toLowerCase().includes(`cursor`)||i.name.toLowerCase().includes(`windsurf`)){let{code:a}=await v(`code`,[r]);e(a===0?`Opened ${t?`worktree`:`project`} in ${n.bold(i.name)}`:`Failed to open in ${i.name}. Try opening manually: ${r}`)}else j(),e(`Please open the ${t?`worktree`:`project`} manually in ${n.bold(i.name)}: ${r}`)},onDone:()=>{e(`Exited without opening IDE`,{display:`system`})}})}let o=await A(!0);if(o.length===0&&t.onInstallIDEExtension&&!M()){let r=await N(),i=r=>{t.onInstallIDEExtension&&(t.onInstallIDEExtension(r),k(r)?e(`Installed plugin to ${n.bold(D(r))}\nPlease ${n.bold(`restart your IDE`)} completely for it to take effect`):e(`Installed extension to ${n.bold(D(r))}`))};if(r.length>1)return(0,Q.jsx)(K,{runningIDEs:r,onSelectIDE:i,onDone:()=>{e(`No IDE selected.`,{display:`system`})}});if(r.length===1)return(0,Q.jsx)(q,{ide:r[0],onInstall:i})}let s=o.filter(e=>e.isValid);return(0,Q.jsx)(Y,{availableIDEs:s,unavailableIDEs:o.filter(e=>!e.isValid),currentIDE:await W(s,i),dynamicMcpConfig:i,onChangeDynamicMcpConfig:a,onDone:e})}function Y({availableIDEs:e,unavailableIDEs:t,currentIDE:n,dynamicMcpConfig:r,onChangeDynamicMcpConfig:i,onDone:o}){let[s,c]=(0,Z.useState)(null),l=b(e=>e.mcp.clients.find(e=>e.name===`ide`)),u=E(),d=(0,Z.useRef)(!0);(0,Z.useEffect)(()=>{if(s){if(d.current){d.current=!1;return}!l||l.type===`pending`||(l.type===`connected`?o(`Connected to ${s.name}.`):l.type===`failed`&&o(`Failed to connect to ${s.name}.`))}},[l,s,o]),(0,Z.useEffect)(()=>{if(!s)return;let e=setTimeout(o,$,`Connection to ${s.name} timed out.`);return()=>clearTimeout(e)},[s,o]);let f=(0,Z.useCallback)(e=>{if(!i){o(`Error connecting to IDE.`);return}let t={...r||{}};if(n&&delete t.ide,!e){l&&l.type===`connected`&&n&&(l.client.onclose=()=>{},y(`ide`,l.config),u(e=>({...e,mcp:{...e.mcp,clients:e.mcp.clients.filter(e=>e.name!==`ide`),tools:e.mcp.tools.filter(e=>!e.name?.startsWith(`mcp__ide__`)),commands:e.mcp.commands.filter(e=>!e.name?.startsWith(`mcp__ide__`))}}))),i(t),o(n?`Disconnected from ${n.name}.`:`No IDE selected.`);return}let a=e.url;t.ide={type:a.startsWith(`ws:`)?`ws-ide`:`sse-ide`,url:a,ideName:e.name,authToken:e.authToken,ideRunningInWindows:e.ideRunningInWindows,scope:`dynamic`},d.current=!0,c(e),i(t)},[r,n,l,u,i,o]);return s?(0,Q.jsxs)(a,{dimColor:!0,children:[`Connecting to `,s.name,`…`]}):(0,Q.jsx)(U,{availableIDEs:e,unavailableIDEs:t,selectedIDE:n,onClose:()=>o(`IDE selection cancelled`,{display:`system`}),onSelect:f})}function X(e,t=100){if(e.length===0)return``;let n=g(),r=e.slice(0,2),i=e.length>2,a=i?3:0,o=t-(r.length-1)*2-a,s=Math.floor(o/r.length),c=n.normalize(`NFC`),l=r.map(e=>{let t=e.normalize(`NFC`);return t.startsWith(c+F.sep)&&(e=t.slice(c.length+1)),e.length<=s?e:`…`+e.slice(-(s-1))}).join(`, `);return i&&(l+=`, …`),l}var Z,Q,$;e((()=>{r(),Z=t(i(),1),p(),P(),s(),H(),S(),T(),h(),_(),O(),C(),Q=l(),$=35e3}))();export{J as call,X as formatWorkspaceFolders};
@@ -0,0 +1 @@
1
+ import{r as e}from"./inboundAttachments-CiF42Eku.js";export{e as resolveAndPrepend};
@@ -1 +1 @@
1
- import{n as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Ln as i,Tt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{Ct as c,cn as l}from"./state-sIHsFpDu.js";import{d as u,s as d}from"./debug-UI3T040K.js";import{n as f,t as p}from"./lazySchema-2sOku3cX.js";import{a as m,n as h,t as g}from"./bridgeConfig-GQzZVhuF.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),s(),l(),d(),t(),p(),m();var S=3e4;function C(e){u(`[bridge:inbound-attach] ${e}`)}var w=f(()=>o({file_uuid:i(),file_name:i()})),T=f(()=>a(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,c())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
1
+ import{n as e,s as t}from"./envUtils-BWeoiL4Y.js";import{n,t as r}from"./axios-DhfaybwJ.js";import{Ln as i,Tt as a,wn as o}from"./schemas-BGAvj1T4.js";import{t as s}from"./v4-f1i_CNUT.js";import{Ct as c,cn as l}from"./state-sIHsFpDu.js";import{d as u,s as d}from"./debug-UI3T040K.js";import{n as f,t as p}from"./lazySchema-2sOku3cX.js";import{a as m,n as h,t as g}from"./bridgeConfig-C110hgnb.js";import{basename as _,join as v}from"path";import{randomUUID as y}from"crypto";import{mkdir as b,writeFile as x}from"fs/promises";r(),s(),l(),d(),t(),p(),m();var S=3e4;function C(e){u(`[bridge:inbound-attach] ${e}`)}var w=f(()=>o({file_uuid:i(),file_name:i()})),T=f(()=>a(w()));function E(e){if(typeof e!=`object`||!e||!(`file_attachments`in e))return[];let t=T().safeParse(e.file_attachments);return t.success?t.data:[]}function D(e){return _(e).replace(/[^a-zA-Z0-9._-]/g,`_`)||`attachment`}function O(){return v(e(),`uploads`,c())}async function k(e){let t=g();if(!t){C(`skip: no oauth token`);return}let r;try{let i=`${h()}/api/oauth/files/${encodeURIComponent(e.file_uuid)}/content`,a=await n.get(i,{headers:{Authorization:`Bearer ${t}`},responseType:`arraybuffer`,timeout:S,validateStatus:()=>!0});if(a.status!==200){C(`fetch ${e.file_uuid} failed: status=${a.status}`);return}r=Buffer.from(a.data)}catch(t){C(`fetch ${e.file_uuid} threw: ${t}`);return}let i=D(e.file_name),a=(e.file_uuid.slice(0,8)||y().slice(0,8)).replace(/[^a-zA-Z0-9_-]/g,`_`),o=O(),s=v(o,`${a}-${i}`);try{await b(o,{recursive:!0}),await x(s,r)}catch(e){C(`write ${s} failed: ${e}`);return}return C(`resolved ${e.file_uuid} → ${s} (${r.length} bytes)`),s}async function A(e){if(e.length===0)return``;C(`resolving ${e.length} attachment(s)`);let t=(await Promise.all(e.map(k))).filter(e=>e!==void 0);return t.length===0?``:t.map(e=>`@"${e}"`).join(` `)+` `}function j(e,t){if(!t)return e;if(typeof e==`string`)return t+e;let n=e.findLastIndex(e=>e.type===`text`);if(n!==-1){let r=e[n];if(r.type===`text`)return[...e.slice(0,n),{...r,text:t+r.text},...e.slice(n+1)]}return[...e,{type:`text`,text:t.trimEnd()}]}async function M(e,t){let n=E(e);return n.length===0?t:j(t,await A(n))}export{A as i,j as n,M as r,E as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{Ct as i,cn as a,ot as o}from"./state-sIHsFpDu.js";import{Ac as s,Jt as c,Pc as l,Pt as u,S as d,Sc as f,la as p,nn as m,on as h,ua as g,v as _}from"./paths-BZbIj1Z1.js";import{L as v,V as y,X as ee,Y as b,d as x,s as S}from"./debug-UI3T040K.js";import{n as te,r as C}from"./analytics-DqMQntaB.js";import{F as w,P as T,i as ne,m as re,v as E}from"./git-CN3qtTb_.js";import{g as D,m as O}from"./log-CzsijfHZ.js";import{n as k,t as A}from"./sleep-8Eb9j_Ly.js";import{Aa as ie,Ao as ae,Da as oe,Ea as se,Fa as j,Go as ce,Ha as le,Ia as ue,Ma as de,Mo as M,Na as fe,Oa as pe,Pa as N,Pr as P,Vo as F,Wa as me,Xa as he,ey as ge,fd as I,gd as _e,ja as L,ka as ve,ty as R,yr as z}from"./loadAgentsDir-DaApSWNv.js";import{O as B,_ as ye,d as V,k as be,n as H,t as U}from"./rcDebugLog-CF73Wofq.js";import{a as W,c as G,d as xe,f as Se,o as K,r as Ce,s as q,u as J}from"./debugUtils-BBMFODKH.js";import{a as we,i as Te}from"./trustedDevice-oDn6E85N.js";import{a as Y,i as Ee,n as X,o as Z,t as Q}from"./bridgeConfig-C110hgnb.js";import{a as De,o as Oe,r as ke,s as Ae,t as je}from"./bridgeEnabled-DrW-kkAr.js";import{i as Me,t as Ne}from"./assistant-od6Nf6EJ.js";import{t as Pe}from"./capacityWake-BXlUpptF.js";import{n as Fe,t as $}from"./pollConfig-orFqIbGd.js";import{a as Ie,n as Le,r as Re,t as ze}from"./workSecret-mS2OrpxF.js";import{a as Be,i as Ve,n as He,t as Ue}from"./createSession-Bk6r39b1.js";import{i as We,n as Ge}from"./envLessBridgeConfig-BKs6Mk4e.js";import{n as Ke,o as qe}from"./mappers-D54WYYhL.js";import{n as Je,r as Ye,t as Xe}from"./sessionTitle-DyexSH43.js";import{a as Ze,i as Qe,n as $e,o as et,r as tt,t as nt}from"./bridgeMessaging-DobCpZGY.js";import{t as rt}from"./HybridTransport-CP63usH9.js";import{n as it,r as at,t as ot}from"./flushGate-CeFJrqgK.js";import{hostname as st}from"os";import{randomUUID as ct}from"crypto";a(),O(),E(),s(),g(),h(),d(),Y(),R(),ke(),F(),le(),P(),Ve(),We(),Ke(),Ye(),fe(),S(),U(),T(),te(),b(),G(),I(),we(),B(),V(),n(),K(),y(),A(),oe();var lt=2e3,ut=6e4,dt=900*1e3,ft=0;async function pt(e){let{dir:n,machineName:i,branch:a,gitRepoUrl:o,title:s,baseUrl:c,sessionIngressUrl:l,workerType:u,getAccessToken:d,createSession:f,archiveSession:p,getCurrentTitle:m=()=>s,toSDKMessages:h=()=>{throw Error(`BridgeCoreParams.toSDKMessages not provided. Pass it if you use writeMessages() or initialMessages — daemon callers that only use writeSdkMessages() never hit this path.`)},onAuth401:g,getPollIntervalConfig:_=()=>Fe,initialHistoryCap:y=200,initialMessages:b,previouslyFlushedUUIDs:S,onInboundMessage:te,onPermissionResponse:T,onInterrupt:ne,onSetModel:re,onSetMaxThinkingTokens:E,onSetPermissionMode:D,onStateChange:O,onUserMessage:k,perpetual:A,initialSSESequenceNum:ae=0}=e,oe=++ft,{writeBridgePointer:j,clearBridgePointer:ce,readBridgePointer:le}=await import(`./bridgePointer-B2FPGDWR.js`),ue=A?await le(n):null,M=ue?.source===`repl`?ue:null;x(`[bridge:repl] initBridgeCore #${oe} starting (initialMessages=${b?.length??0}${M?` perpetual prior=env:${M.environmentId}`:``})`);let fe=de({baseUrl:c,getAccessToken:d,runnerVersion:`2.6.12`,onDebug:x,onAuth401:g,getTrustedDeviceToken:Te}),N=process.env.USER_TYPE===`ant`?ie(fe):fe,P={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:ct(),workerType:u,environmentId:ct(),reuseEnvironmentId:M?.environmentId,apiBaseUrl:c,sessionIngressUrl:l},F,me;try{let e=await N.registerBridgeEnvironment(P);F=e.environment_id,me=e.environment_secret}catch(e){return q(`registration_failed`,`[bridge:repl] Environment registration failed: ${v(e)}`),M&&await ce(n),O?.(`failed`,v(e)),null}x(`[bridge:repl] Environment registered: ${F}`),w(`info`,`bridge_repl_env_registered`),C(`tengu_bridge_repl_env_registered`,{});async function he(e,t){if(F!==e)return x(`[bridge:repl] Env mismatch (requested ${e}, got ${F}) — cannot reconnect in place`),!1;let n=Se(t),r=n===t?[t]:[t,n];for(let e of r)try{return await N.reconnectSession(F,e),x(`[bridge:repl] Reconnected session ${e} in place on env ${F}`),!0}catch(t){x(`[bridge:repl] reconnectSession(${e}) failed: ${v(t)}`)}return x(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let ge=M?await he(M.environmentId,M.sessionId):!1;M&&!ge&&await ce(n);let I;if(ge&&M){if(I=M.sessionId,x(`[bridge:repl] Perpetual session reused: ${I}`),b&&S)for(let e of b)S.add(e.uuid)}else{let e=await f({environmentId:F,title:s,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});if(!e)return x(`[bridge:repl] Session creation failed, deregistering environment`),C(`tengu_bridge_repl_session_failed`,{}),await N.deregisterEnvironment(F).catch(()=>{}),O?.(`failed`,`Session creation failed`),null;I=e,x(`[bridge:repl] Session created: ${I}`)}await j(n,{sessionId:I,environmentId:F,source:`repl`}),w(`info`,`bridge_repl_session_created`),C(`tengu_bridge_repl_started`,{has_initial_messages:!!(b&&b.length>0),inProtectedNamespace:t()});let L=new Set;if(b)for(let e of b)L.add(e.uuid);let R=new nt(2e3);for(let e of L)R.add(e);let z=new nt(2e3),B=new AbortController,V=null;ye(e=>{B.signal.aborted||V?.reportMetadata(e)},{replayCurrent:!0});let U=0,W=ge?ae:0,G=null,K=null,Ce=Pe(B.signal),J=Ce.wake,we=Ce.signal,Y=new ot,Ee=!k,X=0,Z=null;async function Q(){if(Z)return Z;Z=De();try{return await Z}finally{Z=null}}async function De(){if(X++,H(`doReconnect: attempt=${X}/3 envId=${F} sessionId=${I} workId=${G}`),U++,x(`[bridge:repl] Reconnecting after env lost (attempt ${X}/3)`),X>3)return x(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(V){let e=V.getLastSequenceNum();e>W&&(W=e),V.close(),V=null}if(J(),Y.drop(),G){let e=G;if(await N.stopWork(F,e,!1).catch(()=>{}),G!==e)return x(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),X=0,!0;G=null,K=null}if(B.signal.aborted)return x(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=F;P.reuseEnvironmentId=e;try{let e=await N.registerBridgeEnvironment(P);F=e.environment_id,me=e.environment_secret}catch(e){return P.reuseEnvironmentId=void 0,x(`[bridge:repl] Environment re-registration failed: ${v(e)}`),!1}if(P.reuseEnvironmentId=void 0,x(`[bridge:repl] Re-registered: requested=${e} got=${F}`),B.signal.aborted)return x(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await N.deregisterEnvironment(F).catch(()=>{}),!1;if(V!==null)return x(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),X=0,!0;if(await he(e,I))return C(`tengu_bridge_repl_reconnected_in_place`,{}),X=0,!0;if(F!==e&&C(`tengu_bridge_repl_env_expired_fresh_session`,{}),await p(I),B.signal.aborted)return x(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await N.deregisterEnvironment(F).catch(()=>{}),!1;let t=m(),r=await f({environmentId:F,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?B.signal.aborted?(x(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await p(r),!1):(I=r,_e(xe(r)).catch(()=>{}),W=0,z.clear(),Ee=!k,x(`[bridge:repl] Re-created session: ${I}`),await j(n,{sessionId:I,environmentId:F,source:`repl`}),S?.clear(),X=0,!0):(x(`[bridge:repl] Session creation failed during reconnection`),!1)}function Oe(){return d()}function ke(){let e=Y.end();if(e.length===0)return;if(!V){x(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)R.add(t.uuid);let t=h(e).map(e=>({...e,session_id:I}));x(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),V.writeBatch(t)}let Ae=null;function je(){Ae?.()}function Me(e){if(H(`handleTransportPermanentClose: code=${e} transport=${V?`exists`:`null`} pollAborted=${B.signal.aborted}`),x(`[bridge:repl] Transport permanently closed: code=${e}`),C(`tengu_bridge_repl_ws_closed`,{code:e}),V){let e=V.getLastSequenceNum();e>W&&(W=e),V=null}J();let t=Y.drop();if(t>0&&x(`[bridge:repl] Dropping ${t} pending message(s) on transport close (code=${e})`,{level:`warn`}),e===1e3){O?.(`failed`,`session ended`),B.abort(),je();return}O?.(`reconnecting`,`Remote Control connection lost (code ${e})`),x(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),Q().then(t=>{t||B.signal.aborted||(x(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),C(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),O?.(`failed`,`reconnection failed`),je())})}let Ne;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(Ne=()=>{x(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),Q()},process.on(`SIGUSR2`,Ne));let $=null;process.env.USER_TYPE===`ant`&&ve({fireClose:e=>{if(!$){x(`[bridge:debug] fireClose: no transport wired yet`);return}x(`[bridge:debug] fireClose(${e}) — injecting`),$(e)},forceReconnect:()=>{x(`[bridge:debug] forceReconnect — injecting`),Q()},injectFault:pe,wakePollLoop:J,describe:()=>`env=${F} session=${I} transport=${V?.getStateLabel()??`null`} workId=${G??`null`}`}),mt({api:N,getCredentials:()=>({environmentId:F,environmentSecret:me}),signal:B.signal,getPollIntervalConfig:_,onStateChange:O,getWsState:()=>V?.getStateLabel()??`null`,isAtCapacity:()=>V!==null,capacitySignal:we,onFatalError:je,getHeartbeatInfo:()=>!G||!K?null:{environmentId:F,workId:G,sessionToken:K},onHeartbeatFatal:e=>{if(x(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),V){let e=V.getLastSequenceNum();e>W&&(W=e),V.close(),V=null}Y.drop(),G&&N.stopWork(F,G,!1).catch(e=>{x(`[bridge:repl] stopWork after heartbeat fatal: ${v(e)}`)}),G=null,K=null,J(),O?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await Q()?{environmentId:F,environmentSecret:me}:null},onWorkReceived:(e,t,i,a)=>{if(V?.isConnectedStatus()&&x(`[bridge:repl] Work received while transport connected, replacing with fresh token (workId=${i})`),x(`[bridge:repl] Work received: workId=${i} workSessionId=${e} currentSessionId=${I} match=${Ie(e,I)}`),j(n,{sessionId:I,environmentId:F,source:`repl`}),!Ie(e,I)){x(`[bridge:repl] Rejecting foreign session: expected=${I} got=${e}`);return}G=i,K=t;let o=a||r(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=Oe(),!s){x(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}be(s)}if(C(`tengu_bridge_repl_work_received`,{}),V){let e=V;V=null;let t=e.getLastSequenceNum();t>W&&(W=t),e.close()}Y.deactivate();let u=e=>Qe(e,{transport:V,sessionId:I,onInterrupt:ne,onSetModel:re,onSetMaxThinkingTokens:E,onSetPermissionMode:D}),d=!1,f=e=>{V=e,e.setOnConnect(()=>{if(V===e){if(x(`[bridge:repl] Ingress transport connected`),C(`tengu_bridge_repl_ws_connected`,{}),!o){let e=Oe();e&&be(e)}if(He=!1,!d&&b&&b.length>0){d=!0;let t=y,n=b.filter(e=>Ze(e)&&!S?.has(e.uuid)),r=t>0&&n.length>t?n.slice(-t):n;r.length<n.length&&(x(`[bridge:repl] Capped initial flush: ${n.length} -> ${r.length} (cap=${t})`),C(`tengu_bridge_repl_history_capped`,{eligible_count:n.length,capped_count:r.length}));let i=h(r);if(i.length>0){x(`[bridge:repl] Flushing ${i.length} initial message(s) via transport`);let t=i.map(e=>({...e,session_id:I})),n=e.droppedBatchCount;e.writeBatch(t).then(()=>{if(e.droppedBatchCount>n){x(`[bridge:repl] Initial flush dropped ${e.droppedBatchCount-n} batch(es) — not marking ${i.length} UUID(s) as flushed`);return}if(S)for(let e of i)e.uuid&&S.add(e.uuid)}).catch(e=>x(`[bridge:repl] Initial flush failed: ${e}`)).finally(()=>{V===e&&(ke(),O?.(`connected`))})}else ke(),O?.(`connected`)}else Y.active||O?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);H(`ingress: type=${t.type}${t.type===`control_request`?` subtype=${t.request?.subtype} request_id=${t.request_id}`:``}${t.type===`control_response`?` subtype=${t.response?.subtype} request_id=${t.response?.request_id}`:``}${t.type===`user`?` uuid=${t.uuid}`:``}${t.type===`keep_alive`?``:` len=${e.length}`}`)}catch{H(`ingress (non-JSON): ${String(e).slice(0,200)}`)}tt(e,R,z,te,T,u)}),$=Me,e.setOnClose(t=>{V===e&&(H(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),Me(t))}),!d&&b&&b.length>0&&Y.start(),e.connect()};if(U++,o){let n=ze(c,e),r=U;x(`[bridge:repl] CCR v2: sessionUrl=${n} session=${e} gen=${r}`),at({sessionUrl:n,ingressToken:t,sessionId:e,initialSequenceNum:W}).then(e=>{if(B.signal.aborted){e.close();return}if(r!==U){x(`[bridge:repl] CCR v2: discarding stale handshake gen=${r} current=${U}`),e.close();return}f(e)},e=>{x(`[bridge:repl] CCR v2: createV2ReplTransport failed: ${v(e)}`,{level:`error`}),C(`tengu_bridge_repl_ccr_v2_init_failed`,{}),r===U&&(G&&(N.stopWork(F,G,!1).catch(e=>{x(`[bridge:repl] stopWork after v2 init failure: ${v(e)}`)}),G=null,K=null),J())})}else{let t=Le(l,e);x(`[bridge:repl] Ingress URL: ${t}`),x(`[bridge:repl] Creating HybridTransport: session=${e}`);let n=s??``;f(it(new rt(new URL(t),{Authorization:`Bearer ${n}`,"anthropic-version":`2023-06-01`},e,()=>({Authorization:`Bearer ${Oe()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{O?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),J()}})))}}});let Re=A?setInterval(()=>{Z||j(n,{sessionId:I,environmentId:F,source:`repl`})},60*6e4):null;Re?.unref?.();let Be=_().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{V&&(x(`[bridge:repl] keep_alive sent`),V.write({type:`keep_alive`}).catch(e=>{x(`[bridge:repl] keep_alive write failed: ${v(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;Ae=async()=>{if(He){x(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${F} session=${I}`);return}He=!0;let e=Date.now();if(x(`[bridge:repl] Teardown starting: env=${F} session=${I} workId=${G??`none`} transportState=${V?.getStateLabel()??`null`}`),Re!==null&&clearInterval(Re),Ve!==null&&clearInterval(Ve),Ne&&process.off(`SIGUSR2`,Ne),process.env.USER_TYPE===`ant`&&(se(),$=null),B.abort(),x(`[bridge:repl] Teardown: poll loop aborted`),V){let e=V.getLastSequenceNum();e>W&&(W=e)}if(A){V=null,Y.drop(),await j(n,{sessionId:I,environmentId:F,source:`repl`}),x(`[bridge:repl] Teardown (perpetual): leaving env=${F} session=${I} alive on server, duration=${Date.now()-e}ms`);return}let t=V;if(V=null,Y.drop(),t){let e={...et(I),session_id:I};t.write(e)}let r=G?N.stopWork(F,G,!0).then(()=>{x(`[bridge:repl] Teardown: stopWork completed`)}).catch(e=>{x(`[bridge:repl] Teardown stopWork failed: ${v(e)}`)}):Promise.resolve();await Promise.all([r,p(I)]),t?.close(),x(`[bridge:repl] Teardown: transport closed`),await N.deregisterEnvironment(F).catch(e=>{x(`[bridge:repl] Teardown deregister failed: ${v(e)}`)}),await ce(n),x(`[bridge:repl] Teardown complete: env=${F} duration=${Date.now()-e}ms`)};let Ue=ee(()=>Ae?.());return x(`[bridge:repl] Ready: env=${F} session=${I}`),O?.(`ready`),{get bridgeSessionId(){return I},get environmentId(){return F},getSSESequenceNum(){let e=V?.getLastSequenceNum()??0;return Math.max(W,e)},sessionIngressUrl:l,writeMessages(e){let t=e.filter(e=>Ze(e)&&!L.has(e.uuid)&&!R.has(e.uuid));if(t.length===0)return;if(!Ee)for(let e of t){let t=$e(e);if(t!==void 0&&k?.(t,I)){Ee=!0;break}}if(Y.enqueue(...t)){x(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!V){let e=t.map(e=>e.type).join(`,`);x(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${I}`,{level:`warn`});return}for(let e of t)R.add(e.uuid);x(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=h(t).map(e=>({...e,session_id:I}));V.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!R.has(e.uuid));if(t.length===0)return;if(!V){x(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${I}`,{level:`warn`});return}for(let e of t)e.uuid&&R.add(e.uuid);let n=t.map(e=>({...e,session_id:I}));V.writeBatch(n)},sendControlRequest(e){if(!V){x(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:I};V.write(t),x(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!V){x(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:I};V.write(t),x(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!V){x(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:I};V.write(t),x(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!V){x(`[bridge:repl] sendResult: skipping, transport not configured session=${I}`);return}V.reportState(`idle`);let e={...et(I),session_id:I};V.write(e),x(`[bridge:repl] Sent result for session=${I}`)},async teardown(){Ue(),await Ae?.(),x(`[bridge:repl] Torn down`),C(`tengu_bridge_repl_teardown`,{})}}}async function mt({api:e,getCredentials:t,signal:n,onStateChange:r,onWorkReceived:i,onEnvironmentLost:a,getWsState:o,isAtCapacity:s,capacitySignal:c,onFatalError:l,getPollIntervalConfig:u=()=>Fe,getHeartbeatInfo:d,onHeartbeatFatal:f}){x(`[bridge:repl] Starting work poll loop for env=${t().environmentId}`);let p=0,m=null,h=null,g=0,_=!1;for(;!n.aborted;){let{environmentId:y,environmentSecret:ee}=t(),b=u();try{let t=await e.pollForWork(y,ee,n,b.reclaim_older_than_ms);if(g=0,p>0&&(x(`[bridge:repl] Poll recovered after ${p} consecutive error(s)`),p=0,m=null,h=null,r?.(`ready`)),!t){let t=_;if(_=!1,s?.()&&c&&!t){let t=b.poll_interval_ms_at_capacity;if(b.non_exclusive_heartbeat_interval_ms>0&&d){C(`tengu_bridge_heartbeat_mode_entered`,{heartbeat_interval_ms:b.non_exclusive_heartbeat_interval_ms});let r=t>0?Date.now()+t:null,i=!1,a=0;for(;!n.aborted&&s()&&(r===null||Date.now()<r);){let t=u();if(t.non_exclusive_heartbeat_interval_ms<=0)break;let n=d();if(!n)break;let r=c();try{await e.heartbeatWork(n.environmentId,n.workId,n.sessionToken)}catch(e){if(x(`[bridge:repl:heartbeat] Failed: ${v(e)}`),e instanceof L){r.cleanup(),C(`tengu_bridge_heartbeat_error`,{status:e.status,error_type:e.status===401||e.status===403?`auth_failed`:`fatal`}),f?(f(e),x(`[bridge:repl:heartbeat] Fatal (status=${e.status}), work state cleared — fast-polling for re-dispatch`)):i=!0;break}}a++,await k(t.non_exclusive_heartbeat_interval_ms,r.signal),r.cleanup()}let o=i?`error`:n.aborted?`shutdown`:s()?r!==null&&Date.now()>=r?`poll_due`:`config_disabled`:`capacity_changed`;if(C(`tengu_bridge_heartbeat_mode_exited`,{reason:o,heartbeat_cycles:a}),!i){o===`poll_due`&&x(`[bridge:repl] Heartbeat poll_due after ${a} cycles — falling through to pollForWork`);continue}}let r=t>0?t:b.non_exclusive_heartbeat_interval_ms;if(r>0){let e=c(),t=Date.now();await k(r,e.signal),e.cleanup();let n=Date.now()-t-r;n>6e4&&(x(`[bridge:repl] At-capacity sleep overran by ${Math.round(n/1e3)}s — process suspension detected, forcing one fast-poll cycle`),C(`tengu_bridge_repl_suspension_detected`,{overrun_ms:n}),_=!0)}}else await k(b.poll_interval_ms_not_at_capacity,n);continue}let a;try{a=Re(t.secret)}catch(n){x(`[bridge:repl] Failed to decode work secret: ${v(n)}`),C(`tengu_bridge_repl_work_secret_failed`,{}),await e.stopWork(y,t.id,!1).catch(()=>{});continue}x(`[bridge:repl] Acknowledging workId=${t.id}`);try{await e.acknowledgeWork(y,t.id,a.session_ingress_token)}catch(e){x(`[bridge:repl] Acknowledge failed workId=${t.id}: ${v(e)}`)}if(t.data.type===`healthcheck`){x(`[bridge:repl] Healthcheck received`);continue}if(t.data.type===`session`){let e=t.data.id;try{ue(e,`session_id`)}catch{x(`[bridge:repl] Invalid session_id in work: ${e}`);continue}i(e,a.session_ingress_token,t.id,a.use_code_sessions===!0),x(`[bridge:repl] Work accepted, continuing poll loop`)}}catch(i){if(n.aborted)break;if(i instanceof L&&i.status===404&&a){let e=t().environmentId;if(y!==e){x(`[bridge:repl] Stale poll error for old env=${y}, current env=${e} — skipping onEnvironmentLost`),p=0,m=null;continue}if(g++,x(`[bridge:repl] Environment deleted, attempting re-registration (attempt ${g}/3)`),C(`tengu_bridge_repl_env_lost`,{attempt:g}),g>3){x(`[bridge:repl] Environment re-registration limit reached (3), giving up`),r?.(`failed`,`Environment deleted and re-registration limit reached`),l?.();break}r?.(`reconnecting`,`environment lost, recreating session`);let i=await a();if(n.aborted)break;if(i){p=0,m=null,r?.(`ready`),x(`[bridge:repl] Re-registered environment: ${i.environmentId}`);continue}r?.(`failed`,`Environment deleted and re-registration failed`),l?.();break}if(i instanceof L){let e=N(i.errorType),t=j(i);x(`[bridge:repl] Fatal poll error: ${i.message} (status=${i.status}, type=${i.errorType??`unknown`})${t?` (suppressed)`:``}`),C(`tengu_bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),w(e?`info`:`error`,`bridge_repl_fatal_error`,{status:i.status,error_type:i.errorType}),t||r?.(`failed`,e?`session expired · /remote-control to reconnect`:i.message),l?.();break}let s=Date.now();h!==null&&s-h>6e4*2&&(x(`[bridge:repl] Detected system sleep (${Math.round((s-h)/1e3)}s gap), resetting poll error budget`),w(`info`,`bridge_repl_poll_sleep_detected`,{gapMs:s-h}),p=0,m=null),h=s,p++,m===null&&(m=s);let c=s-m,f=W(i),_=Ce(i),v=o?.()??`unknown`;if(x(`[bridge:repl] Poll error (attempt ${p}, elapsed ${Math.round(c/1e3)}s, ws=${v}): ${_}`),C(`tengu_bridge_repl_poll_error`,{status:f,consecutiveErrors:p,elapsedMs:c}),p===1&&r?.(`reconnecting`,_),c>=9e5){x(`[bridge:repl] Poll failures exceeded ${dt/1e3}s (${p} errors), giving up`),w(`info`,`bridge_repl_poll_give_up`),C(`tengu_bridge_repl_poll_give_up`,{consecutiveErrors:p,elapsedMs:c,lastStatus:f}),r?.(`failed`,`connection to server lost`);break}let ee=Math.min(lt*2**(p-1),ut);if(u().non_exclusive_heartbeat_interval_ms>0){let t=d?.();if(t)try{await e.heartbeatWork(t.environmentId,t.workId,t.sessionToken)}catch{}}await k(ee,n)}}x(`[bridge:repl] Work poll loop ended (aborted=${n.aborted}) env=${t().environmentId}`)}S(),y(),K(),G();async function ht(t){let{onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,initialMessages:y,getMessages:ee,previouslyFlushedUUIDs:b,initialName:S,perpetual:te,outboundOnly:C,tags:w}=t??{};if(J(Oe),!await De())return q(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!Q())return q(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),g?.(`failed`,`/login`),null;if(await he(),!me(`allow_remote_control`))return q(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),g?.(`failed`,`disabled by your organization's policy`),null;if(!Ee()){let e=f();if(e.bridgeOauthDeadExpiresAt!=null&&(e.bridgeOauthDeadFailCount??0)>=3&&c()?.expiresAt===e.bridgeOauthDeadExpiresAt)return x(`[bridge:repl] Skipping: cross-process backoff (dead token seen ${e.bridgeOauthDeadFailCount} times)`),null;await u();let t=c();if(t&&t.expiresAt!==null&&t.expiresAt<=Date.now()){q(`oauth_expired_unrefreshable`,`[bridge:repl] Skipping: OAuth token expired and refresh failed (re-login required)`),g?.(`failed`,`/login`);let e=t.expiresAt;return l(t=>({...t,bridgeOauthDeadExpiresAt:e,bridgeOauthDeadFailCount:t.bridgeOauthDeadExpiresAt===e?(t.bridgeOauthDeadFailCount??0)+1:1})),null}}let T=X(),E=`remote-control-${ge()}`,D=!1,O=!1;if(S)E=S,D=!0,O=!0;else{let e=i(),t=e?z(e):void 0;if(t)E=t,D=!0,O=!0;else if(y&&y.length>0)for(let e=y.length-1;e>=0;e--){let t=y[e];if(t.type!==`user`||t.isMeta||t.toolUseResult||t.isCompactSummary||t.origin&&t.origin.kind!==`human`||ce(t))continue;let n=ae(t.message.content);if(!n)continue;let r=_t(n);if(r){E=r,D=!0;break}}}let k=0,A,ie=0,oe=(e,t,n)=>{D=!0,E=e,x(`[bridge:repl] derived title from message ${n}: ${e}`),Be(t,e,{baseUrl:T,getAccessToken:Q}).catch(()=>{})},se=(e,t)=>{let n=++ie,r=k;Je(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===ie&&A===t&&!z(i())&&oe(e,t,r)})},j=(e,t)=>{if(O||z(i()))return!0;if(A!==void 0&&A!==t&&(k=0),A=t,k++,k===1&&!D){let n=_t(e);n&&oe(n,t,k),se(e,t)}else if(k===3){let n=ee?.();se(n?Xe(M(n)):e,t)}return k>=3},le=_(`tengu_bridge_initial_history_cap`,200,300*1e3),ue=Z()?`self-hosted`:await p();if(!ue)return q(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),g?.(`failed`,`/login`),null;if(Ae()&&!te){let e=await Ge();if(e)return q(`version_too_old`,`[bridge:repl] Skipping: ${e}`,!0),g?.(`failed`,"run `claude update` to upgrade"),null;x(`[bridge:repl] Using env-less bridge path (tengu_bridge_repl_v2)`);let{initEnvLessBridgeCore:t}=await import(`./remoteBridgeCore-B2yFfG6S.js`);return t({baseUrl:T,orgUUID:ue,title:E,getAccessToken:Q,onAuth401:m,toSDKMessages:qe,initialHistoryCap:le,initialMessages:y,onInboundMessage:n,onUserMessage:j,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,outboundOnly:C,tags:w})}let de=je();if(de)return q(`version_too_old`,`[bridge:repl] Skipping: ${de}`),g?.(`failed`,"run `claude update` to upgrade"),null;let fe=await ne(),pe=await re(),N=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||T,P=`claude_code`;{let{isAssistantMode:t}=(Me(),e(Ne));t()&&(P=`claude_code_assistant`)}return pt({dir:o(),machineName:st(),branch:fe,gitRepoUrl:pe,title:E,baseUrl:T,sessionIngressUrl:N,workerType:P,getAccessToken:Q,createSession:e=>He({...e,events:[],baseUrl:T,getAccessToken:Q}),archiveSession:e=>Ue(e,{baseUrl:T,getAccessToken:Q,timeoutMs:1500}).catch(e=>{x(`[bridge:repl] archiveBridgeSession threw: ${v(e)}`,{level:`error`})}),getCurrentTitle:()=>z(i())??E,onUserMessage:j,toSDKMessages:qe,onAuth401:m,getPollIntervalConfig:$,initialHistoryCap:le,initialMessages:y,previouslyFlushedUUIDs:b,onInboundMessage:n,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,perpetual:te})}var gt=50;function _t(e){let t=D(e),n=(/^(.*?[.!?])\s/.exec(t)?.[1]??t).replace(/\s+/g,` `).trim();if(n)return n.length>gt?n.slice(0,gt-1)+`…`:n}export{ht as initReplBridge};