@readmagic/workmate 0.0.1 → 0.0.2

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 (434) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-BSLHrjbt.js → AddWorkspaceDirectory-BgNp7glC.js} +1 -1
  2. package/dist/chunks/{App-DY5O6IKw.js → App-Coboqa8H.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-CQsQdQBC.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-BEzfC6r3.js → ApproveApiKey-CYpBbj0k.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-Ce3PraaD.js → AssistantSessionChooser-DxKsTdqj.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-Dvhcgahe.js → BackgroundTasksDialog-AiVi-1pI.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-B68V1bCq.js → BypassPermissionsModeDialog-Cx3QGFz-.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CTWhpIm8.js → ClaudeMdExternalIncludesDialog-BAK9fxwg.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-DUu6iRJk.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-DVTPwR5I.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-BRbU4is4.js → DesktopHandoff-BsHgLlTy.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CBluIK-x.js → DiffDialog-BgTW2Znv.js} +1 -1
  13. package/dist/chunks/{Doctor-WxNv49HC.js → Doctor-BXhz8eUa.js} +1 -1
  14. package/dist/chunks/Doctor-D75dsEyb.js +1 -0
  15. package/dist/chunks/{ExitFlow-CRPgptCN.js → ExitFlow-B1XNACQP.js} +1 -1
  16. package/dist/chunks/{Feedback-CEtzaLr3.js → Feedback-Cvz80lAn.js} +1 -1
  17. package/dist/chunks/Grove-B7hhBvFw.js +1 -0
  18. package/dist/chunks/{Grove--kttLxvs.js → Grove-Dsi4yU08.js} +1 -1
  19. package/dist/chunks/{HybridTransport-BgV5_7Az.js → HybridTransport-8qA64lCx.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-DCGwXW_p.js → InvalidConfigDialog-CAZ1z5WG.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-jTwsdXWr.js → InvalidSettingsDialog-D82Qk_MR.js} +1 -1
  22. package/dist/chunks/{MCPConnectionManager-BX0LMz9J.js → MCPConnectionManager-BLfKm4H2.js} +1 -1
  23. package/dist/chunks/{McpParsingWarnings-WQrWJeWP.js → McpParsingWarnings-8ZueNqAd.js} +1 -1
  24. package/dist/chunks/{MessageSelector-_UZB8cGb.js → MessageSelector-DmKtBYX9.js} +1 -1
  25. package/dist/chunks/Messages-CaFdI1kk.js +11 -0
  26. package/dist/chunks/{Onboarding-BoIVNCgc.js → Onboarding-CUztnbbv.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-1FCN8bH3.js → OverageCreditUpsell-DSgrZvMv.js} +1 -1
  28. package/dist/chunks/{PluginSettings-BD9JLV9-.js → PluginSettings-0FSNch8O.js} +1 -1
  29. package/dist/chunks/{PromptInputFooterSuggestions-CrGST0Cq.js → PromptInputFooterSuggestions-IaihWay3.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-B2TDpbpw.js → PromptInputHelpMenu-okS2rQ4k.js} +1 -1
  31. package/dist/chunks/{QueryEngine-D2HUnwmU.js → QueryEngine-WYDWzQuY.js} +1 -1
  32. package/dist/chunks/{REPL-BV4WyYMg.js → REPL-Dto012J0.js} +7 -7
  33. package/dist/chunks/REPL-vV_jzAVx.js +1 -0
  34. package/dist/chunks/{RemoteCallout-DS_EV6Fh.js → RemoteCallout-C_UIYnuT.js} +1 -1
  35. package/dist/chunks/RemoteSessionManager-CuSSHAXN.js +2 -0
  36. package/dist/chunks/{ResumeConversation-Cw3vP4G8.js → ResumeConversation-g_JyOWbl.js} +1 -1
  37. package/dist/chunks/{SSETransport-BXiEBMpb.js → SSETransport-Chj_yfPv.js} +1 -1
  38. package/dist/chunks/SearchExtraToolsTool-Daedym7_.js +1 -0
  39. package/dist/chunks/{Settings-ns6mRsDc.js → Settings-DUXA-qac.js} +2 -2
  40. package/dist/chunks/{TeleportProgress-CcDzMC5L.js → TeleportProgress-DP1a8jit.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-DZbxl4sD.js → TeleportRepoMismatchDialog-B6sTwXuZ.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-EowJO5nm.js → TeleportResumeWrapper-CKUuRQSG.js} +1 -1
  43. package/dist/chunks/{ThemePicker-BYbChJpu.js → ThemePicker-Dyq1YVhb.js} +1 -1
  44. package/dist/chunks/{TrustDialog-DA3YTk_k.js → TrustDialog-CdZS9t-T.js} +1 -1
  45. package/dist/chunks/{ValidationErrorsList-Cx-hoRwG.js → ValidationErrorsList-DUNh4BNa.js} +1 -1
  46. package/dist/chunks/WelcomeV2-TPbOXGrO.js +1 -0
  47. package/dist/chunks/{add-dir-CWt69NAZ.js → add-dir-Bf_5tCeR.js} +1 -1
  48. package/dist/chunks/{agentDisplay-CQ4mZWFH.js → agentDisplay-CCeYiAta.js} +1 -1
  49. package/dist/chunks/{agents-D4clhuCl.js → agents-Bt72Gz1v.js} +1 -1
  50. package/dist/chunks/{agents-C6jzKOit.js → agents-T8xHY5Wk.js} +1 -1
  51. package/dist/chunks/{allErrors-HMPqE0jK.js → allErrors-CDWTJcMw.js} +1 -1
  52. package/dist/chunks/{ant-9Z5bppVC.js → ant-DRF-v5bA.js} +1 -1
  53. package/dist/chunks/api-CLLIHLpn.js +1 -0
  54. package/dist/chunks/api-DMpNA1s8.js +1 -0
  55. package/dist/chunks/asciicast-BIr75_x9.js +1 -0
  56. package/dist/chunks/{asciicast-n-BBfgDq.js → asciicast-CQJlNTae.js} +1 -1
  57. package/dist/chunks/{assistant-BA9_Mo9U.js → assistant-C83quuNj.js} +1 -1
  58. package/dist/chunks/{assistant-BiNOSla3.js → assistant-z1ojxEET.js} +1 -1
  59. package/dist/chunks/assistant-z2o4-UJe.js +1 -0
  60. package/dist/chunks/auth-Ce0jllLf.js +1 -0
  61. package/dist/chunks/auth-DV3P8Qup.js +1 -0
  62. package/dist/chunks/{auth-DHyCIxCk.js → auth-DpFfHy1W.js} +1 -1
  63. package/dist/chunks/{autoMode-Db4QrgFr.js → autoMode-DW_H3i37.js} +3 -3
  64. package/dist/chunks/{autonomy-BkAMA7du.js → autonomy-46hnmyAi.js} +1 -1
  65. package/dist/chunks/{autonomy-D4Vy-RPQ.js → autonomy-OxhciwYa.js} +1 -1
  66. package/dist/chunks/{autonomyPanel-EjfO8jvg.js → autonomyPanel-CTEjq0Bd.js} +1 -1
  67. package/dist/chunks/backgroundHousekeeping-BycL9lOe.js +1 -0
  68. package/dist/chunks/{backgroundHousekeeping-hDDE8mJC.js → backgroundHousekeeping-Cpxq4krt.js} +2 -2
  69. package/dist/chunks/{banner-hD6wZygx.js → banner-BVkLvJiB.js} +1 -1
  70. package/dist/chunks/bg-H849G7Sc.js +1 -0
  71. package/dist/chunks/{bg-DQ0Q3Qv-.js → bg-zWGqkcST.js} +2 -2
  72. package/dist/chunks/{branch-CeQ9IyZk.js → branch-DJzijRGm.js} +1 -1
  73. package/dist/chunks/{break-cache-Bd0clV2N.js → break-cache-BQfgkNAo.js} +2 -2
  74. package/dist/chunks/{bridge-yerAiaK2.js → bridge-Dpr2AWpc.js} +2 -2
  75. package/dist/chunks/bridgeConfig-CcANVX0P.js +1 -0
  76. package/dist/chunks/{bridgeConfig-CCtXe8ak.js → bridgeConfig-DDF3teRE.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-Cn-u7P4_.js +1 -0
  78. package/dist/chunks/{bridgeEnabled--F-6TUi4.js → bridgeEnabled-D4JDZd0y.js} +1 -1
  79. package/dist/chunks/{bridgeMain--R1HFbOv.js → bridgeMain-CtgVyLjI.js} +7 -7
  80. package/dist/chunks/bridgeMain-Dh0gWRVo.js +1 -0
  81. package/dist/chunks/{bridgeMessaging-CqbLTDcx.js → bridgeMessaging-CRG6HqUb.js} +1 -1
  82. package/dist/chunks/{bridgePointer-W_jdQ8zf.js → bridgePointer-Cug5fQ3e.js} +1 -1
  83. package/dist/chunks/{browser-Bd7GeBH1.js → browser-BKiu1max.js} +1 -1
  84. package/dist/chunks/{btw-CVGRmL9a.js → btw-DG9CCeq4.js} +1 -1
  85. package/dist/chunks/{caches-BtmAri4e.js → caches-BB5_91gU.js} +2 -2
  86. package/dist/chunks/caches-C3NINY3K.js +1 -0
  87. package/dist/chunks/{ccrClient-HqMi5Kfu.js → ccrClient-CRXGlUCe.js} +1 -1
  88. package/dist/chunks/{claudeDesktop-aUMx06RK.js → claudeDesktop-9xfIgkzE.js} +1 -1
  89. package/dist/chunks/{clear-C6nRzIQE.js → clear-ueMvDelv.js} +1 -1
  90. package/dist/chunks/{cliLaunch-2AUoMnqx.js → cliLaunch-BJ9o-rIV.js} +1 -1
  91. package/dist/chunks/client-AnWHs0gW.js +1 -0
  92. package/dist/chunks/{color-DXI_4ibU.js → color-B0-MIfsq.js} +1 -1
  93. package/dist/chunks/commands-DsKH3ogN.js +1 -0
  94. package/dist/chunks/commitAttribution-D7NrwLhc.js +1 -0
  95. package/dist/chunks/{commitAttribution-Cm40fdNU.js → commitAttribution-DKun9CeU.js} +1 -1
  96. package/dist/chunks/{compact-DPTVpJ4D.js → compact-BhWCO-oD.js} +1 -1
  97. package/dist/chunks/completionCache-C9zlWBRz.js +1 -0
  98. package/dist/chunks/{completionCache-BQaLkB4d.js → completionCache-CdHCuiqq.js} +2 -2
  99. package/dist/chunks/{config-C7YHKCPV.js → config-662VDD70.js} +1 -1
  100. package/dist/chunks/config-CUN8YbOa.js +1 -0
  101. package/dist/chunks/{config-CLmFk-5V.js → config-DklnhNx1.js} +1 -1
  102. package/dist/chunks/config-Wk3svGdH.js +1 -0
  103. package/dist/chunks/{context-C_cKrBUn.js → context-DBswG0EY.js} +1 -1
  104. package/dist/chunks/context-noninteractive-C3dICmA9.js +1 -0
  105. package/dist/chunks/{context-noninteractive-DnH6Q9Lu.js → context-noninteractive-CTvyNimw.js} +1 -1
  106. package/dist/chunks/{conversation-GJxfkr6M.js → conversation-CooSju3g.js} +1 -1
  107. package/dist/chunks/conversation-DLLIOKYV.js +1 -0
  108. package/dist/chunks/{createSSHSession--bWmmIk9.js → createSSHSession-BdO35H6o.js} +1 -1
  109. package/dist/chunks/{createSession-DIr4sUp6.js → createSession-Br1g8qSD.js} +1 -1
  110. package/dist/chunks/createSession-CVG8SiEm.js +1 -0
  111. package/dist/chunks/{crossProjectResume-DKrtjTpm.js → crossProjectResume-DiKJb83I.js} +1 -1
  112. package/dist/chunks/cwd--nvsx73T.js +1 -0
  113. package/dist/chunks/{cwd-BuJhkTrc.js → cwd-CYmmnQVS.js} +1 -1
  114. package/dist/chunks/{daemon-B9lBPdBJ.js → daemon-BQiSFjc-.js} +1 -1
  115. package/dist/chunks/{datadog-DNCsyfSO.js → datadog-BE6D_6m0.js} +1 -1
  116. package/dist/chunks/datadog-C69i7cfI.js +1 -0
  117. package/dist/chunks/debug-8kgDrUfj.js +1 -0
  118. package/dist/chunks/{debug-IKW-jE7K.js → debug-DiuXEmUq.js} +1 -1
  119. package/dist/chunks/{debugUtils-D2981c0Z.js → debugUtils-3YYWvb3H.js} +1 -1
  120. package/dist/chunks/{desktop-B5cvrcOQ.js → desktop-W7SA8BFk.js} +1 -1
  121. package/dist/chunks/{detached-rfIUyc-B.js → detached-Cv9gAylK.js} +1 -1
  122. package/dist/chunks/{detectRepository-ReZ0Fz8Z.js → detectRepository-B1PMTLAU.js} +1 -1
  123. package/dist/chunks/detectRepository-_Kj817Vi.js +1 -0
  124. package/dist/chunks/{diff-cXAp9cNN.js → diff-CMtRjFUb.js} +1 -1
  125. package/dist/chunks/{directoryCompletion-DBM2o5kx.js → directoryCompletion-CeV63gvu.js} +1 -1
  126. package/dist/chunks/doctor-DEz8BHAz.js +1 -0
  127. package/dist/chunks/{effort-Br8KKHdx.js → effort-BAlVDBHq.js} +1 -1
  128. package/dist/chunks/{entry-4lIRMrLI.js → entry-DLqeVq5C.js} +2 -2
  129. package/dist/chunks/envLessBridgeConfig-3kCrKZl7.js +1 -0
  130. package/dist/chunks/envLessBridgeConfig-BfgXw47_.js +1 -0
  131. package/dist/chunks/{execFileNoThrow-COKYqVQj.js → execFileNoThrow-DResQRvR.js} +1 -1
  132. package/dist/chunks/{execSyncWrapper-DZJ3tNWF.js → execSyncWrapper-CWxMek26.js} +1 -1
  133. package/dist/chunks/{exit-Z9oWrqE4.js → exit-cyepwuyy.js} +1 -1
  134. package/dist/chunks/extra-usage-DlFeNGQD.js +1 -0
  135. package/dist/chunks/{extra-usage-core-CdL1ltqq.js → extra-usage-core-Dh4rVUI-.js} +1 -1
  136. package/dist/chunks/{extra-usage-DtAIhW74.js → extra-usage-nRFfBiXh.js} +1 -1
  137. package/dist/chunks/{extra-usage-noninteractive-DxxRI0Yx.js → extra-usage-noninteractive-D4Ya5KPm.js} +1 -1
  138. package/dist/chunks/{extraUsage-BYZdi44Y.js → extraUsage-DtWi8E78.js} +1 -1
  139. package/dist/chunks/extractMemories-BqN8fWZ5.js +1 -0
  140. package/dist/chunks/{fast-DKqiojzf.js → fast-DkUxqWhE.js} +1 -1
  141. package/dist/chunks/fast-NvqW2-t1.js +1 -0
  142. package/dist/chunks/{feedback-yB19xph5.js → feedback-Cn7Sbqxa.js} +1 -1
  143. package/dist/chunks/{file-D1cN3LMK.js → file-BZriE-XU.js} +1 -1
  144. package/dist/chunks/{files-DAzGtmzz.js → files-Cz1-PK3r.js} +1 -1
  145. package/dist/chunks/firstPartyEventLogger-AhXYSrkP.js +1 -0
  146. package/dist/chunks/{firstPartyEventLogger-hU-LPkje.js → firstPartyEventLogger-BQYrBdvD.js} +2 -2
  147. package/dist/chunks/{flushGate-ZFr8yv7F.js → flushGate-ebqQZF1t.js} +1 -1
  148. package/dist/chunks/{gemini-DqAv8_GY.js → gemini-Sr_00TsL.js} +1 -1
  149. package/dist/chunks/{generateRecap-lO2PDlx8.js → generateRecap-5d4l_ODy.js} +1 -1
  150. package/dist/chunks/{generateSessionName-48veu5dv.js → generateSessionName-DEAw5x_h.js} +1 -1
  151. package/dist/chunks/{genericProcessUtils-F1Qcb1sO.js → genericProcessUtils-DO7Fy0RJ.js} +1 -1
  152. package/dist/chunks/git-Cc1jAz6r.js +1 -0
  153. package/dist/chunks/{git-tyaWOgRL.js → git-Cgc8X5l2.js} +2 -2
  154. package/dist/chunks/{githubRepoPathMapping-BlR0BphY.js → githubRepoPathMapping-Tt-LdYFZ.js} +1 -1
  155. package/dist/chunks/{goal-Bn8Kz2Dp.js → goal-DCaI1NPN.js} +1 -1
  156. package/dist/chunks/{grok-DhnO_KDC.js → grok-CKlngG3b.js} +1 -1
  157. package/dist/chunks/{grove-DotW04-v.js → grove-DSWe6psK.js} +1 -1
  158. package/dist/chunks/{heapdump-DkZSKNbp.js → heapdump-OVbV05On.js} +1 -1
  159. package/dist/chunks/{help-DU_BcZtU.js → help-CRtX5VX9.js} +1 -1
  160. package/dist/chunks/hooks-DvtnNoYE.js +1 -0
  161. package/dist/chunks/{hooks-BTMWE5Qx.js → hooks-tpf90xd5.js} +1 -1
  162. package/dist/chunks/{hostGuard-Dh296c6q.js → hostGuard-t7QfbijF.js} +1 -1
  163. package/dist/chunks/{inboundAttachments-DVs3_m48.js → inboundAttachments-BZ6MKpxd.js} +1 -1
  164. package/dist/chunks/inboundAttachments-D5Ux2kCl.js +1 -0
  165. package/dist/chunks/{initReplBridge-D0Xec8S-.js → initReplBridge-CjuO6in6.js} +1 -1
  166. package/dist/chunks/{install-BkfXeXpv.js → install-DqpM2brU.js} +1 -1
  167. package/dist/chunks/{instrumentation-H0XRS1yG.js → instrumentation--Sx0y1Gk.js} +3 -3
  168. package/dist/chunks/{job-DKtLkF8V.js → job-D7B35Usp.js} +1 -1
  169. package/dist/chunks/{jwtUtils-C-ojmb8W.js → jwtUtils-CqXPjf-a.js} +1 -1
  170. package/dist/chunks/{keybindings-ez51eHHp.js → keybindings-JvAmBpLt.js} +1 -1
  171. package/dist/chunks/{language-BuRSO2sR.js → language-8Rnu_qxl.js} +1 -1
  172. package/dist/chunks/language-DaxZe0Xw.js +1 -0
  173. package/dist/chunks/{launchAgentsPlatform-BQyPdrHp.js → launchAgentsPlatform-CNPkOVzu.js} +1 -1
  174. package/dist/chunks/{launchLocalMemory-CWHAj7CX.js → launchLocalMemory-BxmDhENs.js} +1 -1
  175. package/dist/chunks/{launchLocalVault-D8iJdtsP.js → launchLocalVault-DQlTGA-g.js} +1 -1
  176. package/dist/chunks/{launchMemoryStores-W7jWG2uH.js → launchMemoryStores-EYAwxI8i.js} +1 -1
  177. package/dist/chunks/{launchOnboarding-q__LaLy1.js → launchOnboarding-CTu5Zf4E.js} +1 -1
  178. package/dist/chunks/{launchSchedule-BWi9F5vh.js → launchSchedule-CeHHSvO7.js} +1 -1
  179. package/dist/chunks/{launchSkillStore-4wd4MQBc.js → launchSkillStore-Bqh2Fru2.js} +1 -1
  180. package/dist/chunks/{launchTeleport-BlCf2QM_.js → launchTeleport-Crc3XVZX.js} +1 -1
  181. package/dist/chunks/{launchVault-C7u7LZV7.js → launchVault-BHLgpth_.js} +1 -1
  182. package/dist/chunks/loadAgentsDir-D7npVvsj.js +1 -0
  183. package/dist/chunks/{loadAgentsDir-nzr38hai.js → loadAgentsDir-ZQwvbURI.js} +66 -66
  184. package/dist/chunks/{loadPluginHooks-z1-zvBLw.js → loadPluginHooks-CaKvZVZI.js} +1 -1
  185. package/dist/chunks/localSearch-BU5oulbF.js +1 -0
  186. package/dist/chunks/{localSearch-B-L_ldos.js → localSearch-H0LchlTi.js} +1 -1
  187. package/dist/chunks/{log-B3eB4EFv.js → log-Duzb4o6h.js} +1 -1
  188. package/dist/chunks/{logoV2Utils-RQ160dI2.js → logoV2Utils-5lcUu53m.js} +1 -1
  189. package/dist/chunks/{magicDocs-BqZ0GewA.js → magicDocs-D1FIPmYg.js} +1 -1
  190. package/dist/chunks/main-B8XtFN2P.js +859 -0
  191. package/dist/chunks/{main-DeFMhaFE.js → main-CR7cXdgy.js} +3 -3
  192. package/dist/chunks/{mappers-CWykjGfP.js → mappers-DKU4RgE3.js} +1 -1
  193. package/dist/chunks/{mcp-DBwT4pa9.js → mcp-B06Mqsur.js} +4 -4
  194. package/dist/chunks/{mcp-DvZTaHZE.js → mcp-C0AjA07u.js} +1 -1
  195. package/dist/chunks/{mcp-CSFPAfaW.js → mcp-ghioDl7W.js} +1 -1
  196. package/dist/chunks/{memoize-BO31Ws9Q.js → memoize-DgMjqLtn.js} +1 -1
  197. package/dist/chunks/{memory-DcpPpYN0.js → memory-D-Q62bJ7.js} +1 -1
  198. package/dist/chunks/{metadata-BRLJvh61.js → metadata-CIx5CsoY.js} +1 -1
  199. package/dist/chunks/{mode-BkViT_0o.js → mode-DFZgqKBd.js} +1 -1
  200. package/dist/chunks/{model-DfFA3qMO.js → model-BgrLt7P7.js} +1 -1
  201. package/dist/chunks/model-aVc5c3Lz.js +1 -0
  202. package/dist/chunks/{model-CZktWw6o.js → model-fDWtIRVr.js} +1 -1
  203. package/dist/chunks/{nativeInstaller-GcIk7G2Y.js → nativeInstaller-DKe1pWoL.js} +1 -1
  204. package/dist/chunks/{onChangeAppState-DwGVi-BC.js → onChangeAppState-DaQ0R9Tw.js} +1 -1
  205. package/dist/chunks/{openai-B2wxZDQx.js → openai-DNS0-ivj.js} +1 -1
  206. package/dist/chunks/{overageCreditGrant-CjK49axw.js → overageCreditGrant-qHN3tnp2.js} +1 -1
  207. package/dist/chunks/{panel-R4ue6pSW.js → panel-Be-OxtqL.js} +1 -1
  208. package/dist/chunks/{panel-B-nrcHpm.js → panel-CrTPqXCv.js} +1 -1
  209. package/dist/chunks/{panelCall-I_fbgub5.js → panelCall-BvKpHquo.js} +1 -1
  210. package/dist/chunks/parser-Bj3gOqFv.js +1 -0
  211. package/dist/chunks/{parser-CQrasoUB.js → parser-TYEkLFgh.js} +1 -1
  212. package/dist/chunks/{partition-CxRF7T-f.js → partition-Cv11dD5P.js} +1 -1
  213. package/dist/chunks/{passes-U_h-hNu-.js → passes-DQdM2Ssq.js} +1 -1
  214. package/dist/chunks/{path-BCSE0S-c.js → path-Cu_AKqg6.js} +1 -1
  215. package/dist/chunks/{permissions-B8epy16o.js → permissions-DB_2mmCl.js} +1 -1
  216. package/dist/chunks/{pidLock-CBJDnBG_.js → pidLock-DchmaAK6.js} +2 -2
  217. package/dist/chunks/{pipeTransport-D3Qx9v1V.js → pipeTransport-7GIO6GCA.js} +1 -1
  218. package/dist/chunks/{plan-BAhStVci.js → plan-D8dQDl8W.js} +1 -1
  219. package/dist/chunks/{platform-EtecGacO.js → platform-B5dCGT8t.js} +1 -1
  220. package/dist/chunks/{plugin-D9huNnv6.js → plugin-w8MqsKHn.js} +1 -1
  221. package/dist/chunks/{pluginAutoupdate-BfmyxR5g.js → pluginAutoupdate-7FFHzSRz.js} +1 -1
  222. package/dist/chunks/{pluginBlocklist-03sZaZa6.js → pluginBlocklist-Cw_l-yal.js} +1 -1
  223. package/dist/chunks/{pluginCliCommands-P2Ndi1r1.js → pluginCliCommands-BtYWRxhS.js} +1 -1
  224. package/dist/chunks/{pluginFlagging-BVy7Xv_0.js → pluginFlagging-_WUQP3Lq.js} +1 -1
  225. package/dist/chunks/{pluginOperations-Cz37qcjF.js → pluginOperations-BOkST1qE.js} +1 -1
  226. package/dist/chunks/{pluginStartupCheck-w24D-wwk.js → pluginStartupCheck-BelpzwZI.js} +1 -1
  227. package/dist/chunks/pluginStartupCheck-XBLJZZys.js +1 -0
  228. package/dist/chunks/{plugins-B0hiIN4q.js → plugins-6px6K1fh.js} +1 -1
  229. package/dist/chunks/policyLimits-C07tQ0Wr.js +1 -0
  230. package/dist/chunks/{poor-CfbMKZNJ.js → poor-D3T_8wwf.js} +1 -1
  231. package/dist/chunks/poorMode-BdBDiOFD.js +1 -0
  232. package/dist/chunks/{poorMode-Bsw2V-V_.js → poorMode-BqyVuBu-.js} +1 -1
  233. package/dist/chunks/{print-ozjC0Mhg.js → print-DcQSuK0v.js} +4 -4
  234. package/dist/chunks/{privacy-settings-DeGoBRrZ.js → privacy-settings-D5zxu4Aa.js} +1 -1
  235. package/dist/chunks/{processBashCommand-loWZ8MSE.js → processBashCommand-CEqA4QZi.js} +1 -1
  236. package/dist/chunks/{processSlashCommand-BdouajZb.js → processSlashCommand-DMpFk59M.js} +1 -1
  237. package/dist/chunks/prompt-CKvoqUC3.js +1 -0
  238. package/dist/chunks/prompt-aXZPR3q8.js +1 -0
  239. package/dist/chunks/{prompt-Bef63FhB.js → prompt-wys9CwDo.js} +1 -1
  240. package/dist/chunks/{promptEditor-foiayhdY.js → promptEditor-D6HzjcMS.js} +1 -1
  241. package/dist/chunks/{protocolHandler-BsiB1oW_.js → protocolHandler-BXlx1N7v.js} +1 -1
  242. package/dist/chunks/{proxy-Cn2YwITp.js → proxy-CHnxhNZI.js} +1 -1
  243. package/dist/chunks/{rate-limit-options-DTJPDcTr.js → rate-limit-options-1hc-RyNR.js} +1 -1
  244. package/dist/chunks/{rcDebugLog-BUuD-X1D.js → rcDebugLog-CivJaJ3V.js} +1 -1
  245. package/dist/chunks/{reconciler-DqXTmV3J.js → reconciler-BKX4jh34.js} +1 -1
  246. package/dist/chunks/{referral-DP_GshTS.js → referral-Cu9bEOFE.js} +1 -1
  247. package/dist/chunks/{refresh-CNzXPAFw.js → refresh-vJbxW4a1.js} +1 -1
  248. package/dist/chunks/{registerProtocol-CjxlFsKw.js → registerProtocol-B_XbLDQO.js} +3 -3
  249. package/dist/chunks/{release-notes-BxgK8zWO.js → release-notes-CavWoMQR.js} +1 -1
  250. package/dist/chunks/{releaseNotes-CbSktIJW.js → releaseNotes-Di6OaHF7.js} +2 -2
  251. package/dist/chunks/{reload-plugins-CDu6yU5-.js → reload-plugins-ofeLn07p.js} +1 -1
  252. package/dist/chunks/{remote-env-B4HnhISc.js → remote-env-dXzHAuD6.js} +1 -1
  253. package/dist/chunks/{remoteBridgeCore-D-wG5jau.js → remoteBridgeCore-CmwkjiTK.js} +1 -1
  254. package/dist/chunks/{remoteManagedSettings-B7gt0VAX.js → remoteManagedSettings-Co-CxR67.js} +1 -1
  255. package/dist/chunks/{rename-DlbMb24l.js → rename-CtjP0lop.js} +1 -1
  256. package/dist/chunks/{renderOptions-5kWQpVr2.js → renderOptions-DOXmueQV.js} +1 -1
  257. package/dist/chunks/{resume-BB5iBogS.js → resume-C5h5JvY1.js} +1 -1
  258. package/dist/chunks/{ripgrep-BvDwiKJ3.js → ripgrep-BN_g-F7X.js} +1 -1
  259. package/dist/chunks/ripgrep-hOjrgpMp.js +1 -0
  260. package/dist/chunks/{runtimeObserver-Ci-5gvYg.js → runtimeObserver-B93v1AxE.js} +2 -2
  261. package/dist/chunks/{runtimeObserver-BNH2WGE3.js → runtimeObserver-DOZFrqJu.js} +1 -1
  262. package/dist/chunks/sandbox-adapter-CO5GuywY.js +1 -0
  263. package/dist/chunks/{sandbox-toggle-B2Yk4y2V.js → sandbox-toggle-TiLGFwaZ.js} +1 -1
  264. package/dist/chunks/searchExtraTools-CXZJU2Kv.js +1 -0
  265. package/dist/chunks/{session-Bmx7L3Mt.js → session-v9tKHhU9.js} +1 -1
  266. package/dist/chunks/{sessionDiscovery-DcEAr5vJ.js → sessionDiscovery-4byQKOnc.js} +1 -1
  267. package/dist/chunks/sessionFileAccessHooks-BUyIQVzL.js +1 -0
  268. package/dist/chunks/sessionMemory-ZsxCLHYd.js +1 -0
  269. package/dist/chunks/{sessionMemory-Bsg2unYX.js → sessionMemory-e6YpTUhW.js} +1 -1
  270. package/dist/chunks/sessionMemoryUtils-BD_dqyYB.js +1 -0
  271. package/dist/chunks/sessionObserver-DNItJztR.js +1 -0
  272. package/dist/chunks/{sessionObserver-DQwHsDrM.js → sessionObserver-OgY9BUP4.js} +1 -1
  273. package/dist/chunks/sessionStorage-xvxpRETp.js +1 -0
  274. package/dist/chunks/{sessionTitle-B8jcexkQ.js → sessionTitle-Bph6GO4F.js} +1 -1
  275. package/dist/chunks/{sessionTracing-BuLsL6qA.js → sessionTracing-BBxhPccY.js} +1 -1
  276. package/dist/chunks/{settings-5PQdphqC.js → settings-BhvhCpVh.js} +2 -2
  277. package/dist/chunks/settingsSync-D2B5K4BT.js +1 -0
  278. package/dist/chunks/{setup-BKEnSLR9.js → setup-CEnNEK6Z.js} +2 -2
  279. package/dist/chunks/{shadowedRuleDetection-7Z8ezTKF.js → shadowedRuleDetection-DDSOFi1W.js} +1 -1
  280. package/dist/chunks/{shellQuote-fB02N16J.js → shellQuote-yXoC_y5m.js} +1 -1
  281. package/dist/chunks/{sideQuestion-CYdNATPW.js → sideQuestion-CAiA6jAf.js} +1 -1
  282. package/dist/chunks/sink-CyKOf5TT.js +1 -0
  283. package/dist/chunks/{sink-DjKoYMsA.js → sink-DxPJ4khU.js} +1 -1
  284. package/dist/chunks/{sinks-GryGVRT8.js → sinks-BNo3DvxO.js} +2 -2
  285. package/dist/chunks/sinks-CHgtwDha.js +1 -0
  286. package/dist/chunks/{skill-learning-E8tQed-Q.js → skill-learning-Dx1o4mMo.js} +1 -1
  287. package/dist/chunks/{skillChangeDetector-A8SAuyo9.js → skillChangeDetector-BRBCwQ2w.js} +1 -1
  288. package/dist/chunks/{skillGapStore-B5rl12bV.js → skillGapStore-BV_6qzxU.js} +1 -1
  289. package/dist/chunks/{skillGapStore-CjJrxxjk.js → skillGapStore-Zvqiyxds.js} +2 -2
  290. package/dist/chunks/{skillGenerator-BDR_z3-X.js → skillGenerator-jJQDphQ8.js} +2 -2
  291. package/dist/chunks/skillLearning-BH7EAU1m.js +1 -0
  292. package/dist/chunks/{skillLearning-BQtfFE0g.js → skillLearning-BTT3_yGc.js} +1 -1
  293. package/dist/chunks/{skillPanel-yR8Oi-mO.js → skillPanel-OW2M6SZr.js} +3 -3
  294. package/dist/chunks/{skillSearchPanel-DUQQUCUS.js → skillSearchPanel-C0Y56c5N.js} +4 -4
  295. package/dist/chunks/{skills-NAZQ3j-t.js → skills-BFsyLP33.js} +1 -1
  296. package/dist/chunks/{startupProfiler-DxRQteII.js → startupProfiler-BquH_Yqm.js} +1 -1
  297. package/dist/chunks/startupProfiler-CYCH-qos.js +1 -0
  298. package/dist/chunks/state-BOa-3Av3.js +1 -0
  299. package/dist/chunks/{state-4KQ3kaqz.js → state-ix0xIunV.js} +1 -1
  300. package/dist/chunks/{stats-h4yu84Q-.js → stats-CrPmPT8f.js} +1 -1
  301. package/dist/chunks/{status-BbdeubJG.js → status-BO5J2MAe.js} +1 -1
  302. package/dist/chunks/{status-is_Bg_IB.js → status-DHJbK4pV.js} +1 -1
  303. package/dist/chunks/{statusNoticeHelpers-CQ7CUugR.js → statusNoticeHelpers-CqeUBySi.js} +1 -1
  304. package/dist/chunks/{stickers-qJoNhPk4.js → stickers-BLFmyHZV.js} +1 -1
  305. package/dist/chunks/{stringUtils-CvXbHQRH.js → stringUtils-D_g2L6A4.js} +1 -1
  306. package/dist/chunks/systemPromptSections-CR_AoPIX.js +1 -0
  307. package/dist/chunks/{systemPromptSections-CgpggIYX.js → systemPromptSections-DN0HGVye.js} +1 -1
  308. package/dist/chunks/{tag-i3HZ4lhj.js → tag-M2AEtXjW.js} +1 -1
  309. package/dist/chunks/{tasks-HzsYNTZ1.js → tasks-CoOs_Qkj.js} +1 -1
  310. package/dist/chunks/{teleport-hN3cAbYC.js → teleport-DjIgQeBB.js} +1 -1
  311. package/dist/chunks/{templateJobs-CIv_ysje.js → templateJobs-Cl50Qw0s.js} +1 -1
  312. package/dist/chunks/{terminalSetup-CxniwSF-.js → terminalSetup-Bdh9K31U.js} +1 -1
  313. package/dist/chunks/{terminalSetup-C0PF87iu.js → terminalSetup-nvS3KCDG.js} +1 -1
  314. package/dist/chunks/{theme-BKIHX_Dx.js → theme-DgCIr0jU.js} +1 -1
  315. package/dist/chunks/thinkback-BSv_fvbV.js +1 -0
  316. package/dist/chunks/{thinkback-mT-8FIT-.js → thinkback-ERCQ86CR.js} +1 -1
  317. package/dist/chunks/{thinkback-play-Cfk49mvF.js → thinkback-play-DNB0IWYt.js} +1 -1
  318. package/dist/chunks/{tmux-CbsW-VDJ.js → tmux-ZZk68JBq.js} +1 -1
  319. package/dist/chunks/{toolEventObserver-8FQtxeVv.js → toolEventObserver-9-5Ne25Z.js} +1 -1
  320. package/dist/chunks/{toolEventObserver-B1xvyKdE.js → toolEventObserver-9XCQXiMx.js} +1 -1
  321. package/dist/chunks/{toolPool-CHVDZqh7.js → toolPool-uQKZRMKg.js} +1 -1
  322. package/dist/chunks/trustedDevice-0ej6e3nx.js +1 -0
  323. package/dist/chunks/{trustedDevice-BYCh1ff7.js → trustedDevice-nqhuw4tp.js} +1 -1
  324. package/dist/chunks/{tui-fTa_pzdA.js → tui-C2yuCuOU.js} +3 -3
  325. package/dist/chunks/{types-a7X-tJpJ.js → types-Cnorfsss.js} +1 -1
  326. package/dist/chunks/{udsClient-Cg9bBD0p.js → udsClient-CiFj4M_h.js} +1 -1
  327. package/dist/chunks/{ultrareviewCommand-DCFRZsKp.js → ultrareviewCommand-BMBHepdu.js} +1 -1
  328. package/dist/chunks/undercover-6UUO38fQ.js +1 -0
  329. package/dist/chunks/{undercover-CsLPQb-a.js → undercover-DDgIKbO5.js} +3 -3
  330. package/dist/chunks/{up-dO5BcPaq.js → up-D6bNw_tT.js} +1 -1
  331. package/dist/chunks/{updateCCB-CfUnkOLT.js → updateCCB-B-OlpLjA.js} +1 -1
  332. package/dist/chunks/{upgrade-kpttjebY.js → upgrade-BN20nsCH.js} +1 -1
  333. package/dist/chunks/upgrade-DYqlCH80.js +1 -0
  334. package/dist/chunks/{upload-DDhQqV8n.js → upload-BQGByiXE.js} +1 -1
  335. package/dist/chunks/{upstreamproxy-CvcjNY7J.js → upstreamproxy-os5rw0Vg.js} +1 -1
  336. package/dist/chunks/{usage-CJ5w0907.js → usage-D_sqm8us.js} +1 -1
  337. package/dist/chunks/usage-DolSCKGi.js +1 -0
  338. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-yAroCqu4.js → useExitOnCtrlCDWithKeybindings-vzUoPY51.js} +1 -1
  339. package/dist/chunks/useMainLoopModel-cZd8EKo5.js +1 -0
  340. package/dist/chunks/{useManagePlugins-CTtPaQRP.js → useManagePlugins-DgGZBvXV.js} +1 -1
  341. package/dist/chunks/{useMergedTools-CZJffsmf.js → useMergedTools-Bb4XbC9d.js} +1 -1
  342. package/dist/chunks/{useSearchInput-C-CqUK6w.js → useSearchInput-B1UOjxAI.js} +1 -1
  343. package/dist/chunks/{useSettingsErrors-BWlJCgYF.js → useSettingsErrors-BLbvu4--.js} +1 -1
  344. package/dist/chunks/{util-DJV0joAW.js → util-CxlfALM4.js} +1 -1
  345. package/dist/chunks/validatePlugin-n8a4W_jI.js +1 -0
  346. package/dist/chunks/{vim-n8-UT5w-.js → vim-DLWBHwVM.js} +1 -1
  347. package/dist/chunks/{which-BBCjXfI2.js → which-sEFQXpaX.js} +1 -1
  348. package/dist/chunks/windowsPaths-BLevJOlm.js +1 -0
  349. package/dist/chunks/{windowsPaths-D6T_3XaU.js → windowsPaths-N_YmYY6k.js} +1 -1
  350. package/dist/chunks/{workSecret-C_lv0dRh.js → workSecret-DvniZR71.js} +1 -1
  351. package/dist/chunks/{workerRegistry-BdHi7_sN.js → workerRegistry-CFnGtb3L.js} +1 -1
  352. package/dist/chunks/worktree-Dr_WzlXs.js +1 -0
  353. package/dist/cli.js +1 -1
  354. package/package.json +1 -1
  355. package/dist/chunks/ApproveApiKey-DfAPwDix.js +0 -1
  356. package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +0 -1
  357. package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +0 -1
  358. package/dist/chunks/Doctor-B0CRtxi2.js +0 -1
  359. package/dist/chunks/Grove-CelgLWH4.js +0 -1
  360. package/dist/chunks/Messages-jCoW_1Rr.js +0 -11
  361. package/dist/chunks/REPL-DcpN3MRC.js +0 -1
  362. package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +0 -2
  363. package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +0 -1
  364. package/dist/chunks/WelcomeV2-BTfttGcv.js +0 -1
  365. package/dist/chunks/api-L2IgleTV.js +0 -1
  366. package/dist/chunks/api-TgV7fl9V.js +0 -1
  367. package/dist/chunks/asciicast-DYbkzGCN.js +0 -1
  368. package/dist/chunks/assistant-YvbVKjVh.js +0 -1
  369. package/dist/chunks/auth-CEig4Gxp.js +0 -1
  370. package/dist/chunks/auth-CbGDlhyO.js +0 -1
  371. package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +0 -1
  372. package/dist/chunks/bg-BzG63WOm.js +0 -1
  373. package/dist/chunks/bridgeConfig-D5dB38xD.js +0 -1
  374. package/dist/chunks/bridgeEnabled-DKX8-T_H.js +0 -1
  375. package/dist/chunks/bridgeMain-d06JByZn.js +0 -1
  376. package/dist/chunks/caches-BuTIAOtY.js +0 -1
  377. package/dist/chunks/client-BeET1hnC.js +0 -1
  378. package/dist/chunks/commands-VjcG4qFq.js +0 -1
  379. package/dist/chunks/commitAttribution-Lb3qUlAR.js +0 -1
  380. package/dist/chunks/completionCache-CW8lKIgy.js +0 -1
  381. package/dist/chunks/config-0cRberzR.js +0 -1
  382. package/dist/chunks/config-BrxKpHpR.js +0 -1
  383. package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +0 -1
  384. package/dist/chunks/conversation-oK3aFzqO.js +0 -1
  385. package/dist/chunks/createSession-DM4acqaC.js +0 -1
  386. package/dist/chunks/cwd-D-tY2NKc.js +0 -1
  387. package/dist/chunks/datadog-ByS7LGGa.js +0 -1
  388. package/dist/chunks/debug-DzZUT2Wv.js +0 -1
  389. package/dist/chunks/detectRepository-6nw-Aw3v.js +0 -1
  390. package/dist/chunks/doctor-CTMHXZvQ.js +0 -1
  391. package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +0 -1
  392. package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +0 -1
  393. package/dist/chunks/extra-usage-BS4aVOt5.js +0 -1
  394. package/dist/chunks/extractMemories-C4f9JWuI.js +0 -1
  395. package/dist/chunks/fast-B0OB4x7K.js +0 -1
  396. package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +0 -1
  397. package/dist/chunks/git-BE_FiJZp.js +0 -1
  398. package/dist/chunks/hooks-DONAb_nq.js +0 -1
  399. package/dist/chunks/inboundAttachments-BcEgi49j.js +0 -1
  400. package/dist/chunks/language-Da4KNbjm.js +0 -1
  401. package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +0 -1
  402. package/dist/chunks/localSearch-D-FprOMr.js +0 -1
  403. package/dist/chunks/main-y7LJ5qUc.js +0 -1243
  404. package/dist/chunks/model--z4Di9QO.js +0 -1
  405. package/dist/chunks/parser-BlM_Fk4J.js +0 -1
  406. package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +0 -1
  407. package/dist/chunks/policyLimits-Dem-XJ_h.js +0 -1
  408. package/dist/chunks/poorMode-jvImnkty.js +0 -1
  409. package/dist/chunks/prompt-C7wd1H_i.js +0 -1
  410. package/dist/chunks/prompt-DIoNqZvO.js +0 -1
  411. package/dist/chunks/ripgrep-BQgJ02F9.js +0 -1
  412. package/dist/chunks/sandbox-adapter-Coe1GDAE.js +0 -1
  413. package/dist/chunks/searchExtraTools-BnWZ9roi.js +0 -1
  414. package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +0 -1
  415. package/dist/chunks/sessionMemory-CIbCojm-.js +0 -1
  416. package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +0 -1
  417. package/dist/chunks/sessionObserver-CRU1qWnP.js +0 -1
  418. package/dist/chunks/sessionStorage-BxDN8qRc.js +0 -1
  419. package/dist/chunks/settingsSync-BDeuErb5.js +0 -1
  420. package/dist/chunks/sink-iYxWapbU.js +0 -1
  421. package/dist/chunks/sinks-jfaIjsRJ.js +0 -1
  422. package/dist/chunks/skillLearning-C8ihdryM.js +0 -1
  423. package/dist/chunks/startupProfiler-B0m6crkd.js +0 -1
  424. package/dist/chunks/state-53JDbNQM.js +0 -1
  425. package/dist/chunks/systemPromptSections-IePG5K8r.js +0 -1
  426. package/dist/chunks/thinkback-BA4cMz4D.js +0 -1
  427. package/dist/chunks/trustedDevice-DnIWErCt.js +0 -1
  428. package/dist/chunks/undercover-B-kKUWtK.js +0 -1
  429. package/dist/chunks/upgrade-CngUwvY4.js +0 -1
  430. package/dist/chunks/usage-eZRwLa77.js +0 -1
  431. package/dist/chunks/useMainLoopModel-BNFW-g8E.js +0 -1
  432. package/dist/chunks/validatePlugin-CRmpIGLV.js +0 -1
  433. package/dist/chunks/windowsPaths-DUKTzBck.js +0 -1
  434. package/dist/chunks/worktree-YDeHMlHZ.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./REPL-Dto012J0.js";export{e as REPL};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,t as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{Nb as s,Pb as c}from"./loadAgentsDir-nzr38hai.js";import{b as l,c as u,g as d}from"./config-C7YHKCPV.js";import{Vt as f,kt as p}from"./model-DfFA3qMO.js";import{i as m,r as h}from"./bridgeEnabled--F-6TUi4.js";import{n as g,t as _}from"./PermissionDialog-0ya1CU5k.js";function v({onDone:e}){let t=(0,b.useRef)(e);t.current=e;let i=(0,b.useCallback)(()=>{t.current(`dismiss`)},[]);(0,b.useEffect)(()=>{l(e=>e.remoteDialogSeen?e:{...e,remoteDialogSeen:!0})},[]);let a=(0,b.useCallback)(e=>{t.current(e)},[]);return(0,x.jsx)(_,{title:`Remote Control`,children:(0,x.jsxs)(n,{flexDirection:`column`,paddingX:2,paddingY:1,children:[(0,x.jsxs)(n,{marginBottom:1,flexDirection:`column`,children:[(0,x.jsx)(r,{children:`Remote Control lets you access this CLI session from the web (claude.ai/code) or the Claude app, so you can pick up where you left off on any device.`}),(0,x.jsx)(r,{children:` `}),(0,x.jsx)(r,{children:`You can disconnect remote access anytime by running /remote-control again.`})]}),(0,x.jsx)(n,{children:(0,x.jsx)(s,{options:[{label:`Enable Remote Control for this session`,description:`Opens a secure connection to claude.ai.`,value:`enable`},{label:`Never mind`,description:`You can always enable it later with /remote-control.`,value:`dismiss`}],onChange:a,onCancel:i})})]})})}function y(){return!(u().remoteDialogSeen||!m()||!p()?.accessToken)}var b,x,S=e((()=>{b=t(i(),1),h(),a(),f(),d(),c(),g(),x=o()}));export{S as n,y as r,v as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,fi as i,t as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{Nb as s,Pb as c}from"./loadAgentsDir-ZQwvbURI.js";import{b as l,c as u,g as d}from"./config-662VDD70.js";import{Vt as f,kt as p}from"./model-BgrLt7P7.js";import{i as m,r as h}from"./bridgeEnabled-D4JDZd0y.js";import{n as g,t as _}from"./PermissionDialog-0ya1CU5k.js";function v({onDone:e}){let t=(0,b.useRef)(e);t.current=e;let i=(0,b.useCallback)(()=>{t.current(`dismiss`)},[]);(0,b.useEffect)(()=>{l(e=>e.remoteDialogSeen?e:{...e,remoteDialogSeen:!0})},[]);let a=(0,b.useCallback)(e=>{t.current(e)},[]);return(0,x.jsx)(_,{title:`Remote Control`,children:(0,x.jsxs)(n,{flexDirection:`column`,paddingX:2,paddingY:1,children:[(0,x.jsxs)(n,{marginBottom:1,flexDirection:`column`,children:[(0,x.jsx)(r,{children:`Remote Control lets you access this CLI session from the web (claude.ai/code) or the Claude app, so you can pick up where you left off on any device.`}),(0,x.jsx)(r,{children:` `}),(0,x.jsx)(r,{children:`You can disconnect remote access anytime by running /remote-control again.`})]}),(0,x.jsx)(n,{children:(0,x.jsx)(s,{options:[{label:`Enable Remote Control for this session`,description:`Opens a secure connection to claude.ai.`,value:`enable`},{label:`Never mind`,description:`You can always enable it later with /remote-control.`,value:`dismiss`}],onChange:a,onCancel:i})})]})})}function y(){return!(u().remoteDialogSeen||!m()||!p()?.accessToken)}var b,x,S=e((()=>{b=t(i(),1),h(),a(),f(),d(),c(),g(),x=o()}));export{S as n,y as r,v as t};
@@ -0,0 +1,2 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./memoize-BK3gG5ob.js";import{n as r,t as i}from"./defineProperty-C-QyHrDq.js";import{I as a,P as o,di as s,fi as c,j as l,t as u,ui as ee}from"./src-CDCSSo0U2.js";import{t as te}from"./jsx-runtime-Bb4Xn-E0.js";import{Ag as ne,As as re,Es as ie,Fg as d,Fl as f,Gy as p,Ig as m,Il as h,Kx as g,Nb as ae,Ng as oe,Nr as se,Og as ce,Pb as le,Pg as ue,Tg as de,Us as fe,Vs as pe,WD as me,XE as _,YD as he,YE as ge,ZD as _e,fr as ve,hD as ye,jr as be,pD as v,qx as xe,xg as Se,zy as y}from"./loadAgentsDir-ZQwvbURI.js";import{n as Ce,t as b}from"./cwd-CYmmnQVS.js";import{D as x,E as S,O as C,U as w,l as T,p as E,z as D}from"./debug-DiuXEmUq.js";import{Jt as O,Zt as k,c as A,f as j,g as we,n as M}from"./settings-BhvhCpVh.js";import{b as N,c as P,g as F,o as I,y as Te}from"./config-662VDD70.js";import{_ as L,d as Ee,g as De,h as Oe}from"./git-Cgc8X5l2.js";import{n as R,r as ke}from"./execFileNoThrow-DResQRvR.js";import{o as z,s as B}from"./log-Duzb4o6h.js";import{i as V,o as Ae}from"./platform-B5dCGT8t.js";import{n as je,r as Me}from"./analytics-BotDBGh0.js";import{l as Ne,u as Pe}from"./oauth-BqJqV-2M.js";import{Ht as H,Vt as Fe,_ as Ie,fi as Le,g as Re,mi as ze,u as Be}from"./model-BgrLt7P7.js";import{c as Ve,h as He,l as Ue,m as U,s as We}from"./proxy-CHnxhNZI.js";import{n as Ge,o as Ke}from"./fileStateCache-DDW5toIs.js";import{d as qe,o as Je}from"./api-CLLIHLpn.js";import{c as Ye,u as Xe}from"./firstPartyEventLogger-BQYrBdvD.js";import{a as Ze,r as Qe,s as $e,t as et}from"./referral-Cu9bEOFE.js";import{c as tt,i as nt}from"./terminalSetup-nvS3KCDG.js";import{n as rt,t as it}from"./PermissionDialog-0ya1CU5k.js";import{n as at,r as ot,t as st}from"./overageCreditGrant-qHN3tnp2.js";import{i as ct,o as lt}from"./OverageCreditUpsell-DSgrZvMv.js";import{n as ut,t as dt}from"./DesktopHandoff-BsHgLlTy.js";import{randomUUID as ft}from"crypto";n(),ge(),Ce(),F(),k(),ke(),L(),z(),Xe();var pt=[/(?:^|\/)(?:package-lock\.json|yarn\.lock|bun\.lock|bun\.lockb|pnpm-lock\.yaml|Pipfile\.lock|poetry\.lock|Cargo\.lock|Gemfile\.lock|go\.sum|composer\.lock|uv\.lock)$/,/\.generated\./,/(?:^|\/)(?:dist|build|out|target|node_modules|\.next|__pycache__)\//,/\.(?:min\.js|min\.css|map|pyc|pyo)$/,/\.(?:json|ya?ml|toml|xml|ini|cfg|conf|env|lock|txt|md|mdx|rst|csv|log|svg)$/i,/(?:^|\/)\.?(?:eslintrc|prettierrc|babelrc|editorconfig|gitignore|gitattributes|dockerignore|npmrc)/,/(?:^|\/)(?:tsconfig|jsconfig|biome|vitest\.config|jest\.config|webpack\.config|vite\.config|rollup\.config)\.[a-z]+$/,/(?:^|\/)\.(?:github|vscode|idea|claude)\//,/(?:^|\/)(?:CHANGELOG|LICENSE|CONTRIBUTING|CODEOWNERS|README)(?:\.[a-z]+)?$/i];function mt(e){return!pt.some(t=>t.test(e))}function ht(e,t){let n=[],r=new Set,i=new Map;for(let a=1;n.length<t&&a<=t;a++)for(let o of e){if(n.length>=t)break;if(!mt(o))continue;let e=Math.max(o.lastIndexOf(`/`),o.lastIndexOf(`\\`)),s=e>=0?o.slice(e+1):o;if(!s||r.has(s))continue;let c=e>=0?o.slice(0,e):`.`;(i.get(c)??0)>=a||(n.push(s),r.add(s),i.set(c,(i.get(c)??0)+1))}return n.length>=t?n:[]}async function gt(){if(O.platform===`win32`||!await Ee())return[];try{let e=await Ye(),t=[`log`,`-n`,`1000`,`--pretty=format:`,`--name-only`,`--diff-filter=M`],n=new Map,r=e=>{for(let t of e.split(`
2
+ `)){let e=t.trim();e&&n.set(e,(n.get(e)??0)+1)}};if(e){let{stdout:n}=await R(`git`,[...t,`--author=${e}`],{cwd:b()});r(n)}if(n.size<10){let{stdout:e}=await R(De(),t,{cwd:b()});r(e)}return ht(Array.from(n.entries()).sort((e,t)=>t[1]-e[1]).map(([e])=>e),5)}catch(e){return B(e),[]}}var _t=10080*60*1e3,vt=t(()=>{let e=I(),t=e.exampleFiles?.length?_(e.exampleFiles):`<filepath>`;return`Try "${_([`fix lint errors`,`fix typecheck errors`,`how does ${t} work?`,`refactor ${t}`,`how do I log an error?`,`edit ${t} to...`,`write a test for ${t}`,`create a util logging.py that...`])}"`}),yt=t(async()=>{let e=I();Date.now()-(e.exampleFilesGeneratedAt??0)>_t&&(e.exampleFiles=[]),e.exampleFiles?.length||gt().then(e=>{e.length&&Te(t=>({...t,exampleFiles:e,exampleFilesGeneratedAt:Date.now()}))})});ze();var bt={"claude-3-opus":{modelName:`Claude 3 Opus`,retirementDates:{firstParty:`January 5, 2026`,bedrock:`January 15, 2026`,vertex:`January 5, 2026`,foundry:`January 5, 2026`}},"claude-3-7-sonnet":{modelName:`Claude 3.7 Sonnet`,retirementDates:{firstParty:`February 19, 2026`,bedrock:`April 28, 2026`,vertex:`May 11, 2026`,foundry:`February 19, 2026`}},"claude-3-5-haiku":{modelName:`Claude 3.5 Haiku`,retirementDates:{firstParty:`February 19, 2026`,bedrock:null,vertex:null,foundry:null}}};function xt(e){let t=e.toLowerCase(),n=Le();for(let[e,r]of Object.entries(bt)){let i=r.retirementDates[n];if(!(!t.includes(e)||!i))return{isDeprecated:!0,modelName:r.modelName,retirementDate:i}}return{isDeprecated:!1}}function St(e){if(!e)return null;let t=xt(e);return t.isDeprecated?`⚠ ${t.modelName} will be retired on ${t.retirementDate}. Consider switching to a newer model.`:null}r(),s(),w(),S(),T(),Ae(),Pe(),we(),Fe(),nt(),p(),h(),be();var W=e(c(),1);u(),je(),F(),le(),ut(),rt();var G=te(),Ct={enable_shortcut_tip:!1,enable_startup_dialog:!1};function K(){return Ct}function wt(){return process.platform===`darwin`||process.platform===`win32`&&process.arch===`x64`}function Tt(){if(!wt()||!K().enable_startup_dialog)return!1;let e=P();return!(e.desktopUpsellDismissed||(e.desktopUpsellSeenCount??0)>=3)}function Et({onDone:e}){let[t,n]=(0,W.useState)(!1);if((0,W.useEffect)(()=>{let e=(P().desktopUpsellSeenCount??0)+1;N(t=>(t.desktopUpsellSeenCount??0)>=e?t:{...t,desktopUpsellSeenCount:e}),Me(`tengu_desktop_upsell_shown`,{seen_count:e})},[]),t)return(0,G.jsx)(dt,{onDone:()=>e()});function r(t){switch(t){case`try`:n(!0);return;case`never`:N(e=>e.desktopUpsellDismissed?e:{...e,desktopUpsellDismissed:!0}),e();return;case`not-now`:e();return}}return(0,G.jsx)(it,{title:`Try Claude Code Desktop`,children:(0,G.jsxs)(a,{flexDirection:`column`,paddingX:2,paddingY:1,children:[(0,G.jsx)(a,{marginBottom:1,children:(0,G.jsx)(o,{children:`Same Claude Code with visual diffs, live app preview, parallel sessions, and more.`})}),(0,G.jsx)(ae,{options:[{label:`Open in Claude Code Desktop`,value:`try`},{label:`Not now`,value:`not-now`},{label:`Don't ask again`,value:`never`}],onChange:r,onCancel:()=>r(`not-now`)})]})})}Ie(),he(),ye(),Ke(),Je(),xe(),ce(),pe(),ie(),$e(),ot(),ct(),F();function Dt(e){let t=P().numStartups;N(n=>{let r=n.tipsHistory??{};return r[e]===t?n:{...n,tipsHistory:{...r,[e]:t}}})}function q(e){let t=P(),n=t.tipsHistory?.[e];return n?t.numStartups-n:1/0}u(),F(),k(),L();var J;async function Ot(){return J===void 0&&(J=v in await fe()),J}async function Y(e,t,n){if(!await Ot()||re(`${e}@claude-plugins-official`))return!1;let{bashTools:r}=t??{};return!!(n.cli&&r?.size&&n.cli.some(e=>r.has(e))||n.filePath&&t?.readFileState&&Ge(t.readFileState).some(e=>n.filePath.test(e)))}var kt=[{id:`new-user-warmup`,content:async()=>`Start with small features or bug fixes, tell Claude to propose a plan, and verify its suggested edits`,cooldownSessions:3,async isRelevant(){return P().numStartups<10}},{id:`plan-mode-for-complex-tasks`,content:async()=>`Use Plan Mode to prepare for a complex request before making changes. Press ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to enable.`,cooldownSessions:5,isRelevant:async()=>{let e=P();return(e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0)>7}},{id:`default-permission-mode-config`,content:async()=>`Use /config to change your default permission mode (including Plan Mode)`,cooldownSessions:10,isRelevant:async()=>{try{let e=P(),t=j(),n=!!e.lastPlanModeUse,r=!!t?.permissions?.defaultMode;return n&&!r}catch(e){return E(`Failed to check default-permission-mode-config tip relevance: ${e}`,{level:`warn`}),!1}}},{id:`git-worktrees`,content:async()=>`Use git worktrees to run multiple Claude sessions in parallel.`,cooldownSessions:10,isRelevant:async()=>{try{let e=P();return await Oe()<=1&&e.numStartups>50}catch{return!1}}},{id:`color-when-multi-clauding`,content:async()=>`Running multiple Claude sessions? Use /color and /rename to tell them apart at a glance.`,cooldownSessions:10,isRelevant:async()=>!ve()&&await f()>=2},{id:`terminal-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable convenient terminal integration like Option + Enter for new line and more`:`Run /terminal-setup to enable convenient terminal integration like Shift + Enter for new line and more`,cooldownSessions:10,async isRelevant(){let e=P();return O.terminal===`Apple_Terminal`?!e.optionAsMetaKeyInstalled:!e.shiftEnterKeyBindingInstalled}},{id:`shift-enter`,content:async()=>O.terminal===`Apple_Terminal`?`Press Option+Enter to send a multi-line message`:`Press Shift+Enter to send a multi-line message`,cooldownSessions:10,async isRelevant(){let e=P();return!!((O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)&&e.numStartups>3)}},{id:`shift-enter-setup`,content:async()=>O.terminal===`Apple_Terminal`?`Run /terminal-setup to enable Option+Enter for new lines`:`Run /terminal-setup to enable Shift+Enter for new lines`,cooldownSessions:10,async isRelevant(){if(!tt())return!1;let e=P();return!(O.terminal===`Apple_Terminal`?e.optionAsMetaKeyInstalled:e.shiftEnterKeyBindingInstalled)}},{id:`memory-command`,content:async()=>`Use /memory to view and manage Claude memory`,cooldownSessions:15,async isRelevant(){return P().memoryUsageCount<=0}},{id:`theme-command`,content:async()=>`Use /theme to change the color theme`,cooldownSessions:20,isRelevant:async()=>!0},{id:`colorterm-truecolor`,content:async()=>`Try setting environment variable COLORTERM=truecolor for richer colors`,cooldownSessions:30,isRelevant:async()=>!process.env.COLORTERM&&ee.level<3},{id:`powershell-tool-env`,content:async()=>`Set CLAUDE_CODE_USE_POWERSHELL_TOOL=1 to enable the PowerShell tool (preview)`,cooldownSessions:10,isRelevant:async()=>V()===`windows`&&process.env.CLAUDE_CODE_USE_POWERSHELL_TOOL===void 0},{id:`status-line`,content:async()=>`Use /statusline to set up a custom status line that will display beneath the input box`,cooldownSessions:25,isRelevant:async()=>j().statusLine===void 0},{id:`prompt-queue`,content:async()=>`Hit Enter to queue up additional messages while Claude is working.`,cooldownSessions:5,async isRelevant(){return P().promptQueueUseCount<=3}},{id:`enter-to-steer-in-relatime`,content:async()=>`Send messages to Claude while it works to steer Claude in real-time`,cooldownSessions:20,isRelevant:async()=>!0},{id:`todo-list`,content:async()=>`Ask Claude to create a todo list when working on complex tasks to track progress and remain on track`,cooldownSessions:20,isRelevant:async()=>!0},{id:`vscode-command-install`,content:async()=>`Open the Command Palette (Cmd+Shift+P) and run "Shell Command: Install '${O.terminal===`vscode`?`code`:O.terminal}' command in PATH" to enable IDE integration`,cooldownSessions:0,async isRelevant(){if(!ue()||V()!==`macos`)return!1;switch(O.terminal){case`vscode`:return!await d();case`cursor`:return!await ne();case`windsurf`:return!await m();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return oe()||(await de()).length!==0?!1:(await Se()).length>0}},{id:`permissions`,content:async()=>`Use /permissions to pre-approve and pre-deny bash, edit, and MCP tools`,cooldownSessions:10,async isRelevant(){return P().numStartups>10}},{id:`drag-and-drop-images`,content:async()=>`Did you know you can drag and drop image files into your terminal?`,cooldownSessions:10,isRelevant:async()=>!O.isSSH()},{id:`paste-images-mac`,content:async()=>`Paste images into Work Mate using control+v (not cmd+v!)`,cooldownSessions:10,isRelevant:async()=>V()===`macos`},{id:`double-esc`,content:async()=>`Double-tap esc to rewind the conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>!y()},{id:`double-esc-code-restore`,content:async()=>`Double-tap esc to rewind the code and/or conversation to a previous point in time`,cooldownSessions:10,isRelevant:async()=>y()},{id:`continue`,content:async()=>`Run claude --continue or claude --resume to resume a conversation`,cooldownSessions:10,isRelevant:async()=>!0},{id:`rename-conversation`,content:async()=>`Name your conversations with /rename to find them easily in /resume later`,cooldownSessions:15,isRelevant:async()=>se()&&P().numStartups>10},{id:`custom-commands`,content:async()=>`Create skills by adding .md files to .claude/skills/ in your project or ~/.claude/skills/ for skills that work in any project`,cooldownSessions:15,async isRelevant(){return P().numStartups>10}},{id:`shift-tab`,content:async()=>`Hit ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} to cycle between default, accept edits, plan, auto, and bypass modes`,cooldownSessions:10,isRelevant:async()=>!0},{id:`image-paste`,content:async()=>`Use ${g(`chat:imagePaste`,`Chat`,`ctrl+v`)} to paste images from your clipboard`,cooldownSessions:20,isRelevant:async()=>!0},{id:`custom-agents`,content:async()=>`Use /agents to optimize specific tasks. Eg. Software Architect, Code Writer, Code Reviewer`,cooldownSessions:15,async isRelevant(){return P().numStartups>5}},{id:`agent-flag`,content:async()=>`Use --agent <agent_name> to directly start a conversation with a subagent`,cooldownSessions:15,async isRelevant(){return P().numStartups>5}},{id:`desktop-app`,content:async()=>`Run Work Mate locally or remotely using the Claude desktop app: clau.de/desktop`,cooldownSessions:15,isRelevant:async()=>V()!==`linux`},{id:`desktop-shortcut`,content:async e=>`Continue your session in Work Mate Desktop with ${l(`suggestion`,e?.theme??`dark`)(`/desktop`)}`,cooldownSessions:15,isRelevant:async()=>K().enable_shortcut_tip?process.platform===`darwin`||process.platform===`win32`&&process.arch===`x64`:!1},{id:`web-app`,content:async()=>`Run tasks in the cloud while you keep coding locally · clau.de/web`,cooldownSessions:15,isRelevant:async()=>!0},{id:`opusplan-mode-reminder`,content:async()=>`Your default model setting is Opus Plan Mode. Press ${g(`chat:cycleMode`,`Chat`,`shift+tab`)} twice to activate Plan Mode and plan with Claude Opus.`,cooldownSessions:2,async isRelevant(){if(process.env.USER_TYPE===`ant`)return!1;let e=P(),t=Re()===`opusplan`,n=e.lastPlanModeUse?(Date.now()-e.lastPlanModeUse)/(1e3*60*60*24):1/0;return t&&n>3}},{id:`frontend-design-plugin`,content:async e=>`Working with HTML/CSS? Install the frontend-design plugin:\n${l(`suggestion`,e?.theme??`dark`)(`/plugin install frontend-design@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`frontend-design`,e,{filePath:/\.(html|css|htm)$/i})},{id:`vercel-plugin`,content:async e=>`Working with Vercel? Install the vercel plugin:\n${l(`suggestion`,e?.theme??`dark`)(`/plugin install vercel@${v}`)}`,cooldownSessions:3,isRelevant:async e=>Y(`vercel`,e,{filePath:/(?:^|[/\\])vercel\.json$/i,cli:[`vercel`]})},{id:`effort-high-nudge`,content:async e=>`Working on something tricky? ${l(`suggestion`,e?.theme??`dark`)(`/effort high`)} gives better first answers`,cooldownSessions:3,isRelevant:async()=>(!H()||!_e(Be())||A(`policySettings`)?.effortLevel!==void 0||me()!==void 0||M().effortLevel,!1)},{id:`subagent-fanout-nudge`,content:async e=>`Say ${l(`suggestion`,e?.theme??`dark`)(`"fan out subagents"`)} and Claude sends a team. Each one digs deep so nothing gets missed.`,cooldownSessions:3,isRelevant:async()=>(H(),!1)},{id:`guest-passes`,content:async e=>{let t=l(`claude`,e?.theme??`dark`),n=Ze();return n?`Share Work Mate and earn ${t(Qe(n))} of extra usage · ${t(`/passes`)}`:`You have free guest passes to share · ${t(`/passes`)}`},cooldownSessions:3,isRelevant:async()=>{if(P().hasVisitedPasses)return!1;let{eligible:e}=et();return e}},{id:`overage-credit`,content:async e=>{let t=l(`claude`,e?.theme??`dark`),n=at(),r=n?st(n):null;return r?`${t(`${r} in extra usage, on us`)} · third-party apps · ${t(`/extra-usage`)}`:``},cooldownSessions:3,isRelevant:async()=>lt()},{id:`feedback-command`,content:async()=>`Use /feedback to help us improve!`,cooldownSessions:15,async isRelevant(){return process.env.USER_TYPE!==`ant`&&P().numStartups>5}}],X=process.env.USER_TYPE===`ant`?[{id:`important-claudemd`,content:async()=>`[ANT-ONLY] Use "IMPORTANT:" prefix for must-follow CLAUDE.md rules`,cooldownSessions:30,isRelevant:async()=>!0},{id:`skillify`,content:async()=>`[ANT-ONLY] Use /skillify at the end of a workflow to turn it into a reusable skill`,cooldownSessions:15,isRelevant:async()=>!0}]:[];function At(){let e=M().spinnerTipsOverride;return e?.tips?.length?e.tips.map((e,t)=>({id:`custom-tip-${t}`,content:async()=>e,cooldownSessions:0,isRelevant:async()=>!0})):[]}async function jt(e){let t=M().spinnerTipsOverride,n=At();if(t?.excludeDefault&&n.length>0)return n;let r=[...kt,...X],i=await Promise.all(r.map(t=>t.isRelevant?.(e)??Promise.resolve(!0)));return[...r.filter((e,t)=>i[t]).filter(e=>q(e.id)>=e.cooldownSessions),...n]}T(),z(),He(),Ue();var Z=2e3,Q=5,Mt=3e4,$=3,Nt=new Set([4003]);function Pt(e){return typeof e!=`object`||!e||!(`type`in e)?!1:typeof e.type==`string`}var Ft=class{constructor(e,t,n,r){i(this,`sessionId`,void 0),i(this,`orgUuid`,void 0),i(this,`getAccessToken`,void 0),i(this,`callbacks`,void 0),i(this,`ws`,null),i(this,`state`,`closed`),i(this,`reconnectAttempts`,0),i(this,`sessionNotFoundRetries`,0),i(this,`pingInterval`,null),i(this,`reconnectTimer`,null),this.sessionId=e,this.orgUuid=t,this.getAccessToken=n,this.callbacks=r}async connect(){if(this.state===`connecting`){E(`[SessionsWebSocket] Already connecting`);return}this.state=`connecting`;let e=`${Ne().BASE_API_URL.replace(`http`,`ws`)}/v1/sessions/ws/${this.sessionId}/subscribe?organization_uuid=${this.orgUuid}`;E(`[SessionsWebSocket] Connecting to ${e}`);let t={Authorization:`Bearer ${this.getAccessToken()}`,"anthropic-version":`2023-06-01`};if(typeof Bun<`u`){let n=new globalThis.WebSocket(e,{headers:t,proxy:Ve(e),tls:U()||void 0});this.ws=n,n.addEventListener(`open`,()=>{E(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),n.addEventListener(`message`,e=>{let t=typeof e.data==`string`?e.data:String(e.data);this.handleMessage(t)}),n.addEventListener(`error`,()=>{let e=Error(`[SessionsWebSocket] WebSocket error`);B(e),this.callbacks.onError?.(e)}),n.addEventListener(`close`,e=>{E(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{E(`[SessionsWebSocket] Pong received`)})}else{let{default:n}=await import(`./wrapper-K8ZapJVu.js`),r=new n(e,{headers:t,agent:We(e),...U()});this.ws=r,r.on(`open`,()=>{E(`[SessionsWebSocket] Connection opened, authenticated via headers`),this.state=`connected`,this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.startPingInterval(),this.callbacks.onConnected?.()}),r.on(`message`,e=>{this.handleMessage(e.toString())}),r.on(`error`,e=>{B(Error(`[SessionsWebSocket] Error: ${e.message}`)),this.callbacks.onError?.(e)}),r.on(`close`,(e,t)=>{E(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{E(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=x(e);Pt(t)?this.callbacks.onMessage(t):E(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){B(Error(`[SessionsWebSocket] Failed to parse message: ${D(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,Nt.has(e)){E(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){E(`[SessionsWebSocket] 4001 retry budget exhausted (${$}), not reconnecting`),this.callbacks.onClose?.();return}this.scheduleReconnect(Z*this.sessionNotFoundRetries,`4001 attempt ${this.sessionNotFoundRetries}/${$}`);return}t===`connected`&&this.reconnectAttempts<Q?(this.reconnectAttempts++,this.scheduleReconnect(Z,`attempt ${this.reconnectAttempts}/${Q}`)):(E(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),E(`[SessionsWebSocket] Scheduling reconnect (${t}) in ${e}ms`),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},e)}startPingInterval(){this.stopPingInterval(),this.pingInterval=setInterval(()=>{if(this.ws&&this.state===`connected`)try{this.ws.ping?.()}catch{}},Mt)}stopPingInterval(){this.pingInterval&&(clearInterval(this.pingInterval),this.pingInterval=null)}sendControlResponse(e){if(!this.ws||this.state!==`connected`){B(Error(`[SessionsWebSocket] Cannot send: not connected`));return}E(`[SessionsWebSocket] Sending control response`),this.ws.send(C(e))}sendControlRequest(e){if(!this.ws||this.state!==`connected`){B(Error(`[SessionsWebSocket] Cannot send: not connected`));return}let t={type:`control_request`,request_id:ft(),request:e};E(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(C(t))}isConnected(){return this.state===`connected`}close(){E(`[SessionsWebSocket] Closing connection`),this.state=`closed`,this.stopPingInterval(),this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.ws&&(this.ws.close(),this.ws=null)}reconnect(){E(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};T(),z(),r();function It(e){return e.type!==`control_request`&&e.type!==`control_response`&&e.type!==`control_cancel_request`}var Lt=class{constructor(e,t){i(this,`config`,void 0),i(this,`callbacks`,void 0),i(this,`websocket`,null),i(this,`pendingPermissionRequests`,new Map),this.config=e,this.callbacks=t}connect(){E(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{E(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{E(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{E(`[RemoteSessionManager] Reconnecting`),this.callbacks.onReconnecting?.()},onError:e=>{B(e),this.callbacks.onError?.(e)}};this.websocket=new Ft(this.config.sessionId,this.config.orgUuid,this.config.getAccessToken,e),this.websocket.connect()}handleMessage(e){if(e.type===`control_request`){this.handleControlRequest(e);return}if(e.type===`control_cancel_request`){let{request_id:t}=e,n=this.pendingPermissionRequests.get(t);E(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){E(`[RemoteSessionManager] Received control response`);return}It(e)&&this.callbacks.onMessage(e)}handleControlRequest(e){let t=e.request_id,n=e.request;if(n.subtype===`can_use_tool`)E(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{E(`[RemoteSessionManager] Unsupported control request subtype: ${n.subtype}`);let e={type:`control_response`,response:{subtype:`error`,request_id:t,error:`Unsupported control request subtype: ${n.subtype}`}};this.websocket?.sendControlResponse(e)}}async sendMessage(e,t){E(`[RemoteSessionManager] Sending message to session ${this.config.sessionId}`);let n=await qe(this.config.sessionId,e,t);return n||B(Error(`[RemoteSessionManager] Failed to send message to session ${this.config.sessionId}`)),n}respondToPermissionRequest(e,t){if(!this.pendingPermissionRequests.get(e)){B(Error(`[RemoteSessionManager] No pending permission request with ID: ${e}`));return}this.pendingPermissionRequests.delete(e);let n={type:`control_response`,response:{subtype:`success`,request_id:e,response:{behavior:t.behavior,...t.behavior===`allow`?{updatedInput:t.updatedInput}:{message:t.message}}}};E(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){E(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){E(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){E(`[RemoteSessionManager] Reconnecting WebSocket`),this.websocket?.reconnect()}};function Rt(e,t,n,r=!1,i=!1){return{sessionId:e,getAccessToken:t,orgUuid:n,hasInitialPrompt:r,viewerOnly:i}}export{Dt as a,St as c,q as i,vt as l,Rt as n,Et as o,jt as r,Tt as s,Lt as t,yt as u};
@@ -1 +1 @@
1
- import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Wt as i,dr as a,fi as o,ot as ee,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{en as l,vr as te}from"./state-4KQ3kaqz.js";import{$y as u,Hr as ne,Il as d,Jn as re,Nr as ie,TS as f,Vl as ae,aC as p,ar as oe,cy as m,fS as h,fi as g,iC as se,jr as _,lS as v,ly as ce,nd as le,op as y,pi as ue,qr as b,rd as x,sp as S,tb as C,ti as de,uS as fe}from"./loadAgentsDir-nzr38hai.js";import{o as w,s as T}from"./log-B3eB4EFv.js";import{n as E,r as D}from"./analytics-BotDBGh0.js";import{u as O}from"./referral-DP_GshTS.js";import{r as pe}from"./asciicast-n-BBfgDq.js";import{a as me,n as k,s as A}from"./skillChangeDetector-A8SAuyo9.js";import{a as j,i as M,n as N,o as P,r as F,t as I}from"./crossProjectResume-DKrtjTpm.js";import{t as L}from"./REPL-BV4WyYMg.js";import{dirname as R}from"path";var z=t(o(),1);f(),l(),P(),C(),y(),s(),O(),E(),v(),p(),M(),d(),m(),N(),w(),_();var B=c();function he(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function V({commands:t,worktreePaths:i,initialTools:o,mcpClients:s,dynamicMcpConfig:c,debug:l,mainThreadAgentDefinition:d,autoConnectIdeFlag:f,strictMcpConfig:p=!1,systemPrompt:m,appendSystemPrompt:_,initialSearchQuery:v,disableSlashCommands:y=!1,forkSession:C,taskListId:w,filterByPr:E,thinkingConfig:O,onTurnComplete:M}){let{rows:N}=ee(),P=fe(e=>e.agentDefinitions),V=h(),[H,U]=z.useState([]),[ve,W]=z.useState(!0),[ye,be]=z.useState(!1),[G,xe]=z.useState(!1),[K,q]=z.useState(null),[J,Se]=z.useState(null),Y=z.useRef(null),X=z.useRef(0),Z=z.useMemo(()=>{let e=H.filter(e=>!e.isSidechain);if(E!==void 0){if(E===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof E==`number`)e=e.filter(e=>e.prNumber===E);else if(typeof E==`string`){let t=he(E);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[H,E]),Ce=ie();z.useEffect(()=>{b(i).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs),W(!1)}).catch(e=>{T(e),W(!1)})},[i]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||oe(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),U(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=z.useCallback(e=>{W(!0),(e?ne():b(i)).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs)}).catch(e=>{T(e)}).finally(()=>{W(!1)})},[i]),we=z.useCallback(()=>{let e=!G;xe(e),$(e)},[G,$]);function Te(){process.exit(1)}async function Ee(t){be(!0);let n=performance.now(),r=I(t,G,i);if(r.isCrossProject&&!r.isSameRepoWorktree){let e=r.command,t=await a(e);t&&process.stdout.write(t),Se(e);return}try{let r=await ce(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!C?(te(se(r.sessionId),t.fullPath?R(t.fullPath):null),await pe(),await g(),S(r.sessionId)):C&&r.contentReplacements?.length&&await de(r.contentReplacements);let{agentDefinition:i}=me(r.agentSetting,d,P);V(e=>({...e,agent:i?.agentType}));let a=k(r.agentName,r.agentColor);if(a&&V(e=>({...e,standaloneAgentContext:a})),ae(r.agentName),ue(C?{...r,worktreeSession:void 0}:r),C||(A(r.worktreeSession),r.sessionId&&re()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(x(),e(le)),n=new Map;n.set(r.sessionId,r.goal),t(n,r.sessionId)}D(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),U([]),q({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor==="default"?void 0:r.agentColor,mainThreadAgentDefinition:i})}catch(e){throw D(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),T(e),e}}return J?(0,B.jsx)(_e,{command:J}):K?(0,B.jsx)(L,{debug:l,commands:t,initialTools:o,initialMessages:K.messages,initialFileHistorySnapshots:K.fileHistorySnapshots,initialContentReplacements:K.contentReplacements,initialAgentName:K.agentName,initialAgentColor:K.agentColor,mcpClients:s,dynamicMcpConfig:c,strictMcpConfig:p,systemPrompt:m,appendSystemPrompt:_,mainThreadAgentDefinition:K.mainThreadAgentDefinition,autoConnectIdeFlag:f,disableSlashCommands:y,taskListId:w,thinkingConfig:O,onTurnComplete:M}):ve?(0,B.jsxs)(n,{children:[(0,B.jsx)(u,{}),(0,B.jsx)(r,{children:` Loading conversations…`})]}):ye?(0,B.jsxs)(n,{children:[(0,B.jsx)(u,{}),(0,B.jsx)(r,{children:` Resuming conversation…`})]}):Z.length===0?(0,B.jsx)(ge,{}):(0,B.jsx)(j,{logs:Z,maxHeight:N,onCancel:Te,onSelect:Ee,onLogsChanged:Ce?()=>$(G):void 0,onLoadMore:Q,initialSearchQuery:v,showAllProjects:G,onToggleAllProjects:we,onAgenticSearch:F})}function ge(){return i(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`No conversations found to resume.`}),(0,B.jsx)(r,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function _e({command:e}){return z.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,B.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,B.jsx)(r,{children:`This conversation is from a different directory.`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`To resume, run:`}),(0,B.jsxs)(r,{children:[` `,e]})]}),(0,B.jsx)(r,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{V as ResumeConversation};
1
+ import{a as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,P as r,Wt as i,dr as a,fi as o,ot as ee,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{en as l,vr as te}from"./state-ix0xIunV.js";import{$y as u,Hr as ne,Il as d,Jn as re,Nr as ie,TS as f,Vl as ae,aC as p,ar as oe,cy as m,fS as h,fi as g,iC as se,jr as _,lS as v,ly as ce,nd as le,op as y,pi as ue,qr as b,rd as x,sp as S,tb as C,ti as de,uS as fe}from"./loadAgentsDir-ZQwvbURI.js";import{o as w,s as T}from"./log-Duzb4o6h.js";import{n as E,r as D}from"./analytics-BotDBGh0.js";import{u as O}from"./referral-Cu9bEOFE.js";import{r as pe}from"./asciicast-CQJlNTae.js";import{a as me,n as k,s as A}from"./skillChangeDetector-BRBCwQ2w.js";import{a as j,i as M,n as N,o as P,r as F,t as I}from"./crossProjectResume-DiKJb83I.js";import{t as L}from"./REPL-Dto012J0.js";import{dirname as R}from"path";var z=t(o(),1);f(),l(),P(),C(),y(),s(),O(),E(),v(),p(),M(),d(),m(),N(),w(),_();var B=c();function he(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function V({commands:t,worktreePaths:i,initialTools:o,mcpClients:s,dynamicMcpConfig:c,debug:l,mainThreadAgentDefinition:d,autoConnectIdeFlag:f,strictMcpConfig:p=!1,systemPrompt:m,appendSystemPrompt:_,initialSearchQuery:v,disableSlashCommands:y=!1,forkSession:C,taskListId:w,filterByPr:E,thinkingConfig:O,onTurnComplete:M}){let{rows:N}=ee(),P=fe(e=>e.agentDefinitions),V=h(),[H,U]=z.useState([]),[ve,W]=z.useState(!0),[ye,be]=z.useState(!1),[G,xe]=z.useState(!1),[K,q]=z.useState(null),[J,Se]=z.useState(null),Y=z.useRef(null),X=z.useRef(0),Z=z.useMemo(()=>{let e=H.filter(e=>!e.isSidechain);if(E!==void 0){if(E===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof E==`number`)e=e.filter(e=>e.prNumber===E);else if(typeof E==`string`){let t=he(E);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[H,E]),Ce=ie();z.useEffect(()=>{b(i).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs),W(!1)}).catch(e=>{T(e),W(!1)})},[i]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||oe(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),U(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=z.useCallback(e=>{W(!0),(e?ne():b(i)).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs)}).catch(e=>{T(e)}).finally(()=>{W(!1)})},[i]),we=z.useCallback(()=>{let e=!G;xe(e),$(e)},[G,$]);function Te(){process.exit(1)}async function Ee(t){be(!0);let n=performance.now(),r=I(t,G,i);if(r.isCrossProject&&!r.isSameRepoWorktree){let e=r.command,t=await a(e);t&&process.stdout.write(t),Se(e);return}try{let r=await ce(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!C?(te(se(r.sessionId),t.fullPath?R(t.fullPath):null),await pe(),await g(),S(r.sessionId)):C&&r.contentReplacements?.length&&await de(r.contentReplacements);let{agentDefinition:i}=me(r.agentSetting,d,P);V(e=>({...e,agent:i?.agentType}));let a=k(r.agentName,r.agentColor);if(a&&V(e=>({...e,standaloneAgentContext:a})),ae(r.agentName),ue(C?{...r,worktreeSession:void 0}:r),C||(A(r.worktreeSession),r.sessionId&&re()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(x(),e(le)),n=new Map;n.set(r.sessionId,r.goal),t(n,r.sessionId)}D(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),U([]),q({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor==="default"?void 0:r.agentColor,mainThreadAgentDefinition:i})}catch(e){throw D(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),T(e),e}}return J?(0,B.jsx)(_e,{command:J}):K?(0,B.jsx)(L,{debug:l,commands:t,initialTools:o,initialMessages:K.messages,initialFileHistorySnapshots:K.fileHistorySnapshots,initialContentReplacements:K.contentReplacements,initialAgentName:K.agentName,initialAgentColor:K.agentColor,mcpClients:s,dynamicMcpConfig:c,strictMcpConfig:p,systemPrompt:m,appendSystemPrompt:_,mainThreadAgentDefinition:K.mainThreadAgentDefinition,autoConnectIdeFlag:f,disableSlashCommands:y,taskListId:w,thinkingConfig:O,onTurnComplete:M}):ve?(0,B.jsxs)(n,{children:[(0,B.jsx)(u,{}),(0,B.jsx)(r,{children:` Loading conversations…`})]}):ye?(0,B.jsxs)(n,{children:[(0,B.jsx)(u,{}),(0,B.jsx)(r,{children:` Resuming conversation…`})]}):Z.length===0?(0,B.jsx)(ge,{}):(0,B.jsx)(j,{logs:Z,maxHeight:N,onCancel:Te,onSelect:Ee,onLogsChanged:Ce?()=>$(G):void 0,onLoadMore:Q,initialSearchQuery:v,showAllProjects:G,onToggleAllProjects:we,onAgenticSearch:F})}function ge(){return i(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`No conversations found to resume.`}),(0,B.jsx)(r,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function _e({command:e}){return z.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,B.jsxs)(n,{flexDirection:`column`,gap:1,children:[(0,B.jsx)(r,{children:`This conversation is from a different directory.`}),(0,B.jsxs)(n,{flexDirection:`column`,children:[(0,B.jsx)(r,{children:`To resume, run:`}),(0,B.jsxs)(r,{children:[` `,e]})]}),(0,B.jsx)(r,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{V as ResumeConversation};
@@ -1,4 +1,4 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{D as a,E as o,O as s,U as c,l,p as u,z as d}from"./debug-IKW-jE7K.js";import{M as f,j as p}from"./git-tyaWOgRL.js";import{lr as m,ur as h,vn as g,yn as _}from"./model-DfFA3qMO.js";import{E as v,O as y,n as b,t as x}from"./rcDebugLog-BUuD-X1D.js";function S(){return!0}function C(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={},s=!1;for(let e of a.split(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./defineProperty-C-QyHrDq.js";import{n as r,t as i}from"./axios-DaWTGg7G.js";import{D as a,E as o,O as s,U as c,l,p as u,z as d}from"./debug-DiuXEmUq.js";import{M as f,j as p}from"./git-Cgc8X5l2.js";import{lr as m,ur as h,vn as g,yn as _}from"./model-BgrLt7P7.js";import{E as v,O as y,n as b,t as x}from"./rcDebugLog-CivJaJ3V.js";function S(){return!0}function C(e){let t=[],n=0,r=/\r?\n\r?\n/g;r.lastIndex=n;let i;for(;(i=r.exec(e))!==null;){let r=i.index,a=e.slice(n,r);if(n=r+i[0].length,!a.trim())continue;let o={},s=!1;for(let e of a.split(`
2
2
  `)){let t=e[e.length-1]===`\r`?e.slice(0,-1):e;if(t.startsWith(`:`)){s=!0;continue}let n=t.indexOf(`:`);if(n===-1)continue;let r=t.slice(0,n),i=t[n+1]===` `?t.slice(n+2):t.slice(n+1);switch(r){case`event`:o.event=i;break;case`id`:o.id=i;break;case`data`:o.data=o.data?o.data+`
3
3
  `+i:i;break}}(o.data||s)&&t.push(o)}return{frames:t,remaining:e.slice(n)}}function w(e){let t=e.pathname;return t.endsWith(`/stream`)&&(t=t.slice(0,-7)),`${e.protocol}//${e.host}${t}`}var T,E,D,O,k,A,j,M,N,P,F=e((()=>{i(),l(),x(),p(),c(),y(),g(),o(),h(),t(),T=1e3,E=3e4,D=6e5,O=45e3,k=new Set([401,403,404]),A=10,j=500,M=8e3,N={stream:!0},P=class{constructor(e,t={},r,i,a,o){n(this,`url`,void 0),n(this,`state`,`idle`),n(this,`onData`,void 0),n(this,`onCloseCallback`,void 0),n(this,`onEventCallback`,void 0),n(this,`headers`,void 0),n(this,`sessionId`,void 0),n(this,`refreshHeaders`,void 0),n(this,`getAuthHeaders`,void 0),n(this,`abortController`,null),n(this,`lastSequenceNum`,0),n(this,`seenSequenceNums`,new Set),n(this,`reconnectAttempts`,0),n(this,`reconnectStartTime`,null),n(this,`reconnectTimer`,null),n(this,`livenessTimer`,null),n(this,`lastActivityTime`,0),n(this,`postUrl`,void 0),n(this,`onLivenessTimeout`,()=>{this.livenessTimer=null,b(`SSE liveness timeout (${O}ms) lastSeqNum=${this.getLastSequenceNum()} state=${this.state}`),u(`SSETransport: Liveness timeout, reconnecting`,{level:`error`}),f(`error`,`cli_sse_liveness_timeout`),this.abortController?.abort(),this.handleConnectionError()}),this.url=e,this.headers=t,this.sessionId=r,this.refreshHeaders=i,this.getAuthHeaders=o??v,this.postUrl=w(e),a!==void 0&&a>0&&(this.lastSequenceNum=a),u(`SSETransport: SSE URL = ${e.href}`),u(`SSETransport: POST URL = ${this.postUrl}`),f(`info`,`cli_sse_transport_initialized`)}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){u(`SSETransport: Cannot connect, current state is ${this.state}`,{level:`error`}),f(`error`,`cli_sse_connect_failed`);return}this.state=`reconnecting`;let e=Date.now(),t=new URL(this.url.href);this.lastSequenceNum>0&&t.searchParams.set(`from_sequence_num`,String(this.lastSequenceNum));let n=this.getAuthHeaders(),r={...this.headers,...n,Accept:`text/event-stream`,"anthropic-version":`2023-06-01`,"User-Agent":m()};n.Cookie&&delete r.Authorization,this.lastSequenceNum>0&&(r[`Last-Event-ID`]=String(this.lastSequenceNum)),u(`SSETransport: Opening ${t.href}`),f(`info`,`cli_sse_connect_opening`),this.abortController=new AbortController;try{let n=await fetch(t.href,{headers:r,signal:this.abortController.signal});if(!n.ok){let e=k.has(n.status);if(u(`SSETransport: HTTP ${n.status}${e?` (permanent)`:``}`,{level:`error`}),f(`error`,`cli_sse_connect_http_error`,{status:n.status}),e){this.state=`closed`,this.onCloseCallback?.(n.status);return}this.handleConnectionError();return}if(!n.body){u(`SSETransport: No response body`),this.handleConnectionError();return}let i=Date.now()-e;u(`SSETransport: Connected`),f(`info`,`cli_sse_connect_connected`,{duration_ms:i}),this.state=`connected`,this.reconnectAttempts=0,this.reconnectStartTime=null,this.resetLivenessTimer(),await this.readStream(n.body)}catch(e){if(this.abortController?.signal.aborted)return;u(`SSETransport: Connection error: ${d(e)}`,{level:`error`}),f(`error`,`cli_sse_connect_error`),this.handleConnectionError()}}async readStream(e){let t=e.getReader(),n=new TextDecoder,r=``,i=1024*1024;try{for(;;){let{done:e,value:a}=await t.read();if(e)break;if(r+=n.decode(a,N),r.length>i){u(`SSETransport: Buffer exceeded ${i} bytes — dropping connection`,{level:`error`}),f(`error`,`cli_sse_buffer_overflow`);break}let{frames:o,remaining:s}=C(r);r=s;for(let e of o){if(this.resetLivenessTimer(),e.id){let t=parseInt(e.id,10);if(!isNaN(t)){if(this.seenSequenceNums.has(t))u(`SSETransport: DUPLICATE frame seq=${t} (lastSequenceNum=${this.lastSequenceNum}, seenCount=${this.seenSequenceNums.size})`,{level:`warn`}),f(`warn`,`cli_sse_duplicate_sequence`);else if(this.seenSequenceNums.add(t),this.seenSequenceNums.size>1e3){let e=this.lastSequenceNum-200;for(let t of this.seenSequenceNums)t<e&&this.seenSequenceNums.delete(t)}t>this.lastSequenceNum&&(this.lastSequenceNum=t)}}e.event&&e.data?this.handleSSEFrame(e.event,e.data):e.data&&(u(`SSETransport: Frame has data: but no event: field — dropped`,{level:`warn`}),f(`warn`,`cli_sse_frame_missing_event_field`))}}}catch(e){if(this.abortController?.signal.aborted)return;u(`SSETransport: Stream read error: ${d(e)}`,{level:`error`}),f(`error`,`cli_sse_stream_read_error`)}finally{t.releaseLock()}this.state!==`closing`&&this.state!==`closed`&&(u(`SSETransport: Stream ended, reconnecting`),this.handleConnectionError())}handleSSEFrame(e,t){if(e!==`client_event`){u(`SSETransport: Unexpected SSE event type '${e}' on worker stream`,{level:`warn`}),f(`warn`,`cli_sse_unexpected_event_type`,{event_type:e});return}let n;try{n=a(t)}catch(e){u(`SSETransport: Failed to parse client_event data: ${d(e)}`,{level:`error`});return}let r=n.payload;if(r&&typeof r==`object`&&`type`in r){let e=this.sessionId?` session=${this.sessionId}`:``;u(`SSETransport: Event seq=${n.sequence_num} event_id=${n.event_id} event_type=${n.event_type} payload_type=${String(r.type)}${e}`),f(`info`,`cli_sse_message_received`),this.onData?.(s(r)+`
4
4
  `)}else u(`SSETransport: Ignoring client_event with no type in payload: event_id=${n.event_id}`);this.onEventCallback?.(n)}handleConnectionError(){if(b(`SSE handleConnectionError: state=${this.state} lastSeqNum=${this.getLastSequenceNum()} reconnectAttempts=${this.reconnectAttempts} msSinceLastActivity=${this.lastActivityTime>0?Date.now()-this.lastActivityTime:-1}`),this.clearLivenessTimer(),this.state===`closing`||this.state===`closed`)return;this.abortController?.abort(),this.abortController=null;let e=Date.now();this.reconnectStartTime||(this.reconnectStartTime=e);let t=e-this.reconnectStartTime;if(t<D){if(this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.refreshHeaders){let e=this.refreshHeaders();Object.assign(this.headers,e),u(`SSETransport: Refreshed headers for reconnect`)}this.state=`reconnecting`,this.reconnectAttempts++;let e=Math.min(T*2**(this.reconnectAttempts-1),E),n=Math.max(0,e+e*.25*(2*Math.random()-1));u(`SSETransport: Reconnecting in ${Math.round(n)}ms (attempt ${this.reconnectAttempts}, ${Math.round(t/1e3)}s elapsed)`),f(`error`,`cli_sse_reconnect_attempt`,{reconnectAttempts:this.reconnectAttempts}),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},n)}else u(`SSETransport: Reconnection time budget exhausted after ${Math.round(t/1e3)}s`,{level:`error`}),f(`error`,`cli_sse_reconnect_exhausted`,{reconnectAttempts:this.reconnectAttempts,elapsedMs:t}),this.state=`closed`,this.onCloseCallback?.()}resetLivenessTimer(){this.clearLivenessTimer(),this.livenessTimer=setTimeout(this.onLivenessTimeout,O)}clearLivenessTimer(){this.livenessTimer&&(clearTimeout(this.livenessTimer),this.livenessTimer=null)}async write(e){let t=this.getAuthHeaders();if(Object.keys(t).length===0){u(`SSETransport: No session token available for POST`),f(`warn`,`cli_sse_post_no_token`);return}let n={...t,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`,"User-Agent":m()};u(`SSETransport: POST body keys=${Object.keys(e).join(`,`)}`);for(let t=1;t<=A;t++){try{let i=await r.post(this.postUrl,e,{headers:n,validateStatus:S});if(i.status===200||i.status===201){u(`SSETransport: POST success type=${e.type}`);return}if(u(`SSETransport: POST ${i.status} body=${s(i.data).slice(0,200)}`),i.status>=400&&i.status<500&&i.status!==429){u(`SSETransport: POST returned ${i.status} (client error), not retrying`),f(`warn`,`cli_sse_post_client_error`,{status:i.status});return}u(`SSETransport: POST returned ${i.status}, attempt ${t}/${A}`),f(`warn`,`cli_sse_post_retryable_error`,{status:i.status,attempt:t})}catch(e){u(`SSETransport: POST error: ${e.message}, attempt ${t}/${A}`),f(`warn`,`cli_sse_post_network_error`,{attempt:t})}if(t===A){u(`SSETransport: POST failed after ${A} attempts, continuing`),f(`warn`,`cli_sse_post_retries_exhausted`);return}await _(Math.min(j*2**(t-1),M))}}isConnectedStatus(){return this.state===`connected`}isClosedStatus(){return this.state===`closed`}setOnData(e){this.onData=e}setOnClose(e){this.onCloseCallback=e}setOnEvent(e){this.onEventCallback=e}close(){this.reconnectTimer&&(clearTimeout(this.reconnectTimer),this.reconnectTimer=null),this.clearLivenessTimer(),this.state=`closing`,this.abortController?.abort(),this.abortController=null}}}));export{F as n,C as r,P as t};
@@ -0,0 +1 @@
1
+ import{_T as e,vT as t}from"./loadAgentsDir-ZQwvbURI.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -1,2 +1,2 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-DSxRz_kt.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{D as c,Gt as ee,H as l,I as u,P as d,T as f,U as te,Wt as ne,Xn as re,a as ie,d as ae,di as p,fi as m,k as oe,n as se,ot as ce,r as le,t as h,ui as g,x as _,y as ue}from"./src-CDCSSo0U2.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{en as y,gr as de,ht as b,qt as fe}from"./state-4KQ3kaqz.js";import{$T as pe,C as x,Dg as me,F as he,Hb as ge,Mb as S,Nb as _e,Ng as ve,Og as ye,Pb as be,S as xe,TS as C,Vb as w,ZT as Se,af as Ce,ah as we,as as Te,cx as T,dS as Ee,eE as De,ex as Oe,fS as ke,if as Ae,is as E,jr as D,lS as O,lx as je,mr as k,oh as Me,op as Ne,os as Pe,rp as A,tE as j,tx as Fe,uS as M,v as Ie}from"./loadAgentsDir-nzr38hai.js";import{n as Le,t as Re}from"./cwd-BuJhkTrc.js";import{E as ze,O as Be}from"./debug-IKW-jE7K.js";import{Ft as Ve,Ht as He,Lt as Ue,Rt as We,c as Ge,g as N,n as Ke,y as P,zt as qe}from"./settings-5PQdphqC.js";import{a as Je,b as F,c as I,g as Ye,i as Xe,m as Ze,o as Qe}from"./config-C7YHKCPV.js";import{o as L,s as $e}from"./log-B3eB4EFv.js";import{n as et,r as R}from"./analytics-BotDBGh0.js";import{b as tt,g as nt}from"./startupProfiler-DxRQteII.js";import{r as rt}from"./permissions-Cn_6f8CB.js";import{Ar as it,It as at,J as ot,K as st,Vt as ct,_ as lt,at as ut,b as dt,it as ft,kr as pt,nt as mt,q as ht,tt as z,x as gt}from"./model-DfFA3qMO.js";import{r as _t,t as vt}from"./poorMode-Bsw2V-V_.js";import{u as yt}from"./referral-DP_GshTS.js";import{i as bt,r as xt}from"./bridgeEnabled--F-6TUi4.js";import{a as B,c as V,d as H,i as St,l as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot,u as U}from"./status-is_Bg_IB.js";import{n as kt,t as At}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";import{i as jt,n as W,r as Mt}from"./modalContext-DFjKLCB6.js";import{n as Nt,t as Pt}from"./ThemePicker-BYbChJpu.js";import{i as Ft,n as It,r as Lt,t as Rt}from"./extraUsage-BYZdi44Y.js";import{n as G,t as zt}from"./ClaudeMdExternalIncludesDialog-CTWhpIm8.js";import{t as Bt}from"./SearchBox-vfLXEPed.js";import{n as Vt,t as Ht}from"./useSearchInput-C-CqUK6w.js";import{n as Ut,t as Wt}from"./usage-CJ5w0907.js";import{a as Gt,i as Kt,t as qt}from"./OverageCreditUpsell-1FCN8bH3.js";function Jt(){let e=b();return[{label:`Version`,value:`0.0.1`},{label:`Session name`,value:k(e)??(0,K.jsx)(d,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Re()},...wt(),...Ot()]}function Yt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:U(e)},...Et(t.clients,r.options.ideInstallationStatus,n),...Tt(t.clients,n),...V(),...Ct()]}async function Xt(){return[...await St(),...await B(),...await Dt()]}function Zt({value:e}){return Array.isArray(e)?(0,K.jsx)(u,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(d,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(d,{children:e}):e}function Qt({context:e,diagnosticsPromise:t}){let n=M(e=>e.mainLoopModel),r=M(e=>e.mcp),[i]=l(),a=en.useMemo(()=>[Jt(),Yt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=Mt()?1:void 0;return(0,K.jsxs)(u,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(u,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(u,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(u,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(d,{bold:!0,children:[e,`:`]}),(0,K.jsx)(Zt,{value:t})]},n))},t)),(0,K.jsx)(tn.Suspense,{fallback:null,children:(0,K.jsx)($t,{promise:t})})]}),(0,K.jsx)(d,{dimColor:!0,children:(0,K.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function $t({promise:e}){let t=(0,tn.use)(e);return t.length===0?null:(0,K.jsxs)(u,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(d,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(u,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(d,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(d,{wrap:`wrap`,children:e}):e]},t))]})}var en,tn,K,nn=t((()=>{o(),en=n(m(),1),tn=n(m(),1),y(),W(),h(),O(),Le(),D(),H(),ge(),K=v()}));function rn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,an.jsxs)(ue,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,an.jsxs)(d,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,an.jsx)(d,{dimColor:!0,children:`How would you like to handle this?`}),(0,an.jsx)(_e,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var an,on=t((()=>{m(),h(),S(),an=v()}));function sn(e){return Object.entries(e).map(([e,t])=>({label:t?.name??un,value:e,description:t?.description??dn}))}function cn({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,ln.useState)([]),[o,s]=(0,ln.useState)(!0);(0,ln.useEffect)(()=>{Te(Re()).then(e=>{let t=sn(e);a(t),s(!1)}).catch(()=>{let e=sn(E);a(e),s(!1)})},[]);let c=(0,ln.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(ue,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(d,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(d,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(_e,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var ln,q,un,dn,fn=t((()=>{m(),ln=n(m(),1),Pe(),h(),Le(),be(),q=v(),un=`Default`,dn=`Claude completes coding tasks efficiently and provides concise responses`}));function pn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,mn.useState)(e),[a,o]=(0,mn.useState)((e??``).length);ne(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(d,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(d,{children:s.pointer}),(0,J.jsx)(Oe,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(d,{dimColor:!0,children:`Leave empty for default (English)`})]})}var mn,J,hn=t((()=>{o(),mn=n(m(),1),h(),yt(),Fe(),J=v()}));function gn({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:ae}){let{headerFocused:p,focusHeader:m}=ie(),se=Mt(),[,le]=l(),h=te(),[_,v]=(0,X.useState)(I()),y=Y.useRef(I()),[b,x]=(0,X.useState)(Ke()),ge=Y.useRef(Ke()),[S,ye]=(0,X.useState)(b?.outputStyle||`default`),be=Y.useRef(S),[C,we]=(0,X.useState)(b?.language),Te=Y.useRef(C),[T,Oe]=(0,X.useState)(0),[E,D]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),Me=re(),{rows:Ne}=ce(),Pe=ae??Math.min(Math.floor(Ne*.8),30),A=Math.max(5,Pe-10),j=M(e=>e.mainLoopModel),Fe=M(e=>e.verbose),Le=M(e=>e.thinkingEnabled),Re=M(e=>ft()?e.fastMode:!1);M(e=>e.promptSuggestionEnabled);let ze=We(b?.permissions?.defaultMode??`default`),Be=xe()||Ie()===`enabled`,Ve=(Ce(),e(Ae)).isBriefEntitled(),N=ke(),[Ye,L]=(0,X.useState)({}),et=Y.useRef(Le),[tt]=(0,X.useState)(()=>Ge(`localSettings`)),[nt]=(0,X.useState)(()=>Ge(`userSettings`)),at=Y.useRef(h),ct=Ee(),[lt]=(0,X.useState)(()=>{let e=ct.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,isBriefOnly:e.isBriefOnly,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),[pt]=(0,X.useState)(()=>fe()),z=Y.useRef(!1),[yt,xt]=(0,X.useState)(!1),[B,V]=(0,X.useState)(null),{query:H,setQuery:St,cursorOffset:Ct}=Vt({isActive:O&&B===null&&!p,onExit:()=>k(!1),onExitUp:m,passthroughCtrlKeys:[`c`,`d`]}),wt=O&&!p;Y.useEffect(()=>{o?.(wt)},[wt,o]);let Tt=me(n.options.mcpClients),Et=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Dt=Y.use(pe(!0)),Ot=De(Dt),U=Je();function kt(e){R(`tengu_config_model_changed`,{from_model:j,to_model:e}),N(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),L(t=>{let n=gt(e)+(It(e,!1,dt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function At(e){F(t=>({...t,verbose:e})),v({...I(),verbose:e}),N(t=>({...t,verbose:e})),L(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let jt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:_.autoCompactEnabled,type:`boolean`,onChange(e){F(t=>({...t,autoCompactEnabled:e})),v({...I(),autoCompactEnabled:e}),R(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:b?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){P(`localSettings`,{spinnerTipsEnabled:e}),x(t=>({...t,spinnerTipsEnabled:e})),R(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:b?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){P(`localSettings`,{cacheWarningEnabled:e}),x(t=>({...t,cacheWarningEnabled:e})),R(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:b?.prefersReducedMotion??!1,type:`boolean`,onChange(e){P(`localSettings`,{prefersReducedMotion:e}),x(t=>({...t,prefersReducedMotion:e})),N(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),R(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Le??!0,type:`boolean`,onChange(e){N(t=>({...t,thinkingEnabled:e})),P(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),R(`tengu_thinking_toggled`,{enabled:e})}},...ft()&&mt()?[{id:`fastMode`,label:`Fast mode (${st} only)`,value:!!Re,type:`boolean`,onChange(e){ht(),P(`userSettings`,{fastMode:e?!0:void 0}),e?(N(e=>({...e,mainLoopModel:ot(),mainLoopModelForSession:null,fastMode:!0})),L(e=>({...e,model:ot(),"Fast mode":`ON`}))):(N(e=>({...e,fastMode:!1})),L(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(vt(),e(_t)).isPoorModeActive(),type:`boolean`,onChange(t){(vt(),e(_t)).setPoorMode(t),N(e=>({...e,promptSuggestionEnabled:!t}))}},...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:_.speculationEnabled??!0,type:`boolean`,onChange(e){F(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),v({...I(),speculationEnabled:e}),R(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Et?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:_.fileCheckpointingEnabled,type:`boolean`,onChange(e){F(t=>({...t,fileCheckpointingEnabled:e})),v({...I(),fileCheckpointingEnabled:e}),R(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Fe,type:`boolean`,onChange:At},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:_.terminalProgressBarEnabled,type:`boolean`,onChange(e){F(t=>({...t,terminalProgressBarEnabled:e})),v({...I(),terminalProgressBarEnabled:e}),R(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:_.showTurnDuration,type:`boolean`,onChange(e){F(t=>({...t,showTurnDuration:e})),v({...I(),showTurnDuration:e}),R(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:ze,options:(()=>{let e=[`default`,`plan`];return[...e,...rt.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=We(e),n=t===`auto`?t:Ue(t)?He(t):t,r=P(`userSettings`,{permissions:{...b?.permissions,defaultMode:n}});if(r.error){$e(r.error);return}x(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),L(t=>({...t,defaultPermissionMode:e})),R(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...Be?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:b?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){P(`userSettings`,{useAutoModeDuringPlan:e}),x(t=>({...t,useAutoModeDuringPlan:e})),N(e=>{let t=he(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),L(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:_.respectGitignore,type:`boolean`,onChange(e){F(t=>({...t,respectGitignore:e})),v({...I(),respectGitignore:e}),R(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...je()?[{id:`copyOnSelect`,label:`Copy on select`,value:_.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),v({...I(),copyOnSelect:e}),R(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],U?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:b?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:h,type:`managedEnum`,onChange:le},{id:`notifChannel`,label:`Local notifications`,value:_.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){F(t=>({...t,preferredNotifChannel:e})),v({...I(),preferredNotifChannel:e})}},{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:_.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){F(t=>({...t,taskCompleteNotifEnabled:e})),v({...I(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:_.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){F(t=>({...t,inputNeededNotifEnabled:e})),v({...I(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:_.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){F(t=>({...t,agentPushNotifEnabled:e})),v({...I(),agentPushNotifEnabled:e})}},{id:`outputStyle`,label:`Output style`,value:S,type:`managedEnum`,onChange:()=>{}},...Ve?[{id:`defaultView`,label:`What you see by default`,value:b?.defaultView===void 0?`default`:String(b.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e==="default"?void 0:e;P(`localSettings`,{defaultView:t}),x(e=>({...e,defaultView:t}));let n=t===`chat`;N(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),de(n),L(t=>({...t,"Default view":e})),R(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:C??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:_.editorMode===`emacs`?`normal`:_.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){F(t=>({...t,editorMode:e})),v({...I(),editorMode:e}),R(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:_.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){F(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),v({...I(),prStatusFooterEnabled:e}),R(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:j===null?`Default (recommended)`:j,type:`managedEnum`,onChange:kt},...Tt?[{id:`diffTool`,label:`Diff tool`,value:_.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){F(t=>({...t,diffTool:e})),v({...I(),diffTool:e}),R(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...ve()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:_.autoConnectIde??!1,type:`boolean`,onChange(e){F(t=>({...t,autoConnectIde:e})),v({...I(),autoConnectIde:e}),R(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...ve()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:_.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){F(t=>({...t,autoInstallIdeExtension:e})),v({...I(),autoInstallIdeExtension:e}),R(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...bt()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:_.remoteControlAtStartup===void 0?`default`:String(_.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e==="default")F(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),v({...I(),remoteControlAtStartup:void 0});else{let t=e===`true`;F(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),v({...I(),remoteControlAtStartup:t})}let t=Ze();N(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Ot?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Qe().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(d,{children:[`Use custom API key: `,(0,Z.jsx)(d,{bold:!0,children:it(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&_.customApiKeyResponses?.approved?.includes(it(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){F(t=>{let n={...t};if(n.customApiKeyResponses||(n.customApiKeyResponses={approved:[],rejected:[]}),n.customApiKeyResponses.approved||(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]}),n.customApiKeyResponses.rejected||(n.customApiKeyResponses={...n.customApiKeyResponses,rejected:[]}),process.env.ANTHROPIC_API_KEY){let t=it(process.env.ANTHROPIC_API_KEY);e?n.customApiKeyResponses={...n.customApiKeyResponses,approved:[...(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),t],rejected:(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t)}:n.customApiKeyResponses={...n.customApiKeyResponses,approved:(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),rejected:[...(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t),t]}}return n}),v(I())}}]:[]],W=Y.useMemo(()=>{if(!H)return jt;let e=H.toLowerCase();return jt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[jt,H]);Y.useEffect(()=>{if(T>=W.length){let e=Math.max(0,W.length-1);Oe(e),D(Math.max(0,e-A+1));return}D(e=>T<e?T:T>=e+A?T-A+1:e)},[W.length,T,A]);let Nt=(0,X.useCallback)(e=>{D(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),Ft=(0,X.useCallback)(()=>{if(B!==null)return;let e=Object.entries(Ye).map(([e,t])=>(R(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${g.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&y.current.customApiKeyResponses?.approved?.includes(it(n))),a=!!(n&&_.customApiKeyResponses?.approved?.includes(it(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),R(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),_.theme!==y.current.theme&&e.push(`Set theme to ${g.bold(_.theme)}`),_.preferredNotifChannel!==y.current.preferredNotifChannel&&e.push(`Set notifications to ${g.bold(_.preferredNotifChannel)}`),S!==be.current&&e.push(`Set output style to ${g.bold(S)}`),C!==Te.current&&e.push(`Set response language to ${g.bold(C??`Default (English)`)}`),_.editorMode!==y.current.editorMode&&e.push(`Set editor mode to ${g.bold(_.editorMode||`emacs`)}`),_.diffTool!==y.current.diffTool&&e.push(`Set diff tool to ${g.bold(_.diffTool)}`),_.autoConnectIde!==y.current.autoConnectIde&&e.push(`${_.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),_.autoInstallIdeExtension!==y.current.autoInstallIdeExtension&&e.push(`${_.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),_.autoCompactEnabled!==y.current.autoCompactEnabled&&e.push(`${_.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),_.respectGitignore!==y.current.respectGitignore&&e.push(`${_.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),_.copyOnSelect!==y.current.copyOnSelect&&e.push(`${_.copyOnSelect?`Enabled`:`Disabled`} copy on select`),_.terminalProgressBarEnabled!==y.current.terminalProgressBarEnabled&&e.push(`${_.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),_.showStatusInTerminalTab!==y.current.showStatusInTerminalTab&&e.push(`${_.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),_.showTurnDuration!==y.current.showTurnDuration&&e.push(`${_.showTurnDuration?`Enabled`:`Disabled`} turn duration`),_.remoteControlAtStartup!==y.current.remoteControlAtStartup){let t=_.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${_.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}b?.autoUpdatesChannel!==ge.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${g.bold(b?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
- `)):t(`Config dialog dismissed`,{display:`system`})},[B,Ye,_,j,S,C,b?.autoUpdatesChannel,ft()?b?.fastMode:void 0,t]),Rt=(0,X.useCallback)(()=>{h!==at.current&&le(at.current),F(()=>y.current);let e=tt;P(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=nt;P(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,useAutoModeDuringPlan:t?.useAutoModeDuringPlan,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=lt;N(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,isBriefOnly:n.isBriefOnly,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:he(e.toolPermissionContext)})),fe()!==pt&&de(pt)},[h,le,tt,nt,lt,pt,N]);ne(`confirm:no`,(0,X.useCallback)(()=>{B===null&&(z.current&&Rt(),t(`Config dialog dismissed`,{display:`system`}))},[B,Rt,t]),{context:`Settings`,isActive:B===null&&!O&&!p}),ne(`settings:close`,Ft,{context:`Settings`,isActive:B===null&&!O&&!p});let G=(0,X.useCallback)(()=>{let e=W[T];if(!(!e||!e.onChange)){if(e.type===`boolean`){z.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===et.current?xt(!1):n.messages.some(e=>e.type===`assistant`)&&xt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:V(`Theme`),a(!0);return;case`model`:V(`Model`),a(!0);return;case`showExternalIncludesDialog`:V(`ExternalIncludes`),a(!0);return;case`outputStyle`:V(`OutputStyle`),a(!0);return;case`language`:V(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(U){V(`EnableAutoUpdates`),a(!0);return}(b?.autoUpdatesChannel??`latest`)===`latest`?(V(`ChannelDowngrade`),a(!0)):(z.current=!0,P(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),x(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),R(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){z.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[U,W,T,b?.autoUpdatesChannel,a]),Bt=e=>{xt(!1);let t=Math.max(0,Math.min(W.length-1,T+e));Oe(t),Nt(t)};return ee({"select:previous":()=>{T===0?(xt(!1),k(!0),D(0)):Bt(-1)},"select:next":()=>Bt(1),"scroll:lineUp":()=>Bt(-1),"scroll:lineDown":()=>Bt(1),"select:accept":G,"select:previousValue":()=>G(),"select:nextValue":()=>G(),"settings:search":()=>{k(!0),St(``)}},{context:`Settings`,isActive:B===null&&!O&&!p}),(0,Z.jsx)(u,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(B===null&&!p){if(O){if(e.key===`escape`){e.preventDefault(),H.length>0?St(``):k(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),k(!1),Oe(0),D(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),G();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),St(e.key))}},[B,p,O,H,St,G]),children:B===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Pt,{onThemeSelect:e=>{z.current=!0,le(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(u,{children:(0,Z.jsx)(d,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):B===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Lt,{initial:j,onSelect:(e,t)=>{z.current=!0,kt(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},showFastModeNotice:ft()?Re&&ut(j)&&mt():!1}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zt,{onDone:()=>{V(null),a(!1)},externalIncludes:Se(Dt)}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):B===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{initialStyle:S,onComplete:e=>{z.current=!0,ye(e??`default`),V(null),a(!1),P(`localSettings`,{outputStyle:e}),R(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pn,{initialLanguage:C,onComplete:e=>{z.current=!0,we(e),V(null),a(!1),P(`userSettings`,{language:e}),R(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):B===`EnableAutoUpdates`?(0,Z.jsx)(ue,{title:`Enable Auto-Updates`,onCancel:()=>{V(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:U?.type===`config`?(0,Z.jsx)(_e,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{z.current=!0,V(null),a(!1),F(e=>({...e,autoUpdates:!0})),v({...I(),autoUpdates:!0}),P(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),x(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),R(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{children:U?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),U?.type===`env`&&(0,Z.jsxs)(d,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):B===`ChannelDowngrade`?(0,Z.jsx)(rn,{currentVersion:`0.0.1`,onChoice:e=>{if(V(null),a(!1),e===`cancel`)return;z.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.1`),P(`userSettings`,t),x(e=>({...e,...t})),R(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(u,{flexDirection:`column`,gap:1,marginY:se?void 0:1,children:[(0,Z.jsx)(oe,{query:H,isFocused:O&&!p,isTerminalFocused:Me,cursorOffset:Ct,placeholder:`Search settings…`}),(0,Z.jsx)(u,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(d,{dimColor:!0,italic:!0,children:[`No settings match "`,H,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[E>0&&(0,Z.jsxs)(d,{dimColor:!0,children:[s.arrowUp,` `,E,` more above`]}),W.slice(E,E+A).map((e,t)=>{let n=E+t===T&&!p&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(u,{width:`100%`,children:[(0,Z.jsx)(u,{width:44,children:(0,Z.jsxs)(d,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(u,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:e.value.toString()}),yt&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(d,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:vn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(_n,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:qe(e.value)}):e.id===`autoUpdatesChannel`&&U?(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(d,{dimColor:!0,children:[`(`,Xe(U),`)`]})]}):(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),E+A<W.length&&(0,Z.jsxs)(d,{dimColor:!0,children:[s.arrowDown,` `,W.length-E-A,` more below`]})]})}),p?(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(d,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(w,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(w,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(w,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function _n({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(d,{children:[`iTerm2 `,(0,Z.jsx)(d,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(d,{children:[`Terminal Bell `,(0,Z.jsx)(d,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(d,{children:[`Kitty `,(0,Z.jsx)(d,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(d,{children:[`Ghostty `,(0,Z.jsx)(d,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,vn,yn=t((()=>{h(),Y=n(m(),1),X=n(m(),1),yt(),o(),Ye(),pt(),p(),Ve(),x(),L(),et(),xt(),Nt(),O(),Ft(),lt(),Rt(),G(),on(),S(),fn(),hn(),j(),ge(),W(),Bt(),ye(),N(),y(),Pe(),a(),Ht(),C(),z(),T(),Z=v(),vn={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function bn({title:e,limit:t,maxWidth:n,showTimeInReset:r=!0,extraSubtext:i}){let{utilization:a,resets_at:o}=t;if(a===null)return null;let s=`${Math.floor(a)}% used`,c;return o&&(c=`Resets ${nt(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsx)(d,{bold:!0,children:e}),(0,Q.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ae,{ratio:a/100,width:50,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(d,{children:s})]}),c&&(0,Q.jsx)(d,{dimColor:!0,children:c})]}):(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsxs)(d,{children:[(0,Q.jsx)(d,{bold:!0,children:e}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(d,{children:` `}),(0,Q.jsxs)(d,{dimColor:!0,children:[`· `,c]})]})]}),(0,Q.jsx)(ae,{ratio:a/100,width:n,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(d,{children:s})]})}function xn(){let[e,t]=(0,wn.useState)(null),[n,r]=(0,wn.useState)(null),[i,a]=(0,wn.useState)(!0),{columns:o}=ce(),s=o-2,c=Math.min(s,80),ee=Cn.useCallback(async()=>{a(!0),r(null);try{let e=await Wt();t(e)}catch(e){$e(e);let t=e,n=t.response?.data?Be(t.response.data):void 0;r(n?`Failed to load usage data: ${n}`:`Failed to load usage data`)}finally{a(!1)}},[]);if((0,wn.useEffect)(()=>{ee()},[ee]),ne(`settings:retry`,()=>{ee()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(d,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(d,{dimColor:!0,children:(0,Q.jsxs)(f,{children:[(0,Q.jsx)(w,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,Q.jsx)(d,{dimColor:!0,children:`Loading usage data…`}),(0,Q.jsx)(d,{dimColor:!0,children:(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let l=at(),te=l===`max`||l===`team`||l===null,re=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...te?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(u,{flexDirection:`column`,gap:1,width:`100%`,children:[re.some(({limit:e})=>e)||(0,Q.jsx)(d,{dimColor:!0,children:`/usage is only available for subscription plans.`}),re.map(({title:e,limit:t})=>t&&(0,Q.jsx)(bn,{title:e,limit:t,maxWidth:c},e)),e.extra_usage&&(0,Q.jsx)(Sn,{extraUsage:e.extra_usage,maxWidth:c}),Gt()&&(0,Q.jsx)(qt,{maxWidth:c}),(0,Q.jsx)(d,{dimColor:!0,children:(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Sn({extraUsage:e,maxWidth:t}){let n=at();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return we.isEnabled()?(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsx)(d,{bold:!0,children:Tn}),(0,Q.jsx)(d,{dimColor:!0,children:`Extra usage not enabled · /extra-usage to enable`})]}):null;if(e.monthly_limit===null)return(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsx)(d,{bold:!0,children:Tn}),(0,Q.jsx)(d,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=A(e.used_credits/100,2),i=A(e.monthly_limit/100,2),a=new Date,o=new Date(a.getFullYear(),a.getMonth()+1,1);return(0,Q.jsx)(bn,{title:Tn,limit:{utilization:e.utilization,resets_at:o.toISOString()},showTimeInReset:!1,extraSubtext:`${r} / ${i} spent`,maxWidth:t})}var Cn,wn,Q,Tn,En=t((()=>{Cn=n(m(),1),wn=n(m(),1),Me(),Ne(),ct(),C(),h(),yt(),Ut(),tt(),L(),ze(),ge(),Kt(),Q=v(),Tn=`Extra usage`}));function Dn({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,On.useState)(n),[a,o]=(0,On.useState)(!1),[s,c]=(0,On.useState)(!1),ee=Mt(),{rows:l}=jt(ce()),u=ee?l+1:Math.max(15,Math.min(Math.floor(l*.8),30)),[d]=(0,On.useState)(()=>Xt().catch(()=>[]));return kt(),ne(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(_,{color:`permission`,children:(0,$.jsx)(le,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||ee?void 0:u,children:[(0,$.jsx)(se,{title:`Status`,children:(0,$.jsx)(Qt,{context:t,diagnosticsPromise:d})},`status`),(0,$.jsx)(se,{title:`Config`,children:(0,$.jsx)(On.Suspense,{fallback:null,children:(0,$.jsx)(gn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:u})})},`config`),(0,$.jsx)(se,{title:`Usage`,children:(0,$.jsx)(xn,{})},`usage`)]})})}var On,$,kn=t((()=>{m(),On=n(m(),1),yt(),At(),C(),W(),h(),nn(),yn(),En(),$=v()}));export{kn as n,Dn as t};
1
+ import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{d as r,l as i,o as a}from"./envUtils-DSxRz_kt.js";import{n as o,t as s}from"./figures-5ThXQEtq.js";import{D as c,Gt as ee,H as l,I as u,P as d,T as f,U as te,Wt as ne,Xn as re,a as ie,d as ae,di as p,fi as m,k as oe,n as se,ot as ce,r as le,t as h,ui as g,x as _,y as ue}from"./src-CDCSSo0U2.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{en as y,gr as de,ht as b,qt as fe}from"./state-ix0xIunV.js";import{$T as pe,C as x,Dg as me,F as he,Hb as ge,Mb as S,Nb as _e,Ng as ve,Og as ye,Pb as be,S as xe,TS as C,Vb as w,ZT as Se,af as Ce,ah as we,as as Te,cx as T,dS as Ee,eE as De,ex as Oe,fS as ke,if as Ae,is as E,jr as D,lS as O,lx as je,mr as k,oh as Me,op as Ne,os as Pe,rp as A,tE as j,tx as Fe,uS as M,v as Ie}from"./loadAgentsDir-ZQwvbURI.js";import{n as Le,t as Re}from"./cwd-CYmmnQVS.js";import{E as ze,O as Be}from"./debug-DiuXEmUq.js";import{Ft as Ve,Ht as He,Lt as Ue,Rt as We,c as Ge,g as N,n as Ke,y as P,zt as qe}from"./settings-BhvhCpVh.js";import{a as Je,b as F,c as I,g as Ye,i as Xe,m as Ze,o as Qe}from"./config-662VDD70.js";import{o as L,s as $e}from"./log-Duzb4o6h.js";import{n as et,r as R}from"./analytics-BotDBGh0.js";import{b as tt,g as nt}from"./startupProfiler-BquH_Yqm.js";import{r as rt}from"./permissions-Cn_6f8CB.js";import{Ar as it,It as at,J as ot,K as st,Vt as ct,_ as lt,at as ut,b as dt,it as ft,kr as pt,nt as mt,q as ht,tt as z,x as gt}from"./model-BgrLt7P7.js";import{r as _t,t as vt}from"./poorMode-BqyVuBu-.js";import{u as yt}from"./referral-Cu9bEOFE.js";import{i as bt,r as xt}from"./bridgeEnabled-D4JDZd0y.js";import{a as B,c as V,d as H,i as St,l as Ct,n as wt,o as Tt,r as Et,s as Dt,t as Ot,u as U}from"./status-DHJbK4pV.js";import{n as kt,t as At}from"./useExitOnCtrlCDWithKeybindings-vzUoPY51.js";import{i as jt,n as W,r as Mt}from"./modalContext-DFjKLCB6.js";import{n as Nt,t as Pt}from"./ThemePicker-Dyq1YVhb.js";import{i as Ft,n as It,r as Lt,t as Rt}from"./extraUsage-DtWi8E78.js";import{n as G,t as zt}from"./ClaudeMdExternalIncludesDialog-BAK9fxwg.js";import{t as Bt}from"./SearchBox-vfLXEPed.js";import{n as Vt,t as Ht}from"./useSearchInput-B1UOjxAI.js";import{n as Ut,t as Wt}from"./usage-D_sqm8us.js";import{a as Gt,i as Kt,t as qt}from"./OverageCreditUpsell-DSgrZvMv.js";function Jt(){let e=b();return[{label:`Version`,value:`0.0.2`},{label:`Session name`,value:k(e)??(0,K.jsx)(d,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Re()},...wt(),...Ot()]}function Yt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:U(e)},...Et(t.clients,r.options.ideInstallationStatus,n),...Tt(t.clients,n),...V(),...Ct()]}async function Xt(){return[...await St(),...await B(),...await Dt()]}function Zt({value:e}){return Array.isArray(e)?(0,K.jsx)(u,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(d,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(d,{children:e}):e}function Qt({context:e,diagnosticsPromise:t}){let n=M(e=>e.mainLoopModel),r=M(e=>e.mcp),[i]=l(),a=en.useMemo(()=>[Jt(),Yt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=Mt()?1:void 0;return(0,K.jsxs)(u,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(u,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(u,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(u,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(d,{bold:!0,children:[e,`:`]}),(0,K.jsx)(Zt,{value:t})]},n))},t)),(0,K.jsx)(tn.Suspense,{fallback:null,children:(0,K.jsx)($t,{promise:t})})]}),(0,K.jsx)(d,{dimColor:!0,children:(0,K.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function $t({promise:e}){let t=(0,tn.use)(e);return t.length===0?null:(0,K.jsxs)(u,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(d,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(u,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(d,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(d,{wrap:`wrap`,children:e}):e]},t))]})}var en,tn,K,nn=t((()=>{o(),en=n(m(),1),tn=n(m(),1),y(),W(),h(),O(),Le(),D(),H(),ge(),K=v()}));function rn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,an.jsxs)(ue,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,an.jsxs)(d,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,an.jsx)(d,{dimColor:!0,children:`How would you like to handle this?`}),(0,an.jsx)(_e,{options:[{label:`Allow possible downgrade to stable version`,value:`downgrade`},{label:`Stay on current version (${e}) until stable catches up`,value:`stay`}],onChange:n})]})}var an,on=t((()=>{m(),h(),S(),an=v()}));function sn(e){return Object.entries(e).map(([e,t])=>({label:t?.name??un,value:e,description:t?.description??dn}))}function cn({initialStyle:e,onComplete:t,onCancel:n,isStandaloneCommand:r}){let[i,a]=(0,ln.useState)([]),[o,s]=(0,ln.useState)(!0);(0,ln.useEffect)(()=>{Te(Re()).then(e=>{let t=sn(e);a(t),s(!1)}).catch(()=>{let e=sn(E);a(e),s(!1)})},[]);let c=(0,ln.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(ue,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(u,{marginTop:1,children:(0,q.jsx)(d,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(d,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(_e,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var ln,q,un,dn,fn=t((()=>{m(),ln=n(m(),1),Pe(),h(),Le(),be(),q=v(),un=`Default`,dn=`Claude completes coding tasks efficiently and provides concise responses`}));function pn({initialLanguage:e,onComplete:t,onCancel:n}){let[r,i]=(0,mn.useState)(e),[a,o]=(0,mn.useState)((e??``).length);ne(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(d,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(d,{children:s.pointer}),(0,J.jsx)(Oe,{value:r??``,onChange:i,onSubmit:c,focus:!0,showCursor:!0,placeholder:`e.g., Japanese, 日本語, Español${s.ellipsis}`,columns:60,cursorOffset:a,onChangeCursorOffset:o})]}),(0,J.jsx)(d,{dimColor:!0,children:`Leave empty for default (English)`})]})}var mn,J,hn=t((()=>{o(),mn=n(m(),1),h(),yt(),Fe(),J=v()}));function gn({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:ae}){let{headerFocused:p,focusHeader:m}=ie(),se=Mt(),[,le]=l(),h=te(),[_,v]=(0,X.useState)(I()),y=Y.useRef(I()),[b,x]=(0,X.useState)(Ke()),ge=Y.useRef(Ke()),[S,ye]=(0,X.useState)(b?.outputStyle||`default`),be=Y.useRef(S),[C,we]=(0,X.useState)(b?.language),Te=Y.useRef(C),[T,Oe]=(0,X.useState)(0),[E,D]=(0,X.useState)(0),[O,k]=(0,X.useState)(!1),Me=re(),{rows:Ne}=ce(),Pe=ae??Math.min(Math.floor(Ne*.8),30),A=Math.max(5,Pe-10),j=M(e=>e.mainLoopModel),Fe=M(e=>e.verbose),Le=M(e=>e.thinkingEnabled),Re=M(e=>ft()?e.fastMode:!1);M(e=>e.promptSuggestionEnabled);let ze=We(b?.permissions?.defaultMode??`default`),Be=xe()||Ie()===`enabled`,Ve=(Ce(),e(Ae)).isBriefEntitled(),N=ke(),[Ye,L]=(0,X.useState)({}),et=Y.useRef(Le),[tt]=(0,X.useState)(()=>Ge(`localSettings`)),[nt]=(0,X.useState)(()=>Ge(`userSettings`)),at=Y.useRef(h),ct=Ee(),[lt]=(0,X.useState)(()=>{let e=ct.getState();return{mainLoopModel:e.mainLoopModel,mainLoopModelForSession:e.mainLoopModelForSession,verbose:e.verbose,thinkingEnabled:e.thinkingEnabled,fastMode:e.fastMode,promptSuggestionEnabled:e.promptSuggestionEnabled,isBriefOnly:e.isBriefOnly,replBridgeEnabled:e.replBridgeEnabled,replBridgeOutboundOnly:e.replBridgeOutboundOnly,settings:e.settings}}),[pt]=(0,X.useState)(()=>fe()),z=Y.useRef(!1),[yt,xt]=(0,X.useState)(!1),[B,V]=(0,X.useState)(null),{query:H,setQuery:St,cursorOffset:Ct}=Vt({isActive:O&&B===null&&!p,onExit:()=>k(!1),onExitUp:m,passthroughCtrlKeys:[`c`,`d`]}),wt=O&&!p;Y.useEffect(()=>{o?.(wt)},[wt,o]);let Tt=me(n.options.mcpClients),Et=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Dt=Y.use(pe(!0)),Ot=De(Dt),U=Je();function kt(e){R(`tengu_config_model_changed`,{from_model:j,to_model:e}),N(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),L(t=>{let n=gt(e)+(It(e,!1,dt())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function At(e){F(t=>({...t,verbose:e})),v({...I(),verbose:e}),N(t=>({...t,verbose:e})),L(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let jt=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:_.autoCompactEnabled,type:`boolean`,onChange(e){F(t=>({...t,autoCompactEnabled:e})),v({...I(),autoCompactEnabled:e}),R(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:b?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){P(`localSettings`,{spinnerTipsEnabled:e}),x(t=>({...t,spinnerTipsEnabled:e})),R(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:b?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){P(`localSettings`,{cacheWarningEnabled:e}),x(t=>({...t,cacheWarningEnabled:e})),R(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:b?.prefersReducedMotion??!1,type:`boolean`,onChange(e){P(`localSettings`,{prefersReducedMotion:e}),x(t=>({...t,prefersReducedMotion:e})),N(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),R(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Le??!0,type:`boolean`,onChange(e){N(t=>({...t,thinkingEnabled:e})),P(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),R(`tengu_thinking_toggled`,{enabled:e})}},...ft()&&mt()?[{id:`fastMode`,label:`Fast mode (${st} only)`,value:!!Re,type:`boolean`,onChange(e){ht(),P(`userSettings`,{fastMode:e?!0:void 0}),e?(N(e=>({...e,mainLoopModel:ot(),mainLoopModelForSession:null,fastMode:!0})),L(e=>({...e,model:ot(),"Fast mode":`ON`}))):(N(e=>({...e,fastMode:!1})),L(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(vt(),e(_t)).isPoorModeActive(),type:`boolean`,onChange(t){(vt(),e(_t)).setPoorMode(t),N(e=>({...e,promptSuggestionEnabled:!t}))}},...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:_.speculationEnabled??!0,type:`boolean`,onChange(e){F(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),v({...I(),speculationEnabled:e}),R(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Et?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:_.fileCheckpointingEnabled,type:`boolean`,onChange(e){F(t=>({...t,fileCheckpointingEnabled:e})),v({...I(),fileCheckpointingEnabled:e}),R(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Fe,type:`boolean`,onChange:At},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:_.terminalProgressBarEnabled,type:`boolean`,onChange(e){F(t=>({...t,terminalProgressBarEnabled:e})),v({...I(),terminalProgressBarEnabled:e}),R(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:_.showTurnDuration,type:`boolean`,onChange(e){F(t=>({...t,showTurnDuration:e})),v({...I(),showTurnDuration:e}),R(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:ze,options:(()=>{let e=[`default`,`plan`];return[...e,...rt.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=We(e),n=t===`auto`?t:Ue(t)?He(t):t,r=P(`userSettings`,{permissions:{...b?.permissions,defaultMode:n}});if(r.error){$e(r.error);return}x(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),L(t=>({...t,defaultPermissionMode:e})),R(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...Be?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:b?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){P(`userSettings`,{useAutoModeDuringPlan:e}),x(t=>({...t,useAutoModeDuringPlan:e})),N(e=>{let t=he(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),L(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:_.respectGitignore,type:`boolean`,onChange(e){F(t=>({...t,respectGitignore:e})),v({...I(),respectGitignore:e}),R(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...je()?[{id:`copyOnSelect`,label:`Copy on select`,value:_.copyOnSelect??!0,type:`boolean`,onChange(e){F(t=>({...t,copyOnSelect:e})),v({...I(),copyOnSelect:e}),R(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],U?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:b?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:h,type:`managedEnum`,onChange:le},{id:`notifChannel`,label:`Local notifications`,value:_.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){F(t=>({...t,preferredNotifChannel:e})),v({...I(),preferredNotifChannel:e})}},{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:_.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){F(t=>({...t,taskCompleteNotifEnabled:e})),v({...I(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:_.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){F(t=>({...t,inputNeededNotifEnabled:e})),v({...I(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:_.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){F(t=>({...t,agentPushNotifEnabled:e})),v({...I(),agentPushNotifEnabled:e})}},{id:`outputStyle`,label:`Output style`,value:S,type:`managedEnum`,onChange:()=>{}},...Ve?[{id:`defaultView`,label:`What you see by default`,value:b?.defaultView===void 0?`default`:String(b.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e==="default"?void 0:e;P(`localSettings`,{defaultView:t}),x(e=>({...e,defaultView:t}));let n=t===`chat`;N(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),de(n),L(t=>({...t,"Default view":e})),R(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:C??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:_.editorMode===`emacs`?`normal`:_.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){F(t=>({...t,editorMode:e})),v({...I(),editorMode:e}),R(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:_.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){F(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),v({...I(),prStatusFooterEnabled:e}),R(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:j===null?`Default (recommended)`:j,type:`managedEnum`,onChange:kt},...Tt?[{id:`diffTool`,label:`Diff tool`,value:_.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){F(t=>({...t,diffTool:e})),v({...I(),diffTool:e}),R(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],...ve()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:_.autoConnectIde??!1,type:`boolean`,onChange(e){F(t=>({...t,autoConnectIde:e})),v({...I(),autoConnectIde:e}),R(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],...ve()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:_.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){F(t=>({...t,autoInstallIdeExtension:e})),v({...I(),autoInstallIdeExtension:e}),R(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...bt()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:_.remoteControlAtStartup===void 0?`default`:String(_.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e==="default")F(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),v({...I(),remoteControlAtStartup:void 0});else{let t=e===`true`;F(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),v({...I(),remoteControlAtStartup:t})}let t=Ze();N(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Ot?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Qe().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(d,{children:[`Use custom API key: `,(0,Z.jsx)(d,{bold:!0,children:it(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&_.customApiKeyResponses?.approved?.includes(it(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){F(t=>{let n={...t};if(n.customApiKeyResponses||(n.customApiKeyResponses={approved:[],rejected:[]}),n.customApiKeyResponses.approved||(n.customApiKeyResponses={...n.customApiKeyResponses,approved:[]}),n.customApiKeyResponses.rejected||(n.customApiKeyResponses={...n.customApiKeyResponses,rejected:[]}),process.env.ANTHROPIC_API_KEY){let t=it(process.env.ANTHROPIC_API_KEY);e?n.customApiKeyResponses={...n.customApiKeyResponses,approved:[...(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),t],rejected:(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t)}:n.customApiKeyResponses={...n.customApiKeyResponses,approved:(n.customApiKeyResponses.approved??[]).filter(e=>e!==t),rejected:[...(n.customApiKeyResponses.rejected??[]).filter(e=>e!==t),t]}}return n}),v(I())}}]:[]],W=Y.useMemo(()=>{if(!H)return jt;let e=H.toLowerCase();return jt.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[jt,H]);Y.useEffect(()=>{if(T>=W.length){let e=Math.max(0,W.length-1);Oe(e),D(Math.max(0,e-A+1));return}D(e=>T<e?T:T>=e+A?T-A+1:e)},[W.length,T,A]);let Nt=(0,X.useCallback)(e=>{D(t=>e<t?e:e>=t+A?e-A+1:t)},[A]),Ft=(0,X.useCallback)(()=>{if(B!==null)return;let e=Object.entries(Ye).map(([e,t])=>(R(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${g.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&y.current.customApiKeyResponses?.approved?.includes(it(n))),a=!!(n&&_.customApiKeyResponses?.approved?.includes(it(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),R(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),_.theme!==y.current.theme&&e.push(`Set theme to ${g.bold(_.theme)}`),_.preferredNotifChannel!==y.current.preferredNotifChannel&&e.push(`Set notifications to ${g.bold(_.preferredNotifChannel)}`),S!==be.current&&e.push(`Set output style to ${g.bold(S)}`),C!==Te.current&&e.push(`Set response language to ${g.bold(C??`Default (English)`)}`),_.editorMode!==y.current.editorMode&&e.push(`Set editor mode to ${g.bold(_.editorMode||`emacs`)}`),_.diffTool!==y.current.diffTool&&e.push(`Set diff tool to ${g.bold(_.diffTool)}`),_.autoConnectIde!==y.current.autoConnectIde&&e.push(`${_.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),_.autoInstallIdeExtension!==y.current.autoInstallIdeExtension&&e.push(`${_.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),_.autoCompactEnabled!==y.current.autoCompactEnabled&&e.push(`${_.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),_.respectGitignore!==y.current.respectGitignore&&e.push(`${_.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),_.copyOnSelect!==y.current.copyOnSelect&&e.push(`${_.copyOnSelect?`Enabled`:`Disabled`} copy on select`),_.terminalProgressBarEnabled!==y.current.terminalProgressBarEnabled&&e.push(`${_.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),_.showStatusInTerminalTab!==y.current.showStatusInTerminalTab&&e.push(`${_.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),_.showTurnDuration!==y.current.showTurnDuration&&e.push(`${_.showTurnDuration?`Enabled`:`Disabled`} turn duration`),_.remoteControlAtStartup!==y.current.remoteControlAtStartup){let t=_.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${_.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}b?.autoUpdatesChannel!==ge.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${g.bold(b?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
+ `)):t(`Config dialog dismissed`,{display:`system`})},[B,Ye,_,j,S,C,b?.autoUpdatesChannel,ft()?b?.fastMode:void 0,t]),Rt=(0,X.useCallback)(()=>{h!==at.current&&le(at.current),F(()=>y.current);let e=tt;P(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=nt;P(`userSettings`,{alwaysThinkingEnabled:t?.alwaysThinkingEnabled,fastMode:t?.fastMode,promptSuggestionEnabled:t?.promptSuggestionEnabled,autoUpdatesChannel:t?.autoUpdatesChannel,minimumVersion:t?.minimumVersion,language:t?.language,useAutoModeDuringPlan:t?.useAutoModeDuringPlan,syntaxHighlightingDisabled:t?.syntaxHighlightingDisabled,permissions:t?.permissions===void 0?void 0:{...t.permissions,defaultMode:t.permissions.defaultMode}});let n=lt;N(e=>({...e,mainLoopModel:n.mainLoopModel,mainLoopModelForSession:n.mainLoopModelForSession,verbose:n.verbose,thinkingEnabled:n.thinkingEnabled,fastMode:n.fastMode,promptSuggestionEnabled:n.promptSuggestionEnabled,isBriefOnly:n.isBriefOnly,replBridgeEnabled:n.replBridgeEnabled,replBridgeOutboundOnly:n.replBridgeOutboundOnly,settings:n.settings,toolPermissionContext:he(e.toolPermissionContext)})),fe()!==pt&&de(pt)},[h,le,tt,nt,lt,pt,N]);ne(`confirm:no`,(0,X.useCallback)(()=>{B===null&&(z.current&&Rt(),t(`Config dialog dismissed`,{display:`system`}))},[B,Rt,t]),{context:`Settings`,isActive:B===null&&!O&&!p}),ne(`settings:close`,Ft,{context:`Settings`,isActive:B===null&&!O&&!p});let G=(0,X.useCallback)(()=>{let e=W[T];if(!(!e||!e.onChange)){if(e.type===`boolean`){z.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===et.current?xt(!1):n.messages.some(e=>e.type===`assistant`)&&xt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:V(`Theme`),a(!0);return;case`model`:V(`Model`),a(!0);return;case`showExternalIncludesDialog`:V(`ExternalIncludes`),a(!0);return;case`outputStyle`:V(`OutputStyle`),a(!0);return;case`language`:V(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(U){V(`EnableAutoUpdates`),a(!0);return}(b?.autoUpdatesChannel??`latest`)===`latest`?(V(`ChannelDowngrade`),a(!0)):(z.current=!0,P(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),x(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),R(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){z.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[U,W,T,b?.autoUpdatesChannel,a]),Bt=e=>{xt(!1);let t=Math.max(0,Math.min(W.length-1,T+e));Oe(t),Nt(t)};return ee({"select:previous":()=>{T===0?(xt(!1),k(!0),D(0)):Bt(-1)},"select:next":()=>Bt(1),"scroll:lineUp":()=>Bt(-1),"scroll:lineDown":()=>Bt(1),"select:accept":G,"select:previousValue":()=>G(),"select:nextValue":()=>G(),"settings:search":()=>{k(!0),St(``)}},{context:`Settings`,isActive:B===null&&!O&&!p}),(0,Z.jsx)(u,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(B===null&&!p){if(O){if(e.key===`escape`){e.preventDefault(),H.length>0?St(``):k(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),k(!1),Oe(0),D(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),G();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),k(!0),St(e.key))}},[B,p,O,H,St,G]),children:B===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Pt,{onThemeSelect:e=>{z.current=!0,le(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(u,{children:(0,Z.jsx)(d,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):B===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Lt,{initial:j,onSelect:(e,t)=>{z.current=!0,kt(e),V(null),a(!1)},onCancel:()=>{V(null),a(!1)},showFastModeNotice:ft()?Re&&ut(j)&&mt():!1}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zt,{onDone:()=>{V(null),a(!1)},externalIncludes:Se(Dt)}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):B===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{initialStyle:S,onComplete:e=>{z.current=!0,ye(e??`default`),V(null),a(!1),P(`localSettings`,{outputStyle:e}),R(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):B===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pn,{initialLanguage:C,onComplete:e=>{z.current=!0,we(e),V(null),a(!1),P(`userSettings`,{language:e}),R(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{V(null),a(!1)}}),(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):B===`EnableAutoUpdates`?(0,Z.jsx)(ue,{title:`Enable Auto-Updates`,onCancel:()=>{V(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:U?.type===`config`?(0,Z.jsx)(_e,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{z.current=!0,V(null),a(!1),F(e=>({...e,autoUpdates:!0})),v({...I(),autoUpdates:!0}),P(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),x(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),R(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{children:U?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),U?.type===`env`&&(0,Z.jsxs)(d,{dimColor:!0,children:[`Unset `,U.envVar,` to re-enable auto-updates.`]})]})}):B===`ChannelDowngrade`?(0,Z.jsx)(rn,{currentVersion:`0.0.2`,onChoice:e=>{if(V(null),a(!1),e===`cancel`)return;z.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.2`),P(`userSettings`,t),x(e=>({...e,...t})),R(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(u,{flexDirection:`column`,gap:1,marginY:se?void 0:1,children:[(0,Z.jsx)(oe,{query:H,isFocused:O&&!p,isTerminalFocused:Me,cursorOffset:Ct,placeholder:`Search settings…`}),(0,Z.jsx)(u,{flexDirection:`column`,children:W.length===0?(0,Z.jsxs)(d,{dimColor:!0,italic:!0,children:[`No settings match "`,H,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[E>0&&(0,Z.jsxs)(d,{dimColor:!0,children:[s.arrowUp,` `,E,` more above`]}),W.slice(E,E+A).map((e,t)=>{let n=E+t===T&&!p&&!O;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(u,{width:`100%`,children:[(0,Z.jsx)(u,{width:44,children:(0,Z.jsxs)(d,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(u,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:e.value.toString()}),yt&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(d,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:vn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(_n,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:qe(e.value)}):e.id===`autoUpdatesChannel`&&U?(0,Z.jsxs)(u,{flexDirection:`column`,children:[(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(d,{dimColor:!0,children:[`(`,Xe(U),`)`]})]}):(0,Z.jsx)(d,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),E+A<W.length&&(0,Z.jsxs)(d,{dimColor:!0,children:[s.arrowDown,` `,W.length-E-A,` more below`]})]})}),p?(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):O?(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(d,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(d,{dimColor:!0,children:(0,Z.jsxs)(f,{children:[(0,Z.jsx)(w,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(w,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(w,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]})})}function _n({value:e}){switch(e){case`auto`:return`Auto`;case`iterm2`:return(0,Z.jsxs)(d,{children:[`iTerm2 `,(0,Z.jsx)(d,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(d,{children:[`Terminal Bell `,(0,Z.jsx)(d,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(d,{children:[`Kitty `,(0,Z.jsx)(d,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(d,{children:[`Ghostty `,(0,Z.jsx)(d,{dimColor:!0,children:`(OSC 777)`})]});case`iterm2_with_bell`:return`iTerm2 w/ Bell`;case`notifications_disabled`:return`Disabled`;default:return e}}var Y,X,Z,vn,yn=t((()=>{h(),Y=n(m(),1),X=n(m(),1),yt(),o(),Ye(),pt(),p(),Ve(),x(),L(),et(),xt(),Nt(),O(),Ft(),lt(),Rt(),G(),on(),S(),fn(),hn(),j(),ge(),W(),Bt(),ye(),N(),y(),Pe(),a(),Ht(),C(),z(),T(),Z=v(),vn={auto:`Auto (match terminal)`,dark:`Dark mode`,light:`Light mode`,"dark-daltonized":`Dark mode (colorblind-friendly)`,"light-daltonized":`Light mode (colorblind-friendly)`,"dark-ansi":`Dark mode (ANSI colors only)`,"light-ansi":`Light mode (ANSI colors only)`}}));function bn({title:e,limit:t,maxWidth:n,showTimeInReset:r=!0,extraSubtext:i}){let{utilization:a,resets_at:o}=t;if(a===null)return null;let s=`${Math.floor(a)}% used`,c;return o&&(c=`Resets ${nt(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsx)(d,{bold:!0,children:e}),(0,Q.jsxs)(u,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ae,{ratio:a/100,width:50,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(d,{children:s})]}),c&&(0,Q.jsx)(d,{dimColor:!0,children:c})]}):(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsxs)(d,{children:[(0,Q.jsx)(d,{bold:!0,children:e}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(d,{children:` `}),(0,Q.jsxs)(d,{dimColor:!0,children:[`· `,c]})]})]}),(0,Q.jsx)(ae,{ratio:a/100,width:n,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(d,{children:s})]})}function xn(){let[e,t]=(0,wn.useState)(null),[n,r]=(0,wn.useState)(null),[i,a]=(0,wn.useState)(!0),{columns:o}=ce(),s=o-2,c=Math.min(s,80),ee=Cn.useCallback(async()=>{a(!0),r(null);try{let e=await Wt();t(e)}catch(e){$e(e);let t=e,n=t.response?.data?Be(t.response.data):void 0;r(n?`Failed to load usage data: ${n}`:`Failed to load usage data`)}finally{a(!1)}},[]);if((0,wn.useEffect)(()=>{ee()},[ee]),ne(`settings:retry`,()=>{ee()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(d,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(d,{dimColor:!0,children:(0,Q.jsxs)(f,{children:[(0,Q.jsx)(w,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(u,{flexDirection:`column`,gap:1,children:[(0,Q.jsx)(d,{dimColor:!0,children:`Loading usage data…`}),(0,Q.jsx)(d,{dimColor:!0,children:(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let l=at(),te=l===`max`||l===`team`||l===null,re=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...te?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(u,{flexDirection:`column`,gap:1,width:`100%`,children:[re.some(({limit:e})=>e)||(0,Q.jsx)(d,{dimColor:!0,children:`/usage is only available for subscription plans.`}),re.map(({title:e,limit:t})=>t&&(0,Q.jsx)(bn,{title:e,limit:t,maxWidth:c},e)),e.extra_usage&&(0,Q.jsx)(Sn,{extraUsage:e.extra_usage,maxWidth:c}),Gt()&&(0,Q.jsx)(qt,{maxWidth:c}),(0,Q.jsx)(d,{dimColor:!0,children:(0,Q.jsx)(w,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Sn({extraUsage:e,maxWidth:t}){let n=at();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return we.isEnabled()?(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsx)(d,{bold:!0,children:Tn}),(0,Q.jsx)(d,{dimColor:!0,children:`Extra usage not enabled · /extra-usage to enable`})]}):null;if(e.monthly_limit===null)return(0,Q.jsxs)(u,{flexDirection:`column`,children:[(0,Q.jsx)(d,{bold:!0,children:Tn}),(0,Q.jsx)(d,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=A(e.used_credits/100,2),i=A(e.monthly_limit/100,2),a=new Date,o=new Date(a.getFullYear(),a.getMonth()+1,1);return(0,Q.jsx)(bn,{title:Tn,limit:{utilization:e.utilization,resets_at:o.toISOString()},showTimeInReset:!1,extraSubtext:`${r} / ${i} spent`,maxWidth:t})}var Cn,wn,Q,Tn,En=t((()=>{Cn=n(m(),1),wn=n(m(),1),Me(),Ne(),ct(),C(),h(),yt(),Ut(),tt(),L(),ze(),ge(),Kt(),Q=v(),Tn=`Extra usage`}));function Dn({onClose:e,context:t,defaultTab:n}){let[r,i]=(0,On.useState)(n),[a,o]=(0,On.useState)(!1),[s,c]=(0,On.useState)(!1),ee=Mt(),{rows:l}=jt(ce()),u=ee?l+1:Math.max(15,Math.min(Math.floor(l*.8),30)),[d]=(0,On.useState)(()=>Xt().catch(()=>[]));return kt(),ne(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(_,{color:`permission`,children:(0,$.jsx)(le,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||ee?void 0:u,children:[(0,$.jsx)(se,{title:`Status`,children:(0,$.jsx)(Qt,{context:t,diagnosticsPromise:d})},`status`),(0,$.jsx)(se,{title:`Config`,children:(0,$.jsx)(On.Suspense,{fallback:null,children:(0,$.jsx)(gn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:u})})},`config`),(0,$.jsx)(se,{title:`Usage`,children:(0,$.jsx)(xn,{})},`usage`)]})})}var On,$,kn=t((()=>{m(),On=n(m(),1),yt(),At(),C(),W(),h(),nn(),yn(),En(),$=v()}));export{kn as n,Dn as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{I as r,P as i,fi as a,mt as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Kv as l,Yv as u,Zv as d,cS as f,lS as p,qv as m}from"./loadAgentsDir-nzr38hai.js";t();var h=e(a(),1);s(),p(),m();var g=c(),_=[`◐`,`◓`,`◑`,`◒`],v=[{key:`validating`,label:`Validating session`},{key:`fetching_logs`,label:`Fetching session logs`},{key:`fetching_branch`,label:`Getting branch info`},{key:`checking_out`,label:`Checking out branch`}];function y({currentStep:e,sessionId:t}){let[a,s]=o(100),c=Math.floor(s/100)%_.length,l=v.findIndex(t=>t.key===e);return(0,g.jsxs)(r,{ref:a,flexDirection:`column`,paddingX:1,paddingY:1,children:[(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsxs)(i,{bold:!0,color:`claude`,children:[_[c],` Teleporting session…`]})}),t&&(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsx)(i,{dimColor:!0,children:t})}),(0,g.jsx)(r,{flexDirection:`column`,marginLeft:2,children:v.map((e,t)=>{let a=t<l,o=t===l,s=t>l,u,d;return a?(u=n.tick,d=`green`):o?(u=_[c],d=`claude`):(u=n.circle,d=void 0),(0,g.jsxs)(r,{flexDirection:`row`,children:[(0,g.jsx)(r,{width:2,children:(0,g.jsx)(i,{color:d,dimColor:s,children:u})}),(0,g.jsx)(i,{dimColor:s,bold:o,children:e.label})]},e.key)})})]})}async function b(e,t){let n=()=>{};function r(){let[e,r]=(0,h.useState)(`validating`);return n=r,(0,g.jsx)(y,{currentStep:e,sessionId:t})}e.render((0,g.jsx)(f,{children:(0,g.jsx)(r,{})}));let i=await d(t,n);n(`checking_out`);let{branchName:a,branchError:o}=await l(i.branch);return{messages:u(i.log,o),branchName:a}}export{b as teleportWithProgress};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{I as r,P as i,fi as a,mt as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Kv as l,Yv as u,Zv as d,cS as f,lS as p,qv as m}from"./loadAgentsDir-ZQwvbURI.js";t();var h=e(a(),1);s(),p(),m();var g=c(),_=[`◐`,`◓`,`◑`,`◒`],v=[{key:`validating`,label:`Validating session`},{key:`fetching_logs`,label:`Fetching session logs`},{key:`fetching_branch`,label:`Getting branch info`},{key:`checking_out`,label:`Checking out branch`}];function y({currentStep:e,sessionId:t}){let[a,s]=o(100),c=Math.floor(s/100)%_.length,l=v.findIndex(t=>t.key===e);return(0,g.jsxs)(r,{ref:a,flexDirection:`column`,paddingX:1,paddingY:1,children:[(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsxs)(i,{bold:!0,color:`claude`,children:[_[c],` Teleporting session…`]})}),t&&(0,g.jsx)(r,{marginBottom:1,children:(0,g.jsx)(i,{dimColor:!0,children:t})}),(0,g.jsx)(r,{flexDirection:`column`,marginLeft:2,children:v.map((e,t)=>{let a=t<l,o=t===l,s=t>l,u,d;return a?(u=n.tick,d=`green`):o?(u=_[c],d=`claude`):(u=n.circle,d=void 0),(0,g.jsxs)(r,{flexDirection:`row`,children:[(0,g.jsx)(r,{width:2,children:(0,g.jsx)(i,{color:d,dimColor:s,children:u})}),(0,g.jsx)(i,{dimColor:s,bold:o,children:e.label})]},e.key)})})]})}async function b(e,t){let n=()=>{};function r(){let[e,r]=(0,h.useState)(`validating`);return n=r,(0,g.jsx)(y,{currentStep:e,sessionId:t})}e.render((0,g.jsx)(f,{children:(0,g.jsx)(r,{})}));let i=await d(t,n);n(`checking_out`);let{branchName:a,branchError:o}=await l(i.branch);return{messages:u(i.log,o),branchName:a}}export{b as teleportWithProgress};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i,y as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{$y as s,Mb as c,Nb as l,tb as u}from"./loadAgentsDir-nzr38hai.js";import{f as d,l as f}from"./file-D1cN3LMK.js";import{a as p,r as m}from"./githubRepoPathMapping-BlR0BphY.js";var h=e(r(),1);i(),d(),c(),u();var g=o();function _({targetRepo:e,initialPaths:r,onSelectPath:i,onCancel:o}){let[c,u]=(0,h.useState)(r),[d,_]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),b=(0,h.useCallback)(async t=>{if(t===`cancel`){o();return}if(y(!0),_(null),await p(t,e)){i(t);return}m(e,t);let n=c.filter(e=>e!==t);u(n),y(!1),_(`${f(t)} no longer contains the correct repository. Select another path.`)},[e,c,i,o]),x=[...c.map(e=>({label:(0,g.jsxs)(n,{children:[`Use `,(0,g.jsx)(n,{bold:!0,children:f(e)})]}),value:e})),{label:`Cancel`,value:`cancel`}];return(0,g.jsx)(a,{title:`Teleport to Repo`,onCancel:o,color:`background`,children:c.length>0?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(t,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{children:[`Open Claude Code in `,(0,g.jsx)(n,{bold:!0,children:e}),`:`]})]}),v?(0,g.jsxs)(t,{children:[(0,g.jsx)(s,{}),(0,g.jsx)(n,{children:` Validating repository…`})]}):(0,g.jsx)(l,{options:x,onChange:e=>void b(e)})]}):(0,g.jsxs)(t,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{dimColor:!0,children:[`Run claude --teleport from a checkout of `,e]})]})})}export{_ as TeleportRepoMismatchDialog};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i,y as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{$y as s,Mb as c,Nb as l,tb as u}from"./loadAgentsDir-ZQwvbURI.js";import{f as d,l as f}from"./file-BZriE-XU.js";import{a as p,r as m}from"./githubRepoPathMapping-Tt-LdYFZ.js";var h=e(r(),1);i(),d(),c(),u();var g=o();function _({targetRepo:e,initialPaths:r,onSelectPath:i,onCancel:o}){let[c,u]=(0,h.useState)(r),[d,_]=(0,h.useState)(null),[v,y]=(0,h.useState)(!1),b=(0,h.useCallback)(async t=>{if(t===`cancel`){o();return}if(y(!0),_(null),await p(t,e)){i(t);return}m(e,t);let n=c.filter(e=>e!==t);u(n),y(!1),_(`${f(t)} no longer contains the correct repository. Select another path.`)},[e,c,i,o]),x=[...c.map(e=>({label:(0,g.jsxs)(n,{children:[`Use `,(0,g.jsx)(n,{bold:!0,children:f(e)})]}),value:e})),{label:`Cancel`,value:`cancel`}];return(0,g.jsx)(a,{title:`Teleport to Repo`,onCancel:o,color:`background`,children:c.length>0?(0,g.jsxs)(g.Fragment,{children:[(0,g.jsxs)(t,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{children:[`Open Claude Code in `,(0,g.jsx)(n,{bold:!0,children:e}),`:`]})]}),v?(0,g.jsxs)(t,{children:[(0,g.jsx)(s,{}),(0,g.jsx)(n,{children:` Validating repository…`})]}):(0,g.jsx)(l,{options:x,onChange:e=>void b(e)})]}):(0,g.jsxs)(t,{flexDirection:`column`,gap:1,children:[d&&(0,g.jsx)(n,{color:`error`,children:d}),(0,g.jsxs)(n,{dimColor:!0,children:[`Run claude --teleport from a checkout of `,e]})]})})}export{_ as TeleportRepoMismatchDialog};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,P as r,T as i,Wt as a,fi as o,hn as s,ot as c,t as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{en as d,pr as f}from"./state-4KQ3kaqz.js";import{$y as p,Hb as m,Mb as h,Nb as g,TS as _,Ub as v,Vb as y,Wb as b,Xy as x,Zv as S,Zy as C,qv as w,tb as T}from"./loadAgentsDir-nzr38hai.js";import{L as E,U as D,l as O,p as k,z as A}from"./debug-IKW-jE7K.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{b as N,m as P}from"./startupProfiler-DxRQteII.js";import{i as F,n as I}from"./detectRepository-ReZ0Fz8Z.js";import{n as L,o as R}from"./api-TgV7fl9V.js";import{u as z}from"./referral-DP_GshTS.js";var B=e(o(),1);d(),j(),D(),w();function V(e){let[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);return{resumeSession:(0,B.useCallback)(async t=>{n(!0),i(null),o(t),M(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await S(t.id);return f({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof E?e.message:A(e),formattedMessage:e instanceof E?e.formattedMessage:void 0,isOperationError:e instanceof E};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}_(),R(),l(),z(),v(),O(),F(),N(),m(),h(),T(),C();var H=u(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:o,isEmbedded:l=!1}){let{rows:u}=c(),[d,f]=(0,B.useState)([]),[m,h]=(0,B.useState)(null),[_,v]=(0,B.useState)(!0),[S,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,A]=(0,B.useState)(1),j=b(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{v(!0),C(null);let e=await I();h(e),k(`Current repository: ${e||`not detected`}`);let t=await L(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),k(`Filtered ${n.length} sessions for repo ${e} from ${t.length} total`));let r=[...n].sort((e,t)=>{let n=new Date(e.updated_at);return new Date(t.updated_at).getTime()-n.getTime()});f(r)}catch(e){let t=e instanceof Error?e.message:String(e);k(`Error loading code sessions: ${t}`),C(K(t))}finally{v(!1),T(!1)}},[]),N=()=>{T(!0),M()};a(`confirm:no`,o,{context:`Confirmation`}),s((e,t)=>{if(t.ctrl&&e===`c`){o();return}if(t.ctrl&&e===`r`&&S){N();return}if(S!==null&&t.return){o();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!E)return(0,H.jsx)(x,{onComplete:F});if(_)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(p,{}),(0,H.jsx)(r,{bold:!0,children:`Loading Claude Code sessions…`})]}),(0,H.jsx)(r,{dimColor:!0,children:w?`Retrying…`:`Fetching your Claude Code sessions…`})]});if(S)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(r,{bold:!0,color:`error`,children:`Error loading Claude Code sessions`}),q(S),(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:`Ctrl+R`}),` to retry · Press `,(0,H.jsx)(r,{bold:!0,children:j}),` to cancel`]})]});if(d.length===0)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(r,{bold:!0,children:[`No Claude Code sessions found`,m&&(0,H.jsxs)(r,{children:[` for `,m]})]}),(0,H.jsx)(n,{marginTop:1,children:(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:j}),` to cancel`]})})]});let R=d.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...R.map(e=>e.timeString.length)),V=R.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,l?Math.min(d.length,5,u-6-7):Math.min(d.length,u-1-7));return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,height:G+7,children:[(0,H.jsxs)(r,{bold:!0,children:[`Select a session to resume`,d.length>G&&(0,H.jsxs)(r,{dimColor:!0,children:[` `,`(`,O,` of `,d.length,`)`]}),m&&(0,H.jsxs)(r,{dimColor:!0,children:[` (`,m,`)`]}),`:`]}),(0,H.jsxs)(n,{flexDirection:`column`,marginTop:1,flexGrow:1,children:[(0,H.jsx)(n,{marginLeft:2,children:(0,H.jsxs)(r,{bold:!0,children:[U.padEnd(z,` `),W,`Session Title`]})}),(0,H.jsx)(g,{visibleOptionCount:G,options:V,onChange:t=>{let n=d.find(e=>e.id===t);n&&e(n)},onFocus:e=>{let t=V.findIndex(t=>t.value===e);t>=0&&A(t+1)}})]}),(0,H.jsx)(n,{flexDirection:`row`,children:(0,H.jsx)(r,{dimColor:!0,children:(0,H.jsxs)(i,{children:[(0,H.jsx)(t,{shortcut:`↑/↓`,action:`select`}),(0,H.jsx)(t,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(y,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}function K(e){let t=e.toLowerCase();return t.includes(`fetch`)||t.includes(`network`)||t.includes(`timeout`)?`network`:t.includes(`auth`)||t.includes(`token`)||t.includes(`permission`)||t.includes(`oauth`)||t.includes(`not authenticated`)||t.includes(`/login`)||t.includes(`console account`)||t.includes(`403`)?`auth`:t.includes(`api`)||t.includes(`rate limit`)||t.includes(`500`)||t.includes(`529`)?`api`:`other`}function q(e){switch(e){case`network`:return(0,H.jsx)(n,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(r,{dimColor:!0,children:`Check your internet connection`})});case`auth`:return(0,H.jsxs)(n,{marginY:1,flexDirection:`column`,children:[(0,H.jsx)(r,{dimColor:!0,children:`Teleport requires a Claude account`}),(0,H.jsxs)(r,{dimColor:!0,children:[`Run `,(0,H.jsx)(r,{bold:!0,children:`/login`}),` and select "Claude account with subscription"`]})]});case`api`:return(0,H.jsx)(n,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(r,{dimColor:!0,children:`Sorry, Claude encountered an error`})});case`other`:return(0,H.jsx)(n,{marginY:1,flexDirection:`row`,children:(0,H.jsx)(r,{dimColor:!0,children:`Sorry, Claude Code encountered an error`})})}}j(),l(),z(),T();function J({onComplete:e,onCancel:t,onError:i,isEmbedded:o=!1,source:s}){let{resumeSession:c,isResuming:l,error:u,selectedSession:d}=V(s);(0,B.useEffect)(()=>{M(`tengu_teleport_started`,{source:s})},[s]);let f=async t=>{let n=await c(t);n?e(n):u&&i&&i(u.message,u.formattedMessage)},m=()=>{M(`tengu_teleport_cancelled`,{}),t()};return a(`app:interrupt`,m,{context:`Global`,isActive:!!u&&!i}),l&&d?(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(p,{}),(0,H.jsx)(r,{bold:!0,children:`Resuming session…`})]}),(0,H.jsxs)(r,{dimColor:!0,children:[`Loading "`,d.title,`"…`]})]}):u&&!i?(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(r,{bold:!0,color:`error`,children:`Failed to resume session`}),(0,H.jsx)(r,{dimColor:!0,children:u.message}),(0,H.jsx)(n,{marginTop:1,children:(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:`Esc`}),` to cancel`]})})]}):(0,H.jsx)(G,{onSelect:f,onCancel:m,isEmbedded:o})}export{J as TeleportResumeWrapper};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,I as n,P as r,T as i,Wt as a,fi as o,hn as s,ot as c,t as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{en as d,pr as f}from"./state-ix0xIunV.js";import{$y as p,Hb as m,Mb as h,Nb as g,TS as _,Ub as v,Vb as y,Wb as b,Xy as x,Zv as S,Zy as C,qv as w,tb as T}from"./loadAgentsDir-ZQwvbURI.js";import{L as E,U as D,l as O,p as k,z as A}from"./debug-DiuXEmUq.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{b as N,m as P}from"./startupProfiler-BquH_Yqm.js";import{i as F,n as I}from"./detectRepository-B1PMTLAU.js";import{n as L,o as R}from"./api-CLLIHLpn.js";import{u as z}from"./referral-Cu9bEOFE.js";var B=e(o(),1);d(),j(),D(),w();function V(e){let[t,n]=(0,B.useState)(!1),[r,i]=(0,B.useState)(null),[a,o]=(0,B.useState)(null);return{resumeSession:(0,B.useCallback)(async t=>{n(!0),i(null),o(t),M(`tengu_teleport_resume_session`,{source:e,session_id:t.id});try{let e=await S(t.id);return f({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof E?e.message:A(e),formattedMessage:e instanceof E?e.formattedMessage:void 0,isOperationError:e instanceof E};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}_(),R(),l(),z(),v(),O(),F(),N(),m(),h(),T(),C();var H=u(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:o,isEmbedded:l=!1}){let{rows:u}=c(),[d,f]=(0,B.useState)([]),[m,h]=(0,B.useState)(null),[_,v]=(0,B.useState)(!0),[S,C]=(0,B.useState)(null),[w,T]=(0,B.useState)(!1),[E,D]=(0,B.useState)(!1),[O,A]=(0,B.useState)(1),j=b(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{v(!0),C(null);let e=await I();h(e),k(`Current repository: ${e||`not detected`}`);let t=await L(),n=t;e&&(n=t.filter(t=>t.repo?`${t.repo.owner.login}/${t.repo.name}`===e:!1),k(`Filtered ${n.length} sessions for repo ${e} from ${t.length} total`));let r=[...n].sort((e,t)=>{let n=new Date(e.updated_at);return new Date(t.updated_at).getTime()-n.getTime()});f(r)}catch(e){let t=e instanceof Error?e.message:String(e);k(`Error loading code sessions: ${t}`),C(K(t))}finally{v(!1),T(!1)}},[]),N=()=>{T(!0),M()};a(`confirm:no`,o,{context:`Confirmation`}),s((e,t)=>{if(t.ctrl&&e===`c`){o();return}if(t.ctrl&&e===`r`&&S){N();return}if(S!==null&&t.return){o();return}});let F=(0,B.useCallback)(()=>{D(!0),M()},[D,M]);if(!E)return(0,H.jsx)(x,{onComplete:F});if(_)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(p,{}),(0,H.jsx)(r,{bold:!0,children:`Loading Claude Code sessions…`})]}),(0,H.jsx)(r,{dimColor:!0,children:w?`Retrying…`:`Fetching your Claude Code sessions…`})]});if(S)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(r,{bold:!0,color:`error`,children:`Error loading Claude Code sessions`}),q(S),(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:`Ctrl+R`}),` to retry · Press `,(0,H.jsx)(r,{bold:!0,children:j}),` to cancel`]})]});if(d.length===0)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(r,{bold:!0,children:[`No Claude Code sessions found`,m&&(0,H.jsxs)(r,{children:[` for `,m]})]}),(0,H.jsx)(n,{marginTop:1,children:(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:j}),` to cancel`]})})]});let R=d.map(e=>({...e,timeString:P(new Date(e.updated_at))})),z=Math.max(7,...R.map(e=>e.timeString.length)),V=R.map(({timeString:e,title:t,id:n})=>({label:`${e.padEnd(z,` `)} ${t}`,value:n})),G=Math.max(1,l?Math.min(d.length,5,u-6-7):Math.min(d.length,u-1-7));return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,height:G+7,children:[(0,H.jsxs)(r,{bold:!0,children:[`Select a session to resume`,d.length>G&&(0,H.jsxs)(r,{dimColor:!0,children:[` `,`(`,O,` of `,d.length,`)`]}),m&&(0,H.jsxs)(r,{dimColor:!0,children:[` (`,m,`)`]}),`:`]}),(0,H.jsxs)(n,{flexDirection:`column`,marginTop:1,flexGrow:1,children:[(0,H.jsx)(n,{marginLeft:2,children:(0,H.jsxs)(r,{bold:!0,children:[U.padEnd(z,` `),W,`Session Title`]})}),(0,H.jsx)(g,{visibleOptionCount:G,options:V,onChange:t=>{let n=d.find(e=>e.id===t);n&&e(n)},onFocus:e=>{let t=V.findIndex(t=>t.value===e);t>=0&&A(t+1)}})]}),(0,H.jsx)(n,{flexDirection:`row`,children:(0,H.jsx)(r,{dimColor:!0,children:(0,H.jsxs)(i,{children:[(0,H.jsx)(t,{shortcut:`↑/↓`,action:`select`}),(0,H.jsx)(t,{shortcut:`Enter`,action:`confirm`}),(0,H.jsx)(y,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]})}function K(e){let t=e.toLowerCase();return t.includes(`fetch`)||t.includes(`network`)||t.includes(`timeout`)?`network`:t.includes(`auth`)||t.includes(`token`)||t.includes(`permission`)||t.includes(`oauth`)||t.includes(`not authenticated`)||t.includes(`/login`)||t.includes(`console account`)||t.includes(`403`)?`auth`:t.includes(`api`)||t.includes(`rate limit`)||t.includes(`500`)||t.includes(`529`)?`api`:`other`}function q(e){switch(e){case`network`:return(0,H.jsx)(n,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(r,{dimColor:!0,children:`Check your internet connection`})});case`auth`:return(0,H.jsxs)(n,{marginY:1,flexDirection:`column`,children:[(0,H.jsx)(r,{dimColor:!0,children:`Teleport requires a Claude account`}),(0,H.jsxs)(r,{dimColor:!0,children:[`Run `,(0,H.jsx)(r,{bold:!0,children:`/login`}),` and select "Claude account with subscription"`]})]});case`api`:return(0,H.jsx)(n,{marginY:1,flexDirection:`column`,children:(0,H.jsx)(r,{dimColor:!0,children:`Sorry, Claude encountered an error`})});case`other`:return(0,H.jsx)(n,{marginY:1,flexDirection:`row`,children:(0,H.jsx)(r,{dimColor:!0,children:`Sorry, Claude Code encountered an error`})})}}j(),l(),z(),T();function J({onComplete:e,onCancel:t,onError:i,isEmbedded:o=!1,source:s}){let{resumeSession:c,isResuming:l,error:u,selectedSession:d}=V(s);(0,B.useEffect)(()=>{M(`tengu_teleport_started`,{source:s})},[s]);let f=async t=>{let n=await c(t);n?e(n):u&&i&&i(u.message,u.formattedMessage)},m=()=>{M(`tengu_teleport_cancelled`,{}),t()};return a(`app:interrupt`,m,{context:`Global`,isActive:!!u&&!i}),l&&d?(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(p,{}),(0,H.jsx)(r,{bold:!0,children:`Resuming session…`})]}),(0,H.jsxs)(r,{dimColor:!0,children:[`Loading "`,d.title,`"…`]})]}):u&&!i?(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsx)(r,{bold:!0,color:`error`,children:`Failed to resume session`}),(0,H.jsx)(r,{dimColor:!0,children:u.message}),(0,H.jsx)(n,{marginTop:1,children:(0,H.jsxs)(r,{dimColor:!0,children:[`Press `,(0,H.jsx)(r,{bold:!0,children:`Esc`}),` to cancel`]})})]}):(0,H.jsx)(G,{onSelect:f,onCancel:m,isEmbedded:o})}export{J as TeleportResumeWrapper};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,H as n,I as r,P as i,T as a,U as o,V as s,Wt as c,Xt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{ES as m,Gb as h,Gf as g,Kf as _,Mb as v,Nb as y,OS as b,TS as x,Ub as S,Wb as C,Xf as w,Yf as T,Zf as E,fS as D,lS as O,uS as k}from"./loadAgentsDir-nzr38hai.js";import{g as A,y as j}from"./settings-5PQdphqC.js";import{u as M}from"./referral-DP_GshTS.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";function F({onThemeSelect:e,showIntroText:u=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:h=!1,skipExitHandling:_=!1,onCancel:v}){let[b]=n(),x=o(),{columns:S}=d(),E=T(),O=E===null?w(b):null,{setPreviewTheme:A,savePreview:M,cancelPreview:P}=s(),F=k(e=>e.settings.syntaxHighlightingDisabled)??!1,L=D();l(`ThemePicker`);let R=C(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(E===null){let e=!F;j(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(_?()=>{}:void 0),B=[{label:`Dark mode`,value:`dark`},{label:`Light mode`,value:`light`},{label:`Dark mode (colorblind-friendly)`,value:`dark-daltonized`},{label:`Light mode (colorblind-friendly)`,value:`light-daltonized`},{label:`Dark mode (ANSI colors only)`,value:`dark-ansi`},{label:`Light mode (ANSI colors only)`,value:`light-ansi`}],V=(0,I.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,I.jsxs)(r,{flexDirection:`column`,gap:1,children:[u?(0,I.jsx)(i,{children:`Let's get started.`}):(0,I.jsx)(i,{bold:!0,color:`permission`,children:`Theme`}),(0,I.jsxs)(r,{flexDirection:`column`,children:[(0,I.jsx)(i,{bold:!0,children:`Choose the text style that looks best with your terminal`}),f&&!p&&(0,I.jsx)(i,{dimColor:!0,children:f})]}),(0,I.jsx)(y,{options:B,onFocus:e=>{A(e)},onChange:t=>{M(),e(t)},onCancel:_?()=>{P(),v?.()}:async()=>{P(),await m(0)},visibleOptionCount:B.length,defaultValue:x,defaultFocusValue:x})]}),(0,I.jsxs)(r,{flexDirection:`column`,width:`100%`,children:[(0,I.jsx)(r,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,I.jsx)(g,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`- console.log("Hello, World!");`,`+ console.log("Hello, Claude!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:S})}),(0,I.jsxs)(i,{dimColor:!0,children:[` `,E===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:F?`Syntax highlighting disabled (${R} to enable)`:O?`Syntax theme: ${O.theme}${O.source?` (from ${O.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return u?V:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(r,{flexDirection:`column`,children:V}),(0,I.jsxs)(r,{marginTop:1,children:[p&&f&&(0,I.jsx)(r,{marginLeft:3,children:(0,I.jsx)(i,{dimColor:!0,children:f})}),!h&&(0,I.jsx)(r,{children:(0,I.jsx)(i,{dimColor:!0,italic:!0,children:z.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,I.jsxs)(a,{children:[(0,I.jsx)(t,{shortcut:`Enter`,action:`select`}),(0,I.jsx)(t,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var I,L=e((()=>{u(),P(),x(),f(),h(),M(),S(),O(),b(),A(),v(),E(),_(),I=p()}));export{L as n,F as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{D as t,H as n,I as r,P as i,T as a,U as o,V as s,Wt as c,Xt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{ES as m,Gb as h,Gf as g,Kf as _,Mb as v,Nb as y,OS as b,TS as x,Ub as S,Wb as C,Xf as w,Yf as T,Zf as E,fS as D,lS as O,uS as k}from"./loadAgentsDir-ZQwvbURI.js";import{g as A,y as j}from"./settings-BhvhCpVh.js";import{u as M}from"./referral-Cu9bEOFE.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-vzUoPY51.js";function F({onThemeSelect:e,showIntroText:u=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:h=!1,skipExitHandling:_=!1,onCancel:v}){let[b]=n(),x=o(),{columns:S}=d(),E=T(),O=E===null?w(b):null,{setPreviewTheme:A,savePreview:M,cancelPreview:P}=s(),F=k(e=>e.settings.syntaxHighlightingDisabled)??!1,L=D();l(`ThemePicker`);let R=C(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(E===null){let e=!F;j(`userSettings`,{syntaxHighlightingDisabled:e}),L(t=>({...t,settings:{...t.settings,syntaxHighlightingDisabled:e}}))}},{context:`ThemePicker`});let z=N(_?()=>{}:void 0),B=[{label:`Dark mode`,value:`dark`},{label:`Light mode`,value:`light`},{label:`Dark mode (colorblind-friendly)`,value:`dark-daltonized`},{label:`Light mode (colorblind-friendly)`,value:`light-daltonized`},{label:`Dark mode (ANSI colors only)`,value:`dark-ansi`},{label:`Light mode (ANSI colors only)`,value:`light-ansi`}],V=(0,I.jsxs)(r,{flexDirection:`column`,gap:1,children:[(0,I.jsxs)(r,{flexDirection:`column`,gap:1,children:[u?(0,I.jsx)(i,{children:`Let's get started.`}):(0,I.jsx)(i,{bold:!0,color:`permission`,children:`Theme`}),(0,I.jsxs)(r,{flexDirection:`column`,children:[(0,I.jsx)(i,{bold:!0,children:`Choose the text style that looks best with your terminal`}),f&&!p&&(0,I.jsx)(i,{dimColor:!0,children:f})]}),(0,I.jsx)(y,{options:B,onFocus:e=>{A(e)},onChange:t=>{M(),e(t)},onCancel:_?()=>{P(),v?.()}:async()=>{P(),await m(0)},visibleOptionCount:B.length,defaultValue:x,defaultFocusValue:x})]}),(0,I.jsxs)(r,{flexDirection:`column`,width:`100%`,children:[(0,I.jsx)(r,{flexDirection:`column`,borderTop:!0,borderBottom:!0,borderLeft:!1,borderRight:!1,borderStyle:`dashed`,borderColor:`subtle`,children:(0,I.jsx)(g,{patch:{oldStart:1,newStart:1,oldLines:3,newLines:3,lines:[` function greet() {`,`- console.log("Hello, World!");`,`+ console.log("Hello, Claude!");`,` }`]},dim:!1,filePath:`demo.js`,firstLine:null,width:S})}),(0,I.jsxs)(i,{dimColor:!0,children:[` `,E===`env`?`Syntax highlighting disabled (via CLAUDE_CODE_SYNTAX_HIGHLIGHT=${process.env.CLAUDE_CODE_SYNTAX_HIGHLIGHT})`:F?`Syntax highlighting disabled (${R} to enable)`:O?`Syntax theme: ${O.theme}${O.source?` (from ${O.source})`:``} (${R} to disable)`:`Syntax highlighting enabled (${R} to disable)`]})]})]});return u?V:(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(r,{flexDirection:`column`,children:V}),(0,I.jsxs)(r,{marginTop:1,children:[p&&f&&(0,I.jsx)(r,{marginLeft:3,children:(0,I.jsx)(i,{dimColor:!0,children:f})}),!h&&(0,I.jsx)(r,{children:(0,I.jsx)(i,{dimColor:!0,italic:!0,children:z.pending?(0,I.jsxs)(I.Fragment,{children:[`Press `,z.keyName,` again to exit`]}):(0,I.jsxs)(a,{children:[(0,I.jsx)(t,{shortcut:`Enter`,action:`select`}),(0,I.jsx)(t,{shortcut:`Esc`,action:`cancel`})]})})})]})]})}var I,L=e((()=>{u(),P(),x(),f(),h(),M(),S(),O(),b(),A(),v(),E(),_(),I=p()}));export{L as n,F as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,Lt as n,P as r,Wt as i,fi as a,t as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{en as c,ur as l}from"./state-4KQ3kaqz.js";import{DS as u,GC as d,G_ as f,Mb as p,Nb as m,OS as h,U_ as g,WC as _,ba as v,xa as y}from"./loadAgentsDir-nzr38hai.js";import{n as b,t as x}from"./cwd-BuJhkTrc.js";import{_ as S,h as C}from"./debug-IKW-jE7K.js";import{c as w,g as T}from"./settings-5PQdphqC.js";import{g as E,n as D,y as O}from"./config-C7YHKCPV.js";import{n as k,r as A}from"./analytics-BotDBGh0.js";import{vn as j}from"./prompt-Bef63FhB.js";import{u as M}from"./referral-DP_GshTS.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";import{n as F,t as I}from"./PermissionDialog-0ya1CU5k.js";import{homedir as L}from"os";var R=e(a(),1),z=s();o(),c(),b(),S(),k(),E(),h(),M(),p(),f(),P(),F(),T(),j(),y(),d();function B(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function V(){let e=[];return B(w(`projectSettings`))&&e.push(`.claude/settings.json`),B(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function H(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function U(){let e=[];return H(_(`projectSettings`))&&e.push(`.claude/settings.json`),H(_(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function W(e){return!!e?.otelHeadersHelper}function G(){let e=[];return W(w(`projectSettings`))&&e.push(`.claude/settings.json`),W(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function K(e){return!!e?.apiKeyHelper}function q(){let e=[];return K(w(`projectSettings`))&&e.push(`.claude/settings.json`),K(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function J(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function Y(){let e=[];return J(w(`projectSettings`))&&e.push(`.claude/settings.json`),J(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function X(e){return!!e?.gcpAuthRefresh}function Z(){let e=[];return X(w(`projectSettings`))&&e.push(`.claude/settings.json`),X(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Q(e){return e?.env?Object.keys(e.env).some(e=>!v.has(e.toUpperCase())):!1}function $(){let e=[];return Q(w(`projectSettings`))&&e.push(`.claude/settings.json`),Q(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}j();function ee({onDone:e,commands:a}){let{servers:o}=g(`project`),s=Object.keys(o).length>0,c=V().length>0,d=U(),f=q().length>0,p=Y().length>0,h=Z().length>0,_=G().length>0,v=$().length>0,y=a?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,b=a?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,S=d.length>0||y||b,w=D(),[T,E]=R.useState(null);R.useEffect(()=>{if(T!==null){let e=T,t=setTimeout(()=>u(e));return()=>clearTimeout(t)}},[T]),R.useEffect(()=>{A(`tengu_trust_dialog_shown`,{isHomeDir:L()===x(),hasMcpServers:s,hasHooks:c,hasBashExecution:S,hasApiKeyHelper:f,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:_,hasDangerousEnvVars:v})},[s,c,S,f,p,h,_,v]);function k(t){if(t===`exit`){E(1);return}let n=L()===x();A(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:s,hasHooks:c,hasBashExecution:S,hasApiKeyHelper:f,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:_,hasDangerousEnvVars:v}),n?l(!0):O(e=>({...e,hasTrustDialogAccepted:!0})),e()}let j=N(()=>E(1));return i(`confirm:no`,()=>{E(0)},{context:`Confirmation`}),T===null?w?(setTimeout(e),null):(0,z.jsx)(I,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,z.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,z.jsx)(r,{bold:!0,children:C().cwd()}),(0,z.jsx)(r,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,z.jsx)(r,{children:`Once trusted, Claude Code can read, edit, and run commands in this folder.`}),(0,z.jsx)(r,{dimColor:!0,children:(0,z.jsx)(n,{url:`https://code.claude.com/docs/en/security`,children:`Security guide`})}),(0,z.jsx)(m,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>k(e),onCancel:()=>k(`exit`)}),(0,z.jsx)(r,{dimColor:!0,children:j.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,j.keyName,` again to exit`]}):(0,z.jsx)(z.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{ee as TrustDialog};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,Lt as n,P as r,Wt as i,fi as a,t as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{en as c,ur as l}from"./state-ix0xIunV.js";import{DS as u,GC as d,G_ as f,Mb as p,Nb as m,OS as h,U_ as g,WC as _,ba as v,xa as y}from"./loadAgentsDir-ZQwvbURI.js";import{n as b,t as x}from"./cwd-CYmmnQVS.js";import{_ as S,h as C}from"./debug-DiuXEmUq.js";import{c as w,g as T}from"./settings-BhvhCpVh.js";import{g as E,n as D,y as O}from"./config-662VDD70.js";import{n as k,r as A}from"./analytics-BotDBGh0.js";import{vn as j}from"./prompt-wys9CwDo.js";import{u as M}from"./referral-Cu9bEOFE.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-vzUoPY51.js";import{n as F,t as I}from"./PermissionDialog-0ya1CU5k.js";import{homedir as L}from"os";var R=e(a(),1),z=s();o(),c(),b(),S(),k(),E(),h(),M(),p(),f(),P(),F(),T(),j(),y(),d();function B(e){if(e===null||e.disableAllHooks)return!1;if(e.statusLine||e.fileSuggestion)return!0;if(!e.hooks)return!1;for(let t of Object.values(e.hooks))if(t.length>0)return!0;return!1}function V(){let e=[];return B(w(`projectSettings`))&&e.push(`.claude/settings.json`),B(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function H(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function U(){let e=[];return H(_(`projectSettings`))&&e.push(`.claude/settings.json`),H(_(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function W(e){return!!e?.otelHeadersHelper}function G(){let e=[];return W(w(`projectSettings`))&&e.push(`.claude/settings.json`),W(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function K(e){return!!e?.apiKeyHelper}function q(){let e=[];return K(w(`projectSettings`))&&e.push(`.claude/settings.json`),K(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function J(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function Y(){let e=[];return J(w(`projectSettings`))&&e.push(`.claude/settings.json`),J(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function X(e){return!!e?.gcpAuthRefresh}function Z(){let e=[];return X(w(`projectSettings`))&&e.push(`.claude/settings.json`),X(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Q(e){return e?.env?Object.keys(e.env).some(e=>!v.has(e.toUpperCase())):!1}function $(){let e=[];return Q(w(`projectSettings`))&&e.push(`.claude/settings.json`),Q(w(`localSettings`))&&e.push(`.claude/settings.local.json`),e}j();function ee({onDone:e,commands:a}){let{servers:o}=g(`project`),s=Object.keys(o).length>0,c=V().length>0,d=U(),f=q().length>0,p=Y().length>0,h=Z().length>0,_=G().length>0,v=$().length>0,y=a?.some(e=>e.type===`prompt`&&e.loadedFrom===`commands_DEPRECATED`&&(e.source===`projectSettings`||e.source===`localSettings`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,b=a?.some(e=>e.type===`prompt`&&(e.loadedFrom===`skills`||e.loadedFrom===`plugin`)&&(e.source===`projectSettings`||e.source===`localSettings`||e.source===`plugin`)&&e.allowedTools?.some(e=>e===`Bash`||e.startsWith(`Bash(`)))??!1,S=d.length>0||y||b,w=D(),[T,E]=R.useState(null);R.useEffect(()=>{if(T!==null){let e=T,t=setTimeout(()=>u(e));return()=>clearTimeout(t)}},[T]),R.useEffect(()=>{A(`tengu_trust_dialog_shown`,{isHomeDir:L()===x(),hasMcpServers:s,hasHooks:c,hasBashExecution:S,hasApiKeyHelper:f,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:_,hasDangerousEnvVars:v})},[s,c,S,f,p,h,_,v]);function k(t){if(t===`exit`){E(1);return}let n=L()===x();A(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:s,hasHooks:c,hasBashExecution:S,hasApiKeyHelper:f,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:_,hasDangerousEnvVars:v}),n?l(!0):O(e=>({...e,hasTrustDialogAccepted:!0})),e()}let j=N(()=>E(1));return i(`confirm:no`,()=>{E(0)},{context:`Confirmation`}),T===null?w?(setTimeout(e),null):(0,z.jsx)(I,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,z.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,z.jsx)(r,{bold:!0,children:C().cwd()}),(0,z.jsx)(r,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,z.jsx)(r,{children:`Once trusted, Claude Code can read, edit, and run commands in this folder.`}),(0,z.jsx)(r,{dimColor:!0,children:(0,z.jsx)(n,{url:`https://code.claude.com/docs/en/security`,children:`Security guide`})}),(0,z.jsx)(m,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>k(e),onCancel:()=>k(`exit`)}),(0,z.jsx)(r,{dimColor:!0,children:j.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,j.keyName,` again to exit`]}):(0,z.jsx)(z.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{ee as TrustDialog};
@@ -1,2 +1,2 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,fi as o,j as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{O as u,k as d}from"./config-C7YHKCPV.js";function f(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:u(e,t,n,r)}var p=e((()=>{d()}));function m(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,o=[],c=new WeakSet;function l(e,t){return t?s(t,i)(e):e}function u(e,t,i,s=0){if(typeof e==`string`){o.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);o.push(t+l(n,a.value))}return}if(c.has(e)){o.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,m=s===0&&i===0?``:t,g=l(p?h.lastBranch:h.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=m+g+(_?` `+_:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);o.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))o.push(v),u(f,m+l(p?h.empty:h.line,a.treeChar)+` `,p,s+1);else if(Array.isArray(f))o.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,o.push(v)}else o.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0],n=l(h.lastBranch,a.treeChar),r=l(e[t],a.value);return n+` `+r}return u(e,``,!0),o.join(`
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./figures-5ThXQEtq.js";import{H as r,I as i,P as a,fi as o,j as s,t as c}from"./src-CDCSSo0U2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{O as u,k as d}from"./config-662VDD70.js";function f(e,t,n,r){return r=typeof r==`function`?r:void 0,e==null?e:u(e,t,n,r)}var p=e((()=>{d()}));function m(e,t={}){let{showValues:n=!0,hideFunctions:r=!1,themeName:i=`dark`,treeCharColors:a={}}=t,o=[],c=new WeakSet;function l(e,t){return t?s(t,i)(e):e}function u(e,t,i,s=0){if(typeof e==`string`){o.push(t+l(e,a.value));return}if(typeof e!=`object`||!e){if(n){let n=String(e);o.push(t+l(n,a.value))}return}if(c.has(e)){o.push(t+l(`[Circular]`,a.value));return}c.add(e);let d=Object.keys(e).filter(t=>{let n=e[t];return!(r&&typeof n==`function`)});d.forEach((r,i)=>{let f=e[r],p=i===d.length-1,m=s===0&&i===0?``:t,g=l(p?h.lastBranch:h.branch,a.treeChar),_=r.trim()===``?``:l(r,a.key),v=m+g+(_?` `+_:``),y=r.trim()!==``;if(f&&typeof f==`object`&&c.has(f)){let e=l(`[Circular]`,a.value);o.push(v+(y?`: `:v?` `:``)+e)}else if(f&&typeof f==`object`&&!Array.isArray(f))o.push(v),u(f,m+l(p?h.empty:h.line,a.treeChar)+` `,p,s+1);else if(Array.isArray(f))o.push(v+(y?`: `:v?` `:``)+`[Array(`+f.length+`)]`);else if(n){let e=l(typeof f==`function`?`[Function]`:String(f),a.value);v+=(y?`: `:v?` `:``)+e,o.push(v)}else o.push(v)})}let d=Object.keys(e);if(d.length===0)return l(`(empty)`,a.value);if(d.length===1&&d[0]!==void 0&&d[0].trim()===``&&typeof e[d[0]]==`string`){let t=d[0],n=l(h.lastBranch,a.treeChar),r=l(e[t],a.value);return n+` `+r}return u(e,``,!0),o.join(`
2
2
  `)}var h,g=e((()=>{t(),c(),h={branch:n.lineUpDownRight,lastBranch:n.lineUpRight,line:n.lineVertical,empty:` `}}));function _(e){let t={};return e.forEach(e=>{if(!e.path){t[``]=e.message;return}let n=e.path.split(`.`),r=e.path;if(e.invalidValue!==null&&e.invalidValue!==void 0&&n.length>0){let t=[];for(let r=0;r<n.length;r++){let i=n[r];if(i)if(!isNaN(parseInt(i,10))&&r===n.length-1){let n;n=typeof e.invalidValue==`string`?`"${e.invalidValue}"`:e.invalidValue===null?`null`:e.invalidValue===void 0?`undefined`:String(e.invalidValue),t.push(n)}else t.push(i)}r=t.join(`.`)}f(t,r,e.message,Object)}),t}function v({errors:e}){let[t]=r();if(e.length===0)return null;let n=e.reduce((e,t)=>{let n=t.file||`(file not specified)`;return e[n]||(e[n]=[]),e[n].push(t),e},{});return(0,y.jsx)(i,{flexDirection:`column`,children:Object.keys(n).sort().map(e=>{let r=n[e]||[];r.sort((e,t)=>!e.path&&t.path?-1:e.path&&!t.path?1:(e.path||``).localeCompare(t.path||``));let o=_(r),s=new Map;r.forEach(e=>{if(e.suggestion||e.docLink){let t=`${e.suggestion||``}|${e.docLink||``}`;s.has(t)||s.set(t,{suggestion:e.suggestion,docLink:e.docLink})}});let c=m(o,{showValues:!0,themeName:t,treeCharColors:{treeChar:`inactive`,key:`text`,value:`inactive`}});return(0,y.jsxs)(i,{flexDirection:`column`,children:[(0,y.jsx)(a,{children:e}),(0,y.jsx)(i,{marginLeft:1,children:(0,y.jsx)(a,{dimColor:!0,children:c})}),s.size>0&&(0,y.jsx)(i,{flexDirection:`column`,marginTop:1,children:Array.from(s.values()).map((e,t)=>(0,y.jsxs)(i,{flexDirection:`column`,marginBottom:1,children:[e.suggestion&&(0,y.jsx)(a,{dimColor:!0,wrap:`wrap`,children:e.suggestion}),e.docLink&&(0,y.jsxs)(a,{dimColor:!0,wrap:`wrap`,children:[`Learn more: `,e.docLink]})]},`suggestion-pair-${t}`))})]},e)})})}var y,b=e((()=>{p(),o(),c(),g(),y=l()}));export{b as n,v as t};
@@ -0,0 +1 @@
1
+ import"./rolldown-runtime-DaDcL9Zw.js";import{H as e,I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Jt as o,Zt as s}from"./settings-BhvhCpVh.js";r(),i(),s();var c=a(),l=58;function u(){let[r]=e(),i=`Welcome to Work Mate`;return o.terminal===`Apple_Terminal`?(0,c.jsx)(d,{theme:r,welcomeMessage:i}):[`light`,`light-daltonized`,`light-ansi`].includes(r)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.2`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[i,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.2`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * `})]})}function d({theme:e,welcomeMessage:r}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.2`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` ░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{children:` `})]}):(0,c.jsxs)(t,{width:l,flexDirection:`column`,children:[(0,c.jsxs)(n,{children:[(0,c.jsxs)(n,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[r,` `]}),(0,c.jsxs)(n,{dimColor:!0,children:[`v`,`0.0.2`,` `]})]}),(0,c.jsx)(n,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,c.jsx)(n,{children:` * █████▓▓░ `}),(0,c.jsx)(n,{children:` * ███▓░ ░░ `}),(0,c.jsx)(n,{children:` ░░░░░░ ███▓░ `}),(0,c.jsx)(n,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,c.jsxs)(n,{children:[(0,c.jsx)(n,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,c.jsx)(n,{bold:!0,children:`*`}),(0,c.jsx)(n,{children:` ██▓░░ ▓ `})]}),(0,c.jsx)(n,{children:` ░▓▓███▓▓░ `}),(0,c.jsx)(n,{dimColor:!0,children:` * ░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░ `}),(0,c.jsx)(n,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}export{u as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{I as i,P as a,di as o,fi as s,t as c,ui as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{en as d,h as f,mn as p}from"./state-4KQ3kaqz.js";import{BC as m,IC as h,IE as g,L as _,NE as v,R as y,VC as b,vb as x,yb as S,z as C}from"./loadAgentsDir-nzr38hai.js";import{n as w,t as T}from"./AddWorkspaceDirectory-BSLHrjbt.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsxs)(a,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(x,{children:(0,k.jsx)(a,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),i=t.getAppState(),a=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=h(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),v.refreshConfig();let s;if(r)try{b(i),s=`Added ${l.bold(n)} as a working directory and saved to local settings`}catch(e){s=`Added ${l.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else s=`Added ${l.bold(n)} as a working directory for this session`;e(`${s} ${l.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add a working directory.`)}});let o=await C(r,i.toolPermissionContext);if(o.resultType!==`success`){let t=_(o);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:o.absolutePath,permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add ${l.bold(o.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{o(),n(),O=t(s(),1),d(),S(),w(),c(),m(),g(),y(),k=u()}))();export{D as call};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{I as i,P as a,di as o,fi as s,t as c,ui as l}from"./src-CDCSSo0U2.js";import{t as u}from"./jsx-runtime-Bb4Xn-E0.js";import{en as d,h as f,mn as p}from"./state-ix0xIunV.js";import{BC as m,IC as h,IE as g,L as _,NE as v,R as y,VC as b,vb as x,yb as S,z as C}from"./loadAgentsDir-ZQwvbURI.js";import{n as w,t as T}from"./AddWorkspaceDirectory-BgNp7glC.js";function E({message:e,args:t,onDone:n}){return(0,O.useEffect)(()=>{let e=setTimeout(n,0);return()=>clearTimeout(e)},[n]),(0,k.jsxs)(i,{flexDirection:`column`,children:[(0,k.jsxs)(a,{dimColor:!0,children:[r.pointer,` /add-dir `,t]}),(0,k.jsx)(x,{children:(0,k.jsx)(a,{children:e})})]})}async function D(e,t,n){let r=(n??``).trim(),i=t.getAppState(),a=async(n,r=!1)=>{let i={type:`addDirectories`,directories:[n],destination:r?`localSettings`:`session`},a=h(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),v.refreshConfig();let s;if(r)try{b(i),s=`Added ${l.bold(n)} as a working directory and saved to local settings`}catch(e){s=`Added ${l.bold(n)} as a working directory. Failed to save to local settings: ${e instanceof Error?e.message:`Unknown error`}`}else s=`Added ${l.bold(n)} as a working directory for this session`;e(`${s} ${l.dim(`· /permissions to manage`)}`)};if(!r)return(0,k.jsx)(T,{permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add a working directory.`)}});let o=await C(r,i.toolPermissionContext);if(o.resultType!==`success`){let t=_(o);return(0,k.jsx)(E,{message:t,args:n??``,onDone:()=>e(t)})}return(0,k.jsx)(T,{directoryPath:o.absolutePath,permissionContext:i.toolPermissionContext,onAddDirectory:a,onCancel:()=>{e(`Did not add ${l.bold(o.absolutePath)} as a working directory.`)}})}var O,k;e((()=>{o(),n(),O=t(s(),1),d(),S(),w(),c(),m(),g(),y(),k=u()}))();export{D as call};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hh as t,Uh as n}from"./loadAgentsDir-nzr38hai.js";import{dn as r,un as i}from"./settings-5PQdphqC.js";function a(e,t){let n=new Map;for(let e of t)n.set(e.agentType,e);let r=new Set,i=[];for(let t of e){let e=`${t.agentType}:${t.source}`;if(r.has(e))continue;r.add(e);let a=n.get(t.agentType),o=a&&a.source!==t.source?a.source:void 0;i.push({...t,overriddenBy:o})}return i}function o(e){let n=e.model||t();if(n)return n===`inherit`?`inherit`:n}function s(e){return i(e).toLowerCase()}function c(e,t){return e.agentType.localeCompare(t.agentType,void 0,{sensitivity:`base`})}var l,u=e((()=>{n(),r(),l=[{label:`User agents`,source:`userSettings`},{label:`Project agents`,source:`projectSettings`},{label:`Local agents`,source:`localSettings`},{label:`Managed agents`,source:`policySettings`},{label:`Plugin agents`,source:`plugin`},{label:`CLI arg agents`,source:`flagSettings`},{label:`Built-in agents`,source:`built-in`}]}));export{o as a,u as i,c as n,a as o,s as r,l as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{Hh as t,Uh as n}from"./loadAgentsDir-ZQwvbURI.js";import{dn as r,un as i}from"./settings-BhvhCpVh.js";function a(e,t){let n=new Map;for(let e of t)n.set(e.agentType,e);let r=new Set,i=[];for(let t of e){let e=`${t.agentType}:${t.source}`;if(r.has(e))continue;r.add(e);let a=n.get(t.agentType),o=a&&a.source!==t.source?a.source:void 0;i.push({...t,overriddenBy:o})}return i}function o(e){let n=e.model||t();if(n)return n===`inherit`?`inherit`:n}function s(e){return i(e).toLowerCase()}function c(e,t){return e.agentType.localeCompare(t.agentType,void 0,{sensitivity:`base`})}var l,u=e((()=>{n(),r(),l=[{label:`User agents`,source:`userSettings`},{label:`Project agents`,source:`projectSettings`},{label:`Local agents`,source:`localSettings`},{label:`Managed agents`,source:`policySettings`},{label:`Plugin agents`,source:`plugin`},{label:`CLI arg agents`,source:`flagSettings`},{label:`Built-in agents`,source:`built-in`}]}));export{o as a,u as i,c as n,a as o,s as r,l as t};
@@ -1,4 +1,4 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,D as s,I as c,P as l,T as u,Wt as d,di as f,fi as p,t as m,ui as h,y as g}from"./src-CDCSSo0U2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$d as v,$y as y,Af as b,Ah as x,Bc as S,Bh as ee,Cf as C,Ef as te,Gg as ne,Hb as w,Hd as re,Hn as ie,IS as ae,Jo as oe,KT as se,Kd as ce,LS as le,M_ as ue,Mf as de,N_ as fe,Nb as pe,Nf as me,Oh as he,Pb as ge,Qd as _e,So as ve,Tf as ye,Ud as be,Uh as xe,Un as Se,Vb as T,Vc as Ce,Vh as we,Wg as Te,Wn as Ee,Xd as De,Xu as Oe,Yu as ke,Zd as Ae,_u as je,at as Me,aw as Ne,bf as Pe,c as Fe,dT as Ie,ef as Le,et as Re,ex as ze,fS as Be,hv as Ve,iD as He,iw as Ue,jf as We,kh as Ge,l as Ke,lS as qe,lh as Je,mv as Ye,nt as Xe,o as Ze,of as Qe,qT as $e,qd as et,r as tt,rD as nt,s as rt,sf as it,sh as at,st as ot,t as st,tb as ct,tx as lt,uS as ut,vu as dt,wf as ft,yf as pt,zo as mt}from"./loadAgentsDir-nzr38hai.js";import{n as ht,t as gt}from"./cwd-BuJhkTrc.js";import{B as _t,D as vt,E as yt,J as bt,U as xt,Y as St,nt as Ct}from"./debug-IKW-jE7K.js";import{Q as wt,Qt as Tt,_n as Et,ct as Dt,dn as Ot,en as kt,gn as At,ln as jt,lt as Mt,nt as Nt}from"./settings-5PQdphqC.js";import{I as Pt,P as Ft}from"./config-C7YHKCPV.js";import{o as It,s as Lt}from"./log-B3eB4EFv.js";import{n as Rt,r as zt}from"./analytics-BotDBGh0.js";import{T as Bt,b as Vt}from"./startupProfiler-DxRQteII.js";import{l as Ht,n as Ut,o as Wt}from"./stringUtils-CvXbHQRH.js";import{Cn as Gt,Sn as Kt}from"./prompt-Bef63FhB.js";import{st as qt}from"./rcDebugLog-BUuD-X1D.js";import{u as E}from"./referral-DP_GshTS.js";import{r as Jt,t as Yt}from"./TungstenTool-CxMQVCuF.js";import{a as Xt,i as Zt,n as Qt,o as $t,r as en,t as tn}from"./agentDisplay-CQ4mZWFH.js";import{n as nn,t as rn}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";import{n as an,t as on}from"./useMergedTools-CZJffsmf.js";import{n as sn,r as cn,t as ln}from"./promptEditor-foiayhdY.js";import{n as un,t as dn}from"./useMainLoopModel-BNFW-g8E.js";import{join as D}from"path";import{mkdir as fn,open as pn,unlink as mn}from"fs/promises";var O,hn=e((()=>{O={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function gn(e,t,n,r,i,a,o,s){return`---
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,D as s,I as c,P as l,T as u,Wt as d,di as f,fi as p,t as m,ui as h,y as g}from"./src-CDCSSo0U2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{$d as v,$y as y,Af as b,Ah as x,Bc as S,Bh as ee,Cf as C,Ef as te,Gg as ne,Hb as w,Hd as re,Hn as ie,IS as ae,Jo as oe,KT as se,Kd as ce,LS as le,M_ as ue,Mf as de,N_ as fe,Nb as pe,Nf as me,Oh as he,Pb as ge,Qd as _e,So as ve,Tf as ye,Ud as be,Uh as xe,Un as Se,Vb as T,Vc as Ce,Vh as we,Wg as Te,Wn as Ee,Xd as De,Xu as Oe,Yu as ke,Zd as Ae,_u as je,at as Me,aw as Ne,bf as Pe,c as Fe,dT as Ie,ef as Le,et as Re,ex as ze,fS as Be,hv as Ve,iD as He,iw as Ue,jf as We,kh as Ge,l as Ke,lS as qe,lh as Je,mv as Ye,nt as Xe,o as Ze,of as Qe,qT as $e,qd as et,r as tt,rD as nt,s as rt,sf as it,sh as at,st as ot,t as st,tb as ct,tx as lt,uS as ut,vu as dt,wf as ft,yf as pt,zo as mt}from"./loadAgentsDir-ZQwvbURI.js";import{n as ht,t as gt}from"./cwd-CYmmnQVS.js";import{B as _t,D as vt,E as yt,J as bt,U as xt,Y as St,nt as Ct}from"./debug-DiuXEmUq.js";import{Q as wt,Qt as Tt,_n as Et,ct as Dt,dn as Ot,en as kt,gn as At,ln as jt,lt as Mt,nt as Nt}from"./settings-BhvhCpVh.js";import{I as Pt,P as Ft}from"./config-662VDD70.js";import{o as It,s as Lt}from"./log-Duzb4o6h.js";import{n as Rt,r as zt}from"./analytics-BotDBGh0.js";import{T as Bt,b as Vt}from"./startupProfiler-BquH_Yqm.js";import{l as Ht,n as Ut,o as Wt}from"./stringUtils-D_g2L6A4.js";import{Cn as Gt,Sn as Kt}from"./prompt-wys9CwDo.js";import{st as qt}from"./rcDebugLog-CivJaJ3V.js";import{u as E}from"./referral-Cu9bEOFE.js";import{r as Jt,t as Yt}from"./TungstenTool-CxMQVCuF.js";import{a as Xt,i as Zt,n as Qt,o as $t,r as en,t as tn}from"./agentDisplay-CCeYiAta.js";import{n as nn,t as rn}from"./useExitOnCtrlCDWithKeybindings-vzUoPY51.js";import{n as an,t as on}from"./useMergedTools-Bb4XbC9d.js";import{n as sn,r as cn,t as ln}from"./promptEditor-D6HzjcMS.js";import{n as un,t as dn}from"./useMainLoopModel-cZd8EKo5.js";import{join as D}from"path";import{mkdir as fn,open as pn,unlink as mn}from"fs/promises";var O,hn=e((()=>{O={FOLDER_NAME:`.claude`,AGENTS_DIR:`agents`}}));function gn(e,t,n,r,i,a,o,s){return`---
2
2
  name: ${e}
3
3
  description: "${t.replace(/\\/g,`\\\\`).replace(/"/g,`\\"`).replace(/\n/g,`\\\\n`)}"${n===void 0||n.length===1&&n[0]===`*`?``:`\ntools: ${n.join(`, `)}`}${a?`\nmodel: ${a}`:``}${s===void 0?``:`\neffort: ${s}`}${i?`\ncolor: ${i}`:``}${o?`\nmemory: ${o}`:``}
4
4
  ---
@@ -1,2 +1,2 @@
1
- import{i as e,o as t,r as n}from"./loadAgentsDir-nzr38hai.js";import{n as r,t as i}from"./cwd-BuJhkTrc.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-CQ4mZWFH.js";o(),t(),r();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:t}=await e(i()),r=c(t,n(t)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
1
+ import{i as e,o as t,r as n}from"./loadAgentsDir-ZQwvbURI.js";import{n as r,t as i}from"./cwd-CYmmnQVS.js";import{a,i as o,n as s,o as c,r as l,t as u}from"./agentDisplay-CCeYiAta.js";o(),t(),r();function d(e){let t=a(e),n=[e.agentType];return t&&n.push(t),e.memory&&n.push(`${e.memory} memory`),n.join(` · `)}async function f(){let{allAgents:t}=await e(i()),r=c(t,n(t)),a=[],o=0;for(let{label:e,source:t}of u){let n=r.filter(e=>e.source===t).sort(s);if(n.length!==0){a.push(`${e}:`);for(let e of n)if(e.overriddenBy){let t=l(e.overriddenBy);a.push(` (shadowed by ${t}) ${d(e)}`)}else a.push(` ${d(e)}`),o++;a.push(``)}}a.length===0?console.log(`No agents found.`):(console.log(`${o} active agents\n`),console.log(a.join(`
2
2
  `).trimEnd()))}export{f as agentsHandler};
@@ -1 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{G_ as t,U_ as n}from"./loadAgentsDir-nzr38hai.js";import{g as r,u as i}from"./settings-5PQdphqC.js";function a(){let e=i(),t=[`user`,`project`,`local`].flatMap(e=>n(e).errors);return{settings:e.settings,errors:[...e.errors,...t]}}var o=e((()=>{t(),r()}));export{o as n,a as t};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{G_ as t,U_ as n}from"./loadAgentsDir-ZQwvbURI.js";import{g as r,u as i}from"./settings-BhvhCpVh.js";function a(){let e=i(),t=[`user`,`project`,`local`].flatMap(e=>n(e).errors);return{settings:e.settings,errors:[...e.errors,...t]}}var o=e((()=>{t(),r()}));export{o as n,a as t};
@@ -1 +1 @@
1
- import{GS as e,JS as t,QS as n,US as r,XS as i,qS as a}from"./loadAgentsDir-nzr38hai.js";import{s as o,u as s}from"./logoV2Utils-RQ160dI2.js";t(),s();var c=`default`;async function l(e,t){let n=await r(t.list||c,{subject:e,description:t.description||``,status:`pending`,blocks:[],blockedBy:[]});console.log(`Created task ${n}: ${e}`)}async function u(e){let t=await i(e.list||c);if(e.pending&&(t=t.filter(e=>e.status===`pending`)),e.json){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log(`No tasks found.`);return}for(let e of t)console.log(` [${e.status}] ${e.id}: ${e.subject}`),e.description&&console.log(` ${e.description}`),e.owner&&console.log(` owner: ${e.owner}`)}async function d(t,n){let r=await e(n.list||c,t);if(!r){console.error(`Task not found: ${t}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function f(e,t){let r=t.list||c,i={};t.status&&(i.status=t.status),t.subject&&(i.subject=t.subject),t.description&&(i.description=t.description),t.owner&&(i.owner=t.owner),t.clearOwner&&(i.owner=void 0);let a=await n(r,e,i);if(!a){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(`Updated task ${e}: [${a.status}] ${a.subject}`)}async function p(e){let t=e.list||c;console.log(a(t))}async function m(e){let t=await o();if(e===void 0){if(t.length===0){console.log(`No recent sessions.`);return}for(let e=0;e<Math.min(t.length,20);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`,i=n.title||n.sessionId||`untitled`;console.log(` ${e}: ${i} (${r})`)}return}let n=typeof e==`string`?parseInt(e,10):e,r=Number.isFinite(n)&&n>=0&&n<t.length?t[n]:t.find(t=>t.sessionId===String(e));if(!r){console.error(`Session not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function h(e){let t=await o(),n=e??5;console.log(`Last ${n} sessions:`);for(let e=0;e<Math.min(n,t.length);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`;console.log(` ${e}: ${n.sessionId} (${r})`)}}async function g(e,t,n){let{regenerateCompletionCache:r}=await import(`./completionCache-CW8lKIgy.js`);t.output,await r(),console.log(`Completion cache regenerated for ${e}.`)}export{g as completionHandler,h as errorHandler,m as logHandler,l as taskCreateHandler,p as taskDirHandler,d as taskGetHandler,u as taskListHandler,f as taskUpdateHandler};
1
+ import{GS as e,JS as t,QS as n,US as r,XS as i,qS as a}from"./loadAgentsDir-ZQwvbURI.js";import{s as o,u as s}from"./logoV2Utils-5lcUu53m.js";t(),s();var c=`default`;async function l(e,t){let n=await r(t.list||c,{subject:e,description:t.description||``,status:`pending`,blocks:[],blockedBy:[]});console.log(`Created task ${n}: ${e}`)}async function u(e){let t=await i(e.list||c);if(e.pending&&(t=t.filter(e=>e.status===`pending`)),e.json){console.log(JSON.stringify(t,null,2));return}if(t.length===0){console.log(`No tasks found.`);return}for(let e of t)console.log(` [${e.status}] ${e.id}: ${e.subject}`),e.description&&console.log(` ${e.description}`),e.owner&&console.log(` owner: ${e.owner}`)}async function d(t,n){let r=await e(n.list||c,t);if(!r){console.error(`Task not found: ${t}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function f(e,t){let r=t.list||c,i={};t.status&&(i.status=t.status),t.subject&&(i.subject=t.subject),t.description&&(i.description=t.description),t.owner&&(i.owner=t.owner),t.clearOwner&&(i.owner=void 0);let a=await n(r,e,i);if(!a){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(`Updated task ${e}: [${a.status}] ${a.subject}`)}async function p(e){let t=e.list||c;console.log(a(t))}async function m(e){let t=await o();if(e===void 0){if(t.length===0){console.log(`No recent sessions.`);return}for(let e=0;e<Math.min(t.length,20);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`,i=n.title||n.sessionId||`untitled`;console.log(` ${e}: ${i} (${r})`)}return}let n=typeof e==`string`?parseInt(e,10):e,r=Number.isFinite(n)&&n>=0&&n<t.length?t[n]:t.find(t=>t.sessionId===String(e));if(!r){console.error(`Session not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(r,null,2))}async function h(e){let t=await o(),n=e??5;console.log(`Last ${n} sessions:`);for(let e=0;e<Math.min(n,t.length);e++){let n=t[e],r=n.modified?new Date(n.modified).toLocaleString():`unknown`;console.log(` ${e}: ${n.sessionId} (${r})`)}}async function g(e,t,n){let{regenerateCompletionCache:r}=await import(`./completionCache-C9zlWBRz.js`);t.output,await r(),console.log(`Completion cache regenerated for ${e}.`)}export{g as completionHandler,h as errorHandler,m as logHandler,l as taskCreateHandler,p as taskDirHandler,d as taskGetHandler,u as taskListHandler,f as taskUpdateHandler};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{n as r,t as i}from"./v4-jw6qOKwQ.js";import{E as a,J as o,O as s,U as c,l,p as u,z as d}from"./debug-DiuXEmUq.js";import{c as f,g as p}from"./config-662VDD70.js";import{o as m,s as h}from"./log-Duzb4o6h.js";import{n as g,t as _}from"./lazySchema-uxlVVNM1.js";import{l as v,u as y}from"./oauth-BqJqV-2M.js";import{Hr as b,Ur as x,Vt as S,kt as C,vn as w,yn as T}from"./model-BgrLt7P7.js";import{a as E,i as D}from"./detectRepository-B1PMTLAU.js";import{randomUUID as O}from"crypto";function k(e){return t.isAxiosError(e)?!e.response||e.response.status>=500:!1}async function A(e,n){let r;for(let i=0;i<=V;i++)try{return await t.get(e,n)}catch(e){if(r=e,!k(e))throw e;if(i>=V)throw u(`Teleport request failed after ${i+1} attempts: ${d(e)}`),e;let t=B[i]??2e3;u(`Teleport request failed (attempt ${i+1}/${V+1}), retrying in ${t}ms: ${d(e)}`),await T(t)}throw r}function j(e){return e===null||typeof e==`string`&&e.trim()===``}async function M(){let e=f(),t=process.env.ANTHROPIC_API_KEY?.trim()||e.workspaceApiKey?.trim();if(!t){let t=e.workspaceApiKey,n=j(t)?`Your workspace API key was cleared. `:`A workspace API key (sk-ant-api03-*) is required to use workspace endpoints (/v1/agents, /v1/vaults, /v1/memory_stores, /v1/skills). `;throw Error(n+`Press W in /login to save your key directly (no restart needed), or set ANTHROPIC_API_KEY=<key> and restart. Obtain a key from https://console.anthropic.com/settings/keys. Subscription OAuth (claude.ai login) cannot reach these endpoints.`)}if(!t.startsWith(`sk-ant-api03-`))throw Error(`Workspace API key must start with sk-ant-api03-, got prefix "${t.slice(0,4)}...". Obtain a workspace API key from https://console.anthropic.com/settings/keys. Press W in /login to save your key, or set ANTHROPIC_API_KEY.`);return{apiKey:t}}async function N(){let e=C()?.accessToken;if(e===void 0)throw Error(`Work Mate web sessions require authentication with a Claude.ai account. API key authentication is not sufficient. Please run /login to authenticate, or check your authentication status with /status.`);let t=await b();if(!t)throw Error(`Unable to get organization UUID`);return{accessToken:e,orgUUID:t}}async function P(){let{accessToken:e,orgUUID:t}=await N(),n=`${v().BASE_API_URL}/v1/sessions`;try{let r=await A(n,{headers:{...F(e),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":t}});if(r.status!==200)throw Error(`Failed to fetch code sessions: ${r.statusText}`);return r.data.data.map(e=>{let t=e.session_context.sources.find(e=>e.type===`git_repository`),n=null;if(t?.url){let e=E(t.url);if(e){let[r,i]=e.split(`/`);r&&i&&(n={name:i,owner:{login:r},default_branch:t.revision||void 0})}}return{id:e.id,title:e.title||`Untitled`,description:``,status:e.session_status,repo:n,turns:[],created_at:e.created_at,updated_at:e.updated_at}})}catch(e){throw h(o(e)),e}}function F(e){return{Authorization:`Bearer ${e}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`}}async function I(e){let{accessToken:n,orgUUID:r}=await N(),i=`${v().BASE_API_URL}/v1/sessions/${e}`,a={...F(n),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":r},o=await t.get(i,{headers:a,timeout:15e3,validateStatus:e=>e<500});if(o.status!==200){let t=o.data?.error?.message;throw o.status===404?Error(`Session not found: ${e}`):o.status===401?Error(`Session expired. Please run /login to sign in again.`):Error(t||`Failed to fetch session: ${o.status} ${o.statusText}`)}return o.data}function L(e){return(e.session_context.outcomes?.find(e=>e.type===`git_repository`))?.git_info?.branches[0]}async function R(e,n,r){try{let{accessToken:i,orgUUID:a}=await N(),o=`${v().BASE_API_URL}/v1/sessions/${e}/events`,c={...F(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},l={events:[{uuid:r?.uuid??O(),session_id:e,type:`user`,parent_tool_use_id:null,message:{role:`user`,content:n}}]};u(`[sendEventToRemoteSession] Sending event to session ${e}`);let d=await t.post(o,l,{headers:c,validateStatus:e=>e<500,timeout:3e4});return d.status===200||d.status===201?(u(`[sendEventToRemoteSession] Successfully sent event to session ${e}`),!0):(u(`[sendEventToRemoteSession] Failed with status ${d.status}: ${s(d.data)}`),!1)}catch(e){return u(`[sendEventToRemoteSession] Error: ${d(e)}`),!1}}async function z(e,n){try{let{accessToken:r,orgUUID:i}=await N(),a=`${v().BASE_API_URL}/v1/sessions/${e}`,o={...F(r),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":i};u(`[updateSessionTitle] Updating title for session ${e}: "${n}"`);let c=await t.patch(a,{title:n},{headers:o,validateStatus:e=>e<500});return c.status===200?(u(`[updateSessionTitle] Successfully updated title for session ${e}`),!0):(u(`[updateSessionTitle] Failed with status ${c.status}: ${s(c.data)}`),!1)}catch(e){return u(`[updateSessionTitle] Error: ${d(e)}`),!1}}var B,V,H=e((()=>{n(),y(),x(),i(),S(),p(),l(),D(),c(),_(),m(),w(),a(),B=[2e3,4e3,8e3,16e3],V=B.length,g(()=>r.object({id:r.string(),title:r.string(),description:r.string(),status:r.enum([`idle`,`working`,`waiting`,`completed`,`archived`,`cancelled`,`rejected`]),repo:r.object({name:r.string(),owner:r.object({login:r.string()}),default_branch:r.string().optional()}).nullable(),turns:r.array(r.string()),created_at:r.string(),updated_at:r.string()}))}));export{F as a,j as c,R as d,z as f,L as i,N as l,P as n,H as o,I as r,k as s,A as t,M as u};
@@ -0,0 +1 @@
1
+ import{a as e,n as t,o as n}from"./api-CLLIHLpn.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};
@@ -0,0 +1 @@
1
+ import{r as e}from"./asciicast-CQJlNTae.js";export{e as renameRecordingForSession};
@@ -1,4 +1,4 @@
1
- import{l as e,n as t,o as n}from"./envUtils-DSxRz_kt.js";import{en as r,ht as i,nt as a}from"./state-4KQ3kaqz.js";import{E as o,O as s,_ as c,h as l,l as u,lt as d,ot as f,p,st as m,ut as h}from"./debug-IKW-jE7K.js";import{m as g}from"./sessionStoragePortable-Cx6JQ5Ye.js";import{i as _}from"./path-BCSE0S-c.js";import{basename as v,dirname as y,join as b}from"path";import{appendFile as x,rename as S}from"fs/promises";r(),h(),f(),u(),n(),c(),_(),o();var C={filePath:null,timestamp:0};function w(){if(C.filePath!==null)return C.filePath;if(process.env.USER_TYPE!==`ant`||!e(process.env.CLAUDE_CODE_TERMINAL_RECORDING))return null;let n=b(b(t(),`projects`),g(a()));return C.timestamp=Date.now(),C.filePath=b(n,`${i()}-${C.timestamp}.cast`),C.filePath}async function T(){let e=C.filePath;if(!e||C.timestamp===0)return;let n=b(b(b(t(),`projects`),g(a())),`${i()}-${C.timestamp}.cast`);if(e===n)return;await E?.flush();let r=v(e),o=v(n);try{await S(e,n),C.filePath=n,p(`[asciicast] Renamed recording: ${r} → ${o}`)}catch{p(`[asciicast] Failed to rename recording from ${r} to ${o}`)}}var E=null;function D(){return{cols:process.stdout.columns||80,rows:process.stdout.rows||24}}function O(){let e=w();if(!e)return;let{cols:t,rows:n}=D(),r=performance.now(),i=s({version:2,width:t,height:n,timestamp:Math.floor(Date.now()/1e3),env:{SHELL:process.env.SHELL||``,TERM:process.env.TERM||``}});try{l().mkdirSync(y(e))}catch{}l().appendFileSync(e,i+`
1
+ import{l as e,n as t,o as n}from"./envUtils-DSxRz_kt.js";import{en as r,ht as i,nt as a}from"./state-ix0xIunV.js";import{E as o,O as s,_ as c,h as l,l as u,lt as d,ot as f,p,st as m,ut as h}from"./debug-DiuXEmUq.js";import{m as g}from"./sessionStoragePortable-Cx6JQ5Ye.js";import{i as _}from"./path-Cu_AKqg6.js";import{basename as v,dirname as y,join as b}from"path";import{appendFile as x,rename as S}from"fs/promises";r(),h(),f(),u(),n(),c(),_(),o();var C={filePath:null,timestamp:0};function w(){if(C.filePath!==null)return C.filePath;if(process.env.USER_TYPE!==`ant`||!e(process.env.CLAUDE_CODE_TERMINAL_RECORDING))return null;let n=b(b(t(),`projects`),g(a()));return C.timestamp=Date.now(),C.filePath=b(n,`${i()}-${C.timestamp}.cast`),C.filePath}async function T(){let e=C.filePath;if(!e||C.timestamp===0)return;let n=b(b(b(t(),`projects`),g(a())),`${i()}-${C.timestamp}.cast`);if(e===n)return;await E?.flush();let r=v(e),o=v(n);try{await S(e,n),C.filePath=n,p(`[asciicast] Renamed recording: ${r} → ${o}`)}catch{p(`[asciicast] Failed to rename recording from ${r} to ${o}`)}}var E=null;function D(){return{cols:process.stdout.columns||80,rows:process.stdout.rows||24}}function O(){let e=w();if(!e)return;let{cols:t,rows:n}=D(),r=performance.now(),i=s({version:2,width:t,height:n,timestamp:Math.floor(Date.now()/1e3),env:{SHELL:process.env.SHELL||``,TERM:process.env.TERM||``}});try{l().mkdirSync(y(e))}catch{}l().appendFileSync(e,i+`
2
2
  `,{mode:384});let a=Promise.resolve(),o=d({writeFn(e){let t=C.filePath;t&&(a=a.then(()=>x(t,e)).catch(()=>{}))},flushIntervalMs:500,maxBufferSize:50,maxBufferBytes:10*1024*1024}),c=process.stdout.write.bind(process.stdout);process.stdout.write=function(e,t,n){let i=(performance.now()-r)/1e3,a=typeof e==`string`?e:Buffer.from(e).toString(`utf-8`);return o.write(s([i,`o`,a])+`
3
3
  `),typeof t==`function`?c(e,t):c(e,t,n)};function u(){let e=(performance.now()-r)/1e3,{cols:t,rows:n}=D();o.write(s([e,`r`,`${t}x${n}`])+`
4
4
  `)}process.stdout.on(`resize`,u),E={async flush(){o.flush(),await a},async dispose(){o.dispose(),await a,process.stdout.removeListener(`resize`,u),process.stdout.write=c}},m(async()=>{await E?.dispose(),E=null}),p(`[asciicast] Recording to ${e}`)}export{O as n,T as r,w as t};
@@ -1 +1 @@
1
- import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{H as i,en as a}from"./state-4KQ3kaqz.js";import{join as o}from"path";import{readFileSync as s}from"fs";var c=t({getAssistantActivationPath:()=>p,getAssistantSystemPromptAddendum:()=>f,isAssistantForced:()=>d,isAssistantMode:()=>l,markAssistantForced:()=>u});function l(){return i()}function u(){m=!0}function d(){return m}function f(){try{return s(o(n(),`agents`,`assistant.md`),`utf-8`)}catch{return``}}function p(){if(l())return m?`daemon`:`gate`}var m,h=e((()=>{a(),r(),m=!1}));export{d as a,h as i,p as n,l as o,f as r,u as s,c as t};
1
+ import{n as e,r as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{H as i,en as a}from"./state-ix0xIunV.js";import{join as o}from"path";import{readFileSync as s}from"fs";var c=t({getAssistantActivationPath:()=>p,getAssistantSystemPromptAddendum:()=>f,isAssistantForced:()=>d,isAssistantMode:()=>l,markAssistantForced:()=>u});function l(){return i()}function u(){m=!0}function d(){return m}function f(){try{return s(o(n(),`agents`,`assistant.md`),`utf-8`)}catch{return``}}function p(){if(l())return m?`daemon`:`gate`}var m,h=e((()=>{a(),r(),m=!1}));export{d as a,h as i,p as n,l as o,f as r,u as s,c as t};