claude-code-best 2.6.0 → 2.6.6

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 (429) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-Cj5bvJgD.js → AddWorkspaceDirectory-Bb6crGWh.js} +1 -1
  2. package/dist/chunks/{App-2tgSv9lb.js → App-CW0Y4ceR.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-DWa-XTLb.js → ApproveApiKey-9rkwQfgT.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-BhMr2Y5F.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-DF9eeJZS.js → AssistantSessionChooser-XzXZZdiH.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-BL_dfbZP.js +2 -0
  7. package/dist/chunks/BypassPermissionsModeDialog-DlLWAKw2.js +1 -0
  8. package/dist/chunks/{ClaudeInChromeOnboarding-BW4XHmkw.js → ClaudeInChromeOnboarding-CjGydpBk.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-Bz0JyaOG.js → ClaudeMdExternalIncludesDialog-B04cjDwX.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-DPki55Xa.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-D_j1NebK.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-CcsM_OAS.js → DesktopHandoff-CFBUqcCf.js} +1 -1
  13. package/dist/chunks/DevChannelsDialog-ByTf41du.js +1 -0
  14. package/dist/chunks/DiffDialog-CY-8kw_Q.js +3 -0
  15. package/dist/chunks/Doctor-2D5Wz58o.js +1 -0
  16. package/dist/chunks/Doctor-CDez_u_U.js +3 -0
  17. package/dist/chunks/{ExitFlow-C4ybxKPn.js → ExitFlow-BlON8IgH.js} +2 -2
  18. package/dist/chunks/Feedback-CSeD3k4M.js +2 -0
  19. package/dist/chunks/Grove-Dwu_0zRw.js +1 -0
  20. package/dist/chunks/{Grove-CKVpREDU.js → Grove-Tp_UtIMg.js} +1 -1
  21. package/dist/chunks/{HybridTransport-Byjvz-DL.js → HybridTransport-CAko699F.js} +2 -2
  22. package/dist/chunks/{ITermBackend-Co9XpeS4.js → ITermBackend-5P3WJumD.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-CNsqbNU3.js → InvalidConfigDialog-CVcdra9v.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-ClnZaN6b.js → InvalidSettingsDialog-CfLdbmSI.js} +1 -1
  25. package/dist/chunks/MCPConnectionManager-BK_3uwQj.js +1 -0
  26. package/dist/chunks/{McpParsingWarnings-DZkzoeZf.js → McpParsingWarnings-BOj-T8F3.js} +1 -1
  27. package/dist/chunks/MessageSelector-BRkxpO1O.js +3 -0
  28. package/dist/chunks/Messages-wyMyMP7U.js +11 -0
  29. package/dist/chunks/{Onboarding-BwoGQB4g.js → Onboarding-C06Mxlf-.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-Q5g2YjQw.js → OverageCreditUpsell-abcPm3PB.js} +1 -1
  31. package/dist/chunks/PluginSettings-DGpIVGvV.js +17 -0
  32. package/dist/chunks/{PromptInputFooterSuggestions-D4lMVCqj.js → PromptInputFooterSuggestions-ihnbjU0K.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-BvLtS6an.js → PromptInputHelpMenu-CMm8z7Gk.js} +1 -1
  34. package/dist/chunks/QueryEngine-I3Bqzbiz.js +1 -0
  35. package/dist/chunks/REPL-BxAsVlx3.js +1 -0
  36. package/dist/chunks/REPL-CBFcgD4r.js +97 -0
  37. package/dist/chunks/{RemoteCallout-BV_hoz98.js → RemoteCallout-Cy6lH-CZ.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-Cxoy1ud2.js → RemoteSessionManager-C7iGd5Og.js} +2 -2
  39. package/dist/chunks/ResumeConversation-AdLtgdVB.js +1 -0
  40. package/dist/chunks/{SSETransport-pIm26VJq.js → SSETransport-B5xlXeAN.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-BJ8Nx_Nu.js +1 -0
  42. package/dist/chunks/SentryErrorBoundary-Bs7mtkPb.js +1 -0
  43. package/dist/chunks/{SentryErrorBoundary-B6EWoJml.js → SentryErrorBoundary-iih9eFpM.js} +1 -1
  44. package/dist/chunks/Settings-PioHwsvg.js +2 -0
  45. package/dist/chunks/{TeleportProgress-DPzGpyyM.js → TeleportProgress-BX-uLwuL.js} +1 -1
  46. package/dist/chunks/TeleportRepoMismatchDialog-D8oPPTWd.js +1 -0
  47. package/dist/chunks/{TeleportResumeWrapper-DPSO0S49.js → TeleportResumeWrapper-B_CvNDbr.js} +1 -1
  48. package/dist/chunks/{ThemePicker-DueihHcy.js → ThemePicker-BG1ykSpX.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-BNaZNAeP.js → TmuxBackend-CnMCWNS4.js} +1 -1
  50. package/dist/chunks/TrustDialog-Z_maAYj8.js +1 -0
  51. package/dist/chunks/{ValidationErrorsList-1k1qbsRo.js → ValidationErrorsList-C9swVkZ-.js} +1 -1
  52. package/dist/chunks/{WelcomeV2-CR6TtXXM.js → WelcomeV2-Au_5ddlT.js} +1 -1
  53. package/dist/chunks/WindowsTerminalBackend-CGxaYH74.js +2 -0
  54. package/dist/chunks/{add-dir-DAMizKzF.js → add-dir-Cm9u56YX.js} +1 -1
  55. package/dist/chunks/{agentDisplay-B9z7i8b_.js → agentDisplay-Bi_bEyEn.js} +1 -1
  56. package/dist/chunks/{agents-D5u0p1UC.js → agents-CMF9fLzV.js} +7 -7
  57. package/dist/chunks/{agents-DCh_gEvJ.js → agents-CbjR7hNr.js} +1 -1
  58. package/dist/chunks/{ant-DRJq-cEg.js → ant-Bu1Gs4WJ.js} +1 -1
  59. package/dist/chunks/api-CFNGoLoL.js +1 -0
  60. package/dist/chunks/{api-B6URs6nc.js → api-D_t0nHsS.js} +1 -1
  61. package/dist/chunks/assistant-BLd4y2FJ.js +1 -0
  62. package/dist/chunks/{assistant-tPxOUa-Z.js → assistant-C_pfWe2a.js} +1 -1
  63. package/dist/chunks/{assistant-BRGDWkKB.js → assistant-EA-MHNQ-.js} +1 -1
  64. package/dist/chunks/{auth-CqURlg4d.js → auth-D7PZvVPf.js} +1 -1
  65. package/dist/chunks/auth-DGfZCD_B.js +1 -0
  66. package/dist/chunks/{autoMode-DVt4K4I2.js → autoMode-B8iO05xy.js} +6 -6
  67. package/dist/chunks/{autonomy-Ffv0QIyl.js → autonomy-CaLvE5N6.js} +12 -12
  68. package/dist/chunks/{autonomy-BZzW8QJZ.js → autonomy-dQVtSiCJ.js} +1 -1
  69. package/dist/chunks/{autonomyPanel-MwuzDvv_.js → autonomyPanel-DSswVlCF.js} +1 -1
  70. package/dist/chunks/backgroundHousekeeping-Ckj8W3RO.js +1 -0
  71. package/dist/chunks/backgroundHousekeeping-D2_Uopt7.js +17 -0
  72. package/dist/chunks/{branch-DXefFdDE.js → branch-C7pM8Sjh.js} +1 -1
  73. package/dist/chunks/{bridge-qr4GQW_c.js → bridge-CTYdzSWg.js} +2 -2
  74. package/dist/chunks/bridgeConfig-7c07tJm9.js +1 -0
  75. package/dist/chunks/{bridgeConfig-CJ-KznTS.js → bridgeConfig-Df6uyp3q.js} +1 -1
  76. package/dist/chunks/{bridgeEnabled-5vsPrjuq.js → bridgeEnabled-A-_xJ94c.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-Z2S8lk0l.js +1 -0
  78. package/dist/chunks/bridgeMain-B7FZpvo0.js +68 -0
  79. package/dist/chunks/bridgeMain-C5UxF8ST.js +1 -0
  80. package/dist/chunks/{bridgeMessaging-BiE0CTqq.js → bridgeMessaging-DPVLAIzl.js} +1 -1
  81. package/dist/chunks/{btw-FpimqEqk.js → btw-CqgjLlFN.js} +1 -1
  82. package/dist/chunks/{buddy-BA3Cr067.js → buddy-DCGBAqF2.js} +1 -1
  83. package/dist/chunks/{bypassPermissionsKillswitch-CSC9p8mO.js → bypassPermissionsKillswitch-CK0jeZTW.js} +1 -1
  84. package/dist/chunks/{caches-BUBkfP2Q.js → caches-CdVW8fYV.js} +2 -2
  85. package/dist/chunks/caches-Dt52PedI.js +1 -0
  86. package/dist/chunks/{ccrClient-BOxUn9EJ.js → ccrClient-B_3AmY7K.js} +1 -1
  87. package/dist/chunks/changeDetector-uO9CBvut.js +1 -0
  88. package/dist/chunks/{channelNotification-l3EXKDNB.js → channelNotification-BbDQdLZC.js} +1 -1
  89. package/dist/chunks/channelNotification-DzTzUrCe.js +1 -0
  90. package/dist/chunks/{chrome-BnKyWWQL.js → chrome-CGyqsCkL.js} +1 -1
  91. package/dist/chunks/clear-B_cVk64B.js +1 -0
  92. package/dist/chunks/client-BcqXgcrx.js +1 -0
  93. package/dist/chunks/{color-D5MCzz9h.js → color-DEXUx7gE.js} +1 -1
  94. package/dist/chunks/commands-BX0_wEGw.js +1 -0
  95. package/dist/chunks/commitAttribution-CSVDcgTO.js +1 -0
  96. package/dist/chunks/{commitAttribution-BFshsh2H.js → commitAttribution-e0kkanVT.js} +1 -1
  97. package/dist/chunks/{compact-DWNaf1wR.js → compact-Dh9RewNA.js} +3 -3
  98. package/dist/chunks/{companion-CyK_Dr1U.js → companion-DVFacTUw.js} +1 -1
  99. package/dist/chunks/{config-DNz6Eitr.js → config-CkSmYDJY.js} +1 -1
  100. package/dist/chunks/{config-BdCuh6eA.js → config-DwiVCSrY.js} +1 -1
  101. package/dist/chunks/{context-BOjdTj0i.js → context-B8VDDHTv.js} +1 -1
  102. package/dist/chunks/{context-noninteractive-k2ibficU.js → context-noninteractive-IZfWniex.js} +2 -2
  103. package/dist/chunks/context-noninteractive-SBxqQ3iu.js +1 -0
  104. package/dist/chunks/conversation-CQBl9Yy2.js +1 -0
  105. package/dist/chunks/conversation-DVZplNag.js +1 -0
  106. package/dist/chunks/{copy-B0VUJ2rH.js → copy-CIjrYoFa.js} +2 -2
  107. package/dist/chunks/{createSSHSession-DqmkCS_k.js → createSSHSession-ArNlbIZB.js} +1 -1
  108. package/dist/chunks/{createSession-CJEsHz58.js → createSession-CBheIT_G.js} +1 -1
  109. package/dist/chunks/createSession-DfEQy2dZ.js +1 -0
  110. package/dist/chunks/cronJitterConfig-DcMGWOa-.js +6 -0
  111. package/dist/chunks/crossProjectResume-Z-aR2q-d.js +40 -0
  112. package/dist/chunks/{datadog-Bd1s_VFj.js → datadog-BK8eJz8B.js} +1 -1
  113. package/dist/chunks/datadog-Uj6FjEuU.js +1 -0
  114. package/dist/chunks/{desktop-BDowrzvG.js → desktop-B9vWJeRu.js} +1 -1
  115. package/dist/chunks/{diff-auU5sUOw.js → diff-BTV7_Dca.js} +1 -1
  116. package/dist/chunks/{doctor-bKPp6AeL.js → doctor-Dpbh0aRz.js} +1 -1
  117. package/dist/chunks/{effort-BQj2QnnA.js → effort-Czlwa5qF.js} +4 -4
  118. package/dist/chunks/{entry-CUu6-QhT.js → entry-CdfuWjKu.js} +3 -3
  119. package/dist/chunks/{envLessBridgeConfig-Ju4W58xf.js → envLessBridgeConfig-BAFYaZ0E.js} +1 -1
  120. package/dist/chunks/envLessBridgeConfig-DOO9eX07.js +1 -0
  121. package/dist/chunks/{exit-DijkO8eo.js → exit-DzOm62Dn.js} +1 -1
  122. package/dist/chunks/{export-DA-bBZkX.js → export-DHOR3z3Z.js} +1 -1
  123. package/dist/chunks/{exportRenderer-3y4tGdSB.js → exportRenderer-CiNXeNr9.js} +1 -1
  124. package/dist/chunks/extra-usage-CJcyfVCt.js +1 -0
  125. package/dist/chunks/{extra-usage-CS6VwKJt.js → extra-usage-DIYR_3ZR.js} +1 -1
  126. package/dist/chunks/{extra-usage-core-DOgT4u4i.js → extra-usage-core-C3uM9bOP.js} +1 -1
  127. package/dist/chunks/{extra-usage-noninteractive-DYnfiRlV.js → extra-usage-noninteractive-Ctz9TfY8.js} +1 -1
  128. package/dist/chunks/{extraUsage-CfxgfpX_.js → extraUsage-CBwIvl73.js} +1 -1
  129. package/dist/chunks/extractMemories-C3SU-Osb.js +1 -0
  130. package/dist/chunks/fast-7iinMwk-.js +1 -0
  131. package/dist/chunks/{fast-CzRUJBTK.js → fast-BpBwjbSD.js} +1 -1
  132. package/dist/chunks/{feedback-FoXtdHAV.js → feedback-BkVnsZVx.js} +1 -1
  133. package/dist/chunks/{firstPartyEventLogger-KIwaBY-E.js → firstPartyEventLogger-BCzGkdpd.js} +1 -1
  134. package/dist/chunks/{flushGate-C2Icy43G.js → flushGate-CQsnMw8g.js} +1 -1
  135. package/dist/chunks/{gates-CbQLZHtm.js → gates-CxWIWtmd.js} +1 -1
  136. package/dist/chunks/gates-qgzva-fO.js +1 -0
  137. package/dist/chunks/{gemini-BrNJGX4k.js → gemini-BbV8D2SS.js} +1 -1
  138. package/dist/chunks/{generateRecap-B0fvSCjo.js → generateRecap-B3j2nUgh.js} +1 -1
  139. package/dist/chunks/{generateSessionName-DvRYa39O.js → generateSessionName-aGnXSNgN.js} +1 -1
  140. package/dist/chunks/{githubRepoPathMapping-Dut3d6nn.js → githubRepoPathMapping-DCJLSTLl.js} +1 -1
  141. package/dist/chunks/{grok-Ftoheab3.js → grok-C4QFXJnR.js} +1 -1
  142. package/dist/chunks/{growthbook-BynnuVTn.js → growthbook-prtWhMRg.js} +1 -1
  143. package/dist/chunks/{heapdump-hQ_w0LPC.js → heapdump-Czm-2XiG.js} +1 -1
  144. package/dist/chunks/{help-DQsHHv6r.js → help-CSAFsN0-.js} +1 -1
  145. package/dist/chunks/hooks-Ch2vPE8u.js +1 -0
  146. package/dist/chunks/{hooks-BhVDc8yb.js → hooks-DkbOP-bI.js} +2 -2
  147. package/dist/chunks/{hostAdapter-D1eWmmhu.js → hostAdapter-BcdDPVTj.js} +1 -1
  148. package/dist/chunks/{ide-CPmMXLL-.js → ide-BXERRFZF.js} +2 -2
  149. package/dist/chunks/{inboundAttachments-Bmf6vYsE.js → inboundAttachments-7rXrAtkb.js} +1 -1
  150. package/dist/chunks/inboundAttachments-C0rkLl2x.js +1 -0
  151. package/dist/chunks/initReplBridge-tXqkba08.js +1 -0
  152. package/dist/chunks/{insights-CTlTyvjj.js → insights-DrvqJgF8.js} +25 -25
  153. package/dist/chunks/{install-IPuD3Lq8.js → install-BGnxwO00.js} +1 -1
  154. package/dist/chunks/{install-github-app-Bmu_sA9e.js → install-github-app-CIpBHlr9.js} +2 -2
  155. package/dist/chunks/{install-slack-app-Rfl81Jqo.js → install-slack-app-By4Lh7ww.js} +1 -1
  156. package/dist/chunks/{instrumentation-DWwmOmr0.js → instrumentation-D9y7Ph_R.js} +3 -3
  157. package/dist/chunks/{job-BXEt0izn.js → job-BPVIMW_P.js} +1 -1
  158. package/dist/chunks/{keybindings-DRDgVvqz.js → keybindings-Ce6AHMLI.js} +2 -2
  159. package/dist/chunks/{lang-D3ZHlfT6.js → lang-DfDG_fSa.js} +1 -1
  160. package/dist/chunks/language-B1yHC1d6.js +1 -0
  161. package/dist/chunks/{language-DcSjogBx.js → language-yGoDFP3X.js} +1 -1
  162. package/dist/chunks/{launchAgentsPlatform-BPm_VMln.js → launchAgentsPlatform-DT01xZM7.js} +1 -1
  163. package/dist/chunks/launchAutofixPr-DrYd7WVf.js +18 -0
  164. package/dist/chunks/{launchLocalMemory-D_hBbXKE.js → launchLocalMemory-Bt3tMYVJ.js} +1 -1
  165. package/dist/chunks/{launchLocalVault-CPzNWvQ9.js → launchLocalVault-jyRHEa_Y.js} +1 -1
  166. package/dist/chunks/{launchMemoryStores-Djq2KhKb.js → launchMemoryStores-cmXnLAF5.js} +1 -1
  167. package/dist/chunks/{launchOnboarding-Bh6E7vdc.js → launchOnboarding-BPTNFftb.js} +1 -1
  168. package/dist/chunks/{launchSchedule-C988bQ-5.js → launchSchedule-141GqGC8.js} +1 -1
  169. package/dist/chunks/{launchSkillStore-DqrP6Gme.js → launchSkillStore-Bz0lok_o.js} +1 -1
  170. package/dist/chunks/{launchTeleport-DFhybaq_.js → launchTeleport-BMquJxIq.js} +2 -2
  171. package/dist/chunks/{launchVault-p_CSK4ZQ.js → launchVault-Bsuwqad6.js} +1 -1
  172. package/dist/chunks/{loadAgentsDir-Ci5mr0vm.js → loadAgentsDir-D7kapZB5.js} +717 -709
  173. package/dist/chunks/loadAgentsDir-DxPE2bIO.js +1 -0
  174. package/dist/chunks/{loadPluginHooks-xYCEZ6t5.js → loadPluginHooks-CL5aGDrb.js} +1 -1
  175. package/dist/chunks/localSearch-iozuZZhZ.js +1 -0
  176. package/dist/chunks/{localSearch-Vpn6W5aY.js → localSearch-r1_G8kfV.js} +1 -1
  177. package/dist/chunks/{login-D9IWjvza.js → login-7MvpaOkt.js} +1 -1
  178. package/dist/chunks/login-Dxza_KNT.js +1 -0
  179. package/dist/chunks/{logoV2Utils-SAulcC5x.js → logoV2Utils-DjThKW15.js} +1 -1
  180. package/dist/chunks/logout-BeGQR78E.js +1 -0
  181. package/dist/chunks/{magicDocs-BfoeYhin.js → magicDocs-Dy72LHIj.js} +2 -2
  182. package/dist/chunks/{main-DhMlhVj3.js → main-CF6Im-LV.js} +46 -46
  183. package/dist/chunks/{mappers-uIrAj-Wd.js → mappers-CkMESMy7.js} +1 -1
  184. package/dist/chunks/mcp-BTgHgOhR.js +2 -0
  185. package/dist/chunks/mcp-UJZ22IDJ.js +6 -0
  186. package/dist/chunks/mcp-fHf8Uc7h.js +1 -0
  187. package/dist/chunks/{mcpServer-1SnOWb8_.js → mcpServer-BueM5fWI.js} +1 -1
  188. package/dist/chunks/{mcpServer-DXvS3v4x.js → mcpServer-Dqm2PQQx.js} +1 -1
  189. package/dist/chunks/{memory-XccPLQLt.js → memory-BNZmqma1.js} +1 -1
  190. package/dist/chunks/model-D3g2QdU-.js +1 -0
  191. package/dist/chunks/{model-CbiDGGJU.js → model-DOw7wIKQ.js} +1 -1
  192. package/dist/chunks/{onChangeAppState-Dp0JIXd8.js → onChangeAppState-Cb9_yIuW.js} +1 -1
  193. package/dist/chunks/{openai-6KcHd4Hw.js → openai-Bvo0Gcec.js} +3 -3
  194. package/dist/chunks/{overageCreditGrant-DYiB4sr-.js → overageCreditGrant-BrN7dk3d.js} +1 -1
  195. package/dist/chunks/{passes-Cbc6T_Tj.js → passes-vgcY8_l8.js} +1 -1
  196. package/dist/chunks/{paths-Q2255dD7.js → paths-1ngPRtu3.js} +2 -2
  197. package/dist/chunks/permissions-BDbIjTT6.js +3 -0
  198. package/dist/chunks/{pipeTransport-D7NIp3aA.js → pipeTransport-KU8psPDI.js} +1 -1
  199. package/dist/chunks/{plan-DloFVJK7.js → plan-5NVPuxp6.js} +1 -1
  200. package/dist/chunks/{plugin-XR9IBPMM.js → plugin-t8jMqdsY.js} +1 -1
  201. package/dist/chunks/{pluginAutoupdate-Cr9hP0zG.js → pluginAutoupdate-CAa4KLro.js} +1 -1
  202. package/dist/chunks/{pluginBlocklist-CM9uP8CY.js → pluginBlocklist-BG2LkLq1.js} +1 -1
  203. package/dist/chunks/{pluginCliCommands-BQkrvES5.js → pluginCliCommands-vqAtVibb.js} +1 -1
  204. package/dist/chunks/{pluginFlagging-CJ1--2Kw.js → pluginFlagging-BFCtv3kY.js} +1 -1
  205. package/dist/chunks/{pluginOperations-B0rLuSvo.js → pluginOperations-C9XP-mko.js} +2 -2
  206. package/dist/chunks/pluginStartupCheck-DZp0wnXP.js +1 -0
  207. package/dist/chunks/{pluginStartupCheck-Bjdc8zhz.js → pluginStartupCheck-RRcAbKfx.js} +1 -1
  208. package/dist/chunks/plugins-0SyID4Kx.js +4 -0
  209. package/dist/chunks/policyLimits-Cmmzuv-E.js +1 -0
  210. package/dist/chunks/{pollConfig-DhptuhFw.js → pollConfig-DTYIJ8lQ.js} +1 -1
  211. package/dist/chunks/{poor-DF0aqXDx.js → poor-Dw5dMZpM.js} +1 -1
  212. package/dist/chunks/{poorMode-C5Frra4j.js → poorMode-CsGLI_hm.js} +1 -1
  213. package/dist/chunks/poorMode-D_hB-rDf.js +1 -0
  214. package/dist/chunks/{print-CPtR0KTa.js → print-Ct8N4PYT.js} +12 -12
  215. package/dist/chunks/{privacy-settings-e-7lc7Un.js → privacy-settings-P2r-kg2i.js} +1 -1
  216. package/dist/chunks/processBashCommand-a8W8aTRu.js +1 -0
  217. package/dist/chunks/{processSlashCommand-DHRUtZ-C.js → processSlashCommand-BaUdUg3T.js} +3 -3
  218. package/dist/chunks/prompt-B1Qy8mi4.js +1 -0
  219. package/dist/chunks/{prompt-DEPUnJdB.js → prompt-BBg3jtfc.js} +1 -1
  220. package/dist/chunks/prompt-D4kWWEZC.js +1 -0
  221. package/dist/chunks/{promptEditor-Ci-h04-5.js → promptEditor-CvaugNTt.js} +2 -2
  222. package/dist/chunks/{protocolHandler-DhqM32qE.js → protocolHandler-DxBaHlaD.js} +1 -1
  223. package/dist/chunks/{rate-limit-options-B0l29Zx8.js → rate-limit-options-Df_sgE0b.js} +1 -1
  224. package/dist/chunks/rcDebugLog-CPGWJbI4.js +11 -0
  225. package/dist/chunks/{referral-ByevBJrE.js → referral-BKeCKnOJ.js} +1 -1
  226. package/dist/chunks/{refresh-B_CwwIRX.js → refresh-Cjv4jA6L.js} +1 -1
  227. package/dist/chunks/{registerProtocol-DzhaQH02.js → registerProtocol-DLuRm0mf.js} +1 -1
  228. package/dist/chunks/{registry-DkHA4cRu.js → registry-DVSgtCq5.js} +1 -1
  229. package/dist/chunks/{release-notes-CZthYkei.js → release-notes-CZcf8zB7.js} +1 -1
  230. package/dist/chunks/{releaseNotes-CwKpIsyd.js → releaseNotes-CvfZb3fZ.js} +2 -2
  231. package/dist/chunks/{reload-plugins-DxWfXvrN.js → reload-plugins-pSlDLk3b.js} +1 -1
  232. package/dist/chunks/{remote-env-BiRLWIrh.js → remote-env-BH89NuwC.js} +1 -1
  233. package/dist/chunks/{remoteBridgeCore-nz1fPY1U.js → remoteBridgeCore-CrXlWEL1.js} +1 -1
  234. package/dist/chunks/{remoteControlServer-FzLUxh2B.js → remoteControlServer-BSOnq4yY.js} +1 -1
  235. package/dist/chunks/{rename-DmGuyncE.js → rename-DNGvNQm2.js} +1 -1
  236. package/dist/chunks/{resume-7GeU7RMS.js → resume-6UL38yL3.js} +2 -2
  237. package/dist/chunks/{runtimeObserver-Duod-ign.js → runtimeObserver-BhvHeiwD.js} +4 -4
  238. package/dist/chunks/{runtimeObserver-OgM9ZYxZ.js → runtimeObserver-Cp-DN8fP.js} +1 -1
  239. package/dist/chunks/sandbox-adapter-DGVtPPD0.js +1 -0
  240. package/dist/chunks/{sandbox-toggle-Cc96R6Ox.js → sandbox-toggle-D19YbI5G.js} +1 -1
  241. package/dist/chunks/searchExtraTools-DXWkpOIg.js +1 -0
  242. package/dist/chunks/{sentry-BUHYuYGj.js → sentry-BZmpC-iI.js} +1 -1
  243. package/dist/chunks/{session-DgLqm7ZI.js → session-lLpGqp0B.js} +2 -2
  244. package/dist/chunks/{sessionDiscovery-DgNea6qa.js → sessionDiscovery-BX3fjgzD.js} +1 -1
  245. package/dist/chunks/sessionFileAccessHooks-BeuS4m7a.js +1 -0
  246. package/dist/chunks/sessionMemory-LMOQk90c.js +1 -0
  247. package/dist/chunks/sessionMemory-UpILj5ww.js +1 -0
  248. package/dist/chunks/sessionMemoryUtils-DE7AezA0.js +1 -0
  249. package/dist/chunks/{sessionObserver-CuWMVPlT.js → sessionObserver-CujNIWks.js} +1 -1
  250. package/dist/chunks/sessionObserver-HqvTXhs9.js +1 -0
  251. package/dist/chunks/sessionStorage-BN56DAAd.js +1 -0
  252. package/dist/chunks/{sessionTitle-DzkMzHer.js → sessionTitle-QxXslbJY.js} +1 -1
  253. package/dist/chunks/{sessionTracing-DTjmc0EF.js → sessionTracing-DognYcDf.js} +1 -1
  254. package/dist/chunks/{settingsSync-CfYDkakY.js → settingsSync-DEPET5O1.js} +1 -1
  255. package/dist/chunks/{setup-BKUG46jQ.js → setup-BUBUidOg.js} +1 -1
  256. package/dist/chunks/setup-BZMVuIIx.js +2 -0
  257. package/dist/chunks/{setup-CmLngvpJ.js → setup-C6G0lasE.js} +1 -1
  258. package/dist/chunks/{shadowedRuleDetection-DesT0yKM.js → shadowedRuleDetection-CQayPrmM.js} +1 -1
  259. package/dist/chunks/{sideQuestion-BAq0YyKY.js → sideQuestion-B9EE1vTM.js} +1 -1
  260. package/dist/chunks/sink-BRrEbL6h.js +1 -0
  261. package/dist/chunks/{sink-B3uP8Cf8.js → sink-Cugto5We.js} +1 -1
  262. package/dist/chunks/{sinks-COcy5GnB.js → sinks-B9A94oIj.js} +2 -2
  263. package/dist/chunks/sinks-CKaSBvU8.js +1 -0
  264. package/dist/chunks/{skill-learning-DOIMPtWE.js → skill-learning-CroDcatu.js} +1 -1
  265. package/dist/chunks/skillChangeDetector-DnyEQqe6.js +1 -0
  266. package/dist/chunks/{skillGapStore-DpEoKhn-.js → skillGapStore-91Mb3xDY.js} +2 -2
  267. package/dist/chunks/{skillGapStore-CWuw1dYh.js → skillGapStore-LKwap3o4.js} +1 -1
  268. package/dist/chunks/{skillGenerator-9y3Q4YoO.js → skillGenerator-B9GM0LHk.js} +2 -2
  269. package/dist/chunks/skillLearning-D6latSKi.js +1 -0
  270. package/dist/chunks/{skillLearning-BhM09bQD.js → skillLearning-DbOOqb6b.js} +1 -1
  271. package/dist/chunks/{skillPanel-Dt24mZTZ.js → skillPanel-rIIYgnBE.js} +3 -3
  272. package/dist/chunks/{skillSearchPanel-gaXN64Fu.js → skillSearchPanel-xAL-6uJF.js} +4 -4
  273. package/dist/chunks/{skills-Dx3dMHYk.js → skills-Doe47wxK.js} +1 -1
  274. package/dist/chunks/{sprites-5OAB-Ui2.js → sprites-D11F3i1M.js} +1 -1
  275. package/dist/chunks/{stats-TUExo9iU.js → stats-WNUyieG-.js} +1 -1
  276. package/dist/chunks/{status-Dghaz1my.js → status-CjBS9SkF.js} +1 -1
  277. package/dist/chunks/{statusNoticeHelpers-DVZSSXeK.js → statusNoticeHelpers-cnI4TiGw.js} +1 -1
  278. package/dist/chunks/{tag-ZcVkzFjz.js → tag-Gfb8vTAR.js} +2 -2
  279. package/dist/chunks/{tasks-DbB33ekt.js → tasks-BwX1rzOD.js} +1 -1
  280. package/dist/chunks/{teamHelpers-BmN9nKz-.js → teamHelpers-DEgaCpta.js} +1 -1
  281. package/dist/chunks/teamHelpers-EJxTXoTV.js +1 -0
  282. package/dist/chunks/teammateModeSnapshot-BgUQ4Phz.js +1 -0
  283. package/dist/chunks/{teammateModeSnapshot-CPjJJDL1.js → teammateModeSnapshot-Dyukgtp9.js} +1 -1
  284. package/dist/chunks/teleport-B4p8XlAv.js +1 -0
  285. package/dist/chunks/{templateJobs-Db630FZD.js → templateJobs-DQXuFnkl.js} +1 -1
  286. package/dist/chunks/{terminalSetup-ygKHrVKR.js → terminalSetup-CTEIn08j.js} +1 -1
  287. package/dist/chunks/{terminalSetup-DJqWE8fc.js → terminalSetup-bSbq4LE7.js} +1 -1
  288. package/dist/chunks/{theme-MmfFhdTD.js → theme-DazaKPy8.js} +1 -1
  289. package/dist/chunks/thinkback-BOfZP_QG.js +1 -0
  290. package/dist/chunks/{thinkback-CrNirB0V.js → thinkback-CxWZV2Oz.js} +1 -1
  291. package/dist/chunks/{thinkback-play-CQ1s7oqg.js → thinkback-play-CHe1x2Hc.js} +1 -1
  292. package/dist/chunks/{toolEventObserver-BqMplcIk.js → toolEventObserver-D4h-QqVP.js} +1 -1
  293. package/dist/chunks/{toolEventObserver-DBq2XBYY.js → toolEventObserver-Dfvv2trb.js} +1 -1
  294. package/dist/chunks/toolPool-BHChMuLr.js +1 -0
  295. package/dist/chunks/toolPool-C5K43w4_.js +1 -0
  296. package/dist/chunks/{trustedDevice-DEuQUTbz.js → trustedDevice-CQ9PK-8m.js} +1 -1
  297. package/dist/chunks/{trustedDevice-C9Zevohz.js → trustedDevice-rdvUkS1W.js} +1 -1
  298. package/dist/chunks/{ultrareviewCommand-DrlfRrXq.js → ultrareviewCommand-Zf9hO4wr.js} +2 -2
  299. package/dist/chunks/{undercover-DKn95mh9.js → undercover-DLyKv5TE.js} +1 -1
  300. package/dist/chunks/undercover-DNS9V_JT.js +1 -0
  301. package/dist/chunks/{updateCCB-CJ7dCUan.js → updateCCB-7WQRz9lW.js} +4 -4
  302. package/dist/chunks/{upgrade-Degqbu8S.js → upgrade-ByIumMQe.js} +1 -1
  303. package/dist/chunks/upgrade-bK4x32Ma.js +1 -0
  304. package/dist/chunks/{upload-pTZQCPLt.js → upload-CvOMbA9_.js} +1 -1
  305. package/dist/chunks/{usage-D96a7Cke.js → usage-C_d-Z-eb.js} +1 -1
  306. package/dist/chunks/{usage-DVQMUMcC.js → usage-DE4PSQiF.js} +1 -1
  307. package/dist/chunks/useMainLoopModel-Os8Ao8-x.js +1 -0
  308. package/dist/chunks/{useManagePlugins-BfGzHMvO.js → useManagePlugins-BYBubfHU.js} +1 -1
  309. package/dist/chunks/{useMergedTools-TemEvCrX.js → useMergedTools-BJAn2i-F.js} +1 -1
  310. package/dist/chunks/{useSearchInput-B-V4kIa-.js → useSearchInput-CF77X2OV.js} +1 -1
  311. package/dist/chunks/useSettingsErrors-DD7fQ-fU.js +1 -0
  312. package/dist/chunks/{useVoice-BuwYDm2U.js → useVoice-DwzMN0fq.js} +1 -1
  313. package/dist/chunks/{util-CeIKZmj9.js → util-DD30Y4o8.js} +1 -1
  314. package/dist/chunks/utils-D44M8obg.js +1 -0
  315. package/dist/chunks/validatePlugin-DpHiJRsT.js +1 -0
  316. package/dist/chunks/{vim-DUZQCWUP.js → vim-zc9EiMil.js} +1 -1
  317. package/dist/chunks/{voice-BkRIHZiM.js → voice-BRhZt4jW.js} +2 -2
  318. package/dist/chunks/{voiceModeEnabled-CPQUE3PU.js → voiceModeEnabled-168-1Ocs.js} +1 -1
  319. package/dist/chunks/voiceModeEnabled-CTT25yFj.js +1 -0
  320. package/dist/chunks/{voiceStreamSTT-Dr_wH1Kh.js → voiceStreamSTT-B80UegKG.js} +1 -1
  321. package/dist/chunks/voiceStreamSTT-BpYhKo2H.js +1 -0
  322. package/dist/chunks/{workerRegistry-CT7_kjvY.js → workerRegistry-s8nnpmUO.js} +1 -1
  323. package/dist/chunks/worktree-CkB4jLXK.js +1 -0
  324. package/dist/chunks/{xml-DD_ldd3X.js → xml-DTMvLcPg.js} +1 -1
  325. package/dist/cli.js +1 -1
  326. package/package.json +1 -1
  327. package/dist/chunks/ApproveApiKey-SIUwkD8j.js +0 -1
  328. package/dist/chunks/BackgroundTasksDialog-DXJdube9.js +0 -2
  329. package/dist/chunks/BypassPermissionsModeDialog-BOSW4Zdy.js +0 -1
  330. package/dist/chunks/ClaudeMdExternalIncludesDialog-B8oAAHSI.js +0 -1
  331. package/dist/chunks/ConsoleOAuthFlow-DYhmGSkx.js +0 -1
  332. package/dist/chunks/DevChannelsDialog-DXRgY00D.js +0 -1
  333. package/dist/chunks/DiffDialog-PvNZfZby.js +0 -3
  334. package/dist/chunks/Doctor--B1HUENo.js +0 -1
  335. package/dist/chunks/Doctor-CE_jL9jC.js +0 -3
  336. package/dist/chunks/Feedback-B5rPGl_C.js +0 -2
  337. package/dist/chunks/Grove-C2YjB3zL.js +0 -1
  338. package/dist/chunks/MCPConnectionManager-CDsa79pu.js +0 -1
  339. package/dist/chunks/MessageSelector-CkeGQPNM.js +0 -3
  340. package/dist/chunks/Messages-PfbzLYOU.js +0 -11
  341. package/dist/chunks/PluginSettings-B2ASJ0Rx.js +0 -17
  342. package/dist/chunks/QueryEngine-Av0G5fze.js +0 -1
  343. package/dist/chunks/REPL-DCwqua0C.js +0 -1
  344. package/dist/chunks/REPL-Dh8vzGmF.js +0 -97
  345. package/dist/chunks/ResumeConversation-B3WuB8rs.js +0 -1
  346. package/dist/chunks/SearchExtraToolsTool-D70C-cmA.js +0 -1
  347. package/dist/chunks/SentryErrorBoundary-oJUBarGg.js +0 -1
  348. package/dist/chunks/Settings-CreAhCsb.js +0 -2
  349. package/dist/chunks/TeleportRepoMismatchDialog-DqWQX6j8.js +0 -1
  350. package/dist/chunks/TrustDialog-CIzAlGn9.js +0 -1
  351. package/dist/chunks/WindowsTerminalBackend-C5SeTXqC.js +0 -2
  352. package/dist/chunks/api-Dz_3z1kl.js +0 -1
  353. package/dist/chunks/assistant-zVegFdAO.js +0 -1
  354. package/dist/chunks/auth-D4isgfuK.js +0 -1
  355. package/dist/chunks/backgroundHousekeeping-CYnAG60-.js +0 -17
  356. package/dist/chunks/backgroundHousekeeping-DUmxC6h0.js +0 -1
  357. package/dist/chunks/bridgeConfig-CNbOKpAg.js +0 -1
  358. package/dist/chunks/bridgeEnabled-BUJTCUHY.js +0 -1
  359. package/dist/chunks/bridgeMain-BimZwc2P.js +0 -68
  360. package/dist/chunks/bridgeMain-DYL4fl6A.js +0 -1
  361. package/dist/chunks/caches-CTfNpKhW.js +0 -1
  362. package/dist/chunks/changeDetector-Y9KV5LgG.js +0 -1
  363. package/dist/chunks/channelNotification-CC7Xb06W.js +0 -1
  364. package/dist/chunks/clear-OUVFUt8Z.js +0 -1
  365. package/dist/chunks/client-B47ZvTMo.js +0 -1
  366. package/dist/chunks/commands-FJGWgQsa.js +0 -1
  367. package/dist/chunks/commitAttribution-DSv9FggK.js +0 -1
  368. package/dist/chunks/context-noninteractive-Bd2HO-vU.js +0 -1
  369. package/dist/chunks/conversation-BP0phkOY.js +0 -1
  370. package/dist/chunks/conversation-Ci8O_eZ-.js +0 -1
  371. package/dist/chunks/createSession-B9MhWusY.js +0 -1
  372. package/dist/chunks/cronJitterConfig-BzPaa52I.js +0 -6
  373. package/dist/chunks/crossProjectResume-tWsqBUHc.js +0 -40
  374. package/dist/chunks/datadog-DJowkWhh.js +0 -1
  375. package/dist/chunks/envLessBridgeConfig-CixkwbRF.js +0 -1
  376. package/dist/chunks/extra-usage-DGHEQOrY.js +0 -1
  377. package/dist/chunks/extractMemories-jvjCvtpC.js +0 -1
  378. package/dist/chunks/fast-Bbtx_Bs1.js +0 -1
  379. package/dist/chunks/gates-DSI3vpwO.js +0 -1
  380. package/dist/chunks/hooks-BLLL4iPv.js +0 -1
  381. package/dist/chunks/inboundAttachments-D-p91z3w.js +0 -1
  382. package/dist/chunks/initReplBridge-BiHXpDEY.js +0 -1
  383. package/dist/chunks/language-B_-BfBT4.js +0 -1
  384. package/dist/chunks/launchAutofixPr-D2qac07g.js +0 -2
  385. package/dist/chunks/loadAgentsDir-vB1QEZ7H.js +0 -1
  386. package/dist/chunks/localSearch-DtVqtfvk.js +0 -1
  387. package/dist/chunks/login-D-N78G6r.js +0 -1
  388. package/dist/chunks/logout-CFggVS-9.js +0 -1
  389. package/dist/chunks/mcp-CAYGNxCb.js +0 -1
  390. package/dist/chunks/mcp-COQap0SM.js +0 -6
  391. package/dist/chunks/mcp-DlM0OC6R.js +0 -2
  392. package/dist/chunks/model-DdbcxKub.js +0 -1
  393. package/dist/chunks/permissions-BLzPHh_3.js +0 -3
  394. package/dist/chunks/pluginStartupCheck-Cu2ezD51.js +0 -1
  395. package/dist/chunks/plugins-BgOP_8TX.js +0 -4
  396. package/dist/chunks/policyLimits-CKy_gTEt.js +0 -1
  397. package/dist/chunks/poorMode-DJvjO2nW.js +0 -1
  398. package/dist/chunks/processBashCommand-D5dC6Mya.js +0 -1
  399. package/dist/chunks/prompt-CQC-mh6u.js +0 -1
  400. package/dist/chunks/prompt-DawxLANl.js +0 -1
  401. package/dist/chunks/rcDebugLog-BbPkkigY.js +0 -11
  402. package/dist/chunks/sandbox-adapter-CxkhKgaa.js +0 -1
  403. package/dist/chunks/searchExtraTools-DQ6e601b.js +0 -1
  404. package/dist/chunks/sessionFileAccessHooks-7Svz-7S-.js +0 -1
  405. package/dist/chunks/sessionMemory-DIrR3zvb.js +0 -1
  406. package/dist/chunks/sessionMemory-_dmj8lcH.js +0 -1
  407. package/dist/chunks/sessionMemoryUtils-BdQtSkRx.js +0 -1
  408. package/dist/chunks/sessionObserver-_adufOGQ.js +0 -1
  409. package/dist/chunks/sessionStorage-W7okgAlQ.js +0 -1
  410. package/dist/chunks/setup-TqJ7-Nxh.js +0 -2
  411. package/dist/chunks/sink-CaWMZBw_.js +0 -1
  412. package/dist/chunks/sinks-oFfsKySL.js +0 -1
  413. package/dist/chunks/skillChangeDetector-CA_Tdx8N.js +0 -1
  414. package/dist/chunks/skillLearning-_o2D06yM.js +0 -1
  415. package/dist/chunks/teamHelpers-yeTNtZbb.js +0 -1
  416. package/dist/chunks/teammateModeSnapshot-CsNIJTKi.js +0 -1
  417. package/dist/chunks/teleport-JHgpwZIh.js +0 -1
  418. package/dist/chunks/thinkback-Quc7KPmi.js +0 -1
  419. package/dist/chunks/toolPool-BkCtTKXz.js +0 -1
  420. package/dist/chunks/toolPool-C7bOwJfR.js +0 -1
  421. package/dist/chunks/undercover-CBeHiWUd.js +0 -1
  422. package/dist/chunks/upgrade-ucJ-lnlY.js +0 -1
  423. package/dist/chunks/useMainLoopModel-B7ch2o9K.js +0 -1
  424. package/dist/chunks/useSettingsErrors-B2JGz1s8.js +0 -1
  425. package/dist/chunks/utils-CwhszpkT.js +0 -1
  426. package/dist/chunks/validatePlugin-BlVho93x.js +0 -1
  427. package/dist/chunks/voiceModeEnabled-DB8GCzAF.js +0 -1
  428. package/dist/chunks/voiceStreamSTT-DgoDscHn.js +0 -1
  429. package/dist/chunks/worktree-DU3xtwKW.js +0 -1
@@ -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-Q2255dD7.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{A_ as C,BS as w,D_ as T,Dx as E,Ku as D,MS as O,M_ as k,NS as A,N_ as j,O_ as M,Ox as N,VS as P,jS as ee,j_ as te,k_ as ne,qu as re}from"./loadAgentsDir-Ci5mr0vm.js";import{t as ie}from"./useKeybinding-FsOnjW6T.js";function ae(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);T(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 oe(e,t){return j(Object.keys(e[t]||{}),e,t)}function F(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(),k(),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-1ngPRtu3.js";import{n as x,r as S}from"./analytics-DqMQntaB.js";import{A_ as C,Ax as w,D_ as T,E_ as E,FS as D,HS as O,Ku as k,M_ as A,NS as ee,O_ as te,PS as j,US as M,j_ as N,k_ as P,kx as F,qu as ne}from"./loadAgentsDir-D7kapZB5.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);E(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 A(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(),N(),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)(E,{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(),N(),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)(E,{options:n.map((e,t)=>({label:`[${e.config.type}] ${M(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${C(e.source)} (${e.pluginName})`:C(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{s(),u(),k(),N(),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)(E,{options:o.map(e=>({label:`[${e.sources.map(te).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(),k(),v(),N(),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:ne(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(),k(),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);P(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=O(e=>e.mcp),v=A(),b=(0,X.useMemo)(()=>[...e,...h.tools.map(e=>e.name)],[e,h.tools]),x=(0,X.useMemo)(()=>ae(v.getState(),b),[b,v]),S=(0,X.useMemo)(()=>oe(x,p),[x,p]),C=(0,X.useMemo)(()=>F(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: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(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: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:T,hooksByEvent:D,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: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),ee(),w(),u(),ie(),R(),b(),v(),V(),W(),se(),Y(),Z=p()})),Q,$;e((()=>{fe(),x(),re(),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)(F,{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(),w(),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)(F,{options:n.map((e,t)=>({label:`[${e.config.type}] ${T(e.config)}`,value:t.toString(),description:e.source===`pluginHook`&&e.pluginName?`${P(e.source)} (${e.pluginName})`:P(e.source)})),onChange:e=>{let t=n[parseInt(e,10)];t&&i(t)},onCancel:a})})})}var U,W=e((()=>{s(),u(),N(),w(),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)(F,{options:o.map(e=>({label:`[${e.sources.map(C).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(),N(),v(),w(),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:te(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(),N(),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);M(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=j(e=>e.mcp),v=D(),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: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(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: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:T,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: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),ee(),O(),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:k(n).map(e=>e.name),onExit:e})}}))();export{$ as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{d as t,s as n}from"./debug-UI3T040K.js";import{o as r,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-CbQLZHtm.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-CxWIWtmd.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-Q2255dD7.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{Cx as y,Dx as b,Gb as x,MS as S,PS as C,Qb as w,Wb as T,cy as E,gx as D,jS as O,nx as k,rx as A,sx as j,tx as M,wt as N,xt as P}from"./loadAgentsDir-Ci5mr0vm.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)(b,{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!A()&&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)(b,{options:[{label:`No`,value:`no`},{label:`Yes`,value:`yes`}],onChange:t,defaultValue:`no`})})}function z(){let e=f();return!A()&&e.autoConnectIde===!0}var B,V,H=e((()=>{B=t(i(),1),s(),u(),w(),E(),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:k()?`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)(b,{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&&!A()&&(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)(b,{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)(b,{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 T(!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 k(),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 T(!0);if(o.length===0&&t.onInstallIDEExtension&&!A()){let r=await x(),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=C(),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=()=>{},D(`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(),E(),s(),H(),y(),O(),h(),_(),w(),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-1ngPRtu3.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{IS as y,Kb as b,NS as x,PS as S,Tx as C,ax as w,ex as T,ix as E,kx as D,lx as O,qb as k,rx as A,uy as j,vx as M,wt as N,xt as P}from"./loadAgentsDir-D7kapZB5.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)(D,{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!w()&&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)(D,{options:[{label:`No`,value:`no`},{label:`Yes`,value:`yes`}],onChange:t,defaultValue:`no`})})}function z(){let e=f();return!w()&&e.autoConnectIde===!0}var B,V,H=e((()=>{B=t(i(),1),s(),u(),T(),j(),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)(D,{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&&!w()&&(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)(D,{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:O(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)(D,{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 b(!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 b(!0);if(o.length===0&&t.onInstallIDEExtension&&!w()){let r=await k(),i=r=>{t.onInstallIDEExtension&&(t.onInstallIDEExtension(r),A(r)?e(`Installed plugin to ${n.bold(O(r))}\nPlease ${n.bold(`restart your IDE`)} completely for it to take effect`):e(`Installed extension to ${n.bold(O(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=()=>{},M(`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(),j(),s(),H(),C(),x(),h(),_(),T(),N(),Q=l(),$=35e3}))();export{J as call,X as formatWorkspaceFolders};
@@ -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-CJ-KznTS.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-Df6uyp3q.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{r as e}from"./inboundAttachments-7rXrAtkb.js";export{e as resolveAndPrepend};
@@ -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-1ngPRtu3.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,Ar as ae,Ba as j,Ca as M,Da as N,Ea as oe,Eo as se,Ka as P,Kv as ce,Lo as F,Ma as I,Oa as le,Oo as L,Ra as R,Sa as ue,Ta as de,Vo as fe,cd as pe,fd as me,hr as z,ja as he,ka as B,qv as ge,wa as _e}from"./loadAgentsDir-D7kapZB5.js";import{O as V,_ as ve,d as H,k as ye,n as U,t as W}from"./rcDebugLog-CPGWJbI4.js";import{a as G,c as K,d as be,f as xe,o as q,r as Se,s as J,u as Y}from"./debugUtils-BBMFODKH.js";import{a as Ce,i as we}from"./trustedDevice-rdvUkS1W.js";import{a as X,i as Te,n as Z,o as Q,t as $}from"./bridgeConfig-Df6uyp3q.js";import{a as Ee,o as De,r as Oe,s as ke,t as Ae}from"./bridgeEnabled-A-_xJ94c.js";import{i as je,t as Me}from"./assistant-EA-MHNQ-.js";import{t as Ne}from"./capacityWake-BXlUpptF.js";import{n as Pe,t as Fe}from"./pollConfig-DTYIJ8lQ.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-CBheIT_G.js";import{i as We,n as Ge}from"./envLessBridgeConfig-BAFYaZ0E.js";import{n as Ke,o as qe}from"./mappers-CkMESMy7.js";import{n as Je,r as Ye,t as Xe}from"./sessionTitle-QxXslbJY.js";import{a as Ze,i as Qe,n as $e,o as et,r as tt,t as nt}from"./bridgeMessaging-DPVLAIzl.js";import{t as rt}from"./HybridTransport-CAko699F.js";import{n as it,r as at,t as ot}from"./flushGate-CQsnMw8g.js";import{hostname as st}from"os";import{randomUUID as ct}from"crypto";a(),O(),E(),s(),g(),h(),d(),X(),ge(),Oe(),F(),R(),ae(),Ve(),We(),Ke(),Ye(),B(),S(),W(),T(),te(),b(),K(),pe(),Ce(),V(),H(),n(),q(),y(),A(),M();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:_=()=>Pe,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:ie=0}=e,ae=++ft,{writeBridgePointer:j,clearBridgePointer:M,readBridgePointer:N}=await import(`./bridgePointer-FvAMj3re.js`),se=A?await N(n):null,P=se?.source===`repl`?se:null;x(`[bridge:repl] initBridgeCore #${ae} starting (initialMessages=${b?.length??0}${P?` perpetual prior=env:${P.environmentId}`:``})`);let ce=le({baseUrl:c,getAccessToken:d,runnerVersion:`2.6.6`,onDebug:x,onAuth401:g,getTrustedDeviceToken:we}),F=process.env.USER_TYPE===`ant`?oe(ce):ce,I={dir:n,machineName:i,branch:a,gitRepoUrl:o,maxSessions:1,spawnMode:`single-session`,verbose:!1,sandbox:!1,bridgeId:ct(),workerType:u,environmentId:ct(),reuseEnvironmentId:P?.environmentId,apiBaseUrl:c,sessionIngressUrl:l},L,R;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return J(`registration_failed`,`[bridge:repl] Environment registration failed: ${v(e)}`),P&&await M(n),O?.(`failed`,v(e)),null}x(`[bridge:repl] Environment registered: ${L}`),w(`info`,`bridge_repl_env_registered`),C(`tengu_bridge_repl_env_registered`,{});async function fe(e,t){if(L!==e)return x(`[bridge:repl] Env mismatch (requested ${e}, got ${L}) — cannot reconnect in place`),!1;let n=xe(t),r=n===t?[t]:[t,n];for(let e of r)try{return await F.reconnectSession(L,e),x(`[bridge:repl] Reconnected session ${e} in place on env ${L}`),!0}catch(t){x(`[bridge:repl] reconnectSession(${e}) failed: ${v(t)}`)}return x(`[bridge:repl] reconnectSession exhausted — falling through to fresh session`),!1}let pe=P?await fe(P.environmentId,P.sessionId):!1;P&&!pe&&await M(n);let z;if(pe&&P){if(z=P.sessionId,x(`[bridge:repl] Perpetual session reused: ${z}`),b&&S)for(let e of b)S.add(e.uuid)}else{let e=await f({environmentId:L,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 F.deregisterEnvironment(L).catch(()=>{}),O?.(`failed`,`Session creation failed`),null;z=e,x(`[bridge:repl] Session created: ${z}`)}await j(n,{sessionId:z,environmentId:L,source:`repl`}),w(`info`,`bridge_repl_session_created`),C(`tengu_bridge_repl_started`,{has_initial_messages:!!(b&&b.length>0),inProtectedNamespace:t()});let he=new Set;if(b)for(let e of b)he.add(e.uuid);let B=new nt(2e3);for(let e of he)B.add(e);let ge=new nt(2e3),V=new AbortController,H=null;ve(e=>{V.signal.aborted||H?.reportMetadata(e)},{replayCurrent:!0});let W=0,G=pe?ie:0,K=null,q=null,Se=Ne(V.signal),Y=Se.wake,Ce=Se.signal,X=new ot,Te=!k,Z=0,Q=null;async function $(){if(Q)return Q;Q=Ee();try{return await Q}finally{Q=null}}async function Ee(){if(Z++,U(`doReconnect: attempt=${Z}/3 envId=${L} sessionId=${z} workId=${K}`),W++,x(`[bridge:repl] Reconnecting after env lost (attempt ${Z}/3)`),Z>3)return x(`[bridge:repl] Environment reconnect limit reached (3), giving up`),!1;if(H){let e=H.getLastSequenceNum();e>G&&(G=e),H.close(),H=null}if(Y(),X.drop(),K){let e=K;if(await F.stopWork(L,e,!1).catch(()=>{}),K!==e)return x(`[bridge:repl] Poll loop recovered during stopWork await — deferring to it`),Z=0,!0;K=null,q=null}if(V.signal.aborted)return x(`[bridge:repl] Reconnect aborted by teardown`),!1;let e=L;I.reuseEnvironmentId=e;try{let e=await F.registerBridgeEnvironment(I);L=e.environment_id,R=e.environment_secret}catch(e){return I.reuseEnvironmentId=void 0,x(`[bridge:repl] Environment re-registration failed: ${v(e)}`),!1}if(I.reuseEnvironmentId=void 0,x(`[bridge:repl] Re-registered: requested=${e} got=${L}`),V.signal.aborted)return x(`[bridge:repl] Reconnect aborted after env registration, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;if(H!==null)return x(`[bridge:repl] Poll loop recovered during registerBridgeEnvironment await — deferring to it`),Z=0,!0;if(await fe(e,z))return C(`tengu_bridge_repl_reconnected_in_place`,{}),Z=0,!0;if(L!==e&&C(`tengu_bridge_repl_env_expired_fresh_session`,{}),await p(z),V.signal.aborted)return x(`[bridge:repl] Reconnect aborted after archive, cleaning up`),await F.deregisterEnvironment(L).catch(()=>{}),!1;let t=m(),r=await f({environmentId:L,title:t,gitRepoUrl:o,branch:a,signal:AbortSignal.timeout(15e3)});return r?V.signal.aborted?(x(`[bridge:repl] Reconnect aborted after session creation, cleaning up`),await p(r),!1):(z=r,me(be(r)).catch(()=>{}),G=0,ge.clear(),Te=!k,x(`[bridge:repl] Re-created session: ${z}`),await j(n,{sessionId:z,environmentId:L,source:`repl`}),S?.clear(),Z=0,!0):(x(`[bridge:repl] Session creation failed during reconnection`),!1)}function De(){return d()}function Oe(){let e=X.end();if(e.length===0)return;if(!H){x(`[bridge:repl] Cannot drain ${e.length} pending message(s): no transport`);return}for(let t of e)B.add(t.uuid);let t=h(e).map(e=>({...e,session_id:z}));x(`[bridge:repl] Drained ${e.length} pending message(s) after flush`),H.writeBatch(t)}let ke=null;function Ae(){ke?.()}function je(e){if(U(`handleTransportPermanentClose: code=${e} transport=${H?`exists`:`null`} pollAborted=${V.signal.aborted}`),x(`[bridge:repl] Transport permanently closed: code=${e}`),C(`tengu_bridge_repl_ws_closed`,{code:e}),H){let e=H.getLastSequenceNum();e>G&&(G=e),H=null}Y();let t=X.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`),V.abort(),Ae();return}O?.(`reconnecting`,`Remote Control connection lost (code ${e})`),x(`[bridge:repl] Transport reconnect budget exhausted (code=${e}), attempting env reconnect`),$().then(t=>{t||V.signal.aborted||(x(`[bridge:repl] reconnectEnvironmentWithSession resolved false — tearing down`),C(`tengu_bridge_repl_reconnect_failed`,{close_code:e}),O?.(`failed`,`reconnection failed`),Ae())})}let Me;process.env.USER_TYPE===`ant`&&process.platform!==`win32`&&(Me=()=>{x(`[bridge:repl] SIGUSR2 received — forcing doReconnect() for testing`),$()},process.on(`SIGUSR2`,Me));let Fe=null;process.env.USER_TYPE===`ant`&&de({fireClose:e=>{if(!Fe){x(`[bridge:debug] fireClose: no transport wired yet`);return}x(`[bridge:debug] fireClose(${e}) — injecting`),Fe(e)},forceReconnect:()=>{x(`[bridge:debug] forceReconnect — injecting`),$()},injectFault:_e,wakePollLoop:Y,describe:()=>`env=${L} session=${z} transport=${H?.getStateLabel()??`null`} workId=${K??`null`}`}),mt({api:F,getCredentials:()=>({environmentId:L,environmentSecret:R}),signal:V.signal,getPollIntervalConfig:_,onStateChange:O,getWsState:()=>H?.getStateLabel()??`null`,isAtCapacity:()=>H!==null,capacitySignal:Ce,onFatalError:Ae,getHeartbeatInfo:()=>!K||!q?null:{environmentId:L,workId:K,sessionToken:q},onHeartbeatFatal:e=>{if(x(`[bridge:repl] heartbeatWork fatal (status=${e.status}) — tearing down work item for fast re-dispatch`),H){let e=H.getLastSequenceNum();e>G&&(G=e),H.close(),H=null}X.drop(),K&&F.stopWork(L,K,!1).catch(e=>{x(`[bridge:repl] stopWork after heartbeat fatal: ${v(e)}`)}),K=null,q=null,Y(),O?.(`reconnecting`,`Work item lease expired, fetching fresh token`)},async onEnvironmentLost(){return await $()?{environmentId:L,environmentSecret:R}:null},onWorkReceived:(e,t,i,a)=>{if(H?.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=${z} match=${Ie(e,z)}`),j(n,{sessionId:z,environmentId:L,source:`repl`}),!Ie(e,z)){x(`[bridge:repl] Rejecting foreign session: expected=${z} got=${e}`);return}K=i,q=t;let o=a||r(process.env.CLAUDE_BRIDGE_USE_CCR_V2),s;if(!o){if(s=De(),!s){x(`[bridge:repl] No OAuth token available for session ingress, skipping work`);return}ye(s)}if(C(`tengu_bridge_repl_work_received`,{}),H){let e=H;H=null;let t=e.getLastSequenceNum();t>G&&(G=t),e.close()}X.deactivate();let u=e=>Qe(e,{transport:H,sessionId:z,onInterrupt:ne,onSetModel:re,onSetMaxThinkingTokens:E,onSetPermissionMode:D}),d=!1,f=e=>{H=e,e.setOnConnect(()=>{if(H===e){if(x(`[bridge:repl] Ingress transport connected`),C(`tengu_bridge_repl_ws_connected`,{}),!o){let e=De();e&&ye(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:z})),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(()=>{H===e&&(Oe(),O?.(`connected`))})}else Oe(),O?.(`connected`)}else X.active||O?.(`connected`)}}),e.setOnData(e=>{try{let t=JSON.parse(e);U(`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{U(`ingress (non-JSON): ${String(e).slice(0,200)}`)}tt(e,B,ge,te,T,u)}),Fe=je,e.setOnClose(t=>{H===e&&(U(`transport onClose: code=${t} connected=${e.isConnectedStatus()} state=${e.getStateLabel()} seq=${e.getLastSequenceNum()}`),je(t))}),!d&&b&&b.length>0&&X.start(),e.connect()};if(W++,o){let n=ze(c,e),r=W;x(`[bridge:repl] CCR v2: sessionUrl=${n} session=${e} gen=${r}`),at({sessionUrl:n,ingressToken:t,sessionId:e,initialSequenceNum:G}).then(e=>{if(V.signal.aborted){e.close();return}if(r!==W){x(`[bridge:repl] CCR v2: discarding stale handshake gen=${r} current=${W}`),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===W&&(K&&(F.stopWork(L,K,!1).catch(e=>{x(`[bridge:repl] stopWork after v2 init failure: ${v(e)}`)}),K=null,q=null),Y())})}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 ${De()??n}`,"anthropic-version":`2023-06-01`}),{maxConsecutiveFailures:50,isBridge:!0,onBatchDropped:()=>{O?.(`reconnecting`,`Lost sync with Remote Control — events could not be delivered`),Y()}})))}}});let Re=A?setInterval(()=>{Q||j(n,{sessionId:z,environmentId:L,source:`repl`})},60*6e4):null;Re?.unref?.();let Be=_().session_keepalive_interval_v2_ms,Ve=Be>0?setInterval(()=>{H&&(x(`[bridge:repl] keep_alive sent`),H.write({type:`keep_alive`}).catch(e=>{x(`[bridge:repl] keep_alive write failed: ${v(e)}`)}))},Be):null;Ve?.unref?.();let He=!1;ke=async()=>{if(He){x(`[bridge:repl] Teardown already in progress, skipping duplicate call env=${L} session=${z}`);return}He=!0;let e=Date.now();if(x(`[bridge:repl] Teardown starting: env=${L} session=${z} workId=${K??`none`} transportState=${H?.getStateLabel()??`null`}`),Re!==null&&clearInterval(Re),Ve!==null&&clearInterval(Ve),Me&&process.off(`SIGUSR2`,Me),process.env.USER_TYPE===`ant`&&(ue(),Fe=null),V.abort(),x(`[bridge:repl] Teardown: poll loop aborted`),H){let e=H.getLastSequenceNum();e>G&&(G=e)}if(A){H=null,X.drop(),await j(n,{sessionId:z,environmentId:L,source:`repl`}),x(`[bridge:repl] Teardown (perpetual): leaving env=${L} session=${z} alive on server, duration=${Date.now()-e}ms`);return}let t=H;if(H=null,X.drop(),t){let e={...et(z),session_id:z};t.write(e)}let r=K?F.stopWork(L,K,!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(z)]),t?.close(),x(`[bridge:repl] Teardown: transport closed`),await F.deregisterEnvironment(L).catch(e=>{x(`[bridge:repl] Teardown deregister failed: ${v(e)}`)}),await M(n),x(`[bridge:repl] Teardown complete: env=${L} duration=${Date.now()-e}ms`)};let Ue=ee(()=>ke?.());return x(`[bridge:repl] Ready: env=${L} session=${z}`),O?.(`ready`),{get bridgeSessionId(){return z},get environmentId(){return L},getSSESequenceNum(){let e=H?.getLastSequenceNum()??0;return Math.max(G,e)},sessionIngressUrl:l,writeMessages(e){let t=e.filter(e=>Ze(e)&&!he.has(e.uuid)&&!B.has(e.uuid));if(t.length===0)return;if(!Te)for(let e of t){let t=$e(e);if(t!==void 0&&k?.(t,z)){Te=!0;break}}if(X.enqueue(...t)){x(`[bridge:repl] Queued ${t.length} message(s) during initial flush`);return}if(!H){let e=t.map(e=>e.type).join(`,`);x(`[bridge:repl] Transport not configured, dropping ${t.length} message(s) [${e}] for session=${z}`,{level:`warn`});return}for(let e of t)B.add(e.uuid);x(`[bridge:repl] Sending ${t.length} message(s) via transport`);let n=h(t).map(e=>({...e,session_id:z}));H.writeBatch(n)},writeSdkMessages(e){let t=e.filter(e=>!e.uuid||!B.has(e.uuid));if(t.length===0)return;if(!H){x(`[bridge:repl] Transport not configured, dropping ${t.length} SDK message(s) for session=${z}`,{level:`warn`});return}for(let e of t)e.uuid&&B.add(e.uuid);let n=t.map(e=>({...e,session_id:z}));H.writeBatch(n)},sendControlRequest(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_request`);return}let t={...e,session_id:z};H.write(t),x(`[bridge:repl] Sent control_request request_id=${e.request_id}`)},sendControlResponse(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_response`);return}let t={...e,session_id:z};H.write(t),x(`[bridge:repl] Sent control_response`)},sendControlCancelRequest(e){if(!H){x(`[bridge:repl] Transport not configured, skipping control_cancel_request`);return}let t={type:`control_cancel_request`,request_id:e,session_id:z};H.write(t),x(`[bridge:repl] Sent control_cancel_request request_id=${e}`)},sendResult(){if(!H){x(`[bridge:repl] sendResult: skipping, transport not configured session=${z}`);return}H.reportState(`idle`);let e={...et(z),session_id:z};H.write(e),x(`[bridge:repl] Sent result for session=${z}`)},async teardown(){Ue(),await ke?.(),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=()=>Pe,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 N){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{I(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 N&&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 N){let e=ie(i.errorType),t=he(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=G(i),_=Se(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(),q(),K();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(Y(De),!await Ee())return J(`not_enabled`,`[bridge:repl] Skipping: bridge not enabled`),null;if(!$())return J(`no_oauth`,`[bridge:repl] Skipping: no OAuth tokens`),g?.(`failed`,`/login`),null;if(await P(),!j(`allow_remote_control`))return J(`policy_denied`,`[bridge:repl] Skipping: allow_remote_control policy not allowed`),g?.(`failed`,`disabled by your organization's policy`),null;if(!Te()){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()){J(`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=Z(),E=`remote-control-${ce()}`,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`||fe(t))continue;let n=se(t.message.content);if(!n)continue;let r=_t(n);if(r){E=r,D=!0;break}}}let k=0,A,ie=0,ae=(e,t,n)=>{D=!0,E=e,x(`[bridge:repl] derived title from message ${n}: ${e}`),Be(t,e,{baseUrl:T,getAccessToken:$}).catch(()=>{})},M=(e,t)=>{let n=++ie,r=k;Je(e,AbortSignal.timeout(15e3)).then(e=>{e&&n===ie&&A===t&&!z(i())&&ae(e,t,r)})},N=(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&&ae(n,t,k),M(e,t)}else if(k===3){let n=ee?.();M(n?Xe(L(n)):e,t)}return k>=3},oe=_(`tengu_bridge_initial_history_cap`,200,300*1e3),F=Q()?`self-hosted`:await p();if(!F)return J(`no_org_uuid`,`[bridge:repl] Skipping: no org UUID`),g?.(`failed`,`/login`),null;if(ke()&&!te){let e=await Ge();if(e)return J(`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-CrXlWEL1.js`);return t({baseUrl:T,orgUUID:F,title:E,getAccessToken:$,onAuth401:m,toSDKMessages:qe,initialHistoryCap:oe,initialMessages:y,onInboundMessage:n,onUserMessage:N,onPermissionResponse:r,onInterrupt:a,onSetModel:s,onSetMaxThinkingTokens:d,onSetPermissionMode:h,onStateChange:g,outboundOnly:C,tags:w})}let I=Ae();if(I)return J(`version_too_old`,`[bridge:repl] Skipping: ${I}`),g?.(`failed`,"run `claude update` to upgrade"),null;let le=await ne(),R=await re(),ue=process.env.CLAUDE_BRIDGE_SESSION_INGRESS_URL||T,de=`claude_code`;{let{isAssistantMode:t}=(je(),e(Me));t()&&(de=`claude_code_assistant`)}return pt({dir:o(),machineName:st(),branch:le,gitRepoUrl:R,title:E,baseUrl:T,sessionIngressUrl:ue,workerType:de,getAccessToken:$,createSession:e=>He({...e,events:[],baseUrl:T,getAccessToken:$}),archiveSession:e=>Ue(e,{baseUrl:T,getAccessToken:$,timeoutMs:1500}).catch(e=>{x(`[bridge:repl] archiveBridgeSession threw: ${v(e)}`,{level:`error`})}),getCurrentTitle:()=>z(i())??E,onUserMessage:N,toSDKMessages:qe,onAuth401:m,getPollIntervalConfig:Fe,initialHistoryCap:oe,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};
@@ -1,6 +1,6 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{Oo as r,Pr as i,Tr as a,jo as o,rs as s}from"./paths-Q2255dD7.js";import{E as c,K as l,T as u,V as d,w as f}from"./debug-UI3T040K.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{r as h,t as g}from"./execFileNoThrow-CuQN1sz8.js";import{Ar as _,Co as v,Cr as y,Lk as b,Lo as x,Rk as S,it as C,jO as ee,tt as te,wr as ne,xr as re,zr as ie}from"./loadAgentsDir-Ci5mr0vm.js";import{n as w,r as ae}from"./xml-DD_ldd3X.js";import{X as T}from"./rcDebugLog-BbPkkigY.js";import{tmpdir as oe}from"os";import{extname as se,join as E}from"path";import{constants as ce}from"fs";import{copyFile as le,mkdir as D,mkdtemp as ue,readFile as O,readdir as k,rm as de,unlink as fe,writeFile as A}from"fs/promises";import{execFileSync as pe}from"child_process";function j(){return a()}function me(){return a()}function M(){return E(t(),`usage-data`)}function N(){return E(M(),`facets`)}function P(){return E(M(),`session-meta`)}function he(e){return K[se(e).toLowerCase()]||null}function ge(e){let t={},n={},i=0,a=0,o=0,s=0,c=0,l=[],u=0,d={},f=!1,p=0,m=0,h=new Set,g=[],_=[],v=!1,y=!1,b=!1,x=null;for(let C of e.messages){let e=C.timestamp;if(C.type===`assistant`&&C.message){e&&(x=e);let c=C.message.usage;c&&(o+=c.input_tokens||0,s+=c.output_tokens||0);let l=C.message.content;if(Array.isArray(l)){for(let e of l)if(e.type===`tool_use`&&`name`in e){let o=e.name;t[o]=(t[o]||0)+1,(o===`Agent`||o===`Task`)&&(f=!0),o.startsWith(`mcp__`)&&(v=!0),o===`WebSearch`&&(y=!0),o===`WebFetch`&&(b=!0);let s=e.input;if(s){let e=s.file_path||``;if(e){let t=he(e);t&&(n[t]=(n[t]||0)+1),(o===`Edit`||o===`Write`)&&h.add(e)}if(o===`Edit`){let e=s.old_string||``,t=s.new_string||``;for(let n of S(e,t))n.added&&(p+=n.count||0),n.removed&&(m+=n.count||0)}if(o===`Write`){let e=s.content||``;e&&(p+=r(e,`
2
- `)+1)}let t=s.command||``;t.includes(`git commit`)&&i++,t.includes(`git push`)&&a++}}}}if(C.type===`user`&&C.message){let t=C.message.content,n=!1;if(typeof t==`string`&&t.trim())n=!0;else if(Array.isArray(t)){for(let e of t)if(e.type===`text`&&`text`in e){n=!0;break}}if(n){if(e)try{let t=new Date(e).getHours();g.push(t),_.push(e)}catch{}if(x&&e){let t=new Date(x).getTime(),n=(new Date(e).getTime()-t)/1e3;n>2&&n<3600&&l.push(n)}}if(Array.isArray(t)){for(let e of t)if(e.type===`tool_result`&&`content`in e&&e.is_error){u++;let t=e.content,n=`Other`;if(typeof t==`string`){let e=t.toLowerCase();e.includes(`exit code`)?n=`Command Failed`:e.includes(`rejected`)||e.includes(`doesn't want`)?n=`User Rejected`:e.includes(`string to replace not found`)||e.includes(`no changes`)?n=`Edit Failed`:e.includes(`modified since read`)?n=`File Changed`:e.includes(`exceeds maximum`)||e.includes(`too large`)?n=`File Too Large`:(e.includes(`file not found`)||e.includes(`does not exist`))&&(n=`File Not Found`)}d[n]=(d[n]||0)+1}}if(typeof t==`string`)t.includes(`[Request interrupted by user`)&&c++;else if(Array.isArray(t)){for(let e of t)if(e.type===`text`&&`text`in e&&e.text.includes(`[Request interrupted by user`)){c++;break}}}}return{toolCounts:t,languages:n,gitCommits:i,gitPushes:a,inputTokens:o,outputTokens:s,userInterruptions:c,userResponseTimes:l,toolErrors:u,toolErrorCategories:d,usesTaskAgent:f,usesMcp:v,usesWebSearch:y,usesWebFetch:b,linesAdded:p,linesRemoved:m,filesModified:h,messageHours:g,userMessageTimestamps:_}}function _e(e){return!Number.isNaN(e.created.getTime())&&!Number.isNaN(e.modified.getTime())}function F(e){let t=ge(e),n=ne(e)||`unknown`,r=e.created.toISOString(),i=Math.round((e.modified.getTime()-e.created.getTime())/1e3/60),a=0,o=0;for(let t of e.messages)if(t.type===`assistant`&&o++,t.type===`user`&&t.message){let e=t.message.content,n=!1;if(typeof e==`string`&&e.trim())n=!0;else if(Array.isArray(e)){for(let t of e)if(t.type===`text`&&`text`in t){n=!0;break}}n&&a++}return{session_id:n,project_path:e.projectPath||``,start_time:r,duration_minutes:i,user_message_count:a,assistant_message_count:o,tool_counts:t.toolCounts,languages:t.languages,git_commits:t.gitCommits,git_pushes:t.gitPushes,input_tokens:t.inputTokens,output_tokens:t.outputTokens,first_prompt:e.firstPrompt||``,summary:e.summary,user_interruptions:t.userInterruptions,user_response_times:t.userResponseTimes,tool_errors:t.toolErrors,tool_error_categories:t.toolErrorCategories,uses_task_agent:t.usesTaskAgent,uses_mcp:t.usesMcp,uses_web_search:t.usesWebSearch,uses_web_fetch:t.usesWebFetch,lines_added:t.linesAdded,lines_removed:t.linesRemoved,files_modified:t.filesModified.size,message_hours:t.messageHours,user_message_timestamps:t.userMessageTimestamps}}function ve(e){let t=[],n=F(e);t.push(`Session: ${n.session_id.slice(0,8)}`),t.push(`Date: ${n.start_time}`),t.push(`Project: ${n.project_path}`),t.push(`Duration: ${n.duration_minutes} min`),t.push(``);for(let n of e.messages)if(n.type===`user`&&n.message){let e=n.message.content;if(typeof e==`string`)t.push(`[User]: ${e.slice(0,500)}`);else if(Array.isArray(e))for(let n of e)n.type===`text`&&`text`in n&&t.push(`[User]: ${n.text.slice(0,500)}`)}else if(n.type===`assistant`&&n.message){let e=n.message.content;if(Array.isArray(e))for(let n of e)n.type===`text`&&`text`in n?t.push(`[Assistant]: ${n.text.slice(0,300)}`):n.type===`tool_use`&&`name`in n&&t.push(`[Tool: ${n.name}]`)}return t.join(`
3
- `)}async function ye(e){try{return v((await C({systemPrompt:T([]),userPrompt:Y+e,signal:new AbortController().signal,options:{model:j(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:500}})).message.content)||e.slice(0,2e3)}catch{return e.slice(0,2e3)}}async function be(e){let t=ve(e);if(t.length<=3e4)return t;let n=25e3,r=[];for(let e=0;e<t.length;e+=n)r.push(t.slice(e,e+n));let i=await Promise.all(r.map(ye)),a=F(e);return[`Session: ${a.session_id.slice(0,8)}`,`Date: ${a.start_time}`,`Project: ${a.project_path}`,`Duration: ${a.duration_minutes} min`,`[Long session - ${r.length} parts summarized]`,``].join(`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,s as n}from"./envUtils-BWeoiL4Y.js";import{Oo as r,Pr as i,Tr as a,jo as o,rs as s}from"./paths-1ngPRtu3.js";import{E as c,K as l,T as u,V as d,w as f}from"./debug-UI3T040K.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{r as h,t as g}from"./execFileNoThrow-CuQN1sz8.js";import{Ar as _,Bk as v,Co as y,Cr as b,Lo as x,NO as S,it as C,tt as ee,wr as te,xr as ne,zk as re,zr as ie}from"./loadAgentsDir-D7kapZB5.js";import{n as w,r as ae}from"./xml-DTMvLcPg.js";import{X as T}from"./rcDebugLog-CPGWJbI4.js";import{tmpdir as oe}from"os";import{extname as se,join as E}from"path";import{constants as ce}from"fs";import{copyFile as le,mkdir as D,mkdtemp as ue,readFile as O,readdir as k,rm as de,unlink as fe,writeFile as A}from"fs/promises";import{execFileSync as pe}from"child_process";function j(){return a()}function me(){return a()}function M(){return E(t(),`usage-data`)}function N(){return E(M(),`facets`)}function P(){return E(M(),`session-meta`)}function he(e){return K[se(e).toLowerCase()]||null}function ge(e){let t={},n={},i=0,a=0,o=0,s=0,c=0,l=[],u=0,d={},f=!1,p=0,m=0,h=new Set,g=[],_=[],y=!1,b=!1,x=!1,S=null;for(let C of e.messages){let e=C.timestamp;if(C.type===`assistant`&&C.message){e&&(S=e);let c=C.message.usage;c&&(o+=c.input_tokens||0,s+=c.output_tokens||0);let l=C.message.content;if(Array.isArray(l)){for(let e of l)if(e.type===`tool_use`&&`name`in e){let o=e.name;t[o]=(t[o]||0)+1,(o===`Agent`||o===`Task`)&&(f=!0),o.startsWith(`mcp__`)&&(y=!0),o===`WebSearch`&&(b=!0),o===`WebFetch`&&(x=!0);let s=e.input;if(s){let e=s.file_path||``;if(e){let t=he(e);t&&(n[t]=(n[t]||0)+1),(o===`Edit`||o===`Write`)&&h.add(e)}if(o===`Edit`){let e=s.old_string||``,t=s.new_string||``;for(let n of v(e,t))n.added&&(p+=n.count||0),n.removed&&(m+=n.count||0)}if(o===`Write`){let e=s.content||``;e&&(p+=r(e,`
2
+ `)+1)}let t=s.command||``;t.includes(`git commit`)&&i++,t.includes(`git push`)&&a++}}}}if(C.type===`user`&&C.message){let t=C.message.content,n=!1;if(typeof t==`string`&&t.trim())n=!0;else if(Array.isArray(t)){for(let e of t)if(e.type===`text`&&`text`in e){n=!0;break}}if(n){if(e)try{let t=new Date(e).getHours();g.push(t),_.push(e)}catch{}if(S&&e){let t=new Date(S).getTime(),n=(new Date(e).getTime()-t)/1e3;n>2&&n<3600&&l.push(n)}}if(Array.isArray(t)){for(let e of t)if(e.type===`tool_result`&&`content`in e&&e.is_error){u++;let t=e.content,n=`Other`;if(typeof t==`string`){let e=t.toLowerCase();e.includes(`exit code`)?n=`Command Failed`:e.includes(`rejected`)||e.includes(`doesn't want`)?n=`User Rejected`:e.includes(`string to replace not found`)||e.includes(`no changes`)?n=`Edit Failed`:e.includes(`modified since read`)?n=`File Changed`:e.includes(`exceeds maximum`)||e.includes(`too large`)?n=`File Too Large`:(e.includes(`file not found`)||e.includes(`does not exist`))&&(n=`File Not Found`)}d[n]=(d[n]||0)+1}}if(typeof t==`string`)t.includes(`[Request interrupted by user`)&&c++;else if(Array.isArray(t)){for(let e of t)if(e.type===`text`&&`text`in e&&e.text.includes(`[Request interrupted by user`)){c++;break}}}}return{toolCounts:t,languages:n,gitCommits:i,gitPushes:a,inputTokens:o,outputTokens:s,userInterruptions:c,userResponseTimes:l,toolErrors:u,toolErrorCategories:d,usesTaskAgent:f,usesMcp:y,usesWebSearch:b,usesWebFetch:x,linesAdded:p,linesRemoved:m,filesModified:h,messageHours:g,userMessageTimestamps:_}}function _e(e){return!Number.isNaN(e.created.getTime())&&!Number.isNaN(e.modified.getTime())}function F(e){let t=ge(e),n=te(e)||`unknown`,r=e.created.toISOString(),i=Math.round((e.modified.getTime()-e.created.getTime())/1e3/60),a=0,o=0;for(let t of e.messages)if(t.type===`assistant`&&o++,t.type===`user`&&t.message){let e=t.message.content,n=!1;if(typeof e==`string`&&e.trim())n=!0;else if(Array.isArray(e)){for(let t of e)if(t.type===`text`&&`text`in t){n=!0;break}}n&&a++}return{session_id:n,project_path:e.projectPath||``,start_time:r,duration_minutes:i,user_message_count:a,assistant_message_count:o,tool_counts:t.toolCounts,languages:t.languages,git_commits:t.gitCommits,git_pushes:t.gitPushes,input_tokens:t.inputTokens,output_tokens:t.outputTokens,first_prompt:e.firstPrompt||``,summary:e.summary,user_interruptions:t.userInterruptions,user_response_times:t.userResponseTimes,tool_errors:t.toolErrors,tool_error_categories:t.toolErrorCategories,uses_task_agent:t.usesTaskAgent,uses_mcp:t.usesMcp,uses_web_search:t.usesWebSearch,uses_web_fetch:t.usesWebFetch,lines_added:t.linesAdded,lines_removed:t.linesRemoved,files_modified:t.filesModified.size,message_hours:t.messageHours,user_message_timestamps:t.userMessageTimestamps}}function ve(e){let t=[],n=F(e);t.push(`Session: ${n.session_id.slice(0,8)}`),t.push(`Date: ${n.start_time}`),t.push(`Project: ${n.project_path}`),t.push(`Duration: ${n.duration_minutes} min`),t.push(``);for(let n of e.messages)if(n.type===`user`&&n.message){let e=n.message.content;if(typeof e==`string`)t.push(`[User]: ${e.slice(0,500)}`);else if(Array.isArray(e))for(let n of e)n.type===`text`&&`text`in n&&t.push(`[User]: ${n.text.slice(0,500)}`)}else if(n.type===`assistant`&&n.message){let e=n.message.content;if(Array.isArray(e))for(let n of e)n.type===`text`&&`text`in n?t.push(`[Assistant]: ${n.text.slice(0,300)}`):n.type===`tool_use`&&`name`in n&&t.push(`[Tool: ${n.name}]`)}return t.join(`
3
+ `)}async function ye(e){try{return y((await C({systemPrompt:T([]),userPrompt:Y+e,signal:new AbortController().signal,options:{model:j(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:500}})).message.content)||e.slice(0,2e3)}catch{return e.slice(0,2e3)}}async function be(e){let t=ve(e);if(t.length<=3e4)return t;let n=25e3,r=[];for(let e=0;e<t.length;e+=n)r.push(t.slice(e,e+n));let i=await Promise.all(r.map(ye)),a=F(e);return[`Session: ${a.session_id.slice(0,8)}`,`Date: ${a.start_time}`,`Project: ${a.project_path}`,`Duration: ${a.duration_minutes} min`,`[Long session - ${r.length} parts summarized]`,``].join(`
4
4
  `)+i.join(`
5
5
 
6
6
  ---
@@ -19,10 +19,10 @@ RESPOND WITH ONLY A VALID JSON OBJECT matching this schema:
19
19
  "friction_detail": "One sentence describing friction or empty",
20
20
  "primary_success": "none|fast_accurate_search|correct_code_edits|good_explanations|proactive_help|multi_file_changes|good_debugging",
21
21
  "brief_summary": "One sentence: what user wanted and whether they got it"
22
- }`,r=v((await C({systemPrompt:T([]),userPrompt:n,signal:new AbortController().signal,options:{model:j(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:4096}})).message.content).match(/\{[\s\S]*\}/);if(!r)return null;let i=u(r[0]);return V(i)?{...i,session_id:t}:null}catch(e){return m(Error(`Facet extraction failed: ${l(e).message}`)),null}}function I(e){let t=[];for(let n of e)for(let e of n.user_message_timestamps)try{let r=new Date(e).getTime();t.push({ts:r,sessionId:n.session_id})}catch{}t.sort((e,t)=>e.ts-t.ts);let n=new Set,r=new Set,i=0,a=new Map;for(let e=0;e<t.length;e++){let o=t[e];for(;i<e&&o.ts-t[i].ts>18e5;){let e=t[i];a.get(e.sessionId)===i&&a.delete(e.sessionId),i++}let s=a.get(o.sessionId);if(s!==void 0)for(let i=s+1;i<e;i++){let e=t[i];if(e.sessionId!==o.sessionId){let i=[o.sessionId,e.sessionId].sort().join(`:`);n.add(i),r.add(`${t[s].ts}:${o.sessionId}`),r.add(`${e.ts}:${e.sessionId}`),r.add(`${o.ts}:${o.sessionId}`);break}}a.set(o.sessionId,e)}let o=new Set;for(let e of n){let[t,n]=e.split(`:`);t&&o.add(t),n&&o.add(n)}return{overlap_events:n.size,sessions_involved:o.size,user_messages_during:r.size}}function Ee(e,t){let n={total_sessions:e.length,sessions_with_facets:t.size,date_range:{start:``,end:``},total_messages:0,total_duration_hours:0,total_input_tokens:0,total_output_tokens:0,tool_counts:{},languages:{},git_commits:0,git_pushes:0,projects:{},goal_categories:{},outcomes:{},satisfaction:{},helpfulness:{},session_types:{},friction:{},success:{},session_summaries:[],total_interruptions:0,total_tool_errors:0,tool_error_categories:{},user_response_times:[],median_response_time:0,avg_response_time:0,sessions_using_task_agent:0,sessions_using_mcp:0,sessions_using_web_search:0,sessions_using_web_fetch:0,total_lines_added:0,total_lines_removed:0,total_files_modified:0,days_active:0,messages_per_day:0,message_hours:[],multi_clauding:{overlap_events:0,sessions_involved:0,user_messages_during:0}},r=[],i=[],a=[];for(let o of e){r.push(o.start_time),n.total_messages+=o.user_message_count,n.total_duration_hours+=o.duration_minutes/60,n.total_input_tokens+=o.input_tokens,n.total_output_tokens+=o.output_tokens,n.git_commits+=o.git_commits,n.git_pushes+=o.git_pushes,n.total_interruptions+=o.user_interruptions,n.total_tool_errors+=o.tool_errors;for(let[e,t]of Object.entries(o.tool_error_categories))n.tool_error_categories[e]=(n.tool_error_categories[e]||0)+t;i.push(...o.user_response_times),o.uses_task_agent&&n.sessions_using_task_agent++,o.uses_mcp&&n.sessions_using_mcp++,o.uses_web_search&&n.sessions_using_web_search++,o.uses_web_fetch&&n.sessions_using_web_fetch++,n.total_lines_added+=o.lines_added,n.total_lines_removed+=o.lines_removed,n.total_files_modified+=o.files_modified,a.push(...o.message_hours);for(let[e,t]of Object.entries(o.tool_counts))n.tool_counts[e]=(n.tool_counts[e]||0)+t;for(let[e,t]of Object.entries(o.languages))n.languages[e]=(n.languages[e]||0)+t;o.project_path&&(n.projects[o.project_path]=(n.projects[o.project_path]||0)+1);let e=t.get(o.session_id);if(e){for(let[t,r]of B(e.goal_categories))r>0&&(n.goal_categories[t]=(n.goal_categories[t]||0)+r);n.outcomes[e.outcome]=(n.outcomes[e.outcome]||0)+1;for(let[t,r]of B(e.user_satisfaction_counts))r>0&&(n.satisfaction[t]=(n.satisfaction[t]||0)+r);n.helpfulness[e.claude_helpfulness]=(n.helpfulness[e.claude_helpfulness]||0)+1,n.session_types[e.session_type]=(n.session_types[e.session_type]||0)+1;for(let[t,r]of B(e.friction_counts))r>0&&(n.friction[t]=(n.friction[t]||0)+r);e.primary_success!==`none`&&(n.success[e.primary_success]=(n.success[e.primary_success]||0)+1)}n.session_summaries.length<50&&n.session_summaries.push({id:o.session_id.slice(0,8),date:o.start_time.split(`T`)[0]||``,summary:o.summary||o.first_prompt.slice(0,100),goal:e?.underlying_goal})}if(r.sort(),n.date_range.start=r[0]?.split(`T`)[0]||``,n.date_range.end=r[r.length-1]?.split(`T`)[0]||``,n.user_response_times=i,i.length>0){let e=[...i].sort((e,t)=>e-t);n.median_response_time=e[Math.floor(e.length/2)]||0,n.avg_response_time=i.reduce((e,t)=>e+t,0)/i.length}return n.days_active=new Set(r.map(e=>e.split(`T`)[0])).size,n.messages_per_day=n.days_active>0?Math.round(n.total_messages/n.days_active*10)/10:0,n.message_hours=a,n.multi_clauding=I(e),n}async function L(e,t){try{let n=v((await C({systemPrompt:T([]),userPrompt:e.prompt+`
22
+ }`,r=y((await C({systemPrompt:T([]),userPrompt:n,signal:new AbortController().signal,options:{model:j(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:4096}})).message.content).match(/\{[\s\S]*\}/);if(!r)return null;let i=u(r[0]);return V(i)?{...i,session_id:t}:null}catch(e){return m(Error(`Facet extraction failed: ${l(e).message}`)),null}}function Ee(e){let t=[];for(let n of e)for(let e of n.user_message_timestamps)try{let r=new Date(e).getTime();t.push({ts:r,sessionId:n.session_id})}catch{}t.sort((e,t)=>e.ts-t.ts);let n=new Set,r=new Set,i=0,a=new Map;for(let e=0;e<t.length;e++){let o=t[e];for(;i<e&&o.ts-t[i].ts>18e5;){let e=t[i];a.get(e.sessionId)===i&&a.delete(e.sessionId),i++}let s=a.get(o.sessionId);if(s!==void 0)for(let i=s+1;i<e;i++){let e=t[i];if(e.sessionId!==o.sessionId){let i=[o.sessionId,e.sessionId].sort().join(`:`);n.add(i),r.add(`${t[s].ts}:${o.sessionId}`),r.add(`${e.ts}:${e.sessionId}`),r.add(`${o.ts}:${o.sessionId}`);break}}a.set(o.sessionId,e)}let o=new Set;for(let e of n){let[t,n]=e.split(`:`);t&&o.add(t),n&&o.add(n)}return{overlap_events:n.size,sessions_involved:o.size,user_messages_during:r.size}}function De(e,t){let n={total_sessions:e.length,sessions_with_facets:t.size,date_range:{start:``,end:``},total_messages:0,total_duration_hours:0,total_input_tokens:0,total_output_tokens:0,tool_counts:{},languages:{},git_commits:0,git_pushes:0,projects:{},goal_categories:{},outcomes:{},satisfaction:{},helpfulness:{},session_types:{},friction:{},success:{},session_summaries:[],total_interruptions:0,total_tool_errors:0,tool_error_categories:{},user_response_times:[],median_response_time:0,avg_response_time:0,sessions_using_task_agent:0,sessions_using_mcp:0,sessions_using_web_search:0,sessions_using_web_fetch:0,total_lines_added:0,total_lines_removed:0,total_files_modified:0,days_active:0,messages_per_day:0,message_hours:[],multi_clauding:{overlap_events:0,sessions_involved:0,user_messages_during:0}},r=[],i=[],a=[];for(let o of e){r.push(o.start_time),n.total_messages+=o.user_message_count,n.total_duration_hours+=o.duration_minutes/60,n.total_input_tokens+=o.input_tokens,n.total_output_tokens+=o.output_tokens,n.git_commits+=o.git_commits,n.git_pushes+=o.git_pushes,n.total_interruptions+=o.user_interruptions,n.total_tool_errors+=o.tool_errors;for(let[e,t]of Object.entries(o.tool_error_categories))n.tool_error_categories[e]=(n.tool_error_categories[e]||0)+t;i.push(...o.user_response_times),o.uses_task_agent&&n.sessions_using_task_agent++,o.uses_mcp&&n.sessions_using_mcp++,o.uses_web_search&&n.sessions_using_web_search++,o.uses_web_fetch&&n.sessions_using_web_fetch++,n.total_lines_added+=o.lines_added,n.total_lines_removed+=o.lines_removed,n.total_files_modified+=o.files_modified,a.push(...o.message_hours);for(let[e,t]of Object.entries(o.tool_counts))n.tool_counts[e]=(n.tool_counts[e]||0)+t;for(let[e,t]of Object.entries(o.languages))n.languages[e]=(n.languages[e]||0)+t;o.project_path&&(n.projects[o.project_path]=(n.projects[o.project_path]||0)+1);let e=t.get(o.session_id);if(e){for(let[t,r]of B(e.goal_categories))r>0&&(n.goal_categories[t]=(n.goal_categories[t]||0)+r);n.outcomes[e.outcome]=(n.outcomes[e.outcome]||0)+1;for(let[t,r]of B(e.user_satisfaction_counts))r>0&&(n.satisfaction[t]=(n.satisfaction[t]||0)+r);n.helpfulness[e.claude_helpfulness]=(n.helpfulness[e.claude_helpfulness]||0)+1,n.session_types[e.session_type]=(n.session_types[e.session_type]||0)+1;for(let[t,r]of B(e.friction_counts))r>0&&(n.friction[t]=(n.friction[t]||0)+r);e.primary_success!==`none`&&(n.success[e.primary_success]=(n.success[e.primary_success]||0)+1)}n.session_summaries.length<50&&n.session_summaries.push({id:o.session_id.slice(0,8),date:o.start_time.split(`T`)[0]||``,summary:o.summary||o.first_prompt.slice(0,100),goal:e?.underlying_goal})}if(r.sort(),n.date_range.start=r[0]?.split(`T`)[0]||``,n.date_range.end=r[r.length-1]?.split(`T`)[0]||``,n.user_response_times=i,i.length>0){let e=[...i].sort((e,t)=>e-t);n.median_response_time=e[Math.floor(e.length/2)]||0,n.avg_response_time=i.reduce((e,t)=>e+t,0)/i.length}return n.days_active=new Set(r.map(e=>e.split(`T`)[0])).size,n.messages_per_day=n.days_active>0?Math.round(n.total_messages/n.days_active*10)/10:0,n.message_hours=a,n.multi_clauding=Ee(e),n}async function I(e,t){try{let n=y((await C({systemPrompt:T([]),userPrompt:e.prompt+`
23
23
 
24
24
  DATA:
25
- `+t,signal:new AbortController().signal,options:{model:me(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:e.maxTokens}})).message.content);if(n){let t=n.match(/\{[\s\S]*\}/);if(t)try{return{name:e.name,result:u(t[0])}}catch{return{name:e.name,result:null}}}return{name:e.name,result:null}}catch(t){return m(Error(`${e.name} failed: ${l(t).message}`)),{name:e.name,result:null}}}async function De(e,t){let n=Array.from(t.values()).slice(0,50).map(e=>`- ${e.brief_summary} (${e.outcome}, ${e.claude_helpfulness})`).join(`
25
+ `+t,signal:new AbortController().signal,options:{model:me(),querySource:`insights`,agents:[],isNonInteractiveSession:!0,hasAppendSystemPrompt:!1,mcpTools:[],maxOutputTokensOverride:e.maxTokens}})).message.content);if(n){let t=n.match(/\{[\s\S]*\}/);if(t)try{return{name:e.name,result:u(t[0])}}catch{return{name:e.name,result:null}}}return{name:e.name,result:null}}catch(t){return m(Error(`${e.name} failed: ${l(t).message}`)),{name:e.name,result:null}}}async function Oe(e,t){let n=Array.from(t.values()).slice(0,50).map(e=>`- ${e.brief_summary} (${e.outcome}, ${e.claude_helpfulness})`).join(`
26
26
  `),r=Array.from(t.values()).filter(e=>e.friction_detail).slice(0,20).map(e=>`- ${e.friction_detail}`).join(`
27
27
  `),i=Array.from(t.values()).flatMap(e=>e.user_instructions_to_claude||[]).slice(0,15).map(e=>`- ${e}`).join(`
28
28
  `),a=c({sessions:e.total_sessions,analyzed:e.sessions_with_facets,date_range:e.date_range,messages:e.total_messages,hours:Math.round(e.total_duration_hours),commits:e.git_commits,top_tools:Object.entries(e.tool_counts).sort((e,t)=>t[1]-e[1]).slice(0,8),top_goals:Object.entries(e.goal_categories).sort((e,t)=>t[1]-e[1]).slice(0,8),outcomes:e.outcomes,satisfaction:e.satisfaction,friction:e.friction,success:e.success,languages:e.languages},null,2)+`
@@ -34,7 +34,7 @@ FRICTION DETAILS:
34
34
  `+r+`
35
35
 
36
36
  USER INSTRUCTIONS TO CLAUDE:
37
- `+(i||`None captured`),o=await Promise.all(X.map(e=>L(e,a))),s={};for(let{name:e,result:t}of o)t&&(s[e]=t);let l=await L({name:`at_a_glance`,prompt:`You're writing an "At a Glance" summary for a Claude Code usage insights report for Claude Code users. The goal is to help them understand their usage and improve how they can use Claude better, especially as models improve.
37
+ `+(i||`None captured`),o=await Promise.all(X.map(e=>I(e,a))),s={};for(let{name:e,result:t}of o)t&&(s[e]=t);let l=await I({name:`at_a_glance`,prompt:`You're writing an "At a Glance" summary for a Claude Code usage insights report for Claude Code users. The goal is to help them understand their usage and improve how they can use Claude better, especially as models improve.
38
38
 
39
39
  Use this 4-part structure:
40
40
 
@@ -81,17 +81,17 @@ ${s.suggestions?.usage_patterns?.map(e=>`- ${e.title}: ${e.suggestion}`).join(`
81
81
 
82
82
  ## On the Horizon (ambitious workflows for better models)
83
83
  ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).join(`
84
- `)||``}`,maxTokens:8192},``);return l.result&&(s.at_a_glance=l.result),s}function R(e){return w(e).replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`)}function z(e,t,n=6,r){let i;if(i=r?r.filter(t=>t in e&&(e[t]??0)>0).map(t=>[t,e[t]??0]):Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,n),i.length===0)return`<p class="empty">No data</p>`;let a=Math.max(...i.map(e=>e[1]));return i.map(([e,n])=>{let r=n/a*100;return`<div class="bar-row">
84
+ `)||``}`,maxTokens:8192},``);return l.result&&(s.at_a_glance=l.result),s}function L(e){return w(e).replace(/\*\*(.+?)\*\*/g,`<strong>$1</strong>`)}function R(e,t,n=6,r){let i;if(i=r?r.filter(t=>t in e&&(e[t]??0)>0).map(t=>[t,e[t]??0]):Object.entries(e).sort((e,t)=>t[1]-e[1]).slice(0,n),i.length===0)return`<p class="empty">No data</p>`;let a=Math.max(...i.map(e=>e[1]));return i.map(([e,n])=>{let r=n/a*100;return`<div class="bar-row">
85
85
  <div class="bar-label">${w(q[e]||e.replace(/_/g,` `).replace(/\b\w/g,e=>e.toUpperCase()))}</div>
86
86
  <div class="bar-track"><div class="bar-fill" style="width:${r}%;background:${t}"></div></div>
87
87
  <div class="bar-value">${n}</div>
88
88
  </div>`}).join(`
89
- `)}function Oe(e){if(e.length===0)return`<p class="empty">No response time data</p>`;let t={"2-10s":0,"10-30s":0,"30s-1m":0,"1-2m":0,"2-5m":0,"5-15m":0,">15m":0};for(let n of e)n<10?t[`2-10s`]=(t[`2-10s`]??0)+1:n<30?t[`10-30s`]=(t[`10-30s`]??0)+1:n<60?t[`30s-1m`]=(t[`30s-1m`]??0)+1:n<120?t[`1-2m`]=(t[`1-2m`]??0)+1:n<300?t[`2-5m`]=(t[`2-5m`]??0)+1:n<900?t[`5-15m`]=(t[`5-15m`]??0)+1:t[`>15m`]=(t[`>15m`]??0)+1;let n=Math.max(...Object.values(t));return n===0?`<p class="empty">No response time data</p>`:Object.entries(t).map(([e,t])=>`<div class="bar-row">
89
+ `)}function ke(e){if(e.length===0)return`<p class="empty">No response time data</p>`;let t={"2-10s":0,"10-30s":0,"30s-1m":0,"1-2m":0,"2-5m":0,"5-15m":0,">15m":0};for(let n of e)n<10?t[`2-10s`]=(t[`2-10s`]??0)+1:n<30?t[`10-30s`]=(t[`10-30s`]??0)+1:n<60?t[`30s-1m`]=(t[`30s-1m`]??0)+1:n<120?t[`1-2m`]=(t[`1-2m`]??0)+1:n<300?t[`2-5m`]=(t[`2-5m`]??0)+1:n<900?t[`5-15m`]=(t[`5-15m`]??0)+1:t[`>15m`]=(t[`>15m`]??0)+1;let n=Math.max(...Object.values(t));return n===0?`<p class="empty">No response time data</p>`:Object.entries(t).map(([e,t])=>`<div class="bar-row">
90
90
  <div class="bar-label">${e}</div>
91
91
  <div class="bar-track"><div class="bar-fill" style="width:${t/n*100}%;background:#6366f1"></div></div>
92
92
  <div class="bar-value">${t}</div>
93
93
  </div>`).join(`
94
- `)}function ke(e){if(e.length===0)return`<p class="empty">No time data</p>`;let t=[{label:`Morning (6-12)`,range:[6,7,8,9,10,11]},{label:`Afternoon (12-18)`,range:[12,13,14,15,16,17]},{label:`Evening (18-24)`,range:[18,19,20,21,22,23]},{label:`Night (0-6)`,range:[0,1,2,3,4,5]}],n={};for(let t of e)n[t]=(n[t]||0)+1;let r=t.map(e=>({label:e.label,count:e.range.reduce((e,t)=>e+(n[t]||0),0)})),i=Math.max(...r.map(e=>e.count))||1;return`<div id="hour-histogram">${r.map(e=>`
94
+ `)}function z(e){if(e.length===0)return`<p class="empty">No time data</p>`;let t=[{label:`Morning (6-12)`,range:[6,7,8,9,10,11]},{label:`Afternoon (12-18)`,range:[12,13,14,15,16,17]},{label:`Evening (18-24)`,range:[18,19,20,21,22,23]},{label:`Night (0-6)`,range:[0,1,2,3,4,5]}],n={};for(let t of e)n[t]=(n[t]||0)+1;let r=t.map(e=>({label:e.label,count:e.range.reduce((e,t)=>e+(n[t]||0),0)})),i=Math.max(...r.map(e=>e.count))||1;return`<div id="hour-histogram">${r.map(e=>`
95
95
  <div class="bar-row">
96
96
  <div class="bar-label">${e.label}</div>
97
97
  <div class="bar-track"><div class="bar-fill" style="width:${e.count/i*100}%;background:#8b5cf6"></div></div>
@@ -104,10 +104,10 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
104
104
  <div class="at-a-glance">
105
105
  <div class="glance-title">At a Glance</div>
106
106
  <div class="glance-sections">
107
- ${r.whats_working?`<div class="glance-section"><strong>What's working:</strong> ${R(r.whats_working)} <a href="#section-wins" class="see-more">Impressive Things You Did →</a></div>`:``}
108
- ${r.whats_hindering?`<div class="glance-section"><strong>What's hindering you:</strong> ${R(r.whats_hindering)} <a href="#section-friction" class="see-more">Where Things Go Wrong →</a></div>`:``}
109
- ${r.quick_wins?`<div class="glance-section"><strong>Quick wins to try:</strong> ${R(r.quick_wins)} <a href="#section-features" class="see-more">Features to Try →</a></div>`:``}
110
- ${r.ambitious_workflows?`<div class="glance-section"><strong>Ambitious workflows:</strong> ${R(r.ambitious_workflows)} <a href="#section-horizon" class="see-more">On the Horizon →</a></div>`:``}
107
+ ${r.whats_working?`<div class="glance-section"><strong>What's working:</strong> ${L(r.whats_working)} <a href="#section-wins" class="see-more">Impressive Things You Did →</a></div>`:``}
108
+ ${r.whats_hindering?`<div class="glance-section"><strong>What's hindering you:</strong> ${L(r.whats_hindering)} <a href="#section-friction" class="see-more">Where Things Go Wrong →</a></div>`:``}
109
+ ${r.quick_wins?`<div class="glance-section"><strong>Quick wins to try:</strong> ${L(r.quick_wins)} <a href="#section-features" class="see-more">Features to Try →</a></div>`:``}
110
+ ${r.ambitious_workflows?`<div class="glance-section"><strong>Ambitious workflows:</strong> ${L(r.ambitious_workflows)} <a href="#section-horizon" class="see-more">On the Horizon →</a></div>`:``}
111
111
  </div>
112
112
  </div>
113
113
  `:``,a=t.project_areas?.areas||[],o=a.length>0?`
@@ -521,22 +521,22 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
521
521
  <div class="charts-row">
522
522
  <div class="chart-card">
523
523
  <div class="chart-title">What You Wanted</div>
524
- ${z(e.goal_categories,`#2563eb`)}
524
+ ${R(e.goal_categories,`#2563eb`)}
525
525
  </div>
526
526
  <div class="chart-card">
527
527
  <div class="chart-title">Top Tools Used</div>
528
- ${z(e.tool_counts,`#0891b2`)}
528
+ ${R(e.tool_counts,`#0891b2`)}
529
529
  </div>
530
530
  </div>
531
531
 
532
532
  <div class="charts-row">
533
533
  <div class="chart-card">
534
534
  <div class="chart-title">Languages</div>
535
- ${z(e.languages,`#10b981`)}
535
+ ${R(e.languages,`#10b981`)}
536
536
  </div>
537
537
  <div class="chart-card">
538
538
  <div class="chart-title">Session Types</div>
539
- ${z(e.session_types||{},`#8b5cf6`)}
539
+ ${R(e.session_types||{},`#8b5cf6`)}
540
540
  </div>
541
541
  </div>
542
542
 
@@ -545,7 +545,7 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
545
545
  <!-- Response Time Distribution -->
546
546
  <div class="chart-card" style="margin: 24px 0;">
547
547
  <div class="chart-title">User Response Time Distribution</div>
548
- ${Oe(e.user_response_times)}
548
+ ${ke(e.user_response_times)}
549
549
  <div style="font-size: 12px; color: #64748b; margin-top: 8px;">
550
550
  Median: ${e.median_response_time.toFixed(1)}s &bull; Average: ${e.avg_response_time.toFixed(1)}s
551
551
  </div>
@@ -595,11 +595,11 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
595
595
  </select>
596
596
  <input type="number" id="custom-offset" placeholder="UTC offset" style="display: none; width: 80px; font-size: 12px; padding: 4px; border-radius: 4px; border: 1px solid #e2e8f0;">
597
597
  </div>
598
- ${ke(e.message_hours)}
598
+ ${z(e.message_hours)}
599
599
  </div>
600
600
  <div class="chart-card">
601
601
  <div class="chart-title">Tool Errors Encountered</div>
602
- ${Object.keys(e.tool_error_categories).length>0?z(e.tool_error_categories,`#dc2626`):`<p class="empty">No tool errors</p>`}
602
+ ${Object.keys(e.tool_error_categories).length>0?R(e.tool_error_categories,`#dc2626`):`<p class="empty">No tool errors</p>`}
603
603
  </div>
604
604
  </div>
605
605
 
@@ -608,11 +608,11 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
608
608
  <div class="charts-row">
609
609
  <div class="chart-card">
610
610
  <div class="chart-title">What Helped Most (Claude's Capabilities)</div>
611
- ${z(e.success,`#16a34a`)}
611
+ ${R(e.success,`#16a34a`)}
612
612
  </div>
613
613
  <div class="chart-card">
614
614
  <div class="chart-title">Outcomes</div>
615
- ${z(e.outcomes,`#8b5cf6`,6,Q)}
615
+ ${R(e.outcomes,`#8b5cf6`,6,Q)}
616
616
  </div>
617
617
  </div>
618
618
 
@@ -621,11 +621,11 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
621
621
  <div class="charts-row">
622
622
  <div class="chart-card">
623
623
  <div class="chart-title">Primary Friction Types</div>
624
- ${z(e.friction,`#dc2626`)}
624
+ ${R(e.friction,`#dc2626`)}
625
625
  </div>
626
626
  <div class="chart-card">
627
627
  <div class="chart-title">Inferred Satisfaction (model-estimated)</div>
628
- ${z(e.satisfaction,`#eab308`,6,Z)}
628
+ ${R(e.satisfaction,`#eab308`,6,Z)}
629
629
  </div>
630
630
  </div>
631
631
 
@@ -639,7 +639,7 @@ ${s.on_the_horizon?.opportunities?.map(e=>`- ${e.title}: ${e.whats_possible}`).j
639
639
  </div>
640
640
  <script>${S}<\/script>
641
641
  </body>
642
- </html>`}async function Me(){let e=re(),t;try{t=await k(e,{withFileTypes:!0})}catch{return[]}let n=t.filter(e=>e.isDirectory()).map(t=>E(e,t.name)),r=[];for(let e=0;e<n.length;e++){let t=await y(n[e]);for(let[e,n]of t)r.push({sessionId:e,path:n.path,mtime:n.mtime,size:n.size});e%10==9&&await new Promise(e=>setImmediate(e))}return r.sort((e,t)=>t.mtime-e.mtime),r}async function Ne(e){let n;if(process.env.USER_TYPE===`ant`&&e?.collectRemote){let{hosts:e,totalCopied:r}=await G(E(t(),`projects`));n={hosts:e,totalCopied:r}}let r=await Me(),i=r.length,a=[],o=[];for(let e=0;e<r.length;e+=50){let t=r.slice(e,e+50),n=await Promise.all(t.map(async e=>({sessionInfo:e,cached:await Ce(e.sessionId)})));for(let{sessionInfo:e,cached:t}of n)t?a.push(t):o.length<200&&o.push(e)}let s=new Map,c=e=>{for(let t of e.messages.slice(0,5))if(t.type===`user`&&t.message){let e=t.message.content;if(typeof e==`string`&&(e.includes(`RESPOND WITH ONLY A VALID JSON OBJECT`)||e.includes(`record_facets`)))return!0}return!1};for(let e=0;e<o.length;e+=10){let t=o.slice(e,e+10),n=await Promise.all(t.map(async e=>{try{return await ie(e.path)}catch{return[]}})),r=[];for(let e of n)for(let t of e){if(c(t)||!_e(t))continue;let e=F(t);a.push(e),r.push(e),s.set(e.session_id,t)}await Promise.all(r.map(e=>we(e)))}let l=new Map;for(let e of a){let t=l.get(e.session_id);(!t||e.user_message_count>t.user_message_count||e.user_message_count===t.user_message_count&&e.duration_minutes>t.duration_minutes)&&l.set(e.session_id,e)}let u=new Set(l.keys());a=[...l.values()];for(let e of s.keys())u.has(e)||s.delete(e);a.sort((e,t)=>t.start_time.localeCompare(e.start_time));let d=a.filter(e=>!(e.user_message_count<2||e.duration_minutes<1)),f=new Map,p=[],m=await Promise.all(d.map(async e=>({sessionId:e.session_id,cached:await xe(e.session_id)})));for(let{sessionId:e,cached:t}of m)if(t)f.set(e,t);else{let t=s.get(e);t&&p.length<50&&p.push({log:t,sessionId:e})}for(let e=0;e<p.length;e+=50){let t=p.slice(e,e+50),n=await Promise.all(t.map(async({log:e,sessionId:t})=>({sessionId:t,newFacets:await Te(e,t)}))),r=[];for(let{sessionId:e,newFacets:t}of n)t&&(f.set(e,t),r.push(t));await Promise.all(r.map(e=>Se(e)))}let h=e=>{let t=f.get(e);if(!t)return!1;let n=t.goal_categories,r=Pe(n).filter(e=>(n[e]??0)>0);return r.length===1&&r[0]===`warmup_minimal`},g=d.filter(e=>!h(e.session_id)),_=new Map;for(let[e,t]of f)h(e)||_.set(e,t);let v=Ee(g,_);v.total_sessions_scanned=i;let y=await De(v,f),b=je(v,y);try{await D(M(),{recursive:!0})}catch{}let x=E(M(),`report.html`);return await A(x,b,{encoding:`utf-8`,mode:384}),{insights:y,htmlPath:x,data:v,remoteStats:n,facets:_}}function B(e){return e?Object.entries(e):[]}function Pe(e){return e?Object.keys(e):[]}function V(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.underlying_goal==`string`&&typeof t.outcome==`string`&&typeof t.brief_summary==`string`&&t.goal_categories!==null&&typeof t.goal_categories==`object`&&t.user_satisfaction_counts!==null&&typeof t.user_satisfaction_counts==`object`&&t.friction_counts!==null&&typeof t.friction_counts==`object`}var H,U,W,G,K,q,J,Y,X,Z,Q,$;e((()=>{b(),te(),s(),n(),d(),h(),p(),x(),i(),_(),f(),o(),ee(),ae(),H=process.env.USER_TYPE===`ant`?async()=>{let{stdout:e,code:t}=await g(`coder`,[`list`,`-o`,`json`],{timeout:3e4});if(t!==0)return[];try{return u(e).filter(e=>e.latest_build?.status===`running`).map(e=>e.name)}catch{return[]}}:async()=>[],U=process.env.USER_TYPE===`ant`?async e=>{let{stdout:t,code:n}=await g(`ssh`,[`${e}.coder`,`find /root/.claude/projects -name "*.jsonl" 2>/dev/null | wc -l`],{timeout:3e4});return n===0&&parseInt(t.trim(),10)||0}:async()=>0,W=process.env.USER_TYPE===`ant`?async(e,t)=>{let n={copied:0,skipped:0},r=await ue(E(oe(),`claude-hs-`));try{if((await g(`scp`,[`-rq`,`${e}.coder:/root/.claude/projects/`,r],{timeout:3e5})).code!==0)return n;let i=E(r,`projects`),a;try{a=await k(i,{withFileTypes:!0})}catch{return n}await Promise.all(a.map(async r=>{let a=r.name,o=E(i,a);if(!r.isDirectory())return;let s=E(t,`${a}__${e}`);try{await D(s,{recursive:!0})}catch{}let c;try{c=await k(o,{withFileTypes:!0})}catch{return}await Promise.all(c.map(async e=>{let t=e.name;if(!t.endsWith(`.jsonl`))return;let r=E(o,t),i=E(s,t);try{await le(r,i,ce.COPYFILE_EXCL),n.copied++}catch{n.skipped++}}))}))}finally{try{await de(r,{recursive:!0,force:!0})}catch{}}return n}:async()=>({copied:0,skipped:0}),G=process.env.USER_TYPE===`ant`?async e=>{let t=await H(),n=[],r=0,i=0,a=await Promise.all(t.map(async t=>{let n=await U(t);if(n>0){let{copied:r,skipped:i}=await W(t,e);return{name:t,sessionCount:n,copied:r,skipped:i}}return{name:t,sessionCount:n,copied:0,skipped:0}}));for(let e of a)n.push({name:e.name,sessionCount:e.sessionCount}),r+=e.copied,i+=e.skipped;return{hosts:n,totalCopied:r,totalSkipped:i}}:async()=>({hosts:[],totalCopied:0,totalSkipped:0}),K={".ts":`TypeScript`,".tsx":`TypeScript`,".js":`JavaScript`,".jsx":`JavaScript`,".py":`Python`,".rb":`Ruby`,".go":`Go`,".rs":`Rust`,".java":`Java`,".md":`Markdown`,".json":`JSON`,".yaml":`YAML`,".yml":`YAML`,".sh":`Shell`,".css":`CSS`,".html":`HTML`},q={debug_investigate:`Debug/Investigate`,implement_feature:`Implement Feature`,fix_bug:`Fix Bug`,write_script_tool:`Write Script/Tool`,refactor_code:`Refactor Code`,configure_system:`Configure System`,create_pr_commit:`Create PR/Commit`,analyze_data:`Analyze Data`,understand_codebase:`Understand Codebase`,write_tests:`Write Tests`,write_docs:`Write Docs`,deploy_infra:`Deploy/Infra`,warmup_minimal:`Cache Warmup`,fast_accurate_search:`Fast/Accurate Search`,correct_code_edits:`Correct Code Edits`,good_explanations:`Good Explanations`,proactive_help:`Proactive Help`,multi_file_changes:`Multi-file Changes`,handled_complexity:`Multi-file Changes`,good_debugging:`Good Debugging`,misunderstood_request:`Misunderstood Request`,wrong_approach:`Wrong Approach`,buggy_code:`Buggy Code`,user_rejected_action:`User Rejected Action`,claude_got_blocked:`Claude Got Blocked`,user_stopped_early:`User Stopped Early`,wrong_file_or_location:`Wrong File/Location`,excessive_changes:`Excessive Changes`,slow_or_verbose:`Slow/Verbose`,tool_failed:`Tool Failed`,user_unclear:`User Unclear`,external_issue:`External Issue`,frustrated:`Frustrated`,dissatisfied:`Dissatisfied`,likely_satisfied:`Likely Satisfied`,satisfied:`Satisfied`,happy:`Happy`,unsure:`Unsure`,neutral:`Neutral`,delighted:`Delighted`,single_task:`Single Task`,multi_task:`Multi Task`,iterative_refinement:`Iterative Refinement`,exploration:`Exploration`,quick_question:`Quick Question`,fully_achieved:`Fully Achieved`,mostly_achieved:`Mostly Achieved`,partially_achieved:`Partially Achieved`,not_achieved:`Not Achieved`,unclear_from_transcript:`Unclear`,unhelpful:`Unhelpful`,slightly_helpful:`Slightly Helpful`,moderately_helpful:`Moderately Helpful`,very_helpful:`Very Helpful`,essential:`Essential`},J=`Analyze this Claude Code session and extract structured facets.
642
+ </html>`}async function Me(){let e=ne(),t;try{t=await k(e,{withFileTypes:!0})}catch{return[]}let n=t.filter(e=>e.isDirectory()).map(t=>E(e,t.name)),r=[];for(let e=0;e<n.length;e++){let t=await b(n[e]);for(let[e,n]of t)r.push({sessionId:e,path:n.path,mtime:n.mtime,size:n.size});e%10==9&&await new Promise(e=>setImmediate(e))}return r.sort((e,t)=>t.mtime-e.mtime),r}async function Ne(e){let n;if(process.env.USER_TYPE===`ant`&&e?.collectRemote){let{hosts:e,totalCopied:r}=await G(E(t(),`projects`));n={hosts:e,totalCopied:r}}let r=await Me(),i=r.length,a=[],o=[];for(let e=0;e<r.length;e+=50){let t=r.slice(e,e+50),n=await Promise.all(t.map(async e=>({sessionInfo:e,cached:await Ce(e.sessionId)})));for(let{sessionInfo:e,cached:t}of n)t?a.push(t):o.length<200&&o.push(e)}let s=new Map,c=e=>{for(let t of e.messages.slice(0,5))if(t.type===`user`&&t.message){let e=t.message.content;if(typeof e==`string`&&(e.includes(`RESPOND WITH ONLY A VALID JSON OBJECT`)||e.includes(`record_facets`)))return!0}return!1};for(let e=0;e<o.length;e+=10){let t=o.slice(e,e+10),n=await Promise.all(t.map(async e=>{try{return await ie(e.path)}catch{return[]}})),r=[];for(let e of n)for(let t of e){if(c(t)||!_e(t))continue;let e=F(t);a.push(e),r.push(e),s.set(e.session_id,t)}await Promise.all(r.map(e=>we(e)))}let l=new Map;for(let e of a){let t=l.get(e.session_id);(!t||e.user_message_count>t.user_message_count||e.user_message_count===t.user_message_count&&e.duration_minutes>t.duration_minutes)&&l.set(e.session_id,e)}let u=new Set(l.keys());a=[...l.values()];for(let e of s.keys())u.has(e)||s.delete(e);a.sort((e,t)=>t.start_time.localeCompare(e.start_time));let d=a.filter(e=>!(e.user_message_count<2||e.duration_minutes<1)),f=new Map,p=[],m=await Promise.all(d.map(async e=>({sessionId:e.session_id,cached:await xe(e.session_id)})));for(let{sessionId:e,cached:t}of m)if(t)f.set(e,t);else{let t=s.get(e);t&&p.length<50&&p.push({log:t,sessionId:e})}for(let e=0;e<p.length;e+=50){let t=p.slice(e,e+50),n=await Promise.all(t.map(async({log:e,sessionId:t})=>({sessionId:t,newFacets:await Te(e,t)}))),r=[];for(let{sessionId:e,newFacets:t}of n)t&&(f.set(e,t),r.push(t));await Promise.all(r.map(e=>Se(e)))}let h=e=>{let t=f.get(e);if(!t)return!1;let n=t.goal_categories,r=Pe(n).filter(e=>(n[e]??0)>0);return r.length===1&&r[0]===`warmup_minimal`},g=d.filter(e=>!h(e.session_id)),_=new Map;for(let[e,t]of f)h(e)||_.set(e,t);let v=De(g,_);v.total_sessions_scanned=i;let y=await Oe(v,f),b=je(v,y);try{await D(M(),{recursive:!0})}catch{}let x=E(M(),`report.html`);return await A(x,b,{encoding:`utf-8`,mode:384}),{insights:y,htmlPath:x,data:v,remoteStats:n,facets:_}}function B(e){return e?Object.entries(e):[]}function Pe(e){return e?Object.keys(e):[]}function V(e){if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.underlying_goal==`string`&&typeof t.outcome==`string`&&typeof t.brief_summary==`string`&&t.goal_categories!==null&&typeof t.goal_categories==`object`&&t.user_satisfaction_counts!==null&&typeof t.user_satisfaction_counts==`object`&&t.friction_counts!==null&&typeof t.friction_counts==`object`}var H,U,W,G,K,q,J,Y,X,Z,Q,$;e((()=>{re(),ee(),s(),n(),d(),h(),p(),x(),i(),_(),f(),o(),S(),ae(),H=process.env.USER_TYPE===`ant`?async()=>{let{stdout:e,code:t}=await g(`coder`,[`list`,`-o`,`json`],{timeout:3e4});if(t!==0)return[];try{return u(e).filter(e=>e.latest_build?.status===`running`).map(e=>e.name)}catch{return[]}}:async()=>[],U=process.env.USER_TYPE===`ant`?async e=>{let{stdout:t,code:n}=await g(`ssh`,[`${e}.coder`,`find /root/.claude/projects -name "*.jsonl" 2>/dev/null | wc -l`],{timeout:3e4});return n===0&&parseInt(t.trim(),10)||0}:async()=>0,W=process.env.USER_TYPE===`ant`?async(e,t)=>{let n={copied:0,skipped:0},r=await ue(E(oe(),`claude-hs-`));try{if((await g(`scp`,[`-rq`,`${e}.coder:/root/.claude/projects/`,r],{timeout:3e5})).code!==0)return n;let i=E(r,`projects`),a;try{a=await k(i,{withFileTypes:!0})}catch{return n}await Promise.all(a.map(async r=>{let a=r.name,o=E(i,a);if(!r.isDirectory())return;let s=E(t,`${a}__${e}`);try{await D(s,{recursive:!0})}catch{}let c;try{c=await k(o,{withFileTypes:!0})}catch{return}await Promise.all(c.map(async e=>{let t=e.name;if(!t.endsWith(`.jsonl`))return;let r=E(o,t),i=E(s,t);try{await le(r,i,ce.COPYFILE_EXCL),n.copied++}catch{n.skipped++}}))}))}finally{try{await de(r,{recursive:!0,force:!0})}catch{}}return n}:async()=>({copied:0,skipped:0}),G=process.env.USER_TYPE===`ant`?async e=>{let t=await H(),n=[],r=0,i=0,a=await Promise.all(t.map(async t=>{let n=await U(t);if(n>0){let{copied:r,skipped:i}=await W(t,e);return{name:t,sessionCount:n,copied:r,skipped:i}}return{name:t,sessionCount:n,copied:0,skipped:0}}));for(let e of a)n.push({name:e.name,sessionCount:e.sessionCount}),r+=e.copied,i+=e.skipped;return{hosts:n,totalCopied:r,totalSkipped:i}}:async()=>({hosts:[],totalCopied:0,totalSkipped:0}),K={".ts":`TypeScript`,".tsx":`TypeScript`,".js":`JavaScript`,".jsx":`JavaScript`,".py":`Python`,".rb":`Ruby`,".go":`Go`,".rs":`Rust`,".java":`Java`,".md":`Markdown`,".json":`JSON`,".yaml":`YAML`,".yml":`YAML`,".sh":`Shell`,".css":`CSS`,".html":`HTML`},q={debug_investigate:`Debug/Investigate`,implement_feature:`Implement Feature`,fix_bug:`Fix Bug`,write_script_tool:`Write Script/Tool`,refactor_code:`Refactor Code`,configure_system:`Configure System`,create_pr_commit:`Create PR/Commit`,analyze_data:`Analyze Data`,understand_codebase:`Understand Codebase`,write_tests:`Write Tests`,write_docs:`Write Docs`,deploy_infra:`Deploy/Infra`,warmup_minimal:`Cache Warmup`,fast_accurate_search:`Fast/Accurate Search`,correct_code_edits:`Correct Code Edits`,good_explanations:`Good Explanations`,proactive_help:`Proactive Help`,multi_file_changes:`Multi-file Changes`,handled_complexity:`Multi-file Changes`,good_debugging:`Good Debugging`,misunderstood_request:`Misunderstood Request`,wrong_approach:`Wrong Approach`,buggy_code:`Buggy Code`,user_rejected_action:`User Rejected Action`,claude_got_blocked:`Claude Got Blocked`,user_stopped_early:`User Stopped Early`,wrong_file_or_location:`Wrong File/Location`,excessive_changes:`Excessive Changes`,slow_or_verbose:`Slow/Verbose`,tool_failed:`Tool Failed`,user_unclear:`User Unclear`,external_issue:`External Issue`,frustrated:`Frustrated`,dissatisfied:`Dissatisfied`,likely_satisfied:`Likely Satisfied`,satisfied:`Satisfied`,happy:`Happy`,unsure:`Unsure`,neutral:`Neutral`,delighted:`Delighted`,single_task:`Single Task`,multi_task:`Multi Task`,iterative_refinement:`Iterative Refinement`,exploration:`Exploration`,quick_question:`Quick Question`,fully_achieved:`Fully Achieved`,mostly_achieved:`Mostly Achieved`,partially_achieved:`Partially Achieved`,not_achieved:`Not Achieved`,unclear_from_transcript:`Unclear`,unhelpful:`Unhelpful`,slightly_helpful:`Slightly Helpful`,moderately_helpful:`Moderately Helpful`,very_helpful:`Very Helpful`,essential:`Essential`},J=`Analyze this Claude Code session and extract structured facets.
643
643
 
644
644
  CRITICAL GUIDELINES:
645
645
 
@@ -1 +1 @@
1
- import{o as e}from"./chunk-DR8-3Aex.js";import{Mt as t,Rn as n,b as r,o as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Ka as c,lo as l,oo as u}from"./paths-Q2255dD7.js";import{L as d,V as f,d as p,s as m}from"./debug-UI3T040K.js";import{n as h,r as g}from"./analytics-DqMQntaB.js";import{a as _,n as v}from"./env-chR0gV31.js";import{Ib as y,Lb as b,Mb as x,Nb as S,Pb as C}from"./loadAgentsDir-Ci5mr0vm.js";import{join as w}from"node:path";import{homedir as T}from"node:os";var E=e(n(),1);h(),a(),m(),_(),f(),x(),u();var D=s();function O(){let e=v.platform===`win32`,t=T();return e?w(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function k({messages:e}){return e.length===0?null:(0,D.jsxs)(o,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,D.jsx)(o,{children:(0,D.jsxs)(r,{color:`warning`,children:[(0,D.jsx)(i,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,t)=>(0,D.jsx)(o,{marginLeft:2,children:(0,D.jsxs)(r,{dimColor:!0,children:[`• `,e]})},t))]})}function A({onDone:e,force:t,target:n}){let[a,s]=(0,E.useState)({type:`checking`});return(0,E.useEffect)(()=>{async function e(){try{p(`Install: Starting installation process (force=${t}, target=${n})`);let e=n||c()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),p(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${t})`);let r=await b(e,t);if(p(`Install: installLatest returned version=${r.latestVersion}, wasUpdated=${r.wasUpdated}, lockFailed=${r.lockFailed}`),r.lockFailed)throw Error(`Could not install - another process is currently installing Claude. Please try again in a moment.`);r.latestVersion||p(`Install: Failed to retrieve version information during install`,{level:`error`}),r.wasUpdated||p(`Install: Already up to date`),s({type:`setting-up`});let i=await S(!0);p(`Install: Setup launcher completed with ${i.length} messages`),i.length>0&&i.forEach(e=>p(`Install: Setup message: ${e.message}`)),p(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:u}=await C();a>0&&p(`Cleaned up ${a} npm installation(s)`),o.length>0&&p(`Cleanup errors: ${o.join(`, `)}`);let d=await y();d.length>0&&p(`Shell alias cleanup: ${d.map(e=>e.message).join(`; `)}`),g(`tengu_claude_install_command`,{has_version:+!!r.latestVersion,forced:+!!t}),(n===`latest`||n===`stable`)&&(l(`userSettings`,{autoUpdatesChannel:n}),p(`Install: Saved autoUpdatesChannel=${n} to user settings`));let f=[...u,...d.map(e=>e.message)];i.length>0?(s({type:`set-up`,messages:i.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:r.latestVersion||`current`,setupMessages:[...i.map(e=>e.message),...f]})):(p(`Install: Shell PATH already configured`),s({type:`success`,version:r.latestVersion||`current`,setupMessages:f.length>0?f:void 0}))}catch(e){p(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:d(e)})}}e()},[t,n]),(0,E.useEffect)(()=>{a.type===`success`?setTimeout(e,2e3,`Claude Code installation completed successfully`,{display:`system`}):a.type===`error`&&setTimeout(e,3e3,`Claude Code installation failed`,{display:`system`})},[a,e]),(0,D.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[a.type===`checking`&&(0,D.jsx)(r,{color:`claude`,children:`Checking installation status...`}),a.type===`cleaning-npm`&&(0,D.jsx)(r,{color:`warning`,children:`Cleaning up old npm installations...`}),a.type===`installing`&&(0,D.jsxs)(r,{color:`claude`,children:[`Installing Claude Code native build `,a.version,`...`]}),a.type===`setting-up`&&(0,D.jsx)(r,{color:`claude`,children:`Setting up launcher and shell integration...`}),a.type===`set-up`&&(0,D.jsx)(k,{messages:a.messages}),a.type===`success`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`success`,withSpace:!0}),(0,D.jsx)(r,{color:`success`,bold:!0,children:`Claude Code successfully installed!`})]}),(0,D.jsxs)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:[a.version!==`current`&&(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Version: `}),(0,D.jsx)(r,{color:`claude`,children:a.version})]}),(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Location: `}),(0,D.jsx)(r,{color:`text`,children:O()})]})]}),(0,D.jsx)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,D.jsxs)(o,{marginTop:1,children:[(0,D.jsx)(r,{dimColor:!0,children:`Next: Run `}),(0,D.jsx)(r,{color:`claude`,bold:!0,children:`claude --help`}),(0,D.jsx)(r,{dimColor:!0,children:` to get started`})]})}),a.setupMessages&&(0,D.jsx)(k,{messages:a.setupMessages})]}),a.type===`error`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`error`,withSpace:!0}),(0,D.jsx)(r,{color:`error`,children:`Installation failed`})]}),(0,D.jsx)(r,{color:`error`,children:a.message}),(0,D.jsx)(o,{marginTop:1,children:(0,D.jsx)(r,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var j={type:`local-jsx`,name:`install`,description:`Install Claude Code native build`,argumentHint:`[options]`,async call(e,n,r){let i=r.includes(`--force`),a=r.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await t((0,D.jsx)(A,{onDone:(t,n)=>{o(),e(t,n)},force:i,target:a}))}};export{j as install};
1
+ import{o as e}from"./chunk-DR8-3Aex.js";import{Mt as t,Rn as n,b as r,o as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Ka as c,lo as l,oo as u}from"./paths-1ngPRtu3.js";import{L as d,V as f,d as p,s as m}from"./debug-UI3T040K.js";import{n as h,r as g}from"./analytics-DqMQntaB.js";import{a as _,n as v}from"./env-chR0gV31.js";import{Fb as y,Ib as b,Pb as x,Rb as S,zb as C}from"./loadAgentsDir-D7kapZB5.js";import{join as w}from"node:path";import{homedir as T}from"node:os";var E=e(n(),1);h(),a(),m(),_(),f(),x(),u();var D=s();function O(){let e=v.platform===`win32`,t=T();return e?w(t,`.local`,`bin`,`claude.exe`).replace(/\//g,`\\`):`~/.local/bin/claude`}function k({messages:e}){return e.length===0?null:(0,D.jsxs)(o,{flexDirection:`column`,gap:0,marginBottom:1,children:[(0,D.jsx)(o,{children:(0,D.jsxs)(r,{color:`warning`,children:[(0,D.jsx)(i,{status:`warning`,withSpace:!0}),`Setup notes:`]})}),e.map((e,t)=>(0,D.jsx)(o,{marginLeft:2,children:(0,D.jsxs)(r,{dimColor:!0,children:[`• `,e]})},t))]})}function A({onDone:e,force:t,target:n}){let[a,s]=(0,E.useState)({type:`checking`});return(0,E.useEffect)(()=>{async function e(){try{p(`Install: Starting installation process (force=${t}, target=${n})`);let e=n||c()?.autoUpdatesChannel||`latest`;s({type:`installing`,version:e}),p(`Install: Calling installLatest(channelOrVersion=${e}, forceReinstall=${t})`);let r=await C(e,t);if(p(`Install: installLatest returned version=${r.latestVersion}, wasUpdated=${r.wasUpdated}, lockFailed=${r.lockFailed}`),r.lockFailed)throw Error(`Could not install - another process is currently installing Claude. Please try again in a moment.`);r.latestVersion||p(`Install: Failed to retrieve version information during install`,{level:`error`}),r.wasUpdated||p(`Install: Already up to date`),s({type:`setting-up`});let i=await y(!0);p(`Install: Setup launcher completed with ${i.length} messages`),i.length>0&&i.forEach(e=>p(`Install: Setup message: ${e.message}`)),p(`Install: Cleaning up npm installations after successful install`);let{removed:a,errors:o,warnings:u}=await b();a>0&&p(`Cleaned up ${a} npm installation(s)`),o.length>0&&p(`Cleanup errors: ${o.join(`, `)}`);let d=await S();d.length>0&&p(`Shell alias cleanup: ${d.map(e=>e.message).join(`; `)}`),g(`tengu_claude_install_command`,{has_version:+!!r.latestVersion,forced:+!!t}),(n===`latest`||n===`stable`)&&(l(`userSettings`,{autoUpdatesChannel:n}),p(`Install: Saved autoUpdatesChannel=${n} to user settings`));let f=[...u,...d.map(e=>e.message)];i.length>0?(s({type:`set-up`,messages:i.map(e=>e.message)}),setTimeout(s,2e3,{type:`success`,version:r.latestVersion||`current`,setupMessages:[...i.map(e=>e.message),...f]})):(p(`Install: Shell PATH already configured`),s({type:`success`,version:r.latestVersion||`current`,setupMessages:f.length>0?f:void 0}))}catch(e){p(`Install command failed: ${e}`,{level:`error`}),s({type:`error`,message:d(e)})}}e()},[t,n]),(0,E.useEffect)(()=>{a.type===`success`?setTimeout(e,2e3,`Claude Code installation completed successfully`,{display:`system`}):a.type===`error`&&setTimeout(e,3e3,`Claude Code installation failed`,{display:`system`})},[a,e]),(0,D.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[a.type===`checking`&&(0,D.jsx)(r,{color:`claude`,children:`Checking installation status...`}),a.type===`cleaning-npm`&&(0,D.jsx)(r,{color:`warning`,children:`Cleaning up old npm installations...`}),a.type===`installing`&&(0,D.jsxs)(r,{color:`claude`,children:[`Installing Claude Code native build `,a.version,`...`]}),a.type===`setting-up`&&(0,D.jsx)(r,{color:`claude`,children:`Setting up launcher and shell integration...`}),a.type===`set-up`&&(0,D.jsx)(k,{messages:a.messages}),a.type===`success`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`success`,withSpace:!0}),(0,D.jsx)(r,{color:`success`,bold:!0,children:`Claude Code successfully installed!`})]}),(0,D.jsxs)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:[a.version!==`current`&&(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Version: `}),(0,D.jsx)(r,{color:`claude`,children:a.version})]}),(0,D.jsxs)(o,{children:[(0,D.jsx)(r,{dimColor:!0,children:`Location: `}),(0,D.jsx)(r,{color:`text`,children:O()})]})]}),(0,D.jsx)(o,{marginLeft:2,flexDirection:`column`,gap:1,children:(0,D.jsxs)(o,{marginTop:1,children:[(0,D.jsx)(r,{dimColor:!0,children:`Next: Run `}),(0,D.jsx)(r,{color:`claude`,bold:!0,children:`claude --help`}),(0,D.jsx)(r,{dimColor:!0,children:` to get started`})]})}),a.setupMessages&&(0,D.jsx)(k,{messages:a.setupMessages})]}),a.type===`error`&&(0,D.jsxs)(o,{flexDirection:`column`,gap:1,children:[(0,D.jsxs)(o,{children:[(0,D.jsx)(i,{status:`error`,withSpace:!0}),(0,D.jsx)(r,{color:`error`,children:`Installation failed`})]}),(0,D.jsx)(r,{color:`error`,children:a.message}),(0,D.jsx)(o,{marginTop:1,children:(0,D.jsx)(r,{dimColor:!0,children:`Try running with --force to override checks`})})]})]})}var j={type:`local-jsx`,name:`install`,description:`Install Claude Code native build`,argumentHint:`[options]`,async call(e,n,r){let i=r.includes(`--force`),a=r.filter(e=>!e.startsWith(`--`))[0],{unmount:o}=await t((0,D.jsx)(A,{onDone:(t,n)=>{o(),e(t,n)},force:i,target:a}))}};export{j as install};
@@ -1,4 +1,4 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,Q as a,Rn as o,T as s,b as c,f as l,g as u,h as d,nt as f,t as p,tn as m,tt as h,v as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ac as y,Mn as b,Pc as x,Po as ee,Vt as te,cn as S,jo as C,on as w}from"./paths-Q2255dD7.js";import{n as T,r as E}from"./analytics-DqMQntaB.js";import{l as ne,v as re}from"./git-CN3qtTb_.js";import{r as ie,t as ae}from"./execa-CGue6Z3n.js";import{o as oe,s as D}from"./log-CzsijfHZ.js";import{r as se,t as O}from"./execFileNoThrow-CuQN1sz8.js";import{CT as ce,Dx as le,JS as ue,Lw as k,Nx as A,Px as j,ST as de,YS as fe,cy as pe,gy as me,ly as he,my as M,uy as ge}from"./loadAgentsDir-Ci5mr0vm.js";import{n as _e,t as ve}from"./browser-fLRXxIsQ.js";import{t as N}from"./useKeybinding-FsOnjW6T.js";import{l as ye,u as be}from"./referral-ByevBJrE.js";function xe(e){return e.pending?(0,F.jsxs)(c,{children:[`Press `,e.keyName,` again to exit`]}):(0,F.jsxs)(d,{children:[(0,F.jsx)(u,{shortcut:`↑↓`,action:`navigate`}),(0,F.jsx)(u,{shortcut:`Space`,action:`toggle`}),(0,F.jsx)(u,{shortcut:`Enter`,action:`confirm`}),(0,F.jsx)(ue,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}function Se({onSubmit:e,defaultSelections:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useCallback)(t=>{if(t.length===0){r(!0);return}r(!1),e(t)},[e]),o=(0,P.useCallback)(()=>{r(!1)},[]),s=(0,P.useCallback)(()=>{r(!0)},[]);return(0,F.jsxs)(l,{title:`Select GitHub workflows to install`,subtitle:`We'll create a workflow file in your repository for each one you select.`,onCancel:s,inputGuide:xe,children:[(0,F.jsx)(_,{children:(0,F.jsxs)(c,{dimColor:!0,children:[`More workflow examples (issue triage, CI fixes, etc.) at:`,` `,(0,F.jsx)(a,{url:`https://github.com/anthropics/claude-code-action/blob/main/examples/`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/`})]})}),(0,F.jsx)(he,{options:Ce.map(e=>({label:e.label,value:e.value})),defaultValue:t,onSubmit:i,onChange:o,onCancel:s,hideIndexes:!0}),n&&(0,F.jsx)(_,{children:(0,F.jsx)(c,{color:`error`,children:`You must select at least one workflow to continue`})})]})}var P,F,Ce,we=e((()=>{P=t(o(),1),p(),fe(),ge(),F=v(),Ce=[{value:`claude`,label:`@Claude Code - Tag @claude in issues and PR comments`},{value:`claude-review`,label:`Claude Code Review - Automated code review on new PRs`}]})),Te,I,Ee,De,Oe,L=e((()=>{Te=`Add Claude Code GitHub Workflow`,I=`https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md`,Ee=`name: Claude Code
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{n,t as r}from"./figures-gfT9mM8P.js";import{F as i,Q as a,Rn as o,T as s,b as c,f as l,g as u,h as d,nt as f,t as p,tn as m,tt as h,v as g,x as _}from"./src-Di342QoJ.js";import{t as v}from"./jsx-runtime-D-D469L8.js";import{Ac as y,Mn as b,Pc as x,Po as ee,Vt as te,cn as S,jo as C,on as w}from"./paths-1ngPRtu3.js";import{n as T,r as E}from"./analytics-DqMQntaB.js";import{l as ne,v as re}from"./git-CN3qtTb_.js";import{r as ie,t as ae}from"./execa-CGue6Z3n.js";import{o as oe,s as D}from"./log-CzsijfHZ.js";import{r as se,t as O}from"./execFileNoThrow-CuQN1sz8.js";import{Fx as k,Ix as A,TT as ce,XS as le,ZS as ue,dy as de,fy as fe,gy as j,kx as pe,uy as me,vy as he,wT as ge,zw as M}from"./loadAgentsDir-D7kapZB5.js";import{n as _e,t as ve}from"./browser-fLRXxIsQ.js";import{t as N}from"./useKeybinding-FsOnjW6T.js";import{l as ye,u as be}from"./referral-BKeCKnOJ.js";function xe(e){return e.pending?(0,F.jsxs)(c,{children:[`Press `,e.keyName,` again to exit`]}):(0,F.jsxs)(d,{children:[(0,F.jsx)(u,{shortcut:`↑↓`,action:`navigate`}),(0,F.jsx)(u,{shortcut:`Space`,action:`toggle`}),(0,F.jsx)(u,{shortcut:`Enter`,action:`confirm`}),(0,F.jsx)(le,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})}function Se({onSubmit:e,defaultSelections:t}){let[n,r]=(0,P.useState)(!1),i=(0,P.useCallback)(t=>{if(t.length===0){r(!0);return}r(!1),e(t)},[e]),o=(0,P.useCallback)(()=>{r(!1)},[]),s=(0,P.useCallback)(()=>{r(!0)},[]);return(0,F.jsxs)(l,{title:`Select GitHub workflows to install`,subtitle:`We'll create a workflow file in your repository for each one you select.`,onCancel:s,inputGuide:xe,children:[(0,F.jsx)(_,{children:(0,F.jsxs)(c,{dimColor:!0,children:[`More workflow examples (issue triage, CI fixes, etc.) at:`,` `,(0,F.jsx)(a,{url:`https://github.com/anthropics/claude-code-action/blob/main/examples/`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/`})]})}),(0,F.jsx)(de,{options:Ce.map(e=>({label:e.label,value:e.value})),defaultValue:t,onSubmit:i,onChange:o,onCancel:s,hideIndexes:!0}),n&&(0,F.jsx)(_,{children:(0,F.jsx)(c,{color:`error`,children:`You must select at least one workflow to continue`})})]})}var P,F,Ce,we=e((()=>{P=t(o(),1),p(),ue(),fe(),F=v(),Ce=[{value:`claude`,label:`@Claude Code - Tag @claude in issues and PR comments`},{value:`claude-review`,label:`Claude Code Review - Automated code review on new PRs`}]})),Te,I,Ee,De,Oe,L=e((()=>{Te=`Add Claude Code GitHub Workflow`,I=`https://github.com/anthropics/claude-code-action/blob/main/docs/setup.md`,Ee=`name: Claude Code
2
2
 
3
3
  on:
4
4
  issue_comment:
@@ -132,7 +132,7 @@ jobs:
132
132
  # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md
133
133
  # or https://code.claude.com/docs/en/cli-reference for available options
134
134
 
135
- `}));function ke({existingApiKey:e,apiKeyOrOAuthToken:t,onApiKeyChange:n,onSubmit:r,onToggleUseExistingKey:a,onCreateOAuthToken:o,selectedOption:l=e?`existing`:o?`oauth`:`new`,onSelectOption:u}){let[d,p]=(0,R.useState)(0),m=i(),[h]=s(),v=(0,R.useCallback)(()=>{l===`new`&&o?u?.(`oauth`):l===`oauth`&&e&&(u?.(`existing`),a(!0))},[l,o,e,u,a]),y=(0,R.useCallback)(()=>{l===`existing`?(u?.(o?`oauth`:`new`),a(!1)):l===`oauth`&&u?.(`new`)},[l,o,u,a]),b=(0,R.useCallback)(()=>{l===`oauth`&&o?o():r()},[l,o,r]),x=l===`new`;return f({"confirm:previous":v,"confirm:next":y,"confirm:yes":b},{context:`Confirmation`,isActive:!x}),f({"confirm:previous":v,"confirm:next":y},{context:`Confirmation`,isActive:x}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,z.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,z.jsx)(c,{dimColor:!0,children:`Choose API key`})]}),e&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`existing`?g(`success`,h)(`> `):` `,`Use your existing Claude Code API key`]})}),o&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`oauth`?g(`success`,h)(`> `):` `,`Create a long-lived token with your Claude subscription`]})}),(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`new`?g(`success`,h)(`> `):` `,`Enter a new API key`]})}),l===`new`&&(0,z.jsx)(A,{value:t,onChange:n,onSubmit:r,onPaste:n,focus:!0,placeholder:`sk-ant… (Create a new key at https://platform.claude.com/settings/keys)`,mask:`*`,columns:m.columns,cursorOffset:d,onChangeCursorOffset:p,showCursor:!0})]}),(0,z.jsx)(_,{marginLeft:3,children:(0,z.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var R,z,Ae=e((()=>{R=t(o(),1),j(),k(),p(),N(),z=v()}));function je({useExistingSecret:e,secretName:t,onToggleUseExistingSecret:n,onSecretNameChange:r,onSubmit:a}){let[o,l]=(0,B.useState)(0),u=i(),[d]=s(),p=(0,B.useCallback)(()=>n(!0),[n]),m=(0,B.useCallback)(()=>n(!1),[n]);return f({"confirm:previous":p,"confirm:next":m,"confirm:yes":a},{context:`Confirmation`,isActive:e}),f({"confirm:previous":p,"confirm:next":m},{context:`Confirmation`,isActive:!e}),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,V.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,V.jsx)(c,{dimColor:!0,children:`Setup API key secret`})]}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{color:`warning`,children:`ANTHROPIC_API_KEY already exists in repository secrets!`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Would you like to:`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?g(`success`,d)(`> `):` `,`Use the existing API key`]})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?` `:g(`success`,d)(`> `),`Create a new secret with a different name`]})}),!e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Enter new secret name (alphanumeric with underscores):`})}),(0,V.jsx)(A,{value:t,onChange:r,onSubmit:a,focus:!0,placeholder:`e.g., CLAUDE_API_KEY`,columns:u.columns,cursorOffset:o,onChangeCursorOffset:l,showCursor:!0})]})]}),(0,V.jsx)(_,{marginLeft:3,children:(0,V.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var B,V,Me=e((()=>{B=t(o(),1),j(),k(),p(),N(),V=v()}));function Ne(){return(0,Pe.jsx)(c,{children:`Checking GitHub CLI installation…`})}var Pe,Fe=e((()=>{p(),Pe=v()}));function Ie({currentRepo:e,useCurrentRepo:t,repoUrl:n,onRepoUrlChange:r,onSubmit:a,onToggleUseCurrentRepo:o}){let[s,l]=(0,H.useState)(0),[u,d]=(0,H.useState)(!1),p=i().columns,m=(0,H.useCallback)(()=>{if(!(t?e:n)?.trim()){d(!0);return}a()},[t,e,n,a]),h=!t||!e,g=(0,H.useCallback)(()=>{o(!0),d(!1)},[o]),v=(0,H.useCallback)(()=>{o(!1),d(!1)},[o]);return f({"confirm:previous":g,"confirm:next":v,"confirm:yes":m},{context:`Confirmation`,isActive:!h}),f({"confirm:previous":g,"confirm:next":v},{context:`Confirmation`,isActive:h}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,U.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,U.jsx)(c,{dimColor:!0,children:`Select GitHub repository`})]}),e&&(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:t,color:t?`permission`:void 0,children:[t?`> `:` `,`Use current repository: `,e]})}),(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:!t||!e,color:!t||!e?`permission`:void 0,children:[!t||!e?`> `:` `,e?`Enter a different repository`:`Enter repository`]})}),(!t||!e)&&(0,U.jsx)(_,{marginLeft:2,marginBottom:1,children:(0,U.jsx)(A,{value:n,onChange:e=>{r(e),d(!1)},onSubmit:m,focus:!0,placeholder:`Enter a repo as owner/repo or https://github.com/owner/repo…`,columns:p,cursorOffset:s,onChangeCursorOffset:l,showCursor:!0})})]}),u&&(0,U.jsx)(_,{marginLeft:3,marginBottom:1,children:(0,U.jsx)(c,{color:`error`,children:`Please enter a repository name to continue`})}),(0,U.jsx)(_,{marginLeft:3,children:(0,U.jsxs)(c,{dimColor:!0,children:[e?`↑/↓ to select · `:``,`Enter to continue`]})})]})}var H,U,Le=e((()=>{H=t(o(),1),j(),k(),p(),N(),U=v()}));function Re({currentWorkflowInstallStep:e,secretExists:t,useExistingSecret:n,secretName:r,skipWorkflow:i=!1,selectedWorkflows:a}){let o=i?[`Getting repository information`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`]:[`Getting repository information`,`Creating branch`,a.length>1?`Creating workflow files`:`Creating workflow file`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`,`Opening pull request page`];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,W.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,W.jsx)(c,{dimColor:!0,children:`Create GitHub Actions workflow`})]}),o.map((t,n)=>{let r=`pending`;return n<e?r=`completed`:n===e&&(r=`in-progress`),(0,W.jsx)(_,{children:(0,W.jsxs)(c,{color:r===`completed`?`success`:r===`in-progress`?`warning`:void 0,children:[r===`completed`?`✓ `:``,t,r===`in-progress`?`…`:``]})},n)})]})})}var W,ze=e((()=>{p(),W=v()}));function Be({error:e,errorReason:t,errorInstructions:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,G.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,G.jsx)(c,{bold:!0,children:`Install GitHub App`})}),(0,G.jsxs)(c,{color:`error`,children:[`Error: `,e]}),t&&(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`Reason: `,t]})}),n&&n.length>0&&(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(c,{dimColor:!0,children:`How to fix:`}),n.map((e,t)=>(0,G.jsxs)(_,{marginLeft:2,children:[(0,G.jsx)(c,{dimColor:!0,children:`• `}),(0,G.jsx)(c,{children:e})]},t))]}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`For manual setup instructions, see: `,(0,G.jsx)(c,{color:`claude`,children:I})]})})]}),(0,G.jsx)(_,{marginLeft:3,children:(0,G.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var G,Ve=e((()=>{L(),p(),G=v()}));function He({repoName:e,onSelectAction:t}){return(0,K.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsx)(c,{bold:!0,children:`Existing Workflow Found`}),(0,K.jsxs)(c,{dimColor:!0,children:[`Repository: `,e]})]}),(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsxs)(c,{children:[`A Claude workflow file already exists at `,(0,K.jsx)(c,{color:`claude`,children:`.github/workflows/claude.yml`})]}),(0,K.jsx)(c,{dimColor:!0,children:`What would you like to do?`})]}),(0,K.jsx)(_,{flexDirection:`column`,children:(0,K.jsx)(le,{options:[{label:`Update workflow file with latest version`,value:`update`},{label:`Skip workflow update (configure secrets only)`,value:`skip`},{label:`Exit without making changes`,value:`exit`}],onChange:e=>{t(e)},onCancel:()=>{t(`exit`)}})}),(0,K.jsx)(_,{marginTop:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[`View the latest workflow template at:`,` `,(0,K.jsx)(c,{color:`claude`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml`})]})})]})}var K,Ue=e((()=>{pe(),p(),K=v()}));function We({repoUrl:e,onSubmit:t}){return h(`confirm:yes`,t,{context:`Confirmation`}),(0,q.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,q.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,q.jsx)(c,{bold:!0,children:`Install the Claude GitHub App`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`Opening browser to install the Claude GitHub App…`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`If your browser doesn't open automatically, visit:`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{underline:!0,children:`https://github.com/apps/claude`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsxs)(c,{children:[`Please install the app for repository: `,(0,q.jsx)(c,{bold:!0,children:e})]})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{dimColor:!0,children:`Important: Make sure to grant access to this specific repository`})}),(0,q.jsx)(_,{children:(0,q.jsxs)(c,{bold:!0,color:`permission`,children:[`Press Enter once you've installed the app`,r.ellipsis]})}),(0,q.jsx)(_,{marginTop:1,children:(0,q.jsxs)(c,{dimColor:!0,children:[`Having trouble? See manual setup instructions at: `,(0,q.jsx)(c,{color:`claude`,children:I})]})})]})}var q,Ge=e((()=>{n(),L(),p(),N(),q=v()}));function Ke({onSuccess:e,onCancel:t}){let[n,r]=(0,J.useState)({state:`starting`}),[o]=(0,J.useState)(()=>new de),[s,l]=(0,J.useState)(``),[d,f]=(0,J.useState)(0),[p,h]=(0,J.useState)(!1),[g,v]=(0,J.useState)(!1),y=(0,J.useRef)(new Set),x=(0,J.useRef)(void 0),ee=i(),te=Math.max(50,ee.columns-30-4);function S(e){n.state===`error`&&(e.preventDefault(),e.key===`return`&&n.toRetry?(l(``),f(0),r({state:`about_to_retry`,nextState:n.toRetry})):t())}async function C(e,t){try{let[n,i]=e.split(`#`);if(!n||!i){r({state:`error`,message:`Invalid code. Please make sure the full code was copied`,toRetry:{state:`waiting_for_login`,url:t}});return}E(`tengu_oauth_manual_entry`,{}),o.handleManualAuthCodeInput({authorizationCode:n,state:i})}catch(e){D(e),r({state:`error`,message:e.message,toRetry:{state:`waiting_for_login`,url:t}})}}let w=(0,J.useCallback)(async()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear();try{let t=await o.startOAuthFlow(async e=>{r({state:`waiting_for_login`,url:e});let t=setTimeout(h,3e3,!0);y.current.add(t)},{loginWithClaudeAi:!0,inferenceOnly:!0,expiresIn:365*24*60*60});r({state:`processing`}),b(t);let n=setTimeout((e,t,n,r)=>{e({state:`success`,token:t});let i=setTimeout(n,1e3,t);r.current.add(i)},100,r,t.accessToken,e,y);y.current.add(n)}catch(e){let t=e.message;r({state:`error`,message:t,toRetry:{state:`starting`}}),D(e),E(`tengu_oauth_error`,{error:t})}},[o,e]);(0,J.useEffect)(()=>{n.state===`starting`&&w()},[n.state,w]),(0,J.useEffect)(()=>{if(n.state===`about_to_retry`){let e=setTimeout((e,t,n)=>{t(e.state===`waiting_for_login`),n(e)},500,n.nextState,h,r);y.current.add(e)}},[n]),(0,J.useEffect)(()=>{s===`c`&&n.state===`waiting_for_login`&&p&&!g&&(m(n.url).then(e=>{e&&process.stdout.write(e),v(!0),clearTimeout(x.current),x.current=setTimeout(v,2e3,!1)}),l(``))},[s,n,p,g]),(0,J.useEffect)(()=>{let e=y.current;return()=>{o.cleanup(),e.forEach(e=>clearTimeout(e)),e.clear(),clearTimeout(x.current)}},[o]);function T(){switch(n.state){case`starting`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:`Starting authentication…`})]});case`waiting_for_login`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[!p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:`Opening browser to sign in with your Claude account…`})]}),p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(c,{children:qe}),(0,Y.jsx)(A,{value:s,onChange:l,onSubmit:e=>C(e,n.url),cursorOffset:d,onChangeCursorOffset:f,columns:te})]})]});case`processing`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(M,{}),(0,Y.jsx)(c,{children:`Processing authentication…`})]});case`success`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsx)(c,{color:`success`,children:`✓ Authentication token created successfully!`}),(0,Y.jsx)(c,{dimColor:!0,children:`Using token for GitHub Actions setup…`})]});case`error`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsxs)(c,{color:`error`,children:[`OAuth error: `,n.message]}),n.toRetry?(0,Y.jsx)(c,{dimColor:!0,children:`Press Enter to try again, or any other key to cancel`}):(0,Y.jsx)(c,{dimColor:!0,children:`Press any key to return to API key selection`})]});case`about_to_retry`:return(0,Y.jsx)(_,{flexDirection:`column`,gap:1,children:(0,Y.jsx)(c,{color:`permission`,children:`Retrying…`})});default:return null}}return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[n.state===`starting`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]}),n.state!==`success`&&n.state!==`starting`&&n.state!==`processing`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]},`header`),n.state===`waiting_for_login`&&p&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsxs)(_,{paddingX:1,children:[(0,Y.jsx)(c,{dimColor:!0,children:`Browser didn't open? Use the url below to sign in `}),g?(0,Y.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,Y.jsx)(c,{dimColor:!0,children:(0,Y.jsx)(u,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,Y.jsx)(a,{url:n.url,children:(0,Y.jsx)(c,{dimColor:!0,children:n.url})})]},`urlToCopy`),(0,Y.jsx)(_,{paddingLeft:1,flexDirection:`column`,gap:1,children:T()})]})}var J,Y,qe,Je=e((()=>{J=t(o(),1),T(),p(),me(),j(),k(),ce(),w(),oe(),Y=v(),qe=`Paste code here if prompted > `}));function Ye({secretExists:e,useExistingSecret:t,secretName:n,skipWorkflow:r=!1}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,X.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,X.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,X.jsx)(c,{dimColor:!0,children:`Success`})]}),!r&&(0,X.jsx)(c,{color:`success`,children:`✓ GitHub Actions workflow created!`}),e&&t&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{color:`success`,children:`✓ Using existing ANTHROPIC_API_KEY secret`})}),(!e||!t)&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsxs)(c,{color:`success`,children:[`✓ API key saved as `,n,` secret`]})}),(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{children:`Next steps:`})}),r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`2. Your workflow file was kept unchanged`}),(0,X.jsx)(c,{children:`3. API key is configured and ready to use`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. A pre-filled PR page has been created`}),(0,X.jsx)(c,{children:`2. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`3. Merge the PR to enable Claude PR assistance`})]})]}),(0,X.jsx)(_,{marginLeft:3,children:(0,X.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var X,Xe=e((()=>{o(),p(),X=v()}));async function Ze(e,t,n,r,i,a,o){let s=await O(`gh`,[`api`,`repos/${e}/contents/${n}`,`--jq`,`.sha`]),c=null;s.code===0&&(c=s.stdout.trim());let l=r;i===`CLAUDE_CODE_OAUTH_TOKEN`?l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,"claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}"):i!==`ANTHROPIC_API_KEY`&&(l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,`anthropic_api_key: \${{ secrets.${i} }}`));let u=Buffer.from(l).toString(`base64`),d=[`api`,`--method`,`PUT`,`repos/${e}/contents/${n}`,`-f`,`message=${c?`"Update ${a}"`:`"${a}"`}`,`-f`,`content=${u}`,`-f`,`branch=${t}`];c&&d.push(`-f`,`sha=${c}`);let f=await O(`gh`,d);if(f.code!==0)throw f.stderr.includes(`422`)&&f.stderr.includes(`sha`)?(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`)):(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: ${f.stderr}
135
+ `}));function ke({existingApiKey:e,apiKeyOrOAuthToken:t,onApiKeyChange:n,onSubmit:r,onToggleUseExistingKey:a,onCreateOAuthToken:o,selectedOption:l=e?`existing`:o?`oauth`:`new`,onSelectOption:u}){let[d,p]=(0,R.useState)(0),m=i(),[h]=s(),v=(0,R.useCallback)(()=>{l===`new`&&o?u?.(`oauth`):l===`oauth`&&e&&(u?.(`existing`),a(!0))},[l,o,e,u,a]),y=(0,R.useCallback)(()=>{l===`existing`?(u?.(o?`oauth`:`new`),a(!1)):l===`oauth`&&u?.(`new`)},[l,o,u,a]),b=(0,R.useCallback)(()=>{l===`oauth`&&o?o():r()},[l,o,r]),x=l===`new`;return f({"confirm:previous":v,"confirm:next":y,"confirm:yes":b},{context:`Confirmation`,isActive:!x}),f({"confirm:previous":v,"confirm:next":y},{context:`Confirmation`,isActive:x}),(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,z.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,z.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,z.jsx)(c,{dimColor:!0,children:`Choose API key`})]}),e&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`existing`?g(`success`,h)(`> `):` `,`Use your existing Claude Code API key`]})}),o&&(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`oauth`?g(`success`,h)(`> `):` `,`Create a long-lived token with your Claude subscription`]})}),(0,z.jsx)(_,{marginBottom:1,children:(0,z.jsxs)(c,{children:[l===`new`?g(`success`,h)(`> `):` `,`Enter a new API key`]})}),l===`new`&&(0,z.jsx)(k,{value:t,onChange:n,onSubmit:r,onPaste:n,focus:!0,placeholder:`sk-ant… (Create a new key at https://platform.claude.com/settings/keys)`,mask:`*`,columns:m.columns,cursorOffset:d,onChangeCursorOffset:p,showCursor:!0})]}),(0,z.jsx)(_,{marginLeft:3,children:(0,z.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var R,z,Ae=e((()=>{R=t(o(),1),A(),M(),p(),N(),z=v()}));function je({useExistingSecret:e,secretName:t,onToggleUseExistingSecret:n,onSecretNameChange:r,onSubmit:a}){let[o,l]=(0,B.useState)(0),u=i(),[d]=s(),p=(0,B.useCallback)(()=>n(!0),[n]),m=(0,B.useCallback)(()=>n(!1),[n]);return f({"confirm:previous":p,"confirm:next":m,"confirm:yes":a},{context:`Confirmation`,isActive:e}),f({"confirm:previous":p,"confirm:next":m},{context:`Confirmation`,isActive:!e}),(0,V.jsxs)(V.Fragment,{children:[(0,V.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,V.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,V.jsx)(c,{dimColor:!0,children:`Setup API key secret`})]}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{color:`warning`,children:`ANTHROPIC_API_KEY already exists in repository secrets!`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Would you like to:`})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?g(`success`,d)(`> `):` `,`Use the existing API key`]})}),(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsxs)(c,{children:[e?` `:g(`success`,d)(`> `),`Create a new secret with a different name`]})}),!e&&(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(_,{marginBottom:1,children:(0,V.jsx)(c,{children:`Enter new secret name (alphanumeric with underscores):`})}),(0,V.jsx)(k,{value:t,onChange:r,onSubmit:a,focus:!0,placeholder:`e.g., CLAUDE_API_KEY`,columns:u.columns,cursorOffset:o,onChangeCursorOffset:l,showCursor:!0})]})]}),(0,V.jsx)(_,{marginLeft:3,children:(0,V.jsx)(c,{dimColor:!0,children:`↑/↓ to select · Enter to continue`})})]})}var B,V,Me=e((()=>{B=t(o(),1),A(),M(),p(),N(),V=v()}));function Ne(){return(0,Pe.jsx)(c,{children:`Checking GitHub CLI installation…`})}var Pe,Fe=e((()=>{p(),Pe=v()}));function Ie({currentRepo:e,useCurrentRepo:t,repoUrl:n,onRepoUrlChange:r,onSubmit:a,onToggleUseCurrentRepo:o}){let[s,l]=(0,H.useState)(0),[u,d]=(0,H.useState)(!1),p=i().columns,m=(0,H.useCallback)(()=>{if(!(t?e:n)?.trim()){d(!0);return}a()},[t,e,n,a]),h=!t||!e,g=(0,H.useCallback)(()=>{o(!0),d(!1)},[o]),v=(0,H.useCallback)(()=>{o(!1),d(!1)},[o]);return f({"confirm:previous":g,"confirm:next":v,"confirm:yes":m},{context:`Confirmation`,isActive:!h}),f({"confirm:previous":g,"confirm:next":v},{context:`Confirmation`,isActive:h}),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,U.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,U.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,U.jsx)(c,{dimColor:!0,children:`Select GitHub repository`})]}),e&&(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:t,color:t?`permission`:void 0,children:[t?`> `:` `,`Use current repository: `,e]})}),(0,U.jsx)(_,{marginBottom:1,children:(0,U.jsxs)(c,{bold:!t||!e,color:!t||!e?`permission`:void 0,children:[!t||!e?`> `:` `,e?`Enter a different repository`:`Enter repository`]})}),(!t||!e)&&(0,U.jsx)(_,{marginLeft:2,marginBottom:1,children:(0,U.jsx)(k,{value:n,onChange:e=>{r(e),d(!1)},onSubmit:m,focus:!0,placeholder:`Enter a repo as owner/repo or https://github.com/owner/repo…`,columns:p,cursorOffset:s,onChangeCursorOffset:l,showCursor:!0})})]}),u&&(0,U.jsx)(_,{marginLeft:3,marginBottom:1,children:(0,U.jsx)(c,{color:`error`,children:`Please enter a repository name to continue`})}),(0,U.jsx)(_,{marginLeft:3,children:(0,U.jsxs)(c,{dimColor:!0,children:[e?`↑/↓ to select · `:``,`Enter to continue`]})})]})}var H,U,Le=e((()=>{H=t(o(),1),A(),M(),p(),N(),U=v()}));function Re({currentWorkflowInstallStep:e,secretExists:t,useExistingSecret:n,secretName:r,skipWorkflow:i=!1,selectedWorkflows:a}){let o=i?[`Getting repository information`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`]:[`Getting repository information`,`Creating branch`,a.length>1?`Creating workflow files`:`Creating workflow file`,t&&n?`Using existing API key secret`:`Setting up ${r} secret`,`Opening pull request page`];return(0,W.jsx)(W.Fragment,{children:(0,W.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,W.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,W.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,W.jsx)(c,{dimColor:!0,children:`Create GitHub Actions workflow`})]}),o.map((t,n)=>{let r=`pending`;return n<e?r=`completed`:n===e&&(r=`in-progress`),(0,W.jsx)(_,{children:(0,W.jsxs)(c,{color:r===`completed`?`success`:r===`in-progress`?`warning`:void 0,children:[r===`completed`?`✓ `:``,t,r===`in-progress`?`…`:``]})},n)})]})})}var W,ze=e((()=>{p(),W=v()}));function Be({error:e,errorReason:t,errorInstructions:n}){return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,G.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,G.jsx)(c,{bold:!0,children:`Install GitHub App`})}),(0,G.jsxs)(c,{color:`error`,children:[`Error: `,e]}),t&&(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`Reason: `,t]})}),n&&n.length>0&&(0,G.jsxs)(_,{flexDirection:`column`,marginTop:1,children:[(0,G.jsx)(c,{dimColor:!0,children:`How to fix:`}),n.map((e,t)=>(0,G.jsxs)(_,{marginLeft:2,children:[(0,G.jsx)(c,{dimColor:!0,children:`• `}),(0,G.jsx)(c,{children:e})]},t))]}),(0,G.jsx)(_,{marginTop:1,children:(0,G.jsxs)(c,{dimColor:!0,children:[`For manual setup instructions, see: `,(0,G.jsx)(c,{color:`claude`,children:I})]})})]}),(0,G.jsx)(_,{marginLeft:3,children:(0,G.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var G,Ve=e((()=>{L(),p(),G=v()}));function He({repoName:e,onSelectAction:t}){return(0,K.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsx)(c,{bold:!0,children:`Existing Workflow Found`}),(0,K.jsxs)(c,{dimColor:!0,children:[`Repository: `,e]})]}),(0,K.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,K.jsxs)(c,{children:[`A Claude workflow file already exists at `,(0,K.jsx)(c,{color:`claude`,children:`.github/workflows/claude.yml`})]}),(0,K.jsx)(c,{dimColor:!0,children:`What would you like to do?`})]}),(0,K.jsx)(_,{flexDirection:`column`,children:(0,K.jsx)(pe,{options:[{label:`Update workflow file with latest version`,value:`update`},{label:`Skip workflow update (configure secrets only)`,value:`skip`},{label:`Exit without making changes`,value:`exit`}],onChange:e=>{t(e)},onCancel:()=>{t(`exit`)}})}),(0,K.jsx)(_,{marginTop:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[`View the latest workflow template at:`,` `,(0,K.jsx)(c,{color:`claude`,children:`https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml`})]})})]})}var K,Ue=e((()=>{me(),p(),K=v()}));function We({repoUrl:e,onSubmit:t}){return h(`confirm:yes`,t,{context:`Confirmation`}),(0,q.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,borderDimColor:!0,paddingX:1,children:[(0,q.jsx)(_,{flexDirection:`column`,marginBottom:1,children:(0,q.jsx)(c,{bold:!0,children:`Install the Claude GitHub App`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`Opening browser to install the Claude GitHub App…`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{children:`If your browser doesn't open automatically, visit:`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{underline:!0,children:`https://github.com/apps/claude`})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsxs)(c,{children:[`Please install the app for repository: `,(0,q.jsx)(c,{bold:!0,children:e})]})}),(0,q.jsx)(_,{marginBottom:1,children:(0,q.jsx)(c,{dimColor:!0,children:`Important: Make sure to grant access to this specific repository`})}),(0,q.jsx)(_,{children:(0,q.jsxs)(c,{bold:!0,color:`permission`,children:[`Press Enter once you've installed the app`,r.ellipsis]})}),(0,q.jsx)(_,{marginTop:1,children:(0,q.jsxs)(c,{dimColor:!0,children:[`Having trouble? See manual setup instructions at: `,(0,q.jsx)(c,{color:`claude`,children:I})]})})]})}var q,Ge=e((()=>{n(),L(),p(),N(),q=v()}));function Ke({onSuccess:e,onCancel:t}){let[n,r]=(0,J.useState)({state:`starting`}),[o]=(0,J.useState)(()=>new ge),[s,l]=(0,J.useState)(``),[d,f]=(0,J.useState)(0),[p,h]=(0,J.useState)(!1),[g,v]=(0,J.useState)(!1),y=(0,J.useRef)(new Set),x=(0,J.useRef)(void 0),ee=i(),te=Math.max(50,ee.columns-30-4);function S(e){n.state===`error`&&(e.preventDefault(),e.key===`return`&&n.toRetry?(l(``),f(0),r({state:`about_to_retry`,nextState:n.toRetry})):t())}async function C(e,t){try{let[n,i]=e.split(`#`);if(!n||!i){r({state:`error`,message:`Invalid code. Please make sure the full code was copied`,toRetry:{state:`waiting_for_login`,url:t}});return}E(`tengu_oauth_manual_entry`,{}),o.handleManualAuthCodeInput({authorizationCode:n,state:i})}catch(e){D(e),r({state:`error`,message:e.message,toRetry:{state:`waiting_for_login`,url:t}})}}let w=(0,J.useCallback)(async()=>{y.current.forEach(e=>clearTimeout(e)),y.current.clear();try{let t=await o.startOAuthFlow(async e=>{r({state:`waiting_for_login`,url:e});let t=setTimeout(h,3e3,!0);y.current.add(t)},{loginWithClaudeAi:!0,inferenceOnly:!0,expiresIn:365*24*60*60});r({state:`processing`}),b(t);let n=setTimeout((e,t,n,r)=>{e({state:`success`,token:t});let i=setTimeout(n,1e3,t);r.current.add(i)},100,r,t.accessToken,e,y);y.current.add(n)}catch(e){let t=e.message;r({state:`error`,message:t,toRetry:{state:`starting`}}),D(e),E(`tengu_oauth_error`,{error:t})}},[o,e]);(0,J.useEffect)(()=>{n.state===`starting`&&w()},[n.state,w]),(0,J.useEffect)(()=>{if(n.state===`about_to_retry`){let e=setTimeout((e,t,n)=>{t(e.state===`waiting_for_login`),n(e)},500,n.nextState,h,r);y.current.add(e)}},[n]),(0,J.useEffect)(()=>{s===`c`&&n.state===`waiting_for_login`&&p&&!g&&(m(n.url).then(e=>{e&&process.stdout.write(e),v(!0),clearTimeout(x.current),x.current=setTimeout(v,2e3,!1)}),l(``))},[s,n,p,g]),(0,J.useEffect)(()=>{let e=y.current;return()=>{o.cleanup(),e.forEach(e=>clearTimeout(e)),e.clear(),clearTimeout(x.current)}},[o]);function T(){switch(n.state){case`starting`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Starting authentication…`})]});case`waiting_for_login`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[!p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Opening browser to sign in with your Claude account…`})]}),p&&(0,Y.jsxs)(_,{children:[(0,Y.jsx)(c,{children:qe}),(0,Y.jsx)(k,{value:s,onChange:l,onSubmit:e=>C(e,n.url),cursorOffset:d,onChangeCursorOffset:f,columns:te})]})]});case`processing`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(j,{}),(0,Y.jsx)(c,{children:`Processing authentication…`})]});case`success`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsx)(c,{color:`success`,children:`✓ Authentication token created successfully!`}),(0,Y.jsx)(c,{dimColor:!0,children:`Using token for GitHub Actions setup…`})]});case`error`:return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,children:[(0,Y.jsxs)(c,{color:`error`,children:[`OAuth error: `,n.message]}),n.toRetry?(0,Y.jsx)(c,{dimColor:!0,children:`Press Enter to try again, or any other key to cancel`}):(0,Y.jsx)(c,{dimColor:!0,children:`Press any key to return to API key selection`})]});case`about_to_retry`:return(0,Y.jsx)(_,{flexDirection:`column`,gap:1,children:(0,Y.jsx)(c,{color:`permission`,children:`Retrying…`})});default:return null}}return(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,tabIndex:0,autoFocus:!0,onKeyDown:S,children:[n.state===`starting`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]}),n.state!==`success`&&n.state!==`starting`&&n.state!==`processing`&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsx)(c,{bold:!0,children:`Create Authentication Token`}),(0,Y.jsx)(c,{dimColor:!0,children:`Creating a long-lived token for GitHub Actions`})]},`header`),n.state===`waiting_for_login`&&p&&(0,Y.jsxs)(_,{flexDirection:`column`,gap:1,paddingBottom:1,children:[(0,Y.jsxs)(_,{paddingX:1,children:[(0,Y.jsx)(c,{dimColor:!0,children:`Browser didn't open? Use the url below to sign in `}),g?(0,Y.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,Y.jsx)(c,{dimColor:!0,children:(0,Y.jsx)(u,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,Y.jsx)(a,{url:n.url,children:(0,Y.jsx)(c,{dimColor:!0,children:n.url})})]},`urlToCopy`),(0,Y.jsx)(_,{paddingLeft:1,flexDirection:`column`,gap:1,children:T()})]})}var J,Y,qe,Je=e((()=>{J=t(o(),1),T(),p(),he(),A(),M(),ce(),w(),oe(),Y=v(),qe=`Paste code here if prompted > `}));function Ye({secretExists:e,useExistingSecret:t,secretName:n,skipWorkflow:r=!1}){return(0,X.jsxs)(X.Fragment,{children:[(0,X.jsxs)(_,{flexDirection:`column`,borderStyle:`round`,paddingX:1,children:[(0,X.jsxs)(_,{flexDirection:`column`,marginBottom:1,children:[(0,X.jsx)(c,{bold:!0,children:`Install GitHub App`}),(0,X.jsx)(c,{dimColor:!0,children:`Success`})]}),!r&&(0,X.jsx)(c,{color:`success`,children:`✓ GitHub Actions workflow created!`}),e&&t&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{color:`success`,children:`✓ Using existing ANTHROPIC_API_KEY secret`})}),(!e||!t)&&(0,X.jsx)(_,{marginTop:1,children:(0,X.jsxs)(c,{color:`success`,children:[`✓ API key saved as `,n,` secret`]})}),(0,X.jsx)(_,{marginTop:1,children:(0,X.jsx)(c,{children:`Next steps:`})}),r?(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`2. Your workflow file was kept unchanged`}),(0,X.jsx)(c,{children:`3. API key is configured and ready to use`})]}):(0,X.jsxs)(X.Fragment,{children:[(0,X.jsx)(c,{children:`1. A pre-filled PR page has been created`}),(0,X.jsx)(c,{children:`2. Install the Claude GitHub App if you haven't already`}),(0,X.jsx)(c,{children:`3. Merge the PR to enable Claude PR assistance`})]})]}),(0,X.jsx)(_,{marginLeft:3,children:(0,X.jsx)(c,{dimColor:!0,children:`Press any key to exit`})})]})}var X,Xe=e((()=>{o(),p(),X=v()}));async function Ze(e,t,n,r,i,a,o){let s=await O(`gh`,[`api`,`repos/${e}/contents/${n}`,`--jq`,`.sha`]),c=null;s.code===0&&(c=s.stdout.trim());let l=r;i===`CLAUDE_CODE_OAUTH_TOKEN`?l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,"claude_code_oauth_token: ${{ secrets.CLAUDE_CODE_OAUTH_TOKEN }}"):i!==`ANTHROPIC_API_KEY`&&(l=r.replace(/anthropic_api_key: \$\{\{ secrets\.ANTHROPIC_API_KEY \}\}/g,`anthropic_api_key: \${{ secrets.${i} }}`));let u=Buffer.from(l).toString(`base64`),d=[`api`,`--method`,`PUT`,`repos/${e}/contents/${n}`,`-f`,`message=${c?`"Update ${a}"`:`"${a}"`}`,`-f`,`content=${u}`,`-f`,`branch=${t}`];c&&d.push(`-f`,`sha=${c}`);let f=await O(`gh`,d);if(f.code!==0)throw f.stderr.includes(`422`)&&f.stderr.includes(`sha`)?(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: A Claude workflow file already exists in this repository. Please remove it first or update it manually.`)):(E(`tengu_setup_github_actions_failed`,{reason:`failed_to_create_workflow_file`,exit_code:f.code,...o}),Error(`Failed to create workflow file ${n}: ${f.stderr}
136
136
 
137
137
  Need help? Common issues:
138
138
  · Permission denied → Run: gh auth refresh -h github.com -s repo,workflow