@readmagic/workmate 0.0.3 → 0.0.4

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 (322) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-mANiG0xj.js → AddWorkspaceDirectory-BTC7FPqM.js} +1 -1
  2. package/dist/chunks/{App-aUVaOLeo.js → App-DOm71vtY.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-36iUE5CW.js → ApproveApiKey-9YQzwrrC.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-LPrZMlgU.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-BLcvdkgb.js → AssistantSessionChooser-CnYfFWrx.js} +1 -1
  6. package/dist/chunks/{BackgroundTasksDialog-DyjVt81B.js → BackgroundTasksDialog-D_UHm7xo.js} +1 -1
  7. package/dist/chunks/{BypassPermissionsModeDialog-CTlpvTuz.js → BypassPermissionsModeDialog-DAq-qbqC.js} +1 -1
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog--w2zWWEn.js +1 -0
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-5pipE8m8.js → ClaudeMdExternalIncludesDialog-CyvidoR3.js} +1 -1
  10. package/dist/chunks/ConsoleOAuthFlow-BXdC6j3_.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-Blg1TVut.js → DesktopHandoff-gRvy-WlW.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CUEpuocY.js → DiffDialog-CdfVTgOx.js} +1 -1
  13. package/dist/chunks/Doctor-BuiYwjAS.js +1 -0
  14. package/dist/chunks/{Doctor-DlE1Mbb9.js → Doctor-DKlHJBXq.js} +1 -1
  15. package/dist/chunks/{ExitFlow-DCIhnP5h.js → ExitFlow-rExuBL3w.js} +1 -1
  16. package/dist/chunks/{Feedback-CDTqPqsM.js → Feedback-gGpjUC_F.js} +1 -1
  17. package/dist/chunks/{Grove-D9lSG_Lh.js → Grove-CD769Wvw.js} +1 -1
  18. package/dist/chunks/Grove-ENfM8hC6.js +1 -0
  19. package/dist/chunks/{HybridTransport-8j0AviF6.js → HybridTransport-kN1jmg26.js} +1 -1
  20. package/dist/chunks/{InvalidConfigDialog-I3t-0nU3.js → InvalidConfigDialog-BpJub73a.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-BnthOxGT.js → InvalidSettingsDialog-DzOp3Ihx.js} +1 -1
  22. package/dist/chunks/{MCPConnectionManager-zdocEDgk.js → MCPConnectionManager-CaBvO7NB.js} +1 -1
  23. package/dist/chunks/{McpParsingWarnings-D0XvLirX.js → McpParsingWarnings-Cc6FWyU4.js} +1 -1
  24. package/dist/chunks/{MessageSelector-BBhCstBa.js → MessageSelector-DOB1S2-O.js} +1 -1
  25. package/dist/chunks/{Messages-Dv2VrytX.js → Messages-Clihwd2F.js} +2 -2
  26. package/dist/chunks/{Onboarding-B1WRpoBI.js → Onboarding-D00lTweB.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-BSmgq089.js → OverageCreditUpsell-B-Bf_-UX.js} +1 -1
  28. package/dist/chunks/{PluginSettings-DN9rpwc_.js → PluginSettings-DUxj_oAg.js} +1 -1
  29. package/dist/chunks/{PromptInputFooterSuggestions-3rjz6zhK.js → PromptInputFooterSuggestions-MwS_cExV.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-DgDJHZqC.js → PromptInputHelpMenu-V2dEpzhC.js} +1 -1
  31. package/dist/chunks/{QueryEngine-BnaHDZVZ.js → QueryEngine-BLcPQYq_.js} +1 -1
  32. package/dist/chunks/{REPL-CA8FEO7J.js → REPL-B_E07dnf.js} +6 -6
  33. package/dist/chunks/REPL-BhURgntS.js +1 -0
  34. package/dist/chunks/{RemoteCallout-BFzCx_Pn.js → RemoteCallout-ChCjmgw1.js} +1 -1
  35. package/dist/chunks/{RemoteSessionManager-BhUrtejX.js → RemoteSessionManager-B43isWQs.js} +1 -1
  36. package/dist/chunks/{ResumeConversation-BseKUFRI.js → ResumeConversation-DaQ9n8_C.js} +1 -1
  37. package/dist/chunks/{SSETransport-DGIytG74.js → SSETransport-h43pQVlJ.js} +1 -1
  38. package/dist/chunks/SearchExtraToolsTool-DSq7beKs.js +1 -0
  39. package/dist/chunks/{Settings-BvhG1XoW.js → Settings-CNsaWv8g.js} +2 -2
  40. package/dist/chunks/{TeleportProgress-Bens06DU.js → TeleportProgress-QtJrXSCX.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-BtLBCZUe.js → TeleportRepoMismatchDialog-D-HVj-A6.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-t50LfWyN.js → TeleportResumeWrapper-C6sbzJsJ.js} +1 -1
  43. package/dist/chunks/{ThemePicker-BTfuZZ7E.js → ThemePicker-CqPCp5Hs.js} +1 -1
  44. package/dist/chunks/{TrustDialog-CgE_pYUK.js → TrustDialog-CeVwxDlZ.js} +1 -1
  45. package/dist/chunks/{WelcomeV2-C93xQYAF.js → WelcomeV2-DNiXQ5ES.js} +1 -1
  46. package/dist/chunks/{add-dir-C3IhJYVH.js → add-dir-V3xjklnJ.js} +1 -1
  47. package/dist/chunks/{agentDisplay-Cju-aXCx.js → agentDisplay-BuiwcrQi.js} +1 -1
  48. package/dist/chunks/{agents-Bhg0CtXR.js → agents-D7um1IXM.js} +1 -1
  49. package/dist/chunks/{agents-Du3FQ82k.js → agents-ZY6IaVE7.js} +1 -1
  50. package/dist/chunks/{allErrors-DJYCAtab.js → allErrors-CHVdQ3fT.js} +1 -1
  51. package/dist/chunks/{ant-CVvy4SuO.js → ant-D66LZCap.js} +1 -1
  52. package/dist/chunks/{api-gJBnC8z3.js → api-C-rOQY-l.js} +1 -1
  53. package/dist/chunks/api-Dmn7DUgU.js +1 -0
  54. package/dist/chunks/{assistant-C_SkUDk_.js → assistant-CYF7ch7C.js} +1 -1
  55. package/dist/chunks/auth-C4Rvit2q.js +1 -0
  56. package/dist/chunks/auth-Cj7EX1eG.js +1 -0
  57. package/dist/chunks/{auth-CgEABs3i.js → auth-DAxGNCIR.js} +1 -1
  58. package/dist/chunks/{autoMode-CZyb-mMY.js → autoMode-TysBQkU_.js} +1 -1
  59. package/dist/chunks/{autonomy-DJZ25xZp.js → autonomy-CNEbT-t_.js} +1 -1
  60. package/dist/chunks/{autonomy-BpINX4jw.js → autonomy-k3QPea5z.js} +1 -1
  61. package/dist/chunks/{autonomyPanel-ssoiIOx5.js → autonomyPanel-DiztRblF.js} +1 -1
  62. package/dist/chunks/{backgroundHousekeeping-BHncba6e.js → backgroundHousekeeping-C9m4tiFi.js} +2 -2
  63. package/dist/chunks/backgroundHousekeeping-DQjzXBe0.js +1 -0
  64. package/dist/chunks/{branch-BXo5z2al.js → branch-_NBgDfrK.js} +1 -1
  65. package/dist/chunks/{bridge-CbKc1HeD.js → bridge-DpmFl8p8.js} +2 -2
  66. package/dist/chunks/{bridgeConfig-DbqUHe0H.js → bridgeConfig-DMBOO3gW.js} +1 -1
  67. package/dist/chunks/bridgeConfig-DsI5d0s7.js +1 -0
  68. package/dist/chunks/bridgeEnabled-DZzlF2d8.js +1 -0
  69. package/dist/chunks/{bridgeEnabled-CM3SaumJ.js → bridgeEnabled-FjPuA7zx.js} +1 -1
  70. package/dist/chunks/{bridgeMain-CzhBVCsN.js → bridgeMain-BppY0KW3.js} +6 -6
  71. package/dist/chunks/bridgeMain-BrY4tkF6.js +1 -0
  72. package/dist/chunks/{bridgeMessaging-lfa_v3oi.js → bridgeMessaging-N5zlzCCr.js} +1 -1
  73. package/dist/chunks/{btw-Cp0whJaJ.js → btw-BFRje_Zi.js} +1 -1
  74. package/dist/chunks/caches-BBLH8G1I.js +1 -0
  75. package/dist/chunks/{caches-CmW7idg5.js → caches-CcfPJ4_A.js} +2 -2
  76. package/dist/chunks/{ccrClient-BPXmxWHw.js → ccrClient-q2JCVCU2.js} +1 -1
  77. package/dist/chunks/{clear-DjGPxX7T.js → clear-CxY7W5Wt.js} +1 -1
  78. package/dist/chunks/client-CtVu3BLD.js +1 -0
  79. package/dist/chunks/{color-DYYBN52b.js → color-DOWhfjnA.js} +1 -1
  80. package/dist/chunks/commands-BWw1sQeH.js +1 -0
  81. package/dist/chunks/{commitAttribution-Bmzgtqc6.js → commitAttribution-CLbEIaRJ.js} +1 -1
  82. package/dist/chunks/commitAttribution-DIT_s0vY.js +1 -0
  83. package/dist/chunks/{compact-D6xqZN4Q.js → compact-CaOnQVkH.js} +1 -1
  84. package/dist/chunks/config-DmPGzNmi.js +1 -0
  85. package/dist/chunks/{config-huQaTcNb.js → config-HHTwEsWp.js} +1 -1
  86. package/dist/chunks/{context-Bh_iUj76.js → context-B2OvKo2t.js} +1 -1
  87. package/dist/chunks/context-noninteractive-BilCSCV1.js +1 -0
  88. package/dist/chunks/{context-noninteractive-Cb3EM2Oz.js → context-noninteractive-BuGxX3YL.js} +1 -1
  89. package/dist/chunks/conversation-BWXf3un9.js +1 -0
  90. package/dist/chunks/{conversation-CvCQta8e.js → conversation-awh8AwwL.js} +1 -1
  91. package/dist/chunks/{createSSHSession-B0s839mX.js → createSSHSession-C-c7I5iJ.js} +1 -1
  92. package/dist/chunks/{createSession-VMTMXOHu.js → createSession-D_fIDqgc.js} +1 -1
  93. package/dist/chunks/createSession-Hvpx3Le7.js +1 -0
  94. package/dist/chunks/{crossProjectResume-DGpgCUfk.js → crossProjectResume-_XjvSXA3.js} +1 -1
  95. package/dist/chunks/{datadog-D9rlcN12.js → datadog-Ed8emSFA.js} +1 -1
  96. package/dist/chunks/{desktop-DidI-4N5.js → desktop-D_ofPlyi.js} +1 -1
  97. package/dist/chunks/{diff-CZg5qL2n.js → diff-CUAgBDu1.js} +1 -1
  98. package/dist/chunks/doctor-CkdQ7Fv7.js +1 -0
  99. package/dist/chunks/{effort-BcvNemuq.js → effort-DCgooYMY.js} +1 -1
  100. package/dist/chunks/{entry-dA1UCfC0.js → entry-Bh0gPOAo.js} +1 -1
  101. package/dist/chunks/{envLessBridgeConfig-BFjJ8Kt4.js → envLessBridgeConfig-DJHZAlU-.js} +1 -1
  102. package/dist/chunks/envLessBridgeConfig-sxodu0xO.js +1 -0
  103. package/dist/chunks/{esm-DjGYYlQe.js → esm-B62dCLgf.js} +1 -1
  104. package/dist/chunks/{exit-COMnVxzw.js → exit-CFJR3NfE.js} +1 -1
  105. package/dist/chunks/{extra-usage-BTv_OwGN.js → extra-usage-CjaHpu8y.js} +1 -1
  106. package/dist/chunks/extra-usage-D1Y-3OWQ.js +1 -0
  107. package/dist/chunks/{extra-usage-core-RZMzaH0L.js → extra-usage-core-B6ga8Rni.js} +1 -1
  108. package/dist/chunks/{extra-usage-noninteractive-BB-BQ3kh.js → extra-usage-noninteractive-Dc9AndId.js} +1 -1
  109. package/dist/chunks/{extraUsage-CTn9FWSk.js → extraUsage-2DwLEr26.js} +1 -1
  110. package/dist/chunks/extractMemories-C3qrwpu2.js +1 -0
  111. package/dist/chunks/{fast-CNXgsvnE.js → fast-CW_NsL0x.js} +1 -1
  112. package/dist/chunks/fast-D3CPmUX4.js +1 -0
  113. package/dist/chunks/{feedback-DeJ2gvw2.js → feedback-BpRorTAC.js} +1 -1
  114. package/dist/chunks/{firstPartyEventLogger-CQdJn3LV.js → firstPartyEventLogger-CuUiNdj8.js} +2 -2
  115. package/dist/chunks/firstPartyEventLogger-DPUQnc6J.js +1 -0
  116. package/dist/chunks/{flushGate-CJ73xcaK.js → flushGate-BltVae97.js} +1 -1
  117. package/dist/chunks/{gemini-Cn9bMXwP.js → gemini-YyIxfveQ.js} +1 -1
  118. package/dist/chunks/{generateRecap-BO9kzRon.js → generateRecap-tx4wLIkI.js} +1 -1
  119. package/dist/chunks/{generateSessionName-CGpL6ATy.js → generateSessionName-BkDigIN8.js} +1 -1
  120. package/dist/chunks/{goal-C8Qzl7_i.js → goal-DZrD4puM.js} +1 -1
  121. package/dist/chunks/{grok-CDT9P_BL.js → grok-BZf7W_hL.js} +1 -1
  122. package/dist/chunks/{grove-BGXzEyH9.js → grove-CFBPplP6.js} +1 -1
  123. package/dist/chunks/{heapdump-CFHvdSZv.js → heapdump-DWc3Z2NO.js} +1 -1
  124. package/dist/chunks/{help-DUZ7Y7Em.js → help-pap9jNUJ.js} +1 -1
  125. package/dist/chunks/{hooks-RHwUCXcT.js → hooks-Bmat0L6A.js} +1 -1
  126. package/dist/chunks/hooks-cCAzfabs.js +1 -0
  127. package/dist/chunks/inboundAttachments-DZgSqDwY.js +1 -0
  128. package/dist/chunks/{inboundAttachments-Cfl4_n0S.js → inboundAttachments-DkfNHtF9.js} +1 -1
  129. package/dist/chunks/{initReplBridge-GH3-LHF4.js → initReplBridge-myzllvlk.js} +1 -1
  130. package/dist/chunks/{install-OkuNmjmB.js → install-D4jmHjmk.js} +1 -1
  131. package/dist/chunks/{instrumentation-hrXeo-G4.js → instrumentation-Nqgm1SMw.js} +3 -3
  132. package/dist/chunks/{job-DjmIpwJl.js → job-CT9bcgPb.js} +1 -1
  133. package/dist/chunks/{keybindings-B8U17bhs.js → keybindings-DETOn3qJ.js} +1 -1
  134. package/dist/chunks/{launchAgentsPlatform-DnxH2SAn.js → launchAgentsPlatform-CuRQgd2Q.js} +1 -1
  135. package/dist/chunks/{launchLocalMemory-CgXtGng1.js → launchLocalMemory-CRMqifzn.js} +1 -1
  136. package/dist/chunks/{launchLocalVault-Bs6Km3Ua.js → launchLocalVault-DlKX_oDE.js} +1 -1
  137. package/dist/chunks/{launchMemoryStores-DxVAIJuB.js → launchMemoryStores-CN0ecWpP.js} +1 -1
  138. package/dist/chunks/{launchOnboarding-Cn0t_o2k.js → launchOnboarding-DTdUA_wE.js} +1 -1
  139. package/dist/chunks/{launchSchedule-Chwr3Nzd.js → launchSchedule-psiSLmTA.js} +1 -1
  140. package/dist/chunks/{launchSkillStore-6zxJfWVU.js → launchSkillStore-CQQ00Ads.js} +1 -1
  141. package/dist/chunks/{launchTeleport-Ba_Hj13c.js → launchTeleport-CXFRPVMR.js} +1 -1
  142. package/dist/chunks/{launchVault-hGVrHy33.js → launchVault-Dn6jq0Rc.js} +1 -1
  143. package/dist/chunks/{loadAgentsDir-DrDu5yYy.js → loadAgentsDir-BURvZNN6.js} +38 -38
  144. package/dist/chunks/loadAgentsDir-Db9UTm45.js +1 -0
  145. package/dist/chunks/{loadPluginHooks-s7bvGtns.js → loadPluginHooks-C9A9oS-w.js} +1 -1
  146. package/dist/chunks/{localSearch-_bQhk9W6.js → localSearch-D2Rs8wQP.js} +1 -1
  147. package/dist/chunks/localSearch-hBh1ATr2.js +1 -0
  148. package/dist/chunks/{logoV2Utils-CoC4nheD.js → logoV2Utils-DN9nzdX-.js} +1 -1
  149. package/dist/chunks/{magicDocs-kMjYpjCA.js → magicDocs-DIeTcwAA.js} +1 -1
  150. package/dist/chunks/{main-C_rVSWfm.js → main-CI54PZrG.js} +14 -14
  151. package/dist/chunks/{mappers-D0CNXG32.js → mappers-Q_Z3Kjo-.js} +1 -1
  152. package/dist/chunks/{mcp-1ZuFesM9.js → mcp-CtbhGaLC.js} +1 -1
  153. package/dist/chunks/{mcp-CKvGBEjz.js → mcp-DMacvhqZ.js} +1 -1
  154. package/dist/chunks/{mcp-DtxIl6aN.js → mcp-RvwPC7FB.js} +2 -2
  155. package/dist/chunks/{memory-DE2jtkd_.js → memory-BPN8gW7n.js} +1 -1
  156. package/dist/chunks/{mode-B4WIxCMW.js → mode-Jl_Boaym.js} +1 -1
  157. package/dist/chunks/{model-fi472PRc.js → model-BIVmcl_N.js} +1 -1
  158. package/dist/chunks/{model-j9GNZDFr.js → model-CWBwPvTH.js} +1 -1
  159. package/dist/chunks/model-DlVpqR0P.js +1 -0
  160. package/dist/chunks/{nativeInstaller-DktvrWRd.js → nativeInstaller-8arnRiUO.js} +1 -1
  161. package/dist/chunks/{onChangeAppState-CGVeNkt7.js → onChangeAppState-DBantDJ6.js} +1 -1
  162. package/dist/chunks/{openai-BSVjSJiF.js → openai-yin1iDG8.js} +1 -1
  163. package/dist/chunks/{overageCreditGrant-BVxlYgeU.js → overageCreditGrant-CN_sVURL.js} +1 -1
  164. package/dist/chunks/{panelCall-Cp6fpQeL.js → panelCall-CPKC6VR5.js} +1 -1
  165. package/dist/chunks/{partition-RjCtgt9J.js → partition-CW0BJ881.js} +1 -1
  166. package/dist/chunks/{passes-ByTLy6pj.js → passes-DOm9ukdK.js} +1 -1
  167. package/dist/chunks/{permissions-B3df_htx.js → permissions-CxDJ__l6.js} +1 -1
  168. package/dist/chunks/{pidLock-CdNZ0Wfg.js → pidLock-C69HNTTb.js} +2 -2
  169. package/dist/chunks/{plan-BxTA-b4l.js → plan-B0rEs32a.js} +1 -1
  170. package/dist/chunks/{plugin-DOpl5e1t.js → plugin-BSEMgcGu.js} +1 -1
  171. package/dist/chunks/{pluginAutoupdate-L09CQ-ph.js → pluginAutoupdate-CTByPD8J.js} +1 -1
  172. package/dist/chunks/{pluginBlocklist-B32eWmzn.js → pluginBlocklist-mogKaK0p.js} +1 -1
  173. package/dist/chunks/{pluginCliCommands-CDMWnO3d.js → pluginCliCommands-DQQ7C7kk.js} +1 -1
  174. package/dist/chunks/{pluginFlagging-3FQGvIfq.js → pluginFlagging-mHNff1t9.js} +1 -1
  175. package/dist/chunks/{pluginOperations-ClzXYNQe.js → pluginOperations-JEedVzfS.js} +1 -1
  176. package/dist/chunks/pluginStartupCheck-D7ts2V3p.js +1 -0
  177. package/dist/chunks/{pluginStartupCheck-BNd2QNzZ.js → pluginStartupCheck-RscVZDi4.js} +1 -1
  178. package/dist/chunks/{plugins-CcDG95Bs.js → plugins-Cr03lISA.js} +1 -1
  179. package/dist/chunks/policyLimits-DWtLyJ4n.js +1 -0
  180. package/dist/chunks/{print-Cc_QOSPF.js → print-CZUmAzmt.js} +4 -4
  181. package/dist/chunks/{privacy-settings-ChNsgGUs.js → privacy-settings-CwJ1H8Ua.js} +1 -1
  182. package/dist/chunks/{processBashCommand-Bx6_oZoE.js → processBashCommand-aKNneP2u.js} +1 -1
  183. package/dist/chunks/{processSlashCommand-AltWgIFt.js → processSlashCommand-BcPnWNxZ.js} +1 -1
  184. package/dist/chunks/prompt-CIyhCdkE.js +1 -0
  185. package/dist/chunks/{prompt-C0nU0VK3.js → prompt-DNDgGM9q.js} +1 -1
  186. package/dist/chunks/prompt-DRhjinu2.js +1 -0
  187. package/dist/chunks/{promptEditor-Cumef6hJ.js → promptEditor-DMJyosKj.js} +1 -1
  188. package/dist/chunks/{rate-limit-options-VL7S3SCx.js → rate-limit-options--Y3oF1g0.js} +1 -1
  189. package/dist/chunks/{rcDebugLog-2-1XSyFV.js → rcDebugLog-DoL1FpGJ.js} +1 -1
  190. package/dist/chunks/{reconciler-DHRE_gV2.js → reconciler-CJcSh6xo.js} +1 -1
  191. package/dist/chunks/{referral-DrebVwqx.js → referral-UKJv23_5.js} +1 -1
  192. package/dist/chunks/{refresh-pFezssA8.js → refresh-ul_i5R1a.js} +1 -1
  193. package/dist/chunks/{release-notes-D7vrFNXp.js → release-notes-CGv_6MMt.js} +1 -1
  194. package/dist/chunks/{releaseNotes-CDx2P0fb.js → releaseNotes-BKZNuDLD.js} +1 -1
  195. package/dist/chunks/{reload-plugins-CltHfg-l.js → reload-plugins-2W11dpLQ.js} +1 -1
  196. package/dist/chunks/{remote-env-SvvSuP0J.js → remote-env-D9xsoBfx.js} +1 -1
  197. package/dist/chunks/{remoteBridgeCore-BOeljn2c.js → remoteBridgeCore-asY9JAXU.js} +1 -1
  198. package/dist/chunks/{remoteManagedSettings-CaY_ZH8r.js → remoteManagedSettings-Bxo3bv1U.js} +1 -1
  199. package/dist/chunks/{rename-CbqrCCBO.js → rename-CHsHMWpO.js} +1 -1
  200. package/dist/chunks/{resume-DockJaY9.js → resume-NduOaghx.js} +1 -1
  201. package/dist/chunks/{runtimeObserver-XufSllVw.js → runtimeObserver-BXbjibFk.js} +2 -2
  202. package/dist/chunks/{runtimeObserver-DSUuYKfs.js → runtimeObserver-Bo80nWQf.js} +1 -1
  203. package/dist/chunks/sandbox-adapter-DDfVl_2V.js +1 -0
  204. package/dist/chunks/{sandbox-toggle-CZI5fuK3.js → sandbox-toggle-C-WCDRN4.js} +1 -1
  205. package/dist/chunks/searchExtraTools-BHWzsbNO.js +1 -0
  206. package/dist/chunks/{session-B-Z3DU9o.js → session-pDd13-wE.js} +1 -1
  207. package/dist/chunks/{sessionDiscovery-C3pMZkBM.js → sessionDiscovery-CSUnpsCy.js} +1 -1
  208. package/dist/chunks/sessionFileAccessHooks-BZvxeufx.js +1 -0
  209. package/dist/chunks/{sessionMemory-CqRpgwtU.js → sessionMemory-CAmpw2yb.js} +1 -1
  210. package/dist/chunks/sessionMemory-DT0IkiA1.js +1 -0
  211. package/dist/chunks/sessionMemoryUtils-B4kGNH4j.js +1 -0
  212. package/dist/chunks/{sessionObserver-B_09FQKV.js → sessionObserver-Ur7PqKl_.js} +1 -1
  213. package/dist/chunks/sessionObserver-oIkwTidC.js +1 -0
  214. package/dist/chunks/sessionStorage-DqARUj0K.js +1 -0
  215. package/dist/chunks/{sessionTitle-CmLWNFuX.js → sessionTitle-pWMaI79N.js} +1 -1
  216. package/dist/chunks/{sessionTracing-lArOaj9u.js → sessionTracing-CCPRzOvy.js} +1 -1
  217. package/dist/chunks/{settingsSync-BlDk6rsM.js → settingsSync-D_4P3Esd.js} +1 -1
  218. package/dist/chunks/{setup-DdbmxSZh.js → setup-JHvhWKh9.js} +2 -2
  219. package/dist/chunks/{shadowedRuleDetection-E2wF1UjU.js → shadowedRuleDetection-Chi3afMR.js} +1 -1
  220. package/dist/chunks/{sideQuestion-BjHCLSR9.js → sideQuestion-D03MXdE2.js} +1 -1
  221. package/dist/chunks/{sinks-Cb--pqr-.js → sinks-B4_pw0Gb.js} +2 -2
  222. package/dist/chunks/sinks-Cro1Y8C2.js +1 -0
  223. package/dist/chunks/{skill-learning-B0dyBT1_.js → skill-learning-7ZQF5JvA.js} +1 -1
  224. package/dist/chunks/{skillChangeDetector-DQof8SUY.js → skillChangeDetector-uCaYrerZ.js} +1 -1
  225. package/dist/chunks/{skillGapStore-D2fqmnKx.js → skillGapStore-BND2Lq0Z.js} +1 -1
  226. package/dist/chunks/{skillGapStore-75ZYlfwi.js → skillGapStore-z3LP64O-.js} +2 -2
  227. package/dist/chunks/{skillGenerator-CwXUfM4Y.js → skillGenerator-DaNb-yKH.js} +2 -2
  228. package/dist/chunks/skillLearning-GZxYPlyl.js +1 -0
  229. package/dist/chunks/{skillLearning-CB-5fdMl.js → skillLearning-rMX1bSBa.js} +1 -1
  230. package/dist/chunks/{skillPanel-Bum7xpgo.js → skillPanel-q7GPSQ6_.js} +3 -3
  231. package/dist/chunks/{skillSearchPanel-LSPwZIOw.js → skillSearchPanel-oj8gy1ZL.js} +2 -2
  232. package/dist/chunks/{skills-G8WBeffd.js → skills-QqbeFP0s.js} +1 -1
  233. package/dist/chunks/{status-i5beKggW.js → status-BEIsLmfj.js} +1 -1
  234. package/dist/chunks/{status-ClSsvm1N.js → status-DW3Z_7xa.js} +1 -1
  235. package/dist/chunks/{statusNoticeHelpers-BK-54uGY.js → statusNoticeHelpers-CaHS8xig.js} +1 -1
  236. package/dist/chunks/{tag-DYYq4H_i.js → tag-CRg93Die.js} +1 -1
  237. package/dist/chunks/{tasks-BySzm_YJ.js → tasks-BEohK1ij.js} +1 -1
  238. package/dist/chunks/{teleport-dxtBcM01.js → teleport-4Srg5vcP.js} +1 -1
  239. package/dist/chunks/{templateJobs-CT5VxeRr.js → templateJobs-DYP1fjYU.js} +1 -1
  240. package/dist/chunks/{theme-CVTVsRwt.js → theme-kNL4kl_3.js} +1 -1
  241. package/dist/chunks/{thinkback-CXsRbDYN.js → thinkback-gV-sKkMM.js} +1 -1
  242. package/dist/chunks/thinkback-hc5eJ9ul.js +1 -0
  243. package/dist/chunks/{thinkback-play-BhfCaIye.js → thinkback-play-BpWMqbgJ.js} +1 -1
  244. package/dist/chunks/{toolEventObserver-DdhPsAs1.js → toolEventObserver-C98uraqD.js} +1 -1
  245. package/dist/chunks/{toolEventObserver--4fqXxQZ.js → toolEventObserver-ar5NDa0M.js} +1 -1
  246. package/dist/chunks/{toolPool-DvHECcbN.js → toolPool-CNYKDRq5.js} +1 -1
  247. package/dist/chunks/trustedDevice-0dehm9qz.js +1 -0
  248. package/dist/chunks/{trustedDevice-DvpN4J1F.js → trustedDevice-BBKUhCCL.js} +1 -1
  249. package/dist/chunks/{ultrareviewCommand-i3PfFKly.js → ultrareviewCommand-yXlFsMnv.js} +1 -1
  250. package/dist/chunks/{undercover-Q24TWRw0.js → undercover-BTIRVF1t.js} +1 -1
  251. package/dist/chunks/undercover-CG_269xD.js +1 -0
  252. package/dist/chunks/{updateCCB-CEXA6dax.js → updateCCB-B2xAJ4Nr.js} +1 -1
  253. package/dist/chunks/upgrade-J7lKLkD2.js +1 -0
  254. package/dist/chunks/{upgrade-7OrBbrzS.js → upgrade-yNl7EO4e.js} +1 -1
  255. package/dist/chunks/{upload-B-lNHpWe.js → upload-BWVIHmMB.js} +1 -1
  256. package/dist/chunks/{usage-CZdPfUqP.js → usage-B2PbCUMi.js} +1 -1
  257. package/dist/chunks/usage-Ck8Cu45g.js +1 -0
  258. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-CzFtdlnD.js → useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js} +1 -1
  259. package/dist/chunks/useMainLoopModel-CO4yBjRM.js +1 -0
  260. package/dist/chunks/{useManagePlugins-BkK1zydO.js → useManagePlugins-BzFKIDrD.js} +1 -1
  261. package/dist/chunks/{useMergedTools-DMGRA1ga.js → useMergedTools-CRLWSGDl.js} +1 -1
  262. package/dist/chunks/{useSearchInput-D5VU9IDU.js → useSearchInput-BzGq4t7t.js} +1 -1
  263. package/dist/chunks/{useSettingsErrors-B5PSF1va.js → useSettingsErrors-CSemUjj1.js} +1 -1
  264. package/dist/chunks/{util-CNa1ib_4.js → util-BnReK81E.js} +1 -1
  265. package/dist/chunks/{validatePlugin-Dw-RGCrm.js → validatePlugin-D6sPqea1.js} +1 -1
  266. package/dist/chunks/{workerRegistry-B2QD2sKq.js → workerRegistry-CUXbNyL9.js} +1 -1
  267. package/dist/chunks/worktree-89ttIVxH.js +1 -0
  268. package/dist/cli.js +1 -1
  269. package/package.json +2 -6
  270. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +0 -1
  271. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +0 -1
  272. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +0 -1
  273. package/dist/chunks/Doctor-B540I-gq.js +0 -1
  274. package/dist/chunks/Grove-DLYXL8hv.js +0 -1
  275. package/dist/chunks/REPL-B3RbzeV7.js +0 -1
  276. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +0 -1
  277. package/dist/chunks/api-CI8HXREw.js +0 -1
  278. package/dist/chunks/auth-B9V3i5oZ.js +0 -1
  279. package/dist/chunks/auth-fSFfSKy_.js +0 -1
  280. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +0 -1
  281. package/dist/chunks/bridgeConfig-CLHy-BiF.js +0 -1
  282. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +0 -1
  283. package/dist/chunks/bridgeMain-BESKzpm0.js +0 -1
  284. package/dist/chunks/caches-CpqTC0Lb.js +0 -1
  285. package/dist/chunks/client-DPUvQ6Rf.js +0 -1
  286. package/dist/chunks/commands-D7l3P1k9.js +0 -1
  287. package/dist/chunks/commitAttribution-B7NUPJ8E.js +0 -1
  288. package/dist/chunks/config-qLaiAn7z.js +0 -1
  289. package/dist/chunks/context-noninteractive-CNot6jbs.js +0 -1
  290. package/dist/chunks/conversation-CSpwF3Ha.js +0 -1
  291. package/dist/chunks/createSession-GNSNbUbN.js +0 -1
  292. package/dist/chunks/doctor-CKUXGCri.js +0 -1
  293. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +0 -1
  294. package/dist/chunks/extra-usage-By33zGLT.js +0 -1
  295. package/dist/chunks/extractMemories-CXGZGe0h.js +0 -1
  296. package/dist/chunks/fast-BXzdzzXU.js +0 -1
  297. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +0 -1
  298. package/dist/chunks/hooks-fZ1r0jUF.js +0 -1
  299. package/dist/chunks/inboundAttachments-YMxf4fmR.js +0 -1
  300. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +0 -1
  301. package/dist/chunks/localSearch-CebU5BA9.js +0 -1
  302. package/dist/chunks/model-C4RHNhDQ.js +0 -1
  303. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +0 -1
  304. package/dist/chunks/policyLimits-Bwi9VqDF.js +0 -1
  305. package/dist/chunks/prompt-CYx145pp.js +0 -1
  306. package/dist/chunks/prompt-DH3lKFag.js +0 -1
  307. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +0 -1
  308. package/dist/chunks/searchExtraTools-iQfI39wB.js +0 -1
  309. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +0 -1
  310. package/dist/chunks/sessionMemory-D_HQmhj7.js +0 -1
  311. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +0 -1
  312. package/dist/chunks/sessionObserver-B400YG3s.js +0 -1
  313. package/dist/chunks/sessionStorage-DRnvtrpU.js +0 -1
  314. package/dist/chunks/sinks-DbwDBd-E.js +0 -1
  315. package/dist/chunks/skillLearning-CSY5R5Jn.js +0 -1
  316. package/dist/chunks/thinkback-B-GpXG9U.js +0 -1
  317. package/dist/chunks/trustedDevice-e6iF1X7C.js +0 -1
  318. package/dist/chunks/undercover-CPvoDtJ1.js +0 -1
  319. package/dist/chunks/upgrade-uR7SIVtx.js +0 -1
  320. package/dist/chunks/usage-7jOeIVv9.js +0 -1
  321. package/dist/chunks/useMainLoopModel-DegH12LZ.js +0 -1
  322. package/dist/chunks/worktree-D38cJ23W.js +0 -1
@@ -0,0 +1 @@
1
+ import{t as e}from"./REPL-B_E07dnf.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{_x as s,vx as c}from"./loadAgentsDir-DrDu5yYy.js";import{b as l,c as u,g as d}from"./config-DiT2Z8dY.js";import{Vt as f,kt as p}from"./model-fi472PRc.js";import{i as m,r as h}from"./bridgeEnabled-CM3SaumJ.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{_x as s,vx as c}from"./loadAgentsDir-BURvZNN6.js";import{b as l,c as u,g as d}from"./config-DiT2Z8dY.js";import{Vt as f,kt as p}from"./model-BIVmcl_N.js";import{i as m,r as h}from"./bridgeEnabled-FjPuA7zx.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,2 +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 d}from"./jsx-runtime-Bb4Xn-E0.js";import{$D as te,AS as f,Ag as ne,As as p,Cb as m,DO as h,Es as g,Fg as _,Fl as re,Ig as ie,Il as ae,MO as oe,ND as se,Ng as ce,Nr as le,Og as ue,PD as v,PO as de,Pg as fe,Tg as pe,Us as me,Vs as he,ZD as y,_x as ge,fr as _e,jS as ve,jr as ye,kb as be,vx as xe,xg as Se}from"./loadAgentsDir-DrDu5yYy.js";import{n as Ce,t as b}from"./cwd-CYmmnQVS.js";import{C as x,F as S,S as C,a as w,l as T,w as E,z as D}from"./debug-BrXObCdR.js";import{Jt as O,Zt as k,c as A,f as j,g as we,n as M}from"./settings-DfWP5y6X.js";import{b as N,c as P,g as F,o as I,y as Te}from"./config-DiT2Z8dY.js";import{_ as L,d as Ee,g as De,h as Oe}from"./git-Do0wJvux.js";import{n as R,r as ke}from"./execFileNoThrow-D244NytW.js";import{o as z,s as B}from"./log-BMCygSzM.js";import{i as V,o as Ae}from"./platform-BrYefG_2.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-fi472PRc.js";import{c as Ve,h as He,l as Ue,m as U,s as We}from"./proxy-CRN7jYIi.js";import{n as Ge,o as Ke}from"./fileStateCache-DDW5toIs.js";import{d as qe,o as Je}from"./api-gJBnC8z3.js";import{c as Ye,u as Xe}from"./firstPartyEventLogger-CQdJn3LV.js";import{a as Ze,r as Qe,s as $e,t as et}from"./referral-DrebVwqx.js";import{c as tt,i as nt}from"./terminalSetup-BNs9nLbT.js";import{n as rt,t as it}from"./PermissionDialog-0ya1CU5k.js";import{n as at,r as ot,t as st}from"./overageCreditGrant-BVxlYgeU.js";import{i as ct,o as lt}from"./OverageCreditUpsell-BSmgq089.js";import{n as ut,t as dt}from"./DesktopHandoff-Blg1TVut.js";import{randomUUID as ft}from"crypto";n(),se(),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(`
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 d}from"./jsx-runtime-Bb4Xn-E0.js";import{$D as te,AS as f,Ag as ne,As as p,Cb as m,DO as h,Es as g,Fg as _,Fl as re,Ig as ie,Il as ae,MO as oe,ND as se,Ng as ce,Nr as le,Og as ue,PD as v,PO as de,Pg as fe,Tg as pe,Us as me,Vs as he,ZD as y,_x as ge,fr as _e,jS as ve,jr as ye,kb as be,vx as xe,xg as Se}from"./loadAgentsDir-BURvZNN6.js";import{n as Ce,t as b}from"./cwd-CYmmnQVS.js";import{C as x,F as S,S as C,a as w,l as T,w as E,z as D}from"./debug-BrXObCdR.js";import{Jt as O,Zt as k,c as A,f as j,g as we,n as M}from"./settings-DfWP5y6X.js";import{b as N,c as P,g as F,o as I,y as Te}from"./config-DiT2Z8dY.js";import{_ as L,d as Ee,g as De,h as Oe}from"./git-Do0wJvux.js";import{n as R,r as ke}from"./execFileNoThrow-D244NytW.js";import{o as z,s as B}from"./log-BMCygSzM.js";import{i as V,o as Ae}from"./platform-BrYefG_2.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-BIVmcl_N.js";import{c as Ve,h as He,l as Ue,m as U,s as We}from"./proxy-CRN7jYIi.js";import{n as Ge,o as Ke}from"./fileStateCache-DDW5toIs.js";import{d as qe,o as Je}from"./api-C-rOQY-l.js";import{c as Ye,u as Xe}from"./firstPartyEventLogger-CuUiNdj8.js";import{a as Ze,r as Qe,s as $e,t as et}from"./referral-UKJv23_5.js";import{c as tt,i as nt}from"./terminalSetup-BNs9nLbT.js";import{n as rt,t as it}from"./PermissionDialog-0ya1CU5k.js";import{n as at,r as ot,t as st}from"./overageCreditGrant-CN_sVURL.js";import{i as ct,o as lt}from"./OverageCreditUpsell-B-Bf_-UX.js";import{n as ut,t as dt}from"./DesktopHandoff-gRvy-WlW.js";import{randomUUID as ft}from"crypto";n(),se(),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
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?v(e.exampleFiles):`<filepath>`;return`Try "${v([`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(),D(),C(),w(),Ae(),Pe(),we(),Fe(),nt(),be(),ae(),ye();var W=e(c(),1);u(),je(),F(),xe(),ut(),rt();var G=d(),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)(ge,{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(),oe(),te(),Ke(),Je(),ve(),ue(),he(),g(),$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=y in await me()),J}async function Y(e,t,n){if(!await Ot()||p(`${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 ${f(`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 T(`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()=>!_e()&&await re()>=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(!fe()||V()!==`macos`)return!1;switch(O.terminal){case`vscode`:return!await _();case`cursor`:return!await ne();case`windsurf`:return!await ie();default:return!1}}},{id:`ide-upsell-external-terminal`,content:async()=>`Connect Claude to your IDE · /ide`,cooldownSessions:4,async isRelevant(){return ce()||(await pe()).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()=>!m()},{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()=>m()},{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()=>le()&&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 ${f(`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 ${f(`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 ${f(`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@${y}`)}`,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@${y}`)}`,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()||!de(Be())||A(`policySettings`)?.effortLevel!==void 0||h()!==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]}w(),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`){T(`[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}`;T(`[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`,()=>{T(`[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=>{T(`[SessionsWebSocket] Closed: code=${e.code} reason=${e.reason}`),this.handleClose(e.code)}),n.addEventListener(`pong`,()=>{T(`[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`,()=>{T(`[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)=>{T(`[SessionsWebSocket] Closed: code=${e} reason=${t.toString()}`),this.handleClose(e)}),r.on(`pong`,()=>{T(`[SessionsWebSocket] Pong received`)})}}handleMessage(e){try{let t=x(e);Pt(t)?this.callbacks.onMessage(t):T(`[SessionsWebSocket] Ignoring message type: ${typeof t==`object`&&t&&`type`in t?String(t.type):`unknown`}`)}catch(e){B(Error(`[SessionsWebSocket] Failed to parse message: ${S(e)}`))}}handleClose(e){if(this.stopPingInterval(),this.state===`closed`)return;this.ws=null;let t=this.state;if(this.state=`closed`,Nt.has(e)){T(`[SessionsWebSocket] Permanent close code ${e}, not reconnecting`),this.callbacks.onClose?.();return}if(e===4001){if(this.sessionNotFoundRetries++,this.sessionNotFoundRetries>$){T(`[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}`)):(T(`[SessionsWebSocket] Not reconnecting`),this.callbacks.onClose?.())}scheduleReconnect(e,t){this.callbacks.onReconnecting?.(),T(`[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}T(`[SessionsWebSocket] Sending control response`),this.ws.send(E(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};T(`[SessionsWebSocket] Sending control request: ${e.subtype}`),this.ws.send(E(t))}isConnected(){return this.state===`connected`}close(){T(`[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(){T(`[SessionsWebSocket] Force reconnecting`),this.reconnectAttempts=0,this.sessionNotFoundRetries=0,this.close(),this.reconnectTimer=setTimeout(()=>{this.reconnectTimer=null,this.connect()},500)}};w(),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(){T(`[RemoteSessionManager] Connecting to session ${this.config.sessionId}`);let e={onMessage:e=>this.handleMessage(e),onConnected:()=>{T(`[RemoteSessionManager] Connected`),this.callbacks.onConnected?.()},onClose:()=>{T(`[RemoteSessionManager] Disconnected`),this.callbacks.onDisconnected?.()},onReconnecting:()=>{T(`[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);T(`[RemoteSessionManager] Permission request cancelled: ${t}`),this.pendingPermissionRequests.delete(t),this.callbacks.onPermissionCancelled?.(t,n?.tool_use_id);return}if(e.type===`control_response`){T(`[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`)T(`[RemoteSessionManager] Permission request for tool: ${n.tool_name}`),this.pendingPermissionRequests.set(t,n),this.callbacks.onPermissionRequest(n,t);else{T(`[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){T(`[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}}}};T(`[RemoteSessionManager] Sending permission response: ${t.behavior}`),this.websocket?.sendControlResponse(n)}isConnected(){return this.websocket?.isConnected()??!1}cancelSession(){T(`[RemoteSessionManager] Sending interrupt signal`),this.websocket?.sendControlRequest({subtype:`interrupt`})}getSessionId(){return this.config.sessionId}disconnect(){T(`[RemoteSessionManager] Disconnecting`),this.websocket?.close(),this.websocket=null,this.pendingPermissionRequests.clear()}reconnect(){T(`[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-ix0xIunV.js";import{HC as ne,Hr as re,Il as u,JS as ie,Jn as ae,Ky as d,Lb as f,Nr as oe,UC as p,Vl as se,XS as ce,ar as le,fi as ue,jr as m,lC as h,nd as de,op as g,pi as fe,qS as _,qr as v,qy as y,rd as b,sp as x,ti as S,zb as C}from"./loadAgentsDir-DrDu5yYy.js";import{o as w,s as T}from"./log-BMCygSzM.js";import{n as E,r as D}from"./analytics-BotDBGh0.js";import{u as O}from"./referral-DrebVwqx.js";import{r as pe}from"./asciicast-CbAjUHT_.js";import{a as me,n as k,s as A}from"./skillChangeDetector-DQof8SUY.js";import{a as j,i as M,n as N,o as P,r as F,t as I}from"./crossProjectResume-DGpgCUfk.js";import{t as L}from"./REPL-CA8FEO7J.js";import{dirname as R}from"path";var z=t(o(),1);h(),l(),P(),C(),g(),s(),O(),E(),_(),p(),M(),u(),d(),N(),w(),m();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:u,autoConnectIdeFlag:d,strictMcpConfig:p=!1,systemPrompt:m,appendSystemPrompt:h,initialSearchQuery:g,disableSlashCommands:_=!1,forkSession:C,taskListId:w,filterByPr:E,thinkingConfig:O,onTurnComplete:M}){let{rows:N}=ee(),P=ie(e=>e.agentDefinitions),V=ce(),[U,W]=z.useState([]),[_e,G]=z.useState(!0),[ve,ye]=z.useState(!1),[K,be]=z.useState(!1),[q,xe]=z.useState(null),[J,Se]=z.useState(null),Y=z.useRef(null),X=z.useRef(0),Z=z.useMemo(()=>{let e=U.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},[U,E]),Ce=oe();z.useEffect(()=>{v(i).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{T(e),G(!1)})},[i]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||le(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}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=z.useCallback(e=>{G(!0),(e?re():v(i)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{T(e)}).finally(()=>{G(!1)})},[i]),we=z.useCallback(()=>{let e=!K;be(e),$(e)},[K,$]);function Te(){process.exit(1)}async function Ee(t){ye(!0);let n=performance.now(),r=I(t,K,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 y(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!C?(te(ne(r.sessionId),t.fullPath?R(t.fullPath):null),await pe(),await ue(),x(r.sessionId)):C&&r.contentReplacements?.length&&await S(r.contentReplacements);let{agentDefinition:i}=me(r.agentSetting,u,P);V(e=>({...e,agent:i?.agentType}));let a=k(r.agentName,r.agentColor);if(a&&V(e=>({...e,standaloneAgentContext:a})),se(r.agentName),fe(C?{...r,worktreeSession:void 0}:r),C||(A(r.worktreeSession),r.sessionId&&ae()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(b(),e(de)),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)}),W([]),xe({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)(ge,{command:J}):q?(0,B.jsx)(L,{debug:l,commands:t,initialTools:o,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:s,dynamicMcpConfig:c,strictMcpConfig:p,systemPrompt:m,appendSystemPrompt:h,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:d,disableSlashCommands:_,taskListId:w,thinkingConfig:O,onTurnComplete:M}):_e?(0,B.jsxs)(n,{children:[(0,B.jsx)(f,{}),(0,B.jsx)(r,{children:` Loading conversations…`})]}):ve?(0,B.jsxs)(n,{children:[(0,B.jsx)(f,{}),(0,B.jsx)(r,{children:` Resuming conversation…`})]}):Z.length===0?(0,B.jsx)(H,{}):(0,B.jsx)(j,{logs:Z,maxHeight:N,onCancel:Te,onSelect:Ee,onLogsChanged:Ce?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:g,showAllProjects:K,onToggleAllProjects:we,onAgenticSearch:F})}function H(){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 ge({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{HC as ne,Hr as re,Il as u,JS as ie,Jn as ae,Ky as d,Lb as f,Nr as oe,UC as p,Vl as se,XS as ce,ar as le,fi as ue,jr as m,lC as h,nd as de,op as g,pi as fe,qS as _,qr as v,qy as y,rd as b,sp as x,ti as S,zb as C}from"./loadAgentsDir-BURvZNN6.js";import{o as w,s as T}from"./log-BMCygSzM.js";import{n as E,r as D}from"./analytics-BotDBGh0.js";import{u as O}from"./referral-UKJv23_5.js";import{r as pe}from"./asciicast-CbAjUHT_.js";import{a as me,n as k,s as A}from"./skillChangeDetector-uCaYrerZ.js";import{a as j,i as M,n as N,o as P,r as F,t as I}from"./crossProjectResume-_XjvSXA3.js";import{t as L}from"./REPL-B_E07dnf.js";import{dirname as R}from"path";var z=t(o(),1);h(),l(),P(),C(),g(),s(),O(),E(),_(),p(),M(),u(),d(),N(),w(),m();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:u,autoConnectIdeFlag:d,strictMcpConfig:p=!1,systemPrompt:m,appendSystemPrompt:h,initialSearchQuery:g,disableSlashCommands:_=!1,forkSession:C,taskListId:w,filterByPr:E,thinkingConfig:O,onTurnComplete:M}){let{rows:N}=ee(),P=ie(e=>e.agentDefinitions),V=ce(),[U,W]=z.useState([]),[_e,G]=z.useState(!0),[ve,ye]=z.useState(!1),[K,be]=z.useState(!1),[q,xe]=z.useState(null),[J,Se]=z.useState(null),Y=z.useRef(null),X=z.useRef(0),Z=z.useMemo(()=>{let e=U.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},[U,E]),Ce=oe();z.useEffect(()=>{v(i).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs),G(!1)}).catch(e=>{T(e),G(!1)})},[i]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||le(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}),W(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=z.useCallback(e=>{G(!0),(e?re():v(i)).then(e=>{Y.current=e,X.current=e.logs.length,W(e.logs)}).catch(e=>{T(e)}).finally(()=>{G(!1)})},[i]),we=z.useCallback(()=>{let e=!K;be(e),$(e)},[K,$]);function Te(){process.exit(1)}async function Ee(t){ye(!0);let n=performance.now(),r=I(t,K,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 y(t,void 0);if(!r)throw Error(`Failed to load conversation`);r.sessionId&&!C?(te(ne(r.sessionId),t.fullPath?R(t.fullPath):null),await pe(),await ue(),x(r.sessionId)):C&&r.contentReplacements?.length&&await S(r.contentReplacements);let{agentDefinition:i}=me(r.agentSetting,u,P);V(e=>({...e,agent:i?.agentType}));let a=k(r.agentName,r.agentColor);if(a&&V(e=>({...e,standaloneAgentContext:a})),se(r.agentName),fe(C?{...r,worktreeSession:void 0}:r),C||(A(r.worktreeSession),r.sessionId&&ae()),r.goal&&r.sessionId){let{hydrateGoalFromTranscript:t}=(b(),e(de)),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)}),W([]),xe({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)(ge,{command:J}):q?(0,B.jsx)(L,{debug:l,commands:t,initialTools:o,initialMessages:q.messages,initialFileHistorySnapshots:q.fileHistorySnapshots,initialContentReplacements:q.contentReplacements,initialAgentName:q.agentName,initialAgentColor:q.agentColor,mcpClients:s,dynamicMcpConfig:c,strictMcpConfig:p,systemPrompt:m,appendSystemPrompt:h,mainThreadAgentDefinition:q.mainThreadAgentDefinition,autoConnectIdeFlag:d,disableSlashCommands:_,taskListId:w,thinkingConfig:O,onTurnComplete:M}):_e?(0,B.jsxs)(n,{children:[(0,B.jsx)(f,{}),(0,B.jsx)(r,{children:` Loading conversations…`})]}):ve?(0,B.jsxs)(n,{children:[(0,B.jsx)(f,{}),(0,B.jsx)(r,{children:` Resuming conversation…`})]}):Z.length===0?(0,B.jsx)(H,{}):(0,B.jsx)(j,{logs:Z,maxHeight:N,onCancel:Te,onSelect:Ee,onLogsChanged:Ce?()=>$(K):void 0,onLoadMore:Q,initialSearchQuery:g,showAllProjects:K,onToggleAllProjects:we,onAgenticSearch:F})}function H(){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 ge({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{C as a,F as o,S as s,a as c,l,w as u,z as d}from"./debug-BrXObCdR.js";import{M as f,j as p}from"./git-Do0wJvux.js";import{lr as m,ur as h,vn as g,yn as _}from"./model-fi472PRc.js";import{E as v,O as y,n as b,t as x}from"./rcDebugLog-2-1XSyFV.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{C as a,F as o,S as s,a as c,l,w as u,z as d}from"./debug-BrXObCdR.js";import{M as f,j as p}from"./git-Do0wJvux.js";import{lr as m,ur as h,vn as g,yn as _}from"./model-BIVmcl_N.js";import{E as v,O as y,n as b,t as x}from"./rcDebugLog-DoL1FpGJ.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(),c(),x(),p(),d(),y(),g(),s(),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}`),l(`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),l(`SSETransport: SSE URL = ${e.href}`),l(`SSETransport: POST URL = ${this.postUrl}`),f(`info`,`cli_sse_transport_initialized`)}getLastSequenceNum(){return this.lastSequenceNum}async connect(){if(this.state!==`idle`&&this.state!==`reconnecting`){l(`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)),l(`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(l(`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){l(`SSETransport: No response body`),this.handleConnectionError();return}let i=Date.now()-e;l(`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;l(`SSETransport: Connection error: ${o(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){l(`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))l(`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&&(l(`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;l(`SSETransport: Stream read error: ${o(e)}`,{level:`error`}),f(`error`,`cli_sse_stream_read_error`)}finally{t.releaseLock()}this.state!==`closing`&&this.state!==`closed`&&(l(`SSETransport: Stream ended, reconnecting`),this.handleConnectionError())}handleSSEFrame(e,t){if(e!==`client_event`){l(`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){l(`SSETransport: Failed to parse client_event data: ${o(e)}`,{level:`error`});return}let r=n.payload;if(r&&typeof r==`object`&&`type`in r){let e=this.sessionId?` session=${this.sessionId}`:``;l(`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?.(u(r)+`
4
4
  `)}else l(`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),l(`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));l(`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 l(`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){l(`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()};l(`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){l(`SSETransport: POST success type=${e.type}`);return}if(l(`SSETransport: POST ${i.status} body=${u(i.data).slice(0,200)}`),i.status>=400&&i.status<500&&i.status!==429){l(`SSETransport: POST returned ${i.status} (client error), not retrying`),f(`warn`,`cli_sse_post_client_error`,{status:i.status});return}l(`SSETransport: POST returned ${i.status}, attempt ${t}/${A}`),f(`warn`,`cli_sse_post_retryable_error`,{status:i.status,attempt:t})}catch(e){l(`SSETransport: POST error: ${e.message}, attempt ${t}/${A}`),f(`warn`,`cli_sse_post_network_error`,{attempt:t})}if(t===A){l(`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{nE as e,tE as t}from"./loadAgentsDir-BURvZNN6.js";e();export{t 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 l,H as u,I as d,P as f,T as p,U as ee,Wt as te,Xn as ne,a as re,d as ie,di as m,fi as h,k as ae,n as oe,ot as se,r as ce,t as g,ui as _,x as v,y as le}from"./src-CDCSSo0U2.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{en as b,gr as ue,ht as x,qt as de}from"./state-ix0xIunV.js";import{C as S,Dg as fe,Ex as pe,F as me,FE as he,JS as C,Kx as w,LE as ge,Ng as _e,Og as ve,RE as ye,Rx as be,S as xe,Tx as T,XS as Se,YS as Ce,_x as we,af as Te,ah as E,as as Ee,gx as De,if as Oe,is as D,jr as ke,lC as O,mr as k,oh as A,op as j,os as Ae,qS as je,qx as Me,rp as Ne,v as Pe,vx as M,zE as N,zx as Fe}from"./loadAgentsDir-DrDu5yYy.js";import{n as Ie,t as Le}from"./cwd-CYmmnQVS.js";import{S as Re,w as ze}from"./debug-BrXObCdR.js";import{Ft as Be,Ht as Ve,Lt as He,Rt as Ue,c as We,g as P,n as Ge,y as F,zt as Ke}from"./settings-DfWP5y6X.js";import{a as qe,b as I,c as L,g as Je,i as Ye,m as Xe,o as Ze}from"./config-DiT2Z8dY.js";import{o as R,s as Qe}from"./log-BMCygSzM.js";import{n as $e,r as z}from"./analytics-BotDBGh0.js";import{b as et,g as tt}from"./startupProfiler-xa3NmN7Z.js";import{r as nt}from"./permissions-Cn_6f8CB.js";import{Ar as rt,It as it,J as at,K as ot,Vt as st,_ as ct,at as lt,b as ut,it as dt,kr as ft,nt as pt,q as mt,tt as B,x as ht}from"./model-fi472PRc.js";import{r as gt,t as _t}from"./poorMode-CtcqaiwD.js";import{u as vt}from"./referral-DrebVwqx.js";import{i as yt,r as bt}from"./bridgeEnabled-CM3SaumJ.js";import{a as V,c as H,d as U,i as xt,l as St,n as Ct,o as wt,r as Tt,s as Et,t as Dt,u as W}from"./status-ClSsvm1N.js";import{n as Ot,t as kt}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import{i as At,n as G,r as jt}from"./modalContext-DFjKLCB6.js";import{n as Mt,t as Nt}from"./ThemePicker-BTfuZZ7E.js";import{i as Pt,n as Ft,r as It,t as Lt}from"./extraUsage-CTn9FWSk.js";import{n as Rt,t as zt}from"./ClaudeMdExternalIncludesDialog-5pipE8m8.js";import{t as Bt}from"./SearchBox-vfLXEPed.js";import{n as Vt,t as Ht}from"./useSearchInput-D5VU9IDU.js";import{n as Ut,t as Wt}from"./usage-CZdPfUqP.js";import{a as Gt,i as Kt,t as qt}from"./OverageCreditUpsell-BSmgq089.js";function Jt(){let e=x();return[{label:`Version`,value:`0.0.3`},{label:`Session name`,value:k(e)??(0,K.jsx)(f,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Le()},...Ct(),...Dt()]}function Yt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:W(e)},...Tt(t.clients,r.options.ideInstallationStatus,n),...wt(t.clients,n),...H(),...St()]}async function Xt(){return[...await xt(),...await V(),...await Et()]}function Zt({value:e}){return Array.isArray(e)?(0,K.jsx)(d,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(f,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(f,{children:e}):e}function Qt({context:e,diagnosticsPromise:t}){let n=C(e=>e.mainLoopModel),r=C(e=>e.mcp),[i]=u(),a=en.useMemo(()=>[Jt(),Yt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=jt()?1:void 0;return(0,K.jsxs)(d,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(d,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(d,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(f,{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)(f,{dimColor:!0,children:(0,K.jsx)(T,{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)(d,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(f,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(f,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(f,{wrap:`wrap`,children:e}):e]},t))]})}var en,tn,K,nn=t((()=>{o(),en=n(h(),1),tn=n(h(),1),b(),G(),g(),je(),Ie(),ke(),U(),pe(),K=y()}));function rn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,an.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,an.jsxs)(f,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,an.jsx)(f,{dimColor:!0,children:`How would you like to handle this?`}),(0,an.jsx)(we,{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((()=>{h(),g(),De(),an=y()}));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)(()=>{Ee(Le()).then(e=>{let t=sn(e);a(t),s(!1)}).catch(()=>{let e=sn(D);a(e),s(!1)})},[]);let c=(0,ln.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(le,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(d,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(f,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(we,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var ln,q,un,dn,fn=t((()=>{h(),ln=n(h(),1),Ae(),g(),Ie(),M(),q=y(),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);te(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(f,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:s.pointer}),(0,J.jsx)(be,{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)(f,{dimColor:!0,children:`Leave empty for default (English)`})]})}var mn,J,hn=t((()=>{o(),mn=n(h(),1),g(),vt(),Fe(),J=y()}));function gn({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:ie}){let{headerFocused:m,focusHeader:h}=re(),oe=jt(),[,ce]=u(),g=ee(),[v,y]=(0,X.useState)(L()),b=Y.useRef(L()),[x,S]=(0,X.useState)(Ge()),pe=Y.useRef(Ge()),[w,ve]=(0,X.useState)(x?.outputStyle||`default`),be=Y.useRef(w),[E,Ee]=(0,X.useState)(x?.language),De=Y.useRef(E),[D,ke]=(0,X.useState)(0),[O,k]=(0,X.useState)(0),[A,j]=(0,X.useState)(!1),Ae=ne(),{rows:je}=se(),Ne=ie??Math.min(Math.floor(je*.8),30),M=Math.max(5,Ne-10),N=C(e=>e.mainLoopModel),Fe=C(e=>e.verbose),Ie=C(e=>e.thinkingEnabled),Le=C(e=>dt()?e.fastMode:!1);C(e=>e.promptSuggestionEnabled);let Re=Ue(x?.permissions?.defaultMode??`default`),ze=xe()||Pe()===`enabled`,Be=(Te(),e(Oe)).isBriefEntitled(),P=Se(),[Je,R]=(0,X.useState)({}),$e=Y.useRef(Ie),[et]=(0,X.useState)(()=>We(`localSettings`)),[tt]=(0,X.useState)(()=>We(`userSettings`)),it=Y.useRef(g),st=Ce(),[ct]=(0,X.useState)(()=>{let e=st.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}}),[ft]=(0,X.useState)(()=>de()),B=Y.useRef(!1),[vt,bt]=(0,X.useState)(!1),[V,H]=(0,X.useState)(null),{query:U,setQuery:xt,cursorOffset:St}=Vt({isActive:A&&V===null&&!m,onExit:()=>j(!1),onExitUp:h,passthroughCtrlKeys:[`c`,`d`]}),Ct=A&&!m;Y.useEffect(()=>{o?.(Ct)},[Ct,o]);let wt=fe(n.options.mcpClients),Tt=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Et=Y.use(ge(!0)),Dt=ye(Et),W=qe();function Ot(e){z(`tengu_config_model_changed`,{from_model:N,to_model:e}),P(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=ht(e)+(Ft(e,!1,ut())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function kt(e){I(t=>({...t,verbose:e})),y({...L(),verbose:e}),P(t=>({...t,verbose:e})),R(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let At=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:v.autoCompactEnabled,type:`boolean`,onChange(e){I(t=>({...t,autoCompactEnabled:e})),y({...L(),autoCompactEnabled:e}),z(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:x?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{spinnerTipsEnabled:e}),S(t=>({...t,spinnerTipsEnabled:e})),z(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:x?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{cacheWarningEnabled:e}),S(t=>({...t,cacheWarningEnabled:e})),z(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:x?.prefersReducedMotion??!1,type:`boolean`,onChange(e){F(`localSettings`,{prefersReducedMotion:e}),S(t=>({...t,prefersReducedMotion:e})),P(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),z(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ie??!0,type:`boolean`,onChange(e){P(t=>({...t,thinkingEnabled:e})),F(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),z(`tengu_thinking_toggled`,{enabled:e})}},...dt()&&pt()?[{id:`fastMode`,label:`Fast mode (${ot} only)`,value:!!Le,type:`boolean`,onChange(e){mt(),F(`userSettings`,{fastMode:e?!0:void 0}),e?(P(e=>({...e,mainLoopModel:at(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:at(),"Fast mode":`ON`}))):(P(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(_t(),e(gt)).isPoorModeActive(),type:`boolean`,onChange(t){(_t(),e(gt)).setPoorMode(t),P(e=>({...e,promptSuggestionEnabled:!t}))}},...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:v.speculationEnabled??!0,type:`boolean`,onChange(e){I(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),y({...L(),speculationEnabled:e}),z(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Tt?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:v.fileCheckpointingEnabled,type:`boolean`,onChange(e){I(t=>({...t,fileCheckpointingEnabled:e})),y({...L(),fileCheckpointingEnabled:e}),z(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Fe,type:`boolean`,onChange:kt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:v.terminalProgressBarEnabled,type:`boolean`,onChange(e){I(t=>({...t,terminalProgressBarEnabled:e})),y({...L(),terminalProgressBarEnabled:e}),z(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:v.showTurnDuration,type:`boolean`,onChange(e){I(t=>({...t,showTurnDuration:e})),y({...L(),showTurnDuration:e}),z(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Re,options:(()=>{let e=[`default`,`plan`];return[...e,...nt.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Ue(e),n=t===`auto`?t:He(t)?Ve(t):t,r=F(`userSettings`,{permissions:{...x?.permissions,defaultMode:n}});if(r.error){Qe(r.error);return}S(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),R(t=>({...t,defaultPermissionMode:e})),z(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...ze?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:x?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){F(`userSettings`,{useAutoModeDuringPlan:e}),S(t=>({...t,useAutoModeDuringPlan:e})),P(e=>{let t=me(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),R(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:v.respectGitignore,type:`boolean`,onChange(e){I(t=>({...t,respectGitignore:e})),y({...L(),respectGitignore:e}),z(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...Me()?[{id:`copyOnSelect`,label:`Copy on select`,value:v.copyOnSelect??!0,type:`boolean`,onChange(e){I(t=>({...t,copyOnSelect:e})),y({...L(),copyOnSelect:e}),z(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],W?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:x?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:g,type:`managedEnum`,onChange:ce},{id:`notifChannel`,label:`Local notifications`,value:v.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){I(t=>({...t,preferredNotifChannel:e})),y({...L(),preferredNotifChannel:e})}},{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:v.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,taskCompleteNotifEnabled:e})),y({...L(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:v.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,inputNeededNotifEnabled:e})),y({...L(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:v.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,agentPushNotifEnabled:e})),y({...L(),agentPushNotifEnabled:e})}},{id:`outputStyle`,label:`Output style`,value:w,type:`managedEnum`,onChange:()=>{}},...Be?[{id:`defaultView`,label:`What you see by default`,value:x?.defaultView===void 0?`default`:String(x.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e==="default"?void 0:e;F(`localSettings`,{defaultView:t}),S(e=>({...e,defaultView:t}));let n=t===`chat`;P(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),ue(n),R(t=>({...t,"Default view":e})),z(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:E??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:v.editorMode===`emacs`?`normal`:v.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){I(t=>({...t,editorMode:e})),y({...L(),editorMode:e}),z(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:v.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){I(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),y({...L(),prStatusFooterEnabled:e}),z(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:N===null?`Default (recommended)`:N,type:`managedEnum`,onChange:Ot},...wt?[{id:`diffTool`,label:`Diff tool`,value:v.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){I(t=>({...t,diffTool:e})),y({...L(),diffTool:e}),z(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],..._e()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:v.autoConnectIde??!1,type:`boolean`,onChange(e){I(t=>({...t,autoConnectIde:e})),y({...L(),autoConnectIde:e}),z(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],..._e()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:v.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){I(t=>({...t,autoInstallIdeExtension:e})),y({...L(),autoInstallIdeExtension:e}),z(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...yt()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:v.remoteControlAtStartup===void 0?`default`:String(v.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e==="default")I(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),y({...L(),remoteControlAtStartup:void 0});else{let t=e===`true`;I(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),y({...L(),remoteControlAtStartup:t})}let t=Xe();P(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Dt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Ze().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(f,{children:[`Use custom API key: `,(0,Z.jsx)(f,{bold:!0,children:rt(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&v.customApiKeyResponses?.approved?.includes(rt(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){I(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=rt(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}),y(L())}}]:[]],G=Y.useMemo(()=>{if(!U)return At;let e=U.toLowerCase();return At.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[At,U]);Y.useEffect(()=>{if(D>=G.length){let e=Math.max(0,G.length-1);ke(e),k(Math.max(0,e-M+1));return}k(e=>D<e?D:D>=e+M?D-M+1:e)},[G.length,D,M]);let Mt=(0,X.useCallback)(e=>{k(t=>e<t?e:e>=t+M?e-M+1:t)},[M]),Pt=(0,X.useCallback)(()=>{if(V!==null)return;let e=Object.entries(Je).map(([e,t])=>(z(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${_.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&b.current.customApiKeyResponses?.approved?.includes(rt(n))),a=!!(n&&v.customApiKeyResponses?.approved?.includes(rt(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),z(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),v.theme!==b.current.theme&&e.push(`Set theme to ${_.bold(v.theme)}`),v.preferredNotifChannel!==b.current.preferredNotifChannel&&e.push(`Set notifications to ${_.bold(v.preferredNotifChannel)}`),w!==be.current&&e.push(`Set output style to ${_.bold(w)}`),E!==De.current&&e.push(`Set response language to ${_.bold(E??`Default (English)`)}`),v.editorMode!==b.current.editorMode&&e.push(`Set editor mode to ${_.bold(v.editorMode||`emacs`)}`),v.diffTool!==b.current.diffTool&&e.push(`Set diff tool to ${_.bold(v.diffTool)}`),v.autoConnectIde!==b.current.autoConnectIde&&e.push(`${v.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),v.autoInstallIdeExtension!==b.current.autoInstallIdeExtension&&e.push(`${v.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),v.autoCompactEnabled!==b.current.autoCompactEnabled&&e.push(`${v.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),v.respectGitignore!==b.current.respectGitignore&&e.push(`${v.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),v.copyOnSelect!==b.current.copyOnSelect&&e.push(`${v.copyOnSelect?`Enabled`:`Disabled`} copy on select`),v.terminalProgressBarEnabled!==b.current.terminalProgressBarEnabled&&e.push(`${v.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),v.showStatusInTerminalTab!==b.current.showStatusInTerminalTab&&e.push(`${v.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),v.showTurnDuration!==b.current.showTurnDuration&&e.push(`${v.showTurnDuration?`Enabled`:`Disabled`} turn duration`),v.remoteControlAtStartup!==b.current.remoteControlAtStartup){let t=v.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${v.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}x?.autoUpdatesChannel!==pe.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${_.bold(x?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
- `)):t(`Config dialog dismissed`,{display:`system`})},[V,Je,v,N,w,E,x?.autoUpdatesChannel,dt()?x?.fastMode:void 0,t]),Lt=(0,X.useCallback)(()=>{g!==it.current&&ce(it.current),I(()=>b.current);let e=et;F(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=tt;F(`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=ct;P(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:me(e.toolPermissionContext)})),de()!==ft&&ue(ft)},[g,ce,et,tt,ct,ft,P]);te(`confirm:no`,(0,X.useCallback)(()=>{V===null&&(B.current&&Lt(),t(`Config dialog dismissed`,{display:`system`}))},[V,Lt,t]),{context:`Settings`,isActive:V===null&&!A&&!m}),te(`settings:close`,Pt,{context:`Settings`,isActive:V===null&&!A&&!m});let Rt=(0,X.useCallback)(()=>{let e=G[D];if(!(!e||!e.onChange)){if(e.type===`boolean`){B.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===$e.current?bt(!1):n.messages.some(e=>e.type===`assistant`)&&bt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:H(`Theme`),a(!0);return;case`model`:H(`Model`),a(!0);return;case`showExternalIncludesDialog`:H(`ExternalIncludes`),a(!0);return;case`outputStyle`:H(`OutputStyle`),a(!0);return;case`language`:H(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(W){H(`EnableAutoUpdates`),a(!0);return}(x?.autoUpdatesChannel??`latest`)===`latest`?(H(`ChannelDowngrade`),a(!0)):(B.current=!0,F(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),S(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),z(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){B.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[W,G,D,x?.autoUpdatesChannel,a]),Bt=e=>{bt(!1);let t=Math.max(0,Math.min(G.length-1,D+e));ke(t),Mt(t)};return l({"select:previous":()=>{D===0?(bt(!1),j(!0),k(0)):Bt(-1)},"select:next":()=>Bt(1),"scroll:lineUp":()=>Bt(-1),"scroll:lineDown":()=>Bt(1),"select:accept":Rt,"select:previousValue":()=>Rt(),"select:nextValue":()=>Rt(),"settings:search":()=>{j(!0),xt(``)}},{context:`Settings`,isActive:V===null&&!A&&!m}),(0,Z.jsx)(d,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(V===null&&!m){if(A){if(e.key===`escape`){e.preventDefault(),U.length>0?xt(``):j(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),j(!1),ke(0),k(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),Rt();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),j(!0),xt(e.key))}},[V,m,A,U,xt,Rt]),children:V===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{onThemeSelect:e=>{B.current=!0,ce(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(d,{children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):V===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(It,{initial:N,onSelect:(e,t)=>{B.current=!0,Ot(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},showFastModeNotice:dt()?Le&&lt(N)&&pt():!1}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zt,{onDone:()=>{H(null),a(!1)},externalIncludes:he(Et)}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):V===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{initialStyle:w,onComplete:e=>{B.current=!0,ve(e??`default`),H(null),a(!1),F(`localSettings`,{outputStyle:e}),z(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pn,{initialLanguage:E,onComplete:e=>{B.current=!0,Ee(e),H(null),a(!1),F(`userSettings`,{language:e}),z(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):V===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{H(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:W?.type===`config`?(0,Z.jsx)(we,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{B.current=!0,H(null),a(!1),I(e=>({...e,autoUpdates:!0})),y({...L(),autoUpdates:!0}),F(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),S(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),z(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{children:W?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),W?.type===`env`&&(0,Z.jsxs)(f,{dimColor:!0,children:[`Unset `,W.envVar,` to re-enable auto-updates.`]})]})}):V===`ChannelDowngrade`?(0,Z.jsx)(rn,{currentVersion:`0.0.3`,onChoice:e=>{if(H(null),a(!1),e===`cancel`)return;B.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.3`),F(`userSettings`,t),S(e=>({...e,...t})),z(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(d,{flexDirection:`column`,gap:1,marginY:oe?void 0:1,children:[(0,Z.jsx)(ae,{query:U,isFocused:A&&!m,isTerminalFocused:Ae,cursorOffset:St,placeholder:`Search settings…`}),(0,Z.jsx)(d,{flexDirection:`column`,children:G.length===0?(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[`No settings match "`,U,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[O>0&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowUp,` `,O,` more above`]}),G.slice(O,O+M).map((e,t)=>{let n=O+t===D&&!m&&!A;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(d,{width:`100%`,children:[(0,Z.jsx)(d,{width:44,children:(0,Z.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(d,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()}),vt&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(f,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:vn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(_n,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:Ke(e.value)}):e.id===`autoUpdatesChannel`&&W?(0,Z.jsxs)(d,{flexDirection:`column`,children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`(`,Ye(W),`)`]})]}):(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),O+M<G.length&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowDown,` `,G.length-O-M,` more below`]})]})}),m?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):A?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(f,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(T,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(T,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(T,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(T,{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)(f,{children:[`iTerm2 `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(f,{children:[`Terminal Bell `,(0,Z.jsx)(f,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(f,{children:[`Kitty `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(f,{children:[`Ghostty `,(0,Z.jsx)(f,{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((()=>{g(),Y=n(h(),1),X=n(h(),1),vt(),o(),Je(),ft(),m(),Be(),S(),R(),$e(),bt(),Mt(),je(),Pt(),ct(),Lt(),Rt(),on(),De(),fn(),hn(),N(),pe(),G(),Bt(),ve(),P(),b(),Ae(),a(),Ht(),O(),B(),w(),Z=y(),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 ${tt(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:e}),(0,Q.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ie,{ratio:a/100,width:50,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]}),c&&(0,Q.jsx)(f,{dimColor:!0,children:c})]}):(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsxs)(f,{children:[(0,Q.jsx)(f,{bold:!0,children:e}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f,{children:` `}),(0,Q.jsxs)(f,{dimColor:!0,children:[`· `,c]})]})]}),(0,Q.jsx)(ie,{ratio:a/100,width:n,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{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}=se(),s=o-2,c=Math.min(s,80),l=Cn.useCallback(async()=>{a(!0),r(null);try{let e=await Wt();t(e)}catch(e){Qe(e);let t=e,n=t.response?.data?ze(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)(()=>{l()},[l]),te(`settings:retry`,()=>{l()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(f,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsxs)(p,{children:[(0,Q.jsx)(T,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsx)(f,{dimColor:!0,children:`Loading usage data…`}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let u=it(),ee=u===`max`||u===`team`||u===null,ne=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...ee?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,width:`100%`,children:[ne.some(({limit:e})=>e)||(0,Q.jsx)(f,{dimColor:!0,children:`/usage is only available for subscription plans.`}),ne.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)(f,{dimColor:!0,children:(0,Q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Sn({extraUsage:e,maxWidth:t}){let n=it();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return E.isEnabled()?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Extra usage not enabled · /extra-usage to enable`})]}):null;if(e.monthly_limit===null)return(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=Ne(e.used_credits/100,2),i=Ne(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(h(),1),wn=n(h(),1),A(),j(),st(),O(),g(),vt(),Ut(),et(),R(),Re(),pe(),Kt(),Q=y(),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),l=jt(),{rows:u}=At(se()),d=l?u+1:Math.max(15,Math.min(Math.floor(u*.8),30)),[f]=(0,On.useState)(()=>Xt().catch(()=>[]));return Ot(),te(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(v,{color:`permission`,children:(0,$.jsx)(ce,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:d,children:[(0,$.jsx)(oe,{title:`Status`,children:(0,$.jsx)(Qt,{context:t,diagnosticsPromise:f})},`status`),(0,$.jsx)(oe,{title:`Config`,children:(0,$.jsx)(On.Suspense,{fallback:null,children:(0,$.jsx)(gn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:d})})},`config`),(0,$.jsx)(oe,{title:`Usage`,children:(0,$.jsx)(xn,{})},`usage`)]})})}var On,$,kn=t((()=>{h(),On=n(h(),1),vt(),kt(),O(),G(),g(),nn(),yn(),En(),$=y()}));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 l,H as u,I as d,P as f,T as p,U as ee,Wt as te,Xn as ne,a as re,d as ie,di as m,fi as h,k as ae,n as oe,ot as se,r as ce,t as g,ui as _,x as v,y as le}from"./src-CDCSSo0U2.js";import{t as y}from"./jsx-runtime-Bb4Xn-E0.js";import{en as b,gr as ue,ht as x,qt as de}from"./state-ix0xIunV.js";import{C as S,Dg as fe,Ex as pe,F as me,FE as he,JS as C,Kx as w,LE as ge,Ng as _e,Og as ve,RE as ye,Rx as be,S as xe,Tx as T,XS as Se,YS as Ce,_x as we,af as Te,ah as E,as as Ee,gx as De,if as Oe,is as D,jr as ke,lC as O,mr as k,oh as A,op as j,os as Ae,qS as je,qx as Me,rp as Ne,v as Pe,vx as M,zE as N,zx as Fe}from"./loadAgentsDir-BURvZNN6.js";import{n as Ie,t as Le}from"./cwd-CYmmnQVS.js";import{S as Re,w as ze}from"./debug-BrXObCdR.js";import{Ft as Be,Ht as Ve,Lt as He,Rt as Ue,c as We,g as P,n as Ge,y as F,zt as Ke}from"./settings-DfWP5y6X.js";import{a as qe,b as I,c as L,g as Je,i as Ye,m as Xe,o as Ze}from"./config-DiT2Z8dY.js";import{o as R,s as Qe}from"./log-BMCygSzM.js";import{n as $e,r as z}from"./analytics-BotDBGh0.js";import{b as et,g as tt}from"./startupProfiler-xa3NmN7Z.js";import{r as nt}from"./permissions-Cn_6f8CB.js";import{Ar as rt,It as it,J as at,K as ot,Vt as st,_ as ct,at as lt,b as ut,it as dt,kr as ft,nt as pt,q as mt,tt as B,x as ht}from"./model-BIVmcl_N.js";import{r as gt,t as _t}from"./poorMode-CtcqaiwD.js";import{u as vt}from"./referral-UKJv23_5.js";import{i as yt,r as bt}from"./bridgeEnabled-FjPuA7zx.js";import{a as V,c as H,d as U,i as xt,l as St,n as Ct,o as wt,r as Tt,s as Et,t as Dt,u as W}from"./status-DW3Z_7xa.js";import{n as Ot,t as kt}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";import{i as At,n as G,r as jt}from"./modalContext-DFjKLCB6.js";import{n as Mt,t as Nt}from"./ThemePicker-CqPCp5Hs.js";import{i as Pt,n as Ft,r as It,t as Lt}from"./extraUsage-2DwLEr26.js";import{n as Rt,t as zt}from"./ClaudeMdExternalIncludesDialog-CyvidoR3.js";import{t as Bt}from"./SearchBox-vfLXEPed.js";import{n as Vt,t as Ht}from"./useSearchInput-BzGq4t7t.js";import{n as Ut,t as Wt}from"./usage-B2PbCUMi.js";import{a as Gt,i as Kt,t as qt}from"./OverageCreditUpsell-B-Bf_-UX.js";function Jt(){let e=x();return[{label:`Version`,value:`0.0.4`},{label:`Session name`,value:k(e)??(0,K.jsx)(f,{dimColor:!0,children:`/rename to add a name`})},{label:`Session ID`,value:e},{label:`cwd`,value:Le()},...Ct(),...Dt()]}function Yt({mainLoopModel:e,mcp:t,theme:n,context:r}){return[{label:`Model`,value:W(e)},...Tt(t.clients,r.options.ideInstallationStatus,n),...wt(t.clients,n),...H(),...St()]}async function Xt(){return[...await xt(),...await V(),...await Et()]}function Zt({value:e}){return Array.isArray(e)?(0,K.jsx)(d,{flexWrap:`wrap`,columnGap:1,flexShrink:99,children:e.map((t,n)=>(0,K.jsxs)(f,{children:[t,n<e.length-1?`,`:``]},n))}):typeof e==`string`?(0,K.jsx)(f,{children:e}):e}function Qt({context:e,diagnosticsPromise:t}){let n=C(e=>e.mainLoopModel),r=C(e=>e.mcp),[i]=u(),a=en.useMemo(()=>[Jt(),Yt({mainLoopModel:n,mcp:r,theme:i,context:e})],[n,r,i,e]),o=jt()?1:void 0;return(0,K.jsxs)(d,{flexDirection:`column`,flexGrow:o,children:[(0,K.jsxs)(d,{flexDirection:`column`,gap:1,flexGrow:o,children:[a.map((e,t)=>e.length>0&&(0,K.jsx)(d,{flexDirection:`column`,children:e.map(({label:e,value:t},n)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,flexShrink:0,children:[e!==void 0&&(0,K.jsxs)(f,{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)(f,{dimColor:!0,children:(0,K.jsx)(T,{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)(d,{flexDirection:`column`,paddingBottom:1,children:[(0,K.jsx)(f,{bold:!0,children:`System Diagnostics`}),t.map((e,t)=>(0,K.jsxs)(d,{flexDirection:`row`,gap:1,paddingX:1,children:[(0,K.jsx)(f,{color:`error`,children:s.warning}),typeof e==`string`?(0,K.jsx)(f,{wrap:`wrap`,children:e}):e]},t))]})}var en,tn,K,nn=t((()=>{o(),en=n(h(),1),tn=n(h(),1),b(),G(),g(),je(),Ie(),ke(),U(),pe(),K=y()}));function rn({currentVersion:e,onChoice:t}){function n(e){t(e)}function r(){t(`cancel`)}return(0,an.jsxs)(le,{title:`Switch to Stable Channel`,onCancel:r,color:`permission`,hideBorder:!0,hideInputGuide:!0,children:[(0,an.jsxs)(f,{children:[`The stable channel may have an older version than what you're currently running (`,e,`).`]}),(0,an.jsx)(f,{dimColor:!0,children:`How would you like to handle this?`}),(0,an.jsx)(we,{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((()=>{h(),g(),De(),an=y()}));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)(()=>{Ee(Le()).then(e=>{let t=sn(e);a(t),s(!1)}).catch(()=>{let e=sn(D);a(e),s(!1)})},[]);let c=(0,ln.useCallback)(e=>{t(e)},[t]);return(0,q.jsx)(le,{title:`Preferred output style`,onCancel:n,hideInputGuide:!r,hideBorder:!r,children:(0,q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,q.jsx)(d,{marginTop:1,children:(0,q.jsx)(f,{dimColor:!0,children:`This changes how Claude Code communicates with you`})}),o?(0,q.jsx)(f,{dimColor:!0,children:`Loading output styles…`}):(0,q.jsx)(we,{options:i,onChange:c,visibleOptionCount:10,defaultValue:e})]})})}var ln,q,un,dn,fn=t((()=>{h(),ln=n(h(),1),Ae(),g(),Ie(),M(),q=y(),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);te(`confirm:no`,n,{context:`Settings`});function c(){let e=r?.trim();t(e||void 0)}return(0,J.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,J.jsx)(f,{children:`Enter your preferred response and voice language:`}),(0,J.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(f,{children:s.pointer}),(0,J.jsx)(be,{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)(f,{dimColor:!0,children:`Leave empty for default (English)`})]})}var mn,J,hn=t((()=>{o(),mn=n(h(),1),g(),vt(),Fe(),J=y()}));function gn({onClose:t,context:n,setTabsHidden:a,onIsSearchModeChange:o,contentHeight:ie}){let{headerFocused:m,focusHeader:h}=re(),oe=jt(),[,ce]=u(),g=ee(),[v,y]=(0,X.useState)(L()),b=Y.useRef(L()),[x,S]=(0,X.useState)(Ge()),pe=Y.useRef(Ge()),[w,ve]=(0,X.useState)(x?.outputStyle||`default`),be=Y.useRef(w),[E,Ee]=(0,X.useState)(x?.language),De=Y.useRef(E),[D,ke]=(0,X.useState)(0),[O,k]=(0,X.useState)(0),[A,j]=(0,X.useState)(!1),Ae=ne(),{rows:je}=se(),Ne=ie??Math.min(Math.floor(je*.8),30),M=Math.max(5,Ne-10),N=C(e=>e.mainLoopModel),Fe=C(e=>e.verbose),Ie=C(e=>e.thinkingEnabled),Le=C(e=>dt()?e.fastMode:!1);C(e=>e.promptSuggestionEnabled);let Re=Ue(x?.permissions?.defaultMode??`default`),ze=xe()||Pe()===`enabled`,Be=(Te(),e(Oe)).isBriefEntitled(),P=Se(),[Je,R]=(0,X.useState)({}),$e=Y.useRef(Ie),[et]=(0,X.useState)(()=>We(`localSettings`)),[tt]=(0,X.useState)(()=>We(`userSettings`)),it=Y.useRef(g),st=Ce(),[ct]=(0,X.useState)(()=>{let e=st.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}}),[ft]=(0,X.useState)(()=>de()),B=Y.useRef(!1),[vt,bt]=(0,X.useState)(!1),[V,H]=(0,X.useState)(null),{query:U,setQuery:xt,cursorOffset:St}=Vt({isActive:A&&V===null&&!m,onExit:()=>j(!1),onExitUp:h,passthroughCtrlKeys:[`c`,`d`]}),Ct=A&&!m;Y.useEffect(()=>{o?.(Ct)},[Ct,o]);let wt=fe(n.options.mcpClients),Tt=!i(process.env.CLAUDE_CODE_DISABLE_FILE_CHECKPOINTING),Et=Y.use(ge(!0)),Dt=ye(Et),W=qe();function Ot(e){z(`tengu_config_model_changed`,{from_model:N,to_model:e}),P(t=>({...t,mainLoopModel:e,mainLoopModelForSession:null})),R(t=>{let n=ht(e)+(Ft(e,!1,ut())?` · Billed as extra usage`:``);if(`model`in t){let{model:e,...r}=t;return{...r,model:n}}return{...t,model:n}})}function kt(e){I(t=>({...t,verbose:e})),y({...L(),verbose:e}),P(t=>({...t,verbose:e})),R(t=>{if(`verbose`in t){let{verbose:e,...n}=t;return n}return{...t,verbose:e}})}let At=[{id:`autoCompactEnabled`,label:`Auto-compact`,value:v.autoCompactEnabled,type:`boolean`,onChange(e){I(t=>({...t,autoCompactEnabled:e})),y({...L(),autoCompactEnabled:e}),z(`tengu_auto_compact_setting_changed`,{enabled:e})}},{id:`spinnerTipsEnabled`,label:`Show tips`,value:x?.spinnerTipsEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{spinnerTipsEnabled:e}),S(t=>({...t,spinnerTipsEnabled:e})),z(`tengu_tips_setting_changed`,{enabled:e})}},{id:`cacheWarningEnabled`,label:`Cache warnings`,value:x?.cacheWarningEnabled??!0,type:`boolean`,onChange(e){F(`localSettings`,{cacheWarningEnabled:e}),S(t=>({...t,cacheWarningEnabled:e})),z(`tengu_cache_warning_setting_changed`,{enabled:e})}},{id:`prefersReducedMotion`,label:`Reduce motion`,value:x?.prefersReducedMotion??!1,type:`boolean`,onChange(e){F(`localSettings`,{prefersReducedMotion:e}),S(t=>({...t,prefersReducedMotion:e})),P(t=>({...t,settings:{...t.settings,prefersReducedMotion:e}})),z(`tengu_reduce_motion_setting_changed`,{enabled:e})}},{id:`thinkingEnabled`,label:`Thinking mode`,value:Ie??!0,type:`boolean`,onChange(e){P(t=>({...t,thinkingEnabled:e})),F(`userSettings`,{alwaysThinkingEnabled:e?void 0:!1}),z(`tengu_thinking_toggled`,{enabled:e})}},...dt()&&pt()?[{id:`fastMode`,label:`Fast mode (${ot} only)`,value:!!Le,type:`boolean`,onChange(e){mt(),F(`userSettings`,{fastMode:e?!0:void 0}),e?(P(e=>({...e,mainLoopModel:at(),mainLoopModelForSession:null,fastMode:!0})),R(e=>({...e,model:at(),"Fast mode":`ON`}))):(P(e=>({...e,fastMode:!1})),R(e=>({...e,"Fast mode":`OFF`})))}}]:[],{id:`poorMode`,label:`Poor mode (save tokens)`,value:(_t(),e(gt)).isPoorModeActive(),type:`boolean`,onChange(t){(_t(),e(gt)).setPoorMode(t),P(e=>({...e,promptSuggestionEnabled:!t}))}},...process.env.USER_TYPE===`ant`?[{id:`speculationEnabled`,label:`Speculative execution`,value:v.speculationEnabled??!0,type:`boolean`,onChange(e){I(t=>t.speculationEnabled===e?t:{...t,speculationEnabled:e}),y({...L(),speculationEnabled:e}),z(`tengu_speculation_setting_changed`,{enabled:e})}}]:[],...Tt?[{id:`fileCheckpointingEnabled`,label:`Rewind code (checkpoints)`,value:v.fileCheckpointingEnabled,type:`boolean`,onChange(e){I(t=>({...t,fileCheckpointingEnabled:e})),y({...L(),fileCheckpointingEnabled:e}),z(`tengu_file_history_snapshots_setting_changed`,{enabled:e})}}]:[],{id:`verbose`,label:`Verbose output`,value:Fe,type:`boolean`,onChange:kt},{id:`terminalProgressBarEnabled`,label:`Terminal progress bar`,value:v.terminalProgressBarEnabled,type:`boolean`,onChange(e){I(t=>({...t,terminalProgressBarEnabled:e})),y({...L(),terminalProgressBarEnabled:e}),z(`tengu_terminal_progress_bar_setting_changed`,{enabled:e})}},{id:`showTurnDuration`,label:`Show turn duration`,value:v.showTurnDuration,type:`boolean`,onChange(e){I(t=>({...t,showTurnDuration:e})),y({...L(),showTurnDuration:e}),z(`tengu_show_turn_duration_setting_changed`,{enabled:e})}},{id:`defaultPermissionMode`,label:`Default permission mode`,value:Re,options:(()=>{let e=[`default`,`plan`];return[...e,...nt.filter(t=>!e.includes(t))]})(),type:`enum`,onChange(e){let t=Ue(e),n=t===`auto`?t:He(t)?Ve(t):t,r=F(`userSettings`,{permissions:{...x?.permissions,defaultMode:n}});if(r.error){Qe(r.error);return}S(e=>({...e,permissions:{...e?.permissions,defaultMode:n}})),R(t=>({...t,defaultPermissionMode:e})),z(`tengu_config_changed`,{setting:`defaultPermissionMode`,value:e})}},...ze?[{id:`useAutoModeDuringPlan`,label:`Use auto mode during plan`,value:x?.useAutoModeDuringPlan??!0,type:`boolean`,onChange(e){F(`userSettings`,{useAutoModeDuringPlan:e}),S(t=>({...t,useAutoModeDuringPlan:e})),P(e=>{let t=me(e.toolPermissionContext);return t===e.toolPermissionContext?e:{...e,toolPermissionContext:t}}),R(t=>({...t,"Use auto mode during plan":e}))}}]:[],{id:`respectGitignore`,label:`Respect .gitignore in file picker`,value:v.respectGitignore,type:`boolean`,onChange(e){I(t=>({...t,respectGitignore:e})),y({...L(),respectGitignore:e}),z(`tengu_respect_gitignore_setting_changed`,{enabled:e})}},...Me()?[{id:`copyOnSelect`,label:`Copy on select`,value:v.copyOnSelect??!0,type:`boolean`,onChange(e){I(t=>({...t,copyOnSelect:e})),y({...L(),copyOnSelect:e}),z(`tengu_config_changed`,{setting:`copyOnSelect`,value:String(e)})}}]:[],W?{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:`disabled`,type:`managedEnum`,onChange(){}}:{id:`autoUpdatesChannel`,label:`Auto-update channel`,value:x?.autoUpdatesChannel??`latest`,type:`managedEnum`,onChange(){}},{id:`theme`,label:`Theme`,value:g,type:`managedEnum`,onChange:ce},{id:`notifChannel`,label:`Local notifications`,value:v.preferredNotifChannel,options:[`auto`,`iterm2`,`terminal_bell`,`iterm2_with_bell`,`kitty`,`ghostty`,`notifications_disabled`],type:`enum`,onChange(e){I(t=>({...t,preferredNotifChannel:e})),y({...L(),preferredNotifChannel:e})}},{id:`taskCompleteNotifEnabled`,label:`Push when idle`,value:v.taskCompleteNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,taskCompleteNotifEnabled:e})),y({...L(),taskCompleteNotifEnabled:e})}},{id:`inputNeededNotifEnabled`,label:`Push when input needed`,value:v.inputNeededNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,inputNeededNotifEnabled:e})),y({...L(),inputNeededNotifEnabled:e})}},{id:`agentPushNotifEnabled`,label:`Push when Claude decides`,value:v.agentPushNotifEnabled??!1,type:`boolean`,onChange(e){I(t=>({...t,agentPushNotifEnabled:e})),y({...L(),agentPushNotifEnabled:e})}},{id:`outputStyle`,label:`Output style`,value:w,type:`managedEnum`,onChange:()=>{}},...Be?[{id:`defaultView`,label:`What you see by default`,value:x?.defaultView===void 0?`default`:String(x.defaultView),options:[`transcript`,`chat`,`default`],type:`enum`,onChange(e){let t=e==="default"?void 0:e;F(`localSettings`,{defaultView:t}),S(e=>({...e,defaultView:t}));let n=t===`chat`;P(e=>e.isBriefOnly===n?e:{...e,isBriefOnly:n}),ue(n),R(t=>({...t,"Default view":e})),z(`tengu_default_view_setting_changed`,{value:t??`unset`})}}]:[],{id:`language`,label:`Language`,value:E??`Default (English)`,type:`managedEnum`,onChange:()=>{}},{id:`editorMode`,label:`Editor mode`,value:v.editorMode===`emacs`?`normal`:v.editorMode||`normal`,options:[`normal`,`vim`],type:`enum`,onChange(e){I(t=>({...t,editorMode:e})),y({...L(),editorMode:e}),z(`tengu_editor_mode_changed`,{mode:e,source:`config_panel`})}},{id:`prStatusFooterEnabled`,label:`Show PR status footer`,value:v.prStatusFooterEnabled??!0,type:`boolean`,onChange(e){I(t=>t.prStatusFooterEnabled===e?t:{...t,prStatusFooterEnabled:e}),y({...L(),prStatusFooterEnabled:e}),z(`tengu_pr_status_footer_setting_changed`,{enabled:e})}},{id:`model`,label:`Model`,value:N===null?`Default (recommended)`:N,type:`managedEnum`,onChange:Ot},...wt?[{id:`diffTool`,label:`Diff tool`,value:v.diffTool??`auto`,options:[`terminal`,`auto`],type:`enum`,onChange(e){I(t=>({...t,diffTool:e})),y({...L(),diffTool:e}),z(`tengu_diff_tool_changed`,{tool:e,source:`config_panel`})}}]:[],..._e()?[]:[{id:`autoConnectIde`,label:`Auto-connect to IDE (external terminal)`,value:v.autoConnectIde??!1,type:`boolean`,onChange(e){I(t=>({...t,autoConnectIde:e})),y({...L(),autoConnectIde:e}),z(`tengu_auto_connect_ide_changed`,{enabled:e,source:`config_panel`})}}],..._e()?[{id:`autoInstallIdeExtension`,label:`Auto-install IDE extension`,value:v.autoInstallIdeExtension??!0,type:`boolean`,onChange(e){I(t=>({...t,autoInstallIdeExtension:e})),y({...L(),autoInstallIdeExtension:e}),z(`tengu_auto_install_ide_extension_changed`,{enabled:e,source:`config_panel`})}}]:[],...yt()?[{id:`remoteControlAtStartup`,label:`Enable Remote Control for all sessions`,value:v.remoteControlAtStartup===void 0?`default`:String(v.remoteControlAtStartup),options:[`true`,`false`,`default`],type:`enum`,onChange(e){if(e==="default")I(e=>{if(e.remoteControlAtStartup===void 0)return e;let t={...e};return delete t.remoteControlAtStartup,t}),y({...L(),remoteControlAtStartup:void 0});else{let t=e===`true`;I(e=>e.remoteControlAtStartup===t?e:{...e,remoteControlAtStartup:t}),y({...L(),remoteControlAtStartup:t})}let t=Xe();P(e=>e.replBridgeEnabled===t&&!e.replBridgeOutboundOnly?e:{...e,replBridgeEnabled:t,replBridgeOutboundOnly:!1})}}]:[],...Dt?[{id:`showExternalIncludesDialog`,label:`External CLAUDE.md includes`,value:Ze().hasClaudeMdExternalIncludesApproved?`true`:`false`,type:`managedEnum`,onChange(){}}]:[],...process.env.ANTHROPIC_API_KEY&&!r()?[{id:`apiKey`,label:(0,Z.jsxs)(f,{children:[`Use custom API key: `,(0,Z.jsx)(f,{bold:!0,children:rt(process.env.ANTHROPIC_API_KEY)})]}),searchText:`Use custom API key`,value:!!(process.env.ANTHROPIC_API_KEY&&v.customApiKeyResponses?.approved?.includes(rt(process.env.ANTHROPIC_API_KEY))),type:`boolean`,onChange(e){I(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=rt(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}),y(L())}}]:[]],G=Y.useMemo(()=>{if(!U)return At;let e=U.toLowerCase();return At.filter(t=>t.id.toLowerCase().includes(e)?!0:(`searchText`in t?t.searchText:t.label).toLowerCase().includes(e))},[At,U]);Y.useEffect(()=>{if(D>=G.length){let e=Math.max(0,G.length-1);ke(e),k(Math.max(0,e-M+1));return}k(e=>D<e?D:D>=e+M?D-M+1:e)},[G.length,D,M]);let Mt=(0,X.useCallback)(e=>{k(t=>e<t?e:e>=t+M?e-M+1:t)},[M]),Pt=(0,X.useCallback)(()=>{if(V!==null)return;let e=Object.entries(Je).map(([e,t])=>(z(`tengu_config_changed`,{key:e,value:t}),`Set ${e} to ${_.bold(t)}`)),n=r()?void 0:process.env.ANTHROPIC_API_KEY,i=!!(n&&b.current.customApiKeyResponses?.approved?.includes(rt(n))),a=!!(n&&v.customApiKeyResponses?.approved?.includes(rt(n)));if(i!==a&&(e.push(`${a?`Enabled`:`Disabled`} custom API key`),z(`tengu_config_changed`,{key:`env.ANTHROPIC_API_KEY`,value:a})),v.theme!==b.current.theme&&e.push(`Set theme to ${_.bold(v.theme)}`),v.preferredNotifChannel!==b.current.preferredNotifChannel&&e.push(`Set notifications to ${_.bold(v.preferredNotifChannel)}`),w!==be.current&&e.push(`Set output style to ${_.bold(w)}`),E!==De.current&&e.push(`Set response language to ${_.bold(E??`Default (English)`)}`),v.editorMode!==b.current.editorMode&&e.push(`Set editor mode to ${_.bold(v.editorMode||`emacs`)}`),v.diffTool!==b.current.diffTool&&e.push(`Set diff tool to ${_.bold(v.diffTool)}`),v.autoConnectIde!==b.current.autoConnectIde&&e.push(`${v.autoConnectIde?`Enabled`:`Disabled`} auto-connect to IDE`),v.autoInstallIdeExtension!==b.current.autoInstallIdeExtension&&e.push(`${v.autoInstallIdeExtension?`Enabled`:`Disabled`} auto-install IDE extension`),v.autoCompactEnabled!==b.current.autoCompactEnabled&&e.push(`${v.autoCompactEnabled?`Enabled`:`Disabled`} auto-compact`),v.respectGitignore!==b.current.respectGitignore&&e.push(`${v.respectGitignore?`Enabled`:`Disabled`} respect .gitignore in file picker`),v.copyOnSelect!==b.current.copyOnSelect&&e.push(`${v.copyOnSelect?`Enabled`:`Disabled`} copy on select`),v.terminalProgressBarEnabled!==b.current.terminalProgressBarEnabled&&e.push(`${v.terminalProgressBarEnabled?`Enabled`:`Disabled`} terminal progress bar`),v.showStatusInTerminalTab!==b.current.showStatusInTerminalTab&&e.push(`${v.showStatusInTerminalTab?`Enabled`:`Disabled`} terminal tab status`),v.showTurnDuration!==b.current.showTurnDuration&&e.push(`${v.showTurnDuration?`Enabled`:`Disabled`} turn duration`),v.remoteControlAtStartup!==b.current.remoteControlAtStartup){let t=v.remoteControlAtStartup===void 0?`Reset Remote Control to default`:`${v.remoteControlAtStartup?`Enabled`:`Disabled`} Remote Control for all sessions`;e.push(t)}x?.autoUpdatesChannel!==pe.current?.autoUpdatesChannel&&e.push(`Set auto-update channel to ${_.bold(x?.autoUpdatesChannel??`latest`)}`),e.length>0?t(e.join(`
2
+ `)):t(`Config dialog dismissed`,{display:`system`})},[V,Je,v,N,w,E,x?.autoUpdatesChannel,dt()?x?.fastMode:void 0,t]),Lt=(0,X.useCallback)(()=>{g!==it.current&&ce(it.current),I(()=>b.current);let e=et;F(`localSettings`,{spinnerTipsEnabled:e?.spinnerTipsEnabled,prefersReducedMotion:e?.prefersReducedMotion,defaultView:e?.defaultView,outputStyle:e?.outputStyle});let t=tt;F(`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=ct;P(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:me(e.toolPermissionContext)})),de()!==ft&&ue(ft)},[g,ce,et,tt,ct,ft,P]);te(`confirm:no`,(0,X.useCallback)(()=>{V===null&&(B.current&&Lt(),t(`Config dialog dismissed`,{display:`system`}))},[V,Lt,t]),{context:`Settings`,isActive:V===null&&!A&&!m}),te(`settings:close`,Pt,{context:`Settings`,isActive:V===null&&!A&&!m});let Rt=(0,X.useCallback)(()=>{let e=G[D];if(!(!e||!e.onChange)){if(e.type===`boolean`){B.current=!0,e.onChange(!e.value),e.id===`thinkingEnabled`&&(!e.value===$e.current?bt(!1):n.messages.some(e=>e.type===`assistant`)&&bt(!0));return}if(e.id===`theme`||e.id===`model`||e.id===`showExternalIncludesDialog`||e.id===`outputStyle`||e.id===`language`)switch(e.id){case`theme`:H(`Theme`),a(!0);return;case`model`:H(`Model`),a(!0);return;case`showExternalIncludesDialog`:H(`ExternalIncludes`),a(!0);return;case`outputStyle`:H(`OutputStyle`),a(!0);return;case`language`:H(`Language`),a(!0);return}if(e.id===`autoUpdatesChannel`){if(W){H(`EnableAutoUpdates`),a(!0);return}(x?.autoUpdatesChannel??`latest`)===`latest`?(H(`ChannelDowngrade`),a(!0)):(B.current=!0,F(`userSettings`,{autoUpdatesChannel:`latest`,minimumVersion:void 0}),S(e=>({...e,autoUpdatesChannel:`latest`,minimumVersion:void 0})),z(`tengu_autoupdate_channel_changed`,{channel:`latest`}));return}if(e.type===`enum`){B.current=!0;let t=(e.options.indexOf(e.value)+1)%e.options.length;e.onChange(e.options[t]);return}}},[W,G,D,x?.autoUpdatesChannel,a]),Bt=e=>{bt(!1);let t=Math.max(0,Math.min(G.length-1,D+e));ke(t),Mt(t)};return l({"select:previous":()=>{D===0?(bt(!1),j(!0),k(0)):Bt(-1)},"select:next":()=>Bt(1),"scroll:lineUp":()=>Bt(-1),"scroll:lineDown":()=>Bt(1),"select:accept":Rt,"select:previousValue":()=>Rt(),"select:nextValue":()=>Rt(),"settings:search":()=>{j(!0),xt(``)}},{context:`Settings`,isActive:V===null&&!A&&!m}),(0,Z.jsx)(d,{flexDirection:`column`,width:`100%`,tabIndex:0,autoFocus:!0,onKeyDown:(0,X.useCallback)(e=>{if(V===null&&!m){if(A){if(e.key===`escape`){e.preventDefault(),U.length>0?xt(``):j(!1);return}(e.key===`return`||e.key===`down`||e.key===`wheeldown`)&&(e.preventDefault(),j(!1),ke(0),k(0));return}if(e.key===`left`||e.key===`right`||e.key===`tab`){e.preventDefault(),Rt();return}e.ctrl||e.meta||e.key===`j`||e.key===`k`||e.key===`/`||e.key.length===1&&e.key!==` `&&(e.preventDefault(),j(!0),xt(e.key))}},[V,m,A,U,xt,Rt]),children:V===`Theme`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(Nt,{onThemeSelect:e=>{B.current=!0,ce(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},hideEscToCancel:!0,skipExitHandling:!0}),(0,Z.jsx)(d,{children:(0,Z.jsx)(f,{dimColor:!0,italic:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`select`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})})]}):V===`Model`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(It,{initial:N,onSelect:(e,t)=>{B.current=!0,Ot(e),H(null),a(!1)},onCancel:()=>{H(null),a(!1)},showFastModeNotice:dt()?Le&&lt(N)&&pt():!1}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`ExternalIncludes`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(zt,{onDone:()=>{H(null),a(!1)},externalIncludes:he(Et)}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`disable external includes`})]})})]}):V===`OutputStyle`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(cn,{initialStyle:w,onComplete:e=>{B.current=!0,ve(e??`default`),H(null),a(!1),F(`localSettings`,{outputStyle:e}),z(`tengu_output_style_changed`,{style:e??`default`,source:`config_panel`,settings_source:`localSettings`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]})})]}):V===`Language`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(pn,{initialLanguage:E,onComplete:e=>{B.current=!0,Ee(e),H(null),a(!1),F(`userSettings`,{language:e}),z(`tengu_language_changed`,{language:e??`default`,source:`config_panel`})},onCancel:()=>{H(null),a(!1)}}),(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`Enter`,action:`confirm`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]}):V===`EnableAutoUpdates`?(0,Z.jsx)(le,{title:`Enable Auto-Updates`,onCancel:()=>{H(null),a(!1)},hideBorder:!0,hideInputGuide:!0,children:W?.type===`config`?(0,Z.jsx)(we,{options:[{label:`Enable with latest channel`,value:`latest`},{label:`Enable with stable channel`,value:`stable`}],onChange:e=>{B.current=!0,H(null),a(!1),I(e=>({...e,autoUpdates:!0})),y({...L(),autoUpdates:!0}),F(`userSettings`,{autoUpdatesChannel:e,minimumVersion:void 0}),S(t=>({...t,autoUpdatesChannel:e,minimumVersion:void 0})),z(`tengu_autoupdate_enabled`,{channel:e})}}):(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{children:W?.type===`env`?`Auto-updates are controlled by an environment variable and cannot be changed here.`:`Auto-updates are disabled in development builds.`}),W?.type===`env`&&(0,Z.jsxs)(f,{dimColor:!0,children:[`Unset `,W.envVar,` to re-enable auto-updates.`]})]})}):V===`ChannelDowngrade`?(0,Z.jsx)(rn,{currentVersion:`0.0.4`,onChoice:e=>{if(H(null),a(!1),e===`cancel`)return;B.current=!0;let t={autoUpdatesChannel:`stable`};e===`stay`&&(t.minimumVersion=`0.0.4`),F(`userSettings`,t),S(e=>({...e,...t})),z(`tengu_autoupdate_channel_changed`,{channel:`stable`,minimum_version_set:e===`stay`})}}):(0,Z.jsxs)(d,{flexDirection:`column`,gap:1,marginY:oe?void 0:1,children:[(0,Z.jsx)(ae,{query:U,isFocused:A&&!m,isTerminalFocused:Ae,cursorOffset:St,placeholder:`Search settings…`}),(0,Z.jsx)(d,{flexDirection:`column`,children:G.length===0?(0,Z.jsxs)(f,{dimColor:!0,italic:!0,children:[`No settings match "`,U,`"`]}):(0,Z.jsxs)(Z.Fragment,{children:[O>0&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowUp,` `,O,` more above`]}),G.slice(O,O+M).map((e,t)=>{let n=O+t===D&&!m&&!A;return(0,Z.jsx)(Y.Fragment,{children:(0,Z.jsxs)(d,{width:`100%`,children:[(0,Z.jsx)(d,{width:44,children:(0,Z.jsxs)(f,{color:n?`suggestion`:void 0,children:[n?s.pointer:` `,` `,e.label]})}),(0,Z.jsx)(d,{flexGrow:1,children:e.type===`boolean`?(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()}),vt&&e.id===`thinkingEnabled`&&(0,Z.jsxs)(f,{color:`warning`,children:[` `,`Changing thinking mode mid-conversation will increase latency and may reduce quality.`]})]}):e.id===`theme`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:vn[e.value.toString()]??e.value.toString()}):e.id===`notifChannel`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:(0,Z.jsx)(_n,{value:e.value.toString()})}):e.id===`defaultPermissionMode`?(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:Ke(e.value)}):e.id===`autoUpdatesChannel`&&W?(0,Z.jsxs)(d,{flexDirection:`column`,children:[(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:`disabled`}),(0,Z.jsxs)(f,{dimColor:!0,children:[`(`,Ye(W),`)`]})]}):(0,Z.jsx)(f,{color:n?`suggestion`:void 0,children:e.value.toString()})})]})},e.id)}),O+M<G.length&&(0,Z.jsxs)(f,{dimColor:!0,children:[s.arrowDown,` `,G.length-O-M,` more below`]})]})}),m?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(c,{shortcut:`←/→ tab`,action:`switch`}),(0,Z.jsx)(c,{shortcut:`↓`,action:`return`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`close`})]})}):A?(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(f,{children:`Type to filter`}),(0,Z.jsx)(c,{shortcut:`Enter/↓`,action:`select`}),(0,Z.jsx)(c,{shortcut:`↑`,action:`tabs`}),(0,Z.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`clear`})]})}):(0,Z.jsx)(f,{dimColor:!0,children:(0,Z.jsxs)(p,{children:[(0,Z.jsx)(T,{action:`select:accept`,context:`Settings`,fallback:`Space`,description:`change`}),(0,Z.jsx)(T,{action:`settings:close`,context:`Settings`,fallback:`Enter`,description:`save`}),(0,Z.jsx)(T,{action:`settings:search`,context:`Settings`,fallback:`/`,description:`search`}),(0,Z.jsx)(T,{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)(f,{children:[`iTerm2 `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 9)`})]});case`terminal_bell`:return(0,Z.jsxs)(f,{children:[`Terminal Bell `,(0,Z.jsx)(f,{dimColor:!0,children:`(\\a)`})]});case`kitty`:return(0,Z.jsxs)(f,{children:[`Kitty `,(0,Z.jsx)(f,{dimColor:!0,children:`(OSC 99)`})]});case`ghostty`:return(0,Z.jsxs)(f,{children:[`Ghostty `,(0,Z.jsx)(f,{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((()=>{g(),Y=n(h(),1),X=n(h(),1),vt(),o(),Je(),ft(),m(),Be(),S(),R(),$e(),bt(),Mt(),je(),Pt(),ct(),Lt(),Rt(),on(),De(),fn(),hn(),N(),pe(),G(),Bt(),ve(),P(),b(),Ae(),a(),Ht(),O(),B(),w(),Z=y(),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 ${tt(o,!0,r)}`),i&&(c=c?`${i} · ${c}`:i),n>=62?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:e}),(0,Q.jsxs)(d,{flexDirection:`row`,gap:1,children:[(0,Q.jsx)(ie,{ratio:a/100,width:50,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{children:s})]}),c&&(0,Q.jsx)(f,{dimColor:!0,children:c})]}):(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsxs)(f,{children:[(0,Q.jsx)(f,{bold:!0,children:e}),c&&(0,Q.jsxs)(Q.Fragment,{children:[(0,Q.jsx)(f,{children:` `}),(0,Q.jsxs)(f,{dimColor:!0,children:[`· `,c]})]})]}),(0,Q.jsx)(ie,{ratio:a/100,width:n,fillColor:`rate_limit_fill`,emptyColor:`rate_limit_empty`}),(0,Q.jsx)(f,{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}=se(),s=o-2,c=Math.min(s,80),l=Cn.useCallback(async()=>{a(!0),r(null);try{let e=await Wt();t(e)}catch(e){Qe(e);let t=e,n=t.response?.data?ze(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)(()=>{l()},[l]),te(`settings:retry`,()=>{l()},{context:`Settings`,isActive:!!n&&!i}),n)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsxs)(f,{color:`error`,children:[`Error: `,n]}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsxs)(p,{children:[(0,Q.jsx)(T,{action:`settings:retry`,context:`Settings`,fallback:`r`,description:`retry`}),(0,Q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})]})})]});if(!e)return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,children:[(0,Q.jsx)(f,{dimColor:!0,children:`Loading usage data…`}),(0,Q.jsx)(f,{dimColor:!0,children:(0,Q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]});let u=it(),ee=u===`max`||u===`team`||u===null,ne=[{title:`Current session`,limit:e.five_hour},{title:`Current week (all models)`,limit:e.seven_day},...ee?[{title:`Current week (Sonnet only)`,limit:e.seven_day_sonnet}]:[]];return(0,Q.jsxs)(d,{flexDirection:`column`,gap:1,width:`100%`,children:[ne.some(({limit:e})=>e)||(0,Q.jsx)(f,{dimColor:!0,children:`/usage is only available for subscription plans.`}),ne.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)(f,{dimColor:!0,children:(0,Q.jsx)(T,{action:`confirm:no`,context:`Settings`,fallback:`Esc`,description:`cancel`})})]})}function Sn({extraUsage:e,maxWidth:t}){let n=it();if(!(n===`pro`||n===`max`))return!1;if(!e.is_enabled)return E.isEnabled()?(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Extra usage not enabled · /extra-usage to enable`})]}):null;if(e.monthly_limit===null)return(0,Q.jsxs)(d,{flexDirection:`column`,children:[(0,Q.jsx)(f,{bold:!0,children:Tn}),(0,Q.jsx)(f,{dimColor:!0,children:`Unlimited`})]});if(typeof e.used_credits!=`number`||typeof e.utilization!=`number`)return null;let r=Ne(e.used_credits/100,2),i=Ne(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(h(),1),wn=n(h(),1),A(),j(),st(),O(),g(),vt(),Ut(),et(),R(),Re(),pe(),Kt(),Q=y(),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),l=jt(),{rows:u}=At(se()),d=l?u+1:Math.max(15,Math.min(Math.floor(u*.8),30)),[f]=(0,On.useState)(()=>Xt().catch(()=>[]));return Ot(),te(`confirm:no`,()=>{a||e(`Status dialog dismissed`,{display:`system`})},{context:`Settings`,isActive:!a&&!(r===`Config`&&s)}),(0,$.jsx)(v,{color:`permission`,children:(0,$.jsx)(ce,{color:`permission`,selectedTab:r,onTabChange:i,hidden:a,initialHeaderFocused:n!==`Config`,contentHeight:a||l?void 0:d,children:[(0,$.jsx)(oe,{title:`Status`,children:(0,$.jsx)(Qt,{context:t,diagnosticsPromise:f})},`status`),(0,$.jsx)(oe,{title:`Config`,children:(0,$.jsx)(On.Suspense,{fallback:null,children:(0,$.jsx)(gn,{context:t,onClose:e,setTabsHidden:o,onIsSearchModeChange:c,contentHeight:d})})},`config`),(0,$.jsx)(oe,{title:`Usage`,children:(0,$.jsx)(xn,{})},`usage`)]})})}var On,$,kn=t((()=>{h(),On=n(h(),1),vt(),kt(),O(),G(),g(),nn(),yn(),En(),$=y()}));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{Ay as l,Fy as u,KS as d,Ny as f,jy as p,qS as m}from"./loadAgentsDir-DrDu5yYy.js";t();var h=e(a(),1);s(),m(),p();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)(d,{children:(0,g.jsx)(r,{})}));let i=await u(t,n);n(`checking_out`);let{branchName:a,branchError:o}=await l(i.branch);return{messages:f(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{Ay as l,Fy as u,KS as d,Ny as f,jy as p,qS as m}from"./loadAgentsDir-BURvZNN6.js";t();var h=e(a(),1);s(),m(),p();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)(d,{children:(0,g.jsx)(r,{})}));let i=await u(t,n);n(`checking_out`);let{branchName:a,branchError:o}=await l(i.branch);return{messages:f(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{Lb as s,_x as c,gx as l,zb as u}from"./loadAgentsDir-DrDu5yYy.js";import{f as d,l as f}from"./file-DcZWPH2V.js";import{a as p,r as m}from"./githubRepoPathMapping-C4umZ1oC.js";var h=e(r(),1);i(),d(),l(),u();var g=o();function _({targetRepo:e,initialPaths:r,onSelectPath:i,onCancel:o}){let[l,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=l.filter(e=>e!==t);u(n),y(!1),_(`${f(t)} no longer contains the correct repository. Select another path.`)},[e,l,i,o]),x=[...l.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:l.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)(c,{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{Lb as s,_x as c,gx as l,zb as u}from"./loadAgentsDir-BURvZNN6.js";import{f as d,l as f}from"./file-DcZWPH2V.js";import{a as p,r as m}from"./githubRepoPathMapping-C4umZ1oC.js";var h=e(r(),1);i(),d(),l(),u();var g=o();function _({targetRepo:e,initialPaths:r,onSelectPath:i,onCancel:o}){let[l,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=l.filter(e=>e!==t);u(n),y(!1),_(`${f(t)} no longer contains the correct repository. Select another path.`)},[e,l,i,o]),x=[...l.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:l.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)(c,{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-ix0xIunV.js";import{Dx as p,Ex as m,Fb as h,Fy as g,Lb as _,Ox as v,Pb as y,Tx as b,_x as x,gx as S,jy as C,lC as w,zb as T}from"./loadAgentsDir-DrDu5yYy.js";import{F as E,N as D,a as O,l as k,z as A}from"./debug-BrXObCdR.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{b as N,m as P}from"./startupProfiler-xa3NmN7Z.js";import{i as F,n as I}from"./detectRepository-BPr0VWNO.js";import{n as L,o as R}from"./api-gJBnC8z3.js";import{u as z}from"./referral-DrebVwqx.js";var B=e(o(),1);d(),j(),A(),C();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 g(t.id);return f({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof D?e.message:E(e),formattedMessage:e instanceof D?e.formattedMessage:void 0,isOperationError:e instanceof D};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}w(),R(),l(),z(),p(),O(),F(),N(),m(),S(),T(),h();var H=u(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:o,isEmbedded:l=!1}){let{rows:u}=c(),[d,f]=(0,B.useState)([]),[p,m]=(0,B.useState)(null),[h,g]=(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=v(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{g(!0),C(null);let e=await I();m(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{g(!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)(y,{onComplete:F});if(h)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(_,{}),(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`,p&&(0,H.jsxs)(r,{children:[` for `,p]})]}),(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,`)`]}),p&&(0,H.jsxs)(r,{dimColor:!0,children:[` (`,p,`)`]}),`:`]}),(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)(x,{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)(b,{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)},p=()=>{M(`tengu_teleport_cancelled`,{}),t()};return a(`app:interrupt`,p,{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)(_,{}),(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:p,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{Dx as p,Ex as m,Fb as h,Fy as g,Lb as _,Ox as v,Pb as y,Tx as b,_x as x,gx as S,jy as C,lC as w,zb as T}from"./loadAgentsDir-BURvZNN6.js";import{F as E,N as D,a as O,l as k,z as A}from"./debug-BrXObCdR.js";import{n as j,r as M}from"./analytics-BotDBGh0.js";import{b as N,m as P}from"./startupProfiler-xa3NmN7Z.js";import{i as F,n as I}from"./detectRepository-BPr0VWNO.js";import{n as L,o as R}from"./api-C-rOQY-l.js";import{u as z}from"./referral-UKJv23_5.js";var B=e(o(),1);d(),j(),A(),C();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 g(t.id);return f({sessionId:t.id}),n(!1),e}catch(e){let t={message:e instanceof D?e.message:E(e),formattedMessage:e instanceof D?e.formattedMessage:void 0,isOperationError:e instanceof D};return i(t),n(!1),null}},[e]),isResuming:t,error:r,selectedSession:a,clearError:(0,B.useCallback)(()=>{i(null)},[])}}w(),R(),l(),z(),p(),O(),F(),N(),m(),S(),T(),h();var H=u(),U=`Updated`,W=` `;function G({onSelect:e,onCancel:o,isEmbedded:l=!1}){let{rows:u}=c(),[d,f]=(0,B.useState)([]),[p,m]=(0,B.useState)(null),[h,g]=(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=v(`confirm:no`,`Confirmation`,`Esc`),M=(0,B.useCallback)(async()=>{try{g(!0),C(null);let e=await I();m(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{g(!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)(y,{onComplete:F});if(h)return(0,H.jsxs)(n,{flexDirection:`column`,padding:1,children:[(0,H.jsxs)(n,{flexDirection:`row`,children:[(0,H.jsx)(_,{}),(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`,p&&(0,H.jsxs)(r,{children:[` for `,p]})]}),(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,`)`]}),p&&(0,H.jsxs)(r,{dimColor:!0,children:[` (`,p,`)`]}),`:`]}),(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)(x,{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)(b,{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)},p=()=>{M(`tengu_teleport_cancelled`,{}),t()};return a(`app:interrupt`,p,{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)(_,{}),(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:p,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{Dx as m,Gf as h,JS as g,Kf as _,Ox as v,XS as y,Xf as b,Yf as x,Zf as S,_x as C,fC as w,gx as T,kx as E,lC as D,qS as O,uC as k}from"./loadAgentsDir-DrDu5yYy.js";import{g as A,y as j}from"./settings-DfWP5y6X.js";import{u as M}from"./referral-DrebVwqx.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";function F({onThemeSelect:e,showIntroText:u=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:m=!1,skipExitHandling:_=!1,onCancel:S}){let[w]=n(),T=o(),{columns:E}=d(),D=x(),O=D===null?b(w):null,{setPreviewTheme:A,savePreview:M,cancelPreview:P}=s(),F=g(e=>e.settings.syntaxHighlightingDisabled)??!1,L=y();l(`ThemePicker`);let R=v(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(D===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)(C,{options:B,onFocus:e=>{A(e)},onChange:t=>{M(),e(t)},onCancel:_?()=>{P(),S?.()}:async()=>{P(),await k(0)},visibleOptionCount:B.length,defaultValue:T,defaultFocusValue:T})]}),(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)(h,{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:E})}),(0,I.jsxs)(i,{dimColor:!0,children:[` `,D===`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})}),!m&&(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(),D(),f(),E(),M(),m(),O(),w(),A(),T(),S(),_(),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{Dx as m,Gf as h,JS as g,Kf as _,Ox as v,XS as y,Xf as b,Yf as x,Zf as S,_x as C,fC as w,gx as T,kx as E,lC as D,qS as O,uC as k}from"./loadAgentsDir-BURvZNN6.js";import{g as A,y as j}from"./settings-DfWP5y6X.js";import{u as M}from"./referral-UKJv23_5.js";import{n as N,t as P}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";function F({onThemeSelect:e,showIntroText:u=!1,helpText:f=``,showHelpTextBelow:p=!1,hideEscToCancel:m=!1,skipExitHandling:_=!1,onCancel:S}){let[w]=n(),T=o(),{columns:E}=d(),D=x(),O=D===null?b(w):null,{setPreviewTheme:A,savePreview:M,cancelPreview:P}=s(),F=g(e=>e.settings.syntaxHighlightingDisabled)??!1,L=y();l(`ThemePicker`);let R=v(`theme:toggleSyntaxHighlighting`,`ThemePicker`,`ctrl+t`);c(`theme:toggleSyntaxHighlighting`,()=>{if(D===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)(C,{options:B,onFocus:e=>{A(e)},onChange:t=>{M(),e(t)},onCancel:_?()=>{P(),S?.()}:async()=>{P(),await k(0)},visibleOptionCount:B.length,defaultValue:T,defaultFocusValue:T})]}),(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)(h,{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:E})}),(0,I.jsxs)(i,{dimColor:!0,children:[` `,D===`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})}),!m&&(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(),D(),f(),E(),M(),m(),O(),w(),A(),T(),S(),_(),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,P as n,Wt as r,fi as i,t as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{en as s,ur as c}from"./state-ix0xIunV.js";import{G_ as l,Ow as u,U_ as d,_x as f,ba as p,dC as m,fC as h,gx as g,kw as _,xa as v}from"./loadAgentsDir-DrDu5yYy.js";import{n as y,t as b}from"./cwd-CYmmnQVS.js";import{d as x,p as S}from"./debug-BrXObCdR.js";import{c as C,g as w}from"./settings-DfWP5y6X.js";import{g as T,n as E,y as D}from"./config-DiT2Z8dY.js";import{n as O,r as k}from"./analytics-BotDBGh0.js";import{bn as A}from"./prompt-C0nU0VK3.js";import{u as j}from"./referral-DrebVwqx.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import{n as P,t as F}from"./PermissionDialog-0ya1CU5k.js";import{homedir as I}from"os";var L=e(i(),1),R=o();a(),s(),y(),S(),O(),T(),h(),j(),g(),l(),N(),P(),w(),A(),v(),_();function z(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 B(){let e=[];return z(C(`projectSettings`))&&e.push(`.claude/settings.json`),z(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(u(`projectSettings`))&&e.push(`.claude/settings.json`),V(u(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(C(`projectSettings`))&&e.push(`.claude/settings.json`),U(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(C(`projectSettings`))&&e.push(`.claude/settings.json`),G(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(C(`projectSettings`))&&e.push(`.claude/settings.json`),q(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(C(`projectSettings`))&&e.push(`.claude/settings.json`),Y(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!p.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(C(`projectSettings`))&&e.push(`.claude/settings.json`),Z(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}A();function $({onDone:e,commands:i}){let{servers:a}=d(`project`),o=Object.keys(a).length>0,s=B().length>0,l=H(),u=K().length>0,p=J().length>0,h=X().length>0,g=W().length>0,_=Q().length>0,v=i?.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,y=i?.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=l.length>0||v||y,C=E(),[w,T]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>m(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{k(`tengu_trust_dialog_shown`,{isHomeDir:I()===b(),hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:g,hasDangerousEnvVars:_})},[o,s,S,u,p,h,g,_]);function O(t){if(t===`exit`){T(1);return}let n=I()===b();k(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:g,hasDangerousEnvVars:_}),n?c(!0):D(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>T(1));return r(`confirm:no`,()=>{T(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(n,{bold:!0,children:x().cwd()}),(0,R.jsx)(n,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(n,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(f,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>O(e),onCancel:()=>O(`exit`)}),(0,R.jsx)(n,{dimColor:!0,children:A.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,A.keyName,` again to exit`]}):(0,R.jsx)(R.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{$ as TrustDialog};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,Wt as r,fi as i,t as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{en as s,ur as c}from"./state-ix0xIunV.js";import{G_ as l,Ow as u,U_ as d,_x as f,ba as p,dC as m,fC as h,gx as g,kw as _,xa as v}from"./loadAgentsDir-BURvZNN6.js";import{n as y,t as b}from"./cwd-CYmmnQVS.js";import{d as x,p as S}from"./debug-BrXObCdR.js";import{c as C,g as w}from"./settings-DfWP5y6X.js";import{g as T,n as E,y as D}from"./config-DiT2Z8dY.js";import{n as O,r as k}from"./analytics-BotDBGh0.js";import{bn as A}from"./prompt-DNDgGM9q.js";import{u as j}from"./referral-UKJv23_5.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";import{n as P,t as F}from"./PermissionDialog-0ya1CU5k.js";import{homedir as I}from"os";var L=e(i(),1),R=o();a(),s(),y(),S(),O(),T(),h(),j(),g(),l(),N(),P(),w(),A(),v(),_();function z(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 B(){let e=[];return z(C(`projectSettings`))&&e.push(`.claude/settings.json`),z(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function V(e){return e.some(e=>e.ruleBehavior===`allow`&&(e.ruleValue.toolName===`Bash`||e.ruleValue.toolName.startsWith(`Bash(`)))}function H(){let e=[];return V(u(`projectSettings`))&&e.push(`.claude/settings.json`),V(u(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function U(e){return!!e?.otelHeadersHelper}function W(){let e=[];return U(C(`projectSettings`))&&e.push(`.claude/settings.json`),U(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function G(e){return!!e?.apiKeyHelper}function K(){let e=[];return G(C(`projectSettings`))&&e.push(`.claude/settings.json`),G(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function q(e){return!!(e?.awsAuthRefresh||e?.awsCredentialExport)}function J(){let e=[];return q(C(`projectSettings`))&&e.push(`.claude/settings.json`),q(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Y(e){return!!e?.gcpAuthRefresh}function X(){let e=[];return Y(C(`projectSettings`))&&e.push(`.claude/settings.json`),Y(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}function Z(e){return e?.env?Object.keys(e.env).some(e=>!p.has(e.toUpperCase())):!1}function Q(){let e=[];return Z(C(`projectSettings`))&&e.push(`.claude/settings.json`),Z(C(`localSettings`))&&e.push(`.claude/settings.local.json`),e}A();function $({onDone:e,commands:i}){let{servers:a}=d(`project`),o=Object.keys(a).length>0,s=B().length>0,l=H(),u=K().length>0,p=J().length>0,h=X().length>0,g=W().length>0,_=Q().length>0,v=i?.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,y=i?.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=l.length>0||v||y,C=E(),[w,T]=L.useState(null);L.useEffect(()=>{if(w!==null){let e=w,t=setTimeout(()=>m(e));return()=>clearTimeout(t)}},[w]),L.useEffect(()=>{k(`tengu_trust_dialog_shown`,{isHomeDir:I()===b(),hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:g,hasDangerousEnvVars:_})},[o,s,S,u,p,h,g,_]);function O(t){if(t===`exit`){T(1);return}let n=I()===b();k(`tengu_trust_dialog_accept`,{isHomeDir:n,hasMcpServers:o,hasHooks:s,hasBashExecution:S,hasApiKeyHelper:u,hasAwsCommands:p,hasGcpCommands:h,hasOtelHeadersHelper:g,hasDangerousEnvVars:_}),n?c(!0):D(e=>({...e,hasTrustDialogAccepted:!0})),e()}let A=M(()=>T(1));return r(`confirm:no`,()=>{T(0)},{context:`Confirmation`}),w===null?C?(setTimeout(e),null):(0,R.jsx)(F,{color:`warning`,titleColor:`warning`,title:`Accessing workspace:`,children:(0,R.jsxs)(t,{flexDirection:`column`,gap:1,paddingTop:1,children:[(0,R.jsx)(n,{bold:!0,children:x().cwd()}),(0,R.jsx)(n,{children:`Is this a project you trust? (Your own code, a well-known open source project, or work from your team).`}),(0,R.jsx)(n,{children:`Once trusted, Work Mate can read, edit, and run commands in this folder.`}),(0,R.jsx)(f,{options:[{label:`Yes, I trust this folder`,value:`enable_all`},{label:`No, exit`,value:`exit`}],onChange:e=>O(e),onCancel:()=>O(`exit`)}),(0,R.jsx)(n,{dimColor:!0,children:A.pending?(0,R.jsxs)(R.Fragment,{children:[`Press `,A.keyName,` again to exit`]}):(0,R.jsx)(R.Fragment,{children:`Enter to confirm · Esc to cancel`})})]})}):null}export{$ as TrustDialog};
@@ -1 +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-DfWP5y6X.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.3`,` `]})]}),(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.3`,` `]})]}),(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.3`,` `]})]}),(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.3`,` `]})]}),(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
+ 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-DfWP5y6X.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.4`,` `]})]}),(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.4`,` `]})]}),(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.4`,` `]})]}),(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.4`,` `]})]}),(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-ix0xIunV.js";import{L as m,R as h,Tw as g,_D as _,bD as v,bw as y,nx as b,rx as x,ww as S,z as C}from"./loadAgentsDir-DrDu5yYy.js";import{n as w,t as T}from"./AddWorkspaceDirectory-mANiG0xj.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)(b,{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=y(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),_.refreshConfig();let s;if(r)try{g(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=m(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(),x(),w(),c(),S(),v(),h(),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{L as m,R as h,Tw as g,_D as _,bD as v,bw as y,nx as b,rx as x,ww as S,z as C}from"./loadAgentsDir-BURvZNN6.js";import{n as w,t as T}from"./AddWorkspaceDirectory-BTC7FPqM.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)(b,{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=y(t.getAppState().toolPermissionContext,i);t.setAppState(e=>({...e,toolPermissionContext:a}));let o=f();o.includes(n)||p([...o,n]),_.refreshConfig();let s;if(r)try{g(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=m(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(),x(),w(),c(),S(),v(),h(),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-DrDu5yYy.js";import{dn as r,un as i}from"./settings-DfWP5y6X.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-BURvZNN6.js";import{dn as r,un as i}from"./settings-DfWP5y6X.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,AE as y,Af as b,Ah as x,Bc as S,Bh as ee,Cf as C,Ef as te,Ex as w,Gg as ne,HD as re,Hd as ie,Hn as ae,Hw as oe,JS as se,Jo as ce,Kd as le,Lb as ue,M_ as de,Mf as fe,N_ as pe,Nf as me,Oh as he,Qd as ge,Rx as _e,So as ve,Tf as ye,Tx as T,Ud as be,Uh as xe,Un as Se,Uw as Ce,VD as we,Vc as Te,Vh as Ee,Wg as De,Wn as Oe,XS as ke,Xd as Ae,Xu as je,YT as Me,Yu as Ne,Zd as Pe,_u as Fe,_x as Ie,at as Le,bC as Re,bf as ze,c as Be,ef as Ve,et as He,hv as Ue,jE as We,jf as Ge,kh as Ke,l as qe,lh as Je,mv as Ye,nt as Xe,o as Ze,of as Qe,qS as $e,qd as et,r as tt,s as nt,sf as rt,sh as it,st as at,t as ot,vu as st,vx as ct,wf as lt,xC as ut,yf as dt,zb as ft,zo as pt,zx as mt}from"./loadAgentsDir-DrDu5yYy.js";import{n as ht,t as gt}from"./cwd-CYmmnQVS.js";import{C as _t,G as vt,I as yt,Q as bt,S as xt,W as St,z as Ct}from"./debug-BrXObCdR.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-DfWP5y6X.js";import{I as Pt,P as Ft}from"./config-DiT2Z8dY.js";import{o as It,s as Lt}from"./log-BMCygSzM.js";import{n as Rt,r as zt}from"./analytics-BotDBGh0.js";import{T as Bt,b as Vt}from"./startupProfiler-xa3NmN7Z.js";import{l as Ht,n as Ut,o as Wt}from"./stringUtils-DGLPkqJ4.js";import{Tn as Gt,wn as Kt}from"./prompt-C0nU0VK3.js";import{st as qt}from"./rcDebugLog-2-1XSyFV.js";import{u as E}from"./referral-DrebVwqx.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-Cju-aXCx.js";import{n as nn,t as rn}from"./useExitOnCtrlCDWithKeybindings-CzFtdlnD.js";import{n as an,t as on}from"./useMergedTools-DMGRA1ga.js";import{n as sn,r as cn,t as ln}from"./promptEditor-Cumef6hJ.js";import{n as un,t as dn}from"./useMainLoopModel-DegH12LZ.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,AE as y,Af as b,Ah as x,Bc as S,Bh as ee,Cf as C,Ef as te,Ex as w,Gg as ne,HD as re,Hd as ie,Hn as ae,Hw as oe,JS as se,Jo as ce,Kd as le,Lb as ue,M_ as de,Mf as fe,N_ as pe,Nf as me,Oh as he,Qd as ge,Rx as _e,So as ve,Tf as ye,Tx as T,Ud as be,Uh as xe,Un as Se,Uw as Ce,VD as we,Vc as Te,Vh as Ee,Wg as De,Wn as Oe,XS as ke,Xd as Ae,Xu as je,YT as Me,Yu as Ne,Zd as Pe,_u as Fe,_x as Ie,at as Le,bC as Re,bf as ze,c as Be,ef as Ve,et as He,hv as Ue,jE as We,jf as Ge,kh as Ke,l as qe,lh as Je,mv as Ye,nt as Xe,o as Ze,of as Qe,qS as $e,qd as et,r as tt,s as nt,sf as rt,sh as it,st as at,t as ot,vu as st,vx as ct,wf as lt,xC as ut,yf as dt,zb as ft,zo as pt,zx as mt}from"./loadAgentsDir-BURvZNN6.js";import{n as ht,t as gt}from"./cwd-CYmmnQVS.js";import{C as _t,G as vt,I as yt,Q as bt,S as xt,W as St,z as Ct}from"./debug-BrXObCdR.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-DfWP5y6X.js";import{I as Pt,P as Ft}from"./config-DiT2Z8dY.js";import{o as It,s as Lt}from"./log-BMCygSzM.js";import{n as Rt,r as zt}from"./analytics-BotDBGh0.js";import{T as Bt,b as Vt}from"./startupProfiler-xa3NmN7Z.js";import{l as Ht,n as Ut,o as Wt}from"./stringUtils-DGLPkqJ4.js";import{Tn as Gt,wn as Kt}from"./prompt-DNDgGM9q.js";import{st as qt}from"./rcDebugLog-DoL1FpGJ.js";import{u as E}from"./referral-UKJv23_5.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-BuiwcrQi.js";import{n as nn,t as rn}from"./useExitOnCtrlCDWithKeybindings-CV4GZ-sq.js";import{n as an,t as on}from"./useMergedTools-CRLWSGDl.js";import{n as sn,r as cn,t as ln}from"./promptEditor-DMJyosKj.js";import{n as un,t as dn}from"./useMainLoopModel-CO4yBjRM.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-DrDu5yYy.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-Cju-aXCx.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-BURvZNN6.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-BuiwcrQi.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-DrDu5yYy.js";import{g as r,u as i}from"./settings-DfWP5y6X.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-BURvZNN6.js";import{g as r,u as i}from"./settings-DfWP5y6X.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{DC as e,IC as t,MC as n,PC as r,jC as i,kC as a}from"./loadAgentsDir-DrDu5yYy.js";import{s as o,u as s}from"./logoV2Utils-CoC4nheD.js";n(),s();var c=`default`;async function l(t,n){let r=await e(n.list||c,{subject:t,description:n.description||``,status:`pending`,blocks:[],blockedBy:[]});console.log(`Created task ${r}: ${t}`)}async function u(e){let t=await r(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(e,t){let n=await a(t.list||c,e);if(!n){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(n,null,2))}async function f(e,n){let r=n.list||c,i={};n.status&&(i.status=n.status),n.subject&&(i.subject=n.subject),n.description&&(i.description=n.description),n.owner&&(i.owner=n.owner),n.clearOwner&&(i.owner=void 0);let a=await t(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(i(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-c4aiyZ_f.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{DC as e,IC as t,MC as n,PC as r,jC as i,kC as a}from"./loadAgentsDir-BURvZNN6.js";import{s as o,u as s}from"./logoV2Utils-DN9nzdX-.js";n(),s();var c=`default`;async function l(t,n){let r=await e(n.list||c,{subject:t,description:n.description||``,status:`pending`,blocks:[],blockedBy:[]});console.log(`Created task ${r}: ${t}`)}async function u(e){let t=await r(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(e,t){let n=await a(t.list||c,e);if(!n){console.error(`Task not found: ${e}`),process.exitCode=1;return}console.log(JSON.stringify(n,null,2))}async function f(e,n){let r=n.list||c,i={};n.status&&(i.status=n.status),n.subject&&(i.subject=n.subject),n.description&&(i.description=n.description),n.owner&&(i.owner=n.owner),n.clearOwner&&(i.owner=void 0);let a=await t(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(i(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-c4aiyZ_f.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 +1 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{i as r,n as i,r as a,t as o}from"./lazySchema-DcIJE_0i.js";import{F as s,S as c,W as l,a as u,l as d,w as f,z as p}from"./debug-BrXObCdR.js";import{c as m,g as h}from"./config-DiT2Z8dY.js";import{o as g,s as _}from"./log-BMCygSzM.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-fi472PRc.js";import{a as E,i as D}from"./detectRepository-BPr0VWNO.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 d(`Teleport request failed after ${i+1} attempts: ${s(e)}`),e;let t=B[i]??2e3;d(`Teleport request failed (attempt ${i+1}/${V+1}), retrying in ${t}ms: ${s(e)}`),await T(t)}throw r}function j(e){return e===null||typeof e==`string`&&e.trim()===``}async function M(){let e=m(),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 _(l(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`,s={...F(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},c={events:[{uuid:r?.uuid??O(),session_id:e,type:`user`,parent_tool_use_id:null,message:{role:`user`,content:n}}]};d(`[sendEventToRemoteSession] Sending event to session ${e}`);let l=await t.post(o,c,{headers:s,validateStatus:e=>e<500,timeout:3e4});return l.status===200||l.status===201?(d(`[sendEventToRemoteSession] Successfully sent event to session ${e}`),!0):(d(`[sendEventToRemoteSession] Failed with status ${l.status}: ${f(l.data)}`),!1)}catch(e){return d(`[sendEventToRemoteSession] Error: ${s(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};d(`[updateSessionTitle] Updating title for session ${e}: "${n}"`);let s=await t.patch(a,{title:n},{headers:o,validateStatus:e=>e<500});return s.status===200?(d(`[updateSessionTitle] Successfully updated title for session ${e}`),!0):(d(`[updateSessionTitle] Failed with status ${s.status}: ${f(s.data)}`),!1)}catch(e){return d(`[updateSessionTitle] Error: ${s(e)}`),!1}}var B,V,H=e((()=>{n(),y(),x(),a(),S(),h(),u(),D(),p(),o(),g(),w(),c(),B=[2e3,4e3,8e3,16e3],V=B.length,i(()=>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};
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{n as t,t as n}from"./axios-DaWTGg7G.js";import{i as r,n as i,r as a,t as o}from"./lazySchema-DcIJE_0i.js";import{F as s,S as c,W as l,a as u,l as d,w as f,z as p}from"./debug-BrXObCdR.js";import{c as m,g as h}from"./config-DiT2Z8dY.js";import{o as g,s as _}from"./log-BMCygSzM.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-BIVmcl_N.js";import{a as E,i as D}from"./detectRepository-BPr0VWNO.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 d(`Teleport request failed after ${i+1} attempts: ${s(e)}`),e;let t=B[i]??2e3;d(`Teleport request failed (attempt ${i+1}/${V+1}), retrying in ${t}ms: ${s(e)}`),await T(t)}throw r}function j(e){return e===null||typeof e==`string`&&e.trim()===``}async function M(){let e=m(),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 _(l(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`,s={...F(i),"anthropic-beta":`ccr-byoc-2025-07-29`,"x-organization-uuid":a},c={events:[{uuid:r?.uuid??O(),session_id:e,type:`user`,parent_tool_use_id:null,message:{role:`user`,content:n}}]};d(`[sendEventToRemoteSession] Sending event to session ${e}`);let l=await t.post(o,c,{headers:s,validateStatus:e=>e<500,timeout:3e4});return l.status===200||l.status===201?(d(`[sendEventToRemoteSession] Successfully sent event to session ${e}`),!0):(d(`[sendEventToRemoteSession] Failed with status ${l.status}: ${f(l.data)}`),!1)}catch(e){return d(`[sendEventToRemoteSession] Error: ${s(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};d(`[updateSessionTitle] Updating title for session ${e}: "${n}"`);let s=await t.patch(a,{title:n},{headers:o,validateStatus:e=>e<500});return s.status===200?(d(`[updateSessionTitle] Successfully updated title for session ${e}`),!0):(d(`[updateSessionTitle] Failed with status ${s.status}: ${f(s.data)}`),!1)}catch(e){return d(`[updateSessionTitle] Error: ${s(e)}`),!1}}var B,V,H=e((()=>{n(),y(),x(),a(),S(),h(),u(),D(),p(),o(),g(),w(),c(),B=[2e3,4e3,8e3,16e3],V=B.length,i(()=>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-C-rOQY-l.js";n();export{t as fetchCodeSessionsFromSessionsAPI,e as getOAuthHeaders};