claude-code-best 2.8.1 → 2.8.3

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 (445) hide show
  1. package/README.md +1 -1
  2. package/dist/chunks/{AddWorkspaceDirectory-CNyPaerF.js → AddWorkspaceDirectory-CM5PYqoF.js} +1 -1
  3. package/dist/chunks/{App-hiKxO6UA.js → App-BLLQEMkd.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-AMXQPmfE.js +1 -0
  5. package/dist/chunks/{ApproveApiKey-Cd43j9Wa.js → ApproveApiKey-DrflOSA-.js} +1 -1
  6. package/dist/chunks/{AssistantSessionChooser-C8OxwSGM.js → AssistantSessionChooser-SlRne98s.js} +1 -1
  7. package/dist/chunks/BackgroundTasksDialog-Cciww_FF.js +2 -0
  8. package/dist/chunks/{BypassPermissionsModeDialog-Ddjzluka.js → BypassPermissionsModeDialog-HaciDdx0.js} +1 -1
  9. package/dist/chunks/{ClaudeInChromeOnboarding-BhvrEJlm.js → ClaudeInChromeOnboarding-EA3k_q2M.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-C-T8G8O7.js +1 -0
  11. package/dist/chunks/{ClaudeMdExternalIncludesDialog-DoNd72PS.js → ClaudeMdExternalIncludesDialog-xBclyqKk.js} +1 -1
  12. package/dist/chunks/ConsoleOAuthFlow-BTN62PKj.js +1 -0
  13. package/dist/chunks/{DesktopHandoff-DVUOZjb0.js → DesktopHandoff-BhY_F3Ob.js} +1 -1
  14. package/dist/chunks/{DevChannelsDialog-DJbRHAIy.js → DevChannelsDialog-DU5komVT.js} +1 -1
  15. package/dist/chunks/DiffDialog-D_-znREV.js +3 -0
  16. package/dist/chunks/Doctor-BhrEYzPO.js +3 -0
  17. package/dist/chunks/Doctor-CjnUU1CY.js +1 -0
  18. package/dist/chunks/{ExitFlow-BPbtGcEg.js → ExitFlow-cRfxceuS.js} +2 -2
  19. package/dist/chunks/{Feedback-BSagYjmf.js → Feedback-BMv8Kt05.js} +2 -2
  20. package/dist/chunks/Grove-CRAZGlvf.js +1 -0
  21. package/dist/chunks/{Grove-BrP9JNpK.js → Grove-CjfR7Acp.js} +1 -1
  22. package/dist/chunks/{HybridTransport-DLaxmXCR.js → HybridTransport-D32dn9xc.js} +1 -1
  23. package/dist/chunks/{ITermBackend-tXN55G2D.js → ITermBackend-BxjzkptA.js} +1 -1
  24. package/dist/chunks/{InvalidConfigDialog-BzFQdfwu.js → InvalidConfigDialog-CnCOCqMT.js} +1 -1
  25. package/dist/chunks/{InvalidSettingsDialog-KFg61s41.js → InvalidSettingsDialog-CLOgpfR2.js} +1 -1
  26. package/dist/chunks/MCPConnectionManager-BhbT4Sah.js +1 -0
  27. package/dist/chunks/{McpParsingWarnings-DsHSSgsx.js → McpParsingWarnings-B5X5HVnQ.js} +1 -1
  28. package/dist/chunks/MessageSelector-DLofsxam.js +3 -0
  29. package/dist/chunks/Messages-D1-i4MMT.js +11 -0
  30. package/dist/chunks/{Onboarding-DBJX6Cnf.js → Onboarding-Co5P3gZs.js} +1 -1
  31. package/dist/chunks/{OverageCreditUpsell-B4beCEX2.js → OverageCreditUpsell-DjgcfVt2.js} +1 -1
  32. package/dist/chunks/PluginSettings-NB-Wod-9.js +17 -0
  33. package/dist/chunks/{PromptInputHelpMenu-Bjjr3tYl.js → PromptInputHelpMenu-BDI5IF1s.js} +1 -1
  34. package/dist/chunks/QueryEngine-B217mLel.js +1 -0
  35. package/dist/chunks/REPL-BfprHNDt.js +1 -0
  36. package/dist/chunks/{REPL-CXcCBQuz.js → REPL-DCm_BFr_.js} +36 -36
  37. package/dist/chunks/{RemoteCallout-CuxqarhC.js → RemoteCallout-dGnKRIDB.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-BhPF41Wn.js → RemoteSessionManager-BidAIOqZ.js} +2 -2
  39. package/dist/chunks/ResumeConversation-SDRT6hO3.js +1 -0
  40. package/dist/chunks/{SSETransport-8yaTbdSK.js → SSETransport-BM2xz03M.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-DCSReOsq.js +1 -0
  42. package/dist/chunks/{SentryErrorBoundary-ydwbrVTx.js → SentryErrorBoundary-D5niZGEU.js} +1 -1
  43. package/dist/chunks/SentryErrorBoundary-DzwCuftg.js +1 -0
  44. package/dist/chunks/Settings-D3ds_WCz.js +2 -0
  45. package/dist/chunks/{TeleportProgress-CNcl_DxR.js → TeleportProgress-Dg6HcEO9.js} +1 -1
  46. package/dist/chunks/{TeleportRepoMismatchDialog-DJc8_mjE.js → TeleportRepoMismatchDialog-BUKNU2jx.js} +1 -1
  47. package/dist/chunks/{TeleportResumeWrapper-Cw438s-J.js → TeleportResumeWrapper-5FTzA9R_.js} +1 -1
  48. package/dist/chunks/{ThemePicker-8X6yAwuQ.js → ThemePicker-Bdm12PmJ.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-CqAnVFoI.js → TmuxBackend-CYx3Hdf1.js} +2 -2
  50. package/dist/chunks/{TrustDialog-Ch1FJzxi.js → TrustDialog-DGKf4iwh.js} +1 -1
  51. package/dist/chunks/{ValidationErrorsList-sgfvJPWZ.js → ValidationErrorsList-BP7vG1uX.js} +1 -1
  52. package/dist/chunks/{WelcomeV2-Bu8l3w90.js → WelcomeV2-k_969SnB.js} +1 -1
  53. package/dist/chunks/{WindowsTerminalBackend-Bvq7nHOp.js → WindowsTerminalBackend-K_zVZBSP.js} +2 -2
  54. package/dist/chunks/{add-dir-DqrRNnxe.js → add-dir-DnfUkb1n.js} +1 -1
  55. package/dist/chunks/{agentDisplay-DcxzWi1v.js → agentDisplay-DT04Kqdm.js} +1 -1
  56. package/dist/chunks/{agents-Do1ynqiW.js → agents-ELZyUElQ.js} +7 -7
  57. package/dist/chunks/{agents-QqLm1wcM.js → agents-hh7Zcqm6.js} +1 -1
  58. package/dist/chunks/{ant-D5gD6O-r.js → ant-CuQC6xHS.js} +1 -1
  59. package/dist/chunks/api-BY3NFL4L.js +1 -0
  60. package/dist/chunks/{api-hcsOinLV.js → api-C-KY7A3r.js} +1 -1
  61. package/dist/chunks/asciicast-BeEmDIKr.js +1 -0
  62. package/dist/chunks/{asciicast-C_1Pi99k.js → asciicast-C0fPsv7_.js} +1 -1
  63. package/dist/chunks/assistant-C669PK45.js +1 -0
  64. package/dist/chunks/{assistant-CemNvrYr.js → assistant-DbtrknMt.js} +1 -1
  65. package/dist/chunks/{assistant-DkECAILU.js → assistant-Z-xFHPiY.js} +1 -1
  66. package/dist/chunks/{auth-Dm8aWPRh.js → auth-Bo_eeRO9.js} +1 -1
  67. package/dist/chunks/auth-C-rD91K7.js +1 -0
  68. package/dist/chunks/{autoMode-dygqoN_C.js → autoMode-BhsFtU8_.js} +6 -6
  69. package/dist/chunks/{autonomy-BdxnxJnk.js → autonomy-B-d3Xamr.js} +1 -1
  70. package/dist/chunks/{autonomy-DPeEmb00.js → autonomy-C5wE-5B8.js} +12 -12
  71. package/dist/chunks/{autonomyPanel-Bocl2taZ.js → autonomyPanel-CMy4Zs1a.js} +1 -1
  72. package/dist/chunks/backgroundHousekeeping-YAOGWoo4.js +17 -0
  73. package/dist/chunks/backgroundHousekeeping-xFmPDL7y.js +1 -0
  74. package/dist/chunks/{branch-DwdVgun5.js → branch-DoV3sEJf.js} +2 -2
  75. package/dist/chunks/{bridge-DkkMogD_.js → bridge-8RYx23zW.js} +2 -2
  76. package/dist/chunks/{bridgeConfig-l6Ldi_hk.js → bridgeConfig-C8tQXEsd.js} +1 -1
  77. package/dist/chunks/bridgeConfig-D5awYlvd.js +1 -0
  78. package/dist/chunks/bridgeEnabled-0tZw2TlM.js +1 -0
  79. package/dist/chunks/{bridgeEnabled-DYclTb9d.js → bridgeEnabled-B3KTIVe4.js} +1 -1
  80. package/dist/chunks/bridgeMain-DKkE8RYG.js +1 -0
  81. package/dist/chunks/bridgeMain-Ssp8HRcV.js +68 -0
  82. package/dist/chunks/{bridgeMessaging-CYe1Cixl.js → bridgeMessaging-DGTm_wDk.js} +1 -1
  83. package/dist/chunks/{btw-CyOlY5R-.js → btw-Du0mHeiD.js} +1 -1
  84. package/dist/chunks/{buddy-q-utA1_5.js → buddy-D04AYSW6.js} +1 -1
  85. package/dist/chunks/{bypassPermissionsKillswitch-CTrRxzdz.js → bypassPermissionsKillswitch-CRYkShwu.js} +1 -1
  86. package/dist/chunks/caches-Byd8SjTZ.js +1 -0
  87. package/dist/chunks/{caches-Bz4yVQyE.js → caches-DYf69-N9.js} +2 -2
  88. package/dist/chunks/{ccrClient-DXiEw9xU.js → ccrClient-CDrBxSox.js} +1 -1
  89. package/dist/chunks/changeDetector-CGzGs92S.js +1 -0
  90. package/dist/chunks/{channelNotification-CLPdvxGZ.js → channelNotification-CtA9HHFW.js} +1 -1
  91. package/dist/chunks/channelNotification-DOvTvOGt.js +1 -0
  92. package/dist/chunks/{chrome-DxbhLWDW.js → chrome-BHbT4cc4.js} +1 -1
  93. package/dist/chunks/clear-BGLxPs_B.js +1 -0
  94. package/dist/chunks/client-CtOmoNuQ.js +1 -0
  95. package/dist/chunks/color-MOZYZ1cM.js +1 -0
  96. package/dist/chunks/commands-B3XpQmEm.js +1 -0
  97. package/dist/chunks/{commitAttribution-CJXF8wMs.js → commitAttribution-BTtCTr8c.js} +1 -1
  98. package/dist/chunks/commitAttribution-CXNK79GW.js +1 -0
  99. package/dist/chunks/compact-CMqxm2yG.js +3 -0
  100. package/dist/chunks/{companion-rXSt0nmz.js → companion-ChxkOPHB.js} +1 -1
  101. package/dist/chunks/{config-BE3jrcr-.js → config-cRyRIPI7.js} +1 -1
  102. package/dist/chunks/{config-CzC08IjE.js → config-wvQYYbwU.js} +1 -1
  103. package/dist/chunks/{context-BHE99SMA.js → context-7ds9guuJ.js} +1 -1
  104. package/dist/chunks/{context-noninteractive-BZQIUH_y.js → context-noninteractive-CISZymIU.js} +2 -2
  105. package/dist/chunks/context-noninteractive-CwJBBF8h.js +1 -0
  106. package/dist/chunks/conversation-Bgsdn99n.js +1 -0
  107. package/dist/chunks/conversation-D30CU_jS.js +1 -0
  108. package/dist/chunks/{copy-TgphIVzy.js → copy-Dvz2Mge4.js} +2 -2
  109. package/dist/chunks/{createSSHSession-CSKEZ4ic.js → createSSHSession-Befx8LiM.js} +1 -1
  110. package/dist/chunks/createSession-Cp0KTjPL.js +1 -0
  111. package/dist/chunks/{createSession-Ce218tQj.js → createSession-CsZGoika.js} +1 -1
  112. package/dist/chunks/{cronJitterConfig-CnKed5Gi.js → cronJitterConfig-Dfl7iZqE.js} +3 -3
  113. package/dist/chunks/{crossProjectResume-BFlsTYOq.js → crossProjectResume-DK8nt_cn.js} +3 -3
  114. package/dist/chunks/{datadog-D5jSRybW.js → datadog-2vPhbh6g.js} +1 -1
  115. package/dist/chunks/datadog-DLTYg-S2.js +1 -0
  116. package/dist/chunks/{desktop-cjA0tGOa.js → desktop-DY9Nw2Fi.js} +1 -1
  117. package/dist/chunks/{diff-DMd61IjE.js → diff-Ci6rs6S6.js} +1 -1
  118. package/dist/chunks/{directoryCompletion-DqtWZsoW.js → directoryCompletion-DLxCFk_m.js} +1 -1
  119. package/dist/chunks/{doctor-ueUYyjyL.js → doctor-DBYGgS-y.js} +1 -1
  120. package/dist/chunks/{effort-B9IvAstG.js → effort-Bi_t4J_o.js} +2 -2
  121. package/dist/chunks/{entry-Bq_KRMWs.js → entry-p_5l64_p.js} +5 -5
  122. package/dist/chunks/{envLessBridgeConfig-CpjlwmvF.js → envLessBridgeConfig-C_sqoGX6.js} +1 -1
  123. package/dist/chunks/envLessBridgeConfig-Cfbqwjew.js +1 -0
  124. package/dist/chunks/exit-Bc8L5oQT.js +1 -0
  125. package/dist/chunks/{export-CP638-TO.js → export-kvnEu9Iw.js} +1 -1
  126. package/dist/chunks/{exportRenderer-B5emJDvn.js → exportRenderer-DmpMgUiv.js} +1 -1
  127. package/dist/chunks/extra-usage-BnO6knuC.js +1 -0
  128. package/dist/chunks/{extra-usage-DIm8nrKj.js → extra-usage-CmP6V7HX.js} +1 -1
  129. package/dist/chunks/{extra-usage-core-DERKSEe1.js → extra-usage-core-BqJClmf4.js} +1 -1
  130. package/dist/chunks/{extra-usage-noninteractive-Dq5dog_-.js → extra-usage-noninteractive-BWyPFx53.js} +1 -1
  131. package/dist/chunks/extraUsage-DgMspmL4.js +1 -0
  132. package/dist/chunks/extractMemories-uQJS_i6E.js +1 -0
  133. package/dist/chunks/fast-Bunl4ivM.js +1 -0
  134. package/dist/chunks/{fast-BP2t1xDM.js → fast-Dd2jZVF-.js} +1 -1
  135. package/dist/chunks/{feedback-C-mR6zJr.js → feedback-8UeDx3Yc.js} +1 -1
  136. package/dist/chunks/{firstPartyEventLogger-sMmHdYjg.js → firstPartyEventLogger-cKEuzfyR.js} +1 -1
  137. package/dist/chunks/{flushGate-C18XwNsa.js → flushGate-B3upNVdV.js} +1 -1
  138. package/dist/chunks/{gates-Be5r2kKS.js → gates-lWoKqpJ1.js} +1 -1
  139. package/dist/chunks/gates-uo2owWkc.js +1 -0
  140. package/dist/chunks/{gemini-BberPcp1.js → gemini-DDSP4ArG.js} +1 -1
  141. package/dist/chunks/{generateRecap-B76UcVUS.js → generateRecap-DCBzHqag.js} +1 -1
  142. package/dist/chunks/{generateSessionName-BwtXd8TC.js → generateSessionName-Db5pZ3cL.js} +1 -1
  143. package/dist/chunks/{githubRepoPathMapping-5IlVgR2l.js → githubRepoPathMapping-v_U9b0Fe.js} +1 -1
  144. package/dist/chunks/{goal-DQ0jNcLO.js → goal-EZCOCHZa.js} +3 -3
  145. package/dist/chunks/{grok-Dh_thT2_.js → grok-H8K_fDKF.js} +1 -1
  146. package/dist/chunks/{growthbook-4ADV3CAt.js → growthbook-mMD0jkbu.js} +1 -1
  147. package/dist/chunks/{heapdump-Dwqmh4SX.js → heapdump-CbVvtQuH.js} +1 -1
  148. package/dist/chunks/{help-Bznaywoi.js → help-Bq4jxCSJ.js} +1 -1
  149. package/dist/chunks/hooks-CVlFJfV0.js +1 -0
  150. package/dist/chunks/{hooks-F-82cg6M.js → hooks-DbKUS0fN.js} +2 -2
  151. package/dist/chunks/{hostAdapter-DpfLr3hX.js → hostAdapter-BhVpIn1Y.js} +1 -1
  152. package/dist/chunks/{ide-BfAKWufQ.js → ide-DZJheXyl.js} +2 -2
  153. package/dist/chunks/{inboundAttachments-CFV_eqMu.js → inboundAttachments-B9NxWIDx.js} +1 -1
  154. package/dist/chunks/inboundAttachments-_vhgWPEL.js +1 -0
  155. package/dist/chunks/initReplBridge-BCIaWf78.js +1 -0
  156. package/dist/chunks/{insights-BNsCwNYa.js → insights-D1BFvhw_.js} +68 -68
  157. package/dist/chunks/{install-Bszzs98N.js → install-D_xm-9s1.js} +1 -1
  158. package/dist/chunks/{install-github-app-DVxGR2rp.js → install-github-app-CUEACXdr.js} +2 -2
  159. package/dist/chunks/{install-slack-app-CjlRL19o.js → install-slack-app-DGV6l9wy.js} +1 -1
  160. package/dist/chunks/{instrumentation-BOYPOtyu.js → instrumentation-CEfWNakt.js} +3 -3
  161. package/dist/chunks/{job-BvD5_lGz.js → job-BeeAFieV.js} +1 -1
  162. package/dist/chunks/{keybindings-RPmPPGhp.js → keybindings-CeYhuE5G.js} +2 -2
  163. package/dist/chunks/{lang-9VNaOJMz.js → lang-BmwAsgo1.js} +1 -1
  164. package/dist/chunks/{language-Ct5Nkqm6.js → language-BcWiv2lr.js} +1 -1
  165. package/dist/chunks/language-BnQye2Mx.js +1 -0
  166. package/dist/chunks/{launchAgentsPlatform-CnoxFIXV.js → launchAgentsPlatform-DqQzwcqV.js} +1 -1
  167. package/dist/chunks/{launchAutofixPr-ChaDUtvx.js → launchAutofixPr-XltBpICW.js} +3 -3
  168. package/dist/chunks/{launchLocalMemory-MwZfEJxz.js → launchLocalMemory-CHSU4_or.js} +2 -2
  169. package/dist/chunks/{launchLocalVault-B6Ib5WXx.js → launchLocalVault-CnvCdQ1M.js} +3 -3
  170. package/dist/chunks/{launchMemoryStores-D6xyGwQ1.js → launchMemoryStores-DD2duIDU.js} +1 -1
  171. package/dist/chunks/{launchOnboarding-BtdAOO3p.js → launchOnboarding-JTKef_jU.js} +1 -1
  172. package/dist/chunks/{launchSchedule-XVljzNKg.js → launchSchedule-BVtfNQtS.js} +1 -1
  173. package/dist/chunks/{launchSkillStore-QT8Qcc5N.js → launchSkillStore-TisTmZ3O.js} +1 -1
  174. package/dist/chunks/{launchTeleport-DwxPesKQ.js → launchTeleport-BO_V6ggj.js} +3 -3
  175. package/dist/chunks/{launchVault-Dbti6pph.js → launchVault-Civro2KB.js} +1 -1
  176. package/dist/chunks/{loadAgentsDir-BYWykYwn.js → loadAgentsDir-BfEZacjM.js} +740 -690
  177. package/dist/chunks/loadAgentsDir-rYxb2igq.js +1 -0
  178. package/dist/chunks/loadPluginHooks-Cniyh-tZ.js +1 -0
  179. package/dist/chunks/localSearch-C0J7ETJQ.js +1 -0
  180. package/dist/chunks/{localSearch-eWjZxMc8.js → localSearch-COJcqOWl.js} +1 -1
  181. package/dist/chunks/login-B4wjtpEU.js +1 -0
  182. package/dist/chunks/{login-D1aQCqp0.js → login-SuUxFLIY.js} +1 -1
  183. package/dist/chunks/{logoV2Utils-CPNvLtol.js → logoV2Utils-DvjpZkyF.js} +1 -1
  184. package/dist/chunks/logout-o16yNWNB.js +1 -0
  185. package/dist/chunks/{magicDocs-DAvjAbAJ.js → magicDocs-BZBrH9zB.js} +2 -2
  186. package/dist/chunks/{main-BKlQiSuc.js → main-p9Tke3lb.js} +90 -63
  187. package/dist/chunks/mappers-BcXg_fI3.js +1 -0
  188. package/dist/chunks/mcp-BFxLEf3X.js +1 -0
  189. package/dist/chunks/{mcp-ya96irNP.js → mcp-CIJL0PTq.js} +2 -2
  190. package/dist/chunks/mcp-DfuQ1MJu.js +6 -0
  191. package/dist/chunks/{mcpServer-B1q9blAc.js → mcpServer-D2kI_m2H.js} +1 -1
  192. package/dist/chunks/{mcpServer-BJB5g6j2.js → mcpServer-DPk-oJOU.js} +1 -1
  193. package/dist/chunks/{memory-CxiukAGg.js → memory-CJOtY_Uv.js} +1 -1
  194. package/dist/chunks/{mode-DqAJ2y6R.js → mode-DkpKiyTE.js} +1 -1
  195. package/dist/chunks/{model-C8TW-qjl.js → model-DZyzd39E.js} +1 -1
  196. package/dist/chunks/model-De0AGQ3F.js +1 -0
  197. package/dist/chunks/{onChangeAppState-BG1pF7ht.js → onChangeAppState-CvtxqUDG.js} +1 -1
  198. package/dist/chunks/{openai-CHoRhRtf.js → openai-B888nVou.js} +3 -3
  199. package/dist/chunks/{overageCreditGrant-DYMg1lV4.js → overageCreditGrant-BOSyVk3U.js} +1 -1
  200. package/dist/chunks/{panelCall-SYrmrKt9.js → panelCall-BVdu8oii.js} +1 -1
  201. package/dist/chunks/{passes-CSV-SZJc.js → passes-DeSsjipz.js} +1 -1
  202. package/dist/chunks/{path-BE28AJwZ.js → path-Cit7LKW-.js} +1 -1
  203. package/dist/chunks/{paths-BZjPDxMm.js → paths-nIHVpTn2.js} +3 -3
  204. package/dist/chunks/permissions-DGdr-wOj.js +3 -0
  205. package/dist/chunks/{pipeTransport-uK7GxbSG.js → pipeTransport-ClZYq1sd.js} +1 -1
  206. package/dist/chunks/{plan-DEbo-Adi.js → plan-D9bnkDwv.js} +1 -1
  207. package/dist/chunks/{plugin-Cops24hg.js → plugin-BE0r1g1g.js} +1 -1
  208. package/dist/chunks/{pluginAutoupdate-Bg7JMOHN.js → pluginAutoupdate-xyXksEJv.js} +1 -1
  209. package/dist/chunks/pluginBlocklist-Dd7XBe8U.js +1 -0
  210. package/dist/chunks/{pluginCliCommands-DyYEg7Cv.js → pluginCliCommands-8MJCk1nq.js} +1 -1
  211. package/dist/chunks/{pluginFlagging-DwChUZMJ.js → pluginFlagging-7zuXXBD5.js} +1 -1
  212. package/dist/chunks/pluginOperations-DFzbASMD.js +2 -0
  213. package/dist/chunks/{pluginStartupCheck-DCxJJkYs.js → pluginStartupCheck-BC5npqdw.js} +1 -1
  214. package/dist/chunks/pluginStartupCheck-C6IH0haF.js +1 -0
  215. package/dist/chunks/plugins-Bhc2pbAj.js +4 -0
  216. package/dist/chunks/policyLimits-CfrU0rIR.js +1 -0
  217. package/dist/chunks/{pollConfig-DBNHhvHf.js → pollConfig-B3hNYQ_n.js} +1 -1
  218. package/dist/chunks/{poor-aPQce502.js → poor-BjTGCuqc.js} +1 -1
  219. package/dist/chunks/{poorMode-CFRuV-nB.js → poorMode-CGVMMLlz.js} +1 -1
  220. package/dist/chunks/poorMode-DWLhTldO.js +1 -0
  221. package/dist/chunks/{print-Cf2tY__0.js → print-BJkyuCzw.js} +11 -11
  222. package/dist/chunks/{privacy-settings-CYkM3Aem.js → privacy-settings-BDVjqVcX.js} +1 -1
  223. package/dist/chunks/processBashCommand-DnzyTwtS.js +1 -0
  224. package/dist/chunks/processSlashCommand-BGBRvSCA.js +6 -0
  225. package/dist/chunks/prompt-BXrvaHyx.js +1 -0
  226. package/dist/chunks/prompt-DgIuTC6Q.js +227 -0
  227. package/dist/chunks/prompt-Fax-fxAf.js +1 -0
  228. package/dist/chunks/{promptEditor-U03qQWbq.js → promptEditor-BkHY_Vzb.js} +2 -2
  229. package/dist/chunks/{protocolHandler-3yBj9w5N.js → protocolHandler-CrXWRkxh.js} +1 -1
  230. package/dist/chunks/rate-limit-options-skMSi19l.js +1 -0
  231. package/dist/chunks/{rcDebugLog-ClX1msJX.js → rcDebugLog-Bv_x5w_B.js} +1 -1
  232. package/dist/chunks/{referral-qe-yqXJE.js → referral-DfKWr4Jf.js} +1 -1
  233. package/dist/chunks/refresh-zosTlttX.js +1 -0
  234. package/dist/chunks/{registerProtocol-CClQph00.js → registerProtocol-De6y1iOi.js} +1 -1
  235. package/dist/chunks/registry-C8JbYbJI.js +1 -0
  236. package/dist/chunks/{release-notes-CyZHxWTF.js → release-notes-Su1UPyE4.js} +1 -1
  237. package/dist/chunks/{releaseNotes-BtxL5R5Q.js → releaseNotes-C7-JnhrH.js} +2 -2
  238. package/dist/chunks/{reload-plugins-B0eR8JHH.js → reload-plugins-C8lWCq8M.js} +1 -1
  239. package/dist/chunks/{remote-env-B_sIjY87.js → remote-env-tQuvJmrt.js} +1 -1
  240. package/dist/chunks/{remoteBridgeCore-C3WRaLpU.js → remoteBridgeCore-CwOTDmNP.js} +1 -1
  241. package/dist/chunks/{remoteControlServer-BOj9qmgH.js → remoteControlServer-DIKi-0lr.js} +2 -2
  242. package/dist/chunks/rename-Trg9EHjT.js +1 -0
  243. package/dist/chunks/{resume-CpivBr9S.js → resume-Nt_EbjKh.js} +2 -2
  244. package/dist/chunks/{runtimeObserver-sOnfVR7t.js → runtimeObserver-CyWhTJpz.js} +4 -4
  245. package/dist/chunks/{runtimeObserver-C2_7Vsnd.js → runtimeObserver-T9QERJ_O.js} +1 -1
  246. package/dist/chunks/sandbox-adapter-BDGhDrPl.js +1 -0
  247. package/dist/chunks/{sandbox-toggle-Bv68-Ca7.js → sandbox-toggle-C6v31S7-.js} +1 -1
  248. package/dist/chunks/searchExtraTools-C8ehknh0.js +1 -0
  249. package/dist/chunks/{sentry-BBCn6RGP.js → sentry-CK_GHX79.js} +1 -1
  250. package/dist/chunks/{session-DfvxYP8o.js → session-Ys3KvmQ0.js} +1 -1
  251. package/dist/chunks/{sessionDiscovery-CyuRBTAm.js → sessionDiscovery-Cg3X2fKe.js} +1 -1
  252. package/dist/chunks/sessionFileAccessHooks-vthxapHk.js +1 -0
  253. package/dist/chunks/sessionMemory-ek1SfYG_.js +1 -0
  254. package/dist/chunks/sessionMemory-l-S0jpuk.js +1 -0
  255. package/dist/chunks/sessionMemoryUtils-BGJeJyKn.js +1 -0
  256. package/dist/chunks/sessionObserver-COTvvM3Z.js +1 -0
  257. package/dist/chunks/{sessionObserver-CTkIYplM.js → sessionObserver-DvAdG6vQ.js} +2 -2
  258. package/dist/chunks/sessionStorage-GKe4ALVr.js +1 -0
  259. package/dist/chunks/{sessionTitle-ePQRpeV2.js → sessionTitle-DJMmUKBJ.js} +2 -2
  260. package/dist/chunks/{sessionTracing-81-RIJBo.js → sessionTracing-DuQ3kbq6.js} +1 -1
  261. package/dist/chunks/{settingsSync-DEFWnE1o.js → settingsSync-1mhDakFG.js} +1 -1
  262. package/dist/chunks/{setup-CTfYsKsz.js → setup-CAy0HkI3.js} +1 -1
  263. package/dist/chunks/setup-CGxUKG8x.js +3 -0
  264. package/dist/chunks/{setup-2611vmGJ.js → setup-D5ioKRsS.js} +1 -1
  265. package/dist/chunks/{shadowedRuleDetection-CGD7Nx03.js → shadowedRuleDetection-Cq0y9pLR.js} +1 -1
  266. package/dist/chunks/{sideQuestion-BcP9Mm-5.js → sideQuestion-ZII6LMSM.js} +3 -3
  267. package/dist/chunks/{sink-D_t1TIt9.js → sink-Cd5g6Qqh.js} +1 -1
  268. package/dist/chunks/sink-Df9tds-b.js +1 -0
  269. package/dist/chunks/sinks-C4DwU8Xs.js +1 -0
  270. package/dist/chunks/{sinks-DXsozhmS.js → sinks-DZlIEjLZ.js} +2 -2
  271. package/dist/chunks/{skill-learning-CZm2iMik.js → skill-learning-DO21PjpF.js} +1 -1
  272. package/dist/chunks/skillChangeDetector-B6tL2yC9.js +1 -0
  273. package/dist/chunks/{skillGapStore-DzHv8v-D.js → skillGapStore-B_xv3GUy.js} +1 -1
  274. package/dist/chunks/{skillGapStore-cWo6Ra90.js → skillGapStore-CTD8MYTx.js} +2 -2
  275. package/dist/chunks/{skillGenerator-D_W1IeP3.js → skillGenerator-CO9r-gft.js} +2 -2
  276. package/dist/chunks/skillLearning-BJS4lsNk.js +1 -0
  277. package/dist/chunks/skillLearning-C2NmdcYQ.js +1 -0
  278. package/dist/chunks/{skillPanel-ChmOZu4F.js → skillPanel-DSumFGKN.js} +3 -3
  279. package/dist/chunks/{skillSearchPanel-CVx2b4Pr.js → skillSearchPanel-SqkfYBjV.js} +4 -4
  280. package/dist/chunks/{skills-CWX1SydA.js → skills-Bj3g5apl.js} +1 -1
  281. package/dist/chunks/{sprites-BuvEFwW6.js → sprites-CxMz3tIE.js} +1 -1
  282. package/dist/chunks/{stats-wjMQA-CA.js → stats-D1wYx84O.js} +1 -1
  283. package/dist/chunks/{status-CyU7IQhO.js → status-BWCqbeJ3.js} +1 -1
  284. package/dist/chunks/statusNoticeHelpers-DY0Cblkd.js +1 -0
  285. package/dist/chunks/{tag-opEEZI5B.js → tag-Hc7nOYm5.js} +2 -2
  286. package/dist/chunks/{tasks-CCtnU5u1.js → tasks-BSqecqVm.js} +1 -1
  287. package/dist/chunks/{teamHelpers-BJJs8taN.js → teamHelpers-BOmVFTLS.js} +1 -1
  288. package/dist/chunks/teamHelpers-BueGmQcw.js +1 -0
  289. package/dist/chunks/{teammateModeSnapshot-CLiiOCkO.js → teammateModeSnapshot-DhXjREuo.js} +1 -1
  290. package/dist/chunks/teammateModeSnapshot-_MCm6NGJ.js +1 -0
  291. package/dist/chunks/teleport-W2iPwivh.js +1 -0
  292. package/dist/chunks/{templateJobs-C6D7GC-Q.js → templateJobs-1oMC9yLQ.js} +1 -1
  293. package/dist/chunks/{terminalSetup-2ioFcRAA.js → terminalSetup-Bkml3uSP.js} +1 -1
  294. package/dist/chunks/{terminalSetup-B3bN4Cj8.js → terminalSetup-DJX1hqKs.js} +1 -1
  295. package/dist/chunks/{theme-Dgq_Og2P.js → theme-ia4cIc4d.js} +1 -1
  296. package/dist/chunks/thinkback-1NYskewu.js +1 -0
  297. package/dist/chunks/{thinkback-C43WBHis.js → thinkback-DWLUXUQC.js} +1 -1
  298. package/dist/chunks/thinkback-play-DZmXMRtq.js +1 -0
  299. package/dist/chunks/{toolEventObserver-B7EA-nNa.js → toolEventObserver-Ci0BECRu.js} +1 -1
  300. package/dist/chunks/{toolEventObserver-BG_3sGCL.js → toolEventObserver-nPwMQ5Vf.js} +1 -1
  301. package/dist/chunks/toolPool-ByCdlOak.js +1 -0
  302. package/dist/chunks/toolPool-IkNWjuk2.js +1 -0
  303. package/dist/chunks/{trustedDevice-S34i6Jc9.js → trustedDevice-BynTLVs4.js} +1 -1
  304. package/dist/chunks/{trustedDevice-DeNxe6bl.js → trustedDevice-CtL2IGDX.js} +1 -1
  305. package/dist/chunks/{ultrareviewCommand-C45bmZqN.js → ultrareviewCommand-DN-QhQ-f.js} +2 -2
  306. package/dist/chunks/undercover-CqJzV_Ar.js +1 -0
  307. package/dist/chunks/{undercover-DoUSM8d6.js → undercover-DLr5xI3K.js} +1 -1
  308. package/dist/chunks/{updateCCB-BuAm25MX.js → updateCCB-C6Ov8SNx.js} +4 -4
  309. package/dist/chunks/{upgrade-BDKg286g.js → upgrade-CVM1ffhq.js} +1 -1
  310. package/dist/chunks/upgrade-d40dVpDc.js +1 -0
  311. package/dist/chunks/{upload-CMptZXZs.js → upload-DSNwGLNd.js} +1 -1
  312. package/dist/chunks/{usage-Bw_LK9YI.js → usage-BRv8mBDf.js} +1 -1
  313. package/dist/chunks/{usage-DEWsKPXj.js → usage-GMw8NiO_.js} +1 -1
  314. package/dist/chunks/{useMainLoopModel-D0PmGDuy.js → useMainLoopModel-CEM_50a0.js} +1 -1
  315. package/dist/chunks/{useManagePlugins-B-ejJsXy.js → useManagePlugins-hCqb5F5n.js} +1 -1
  316. package/dist/chunks/{useMergedTools-B6x9qtfj.js → useMergedTools-DxvRmxVF.js} +1 -1
  317. package/dist/chunks/{useSearchInput-BpMLsxaS.js → useSearchInput-BCErnYur.js} +1 -1
  318. package/dist/chunks/useSettingsErrors-BwNeCSA6.js +1 -0
  319. package/dist/chunks/{useVoice-C3ryR2HE.js → useVoice-Cu39ifSa.js} +1 -1
  320. package/dist/chunks/{util-DWl5gjmI.js → util-DYuasrIE.js} +1 -1
  321. package/dist/chunks/utils-DSGFJaZ_.js +1 -0
  322. package/dist/chunks/{validatePlugin-8EMSASvV.js → validatePlugin-b1ec7M7n.js} +1 -1
  323. package/dist/chunks/{vim-CaZ20SrQ.js → vim-CrAzv4cM.js} +1 -1
  324. package/dist/chunks/{voice-BrnKguEV.js → voice-DKG3SYqi.js} +2 -2
  325. package/dist/chunks/{voiceModeEnabled-3eg8vSqy.js → voiceModeEnabled-By2qa3A2.js} +1 -1
  326. package/dist/chunks/voiceModeEnabled-DwYcj-FH.js +1 -0
  327. package/dist/chunks/voiceStreamSTT-DD8ulbg1.js +1 -0
  328. package/dist/chunks/{voiceStreamSTT-D7jWIYwz.js → voiceStreamSTT-DEV82xnN.js} +1 -1
  329. package/dist/chunks/{web-tools-BT3TbzG5.js → web-tools-8QRyE7va.js} +1 -1
  330. package/dist/chunks/windowsPaths-CRq9Bt5c.js +1 -0
  331. package/dist/chunks/windowsPaths-jbJ-skB_.js +1 -0
  332. package/dist/chunks/{workerRegistry-C_i5wwjL.js → workerRegistry-S7pO5khK.js} +1 -1
  333. package/dist/chunks/worktree-CfXrXsQ2.js +1 -0
  334. package/dist/chunks/{xml-DOXio8vw.js → xml-CPJXOUFt.js} +1 -1
  335. package/dist/cli.js +1 -1
  336. package/package.json +1 -1
  337. package/dist/chunks/ApproveApiKey-DUoUTxFp.js +0 -1
  338. package/dist/chunks/BackgroundTasksDialog-VKhuyQLe.js +0 -2
  339. package/dist/chunks/ClaudeMdExternalIncludesDialog-COO2W0ij.js +0 -1
  340. package/dist/chunks/ConsoleOAuthFlow-CPWq7O57.js +0 -1
  341. package/dist/chunks/DiffDialog-D0RK4t-9.js +0 -3
  342. package/dist/chunks/Doctor-0Nv3L1Oy.js +0 -3
  343. package/dist/chunks/Doctor-Ba9zhV0V.js +0 -1
  344. package/dist/chunks/Grove-DyvIToPa.js +0 -1
  345. package/dist/chunks/MCPConnectionManager-N-oJu3qn.js +0 -1
  346. package/dist/chunks/MessageSelector-D10JMnsc.js +0 -3
  347. package/dist/chunks/Messages-CQdQJ2AA.js +0 -11
  348. package/dist/chunks/PluginSettings-BBrFCSpQ.js +0 -17
  349. package/dist/chunks/QueryEngine-BSk8-8vB.js +0 -1
  350. package/dist/chunks/REPL-D-akKdFc.js +0 -1
  351. package/dist/chunks/ResumeConversation-hmIOkZ2U.js +0 -1
  352. package/dist/chunks/SearchExtraToolsTool-wDSdfnRo.js +0 -1
  353. package/dist/chunks/SentryErrorBoundary-Duyg6HeT.js +0 -1
  354. package/dist/chunks/Settings-BSbzT25q.js +0 -2
  355. package/dist/chunks/api-VMfJpk1G.js +0 -1
  356. package/dist/chunks/asciicast-DA6TudSH.js +0 -1
  357. package/dist/chunks/assistant-D7D1sqTB.js +0 -1
  358. package/dist/chunks/auth-CGdLe3rq.js +0 -1
  359. package/dist/chunks/backgroundHousekeeping-4H6yTjsj.js +0 -1
  360. package/dist/chunks/backgroundHousekeeping-zf-tDimg.js +0 -17
  361. package/dist/chunks/bridgeConfig-CTJBoASk.js +0 -1
  362. package/dist/chunks/bridgeEnabled-SMuWz3Is.js +0 -1
  363. package/dist/chunks/bridgeMain-Ct5oDosG.js +0 -68
  364. package/dist/chunks/bridgeMain-UqwOi37W.js +0 -1
  365. package/dist/chunks/caches-DKMoKTAZ.js +0 -1
  366. package/dist/chunks/changeDetector--KPj2maX.js +0 -1
  367. package/dist/chunks/channelNotification-fJgjqRMx.js +0 -1
  368. package/dist/chunks/clear-CYVCwiwu.js +0 -1
  369. package/dist/chunks/client-DvWRsIpi.js +0 -1
  370. package/dist/chunks/color-DiLtK8_L.js +0 -1
  371. package/dist/chunks/commands-BT2_ICaW.js +0 -1
  372. package/dist/chunks/commitAttribution-Bpbro1a4.js +0 -1
  373. package/dist/chunks/compact-C6xm1N5a.js +0 -3
  374. package/dist/chunks/context-noninteractive-BQDOgVUW.js +0 -1
  375. package/dist/chunks/conversation-Bt6QdGd-.js +0 -1
  376. package/dist/chunks/conversation-CBPRFDod.js +0 -1
  377. package/dist/chunks/createSession-BaHXBnfG.js +0 -1
  378. package/dist/chunks/datadog-DgYqUGa-.js +0 -1
  379. package/dist/chunks/envLessBridgeConfig-D_GCqhTu.js +0 -1
  380. package/dist/chunks/exit-DtjFIrvJ.js +0 -1
  381. package/dist/chunks/extra-usage-C4dUWLhg.js +0 -1
  382. package/dist/chunks/extraUsage-BMvDY0Sk.js +0 -1
  383. package/dist/chunks/extractMemories-DS7XXeEo.js +0 -1
  384. package/dist/chunks/fast-D1xIHYaN.js +0 -1
  385. package/dist/chunks/gates-CUAwAhPL.js +0 -1
  386. package/dist/chunks/hooks-DynUngv2.js +0 -1
  387. package/dist/chunks/inboundAttachments-Cug-8Xdy.js +0 -1
  388. package/dist/chunks/initReplBridge-DV9KhSic.js +0 -1
  389. package/dist/chunks/language-CjFs6_la.js +0 -1
  390. package/dist/chunks/loadAgentsDir-tPgCg0WD.js +0 -1
  391. package/dist/chunks/loadPluginHooks-2U3UO__Q.js +0 -1
  392. package/dist/chunks/localSearch-CxwxzM8W.js +0 -1
  393. package/dist/chunks/login-CVVFklZw.js +0 -1
  394. package/dist/chunks/logout-BYsszpXx.js +0 -1
  395. package/dist/chunks/mappers-BBkM1aA5.js +0 -1
  396. package/dist/chunks/mcp-C3jlClk0.js +0 -6
  397. package/dist/chunks/mcp-Cmw8ecKk.js +0 -1
  398. package/dist/chunks/model-VB4ItNVB.js +0 -1
  399. package/dist/chunks/permissions-DBddT2NP.js +0 -3
  400. package/dist/chunks/pluginBlocklist-DEM_RWc2.js +0 -1
  401. package/dist/chunks/pluginOperations-COyT4tHs.js +0 -2
  402. package/dist/chunks/pluginStartupCheck-DjfIaOch.js +0 -1
  403. package/dist/chunks/plugins-BanQjHmw.js +0 -4
  404. package/dist/chunks/policyLimits-D-Y_soHx.js +0 -1
  405. package/dist/chunks/poorMode-DQagHYWe.js +0 -1
  406. package/dist/chunks/processBashCommand-BLSC8o8M.js +0 -1
  407. package/dist/chunks/processSlashCommand-Ch9B-6nh.js +0 -6
  408. package/dist/chunks/prompt-BGNhFY1n.js +0 -227
  409. package/dist/chunks/prompt-CrNwH5kr.js +0 -1
  410. package/dist/chunks/prompt-dH0MMivt.js +0 -1
  411. package/dist/chunks/rate-limit-options-D-xl_9PO.js +0 -1
  412. package/dist/chunks/refresh-CO_P3WKA.js +0 -1
  413. package/dist/chunks/registry-C0zdU2Hb.js +0 -1
  414. package/dist/chunks/rename-BFAC3WLD.js +0 -1
  415. package/dist/chunks/sandbox-adapter-jX_WzvnK.js +0 -1
  416. package/dist/chunks/searchExtraTools-xPuOKDpi.js +0 -1
  417. package/dist/chunks/sessionFileAccessHooks-DiKsr7H7.js +0 -1
  418. package/dist/chunks/sessionMemory-C34-eFnJ.js +0 -1
  419. package/dist/chunks/sessionMemory-kYQnpcyG.js +0 -1
  420. package/dist/chunks/sessionMemoryUtils-CcJcgftx.js +0 -1
  421. package/dist/chunks/sessionObserver-B73s6yu8.js +0 -1
  422. package/dist/chunks/sessionStorage-BHi7PKs-.js +0 -1
  423. package/dist/chunks/setup-BJSk1czd.js +0 -3
  424. package/dist/chunks/sink-i8NmYch9.js +0 -1
  425. package/dist/chunks/sinks-3w0mLszx.js +0 -1
  426. package/dist/chunks/skillChangeDetector-1aFn40GC.js +0 -1
  427. package/dist/chunks/skillLearning-Bddmbx8E.js +0 -1
  428. package/dist/chunks/skillLearning-C-uI_jZB.js +0 -1
  429. package/dist/chunks/statusNoticeHelpers-JNibsI_v.js +0 -1
  430. package/dist/chunks/teamHelpers-D41zdxpl.js +0 -1
  431. package/dist/chunks/teammateModeSnapshot-q-bARbLL.js +0 -1
  432. package/dist/chunks/teleport-ClxQigSQ.js +0 -1
  433. package/dist/chunks/thinkback-BE8NNmAo.js +0 -1
  434. package/dist/chunks/thinkback-play-D2_n_aoQ.js +0 -1
  435. package/dist/chunks/toolPool-BLshLuvo.js +0 -1
  436. package/dist/chunks/toolPool-HYKCHxDA.js +0 -1
  437. package/dist/chunks/undercover-B4sdXe12.js +0 -1
  438. package/dist/chunks/upgrade-BiWGhm2d.js +0 -1
  439. package/dist/chunks/useSettingsErrors-DUe4k_RK.js +0 -1
  440. package/dist/chunks/utils-DP3EtI6F.js +0 -1
  441. package/dist/chunks/voiceModeEnabled-B1ARFTcz.js +0 -1
  442. package/dist/chunks/voiceStreamSTT-CONK4g-B.js +0 -1
  443. package/dist/chunks/windowsPaths-BeDSnJ23.js +0 -2
  444. package/dist/chunks/windowsPaths-ttHiMKpR.js +0 -1
  445. package/dist/chunks/worktree-CFNQKVGn.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"./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{Cc as y,Mn as b,Vt as x,cn as S,on as C,yc as ee}from"./paths-BZjPDxMm.js";import{n as w,r as T}from"./analytics-DqMQntaB.js";import{l as E,v as te}from"./git-C0IuvuIy.js";import{r as ne,t as re}from"./execa-CGue6Z3n.js";import{o as ie,s as D}from"./log-DSV4Ht5l.js";import{r as ae,t as O}from"./execFileNoThrow-azCkYhmF.js";import{l as oe,o as se}from"./stringUtils-KZoO4GUd.js";import{$T as ce,By as le,DC as ue,EC as de,Ky as fe,Ry as pe,Wy as k,aS as me,dS as A,eE as he,fS as j,zy as ge}from"./loadAgentsDir-BYWykYwn.js";import{n as _e,t as ve}from"./browser-Bt-ckCaU.js";import{t as M}from"./useKeybinding-DPOUuymz.js";import{t as N}from"./useTerminalSize-Du-EamDN.js";import{n as ye,t as be}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.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)(de,{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)(ge,{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(),le(),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{Cc as y,Mn as b,Vt as x,cn as S,on as C,yc as ee}from"./paths-nIHVpTn2.js";import{n as w,r as T}from"./analytics-DqMQntaB.js";import{l as E,v as te}from"./git-C0IuvuIy.js";import{r as ne,t as re}from"./execa-CGue6Z3n.js";import{o as ie,s as D}from"./log-DSV4Ht5l.js";import{r as ae,t as O}from"./execFileNoThrow-azCkYhmF.js";import{l as oe,o as se}from"./stringUtils-KZoO4GUd.js";import{By as ce,Hy as le,Jy as ue,Ky as k,OC as de,Vy as fe,kC as pe,mS as A,nE as me,pS as j,sS as he,tE as ge}from"./loadAgentsDir-BfEZacjM.js";import{n as _e,t as ve}from"./browser-Bt-ckCaU.js";import{t as M}from"./useKeybinding-DPOUuymz.js";import{t as N}from"./useTerminalSize-Du-EamDN.js";import{n as ye,t as be}from"./useExitOnCtrlCDWithKeybindings-BHi41Ku_.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)(de,{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)(fe,{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(),pe(),le(),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(),N(),p(),M(),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(),N(),p(),M(),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(),N(),p(),M(),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)(me,{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(),M(),q=v()}));function Ke({onSuccess:e,onCancel:t}){let[n,r]=(0,J.useState)({state:`starting`}),[o]=(0,J.useState)(()=>new ce),[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),S=i(),C=Math.max(50,S.columns-30-4);function ee(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 w(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}T(`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 E=(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),T(`tengu_oauth_error`,{error:t})}},[o,e]);(0,J.useEffect)(()=>{n.state===`starting`&&E()},[n.state,E]),(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 te(){switch(n.state){case`starting`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(k,{}),(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)(k,{}),(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=>w(e,n.url),cursorOffset:d,onChangeCursorOffset:f,columns:C})]})]});case`processing`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(k,{}),(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:ee,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:te()})]})}var J,Y,qe,Je=e((()=>{J=t(o(),1),w(),p(),fe(),j(),N(),he(),C(),ie(),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`)?(T(`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.`)):(T(`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)(j,{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(),N(),p(),M(),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)(j,{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(),N(),p(),M(),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)(j,{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(),N(),p(),M(),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)(he,{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((()=>{ce(),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(),M(),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),S=i(),C=Math.max(50,S.columns-30-4);function ee(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 w(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}T(`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 E=(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),T(`tengu_oauth_error`,{error:t})}},[o,e]);(0,J.useEffect)(()=>{n.state===`starting`&&E()},[n.state,E]),(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 te(){switch(n.state){case`starting`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(k,{}),(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)(k,{}),(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)(j,{value:s,onChange:l,onSubmit:e=>w(e,n.url),cursorOffset:d,onChangeCursorOffset:f,columns:C})]})]});case`processing`:return(0,Y.jsxs)(_,{children:[(0,Y.jsx)(k,{}),(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:ee,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:te()})]})}var J,Y,qe,Je=e((()=>{J=t(o(),1),w(),p(),ue(),A(),N(),me(),C(),ie(),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`)?(T(`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.`)):(T(`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
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,yc as n}from"./paths-BZjPDxMm.js";import{n as r,r as i}from"./analytics-DqMQntaB.js";import{n as a,t as o}from"./browser-Bt-ckCaU.js";async function s(){return i(`tengu_install_slack_app_clicked`,{}),t(e=>({...e,slackAppInstallCount:(e.slackAppInstallCount??0)+1})),await a(c)?{type:`text`,value:`Opening Slack app installation page in browser…`}:{type:`text`,value:`Couldn't open browser. Visit: ${c}`}}var c;e((()=>{r(),o(),n(),c=`https://slack.com/marketplace/A08SF47R6P4-claude`}))();export{s as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,yc as n}from"./paths-nIHVpTn2.js";import{n as r,r as i}from"./analytics-DqMQntaB.js";import{n as a,t as o}from"./browser-Bt-ckCaU.js";async function s(){return i(`tengu_install_slack_app_clicked`,{}),t(e=>({...e,slackAppInstallCount:(e.slackAppInstallCount??0)+1})),await a(c)?{type:`text`,value:`Opening Slack app installation page in browser…`}:{type:`text`,value:`Couldn't open browser. Visit: ${c}`}}var c;e((()=>{r(),o(),n(),c=`https://slack.com/marketplace/A08SF47R6P4-claude`}))();export{s as call};
@@ -1,6 +1,6 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{n as o,o as s,r as c,x as ee}from"./esm-CJlBxjtx.js";import{Q as te,Z as ne,_ as l,at as re,c as u,i as ie,j as d,n as ae,o as f,r as oe,t as p}from"./esm-DcdOXSzi.js";import{n as m,t as se}from"./esm-BGQPWnJy.js";import{a as h,i as ce,l as le,n as ue,r as de}from"./esm-QgL6y---.js";import{n as fe,t as pe}from"./axios-DhfaybwJ.js";import{$ as g,$n as _,Dr as me,Gt as v,Pn as y,U as he,cn as b,ir as x,nt as ge}from"./state-sIHsFpDu.js";import{At as S,Cc as _e,Qt as ve,Tt as ye,ac as be,an as xe,bt as C,dc as w,dn as T,dt as Se,ft as E,jt as D,mt as O,no as Ce,on as k,oo as we,pt as Te,sn as Ee,tn as A,wt as j,yc as M}from"./paths-BZjPDxMm.js";import{E as N,J as De,O as P,Q as F,U as I,Z as Oe,l as L,p as R,s as ke,z}from"./debug-otxXY3j-.js";import{d as Ae,f as je,o as B,s as V}from"./log-DSV4Ht5l.js";import{a as Me,i as Ne,o as Pe}from"./platform-mh9ypxS8.js";import{r as Fe,t as Ie}from"./memoize-DJ1XCN-z.js";import{i as Le,n as Re}from"./startupProfiler-CBcN1Chw.js";import{b as H,d as ze,g as Be,m as Ve,s as He,u as Ue,v as U,x as We,y as Ge}from"./proxy-CF7ZDxaW.js";import{_ as Ke,b as qe,c as Je,l as Ye,r as W,v as Xe,y as Ze}from"./sessionTracing-81-RIJBo.js";import{a as G,i as K,r as Qe,t as $e}from"./esm-vlR7mK5b.js";async function et(){let e=C();if(e.error)throw Error(`Auth error: ${e.error}`);let t={"Content-Type":`application/json`,"User-Agent":S(),...e.headers};return(await fe.get(`https://api.anthropic.com/api/claude_code/organizations/metrics_enabled`,{headers:t,timeout:5e3})).data}async function tt(){if(je())return{enabled:!1,hasError:!1};try{let e=await ye(et,{also403Revoked:!0});return R(`Metrics opt-out API response: enabled=${e.metrics_logging_enabled}`),{enabled:e.metrics_logging_enabled,hasError:!1}}catch(e){return R(`Failed to check metrics opt-out status: ${z(e)}`),V(e),{enabled:!1,hasError:!0}}}async function nt(){let e=await at();if(e.hasError)return e;let t=w().metricsStatusCache;return t!==void 0&&t.enabled===e.enabled&&Date.now()-t.timestamp<q||_e(t=>({...t,metricsStatusCache:{enabled:e.enabled,timestamp:Date.now()}})),e}async function rt(){if(T()&&!xe())return{enabled:!1,hasError:!1};let e=w().metricsStatusCache;return e?(Date.now()-e.timestamp>q&&nt().catch(V),{enabled:e.enabled,hasError:!1}):nt()}var it,q,at,ot=e((()=>{pe(),k(),M(),L(),I(),j(),B(),Ie(),Ae(),D(),it=3600*1e3,q=1440*60*1e3,at=Fe(tt,it)})),st,ct=e((()=>{u(),ue(),pe(),ot(),b(),k(),M(),L(),I(),j(),B(),N(),D(),i(),st=class{constructor(e={}){a(this,`endpoint`,void 0),a(this,`timeout`,void 0),a(this,`pendingExports`,[]),a(this,`isShutdown`,!1),process.env.USER_TYPE===`ant`&&process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT?this.endpoint=process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT+`/api/claude_code/metrics`:this.endpoint=`https://api.anthropic.com/api/claude_code/metrics`,this.timeout=e.timeout||5e3}async export(e,t){if(this.isShutdown){t({code:l.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{if(!(be()||he())){R(`BigQuery metrics export: trust not established, skipping`),t({code:l.SUCCESS});return}if(!(await rt()).enabled){R(`Metrics export disabled by organization setting`),t({code:l.SUCCESS});return}let n=this.transformMetricsForInternal(e),r=C();if(r.error){R(`Metrics export failed: ${r.error}`),t({code:l.FAILED,error:Error(r.error)});return}let i={"Content-Type":`application/json`,"User-Agent":S(),...r.headers},a=await fe.post(this.endpoint,n,{timeout:this.timeout,headers:i});R(`BigQuery metrics exported successfully`),R(`BigQuery API Response: ${P(a.data,null,2)}`),t({code:l.SUCCESS})}catch(e){R(`BigQuery metrics export failed: ${z(e)}`),V(e),t({code:l.FAILED,error:De(e)})}}transformMetricsForInternal(e){let t=e.resource.attributes,n={"service.name":t[`service.name`]||`claude-code`,"service.version":t[`service.version`]||`unknown`,"os.type":t[`os.type`]||`unknown`,"os.version":t[`os.version`]||`unknown`,"host.arch":t[`host.arch`]||`unknown`,"aggregation.temporality":this.selectAggregationTemporality()===le.DELTA?`delta`:`cumulative`};if(t[`wsl.version`]&&(n[`wsl.version`]=t[`wsl.version`]),T()){n[`user.customer_type`]=`claude_ai`;let e=A();e&&(n[`user.subscription_type`]=e)}else n[`user.customer_type`]=`api`;return{resource_attributes:n,metrics:e.scopeMetrics.flatMap(e=>e.metrics.map(e=>({name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit,data_points:this.extractDataPoints(e)})))}}extractDataPoints(e){return(e.dataPoints||[]).filter(e=>typeof e.value==`number`).map(e=>({attributes:this.convertAttributes(e.attributes),value:e.value,timestamp:this.hrTimeToISOString(e.endTime||e.startTime||[Date.now()/1e3,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),R(`BigQuery metrics exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),R(`BigQuery metrics exporter flush complete`)}convertAttributes(e){let t={};if(e)for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return t}hrTimeToISOString(e){let[t,n]=e;return new Date(t*1e3+n/1e6).toISOString()}selectAggregationTemporality(){return le.DELTA}}})),lt,ut=e((()=>{L(),B(),lt=class{error(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag error: ${e}`,{level:`error`})}warn(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag warn: ${e}`,{level:`warn`})}info(e,...t){}debug(e,...t){}verbose(e,...t){}}}));function J(e,t){return new Promise((n,r)=>{setTimeout((e,t)=>e(new $(t)),e,r,t).unref()})}function dt(){process.env.USER_TYPE===`ant`&&(process.env.ANT_OTEL_METRICS_EXPORTER&&(process.env.OTEL_METRICS_EXPORTER=process.env.ANT_OTEL_METRICS_EXPORTER),process.env.ANT_OTEL_LOGS_EXPORTER&&(process.env.OTEL_LOGS_EXPORTER=process.env.ANT_OTEL_LOGS_EXPORTER),process.env.ANT_OTEL_TRACES_EXPORTER&&(process.env.OTEL_TRACES_EXPORTER=process.env.ANT_OTEL_TRACES_EXPORTER),process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL&&(process.env.OTEL_EXPORTER_OTLP_PROTOCOL=process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL),process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT&&(process.env.OTEL_EXPORTER_OTLP_ENDPOINT=process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT),process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS&&(process.env.OTEL_EXPORTER_OTLP_HEADERS=process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS)),process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE||(process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=`delta`)}function Y(e){return(e||``).trim().split(`,`).filter(Boolean).map(e=>e.trim()).filter(e=>e!==`none`)}async function ft(){let e=Y(process.env.OTEL_METRICS_EXPORTER),n=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||St.toString(),10),r=[];for(let n of e)if(n===`console`){let e=new ce,t=e.export.bind(e);e.export=(e,n)=>(e.resource&&e.resource.attributes&&(R(`
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{n as o,o as s,r as c,x as ee}from"./esm-CJlBxjtx.js";import{Q as te,Z as ne,_ as l,at as re,c as u,i as ie,j as d,n as ae,o as f,r as oe,t as p}from"./esm-DcdOXSzi.js";import{n as m,t as se}from"./esm-BGQPWnJy.js";import{a as h,i as ce,l as le,n as ue,r as de}from"./esm-QgL6y---.js";import{n as fe,t as pe}from"./axios-DhfaybwJ.js";import{$ as g,$n as _,Dr as me,Gt as v,Pn as y,U as he,cn as b,ir as x,nt as ge}from"./state-sIHsFpDu.js";import{At as S,Cc as _e,Qt as ve,Tt as ye,ac as be,an as xe,bt as C,dc as w,dn as T,dt as Se,ft as E,jt as D,mt as O,no as Ce,on as k,oo as we,pt as Te,sn as Ee,tn as A,wt as j,yc as M}from"./paths-nIHVpTn2.js";import{E as N,J as De,O as P,Q as F,U as I,Z as Oe,l as L,p as R,s as ke,z}from"./debug-otxXY3j-.js";import{d as Ae,f as je,o as B,s as V}from"./log-DSV4Ht5l.js";import{a as Me,i as Ne,o as Pe}from"./platform-mh9ypxS8.js";import{r as Fe,t as Ie}from"./memoize-DJ1XCN-z.js";import{i as Le,n as Re}from"./startupProfiler-CBcN1Chw.js";import{b as H,d as ze,g as Be,m as Ve,s as He,u as Ue,v as U,x as We,y as Ge}from"./proxy-CF7ZDxaW.js";import{_ as Ke,b as qe,c as Je,l as Ye,r as W,v as Xe,y as Ze}from"./sessionTracing-DuQ3kbq6.js";import{a as G,i as K,r as Qe,t as $e}from"./esm-vlR7mK5b.js";async function et(){let e=C();if(e.error)throw Error(`Auth error: ${e.error}`);let t={"Content-Type":`application/json`,"User-Agent":S(),...e.headers};return(await fe.get(`https://api.anthropic.com/api/claude_code/organizations/metrics_enabled`,{headers:t,timeout:5e3})).data}async function tt(){if(je())return{enabled:!1,hasError:!1};try{let e=await ye(et,{also403Revoked:!0});return R(`Metrics opt-out API response: enabled=${e.metrics_logging_enabled}`),{enabled:e.metrics_logging_enabled,hasError:!1}}catch(e){return R(`Failed to check metrics opt-out status: ${z(e)}`),V(e),{enabled:!1,hasError:!0}}}async function nt(){let e=await at();if(e.hasError)return e;let t=w().metricsStatusCache;return t!==void 0&&t.enabled===e.enabled&&Date.now()-t.timestamp<q||_e(t=>({...t,metricsStatusCache:{enabled:e.enabled,timestamp:Date.now()}})),e}async function rt(){if(T()&&!xe())return{enabled:!1,hasError:!1};let e=w().metricsStatusCache;return e?(Date.now()-e.timestamp>q&&nt().catch(V),{enabled:e.enabled,hasError:!1}):nt()}var it,q,at,ot=e((()=>{pe(),k(),M(),L(),I(),j(),B(),Ie(),Ae(),D(),it=3600*1e3,q=1440*60*1e3,at=Fe(tt,it)})),st,ct=e((()=>{u(),ue(),pe(),ot(),b(),k(),M(),L(),I(),j(),B(),N(),D(),i(),st=class{constructor(e={}){a(this,`endpoint`,void 0),a(this,`timeout`,void 0),a(this,`pendingExports`,[]),a(this,`isShutdown`,!1),process.env.USER_TYPE===`ant`&&process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT?this.endpoint=process.env.ANT_CLAUDE_CODE_METRICS_ENDPOINT+`/api/claude_code/metrics`:this.endpoint=`https://api.anthropic.com/api/claude_code/metrics`,this.timeout=e.timeout||5e3}async export(e,t){if(this.isShutdown){t({code:l.FAILED,error:Error(`Exporter has been shutdown`)});return}let n=this.doExport(e,t);this.pendingExports.push(n),n.finally(()=>{let e=this.pendingExports.indexOf(n);e>-1&&this.pendingExports.splice(e,1)})}async doExport(e,t){try{if(!(be()||he())){R(`BigQuery metrics export: trust not established, skipping`),t({code:l.SUCCESS});return}if(!(await rt()).enabled){R(`Metrics export disabled by organization setting`),t({code:l.SUCCESS});return}let n=this.transformMetricsForInternal(e),r=C();if(r.error){R(`Metrics export failed: ${r.error}`),t({code:l.FAILED,error:Error(r.error)});return}let i={"Content-Type":`application/json`,"User-Agent":S(),...r.headers},a=await fe.post(this.endpoint,n,{timeout:this.timeout,headers:i});R(`BigQuery metrics exported successfully`),R(`BigQuery API Response: ${P(a.data,null,2)}`),t({code:l.SUCCESS})}catch(e){R(`BigQuery metrics export failed: ${z(e)}`),V(e),t({code:l.FAILED,error:De(e)})}}transformMetricsForInternal(e){let t=e.resource.attributes,n={"service.name":t[`service.name`]||`claude-code`,"service.version":t[`service.version`]||`unknown`,"os.type":t[`os.type`]||`unknown`,"os.version":t[`os.version`]||`unknown`,"host.arch":t[`host.arch`]||`unknown`,"aggregation.temporality":this.selectAggregationTemporality()===le.DELTA?`delta`:`cumulative`};if(t[`wsl.version`]&&(n[`wsl.version`]=t[`wsl.version`]),T()){n[`user.customer_type`]=`claude_ai`;let e=A();e&&(n[`user.subscription_type`]=e)}else n[`user.customer_type`]=`api`;return{resource_attributes:n,metrics:e.scopeMetrics.flatMap(e=>e.metrics.map(e=>({name:e.descriptor.name,description:e.descriptor.description,unit:e.descriptor.unit,data_points:this.extractDataPoints(e)})))}}extractDataPoints(e){return(e.dataPoints||[]).filter(e=>typeof e.value==`number`).map(e=>({attributes:this.convertAttributes(e.attributes),value:e.value,timestamp:this.hrTimeToISOString(e.endTime||e.startTime||[Date.now()/1e3,0])}))}async shutdown(){this.isShutdown=!0,await this.forceFlush(),R(`BigQuery metrics exporter shutdown complete`)}async forceFlush(){await Promise.all(this.pendingExports),R(`BigQuery metrics exporter flush complete`)}convertAttributes(e){let t={};if(e)for(let[n,r]of Object.entries(e))r!=null&&(t[n]=String(r));return t}hrTimeToISOString(e){let[t,n]=e;return new Date(t*1e3+n/1e6).toISOString()}selectAggregationTemporality(){return le.DELTA}}})),lt,ut=e((()=>{L(),B(),lt=class{error(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag error: ${e}`,{level:`error`})}warn(e,...t){V(Error(e)),R(`[3P telemetry] OTEL diag warn: ${e}`,{level:`warn`})}info(e,...t){}debug(e,...t){}verbose(e,...t){}}}));function J(e,t){return new Promise((n,r)=>{setTimeout((e,t)=>e(new $(t)),e,r,t).unref()})}function dt(){process.env.USER_TYPE===`ant`&&(process.env.ANT_OTEL_METRICS_EXPORTER&&(process.env.OTEL_METRICS_EXPORTER=process.env.ANT_OTEL_METRICS_EXPORTER),process.env.ANT_OTEL_LOGS_EXPORTER&&(process.env.OTEL_LOGS_EXPORTER=process.env.ANT_OTEL_LOGS_EXPORTER),process.env.ANT_OTEL_TRACES_EXPORTER&&(process.env.OTEL_TRACES_EXPORTER=process.env.ANT_OTEL_TRACES_EXPORTER),process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL&&(process.env.OTEL_EXPORTER_OTLP_PROTOCOL=process.env.ANT_OTEL_EXPORTER_OTLP_PROTOCOL),process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT&&(process.env.OTEL_EXPORTER_OTLP_ENDPOINT=process.env.ANT_OTEL_EXPORTER_OTLP_ENDPOINT),process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS&&(process.env.OTEL_EXPORTER_OTLP_HEADERS=process.env.ANT_OTEL_EXPORTER_OTLP_HEADERS)),process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE||(process.env.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE=`delta`)}function Y(e){return(e||``).trim().split(`,`).filter(Boolean).map(e=>e.trim()).filter(e=>e!==`none`)}async function ft(){let e=Y(process.env.OTEL_METRICS_EXPORTER),n=parseInt(process.env.OTEL_METRIC_EXPORT_INTERVAL||St.toString(),10),r=[];for(let n of e)if(n===`console`){let e=new ce,t=e.export.bind(e);e.export=(e,n)=>(e.resource&&e.resource.attributes&&(R(`
2
2
  === Resource Attributes ===`),R(P(e.resource.attributes)),R(`===========================
3
- `)),t(e,n)),r.push(e)}else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=X();switch(e){case`grpc`:{let{OTLPMetricExporter:e}=await import(`./src-BRC_BuUP.js`).then(e=>t(e.default,1));r.push(new e);break}case`http/json`:{let{OTLPMetricExporter:e}=await import(`./esm-B2HIF0XY.js`);r.push(new e(n));break}case`http/protobuf`:{let{OTLPMetricExporter:e}=await import(`./esm-DxPW7qPs.js`);r.push(new e(n));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else if(n===`prometheus`){let{PrometheusExporter:e}=await import(`./src-DsMd9Q9e.js`).then(e=>t(e.default,1));r.push(new e)}else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`);return r.map(e=>`export`in e?new h({exporter:e,exportIntervalMillis:n}):e)}async function pt(){let e=Y(process.env.OTEL_LOGS_EXPORTER),n=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;R(`[3P telemetry] getOtlpLogExporters: types=${P(e)}, protocol=${n}, endpoint=${r}`);let i=[];for(let r of e)if(r===`console`)i.push(new Te);else if(r===`otlp`){let e=X();switch(n){case`grpc`:{let{OTLPLogExporter:e}=await import(`./src-CYLfL70h.js`).then(e=>t(e.default,1));i.push(new e);break}case`http/json`:{let{OTLPLogExporter:t}=await import(`./esm--xjzB1hI.js`);i.push(new t(e));break}case`http/protobuf`:{let{OTLPLogExporter:t}=await import(`./esm-v0kPjgVS.js`);i.push(new t(e));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${r}`);return i}async function mt(){let e=Y(process.env.OTEL_TRACES_EXPORTER),n=[];for(let r of e)if(r===`console`)n.push(new Qe);else if(r===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=X();switch(e){case`grpc`:{let{OTLPTraceExporter:e}=await import(`./src-DJXCzwyJ.js`).then(e=>t(e.default,1));n.push(new e);break}case`http/json`:{let{OTLPTraceExporter:e}=await import(`./esm-C97WL9nC.js`);n.push(new e(r));break}case`http/protobuf`:{let{OTLPTraceExporter:e}=await import(`./esm-FBUWr3vI.js`);n.push(new e(r));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${r}`);return n}function ht(){return r(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function gt(){return new h({exporter:new st,exportIntervalMillis:300*1e3})}function _t(){let e=A(),t=T()&&(e===`enterprise`||e===`team`);return Ee()||t}async function vt(e){let t=process.env.BETA_TRACING_ENDPOINT;if(!t)return;let[{OTLPTraceExporter:n},{OTLPLogExporter:r}]=await Promise.all([import(`./esm-C97WL9nC.js`),import(`./esm--xjzB1hI.js`)]),i={url:`${t}/v1/traces`},a={url:`${t}/v1/logs`},o=new K({resource:e,spanProcessors:[new G(new n(i),{scheduledDelayMillis:Q})]});c.setGlobalTracerProvider(o),me(o);let s=new O({resource:e,processors:[new E(new r(a),{scheduledDelayMillis:Z})]});m.setGlobalLoggerProvider(s),_(s),y(m.getLogger(`com.anthropic.claude_code.events`,`2.8.1`)),process.on(`beforeExit`,async()=>{await s?.forceFlush(),await o?.forceFlush()}),process.on(`exit`,()=>{s?.forceFlush(),o?.forceFlush()})}async function yt(){if(Le(`telemetry_init_start`),dt(),ke())for(let e of[`OTEL_METRICS_EXPORTER`,`OTEL_LOGS_EXPORTER`,`OTEL_TRACES_EXPORTER`]){let t=process.env[e];t?.includes(`console`)&&(process.env[e]=t.split(`,`).map(e=>e.trim()).filter(e=>e!==`console`).join(`,`))}s.setLogger(new lt,ee.ERROR),qe();let e=[],t=ht();R(`[3P telemetry] isTelemetryEnabled=${t} (CLAUDE_CODE_ENABLE_TELEMETRY=${process.env.CLAUDE_CODE_ENABLE_TELEMETRY})`),t&&e.push(...await ft()),_t()&&e.push(gt());let n=Ne(),r={[ne]:`claude-code`,[te]:`2.8.1`};if(n===`wsl`){let e=Me();e&&(r[`wsl.version`]=e)}let i=f(r),a=f(ae.detect().attributes||{}),o=oe.detect(),l=f(o.attributes?.[`host.arch`]?{[re]:o.attributes[re]}:{}),u=f(ie.detect().attributes||{}),d=i.merge(a).merge(l).merge(u);if(Xe()){vt(d).catch(e=>R(`Beta tracing init failed: ${e}`,{level:`error`}));let t=new de({resource:d,views:[],readers:e});return x(t),F(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let n=g(),r=v(),i=[t.shutdown()];n&&i.push(n.forceFlush().then(()=>n.shutdown())),r&&i.push(r.forceFlush().then(()=>r.shutdown())),await Promise.race([Promise.all(i),J(e,`OpenTelemetry shutdown timeout`)])}catch{}}),t.getMeter(`com.anthropic.claude_code`,`2.8.1`)}let p=new de({resource:d,views:[],readers:e});if(x(p),t){let e=await pt();if(R(`[3P telemetry] Created ${e.length} log exporter(s)`),e.length>0){let t=new O({resource:d,processors:e.map(e=>new E(e,{scheduledDelayMillis:parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||Z.toString(),10)}))});m.setGlobalLoggerProvider(t),_(t),y(m.getLogger(`com.anthropic.claude_code.events`,`2.8.1`)),R(`[3P telemetry] Event logger set successfully`),process.on(`beforeExit`,async()=>{await t?.forceFlush(),await v()?.forceFlush()}),process.on(`exit`,()=>{t?.forceFlush(),v()?.forceFlush()})}}if(t&&Ye()){let e=await mt();if(e.length>0){let t=new K({resource:d,spanProcessors:e.map(e=>new G(e,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||Q.toString(),10)}))});c.setGlobalTracerProvider(t),me(t)}}return F(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let t=[p.shutdown()],n=g();n&&t.push(n.shutdown());let r=v();r&&t.push(r.shutdown()),await Promise.race([Promise.all(t),J(e,`OpenTelemetry shutdown timeout`)])}catch(t){throw t instanceof Error&&t.message.includes(`timeout`)&&R(`
3
+ `)),t(e,n)),r.push(e)}else if(n===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_METRICS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),n=X();switch(e){case`grpc`:{let{OTLPMetricExporter:e}=await import(`./src-BRC_BuUP.js`).then(e=>t(e.default,1));r.push(new e);break}case`http/json`:{let{OTLPMetricExporter:e}=await import(`./esm-B2HIF0XY.js`);r.push(new e(n));break}case`http/protobuf`:{let{OTLPMetricExporter:e}=await import(`./esm-DxPW7qPs.js`);r.push(new e(n));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else if(n===`prometheus`){let{PrometheusExporter:e}=await import(`./src-DsMd9Q9e.js`).then(e=>t(e.default,1));r.push(new e)}else throw Error(`Unknown exporter type set in OTEL_EXPORTER_OTLP_METRICS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`);return r.map(e=>`export`in e?new h({exporter:e,exportIntervalMillis:n}):e)}async function pt(){let e=Y(process.env.OTEL_LOGS_EXPORTER),n=process.env.OTEL_EXPORTER_OTLP_LOGS_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;R(`[3P telemetry] getOtlpLogExporters: types=${P(e)}, protocol=${n}, endpoint=${r}`);let i=[];for(let r of e)if(r===`console`)i.push(new Te);else if(r===`otlp`){let e=X();switch(n){case`grpc`:{let{OTLPLogExporter:e}=await import(`./src-CYLfL70h.js`).then(e=>t(e.default,1));i.push(new e);break}case`http/json`:{let{OTLPLogExporter:t}=await import(`./esm--xjzB1hI.js`);i.push(new t(e));break}case`http/protobuf`:{let{OTLPLogExporter:t}=await import(`./esm-v0kPjgVS.js`);i.push(new t(e));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_LOGS_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${n}`)}}else throw Error(`Unknown exporter type set in OTEL_LOGS_EXPORTER env var: ${r}`);return i}async function mt(){let e=Y(process.env.OTEL_TRACES_EXPORTER),n=[];for(let r of e)if(r===`console`)n.push(new Qe);else if(r===`otlp`){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL?.trim()||process.env.OTEL_EXPORTER_OTLP_PROTOCOL?.trim(),r=X();switch(e){case`grpc`:{let{OTLPTraceExporter:e}=await import(`./src-DJXCzwyJ.js`).then(e=>t(e.default,1));n.push(new e);break}case`http/json`:{let{OTLPTraceExporter:e}=await import(`./esm-C97WL9nC.js`);n.push(new e(r));break}case`http/protobuf`:{let{OTLPTraceExporter:e}=await import(`./esm-FBUWr3vI.js`);n.push(new e(r));break}default:throw Error(`Unknown protocol set in OTEL_EXPORTER_OTLP_TRACES_PROTOCOL or OTEL_EXPORTER_OTLP_PROTOCOL env var: ${e}`)}}else throw Error(`Unknown exporter type set in OTEL_TRACES_EXPORTER env var: ${r}`);return n}function ht(){return r(process.env.CLAUDE_CODE_ENABLE_TELEMETRY)}function gt(){return new h({exporter:new st,exportIntervalMillis:300*1e3})}function _t(){let e=A(),t=T()&&(e===`enterprise`||e===`team`);return Ee()||t}async function vt(e){let t=process.env.BETA_TRACING_ENDPOINT;if(!t)return;let[{OTLPTraceExporter:n},{OTLPLogExporter:r}]=await Promise.all([import(`./esm-C97WL9nC.js`),import(`./esm--xjzB1hI.js`)]),i={url:`${t}/v1/traces`},a={url:`${t}/v1/logs`},o=new K({resource:e,spanProcessors:[new G(new n(i),{scheduledDelayMillis:Q})]});c.setGlobalTracerProvider(o),me(o);let s=new O({resource:e,processors:[new E(new r(a),{scheduledDelayMillis:Z})]});m.setGlobalLoggerProvider(s),_(s),y(m.getLogger(`com.anthropic.claude_code.events`,`2.8.3`)),process.on(`beforeExit`,async()=>{await s?.forceFlush(),await o?.forceFlush()}),process.on(`exit`,()=>{s?.forceFlush(),o?.forceFlush()})}async function yt(){if(Le(`telemetry_init_start`),dt(),ke())for(let e of[`OTEL_METRICS_EXPORTER`,`OTEL_LOGS_EXPORTER`,`OTEL_TRACES_EXPORTER`]){let t=process.env[e];t?.includes(`console`)&&(process.env[e]=t.split(`,`).map(e=>e.trim()).filter(e=>e!==`console`).join(`,`))}s.setLogger(new lt,ee.ERROR),qe();let e=[],t=ht();R(`[3P telemetry] isTelemetryEnabled=${t} (CLAUDE_CODE_ENABLE_TELEMETRY=${process.env.CLAUDE_CODE_ENABLE_TELEMETRY})`),t&&e.push(...await ft()),_t()&&e.push(gt());let n=Ne(),r={[ne]:`claude-code`,[te]:`2.8.3`};if(n===`wsl`){let e=Me();e&&(r[`wsl.version`]=e)}let i=f(r),a=f(ae.detect().attributes||{}),o=oe.detect(),l=f(o.attributes?.[`host.arch`]?{[re]:o.attributes[re]}:{}),u=f(ie.detect().attributes||{}),d=i.merge(a).merge(l).merge(u);if(Xe()){vt(d).catch(e=>R(`Beta tracing init failed: ${e}`,{level:`error`}));let t=new de({resource:d,views:[],readers:e});return x(t),F(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let n=g(),r=v(),i=[t.shutdown()];n&&i.push(n.forceFlush().then(()=>n.shutdown())),r&&i.push(r.forceFlush().then(()=>r.shutdown())),await Promise.race([Promise.all(i),J(e,`OpenTelemetry shutdown timeout`)])}catch{}}),t.getMeter(`com.anthropic.claude_code`,`2.8.3`)}let p=new de({resource:d,views:[],readers:e});if(x(p),t){let e=await pt();if(R(`[3P telemetry] Created ${e.length} log exporter(s)`),e.length>0){let t=new O({resource:d,processors:e.map(e=>new E(e,{scheduledDelayMillis:parseInt(process.env.OTEL_LOGS_EXPORT_INTERVAL||Z.toString(),10)}))});m.setGlobalLoggerProvider(t),_(t),y(m.getLogger(`com.anthropic.claude_code.events`,`2.8.3`)),R(`[3P telemetry] Event logger set successfully`),process.on(`beforeExit`,async()=>{await t?.forceFlush(),await v()?.forceFlush()}),process.on(`exit`,()=>{t?.forceFlush(),v()?.forceFlush()})}}if(t&&Ye()){let e=await mt();if(e.length>0){let t=new K({resource:d,spanProcessors:e.map(e=>new G(e,{scheduledDelayMillis:parseInt(process.env.OTEL_TRACES_EXPORT_INTERVAL||Q.toString(),10)}))});c.setGlobalTracerProvider(t),me(t)}}return F(async()=>{let e=parseInt(process.env.CLAUDE_CODE_OTEL_SHUTDOWN_TIMEOUT_MS||`2000`,10);try{W();let t=[p.shutdown()],n=g();n&&t.push(n.shutdown());let r=v();r&&t.push(r.shutdown()),await Promise.race([Promise.all(t),J(e,`OpenTelemetry shutdown timeout`)])}catch(t){throw t instanceof Error&&t.message.includes(`timeout`)&&R(`
4
4
  OpenTelemetry telemetry flush timed out after ${e}ms
5
5
 
6
6
  To resolve this issue, you can:
@@ -9,4 +9,4 @@ To resolve this issue, you can:
9
9
  3. Disable OpenTelemetry by unsetting CLAUDE_CODE_ENABLE_TELEMETRY env var
10
10
 
11
11
  Current timeout: ${e}ms
12
- `,{level:`error`}),t}}),p.getMeter(`com.anthropic.claude_code`,`2.8.1`)}async function bt(){let e=ge();if(!e)return;let t=parseInt(process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS||`5000`,10);try{let n=[e.forceFlush()],r=g();r&&n.push(r.forceFlush());let i=v();i&&n.push(i.forceFlush()),await Promise.race([Promise.all(n),J(t,`OpenTelemetry flush timeout`)]),R(`Telemetry flushed successfully`)}catch(e){e instanceof $?R(`Telemetry flush timed out after ${t}ms. Some metrics may not be exported.`,{level:`warn`}):R(`Telemetry flush failed: ${z(e)}`,{level:`error`})}}function xt(){let e={},t=process.env.OTEL_EXPORTER_OTLP_HEADERS;if(t)for(let n of t.split(`,`)){let[t,...r]=n.split(`=`);t&&r.length>0&&(e[t.trim()]=r.join(`=`).trim())}return e}function X(){let e=He(),t=Ve(),n=Ce(),r={},i=xt();n?.otelHeadersHelper?r.headers=async()=>{let e=ve();return{...i,...e}}:Object.keys(i).length>0&&(r.headers=async()=>i);let a=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!e||a&&ze(a)){let e=U();return(t||e)&&(r.httpAgentOptions={...t,...e&&{ca:e}}),r}let o=U();return r.httpAgentOptions=n=>t||o?new H(e,{...t&&{cert:t.cert,key:t.key,passphrase:t.passphrase},...o&&{ca:o}}):new H(e),r}var St,Z,Q,$;e((()=>{o(),se(),p(),Se(),ue(),$e(),d(),We(),b(),k(),Pe(),Ge(),Oe(),L(),n(),I(),Be(),Ue(),we(),N(),Re(),Ke(),ct(),ut(),Ze(),Je(),St=6e4,Z=5e3,Q=5e3,$=class extends Error{}}))();export{bt as flushTelemetry,yt as initializeTelemetry};
12
+ `,{level:`error`}),t}}),p.getMeter(`com.anthropic.claude_code`,`2.8.3`)}async function bt(){let e=ge();if(!e)return;let t=parseInt(process.env.CLAUDE_CODE_OTEL_FLUSH_TIMEOUT_MS||`5000`,10);try{let n=[e.forceFlush()],r=g();r&&n.push(r.forceFlush());let i=v();i&&n.push(i.forceFlush()),await Promise.race([Promise.all(n),J(t,`OpenTelemetry flush timeout`)]),R(`Telemetry flushed successfully`)}catch(e){e instanceof $?R(`Telemetry flush timed out after ${t}ms. Some metrics may not be exported.`,{level:`warn`}):R(`Telemetry flush failed: ${z(e)}`,{level:`error`})}}function xt(){let e={},t=process.env.OTEL_EXPORTER_OTLP_HEADERS;if(t)for(let n of t.split(`,`)){let[t,...r]=n.split(`=`);t&&r.length>0&&(e[t.trim()]=r.join(`=`).trim())}return e}function X(){let e=He(),t=Ve(),n=Ce(),r={},i=xt();n?.otelHeadersHelper?r.headers=async()=>{let e=ve();return{...i,...e}}:Object.keys(i).length>0&&(r.headers=async()=>i);let a=process.env.OTEL_EXPORTER_OTLP_ENDPOINT;if(!e||a&&ze(a)){let e=U();return(t||e)&&(r.httpAgentOptions={...t,...e&&{ca:e}}),r}let o=U();return r.httpAgentOptions=n=>t||o?new H(e,{...t&&{cert:t.cert,key:t.key,passphrase:t.passphrase},...o&&{ca:o}}):new H(e),r}var St,Z,Q,$;e((()=>{o(),se(),p(),Se(),ue(),$e(),d(),We(),b(),k(),Pe(),Ge(),Oe(),L(),n(),I(),Be(),Ue(),we(),N(),Re(),Ke(),ct(),ut(),Ze(),Je(),St=6e4,Z=5e3,Q=5e3,$=class extends Error{}}))();export{bt as flushTelemetry,yt as initializeTelemetry};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,n){let r=n?n.trim().split(/\s+/):[],i=r[0]||`list`,a=[],o=console.log,s=console.error;console.log=(...e)=>a.push(e.map(String).join(` `)),console.error=(...e)=>a.push(e.map(String).join(` `));try{let{templatesMain:e}=await import(`./templateJobs-C6D7GC-Q.js`);await e([i,...r.slice(1)])}finally{console.log=o,console.error=s}return e(a.join(`
1
+ import{n as e}from"./chunk-DR8-3Aex.js";async function t(e,t,n){let r=n?n.trim().split(/\s+/):[],i=r[0]||`list`,a=[],o=console.log,s=console.error;console.log=(...e)=>a.push(e.map(String).join(` `)),console.error=(...e)=>a.push(e.map(String).join(` `));try{let{templatesMain:e}=await import(`./templateJobs-1oMC9yLQ.js`);await e([i,...r.slice(1)])}finally{console.log=o,console.error=s}return e(a.join(`
2
2
  `)||`Done.`,{display:`system`}),null}e((()=>{}))();export{t as call};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{B as t,E as n,O as r,U as i}from"./debug-otxXY3j-.js";import{FT as a,HT as o,IT as s,PT as c,UT as l,VT as u,WT as d,zT as f}from"./loadAgentsDir-BYWykYwn.js";import{r as p,t as m}from"./promptEditor-U03qQWbq.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(f.map(e=>o(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(o(r))||(n[r]=i);return{context:e.context,bindings:n}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return r({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:v(l)},null,2)+`
2
- `}var b=e((()=>{n(),d(),u()}));async function x(){if(!s())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=c(),n=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(t(e)===`EEXIST`)n=!0;else throw e}let r=await m(e);return r.error?{type:`text`,value:`${n?`Opened`:`Created`} ${e}. Could not open in editor: ${r.error}`}:{type:`text`,value:n?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{a(),b(),i(),p()}))();export{x as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{B as t,E as n,O as r,U as i}from"./debug-otxXY3j-.js";import{GT as a,IT as o,KT as s,LT as c,RT as l,UT as u,VT as d,WT as f}from"./loadAgentsDir-BfEZacjM.js";import{r as p,t as m}from"./promptEditor-BkHY_Vzb.js";import{dirname as h}from"path";import{mkdir as g,writeFile as _}from"fs/promises";function v(e){let t=new Set(d.map(e=>f(e.key)));return e.map(e=>{let n={};for(let[r,i]of Object.entries(e.bindings))t.has(f(r))||(n[r]=i);return{context:e.context,bindings:n}}).filter(e=>Object.keys(e.bindings).length>0)}function y(){return r({$schema:`https://www.schemastore.org/claude-code-keybindings.json`,$docs:`https://code.claude.com/docs/en/keybindings`,bindings:v(a)},null,2)+`
2
+ `}var b=e((()=>{n(),s(),u()}));async function x(){if(!l())return{type:`text`,value:`Keybinding customization is not enabled. This feature is currently in preview.`};let e=o(),n=!1;await g(h(e),{recursive:!0});try{await _(e,y(),{encoding:`utf-8`,flag:`wx`})}catch(e){if(t(e)===`EEXIST`)n=!0;else throw e}let r=await m(e);return r.error?{type:`text`,value:`${n?`Opened`:`Created`} ${e}. Could not open in editor: ${r.error}`}:{type:`text`,value:n?`Opened ${e} in your editor.`:`Created ${e} with template. Opened in your editor.`}}e((()=>{c(),b(),i(),p()}))();export{x as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,dc as n,yc as r}from"./paths-BZjPDxMm.js";import{n as i,r as a,t as o}from"./language-Ct5Nkqm6.js";async function s(e,r,a){let s=a.trim().toLowerCase();if(!s){let t=n().preferredLanguage??`auto`,r=i(),a=t===`auto`?` → ${o(r)}`:``;return e(`Language: ${o(t)}${a}`,{display:`system`}),null}if(!c.includes(s))return e(`Invalid language "${s}". Use: en, zh, or auto`,{display:`system`}),null;let l=s;t(e=>({...e,preferredLanguage:l}));let u=i(),d=l===`auto`?` → ${o(u)}`:``;return e(`Language set to ${o(l)}${d}`,{display:`system`}),null}var c;e((()=>{r(),a(),c=[`en`,`zh`,`auto`]}))();export{s as call};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Cc as t,dc as n,yc as r}from"./paths-nIHVpTn2.js";import{n as i,r as a,t as o}from"./language-BcWiv2lr.js";async function s(e,r,a){let s=a.trim().toLowerCase();if(!s){let t=n().preferredLanguage??`auto`,r=i(),a=t===`auto`?` → ${o(r)}`:``;return e(`Language: ${o(t)}${a}`,{display:`system`}),null}if(!c.includes(s))return e(`Invalid language "${s}". Use: en, zh, or auto`,{display:`system`}),null;let l=s;t(e=>({...e,preferredLanguage:l}));let u=i(),d=l===`auto`?` → ${o(u)}`:``;return e(`Language set to ${o(l)}${d}`,{display:`system`}),null}var c;e((()=>{r(),a(),c=[`en`,`zh`,`auto`]}))();export{s as call};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{dc as t,yc as n}from"./paths-BZjPDxMm.js";import{i as r,s as i}from"./intl-CLeE9DsD.js";function a(){let e=t().preferredLanguage??`auto`;return e===`en`||e===`zh`?e:r()===`zh`?`zh`:`en`}function o(e){return s[e]??e}var s,c=e((()=>{n(),i(),s={auto:`Auto (follow system)`,en:`English`,zh:`中文`}}));export{a as n,c as r,o as t};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{dc as t,yc as n}from"./paths-nIHVpTn2.js";import{i as r,s as i}from"./intl-CLeE9DsD.js";function a(){let e=t().preferredLanguage??`auto`;return e===`en`||e===`zh`?e:r()===`zh`?`zh`:`en`}function o(e){return s[e]??e}var s,c=e((()=>{n(),i(),s={auto:`Auto (follow system)`,en:`English`,zh:`中文`}}));export{a as n,c as r,o as t};
@@ -0,0 +1 @@
1
+ import{n as e,r as t}from"./language-BcWiv2lr.js";t();export{e as getResolvedLanguage};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{i as f,n as p,r as m}from"./cron-DwR6OJuW.js";import{o as h,u as g}from"./api-hcsOinLV.js";import{n as _,r as v}from"./hostGuard-DSOEyH-P.js";import{n as y,t as b}from"./launchCommand-9eYsPG7W.js";function x(e){return new Promise(t=>setTimeout(t,e))}async function S(){let e;try{e=(await g()).apiKey}catch(e){throw new N(e instanceof Error?e.message:String(e),501)}return _(C()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":j,"content-type":`application/json`}}function C(){return`${u().BASE_API_URL}/v1/agents`}function w(e){if(t.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new N(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new N(`Subscription required. Scheduled agents require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new N(`Agent not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new N(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new N((e.response?.data)?.error?.message??e.message,t)}return e instanceof N?e:new N(e instanceof Error?e.message:String(e),0)}function T(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function E(e){let n;for(let r=0;r<M;r++)try{return await e()}catch(e){let i=w(e);if(i.statusCode>=500){n=i,r<M-1&&await x(T(t.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw n??new N(`Request failed after retries`,0)}async function D(){return E(async()=>{let e=await S();return(await t.get(C(),{headers:e})).data.data??[]})}async function O(e,n){return E(async()=>{let r=await S();return(await t.post(C(),{cron_expr:e,prompt:n,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??`UTC`},{headers:r})).data})}async function k(e){return E(async()=>{let n=await S();await t.delete(`${C()}/${e}`,{headers:n})})}async function A(e){return E(async()=>{let n=await S();return(await t.post(`${C()}/${e}/run`,{},{headers:n})).data})}var j,M,N,P=e((()=>{n(),d(),v(),h(),j=`managed-agents-2026-04-01`,M=3,N=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`AgentsApiError`}}}));function F({agent:e}){let t=p(e.cron_expr,{utc:!0}),n=e.next_run?new Date(e.next_run).toLocaleString():`—`;return(0,L.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(o,{children:[(0,L.jsx)(i,{bold:!0,children:e.id}),(0,L.jsx)(i,{dimColor:!0,children:` · `}),(0,L.jsx)(i,{color:`suggestion`,children:e.status})]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Prompt: `,e.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Next run: `,n]})]})}function I(e){if(e.mode===`list`)return e.agents.length===0?(0,L.jsx)(o,{children:(0,L.jsx)(i,{dimColor:!0,children:`No scheduled agents. Use /agents-platform create <cron> <prompt> to create one.`})}):(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{marginBottom:1,children:(0,L.jsxs)(i,{bold:!0,children:[`Scheduled Agents (`,e.agents.length,`)`]})}),e.agents.map(e=>(0,L.jsx)(F,{agent:e},e.id))]});if(e.mode===`created`){let t=p(e.agent.cron_expr,{utc:!0});return(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsx)(i,{bold:!0,color:`success`,children:`Agent created`})}),(0,L.jsxs)(i,{children:[`ID: `,e.agent.id]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{children:[`Prompt: `,e.agent.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Status: `,e.agent.status]})]})}return e.mode===`deleted`?(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` deleted.`]})}):e.mode===`ran`?(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` triggered.`]})}),(0,L.jsxs)(i,{dimColor:!0,children:[`Run ID: `,e.runId]})]}):(0,L.jsx)(o,{children:(0,L.jsx)(i,{color:`error`,children:e.message})})}var L,R=e((()=>{r(),a(),m(),L=s()}));function z(e){let t=e.trim().split(/\s+/);return t.length<6?null:{cron:t.slice(0,5).join(` `),prompt:t.slice(5).join(` `)}}function B(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`create`){if(!i)return{action:`invalid`,reason:`create requires a cron expression and prompt, e.g. create "0 9 * * 1" Run daily standup`};let e=z(i);if(!e)return{action:`invalid`,reason:`create requires at least 5 cron fields followed by a prompt, e.g. create "0 9 * * 1" Run daily standup`};let{cron:t,prompt:n}=e;return n.trim()?{action:`create`,cron:t,prompt:n.trim()}:{action:`invalid`,reason:`prompt cannot be empty`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires an agent id`}}if(r===`run`){if(!i)return{action:`invalid`,reason:`run requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`run`,id:e}:{action:`invalid`,reason:`run requires an agent id`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". Use: list | create CRON PROMPT | delete ID | run ID`}}var V=e((()=>{}));async function H(e,t){if(e.action===`list`){l(`tengu_agents_platform_list`,{});try{let e=await D();return t(e.length===0?`No scheduled agents found.`:`${e.length} scheduled agent(s).`,{display:`system`}),{mode:`list`,agents:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to list agents: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`create`){let{cron:n,prompt:r}=e;if(!f(n)){let e=`Invalid cron expression: "${n}". Expected 5 fields (minute hour day month weekday).`;return l(`tengu_agents_platform_failed`,{reason:e}),t(e,{display:`system`}),null}l(`tengu_agents_platform_create`,{cron:n});try{let e=await O(n,r);return t(`Agent created: ${e.id}`,{display:`system`}),{mode:`created`,agent:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to create agent: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete`){let{id:n}=e;l(`tengu_agents_platform_delete`,{id:n});try{return await k(n),t(`Agent ${n} deleted.`,{display:`system`}),{mode:`deleted`,id:n}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to delete agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{id:n}=e;l(`tengu_agents_platform_run`,{id:n});try{let e=await A(n);return t(`Agent ${n} triggered. Run ID: ${e.run_id}`,{display:`system`}),{mode:`ran`,id:n,runId:e.run_id}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to run agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}var U;e((()=>{c(),m(),P(),R(),V(),b(),U=y({commandName:`agents-platform`,parseArgs:e=>{l(`tengu_agents_platform_started`,{args:e});let t=B(e);return t.action===`invalid`?(l(`tengu_agents_platform_failed`,{reason:t.reason}),{action:`invalid`,reason:`Usage: /agents-platform list | create CRON PROMPT | delete ID | run ID\n${t.reason}`}):t},dispatch:H,View:I,errorView:e=>null})}))();export{U as callAgentsPlatform};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{i as f,n as p,r as m}from"./cron-DwR6OJuW.js";import{o as h,u as g}from"./api-C-KY7A3r.js";import{n as _,r as v}from"./hostGuard-DSOEyH-P.js";import{n as y,t as b}from"./launchCommand-9eYsPG7W.js";function x(e){return new Promise(t=>setTimeout(t,e))}async function S(){let e;try{e=(await g()).apiKey}catch(e){throw new N(e instanceof Error?e.message:String(e),501)}return _(C()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":j,"content-type":`application/json`}}function C(){return`${u().BASE_API_URL}/v1/agents`}function w(e){if(t.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new N(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new N(`Subscription required. Scheduled agents require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new N(`Agent not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new N(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new N((e.response?.data)?.error?.message??e.message,t)}return e instanceof N?e:new N(e instanceof Error?e.message:String(e),0)}function T(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function E(e){let n;for(let r=0;r<M;r++)try{return await e()}catch(e){let i=w(e);if(i.statusCode>=500){n=i,r<M-1&&await x(T(t.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw n??new N(`Request failed after retries`,0)}async function D(){return E(async()=>{let e=await S();return(await t.get(C(),{headers:e})).data.data??[]})}async function O(e,n){return E(async()=>{let r=await S();return(await t.post(C(),{cron_expr:e,prompt:n,timezone:Intl.DateTimeFormat().resolvedOptions().timeZone??`UTC`},{headers:r})).data})}async function k(e){return E(async()=>{let n=await S();await t.delete(`${C()}/${e}`,{headers:n})})}async function A(e){return E(async()=>{let n=await S();return(await t.post(`${C()}/${e}/run`,{},{headers:n})).data})}var j,M,N,P=e((()=>{n(),d(),v(),h(),j=`managed-agents-2026-04-01`,M=3,N=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`AgentsApiError`}}}));function F({agent:e}){let t=p(e.cron_expr,{utc:!0}),n=e.next_run?new Date(e.next_run).toLocaleString():`—`;return(0,L.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,L.jsxs)(o,{children:[(0,L.jsx)(i,{bold:!0,children:e.id}),(0,L.jsx)(i,{dimColor:!0,children:` · `}),(0,L.jsx)(i,{color:`suggestion`,children:e.status})]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Prompt: `,e.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Next run: `,n]})]})}function I(e){if(e.mode===`list`)return e.agents.length===0?(0,L.jsx)(o,{children:(0,L.jsx)(i,{dimColor:!0,children:`No scheduled agents. Use /agents-platform create <cron> <prompt> to create one.`})}):(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{marginBottom:1,children:(0,L.jsxs)(i,{bold:!0,children:[`Scheduled Agents (`,e.agents.length,`)`]})}),e.agents.map(e=>(0,L.jsx)(F,{agent:e},e.id))]});if(e.mode===`created`){let t=p(e.agent.cron_expr,{utc:!0});return(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsx)(i,{bold:!0,color:`success`,children:`Agent created`})}),(0,L.jsxs)(i,{children:[`ID: `,e.agent.id]}),(0,L.jsxs)(i,{children:[`Schedule: `,t]}),(0,L.jsxs)(i,{children:[`Prompt: `,e.agent.prompt]}),(0,L.jsxs)(i,{dimColor:!0,children:[`Status: `,e.agent.status]})]})}return e.mode===`deleted`?(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` deleted.`]})}):e.mode===`ran`?(0,L.jsxs)(o,{flexDirection:`column`,children:[(0,L.jsx)(o,{children:(0,L.jsxs)(i,{color:`success`,children:[`Agent `,e.id,` triggered.`]})}),(0,L.jsxs)(i,{dimColor:!0,children:[`Run ID: `,e.runId]})]}):(0,L.jsx)(o,{children:(0,L.jsx)(i,{color:`error`,children:e.message})})}var L,R=e((()=>{r(),a(),m(),L=s()}));function z(e){let t=e.trim().split(/\s+/);return t.length<6?null:{cron:t.slice(0,5).join(` `),prompt:t.slice(5).join(` `)}}function B(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`create`){if(!i)return{action:`invalid`,reason:`create requires a cron expression and prompt, e.g. create "0 9 * * 1" Run daily standup`};let e=z(i);if(!e)return{action:`invalid`,reason:`create requires at least 5 cron fields followed by a prompt, e.g. create "0 9 * * 1" Run daily standup`};let{cron:t,prompt:n}=e;return n.trim()?{action:`create`,cron:t,prompt:n.trim()}:{action:`invalid`,reason:`prompt cannot be empty`}}if(r===`delete`){if(!i)return{action:`invalid`,reason:`delete requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`delete`,id:e}:{action:`invalid`,reason:`delete requires an agent id`}}if(r===`run`){if(!i)return{action:`invalid`,reason:`run requires an agent id`};let e=i.split(/\s+/)[0];return e?{action:`run`,id:e}:{action:`invalid`,reason:`run requires an agent id`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". Use: list | create CRON PROMPT | delete ID | run ID`}}var V=e((()=>{}));async function H(e,t){if(e.action===`list`){l(`tengu_agents_platform_list`,{});try{let e=await D();return t(e.length===0?`No scheduled agents found.`:`${e.length} scheduled agent(s).`,{display:`system`}),{mode:`list`,agents:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to list agents: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`create`){let{cron:n,prompt:r}=e;if(!f(n)){let e=`Invalid cron expression: "${n}". Expected 5 fields (minute hour day month weekday).`;return l(`tengu_agents_platform_failed`,{reason:e}),t(e,{display:`system`}),null}l(`tengu_agents_platform_create`,{cron:n});try{let e=await O(n,r);return t(`Agent created: ${e.id}`,{display:`system`}),{mode:`created`,agent:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:n}),t(`Failed to create agent: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete`){let{id:n}=e;l(`tengu_agents_platform_delete`,{id:n});try{return await k(n),t(`Agent ${n} deleted.`,{display:`system`}),{mode:`deleted`,id:n}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to delete agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{id:n}=e;l(`tengu_agents_platform_run`,{id:n});try{let e=await A(n);return t(`Agent ${n} triggered. Run ID: ${e.run_id}`,{display:`system`}),{mode:`ran`,id:n,runId:e.run_id}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_agents_platform_failed`,{reason:r}),t(`Failed to run agent ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}var U;e((()=>{c(),m(),P(),R(),V(),b(),U=y({commandName:`agents-platform`,parseArgs:e=>{l(`tengu_agents_platform_started`,{args:e});let t=B(e);return t.action===`invalid`?(l(`tengu_agents_platform_failed`,{reason:t.reason}),{action:`invalid`,reason:`Usage: /agents-platform list | create CRON PROMPT | delete ID | run ID\n${t.reason}`}):t},dispatch:H,View:I,errorView:e=>null})}))();export{U as callAgentsPlatform};
@@ -1,5 +1,5 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{Ct as s,cn as c}from"./state-sIHsFpDu.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{Cv as d,Dv as f,Ev as p,Nv as m,Ov as h,Rv as g,Sv as ee,Tv as _,kv as v,wv as te}from"./loadAgentsDir-BYWykYwn.js";import{a as y,r as b}from"./detectRepository-2ICvGD0U.js";import{join as x}from"node:path";import{spawn as S}from"node:child_process";import{existsSync as C}from"node:fs";import{randomUUID as w}from"node:crypto";function ne(e){return D.indexOf(e)}function re({phase:e,target:t,sessionUrl:n,errorMessage:i}){let o=ne(e),s=e===`error`;return(0,T.jsxs)(a,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,T.jsxs)(a,{children:[(0,T.jsx)(r,{bold:!0,children:`Autofix PR `}),(0,T.jsx)(r,{color:`claude`,children:t})]}),D.map((e,t)=>{let n=o>t,i=o===t&&!s;return(0,T.jsx)(a,{marginLeft:2,children:(0,T.jsxs)(r,{color:n?`success`:i?`warning`:`subtle`,children:[n?`✓`:i?`→`:`·`,` `,E[e]]})},e)}),s&&i&&(0,T.jsx)(a,{marginLeft:2,marginTop:1,children:(0,T.jsxs)(r,{color:`error`,children:[`✗ `,i]})}),n&&(0,T.jsxs)(a,{marginTop:1,marginLeft:2,children:[(0,T.jsx)(r,{color:`subtle`,children:`Track: `}),(0,T.jsx)(r,{color:`claude`,children:n})]})]})}var T,E,D,ie=e((()=>{n(),i(),T=o(),E={detecting:`Detecting repository...`,checking_eligibility:`Checking remote agent eligibility...`,acquiring_lock:`Acquiring monitor lock...`,launching:`Launching remote session...`,registered:`Session registered`,done:`Autofix launched`,error:`Error`},D=[`detecting`,`checking_eligibility`,`acquiring_lock`,`launching`,`registered`,`done`]}));function O(e,t){return{agentId:w(),agentName:`autofix-pr`,teamName:`_autofix`,color:void 0,planModeRequired:!1,parentSessionId:s(),abortController:new AbortController,taskId:w()}}var k=e((()=>{c()}));function A(){return M}function ae(e){return M?!1:(M=e,!0)}function j(e){M&&(e&&M.taskId!==e||(M.abortController.abort(),M=null))}function oe(e){return M?(M={...M,...e},!0):!1}function se(e,t,n){return M?.owner===e&&M?.repo===t&&M?.prNumber===n}var M,N=e((()=>{M=null}));function P(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n){if(n.type===`system`&&(n.subtype===`hook_progress`||n.subtype===`hook_response`)){let e=n.stdout;if(typeof e==`string`){let t=F(e,L,R);if(t)return t}continue}if(n.type===`assistant`){let e=n.message?.content;if(!e||typeof e==`string`)continue;for(let t of e){if(t.type!==`text`||typeof t.text!=`string`||!t.text.includes(L))continue;let e=F(t.text,L,R);if(e)return e}}}}return null}function F(e,t,n){let r=e.length;for(;r>=0;){let i=e.lastIndexOf(t,r);if(i===-1)return null;let a=e.indexOf(n,i+t.length);if(a!==-1)return e.slice(i,a+n.length);r=i-1}return null}var I,L,R,z=e((()=>{I=`autofix-result`,L=`<${I}>`,R=`</${I}>`}));function B(e){if(!/^[1-9]\d{0,9}$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function V(e){let t=e.trim();if(!t)return{action:`invalid`,reason:`empty`};if(t===`stop`||t===`off`)return{action:`stop`};let n=B(t);if(n!==null)return{action:`start`,prNumber:n};let r=t.match(/^([\w.-]+)\/([\w.-]+)#(\d+)$/);if(r){let e=B(r[3]);return e===null?{action:`invalid`,reason:`pr_number_out_of_range`}:{action:`start`,owner:r[1],repo:r[2],prNumber:e}}return{action:`freeform`,prompt:t}}var H=e((()=>{}));function U(e,t){let{owner:n,repo:r,prNumber:i,initialHeadSha:a}=t;if(e.state===`MERGED`)return{completed:!0,summary:`${n}/${r}#${i} merged. Autofix monitoring complete.`};if(e.state===`CLOSED`)return{completed:!0,summary:`${n}/${r}#${i} closed without merge. Autofix monitoring complete.`};if(!a||e.headRefOid===a)return{completed:!1};let o=W(e.statusCheckRollup);return o.state===`pending`?{completed:!1}:o.state===`failure`?{completed:!0,summary:`Autofix pushed commits to ${n}/${r}#${i} but CI is failing (${o.detail}).`}:{completed:!0,summary:`Autofix pushed commits to ${n}/${r}#${i}, CI green.`}}function W(e){if(!e||e.length===0)return{state:`success`,detail:`no checks configured`};let t=0,n=0,r=e.length;for(let r of e){let e=(r.status??``).toUpperCase(),i=(r.conclusion??``).toUpperCase();if(e&&e!==`COMPLETED`){t++;continue}if(!(i===`SUCCESS`||i===`NEUTRAL`||i===`SKIPPED`)){if(i===``){t++;continue}n++}}return t>0?{state:`pending`,detail:`${t}/${r} checks pending`}:n>0?{state:`failure`,detail:`${n}/${r} checks failing`}:{state:`success`,detail:`${r}/${r} checks passing`}}var G=e((()=>{}));async function ce(e){let{owner:t,repo:n,prNumber:r,initialHeadSha:i,timeoutMs:a}=e,o;try{o=await K(t,n,r,a??q)}catch{return{completed:!1}}return U(o,{owner:t,repo:n,prNumber:r,initialHeadSha:i})}async function le(e,t,n,r=q){try{return(await K(e,t,n,r)).headRefOid||null}catch{return null}}function K(e,t,n,r){return new Promise((i,a)=>{let o=S(`gh`,[`pr`,`view`,String(n),`--repo`,`${e}/${t}`,`--json`,`headRefOid,state,statusCheckRollup`],{stdio:[`ignore`,`pipe`,`pipe`]}),s=[],c=[],l=!1,u=setTimeout(()=>{l||(l=!0,o.kill(`SIGKILL`),a(Error(`gh pr view timed out after ${r}ms`)))},r);o.stdout.on(`data`,e=>s.push(e)),o.stderr.on(`data`,e=>c.push(e)),o.on(`error`,e=>{l||(l=!0,clearTimeout(u),a(e))}),o.on(`close`,e=>{if(l)return;if(l=!0,clearTimeout(u),e!==0){let t=Buffer.concat(c).toString(`utf8`).trim();a(Error(`gh pr view exited ${e}: ${t||`<no stderr>`}`));return}let t=Buffer.concat(s).toString(`utf8`).trim();try{i(JSON.parse(t))}catch(e){a(Error(`gh pr view JSON parse failed: ${e.message}`))}})})}var q,ue=e((()=>{G(),q=5e3}));function de(e){return[`AUTOFIX.md`,`.claude/skills/autofix.md`,`.claude/skills/autofix-pr/SKILL.md`].filter(t=>C(x(e,t)))}function fe(e){return e.length===0?``:` Run ${e.join(` and `)} for custom instructions on how to autofix.`}var pe=e((()=>{}));function J(e){return`${e.owner}/${e.repo}#${e.prNumber}`}function Y(e,t){return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:t}),`Autofix PR failed: ${e}`}var X,Z,Q,$;e((()=>{X=t(n(),1),l(),_(),y(),m(),ie(),k(),N(),z(),H(),ue(),pe(),Z=new Map,Q=5e3,p(`autofix-pr`,async e=>{let t=e;if(!t)return null;let n=J(t),r=Date.now();if(r-(Z.get(n)??0)<Q)return null;Z.set(n,r);let i=await ce({owner:t.owner,repo:t.repo,prNumber:t.prNumber,initialHeadSha:t.initialHeadSha});return i.completed?i.summary:null}),f(`autofix-pr`,(e,t)=>{j(e);let n=t;n&&Z.delete(J(n))}),h(`autofix-pr`,e=>P(e)),$=async(e,t,n)=>{try{let r=V(n);if(r.action===`stop`){let t=A();return t?(j(),e(`Stopped local monitoring of ${t.repo}#${t.prNumber}. Any already-running remote session continues until it finishes or is cancelled from claude.ai/code.`,{display:`system`}),null):(e(`No active autofix monitor.`,{display:`system`}),null)}if(r.action===`invalid`)return e(`Invalid args: ${r.reason}. Use /autofix-pr <pr-number> | stop | <owner>/<repo>#<n>`,{display:`system`}),null;if(r.action===`freeform`)return e(`Freeform prompt mode not yet supported. Use /autofix-pr <pr-number>.`,{display:`system`}),null;u(`tengu_autofix_pr_started`,{action:`start`,has_pr_number:`true`,has_repo_path:String(!!(r.owner&&r.repo))});let i;try{i=await b()}catch{return e(Y(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null}if(!i||i.host!==`github.com`)return e(Y(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null;if(r.owner&&r.owner!==i.owner||r.repo&&r.repo!==i.name)return e(Y(`Cross-repo autofix is not supported from this directory. Run from ${i.owner}/${i.name} or pass only the PR number.`,`repo_mismatch`),{display:`system`}),null;let a=i.owner,o=i.name,{prNumber:s}=r;if(se(a,o,s))return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Already monitoring ${o}#${s} in background.`,{display:`system`}),null;let c=await ee({skipBundle:!0});if(!c.eligible){let t=c.errors.filter(e=>e.type!==`no_remote_environment`);if(t.length>0)return e(Y(`Remote agent not available:\n${t.map(d).join(`
2
- `)}`,`session_create_failed`),{display:`system`}),null}let l=fe(de(process.cwd())),f=`${a}/${o}#${s}`,p=`refs/pull/${s}/head`,m=`Auto-fix failing CI checks on PR #${s} in ${a}/${o}.${l}
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,t as i,x as a}from"./src-Di342QoJ.js";import{t as o}from"./jsx-runtime-D-D469L8.js";import{Ct as s,cn as c}from"./state-sIHsFpDu.js";import{n as l,r as u}from"./analytics-DqMQntaB.js";import{Av as d,Bv as f,Dv as p,Ev as ee,Fv as m,Ov as h,Tv as te,jv as g,kv as _,wv as ne}from"./loadAgentsDir-BfEZacjM.js";import{a as v,r as y}from"./detectRepository-2ICvGD0U.js";import{join as b}from"node:path";import{spawn as x}from"node:child_process";import{existsSync as S}from"node:fs";import{randomUUID as C}from"node:crypto";function re(e){return E.indexOf(e)}function ie({phase:e,target:t,sessionUrl:n,errorMessage:i}){let o=re(e),s=e===`error`;return(0,w.jsxs)(a,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,w.jsxs)(a,{children:[(0,w.jsx)(r,{bold:!0,children:`Autofix PR `}),(0,w.jsx)(r,{color:`claude`,children:t})]}),E.map((e,t)=>{let n=o>t,i=o===t&&!s;return(0,w.jsx)(a,{marginLeft:2,children:(0,w.jsxs)(r,{color:n?`success`:i?`warning`:`subtle`,children:[n?`✓`:i?`→`:`·`,` `,T[e]]})},e)}),s&&i&&(0,w.jsx)(a,{marginLeft:2,marginTop:1,children:(0,w.jsxs)(r,{color:`error`,children:[`✗ `,i]})}),n&&(0,w.jsxs)(a,{marginTop:1,marginLeft:2,children:[(0,w.jsx)(r,{color:`subtle`,children:`Track: `}),(0,w.jsx)(r,{color:`claude`,children:n})]})]})}var w,T,E,D=e((()=>{n(),i(),w=o(),T={detecting:`Detecting repository...`,checking_eligibility:`Checking remote agent eligibility...`,acquiring_lock:`Acquiring monitor lock...`,launching:`Launching remote session...`,registered:`Session registered`,done:`Autofix launched`,error:`Error`},E=[`detecting`,`checking_eligibility`,`acquiring_lock`,`launching`,`registered`,`done`]}));function O(e,t){return{agentId:C(),agentName:`autofix-pr`,teamName:`_autofix`,color:void 0,planModeRequired:!1,parentSessionId:s(),abortController:new AbortController,taskId:C()}}var k=e((()=>{c()}));function A(){return M}function ae(e){return M?!1:(M=e,!0)}function j(e){M&&(e&&M.taskId!==e||(M.abortController.abort(),M=null))}function oe(e){return M?(M={...M,...e},!0):!1}function se(e,t,n){return M?.owner===e&&M?.repo===t&&M?.prNumber===n}var M,N=e((()=>{M=null}));function P(e){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n){if(n.type===`system`&&(n.subtype===`hook_progress`||n.subtype===`hook_response`)){let e=n.stdout;if(typeof e==`string`){let t=F(e,L,R);if(t)return t}continue}if(n.type===`assistant`){let e=n.message?.content;if(!e||typeof e==`string`)continue;for(let t of e){if(t.type!==`text`||typeof t.text!=`string`||!t.text.includes(L))continue;let e=F(t.text,L,R);if(e)return e}}}}return null}function F(e,t,n){let r=e.length;for(;r>=0;){let i=e.lastIndexOf(t,r);if(i===-1)return null;let a=e.indexOf(n,i+t.length);if(a!==-1)return e.slice(i,a+n.length);r=i-1}return null}var I,L,R,z=e((()=>{I=`autofix-result`,L=`<${I}>`,R=`</${I}>`}));function B(e){if(!/^[1-9]\d{0,9}$/.test(e))return null;let t=Number(e);return Number.isSafeInteger(t)?t:null}function V(e){let t=e.trim();if(!t)return{action:`invalid`,reason:`empty`};if(t===`stop`||t===`off`)return{action:`stop`};let n=B(t);if(n!==null)return{action:`start`,prNumber:n};let r=t.match(/^([\w.-]+)\/([\w.-]+)#(\d+)$/);if(r){let e=B(r[3]);return e===null?{action:`invalid`,reason:`pr_number_out_of_range`}:{action:`start`,owner:r[1],repo:r[2],prNumber:e}}return{action:`freeform`,prompt:t}}var H=e((()=>{}));function U(e,t){let{owner:n,repo:r,prNumber:i,initialHeadSha:a}=t;if(e.state===`MERGED`)return{completed:!0,summary:`${n}/${r}#${i} merged. Autofix monitoring complete.`};if(e.state===`CLOSED`)return{completed:!0,summary:`${n}/${r}#${i} closed without merge. Autofix monitoring complete.`};if(!a||e.headRefOid===a)return{completed:!1};let o=W(e.statusCheckRollup);return o.state===`pending`?{completed:!1}:o.state===`failure`?{completed:!0,summary:`Autofix pushed commits to ${n}/${r}#${i} but CI is failing (${o.detail}).`}:{completed:!0,summary:`Autofix pushed commits to ${n}/${r}#${i}, CI green.`}}function W(e){if(!e||e.length===0)return{state:`success`,detail:`no checks configured`};let t=0,n=0,r=e.length;for(let r of e){let e=(r.status??``).toUpperCase(),i=(r.conclusion??``).toUpperCase();if(e&&e!==`COMPLETED`){t++;continue}if(!(i===`SUCCESS`||i===`NEUTRAL`||i===`SKIPPED`)){if(i===``){t++;continue}n++}}return t>0?{state:`pending`,detail:`${t}/${r} checks pending`}:n>0?{state:`failure`,detail:`${n}/${r} checks failing`}:{state:`success`,detail:`${r}/${r} checks passing`}}var G=e((()=>{}));async function ce(e){let{owner:t,repo:n,prNumber:r,initialHeadSha:i,timeoutMs:a}=e,o;try{o=await K(t,n,r,a??q)}catch{return{completed:!1}}return U(o,{owner:t,repo:n,prNumber:r,initialHeadSha:i})}async function le(e,t,n,r=q){try{return(await K(e,t,n,r)).headRefOid||null}catch{return null}}function K(e,t,n,r){return new Promise((i,a)=>{let o=x(`gh`,[`pr`,`view`,String(n),`--repo`,`${e}/${t}`,`--json`,`headRefOid,state,statusCheckRollup`],{stdio:[`ignore`,`pipe`,`pipe`]}),s=[],c=[],l=!1,u=setTimeout(()=>{l||(l=!0,o.kill(`SIGKILL`),a(Error(`gh pr view timed out after ${r}ms`)))},r);o.stdout.on(`data`,e=>s.push(e)),o.stderr.on(`data`,e=>c.push(e)),o.on(`error`,e=>{l||(l=!0,clearTimeout(u),a(e))}),o.on(`close`,e=>{if(l)return;if(l=!0,clearTimeout(u),e!==0){let t=Buffer.concat(c).toString(`utf8`).trim();a(Error(`gh pr view exited ${e}: ${t||`<no stderr>`}`));return}let t=Buffer.concat(s).toString(`utf8`).trim();try{i(JSON.parse(t))}catch(e){a(Error(`gh pr view JSON parse failed: ${e.message}`))}})})}var q,ue=e((()=>{G(),q=5e3}));function de(e){return[`AUTOFIX.md`,`.claude/skills/autofix.md`,`.claude/skills/autofix-pr/SKILL.md`].filter(t=>S(b(e,t)))}function fe(e){return e.length===0?``:` Run ${e.join(` and `)} for custom instructions on how to autofix.`}var pe=e((()=>{}));function J(e){return`${e.owner}/${e.repo}#${e.prNumber}`}function Y(e,t){return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:t}),`Autofix PR failed: ${e}`}var X,Z,Q,$;e((()=>{X=t(n(),1),l(),p(),v(),m(),D(),k(),N(),z(),H(),ue(),pe(),Z=new Map,Q=5e3,h(`autofix-pr`,async e=>{let t=e;if(!t)return null;let n=J(t),r=Date.now();if(r-(Z.get(n)??0)<Q)return null;Z.set(n,r);let i=await ce({owner:t.owner,repo:t.repo,prNumber:t.prNumber,initialHeadSha:t.initialHeadSha});return i.completed?i.summary:null}),_(`autofix-pr`,(e,t)=>{j(e);let n=t;n&&Z.delete(J(n))}),d(`autofix-pr`,e=>P(e)),$=async(e,t,n)=>{try{let r=V(n);if(r.action===`stop`){let t=A();return t?(j(),e(`Stopped local monitoring of ${t.repo}#${t.prNumber}. Any already-running remote session continues until it finishes or is cancelled from claude.ai/code.`,{display:`system`}),null):(e(`No active autofix monitor.`,{display:`system`}),null)}if(r.action===`invalid`)return e(`Invalid args: ${r.reason}. Use /autofix-pr <pr-number> | stop | <owner>/<repo>#<n>`,{display:`system`}),null;if(r.action===`freeform`)return e(`Freeform prompt mode not yet supported. Use /autofix-pr <pr-number>.`,{display:`system`}),null;u(`tengu_autofix_pr_started`,{action:`start`,has_pr_number:`true`,has_repo_path:String(!!(r.owner&&r.repo))});let i;try{i=await y()}catch{return e(Y(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null}if(!i||i.host!==`github.com`)return e(Y(`Cannot detect GitHub repo from current directory.`,`session_create_failed`),{display:`system`}),null;if(r.owner&&r.owner!==i.owner||r.repo&&r.repo!==i.name)return e(Y(`Cross-repo autofix is not supported from this directory. Run from ${i.owner}/${i.name} or pass only the PR number.`,`repo_mismatch`),{display:`system`}),null;let a=i.owner,o=i.name,{prNumber:s}=r;if(se(a,o,s))return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Already monitoring ${o}#${s} in background.`,{display:`system`}),null;let c=await ne({skipBundle:!0});if(!c.eligible){let t=c.errors.filter(e=>e.type!==`no_remote_environment`);if(t.length>0)return e(Y(`Remote agent not available:\n${t.map(te).join(`
2
+ `)}`,`session_create_failed`),{display:`system`}),null}let l=fe(de(process.cwd())),d=`${a}/${o}#${s}`,p=`refs/pull/${s}/head`,m=`Auto-fix failing CI checks on PR #${s} in ${a}/${o}.${l}
3
3
 
4
4
  When you finish (or hit a blocker you can't recover from), output the following XML tag as your final message so the local user gets a structured summary:
5
5
 
@@ -15,4 +15,4 @@ When you finish (or hit a blocker you can't recover from), output the following
15
15
  <summary>One-sentence summary of what was fixed or why it could not be fixed.</summary>
16
16
  </autofix-result>
17
17
 
18
- If no fix was needed, omit <commits-pushed> and <files-changed> and explain in <summary>. If you only attempted partial work, list the commits you did push and explain the remainder in <summary>.`,h=O(m,f);if(!ae({taskId:h.taskId,owner:a,repo:o,prNumber:s,abortController:h.abortController,startedAt:Date.now()})){let t=A();return e(Y(`already monitoring ${t?.repo}#${t?.prNumber}. Run /autofix-pr stop first.`,`rc_already_monitoring_other`),{display:`system`}),null}let _,y=e=>{_=e},x=null;try{x=await g({initialMessage:m,source:`autofix_pr`,branchName:p,skipBundle:!0,title:`Autofix PR: ${f}`,useDefaultEnvironment:!0,signal:h.abortController.signal,githubPr:{owner:a,repo:o,number:s},onBundleFail:y,onCreateFail:y})}catch(t){return j(h.taskId),e(Y(`teleport failed: ${t instanceof Error?t.message:String(t)}`,`teleport_failed`),{display:`system`}),null}if(!x)return j(h.taskId),e(Y(_??`remote session creation failed.`,`session_create_failed`),{display:`system`}),null;let S=await le(a,o,s).catch(()=>null)??void 0;try{let{taskId:e}=v({remoteTaskType:`autofix-pr`,session:x,command:`/autofix-pr ${s}`,context:t,isLongRunning:!0,remoteTaskMetadata:{owner:a,repo:o,prNumber:s,initialHeadSha:S}});oe({taskId:e})}catch(t){return j(h.taskId),e(Y(`task registration failed: ${t instanceof Error?t.message:String(t)}`,`registration_failed`),{display:`system`}),null}let C=te(x.id);return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Autofix launched for ${f}. Track: ${C}`,{display:`system`}),X.createElement(re,{phase:`done`,target:f,sessionUrl:C})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:`exception`}),e(`Autofix PR failed: ${n}`,{display:`system`}),null}}}))();export{$ as callAutofixPr};
18
+ If no fix was needed, omit <commits-pushed> and <files-changed> and explain in <summary>. If you only attempted partial work, list the commits you did push and explain the remainder in <summary>.`,h=O(m,d);if(!ae({taskId:h.taskId,owner:a,repo:o,prNumber:s,abortController:h.abortController,startedAt:Date.now()})){let t=A();return e(Y(`already monitoring ${t?.repo}#${t?.prNumber}. Run /autofix-pr stop first.`,`rc_already_monitoring_other`),{display:`system`}),null}let _,v=e=>{_=e},b=null;try{b=await f({initialMessage:m,source:`autofix_pr`,branchName:p,skipBundle:!0,title:`Autofix PR: ${d}`,useDefaultEnvironment:!0,signal:h.abortController.signal,githubPr:{owner:a,repo:o,number:s},onBundleFail:v,onCreateFail:v})}catch(t){return j(h.taskId),e(Y(`teleport failed: ${t instanceof Error?t.message:String(t)}`,`teleport_failed`),{display:`system`}),null}if(!b)return j(h.taskId),e(Y(_??`remote session creation failed.`,`session_create_failed`),{display:`system`}),null;let x=await le(a,o,s).catch(()=>null)??void 0;try{let{taskId:e}=g({remoteTaskType:`autofix-pr`,session:b,command:`/autofix-pr ${s}`,context:t,isLongRunning:!0,remoteTaskMetadata:{owner:a,repo:o,prNumber:s,initialHeadSha:x}});oe({taskId:e})}catch(t){return j(h.taskId),e(Y(`task registration failed: ${t instanceof Error?t.message:String(t)}`,`registration_failed`),{display:`system`}),null}let S=ee(b.id);return u(`tengu_autofix_pr_result`,{result:`success_rc`}),e(`Autofix launched for ${d}. Track: ${S}`,{display:`system`}),X.createElement(ie,{phase:`done`,target:d,sessionUrl:S})}catch(t){let n=t instanceof Error?t.message:String(t);return u(`tengu_autofix_pr_result`,{result:`failed`,error_code:`exception`}),e(`Autofix PR failed: ${n}`,{display:`system`}),null}}}))();export{$ as callAutofixPr};
@@ -1,3 +1,3 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Af as l,Df as u,Ff as d,If as f,Mf as p,Nf as m,Of as h,Pf as g,dS as _,fS as v,jf as y,kf as b}from"./loadAgentsDir-BYWykYwn.js";import{n as x,t as S}from"./launchCommand-9eYsPG7W.js";function C(e){return e.mode===`list`?e.stores.length===0?(0,w.jsx)(o,{children:(0,w.jsx)(r,{dimColor:!0,children:`No memory stores found. Use /local-memory create <store> to create one.`})}):(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsx)(o,{marginBottom:1,children:(0,w.jsxs)(r,{bold:!0,children:[`Local Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`◆`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`created`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Store created: `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`stored`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Stored entry `}),(0,w.jsx)(r,{bold:!0,children:e.key}),(0,w.jsx)(r,{children:` in `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`fetched`?(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsxs)(o,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}),(0,w.jsx)(o,{children:(0,w.jsx)(r,{children:e.value})})]}):e.mode===`not-found`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`error`,children:`Not found: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),e.key?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}):null]}):e.mode===`entries`?e.keys.length===0?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{dimColor:!0,children:`No entries in `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[`. Use /local-memory store `,e.store,` <key> <value> to add one.`]})]}):(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsxs)(o,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (`,e.keys.length,` entries)`]})]}),e.keys.map(e=>(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`·`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`archived`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Archived store: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (renamed to `,e.store,`.archived)`]})]}):(0,w.jsx)(o,{children:(0,w.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var w,T=e((()=>{n(),a(),w=c()}));function E(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`create`){let e=n[1];return e?{action:`create`,store:e}:{action:`invalid`,reason:`create requires a store name. ${D}`}}if(r===`store`){let e=n[1],t=n[2];if(!e)return{action:`invalid`,reason:`store requires a store name. ${D}`};if(!t)return{action:`invalid`,reason:`store requires a key. ${D}`};let r=n.slice(3).join(` `);return r?{action:`store`,store:e,key:t,value:r}:{action:`invalid`,reason:`store requires a value. ${D}`}}if(r===`fetch`){let e=n[1],t=n[2];return e?t?{action:`fetch`,store:e,key:t}:{action:`invalid`,reason:`fetch requires a key. ${D}`}:{action:`invalid`,reason:`fetch requires a store name. ${D}`}}if(r===`entries`){let e=n[1];return e?{action:`entries`,store:e}:{action:`invalid`,reason:`entries requires a store name. ${D}`}}if(r===`archive`){let e=n[1];return e?{action:`archive`,store:e}:{action:`invalid`,reason:`archive requires a store name. ${D}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${D}`}}var D,O=e((()=>{D=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`}));function k(e){return e.length===0?`No memory stores found.`:[`Local Memory Stores`,...e.map(e=>`- ${e}`)].join(`
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Af as l,Ff as u,If as d,Lf as f,Mf as p,Nf as m,Pf as h,Rf as g,jf as _,kf as v,mS as y,pS as b}from"./loadAgentsDir-BfEZacjM.js";import{n as x,t as S}from"./launchCommand-9eYsPG7W.js";function C(e){return e.mode===`list`?e.stores.length===0?(0,w.jsx)(o,{children:(0,w.jsx)(r,{dimColor:!0,children:`No memory stores found. Use /local-memory create <store> to create one.`})}):(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsx)(o,{marginBottom:1,children:(0,w.jsxs)(r,{bold:!0,children:[`Local Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`◆`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`created`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Store created: `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`stored`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Stored entry `}),(0,w.jsx)(r,{bold:!0,children:e.key}),(0,w.jsx)(r,{children:` in `}),(0,w.jsx)(r,{bold:!0,children:e.store})]}):e.mode===`fetched`?(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsxs)(o,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}),(0,w.jsx)(o,{children:(0,w.jsx)(r,{children:e.value})})]}):e.mode===`not-found`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`error`,children:`Not found: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),e.key?(0,w.jsxs)(w.Fragment,{children:[(0,w.jsx)(r,{dimColor:!0,children:`/`}),(0,w.jsx)(r,{bold:!0,children:e.key})]}):null]}):e.mode===`entries`?e.keys.length===0?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{dimColor:!0,children:`No entries in `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[`. Use /local-memory store `,e.store,` <key> <value> to add one.`]})]}):(0,w.jsxs)(o,{flexDirection:`column`,children:[(0,w.jsxs)(o,{marginBottom:1,children:[(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (`,e.keys.length,` entries)`]})]}),e.keys.map(e=>(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{children:` `}),(0,w.jsx)(r,{color:`success`,children:`·`}),(0,w.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`archived`?(0,w.jsxs)(o,{children:[(0,w.jsx)(r,{color:`success`,children:`✓`}),(0,w.jsx)(r,{children:` Archived store: `}),(0,w.jsx)(r,{bold:!0,children:e.store}),(0,w.jsxs)(r,{dimColor:!0,children:[` (renamed to `,e.store,`.archived)`]})]}):(0,w.jsx)(o,{children:(0,w.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var w,T=e((()=>{n(),a(),w=c()}));function E(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`create`){let e=n[1];return e?{action:`create`,store:e}:{action:`invalid`,reason:`create requires a store name. ${D}`}}if(r===`store`){let e=n[1],t=n[2];if(!e)return{action:`invalid`,reason:`store requires a store name. ${D}`};if(!t)return{action:`invalid`,reason:`store requires a key. ${D}`};let r=n.slice(3).join(` `);return r?{action:`store`,store:e,key:t,value:r}:{action:`invalid`,reason:`store requires a value. ${D}`}}if(r===`fetch`){let e=n[1],t=n[2];return e?t?{action:`fetch`,store:e,key:t}:{action:`invalid`,reason:`fetch requires a key. ${D}`}:{action:`invalid`,reason:`fetch requires a store name. ${D}`}}if(r===`entries`){let e=n[1];return e?{action:`entries`,store:e}:{action:`invalid`,reason:`entries requires a store name. ${D}`}}if(r===`archive`){let e=n[1];return e?{action:`archive`,store:e}:{action:`invalid`,reason:`archive requires a store name. ${D}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${D}`}}var D,O=e((()=>{D=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`}));function k(e){return e.length===0?`No memory stores found.`:[`Local Memory Stores`,...e.map(e=>`- ${e}`)].join(`
2
2
  `)}function A(e,t){return t.length===0?`No entries in "${e}".`:[`Entries in "${e}"`,...t.map(e=>`- ${e}`)].join(`
3
- `)}function j({onDone:e}){let[t,n]=N.useState({kind:`menu`}),[a,c]=N.useState(0),[l,d]=N.useState(``),[v,x]=N.useState(0),[S,C]=N.useState(null),w=N.useCallback(e=>{n(e),d(``),x(0),C(null)},[]),T=N.useCallback(t=>e(t,{display:`system`}),[e]),E=N.useCallback((e,t,n,r,i={})=>{try{if(e===`list`){T(k(m()));return}if(e===`about`){T(F);return}if(!t){C(`Internal: missing store`);return}if(e===`create`){h(t),T(`Store created: ${t}`);return}if(e===`entries`){T(A(t,p(t)));return}if(e===`archive`){u(t),T(`Archived store: ${t}`);return}if(e===`fetch`){if(!n){C(`Internal: missing key`);return}let e=b(t,n);if(e===null){T(`Entry not found: ${t}/${n}`);return}T(`Entry fetched: ${t}/${n}\n\n${e}`);return}if(e===`store`){if(!n||r===void 0){C(`Internal: missing key or value`);return}if(!i.confirmedOverwrite&&b(t,n)!==null){w({kind:`confirm-overwrite`,store:t,key:n,value:r});return}g(t,n,r),T(`Stored ${t}/${n} (${r.length} chars)`);return}}catch(e){C(e instanceof Error?e.message:String(e))}},[T,w]);if(s((e,n)=>{if(t.kind!==`menu`)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(L.length-1,e+1));return}if(n.return){let e=L[a];if(!e)return;if(e.kind===`list`||e.kind===`about`){E(e.kind,void 0,void 0,void 0);return}w({kind:`collect-store`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=L.length&&c(r-1)},{isActive:t.kind===`menu`}),s((e,n)=>{if(t.kind!==`confirm-archive`&&t.kind!==`confirm-overwrite`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();r===`y`||n.return?t.kind===`confirm-archive`?E(`archive`,t.store,void 0,void 0):E(`store`,t.store,t.key,t.value,{confirmedOverwrite:!0}):r===`n`&&w({kind:`menu`})},{isActive:t.kind===`confirm-archive`||t.kind===`confirm-overwrite`}),s((e,n)=>{if(!(t.kind!==`collect-store`&&t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:t.action,store:t.store});return}if(t.kind===`collect-key`){w({kind:`collect-store`,action:t.action});return}w({kind:`menu`})}},{isActive:t.kind===`collect-store`||t.kind===`collect-key`||t.kind===`collect-value`}),t.kind===`menu`)return(0,P.jsx)(i,{title:`Local Memory`,subtitle:`${L.length} actions`,onCancel:()=>T(`Local memory panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[L.map((e,t)=>(0,P.jsxs)(o,{flexDirection:`row`,children:[(0,P.jsx)(r,{children:`${t===a?`›`:` `} ${e.label}`.padEnd(I)}),(0,P.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-7 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-archive`)return(0,P.jsx)(i,{title:`Confirm Archive`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Archive store "`,t.store,`"? This renames it to *.archived.`]}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = archive · n/Esc = cancel`})})]})});if(t.kind===`confirm-overwrite`)return(0,P.jsx)(i,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Entry "`,t.store,`/`,t.key,`" already exists. Overwrite with new value (`,t.value.length,` chars)?`]}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})})]})});let D=t.kind===`collect-store`?`STORE NAME`:t.kind===`collect-key`?`KEY NAME`:`VALUE`,O=t.kind===`collect-store`?`e.g. my-notes`:t.kind===`collect-key`?`e.g. todo-2026-05-08`:`free text`;return(0,P.jsx)(i,{title:`Local Memory · ${t.kind.replace(`collect-`,``).toUpperCase()}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsx)(o,{children:(0,P.jsx)(r,{dimColor:!0,children:D})}),(0,P.jsxs)(o,{children:[(0,P.jsx)(r,{children:`> `}),(0,P.jsx)(_,{value:l,onChange:e=>{d(e),C(null)},cursorOffset:v,onChangeCursorOffset:x,onSubmit:e=>{let n=e.trim();if(t.kind===`collect-store`){if(!n){C(`Store name required`);return}if(!y(n)){C(`Invalid store name (no /, \\, :, null byte, or leading dot; max 255 chars)`);return}t.action===`create`||t.action===`entries`||t.action===`archive`?t.action===`archive`?w({kind:`confirm-archive`,store:n}):E(t.action,n,void 0,void 0):w({kind:`collect-key`,action:t.action,store:n});return}if(t.kind===`collect-key`){if(!n){C(`Key required`);return}if(!f(n)){C(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}t.action===`fetch`?E(`fetch`,t.store,n,void 0):w({kind:`collect-value`,action:`store`,store:t.store,key:n});return}t.kind===`collect-value`&&E(`store`,t.store,t.key,e)},placeholder:O,columns:70,showCursor:!0})]}),S!==null&&(0,P.jsx)(o,{marginTop:0,children:(0,P.jsxs)(r,{color:`warning`,children:[`✗ `,S]})}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function M(e,t){if(e.action===`list`)return t(k(m()),{display:`system`}),null;if(e.action===`create`){let{store:n}=e;return h(n),t(`Store created: ${n}`,{display:`system`}),null}if(e.action===`store`){let{store:n,key:r,value:i}=e;return g(n,r,i),t(`Stored entry "${r}" in store "${n}".`,{display:`system`}),null}if(e.action===`fetch`){let{store:n,key:r}=e,i=b(n,r);return i===null?(t(`Entry not found: ${n}/${r}`,{display:`system`}),null):(t(`Entry fetched: ${n}/${r}\n${i}`,{display:`system`}),null)}if(e.action===`entries`){let{store:n}=e;return t(A(n,p(n)),{display:`system`}),null}if(e.action===`archive`){let{store:n}=e;return u(n),t(`Archived store: ${n}`,{display:`system`}),null}return t(F,{display:`system`}),null}var N,P,F,I,L,R,z;e((()=>{N=t(n(),1),a(),l(),d(),v(),T(),O(),S(),P=c(),F=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`,I=26,L=[{kind:`list`,label:`List`,description:`Show all stores`},{kind:`create`,label:`Create`,description:`Create a new memory store`},{kind:`store`,label:`Store`,description:`Write an entry: store name + key + value`},{kind:`fetch`,label:`Fetch`,description:`Read an entry by store name + key`},{kind:`entries`,label:`Entries`,description:`List entry keys in a store`},{kind:`archive`,label:`Archive`,description:`Archive a store (rename to *.archived)`},{kind:`about`,label:`About`,description:`Show command syntax`}],R=x({commandName:`local-memory`,parseArgs:e=>{let t=E(e);return t.action===`invalid`?{action:`invalid`,reason:`${F}\n${t.reason}`}:t},dispatch:M,View:C,errorView:e=>N.createElement(C,{mode:`error`,message:e})}),z=async(e,t,n)=>(n??``).trim()===``?(0,P.jsx)(j,{onDone:e}):R(e,t,n)}))();export{z as callLocalMemory};
3
+ `)}function j({onDone:e}){let[t,n]=N.useState({kind:`menu`}),[a,c]=N.useState(0),[f,p]=N.useState(``),[y,x]=N.useState(0),[S,C]=N.useState(null),w=N.useCallback(e=>{n(e),p(``),x(0),C(null)},[]),T=N.useCallback(t=>e(t,{display:`system`}),[e]),E=N.useCallback((e,t,n,r,i={})=>{try{if(e===`list`){T(k(u()));return}if(e===`about`){T(F);return}if(!t){C(`Internal: missing store`);return}if(e===`create`){l(t),T(`Store created: ${t}`);return}if(e===`entries`){T(A(t,h(t)));return}if(e===`archive`){v(t),T(`Archived store: ${t}`);return}if(e===`fetch`){if(!n){C(`Internal: missing key`);return}let e=_(t,n);if(e===null){T(`Entry not found: ${t}/${n}`);return}T(`Entry fetched: ${t}/${n}\n\n${e}`);return}if(e===`store`){if(!n||r===void 0){C(`Internal: missing key or value`);return}if(!i.confirmedOverwrite&&_(t,n)!==null){w({kind:`confirm-overwrite`,store:t,key:n,value:r});return}d(t,n,r),T(`Stored ${t}/${n} (${r.length} chars)`);return}}catch(e){C(e instanceof Error?e.message:String(e))}},[T,w]);if(s((e,n)=>{if(t.kind!==`menu`)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(L.length-1,e+1));return}if(n.return){let e=L[a];if(!e)return;if(e.kind===`list`||e.kind===`about`){E(e.kind,void 0,void 0,void 0);return}w({kind:`collect-store`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=L.length&&c(r-1)},{isActive:t.kind===`menu`}),s((e,n)=>{if(t.kind!==`confirm-archive`&&t.kind!==`confirm-overwrite`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();r===`y`||n.return?t.kind===`confirm-archive`?E(`archive`,t.store,void 0,void 0):E(`store`,t.store,t.key,t.value,{confirmedOverwrite:!0}):r===`n`&&w({kind:`menu`})},{isActive:t.kind===`confirm-archive`||t.kind===`confirm-overwrite`}),s((e,n)=>{if(!(t.kind!==`collect-store`&&t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:t.action,store:t.store});return}if(t.kind===`collect-key`){w({kind:`collect-store`,action:t.action});return}w({kind:`menu`})}},{isActive:t.kind===`collect-store`||t.kind===`collect-key`||t.kind===`collect-value`}),t.kind===`menu`)return(0,P.jsx)(i,{title:`Local Memory`,subtitle:`${L.length} actions`,onCancel:()=>T(`Local memory panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[L.map((e,t)=>(0,P.jsxs)(o,{flexDirection:`row`,children:[(0,P.jsx)(r,{children:`${t===a?`›`:` `} ${e.label}`.padEnd(I)}),(0,P.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-7 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-archive`)return(0,P.jsx)(i,{title:`Confirm Archive`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Archive store "`,t.store,`"? This renames it to *.archived.`]}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = archive · n/Esc = cancel`})})]})});if(t.kind===`confirm-overwrite`)return(0,P.jsx)(i,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsxs)(r,{children:[`Entry "`,t.store,`/`,t.key,`" already exists. Overwrite with new value (`,t.value.length,` chars)?`]}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})})]})});let D=t.kind===`collect-store`?`STORE NAME`:t.kind===`collect-key`?`KEY NAME`:`VALUE`,O=t.kind===`collect-store`?`e.g. my-notes`:t.kind===`collect-key`?`e.g. todo-2026-05-08`:`free text`;return(0,P.jsx)(i,{title:`Local Memory · ${t.kind.replace(`collect-`,``).toUpperCase()}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,P.jsxs)(o,{flexDirection:`column`,children:[(0,P.jsx)(o,{children:(0,P.jsx)(r,{dimColor:!0,children:D})}),(0,P.jsxs)(o,{children:[(0,P.jsx)(r,{children:`> `}),(0,P.jsx)(b,{value:f,onChange:e=>{p(e),C(null)},cursorOffset:y,onChangeCursorOffset:x,onSubmit:e=>{let n=e.trim();if(t.kind===`collect-store`){if(!n){C(`Store name required`);return}if(!m(n)){C(`Invalid store name (no /, \\, :, null byte, or leading dot; max 255 chars)`);return}t.action===`create`||t.action===`entries`||t.action===`archive`?t.action===`archive`?w({kind:`confirm-archive`,store:n}):E(t.action,n,void 0,void 0):w({kind:`collect-key`,action:t.action,store:n});return}if(t.kind===`collect-key`){if(!n){C(`Key required`);return}if(!g(n)){C(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}t.action===`fetch`?E(`fetch`,t.store,n,void 0):w({kind:`collect-value`,action:`store`,store:t.store,key:n});return}t.kind===`collect-value`&&E(`store`,t.store,t.key,e)},placeholder:O,columns:70,showCursor:!0})]}),S!==null&&(0,P.jsx)(o,{marginTop:0,children:(0,P.jsxs)(r,{color:`warning`,children:[`✗ `,S]})}),(0,P.jsx)(o,{marginTop:1,children:(0,P.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function M(e,t){if(e.action===`list`)return t(k(u()),{display:`system`}),null;if(e.action===`create`){let{store:n}=e;return l(n),t(`Store created: ${n}`,{display:`system`}),null}if(e.action===`store`){let{store:n,key:r,value:i}=e;return d(n,r,i),t(`Stored entry "${r}" in store "${n}".`,{display:`system`}),null}if(e.action===`fetch`){let{store:n,key:r}=e,i=_(n,r);return i===null?(t(`Entry not found: ${n}/${r}`,{display:`system`}),null):(t(`Entry fetched: ${n}/${r}\n${i}`,{display:`system`}),null)}if(e.action===`entries`){let{store:n}=e;return t(A(n,h(n)),{display:`system`}),null}if(e.action===`archive`){let{store:n}=e;return v(n),t(`Archived store: ${n}`,{display:`system`}),null}return t(F,{display:`system`}),null}var N,P,F,I,L,R,z;e((()=>{N=t(n(),1),a(),p(),f(),y(),T(),O(),S(),P=c(),F=`Usage: /local-memory list | create STORE | store STORE KEY VALUE | fetch STORE KEY | entries STORE | archive STORE`,I=26,L=[{kind:`list`,label:`List`,description:`Show all stores`},{kind:`create`,label:`Create`,description:`Create a new memory store`},{kind:`store`,label:`Store`,description:`Write an entry: store name + key + value`},{kind:`fetch`,label:`Fetch`,description:`Read an entry by store name + key`},{kind:`entries`,label:`Entries`,description:`List entry keys in a store`},{kind:`archive`,label:`Archive`,description:`Archive a store (rename to *.archived)`},{kind:`about`,label:`About`,description:`Show command syntax`}],R=x({commandName:`local-memory`,parseArgs:e=>{let t=E(e);return t.action===`invalid`?{action:`invalid`,reason:`${F}\n${t.reason}`}:t},dispatch:M,View:C,errorView:e=>N.createElement(C,{mode:`error`,message:e})}),z=async(e,t,n)=>(n??``).trim()===``?(0,P.jsx)(j,{onDone:e}):R(e,t,n)}))();export{z as callLocalMemory};
@@ -1,3 +1,3 @@
1
- import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Cf as l,Ef as u,Ff as d,If as f,Sf as p,Tf as m,dS as h,fS as g,wf as _,xf as v}from"./loadAgentsDir-BYWykYwn.js";import{n as y,t as b}from"./launchCommand-9eYsPG7W.js";function x(e){return e.mode===`list`?e.keys.length===0?(0,S.jsx)(o,{children:(0,S.jsx)(r,{dimColor:!0,children:`No secrets stored. Use /local-vault set <key> <value> to add one.`})}):(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsx)(o,{marginBottom:1,children:(0,S.jsxs)(r,{bold:!0,children:[`Local Vault Keys (`,e.keys.length,`)`]})}),e.keys.map(e=>(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{children:` `}),(0,S.jsx)(r,{color:`success`,children:`●`}),(0,S.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`set-ok`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Secret stored: `}),(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:` = [REDACTED]`})]}):e.mode===`get-masked`?(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{children:e.masked})]}),(0,S.jsx)(o,{marginTop:1,children:(0,S.jsxs)(r,{dimColor:!0,children:[`Use /local-vault get `,e.key,` --reveal to see the full value.`]})})]}):e.mode===`get-revealed`?(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{color:`warning`,children:e.value})]}),(0,S.jsx)(o,{marginTop:1,children:(0,S.jsx)(r,{dimColor:!0,color:`warning`,children:`⚠ Secret revealed in terminal — clear scrollback if this session is shared.`})})]}):e.mode===`not-found`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`error`,children:`Key not found: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):e.mode===`deleted`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Deleted: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):(0,S.jsx)(o,{children:(0,S.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var S,C=e((()=>{n(),a(),S=c()}));function w(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`set`){let e=n[1];if(!e)return{action:`invalid`,reason:`set requires a key name. ${T}`};if(E.test(e))return{action:`invalid`,reason:`Key name must not start with "-" or a hyphen-like character (reserved for flags). ${T}`};let t=n.slice(2).join(` `);return t?{action:`set`,key:e,value:t}:{action:`invalid`,reason:`set requires a value. ${T}`}}if(r===`get`){let e=[`--reveal`],t=n.filter(t=>!e.includes(t))[1];return t?{action:`get`,key:t,reveal:n.includes(`--reveal`)}:{action:`invalid`,reason:`get requires a key name. ${T}`}}if(r===`delete`){let e=n[1];return e?{action:`delete`,key:e}:{action:`invalid`,reason:`delete requires a key name. ${T}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${T}`}}var T,E,D=e((()=>{T=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,E=/^[-‐-―−﹘﹣-]/}));function O(e){return e.length===0?`No secrets stored.`:[`Local Vault Keys`,...e.map(e=>`- ${e}`)].join(`
2
- `)}function k({onDone:e}){let[t,n]=j.useState({kind:`menu`}),[a,c]=j.useState(0),[l,d]=j.useState(``),[g,y]=j.useState(0),[b,x]=j.useState(null),[S,C]=j.useState(!1),w=j.useCallback(e=>{n(e),d(``),y(0),x(null)},[]),T=j.useCallback(t=>e(t,{display:`system`}),[e]);s((e,n)=>{if(t.kind!==`menu`||S)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(F.length-1,e+1));return}if(n.return){let e=F[a];if(!e)return;if(e.kind===`about`){T(N);return}if(e.kind===`list`){C(!0),_().then(e=>{T(O(e))});return}w({kind:`collect-key`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=F.length&&c(r-1)},{isActive:t.kind===`menu`&&!S}),s((e,n)=>{if(t.kind!==`confirm-overwrite`&&t.kind!==`confirm-delete`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();if(r===`y`||n.return)if(t.kind===`confirm-delete`){C(!0);let e=t.key;v(e).then(t=>{T(t?`Deleted: ${e}`:`Key not found: ${e}`)})}else{C(!0);let e=t.key,n=t.value;u(e,n).then(()=>T(`Secret stored: ${e} = [REDACTED]`)).catch(t=>T(`Failed to store ${e}: ${t instanceof Error?t.message:String(t)}`))}else r===`n`&&w({kind:`menu`})},{isActive:(t.kind===`confirm-overwrite`||t.kind===`confirm-delete`)&&!S}),s((e,n)=>{if(!(t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:`set`});return}w({kind:`menu`})}},{isActive:(t.kind===`collect-key`||t.kind===`collect-value`)&&!S});let E=e=>{let n=e.trim();if(!n){x(`Key required`);return}if(!f(n)){x(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}if(t.kind===`collect-key`){if(t.action===`get`){C(!0),p(n).then(e=>{T(e===null?`Key not found: ${n}`:`Key found: ${n} = ${m(e)}`)});return}if(t.action===`delete`){w({kind:`confirm-delete`,key:n});return}if(t.action===`set`){w({kind:`collect-value`,key:n});return}}},D=e=>{if(t.kind!==`collect-value`)return;if(e.length===0){x(`Secret value cannot be empty`);return}let n=t.key;C(!0),p(n).then(t=>{if(t!==null){C(!1),w({kind:`confirm-overwrite`,key:n,value:e});return}return u(n,e).then(()=>T(`Secret stored: ${n} = [REDACTED]`))}).catch(e=>T(`Failed to store ${n}: ${e instanceof Error?e.message:String(e)}`))};if(t.kind===`menu`)return(0,M.jsx)(i,{title:`Local Vault`,subtitle:`${F.length} actions`,onCancel:()=>T(`Local vault panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[F.map((e,t)=>(0,M.jsxs)(o,{flexDirection:`row`,children:[(0,M.jsx)(r,{children:`${t===a?`›`:` `} ${e.label}`.padEnd(P)}),(0,M.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),S&&(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-5 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-delete`)return(0,M.jsx)(i,{title:`Confirm Delete`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Delete secret "`,t.key,`"? This cannot be undone.`]}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = delete · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Deleting...`})]})});if(t.kind===`confirm-overwrite`)return(0,M.jsx)(i,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Secret "`,t.key,`" already exists. Overwrite? Old value is lost.`]}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Storing...`})]})});let k=t.kind===`collect-key`?`KEY NAME`:`SECRET VALUE`,A=t.kind===`collect-key`?`e.g. github-token`:`(masked input — value never displayed)`,I=t.kind===`collect-key`?E:D,L=t.kind===`collect-value`;return(0,M.jsx)(i,{title:`Local Vault · ${t.kind===`collect-key`?`KEY`:`VALUE`}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsx)(o,{children:(0,M.jsx)(r,{dimColor:!0,children:k})}),(0,M.jsxs)(o,{children:[(0,M.jsx)(r,{children:`> `}),(0,M.jsx)(h,{value:l,onChange:e=>{d(e),x(null)},cursorOffset:g,onChangeCursorOffset:y,onSubmit:I,placeholder:A,columns:70,showCursor:!0,mask:L?`*`:void 0})]}),b!==null&&(0,M.jsx)(o,{marginTop:0,children:(0,M.jsxs)(r,{color:`warning`,children:[`✗ `,b]})}),S&&(0,M.jsx)(o,{marginTop:0,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function A(e,t){if(e.action===`list`)return t(O(await _()),{display:`system`}),null;if(e.action===`set`){let{key:n,value:r}=e;return await u(n,r),t(`Secret stored: ${n} = [REDACTED]`,{display:`system`}),null}if(e.action===`get`){let{key:n,reveal:r}=e,i=await p(n);return i===null?(t(`Key not found: ${n}`,{display:`system`}),null):r?(t([`Secret revealed for: ${n}`,`Warning: secret revealed in terminal.`,`${n} = ${i}`].join(`
3
- `),{display:`system`}),null):(t(`Key found: ${n} = ${m(i)}`,{display:`system`}),null)}if(e.action===`delete`){let{key:n}=e;return await v(n)?(t(`Deleted: ${n}`,{display:`system`}),null):(t(`Key not found: ${n}`,{display:`system`}),null)}return t(N,{display:`system`}),null}var j,M,N,P,F,I,L;e((()=>{j=t(n(),1),a(),l(),d(),g(),C(),D(),b(),M=c(),N=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,P=26,F=[{kind:`list`,label:`List`,description:`Show stored secret keys`},{kind:`set`,label:`Set`,description:`Store a secret: KEY + VALUE (input is masked)`},{kind:`get`,label:`Get`,description:`Look up a secret (returns masked preview)`},{kind:`delete`,label:`Delete`,description:`Delete a stored secret by KEY`},{kind:`about`,label:`About`,description:`Show command syntax`}],I=y({commandName:`local-vault`,parseArgs:e=>{let t=w(e);return t.action===`invalid`?{action:`invalid`,reason:`${N}\n${t.reason}`}:t},dispatch:A,View:x,errorView:e=>j.createElement(x,{mode:`error`,message:e})}),L=async(e,t,n)=>(n??``).trim()===``?(0,M.jsx)(k,{onDone:e}):I(e,t,n)}))();export{L as callLocalVault};
1
+ import{n as e,o as t}from"./chunk-DR8-3Aex.js";import{Rn as n,b as r,f as i,t as a,x as o,xt as s}from"./src-Di342QoJ.js";import{t as c}from"./jsx-runtime-D-D469L8.js";import{Cf as l,Df as u,Ef as d,Lf as f,Of as p,Rf as m,Tf as h,mS as g,pS as _,wf as v}from"./loadAgentsDir-BfEZacjM.js";import{n as y,t as b}from"./launchCommand-9eYsPG7W.js";function x(e){return e.mode===`list`?e.keys.length===0?(0,S.jsx)(o,{children:(0,S.jsx)(r,{dimColor:!0,children:`No secrets stored. Use /local-vault set <key> <value> to add one.`})}):(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsx)(o,{marginBottom:1,children:(0,S.jsxs)(r,{bold:!0,children:[`Local Vault Keys (`,e.keys.length,`)`]})}),e.keys.map(e=>(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{children:` `}),(0,S.jsx)(r,{color:`success`,children:`●`}),(0,S.jsxs)(r,{children:[` `,e]})]},e))]}):e.mode===`set-ok`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Secret stored: `}),(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:` = [REDACTED]`})]}):e.mode===`get-masked`?(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{children:e.masked})]}),(0,S.jsx)(o,{marginTop:1,children:(0,S.jsxs)(r,{dimColor:!0,children:[`Use /local-vault get `,e.key,` --reveal to see the full value.`]})})]}):e.mode===`get-revealed`?(0,S.jsxs)(o,{flexDirection:`column`,children:[(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{bold:!0,children:e.key}),(0,S.jsx)(r,{dimColor:!0,children:`: `}),(0,S.jsx)(r,{color:`warning`,children:e.value})]}),(0,S.jsx)(o,{marginTop:1,children:(0,S.jsx)(r,{dimColor:!0,color:`warning`,children:`⚠ Secret revealed in terminal — clear scrollback if this session is shared.`})})]}):e.mode===`not-found`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`error`,children:`Key not found: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):e.mode===`deleted`?(0,S.jsxs)(o,{children:[(0,S.jsx)(r,{color:`success`,children:`✓`}),(0,S.jsx)(r,{children:` Deleted: `}),(0,S.jsx)(r,{bold:!0,children:e.key})]}):(0,S.jsx)(o,{children:(0,S.jsxs)(r,{color:`error`,children:[`Error: `,e.message]})})}var S,C=e((()=>{n(),a(),S=c()}));function w(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.split(/\s+/),r=n[0];if(r===`list`)return{action:`list`};if(r===`set`){let e=n[1];if(!e)return{action:`invalid`,reason:`set requires a key name. ${T}`};if(E.test(e))return{action:`invalid`,reason:`Key name must not start with "-" or a hyphen-like character (reserved for flags). ${T}`};let t=n.slice(2).join(` `);return t?{action:`set`,key:e,value:t}:{action:`invalid`,reason:`set requires a value. ${T}`}}if(r===`get`){let e=[`--reveal`],t=n.filter(t=>!e.includes(t))[1];return t?{action:`get`,key:t,reveal:n.includes(`--reveal`)}:{action:`invalid`,reason:`get requires a key name. ${T}`}}if(r===`delete`){let e=n[1];return e?{action:`delete`,key:e}:{action:`invalid`,reason:`delete requires a key name. ${T}`}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${T}`}}var T,E,D=e((()=>{T=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,E=/^[-‐-―−﹘﹣-]/}));function O(e){return e.length===0?`No secrets stored.`:[`Local Vault Keys`,...e.map(e=>`- ${e}`)].join(`
2
+ `)}function k({onDone:e}){let[t,n]=j.useState({kind:`menu`}),[a,c]=j.useState(0),[f,h]=j.useState(``),[g,y]=j.useState(0),[b,x]=j.useState(null),[S,C]=j.useState(!1),w=j.useCallback(e=>{n(e),h(``),y(0),x(null)},[]),T=j.useCallback(t=>e(t,{display:`system`}),[e]);s((e,n)=>{if(t.kind!==`menu`||S)return;if(n.upArrow){c(e=>Math.max(0,e-1));return}if(n.downArrow){c(e=>Math.min(F.length-1,e+1));return}if(n.return){let e=F[a];if(!e)return;if(e.kind===`about`){T(N);return}if(e.kind===`list`){C(!0),d().then(e=>{T(O(e))});return}w({kind:`collect-key`,action:e.kind});return}let r=Number(e);Number.isInteger(r)&&r>=1&&r<=F.length&&c(r-1)},{isActive:t.kind===`menu`&&!S}),s((e,n)=>{if(t.kind!==`confirm-overwrite`&&t.kind!==`confirm-delete`)return;if(n.escape){w({kind:`menu`});return}let r=e.toLowerCase();if(r===`y`||n.return)if(t.kind===`confirm-delete`){C(!0);let e=t.key;l(e).then(t=>{T(t?`Deleted: ${e}`:`Key not found: ${e}`)})}else{C(!0);let e=t.key,n=t.value;p(e,n).then(()=>T(`Secret stored: ${e} = [REDACTED]`)).catch(t=>T(`Failed to store ${e}: ${t instanceof Error?t.message:String(t)}`))}else r===`n`&&w({kind:`menu`})},{isActive:(t.kind===`confirm-overwrite`||t.kind===`confirm-delete`)&&!S}),s((e,n)=>{if(!(t.kind!==`collect-key`&&t.kind!==`collect-value`)&&n.escape){if(t.kind===`collect-value`){w({kind:`collect-key`,action:`set`});return}w({kind:`menu`})}},{isActive:(t.kind===`collect-key`||t.kind===`collect-value`)&&!S});let E=e=>{let n=e.trim();if(!n){x(`Key required`);return}if(!m(n)){x(`Invalid key (allowed: letters/digits/._- only; no leading dot; not a Windows reserved name)`);return}if(t.kind===`collect-key`){if(t.action===`get`){C(!0),v(n).then(e=>{T(e===null?`Key not found: ${n}`:`Key found: ${n} = ${u(e)}`)});return}if(t.action===`delete`){w({kind:`confirm-delete`,key:n});return}if(t.action===`set`){w({kind:`collect-value`,key:n});return}}},D=e=>{if(t.kind!==`collect-value`)return;if(e.length===0){x(`Secret value cannot be empty`);return}let n=t.key;C(!0),v(n).then(t=>{if(t!==null){C(!1),w({kind:`confirm-overwrite`,key:n,value:e});return}return p(n,e).then(()=>T(`Secret stored: ${n} = [REDACTED]`))}).catch(e=>T(`Failed to store ${n}: ${e instanceof Error?e.message:String(e)}`))};if(t.kind===`menu`)return(0,M.jsx)(i,{title:`Local Vault`,subtitle:`${F.length} actions`,onCancel:()=>T(`Local vault panel dismissed`),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[F.map((e,t)=>(0,M.jsxs)(o,{flexDirection:`row`,children:[(0,M.jsx)(r,{children:`${t===a?`›`:` `} ${e.label}`.padEnd(P)}),(0,M.jsx)(r,{dimColor:!0,children:e.description})]},e.kind)),S&&(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`↑/↓ or 1-5 select · Enter run · Esc close`})})]})});if(t.kind===`confirm-delete`)return(0,M.jsx)(i,{title:`Confirm Delete`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Delete secret "`,t.key,`"? This cannot be undone.`]}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = delete · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Deleting...`})]})});if(t.kind===`confirm-overwrite`)return(0,M.jsx)(i,{title:`Confirm Overwrite`,onCancel:()=>w({kind:`menu`}),color:`warning`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsxs)(r,{children:[`Secret "`,t.key,`" already exists. Overwrite? Old value is lost.`]}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`y/Enter = overwrite · n/Esc = cancel`})}),S&&(0,M.jsx)(r,{dimColor:!0,children:`Storing...`})]})});let k=t.kind===`collect-key`?`KEY NAME`:`SECRET VALUE`,A=t.kind===`collect-key`?`e.g. github-token`:`(masked input — value never displayed)`,I=t.kind===`collect-key`?E:D,L=t.kind===`collect-value`;return(0,M.jsx)(i,{title:`Local Vault · ${t.kind===`collect-key`?`KEY`:`VALUE`}`,onCancel:()=>w({kind:`menu`}),color:`background`,hideInputGuide:!0,children:(0,M.jsxs)(o,{flexDirection:`column`,children:[(0,M.jsx)(o,{children:(0,M.jsx)(r,{dimColor:!0,children:k})}),(0,M.jsxs)(o,{children:[(0,M.jsx)(r,{children:`> `}),(0,M.jsx)(_,{value:f,onChange:e=>{h(e),x(null)},cursorOffset:g,onChangeCursorOffset:y,onSubmit:I,placeholder:A,columns:70,showCursor:!0,mask:L?`*`:void 0})]}),b!==null&&(0,M.jsx)(o,{marginTop:0,children:(0,M.jsxs)(r,{color:`warning`,children:[`✗ `,b]})}),S&&(0,M.jsx)(o,{marginTop:0,children:(0,M.jsx)(r,{dimColor:!0,children:`Working...`})}),(0,M.jsx)(o,{marginTop:1,children:(0,M.jsx)(r,{dimColor:!0,children:`Enter = next · Esc = back`})})]})})}async function A(e,t){if(e.action===`list`)return t(O(await d()),{display:`system`}),null;if(e.action===`set`){let{key:n,value:r}=e;return await p(n,r),t(`Secret stored: ${n} = [REDACTED]`,{display:`system`}),null}if(e.action===`get`){let{key:n,reveal:r}=e,i=await v(n);return i===null?(t(`Key not found: ${n}`,{display:`system`}),null):r?(t([`Secret revealed for: ${n}`,`Warning: secret revealed in terminal.`,`${n} = ${i}`].join(`
3
+ `),{display:`system`}),null):(t(`Key found: ${n} = ${u(i)}`,{display:`system`}),null)}if(e.action===`delete`){let{key:n}=e;return await l(n)?(t(`Deleted: ${n}`,{display:`system`}),null):(t(`Key not found: ${n}`,{display:`system`}),null)}return t(N,{display:`system`}),null}var j,M,N,P,F,I,L;e((()=>{j=t(n(),1),a(),h(),f(),g(),C(),D(),b(),M=c(),N=`Usage: /local-vault list | set KEY VALUE | get KEY [--reveal] | delete KEY`,P=26,F=[{kind:`list`,label:`List`,description:`Show stored secret keys`},{kind:`set`,label:`Set`,description:`Store a secret: KEY + VALUE (input is masked)`},{kind:`get`,label:`Get`,description:`Look up a secret (returns masked preview)`},{kind:`delete`,label:`Delete`,description:`Delete a stored secret by KEY`},{kind:`about`,label:`About`,description:`Show command syntax`}],I=y({commandName:`local-vault`,parseArgs:e=>{let t=w(e);return t.action===`invalid`?{action:`invalid`,reason:`${N}\n${t.reason}`}:t},dispatch:A,View:x,errorView:e=>j.createElement(x,{mode:`error`,message:e})}),L=async(e,t,n)=>(n??``).trim()===``?(0,M.jsx)(k,{onDone:e}):I(e,t,n)}))();export{L as callLocalVault};
@@ -1 +1 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{o as f,u as p}from"./api-hcsOinLV.js";import{n as m,r as h}from"./hostGuard-DSOEyH-P.js";import{n as g,t as _}from"./launchCommand-9eYsPG7W.js";function v(e){return new Promise(t=>setTimeout(t,e))}async function y(){let e;try{e=(await p()).apiKey}catch(e){throw new L(e instanceof Error?e.message:String(e),501)}return m(b()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":F,"content-type":`application/json`}}function b(){return`${u().BASE_API_URL}/v1/memory_stores`}function x(e){if(t.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new L(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new L(`Subscription required. Memory stores require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new L(`Memory store or memory not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new L(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new L((e.response?.data)?.error?.message??e.message,t)}return e instanceof L?e:new L(e instanceof Error?e.message:String(e),0)}function S(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function C(e){let n;for(let r=0;r<I;r++)try{return await e()}catch(e){let i=x(e);if(i.statusCode>=500){n=i,r<I-1&&await v(S(t.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw n??new L(`Request failed after retries`,0)}async function w(){return C(async()=>{let e=await y();return(await t.get(b(),{headers:e})).data.data??[]})}async function T(e,n){return C(async()=>{let r=await y(),i={name:e};return n&&(i.namespace=n),(await t.post(b(),i,{headers:r})).data})}async function E(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}`,{headers:n})).data})}async function D(e){return C(async()=>{let n=await y();return(await t.post(`${b()}/${e}/archive`,{},{headers:n})).data})}async function O(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}/memories`,{headers:n})).data.data??[]})}async function k(e,n){return C(async()=>{let r=await y(),i={content:n};return(await t.post(`${b()}/${e}/memories`,i,{headers:r})).data})}async function A(e,n){return C(async()=>{let r=await y();return(await t.get(`${b()}/${e}/memories/${n}`,{headers:r})).data})}async function j(e,n,r){return C(async()=>{let i=await y(),a={content:r};return(await t.patch(`${b()}/${e}/memories/${n}`,a,{headers:i})).data})}async function M(e,n){return C(async()=>{let r=await y();await t.delete(`${b()}/${e}/memories/${n}`,{headers:r})})}async function N(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}/memory_versions`,{headers:n})).data.data??[]})}async function P(e,n){return C(async()=>{let r=await y();return(await t.post(`${b()}/${e}/memory_versions/${n}/redact`,{},{headers:r})).data})}var F,I,L,R=e((()=>{n(),d(),h(),f(),F=`managed-agents-2026-04-01`,I=3,L=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`MemoryStoresApiError`}}}));function z({store:e}){let t=!!e.archived_at,n=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsxs)(o,{children:[(0,V.jsx)(i,{bold:!0,children:e.memory_store_id}),(0,V.jsx)(i,{dimColor:!0,children:` · `}),(0,V.jsx)(i,{color:t?`warning`:`success`,children:t?`archived`:`active`}),e.namespace?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(i,{dimColor:!0,children:` · ns: `}),(0,V.jsx)(i,{children:e.namespace})]}):null]}),(0,V.jsxs)(i,{children:[`Name: `,e.name]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,n]})]})}function B(e){if(e.mode===`list`)return e.stores.length===0?(0,V.jsx)(o,{children:(0,V.jsx)(i,{dimColor:!0,children:`No memory stores found. Use /memory-stores create <name> to create one.`})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,V.jsx)(z,{store:e},e.memory_store_id))]});if(e.mode===`detail`){let{store:t}=e,n=!!t.archived_at,r=t.created_at?new Date(t.created_at).toLocaleString():`—`,a=t.archived_at?new Date(t.archived_at).toLocaleString():null;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Store: `,t.memory_store_id]})}),(0,V.jsxs)(i,{children:[`Name: `,t.name]}),t.namespace?(0,V.jsxs)(i,{children:[`Namespace: `,t.namespace]}):null,(0,V.jsxs)(i,{children:[`Status:`,` `,(0,V.jsx)(i,{color:n?`warning`:`success`,children:n?`archived`:`active`})]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,r]}),a?(0,V.jsxs)(i,{dimColor:!0,children:[`Archived: `,a]}):null]})}if(e.mode===`created`){let{store:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory store created`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_store_id]}),(0,V.jsxs)(i,{children:[`Name: `,t.name]}),t.namespace?(0,V.jsxs)(i,{children:[`Namespace: `,t.namespace]}):null]})}if(e.mode===`archived`){let{store:t}=e,n=t.archived_at?new Date(t.archived_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`warning`,children:`Memory store archived`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_store_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Archived at: `,n]})]})}if(e.mode===`memory-list`){let{storeId:t,memories:n}=e;return n.length===0?(0,V.jsx)(o,{children:(0,V.jsxs)(i,{dimColor:!0,children:[`No memories in store `,t,`. Use /memory-stores create-memory `,t,` <content> to add one.`]})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memories in `,t,` (`,n.length,`)`]})}),n.map(e=>(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(i,{bold:!0,children:e.memory_id}),(0,V.jsx)(i,{dimColor:!0,children:e.content.length>80?`${e.content.slice(0,80)}…`:e.content})]},e.memory_id))]})}if(e.mode===`memory-detail`){let{memory:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`,r=t.updated_at?new Date(t.updated_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory: `,t.memory_id]})}),(0,V.jsxs)(i,{children:[`Store: `,t.memory_store_id]}),(0,V.jsxs)(i,{children:[`Content: `,t.content]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,n]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Updated: `,r]})]})}if(e.mode===`memory-created`){let{memory:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory created`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_id]}),(0,V.jsxs)(i,{children:[`Store: `,t.memory_store_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-updated`){let{memory:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory updated`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-deleted`)return(0,V.jsx)(o,{children:(0,V.jsxs)(i,{color:`success`,children:[`Memory `,e.memoryId,` deleted from store `,e.storeId,`.`]})});if(e.mode===`versions`){let{storeId:t,versions:n}=e;return n.length===0?(0,V.jsx)(o,{children:(0,V.jsxs)(i,{dimColor:!0,children:[`No memory versions found for store `,t,`.`]})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Versions in `,t,` (`,n.length,`)`]})}),n.map(e=>{let t=e.created_at?new Date(e.created_at).toLocaleString():`—`,n=!!e.redacted_at;return(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsxs)(o,{children:[(0,V.jsx)(i,{bold:!0,children:e.version_id}),n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(i,{dimColor:!0,children:` · `}),(0,V.jsx)(i,{color:`warning`,children:`redacted`})]}):null]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,t]})]},e.version_id)})]})}if(e.mode===`redacted`){let{version:t}=e,n=t.redacted_at?new Date(t.redacted_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`warning`,children:`Version redacted`})}),(0,V.jsxs)(i,{children:[`ID: `,t.version_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Redacted at: `,n]})]})}return(0,V.jsx)(o,{children:(0,V.jsx)(i,{color:`error`,children:e.message})})}var V,H=e((()=>{r(),a(),V=s()}));function U(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a store id`}}if(r===`create`)return i?{action:`create`,name:i}:{action:`invalid`,reason:`create requires a store name, e.g. create "My Work Store"`};if(r===`archive`){if(!i)return{action:`invalid`,reason:`archive requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`archive`,id:e}:{action:`invalid`,reason:`archive requires a store id`}}if(r===`memories`){if(!i)return{action:`invalid`,reason:`memories requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`memories`,storeId:e}:{action:`invalid`,reason:`memories requires a store id`}}if(r===`create-memory`){let e=i.split(/\s+/);if(e.length<2||!e[0])return{action:`invalid`,reason:`create-memory requires a store id and content, e.g. create-memory ms_123 "The content"`};let t=e[0],n=e.slice(1).join(` `);return n.trim()?{action:`create-memory`,storeId:t,content:n.trim()}:{action:`invalid`,reason:`create-memory requires non-empty content`}}if(r===`get-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`get-memory requires a store id and memory id, e.g. get-memory ms_123 mem_456`}:{action:`get-memory`,storeId:e[0],memoryId:e[1]}}if(r===`update-memory`){let e=i.split(/\s+/);if(e.length<3||!e[0]||!e[1])return{action:`invalid`,reason:`update-memory requires store id, memory id, and content, e.g. update-memory ms_123 mem_456 "New content"`};let t=e[0],n=e[1],r=e.slice(2).join(` `);return r.trim()?{action:`update-memory`,storeId:t,memoryId:n,content:r.trim()}:{action:`invalid`,reason:`update-memory requires non-empty content`}}if(r===`delete-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`delete-memory requires a store id and memory id, e.g. delete-memory ms_123 mem_456`}:{action:`delete-memory`,storeId:e[0],memoryId:e[1]}}if(r===`versions`){if(!i)return{action:`invalid`,reason:`versions requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`versions`,storeId:e}:{action:`invalid`,reason:`versions requires a store id`}}if(r===`redact`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`redact requires a store id and version id, e.g. redact ms_123 ver_456`}:{action:`redact`,storeId:e[0],versionId:e[1]}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${W}`}}var W,G=e((()=>{W=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`}));async function K(e,t){if(e.action===`list`){l(`tengu_memory_stores_list`,{});try{let e=await w();return t(e.length===0?`No memory stores found.`:`${e.length} memory store(s).`,{display:`system`}),{mode:`list`,stores:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to list memory stores: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`get`){let{id:n}=e;l(`tengu_memory_stores_get`,{id:n});try{let e=await E(n);return t(`Memory store ${n} fetched.`,{display:`system`}),{mode:`detail`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to get memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create`){let{name:n}=e;l(`tengu_memory_stores_create`,{name:n});try{let e=await T(n);return t(`Memory store created: ${e.memory_store_id}`,{display:`system`}),{mode:`created`,store:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to create memory store: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`archive`){let{id:n}=e;l(`tengu_memory_stores_archive`,{id:n});try{let e=await D(n);return t(`Memory store ${n} archived.`,{display:`system`}),{mode:`archived`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to archive memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`memories`){let{storeId:n}=e;l(`tengu_memory_stores_list_memories`,{storeId:n});try{let e=await O(n);return t(e.length===0?`No memories in store ${n}.`:`${e.length} memory(ies) in store ${n}.`,{display:`system`}),{mode:`memory-list`,storeId:n,memories:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list memories in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create-memory`){let{storeId:n,content:r}=e;l(`tengu_memory_stores_create_memory`,{storeId:n});try{let e=await k(n,r);return t(`Memory created: ${e.memory_id}`,{display:`system`}),{mode:`memory-created`,memory:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to create memory in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`get-memory`){let{storeId:n,memoryId:r}=e;l(`tengu_memory_stores_get_memory`,{storeId:n});try{let e=await A(n,r);return t(`Memory ${r} fetched.`,{display:`system`}),{mode:`memory-detail`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to get memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`update-memory`){let{storeId:n,memoryId:r,content:i}=e;l(`tengu_memory_stores_update_memory`,{storeId:n});try{let e=await j(n,r,i);return t(`Memory ${r} updated.`,{display:`system`}),{mode:`memory-updated`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to update memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete-memory`){let{storeId:n,memoryId:r}=e;l(`tengu_memory_stores_delete_memory`,{storeId:n});try{return await M(n,r),t(`Memory ${r} deleted.`,{display:`system`}),{mode:`memory-deleted`,storeId:n,memoryId:r}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to delete memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`versions`){let{storeId:n}=e;l(`tengu_memory_stores_versions`,{storeId:n});try{let e=await N(n);return t(e.length===0?`No memory versions found for store ${n}.`:`${e.length} version(s) in store ${n}.`,{display:`system`}),{mode:`versions`,storeId:n,versions:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list versions for store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{storeId:n,versionId:r}=e;l(`tengu_memory_stores_redact`,{storeId:n});try{let e=await P(n,r);return t(`Version ${r} redacted.`,{display:`system`}),{mode:`redacted`,version:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to redact version ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}var q,J;e((()=>{c(),R(),H(),G(),_(),q=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`,J=g({commandName:`memory-stores`,parseArgs:e=>{l(`tengu_memory_stores_started`,{args:e});let t=U(e);return t.action===`invalid`?(l(`tengu_memory_stores_failed`,{reason:t.reason}),{action:`invalid`,reason:`${q}\n${t.reason}`}):t},dispatch:K,View:B,errorView:e=>null})}))();export{J as callMemoryStores};
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{n as t,t as n}from"./axios-DhfaybwJ.js";import{Rn as r,b as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{n as c,r as l}from"./analytics-DqMQntaB.js";import{l as u,u as d}from"./oauth-CdZEzMww.js";import{o as f,u as p}from"./api-C-KY7A3r.js";import{n as m,r as h}from"./hostGuard-DSOEyH-P.js";import{n as g,t as _}from"./launchCommand-9eYsPG7W.js";function v(e){return new Promise(t=>setTimeout(t,e))}async function y(){let e;try{e=(await p()).apiKey}catch(e){throw new L(e instanceof Error?e.message:String(e),501)}return m(b()),{"x-api-key":e,"anthropic-version":`2023-06-01`,"anthropic-beta":F,"content-type":`application/json`}}function b(){return`${u().BASE_API_URL}/v1/memory_stores`}function x(e){if(t.isAxiosError(e)){let t=e.response?.status??0;if(t===401)return new L(`Authentication failed. Please run /login to re-authenticate.`,401);if(t===403)return new L(`Subscription required. Memory stores require a Claude Pro/Max/Team subscription.`,403);if(t===404)return new L(`Memory store or memory not found.`,404);if(t===429){let t=e.response?.headers?.[`retry-after`]??``;return new L(`Rate limit exceeded.${t?` Retry after ${t}s.`:``}`,429)}return new L((e.response?.data)?.error?.message??e.message,t)}return e instanceof L?e:new L(e instanceof Error?e.message:String(e),0)}function S(e){if(!e)return null;let t=Number(e);if(!Number.isNaN(t)&&t>=0)return t*1e3;let n=Date.parse(e);return Number.isNaN(n)?null:Math.max(0,n-Date.now())}async function C(e){let n;for(let r=0;r<I;r++)try{return await e()}catch(e){let i=x(e);if(i.statusCode>=500){n=i,r<I-1&&await v(S(t.isAxiosError(e)?e.response?.headers?.[`retry-after`]:void 0)??500*2**r);continue}throw i}throw n??new L(`Request failed after retries`,0)}async function w(){return C(async()=>{let e=await y();return(await t.get(b(),{headers:e})).data.data??[]})}async function T(e,n){return C(async()=>{let r=await y(),i={name:e};return n&&(i.namespace=n),(await t.post(b(),i,{headers:r})).data})}async function E(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}`,{headers:n})).data})}async function D(e){return C(async()=>{let n=await y();return(await t.post(`${b()}/${e}/archive`,{},{headers:n})).data})}async function O(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}/memories`,{headers:n})).data.data??[]})}async function k(e,n){return C(async()=>{let r=await y(),i={content:n};return(await t.post(`${b()}/${e}/memories`,i,{headers:r})).data})}async function A(e,n){return C(async()=>{let r=await y();return(await t.get(`${b()}/${e}/memories/${n}`,{headers:r})).data})}async function j(e,n,r){return C(async()=>{let i=await y(),a={content:r};return(await t.patch(`${b()}/${e}/memories/${n}`,a,{headers:i})).data})}async function M(e,n){return C(async()=>{let r=await y();await t.delete(`${b()}/${e}/memories/${n}`,{headers:r})})}async function N(e){return C(async()=>{let n=await y();return(await t.get(`${b()}/${e}/memory_versions`,{headers:n})).data.data??[]})}async function P(e,n){return C(async()=>{let r=await y();return(await t.post(`${b()}/${e}/memory_versions/${n}/redact`,{},{headers:r})).data})}var F,I,L,R=e((()=>{n(),d(),h(),f(),F=`managed-agents-2026-04-01`,I=3,L=class extends Error{constructor(e,t){super(e),this.statusCode=t,this.name=`MemoryStoresApiError`}}}));function z({store:e}){let t=!!e.archived_at,n=e.created_at?new Date(e.created_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsxs)(o,{children:[(0,V.jsx)(i,{bold:!0,children:e.memory_store_id}),(0,V.jsx)(i,{dimColor:!0,children:` · `}),(0,V.jsx)(i,{color:t?`warning`:`success`,children:t?`archived`:`active`}),e.namespace?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(i,{dimColor:!0,children:` · ns: `}),(0,V.jsx)(i,{children:e.namespace})]}):null]}),(0,V.jsxs)(i,{children:[`Name: `,e.name]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,n]})]})}function B(e){if(e.mode===`list`)return e.stores.length===0?(0,V.jsx)(o,{children:(0,V.jsx)(i,{dimColor:!0,children:`No memory stores found. Use /memory-stores create <name> to create one.`})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Stores (`,e.stores.length,`)`]})}),e.stores.map(e=>(0,V.jsx)(z,{store:e},e.memory_store_id))]});if(e.mode===`detail`){let{store:t}=e,n=!!t.archived_at,r=t.created_at?new Date(t.created_at).toLocaleString():`—`,a=t.archived_at?new Date(t.archived_at).toLocaleString():null;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Store: `,t.memory_store_id]})}),(0,V.jsxs)(i,{children:[`Name: `,t.name]}),t.namespace?(0,V.jsxs)(i,{children:[`Namespace: `,t.namespace]}):null,(0,V.jsxs)(i,{children:[`Status:`,` `,(0,V.jsx)(i,{color:n?`warning`:`success`,children:n?`archived`:`active`})]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,r]}),a?(0,V.jsxs)(i,{dimColor:!0,children:[`Archived: `,a]}):null]})}if(e.mode===`created`){let{store:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory store created`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_store_id]}),(0,V.jsxs)(i,{children:[`Name: `,t.name]}),t.namespace?(0,V.jsxs)(i,{children:[`Namespace: `,t.namespace]}):null]})}if(e.mode===`archived`){let{store:t}=e,n=t.archived_at?new Date(t.archived_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`warning`,children:`Memory store archived`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_store_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Archived at: `,n]})]})}if(e.mode===`memory-list`){let{storeId:t,memories:n}=e;return n.length===0?(0,V.jsx)(o,{children:(0,V.jsxs)(i,{dimColor:!0,children:[`No memories in store `,t,`. Use /memory-stores create-memory `,t,` <content> to add one.`]})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memories in `,t,` (`,n.length,`)`]})}),n.map(e=>(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsx)(i,{bold:!0,children:e.memory_id}),(0,V.jsx)(i,{dimColor:!0,children:e.content.length>80?`${e.content.slice(0,80)}…`:e.content})]},e.memory_id))]})}if(e.mode===`memory-detail`){let{memory:t}=e,n=t.created_at?new Date(t.created_at).toLocaleString():`—`,r=t.updated_at?new Date(t.updated_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory: `,t.memory_id]})}),(0,V.jsxs)(i,{children:[`Store: `,t.memory_store_id]}),(0,V.jsxs)(i,{children:[`Content: `,t.content]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,n]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Updated: `,r]})]})}if(e.mode===`memory-created`){let{memory:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory created`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_id]}),(0,V.jsxs)(i,{children:[`Store: `,t.memory_store_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-updated`){let{memory:t}=e;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`success`,children:`Memory updated`})}),(0,V.jsxs)(i,{children:[`ID: `,t.memory_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Content: `,t.content]})]})}if(e.mode===`memory-deleted`)return(0,V.jsx)(o,{children:(0,V.jsxs)(i,{color:`success`,children:[`Memory `,e.memoryId,` deleted from store `,e.storeId,`.`]})});if(e.mode===`versions`){let{storeId:t,versions:n}=e;return n.length===0?(0,V.jsx)(o,{children:(0,V.jsxs)(i,{dimColor:!0,children:[`No memory versions found for store `,t,`.`]})}):(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{marginBottom:1,children:(0,V.jsxs)(i,{bold:!0,children:[`Memory Versions in `,t,` (`,n.length,`)`]})}),n.map(e=>{let t=e.created_at?new Date(e.created_at).toLocaleString():`—`,n=!!e.redacted_at;return(0,V.jsxs)(o,{flexDirection:`column`,marginBottom:1,children:[(0,V.jsxs)(o,{children:[(0,V.jsx)(i,{bold:!0,children:e.version_id}),n?(0,V.jsxs)(V.Fragment,{children:[(0,V.jsx)(i,{dimColor:!0,children:` · `}),(0,V.jsx)(i,{color:`warning`,children:`redacted`})]}):null]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Created: `,t]})]},e.version_id)})]})}if(e.mode===`redacted`){let{version:t}=e,n=t.redacted_at?new Date(t.redacted_at).toLocaleString():`—`;return(0,V.jsxs)(o,{flexDirection:`column`,children:[(0,V.jsx)(o,{children:(0,V.jsx)(i,{bold:!0,color:`warning`,children:`Version redacted`})}),(0,V.jsxs)(i,{children:[`ID: `,t.version_id]}),(0,V.jsxs)(i,{dimColor:!0,children:[`Redacted at: `,n]})]})}return(0,V.jsx)(o,{children:(0,V.jsx)(i,{color:`error`,children:e.message})})}var V,H=e((()=>{r(),a(),V=s()}));function U(e){let t=e.trim();if(t===``||t===`list`)return{action:`list`};let n=t.indexOf(` `),r=n===-1?t:t.slice(0,n),i=n===-1?``:t.slice(n+1).trim();if(r===`get`){if(!i)return{action:`invalid`,reason:`get requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`get`,id:e}:{action:`invalid`,reason:`get requires a store id`}}if(r===`create`)return i?{action:`create`,name:i}:{action:`invalid`,reason:`create requires a store name, e.g. create "My Work Store"`};if(r===`archive`){if(!i)return{action:`invalid`,reason:`archive requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`archive`,id:e}:{action:`invalid`,reason:`archive requires a store id`}}if(r===`memories`){if(!i)return{action:`invalid`,reason:`memories requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`memories`,storeId:e}:{action:`invalid`,reason:`memories requires a store id`}}if(r===`create-memory`){let e=i.split(/\s+/);if(e.length<2||!e[0])return{action:`invalid`,reason:`create-memory requires a store id and content, e.g. create-memory ms_123 "The content"`};let t=e[0],n=e.slice(1).join(` `);return n.trim()?{action:`create-memory`,storeId:t,content:n.trim()}:{action:`invalid`,reason:`create-memory requires non-empty content`}}if(r===`get-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`get-memory requires a store id and memory id, e.g. get-memory ms_123 mem_456`}:{action:`get-memory`,storeId:e[0],memoryId:e[1]}}if(r===`update-memory`){let e=i.split(/\s+/);if(e.length<3||!e[0]||!e[1])return{action:`invalid`,reason:`update-memory requires store id, memory id, and content, e.g. update-memory ms_123 mem_456 "New content"`};let t=e[0],n=e[1],r=e.slice(2).join(` `);return r.trim()?{action:`update-memory`,storeId:t,memoryId:n,content:r.trim()}:{action:`invalid`,reason:`update-memory requires non-empty content`}}if(r===`delete-memory`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`delete-memory requires a store id and memory id, e.g. delete-memory ms_123 mem_456`}:{action:`delete-memory`,storeId:e[0],memoryId:e[1]}}if(r===`versions`){if(!i)return{action:`invalid`,reason:`versions requires a store id`};let e=i.split(/\s+/)[0];return e?{action:`versions`,storeId:e}:{action:`invalid`,reason:`versions requires a store id`}}if(r===`redact`){let e=i.split(/\s+/);return e.length<2||!e[0]||!e[1]?{action:`invalid`,reason:`redact requires a store id and version id, e.g. redact ms_123 ver_456`}:{action:`redact`,storeId:e[0],versionId:e[1]}}return{action:`invalid`,reason:`Unknown sub-command "${r}". ${W}`}}var W,G=e((()=>{W=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`}));async function K(e,t){if(e.action===`list`){l(`tengu_memory_stores_list`,{});try{let e=await w();return t(e.length===0?`No memory stores found.`:`${e.length} memory store(s).`,{display:`system`}),{mode:`list`,stores:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to list memory stores: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`get`){let{id:n}=e;l(`tengu_memory_stores_get`,{id:n});try{let e=await E(n);return t(`Memory store ${n} fetched.`,{display:`system`}),{mode:`detail`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to get memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create`){let{name:n}=e;l(`tengu_memory_stores_create`,{name:n});try{let e=await T(n);return t(`Memory store created: ${e.memory_store_id}`,{display:`system`}),{mode:`created`,store:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to create memory store: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`archive`){let{id:n}=e;l(`tengu_memory_stores_archive`,{id:n});try{let e=await D(n);return t(`Memory store ${n} archived.`,{display:`system`}),{mode:`archived`,store:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to archive memory store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`memories`){let{storeId:n}=e;l(`tengu_memory_stores_list_memories`,{storeId:n});try{let e=await O(n);return t(e.length===0?`No memories in store ${n}.`:`${e.length} memory(ies) in store ${n}.`,{display:`system`}),{mode:`memory-list`,storeId:n,memories:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list memories in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`create-memory`){let{storeId:n,content:r}=e;l(`tengu_memory_stores_create_memory`,{storeId:n});try{let e=await k(n,r);return t(`Memory created: ${e.memory_id}`,{display:`system`}),{mode:`memory-created`,memory:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to create memory in store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}if(e.action===`get-memory`){let{storeId:n,memoryId:r}=e;l(`tengu_memory_stores_get_memory`,{storeId:n});try{let e=await A(n,r);return t(`Memory ${r} fetched.`,{display:`system`}),{mode:`memory-detail`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to get memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`update-memory`){let{storeId:n,memoryId:r,content:i}=e;l(`tengu_memory_stores_update_memory`,{storeId:n});try{let e=await j(n,r,i);return t(`Memory ${r} updated.`,{display:`system`}),{mode:`memory-updated`,memory:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to update memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`delete-memory`){let{storeId:n,memoryId:r}=e;l(`tengu_memory_stores_delete_memory`,{storeId:n});try{return await M(n,r),t(`Memory ${r} deleted.`,{display:`system`}),{mode:`memory-deleted`,storeId:n,memoryId:r}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to delete memory ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}if(e.action===`versions`){let{storeId:n}=e;l(`tengu_memory_stores_versions`,{storeId:n});try{let e=await N(n);return t(e.length===0?`No memory versions found for store ${n}.`:`${e.length} version(s) in store ${n}.`,{display:`system`}),{mode:`versions`,storeId:n,versions:e}}catch(e){let r=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:r}),t(`Failed to list versions for store ${n}: ${r}`,{display:`system`}),{mode:`error`,message:r}}}let{storeId:n,versionId:r}=e;l(`tengu_memory_stores_redact`,{storeId:n});try{let e=await P(n,r);return t(`Version ${r} redacted.`,{display:`system`}),{mode:`redacted`,version:e}}catch(e){let n=e instanceof Error?e.message:String(e);return l(`tengu_memory_stores_failed`,{reason:n}),t(`Failed to redact version ${r}: ${n}`,{display:`system`}),{mode:`error`,message:n}}}var q,J;e((()=>{c(),R(),H(),G(),_(),q=`Usage: /memory-stores list | get ID | create NAME | archive ID | memories STORE_ID | create-memory STORE_ID CONTENT | get-memory STORE_ID MEMORY_ID | update-memory STORE_ID MEMORY_ID CONTENT | delete-memory STORE_ID MEMORY_ID | versions STORE_ID | redact STORE_ID VERSION_ID`,J=g({commandName:`memory-stores`,parseArgs:e=>{l(`tengu_memory_stores_started`,{args:e});let t=U(e);return t.action===`invalid`?(l(`tengu_memory_stores_failed`,{reason:t.reason}),{action:`invalid`,reason:`${q}\n${t.reason}`}):t},dispatch:K,View:B,errorView:e=>null})}))();export{J as callMemoryStores};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,T as n,b as r,p as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Cc as c,Sc as l,dc as u,yc as d}from"./paths-BZjPDxMm.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{n as m,t as h}from"./ThemePicker-8X6yAwuQ.js";function g(e){return e}function _(e){let t=e.trim().toLowerCase();return t===``||t===`reset`?{sub:`full`}:x.has(t)?{sub:t}:{sub:`full`,unknownArg:t}}function v({onDone:e}){let[,t]=n();return(0,b.jsx)(i,{color:`permission`,children:(0,b.jsx)(h,{onThemeSelect:n=>{t(n),p(`tengu_onboarding_step`,{stepId:g(`theme`)}),e(`Theme set to ${n}.`)},onCancel:()=>e(`Theme picker dismissed.`),skipExitHandling:!0})})}function y({theme:e,hasCompletedOnboarding:t,lastOnboardingVersion:n}){return(0,b.jsxs)(o,{flexDirection:`column`,paddingLeft:1,children:[(0,b.jsx)(r,{bold:!0,children:`Onboarding status`}),(0,b.jsxs)(r,{children:[`- Theme: `,(0,b.jsx)(r,{bold:!0,children:e})]}),(0,b.jsxs)(r,{children:[`- Onboarding completed:`,` `,(0,b.jsx)(r,{bold:!0,color:t?`success`:`warning`,children:t?`yes`:`no`})]}),(0,b.jsxs)(r,{children:[`- Last onboarding version: `,(0,b.jsx)(r,{bold:!0,children:n})]}),(0,b.jsx)(r,{dimColor:!0,children:`Run /onboarding (no args) to re-run the full flow, or /onboarding theme | trust | model | mcp for a specific step.`})]})}var b,x,S;e((()=>{t(),a(),f(),m(),d(),b=s(),x=new Set([`full`,`theme`,`trust`,`model`,`mcp`,`status`]),S=async(e,t,n)=>{let{sub:r,unknownArg:i}=_(n);if(p(`tengu_onboarding_step`,{stepId:g(`slash_${r}`)}),i!==void 0)return e(`Unknown /onboarding subcommand: \`${i}\`.\nValid: full | theme | trust | model | mcp | status`,{display:`system`}),null;if(r===`theme`)return(0,b.jsx)(v,{onDone:t=>e(t)});if(r===`trust`)return l(e=>({...e,hasTrustDialogAccepted:!1})),e("Workspace trust cleared for the current project. The trust dialog will appear on the next `claude` launch.",{display:`system`}),null;if(r===`model`)return e("Run `/model` to pick the AI model. Onboarding does not own the model picker; this entry exists for discoverability only.",{display:`system`}),null;if(r===`mcp`)return e("MCP server setup:\n - `/mcp` — list configured MCP servers\n - `claude mcp add <name> <command>` — add a server (in your shell)\n - `claude mcp remove <name>` — remove a server\nServers also load from `.mcp.json` in the workspace and from `~/.claude.json` globally.",{display:`system`}),null;if(r===`status`){let e=u();return(0,b.jsx)(y,{theme:e.theme??`(unset)`,hasCompletedOnboarding:e.hasCompletedOnboarding===!0,lastOnboardingVersion:e.lastOnboardingVersion??`(unset)`})}return c(e=>({...e,hasCompletedOnboarding:!1})),e(`Onboarding flag cleared. The full first-run setup (theme, OAuth/API key, security notes, terminal-setup) will run on the next \`claude\` launch.
1
+ import{n as e}from"./chunk-DR8-3Aex.js";import{Rn as t,T as n,b as r,p as i,t as a,x as o}from"./src-Di342QoJ.js";import{t as s}from"./jsx-runtime-D-D469L8.js";import{Cc as c,Sc as l,dc as u,yc as d}from"./paths-nIHVpTn2.js";import{n as f,r as p}from"./analytics-DqMQntaB.js";import{n as m,t as h}from"./ThemePicker-Bdm12PmJ.js";function g(e){return e}function _(e){let t=e.trim().toLowerCase();return t===``||t===`reset`?{sub:`full`}:x.has(t)?{sub:t}:{sub:`full`,unknownArg:t}}function v({onDone:e}){let[,t]=n();return(0,b.jsx)(i,{color:`permission`,children:(0,b.jsx)(h,{onThemeSelect:n=>{t(n),p(`tengu_onboarding_step`,{stepId:g(`theme`)}),e(`Theme set to ${n}.`)},onCancel:()=>e(`Theme picker dismissed.`),skipExitHandling:!0})})}function y({theme:e,hasCompletedOnboarding:t,lastOnboardingVersion:n}){return(0,b.jsxs)(o,{flexDirection:`column`,paddingLeft:1,children:[(0,b.jsx)(r,{bold:!0,children:`Onboarding status`}),(0,b.jsxs)(r,{children:[`- Theme: `,(0,b.jsx)(r,{bold:!0,children:e})]}),(0,b.jsxs)(r,{children:[`- Onboarding completed:`,` `,(0,b.jsx)(r,{bold:!0,color:t?`success`:`warning`,children:t?`yes`:`no`})]}),(0,b.jsxs)(r,{children:[`- Last onboarding version: `,(0,b.jsx)(r,{bold:!0,children:n})]}),(0,b.jsx)(r,{dimColor:!0,children:`Run /onboarding (no args) to re-run the full flow, or /onboarding theme | trust | model | mcp for a specific step.`})]})}var b,x,S;e((()=>{t(),a(),f(),m(),d(),b=s(),x=new Set([`full`,`theme`,`trust`,`model`,`mcp`,`status`]),S=async(e,t,n)=>{let{sub:r,unknownArg:i}=_(n);if(p(`tengu_onboarding_step`,{stepId:g(`slash_${r}`)}),i!==void 0)return e(`Unknown /onboarding subcommand: \`${i}\`.\nValid: full | theme | trust | model | mcp | status`,{display:`system`}),null;if(r===`theme`)return(0,b.jsx)(v,{onDone:t=>e(t)});if(r===`trust`)return l(e=>({...e,hasTrustDialogAccepted:!1})),e("Workspace trust cleared for the current project. The trust dialog will appear on the next `claude` launch.",{display:`system`}),null;if(r===`model`)return e("Run `/model` to pick the AI model. Onboarding does not own the model picker; this entry exists for discoverability only.",{display:`system`}),null;if(r===`mcp`)return e("MCP server setup:\n - `/mcp` — list configured MCP servers\n - `claude mcp add <name> <command>` — add a server (in your shell)\n - `claude mcp remove <name>` — remove a server\nServers also load from `.mcp.json` in the workspace and from `~/.claude.json` globally.",{display:`system`}),null;if(r===`status`){let e=u();return(0,b.jsx)(y,{theme:e.theme??`(unset)`,hasCompletedOnboarding:e.hasCompletedOnboarding===!0,lastOnboardingVersion:e.lastOnboardingVersion??`(unset)`})}return c(e=>({...e,hasCompletedOnboarding:!1})),e(`Onboarding flag cleared. The full first-run setup (theme, OAuth/API key, security notes, terminal-setup) will run on the next \`claude\` launch.
2
2
 
3
3
  For individual steps in this session, use:
4
4
  /onboarding theme — re-pick theme inline